TODO 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # vim: set fileencoding=utf-8 :
  2. - Fix BisonSyntaxError location tracking.
  3. - Sort polynom by its exponents?
  4. - MESSAGES needs to be expanded.
  5. - Fix division by zero caused by "0/0": Catch exception in front-end
  6. smvv@multivac ~/work/trs $ printf "a/0\n??" | ./main.py
  7. Traceback (most recent call last):
  8. File "./main.py", line 75, in <module>
  9. main()
  10. File "./main.py", line 64, in main
  11. node = p.run(debug=args.debug)
  12. File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 258, in run
  13. self.report_last_error(filename, e)
  14. File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 251, in run
  15. self.engine.runEngine(debug)
  16. File "bison_.pyx", line 592, in bison_.ParserEngine.runEngine (build/external/pybison/bison_.c:592)
  17. File "/home/smvv/work/trs/src/parser.py", line 195, in hook_handler
  18. possibilities = handler(retval)
  19. File "/home/smvv/work/trs/src/rules/fractions.py", line 23, in match_constant_division
  20. raise ZeroDivisionError('Division by zero: %s.' % node)
  21. ZeroDivisionError: Division by zero: a / 0.
  22. smvv@multivac ~/work/trs $ printf "0/0\n??" | ./main.py
  23. Traceback (most recent call last):
  24. File "./main.py", line 75, in <module>
  25. main()
  26. File "./main.py", line 64, in main
  27. node = p.run(debug=args.debug)
  28. File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 258, in run
  29. self.report_last_error(filename, e)
  30. File "/home/smvv/work/trs/external/pybison/src/python/bison.py", line 251, in run
  31. self.engine.runEngine(debug)
  32. File "bison_.pyx", line 592, in bison_.ParserEngine.runEngine (build/external/pybison/bison_.c:592)
  33. File "/home/smvv/work/trs/src/parser.py", line 195, in hook_handler
  34. possibilities = handler(retval)
  35. File "/home/smvv/work/trs/src/rules/numerics.py", line 73, in match_divide_numerics
  36. divide = not divmod(n.value, dv)[1]
  37. ZeroDivisionError: integer division or modulo by zero
  38. - Last possibilities reduce to a similar result.
  39. smvv@multivac ~/work/trs $ printf "0/1\n??" | ./main.py
  40. <Possibility root="0 / 1" handler=divide_numerics args=(0, 1)>
  41. Division of 0 by 1 reduces to 0.
  42. Division of 0 by 1 reduces to 0.
  43. - Fractions constant rewrite rules.
  44. - >>> (sin x) ^ 2 + (cos x) ^ 2
  45. sin(x) ^ 2 + cos(x) ^ 2
  46. >>> sin(x) ^ 2 + cos(x) ^ 2
  47. sin(x ^ 2) + cos(x ^ 2)
  48. - ExpressionNode.equals() werkend maken voor alle cases (negatie).
  49. - validation: preorder traversal implementatie vergelijken met andere
  50. implementaties.
  51. - Fix the following loop using strategy (reduce_fraction_constants):
  52. >>> 2 / 7 - 4 / 11
  53. 2 / 7 - 4 / 11
  54. >>> @
  55. 22 / 77 - 28 / 77
  56. >>> @
  57. 2 / 7 - 28 / 77
  58. >>> @
  59. 2 / 7 + 4 / 11
  60. - Cancel terms before multiplying constants: (3 * ...) / (3 * ...) -> ... / ...
  61. >>> (7/3)*(3/5)
  62. 7 / 3 * (3 / 5)
  63. >>> ??
  64. Expand fraction with nominator greater than denominator 7 / 3 to an integer
  65. plus a fraction.
  66. Multiply fractions 7 / 3 and 3 / 5.
  67. >>> @
  68. 7 * 3 / (3 * 5)
  69. >>> ?
  70. Multiply constant 7 with 3.
  71. >>> @
  72. 21 / (3 * 5)
  73. >>> @
  74. 21 / 15
  75. >>> @
  76. 7 / 5
  77. - filter_duplicates does not seem to work anymore...
  78. - Fix error while parsing unicode PI:
  79. >>> sin(1/2 * pi)
  80. sin(1 / 2 * π)
  81. >>> @
  82. unknown char � ignored.
  83. unknown char � ignored.
  84. ERROR: 41.7-41.8: "syntax error, unexpected TIMES" near "*".
  85. ERROR: 41.14-41.15: "syntax error, unexpected RPAREN" near ")".
  86. - No matches for sin(pi), sin(2pi), sin(4pi), etc...
  87. - Line generator: 'der(f(x), x)' -> 'd/dx f(x)'
  88. - Create unit tests for parser preprocessor.
  89. - Create unit tests for node inequivalece operator.