TODO 3.8 KB

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