summaryrefslogtreecommitdiff
path: root/prolog/problems/dcg/expr_2/common.py
blob: 0bfcb0b65f8596c875af671d7b97de0d0f1da714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
id = 170
number = 90
visible = False
facts = None

solution = '''\
expr --> term170, addterm170.
addterm170 --> [].
addterm170 --> [+], expr.
term170 --> factor170, multfactor170.
multfactor170 --> [].
multfactor170 --> [*], term170.
factor170 --> num170.
factor170 --> ['('], expr, [')'].

num170 --> digit170.
num170 --> nzdigit170, num_next170.
num_next170 --> digit170.
num_next170 --> digit170, num_next170.
digit170 --> ([0] ; [1] ; [2] ; [3] ; [4] ; [5] ; [6] ; [7] ; [8] ; [9]).
nzdigit170 --> ([1] ; [2] ; [3] ; [4] ; [5] ; [6] ; [7] ; [8] ; [9]).
'''