| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- # vim: set fileencoding=utf-8 :
- - Fix BisonSyntaxError location tracking.
- - Sort polynom by its exponents?
- - MESSAGES needs to be expanded.
- - Fix division by zero caused by "0/0": Catch exception in front-end
- smvv@multivac ~/work/trs $ printf "a/0\n??" | ./main.py
- Traceback (most recent call last):
- File "./main.py", line 75, in <module>
- main()
- File "./main.py", line 64, in main
- node = p.run(debug=args.debug)
- File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 258, in run
- self.report_last_error(filename, e)
- File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 251, in run
- self.engine.runEngine(debug)
- File "bison_.pyx", line 592, in bison_.ParserEngine.runEngine (build/external/pybison/bison_.c:592)
- File "/home/smvv/work/trs/src/parser.py", line 195, in hook_handler
- possibilities = handler(retval)
- File "/home/smvv/work/trs/src/rules/fractions.py", line 23, in match_constant_division
- raise ZeroDivisionError('Division by zero: %s.' % node)
- ZeroDivisionError: Division by zero: a / 0.
- smvv@multivac ~/work/trs $ printf "0/0\n??" | ./main.py
- Traceback (most recent call last):
- File "./main.py", line 75, in <module>
- main()
- File "./main.py", line 64, in main
- node = p.run(debug=args.debug)
- File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 258, in run
- self.report_last_error(filename, e)
- File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 251, in run
- self.engine.runEngine(debug)
- File "bison_.pyx", line 592, in bison_.ParserEngine.runEngine (build/external/pybison/bison_.c:592)
- File "/home/smvv/work/trs/src/parser.py", line 195, in hook_handler
- possibilities = handler(retval)
- File "/home/smvv/work/trs/src/rules/numerics.py", line 73, in match_divide_numerics
- divide = not divmod(n.value, dv)[1]
- ZeroDivisionError: integer division or modulo by zero
- - Last possibilities reduce to a similar result.
- smvv@multivac ~/work/trs $ printf "0/1\n??" | ./main.py
- <Possibility root="0 / 1" handler=divide_numerics args=(0, 1)>
- Division of 0 by 1 reduces to 0.
- Division of 0 by 1 reduces to 0.
- - Fractions constant rewrite rules.
- - >>> (sin x) ^ 2 + (cos x) ^ 2
- sin(x) ^ 2 + cos(x) ^ 2
- >>> sin(x) ^ 2 + cos(x) ^ 2
- sin(x ^ 2) + cos(x ^ 2)
- - ExpressionNode.equals() werkend maken voor alle cases (negatie).
- - validation: preorder traversal implementatie vergelijken met andere
- implementaties.
- - Fix the following loop using strategy (reduce_fraction_constants):
- >>> 2 / 7 - 4 / 11
- 2 / 7 - 4 / 11
- >>> @
- 22 / 77 - 28 / 77
- >>> @
- 2 / 7 - 28 / 77
- >>> @
- 2 / 7 + 4 / 11
- - Cancel terms before multiplying constants: (3 * ...) / (3 * ...) -> ... / ...
- >>> (7/3)*(3/5)
- 7 / 3 * (3 / 5)
- >>> ??
- Expand fraction with nominator greater than denominator 7 / 3 to an integer
- plus a fraction.
- Multiply fractions 7 / 3 and 3 / 5.
- >>> @
- 7 * 3 / (3 * 5)
- >>> ?
- Multiply constant 7 with 3.
- >>> @
- 21 / (3 * 5)
- >>> @
- 21 / 15
- >>> @
- 7 / 5
- - filter_duplicates does not seem to work anymore...
- - Fix error while parsing unicode PI:
- >>> sin(1/2 * pi)
- sin(1 / 2 * π)
- >>> @
- unknown char � ignored.
- unknown char � ignored.
- ERROR: 41.7-41.8: "syntax error, unexpected TIMES" near "*".
- ERROR: 41.14-41.15: "syntax error, unexpected RPAREN" near ")".
- - No matches for sin(pi), sin(2pi), sin(4pi), etc...
- - Line generator: 'der(f(x), x)' -> 'd/dx f(x)'
- - Create unit tests for parser preprocessor.
- - Create unit tests for node inequivalece operator.
- - Line printer: 1 / (n + n)x -> 1 / (n + n) * x
- - Parser: 'apia' -> 'aa'
|