diff options
Diffstat (limited to 'prolog/problems/dcg/expr_3/en.py')
-rw-r--r-- | prolog/problems/dcg/expr_3/en.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prolog/problems/dcg/expr_3/en.py b/prolog/problems/dcg/expr_3/en.py index 298ebeb..f853ad2 100644 --- a/prolog/problems/dcg/expr_3/en.py +++ b/prolog/problems/dcg/expr_3/en.py @@ -7,8 +7,8 @@ description = '''\ <p>Write a DCG with the starting symbol <code>expr</code> for the language of arithmetic expressions consisting of numbers (without leading zeros), addition and multiplication. Subexpressions can be grouped using parentheses. The meaning of a word in this language is the numeric value of the represented arithmetic expression.</p> <p>Example words: <code>(1+2)*3</code>, <code>42*8*3</code>, <code>(2+1)*(3+4)</code>.</p> <pre> - ?- expr(N, ['(',2,'+',1,')','*','(',3,'+',4,')'], []). % (2+1)*(3+4) = 21 - N = 21. +?- expr(N, ['(',2,'+',1,')','*','(',3,'+',4,')'], []). % (2+1)*(3+4) = 21 + N = 21. </pre> ''' |