Commit Graph

405 Commits

Author SHA1 Message Date
Felix Raimundo
581dc7c82f Remove useless clone and memory leak.
Change-Id: I413cf23249db7a120fa198fdf538a64caa22497e
2016-04-18 18:48:56 +02:00
Felix Raimundo
c9e90299af Distributivity for addition rules.
Change-Id: I86eb9133e2a83e7bdefea9facaa84e475f480426
2016-04-18 18:48:56 +02:00
Felix Raimundo
07fdfacd5b Adds the equivalentTo test utility.
Change-Id: I1999a2e7434cc5919e628b906a13ec0edea04b8d
2016-04-18 18:48:56 +02:00
Felix Raimundo
b13fb99653 Add the equivalentTo to expression.
Change-Id: I773542d7434bb357976774f3cb746d41fdf74911
2016-04-18 18:48:56 +02:00
Felix Raimundo
47f361a667 Make the addition public.
Change-Id: I9b277f0a959f36453215de7dbb98b8f8dad69544
2016-04-18 18:48:56 +02:00
Félix Raimundo
e8149909ca Merge changes I090f8bd1,I5e91414e,I21150a58,I43c333d9,I8b55a228, ...
* changes:
  Fix the recursiveness of simplification.
  Add multiplication rules.
  Fix bad assert.
  make isIdenticalTo aware of commutativity.
  Add is_identical_to util in tests.
  Add assert in operand() for comuttaive operator.
  Fix bad assert in binary operation.
  Fix size allocation in expression selector.
  Add a test for the recursive simplification.
  Refactor the simplification tests.
2016-04-18 18:27:18 +02:00
Félix Raimundo
9d3a88e3ad Merge "Make the simplification recursive" 2016-04-18 18:26:01 +02:00
Romain Goyet
22c1194ba3 Merge "Add an Escher demo" 2016-04-18 18:18:36 +02:00
Romain Goyet
6da0bc8c00 Merge "Merge branch 'master' of ssh://git.numworks.com:2222/CalcOS" 2016-04-18 18:18:33 +02:00
Romain Goyet
196beceb4f Merge "Escher: Adding a GUI toolkit" 2016-04-18 18:18:23 +02:00
Romain Goyet
cc6dcbb9f2 Add an Escher demo
Replace app.o by escher_demo.o in the Makefile to give it a run

Change-Id: Id5e81220db149b2f43f55be81559ecd252a01991
2016-04-12 18:48:28 +02:00
Romain Goyet
9c60f0bfb9 Merge branch 'master' of ssh://git.numworks.com:2222/CalcOS
Change-Id: I5dca6556382400727625ff2e97cba8f382be3ca7
2016-04-12 18:48:02 +02:00
Romain Goyet
a21f201cc0 Escher: Adding a GUI toolkit
Change-Id: I9c78cc1afdd35968110484c3e3782c866b88c671
2016-04-12 18:47:36 +02:00
Felix Raimundo
4e7f8d81bf Fix the recursiveness of simplification.
Change-Id: I090f8bd14a85ff46d6cb9807e5a1204894a5c152
2016-04-11 16:50:08 +02:00
Felix Raimundo
3f8c05ad7e Add multiplication rules.
Change-Id: I5e91414e8c6ad45e0ff2d19fc7c5dc3914fa247a
2016-04-11 16:50:08 +02:00
Felix Raimundo
def625cca1 Fix bad assert.
Now the method cloneWithDifferentOperands can happen to integers.

Change-Id: I21150a58d137376ee74d25c1dec14efebf6d5605
2016-04-11 16:33:03 +02:00
Felix Raimundo
39d6f9b1d5 make isIdenticalTo aware of commutativity.
Change-Id: I43c333d9aef9fe10ad042c56996a157c04c0830a
2016-04-11 12:57:49 +02:00
Felix Raimundo
44ec987008 Add is_identical_to util in tests.
Change-Id: I8b55a228e1bd27e4c7b72891ff887bdc15b02fad
2016-04-11 12:47:24 +02:00
Felix Raimundo
5385f0a714 Add assert in operand() for comuttaive operator.
Change-Id: I677b87c3325084a82fbaae07ec4e51ea9a9cabdc
2016-04-11 12:37:24 +02:00
Felix Raimundo
f7f12f59b6 Fix bad assert in binary operation.
Change-Id: If3c26ea332a81ac07266d00b4639e287c85730bc
2016-04-11 12:37:24 +02:00
Felix Raimundo
94c17afc2c Fix size allocation in expression selector.
Change-Id: I86fd920b463c3f304346e7c1b013563986435a2e
2016-04-11 12:37:24 +02:00
Felix Raimundo
9d4c95eeea Add a test for the recursive simplification.
Note that this test will stop passing as soon as we add rules for simpficating
products of integer.

Change-Id: I4087bd92516e1dbe41da2dae77c2cdab8da5f8a5
2016-04-11 12:37:22 +02:00
Felix Raimundo
93914a21fc Refactor the simplification tests.
The assert_simpfilies_to is now a util function.

Change-Id: Iac164359e7f8136434860e10d9b414b17c6b6268
2016-04-11 12:26:06 +02:00
Felix Raimundo
782abe876f Make the simplification recursive
Change-Id: Ic4f99508358e158982901a7a3c7568d8502277c3
2016-04-11 12:26:05 +02:00
Felix Raimundo
2f7b1f4860 Add the cloneWithNewOperands method.
This allows to replace the operands of an expression with new ones.

Change-Id: I3c2d183bbdbcc43b776f7ce2a302216c52e494bd
2016-04-11 12:21:14 +02:00
Felix Raimundo
33226cc3a9 Dirty fix device build.
It seems that gcc generates instructions it cannot use which is weird.
The offending line was:
char input[255] = {0};

It was trying tp use __eabi_memclr for that which it did not have.

We need to find out why it generates instruction it cannot use (probably some
wrong flags somewhere).

Change-Id: I6a05280ce8876aa50e2cd6d5a112d18d266581c4
2016-04-08 18:23:18 +02:00
Felix Raimundo
ecab47b1e4 Fix bad assert.
Change-Id: Id9c6b9d100a978df8e25758d84f828ab31babe3d
2016-04-08 13:43:57 +02:00
Felix Raimundo
efb35e184a Plot auto zooms.
Change-Id: I8c15f4265e098ff05fcddf3226409491913ae8e0
2016-04-08 13:43:57 +02:00
Felix Raimundo
8025b5d77b Change comments style.
Change-Id: If25ab708d6ebb3ad8793a0635e05d345b26bc5b0
2016-04-08 13:43:55 +02:00
Félix Raimundo
a53231b513 Merge changes I6f080a4c,I676e8b80,I9d2ff286
* changes:
  Nicer plot
  Prototype of the history for user inputs.
  First part for adding history to the user input.
2016-04-07 18:49:30 +02:00
Romain Goyet
639d24940a Poincare: Remove in-class implementation
Since those have to be inline though, keep them in the header

Change-Id: I561abd3cdfd5acfa33099e2ccd36cf05d53a5bca
2016-04-07 18:15:09 +02:00
Romain Goyet
9141be784b Poincare: Simplify products
Change-Id: Ic1c558c9b210c1e7f4fcc859118cf18f73adab68
2016-04-07 18:08:57 +02:00
Romain Goyet
e9f28c4f45 Poincare: Fix tests
Change-Id: Ie5f08a35dae854a16a3286a3015e9942c612948b
2016-04-07 17:53:48 +02:00
Romain Goyet
0ac978468a Poincare: Pointer arithmetics doesn't play well with inheritance
Change-Id: I78cc57ca60bb703f00922f5257d53d6112a97f91
2016-04-07 17:31:05 +02:00
Felix Raimundo
f334977c6a Nicer plot
Change-Id: I6f080a4c26ad8ce574661228a4d4b53632d2f870
2016-04-07 16:53:39 +02:00
Romain Goyet
b849baf0d9 Poincare: ExpressionSelector is not a POD object anymore
Change-Id: Ie07c4b308d06e1726d6a9ba9dc54bafe8ab57655
2016-04-07 15:57:32 +02:00
Romain Goyet
07f749ff2a Poincare: Proper macro to enable expression debug
Change-Id: Ie1e880f5f80a5ce49424319a9af9d97bf10f2ef4
2016-04-07 15:51:16 +02:00
Romain Goyet
d2a010be70 Poincare: RuleGen now uses a more explicit grammar
Change-Id: I22ca00a7115d8c60fd0aa95ec17deec829e0a69d
Examples: Integer.a and Integer["0"]
2016-04-07 15:51:16 +02:00
Romain Goyet
1f64dfda9d Ignore the rulegen generated files
Change-Id: Icbbe984dedbedf7c4b74e496fbd43279cc49b7e0
2016-04-07 15:51:16 +02:00
Romain Goyet
e41150f56d Poincare: Removing dead code
Change-Id: I6d38a7f7be99e8b219f541673b6cb5815b9408d9
2016-04-07 15:51:16 +02:00
Romain Goyet
d9354ac1cc ExpressionBuilder now has both BuildFromType and BuildFromTypeAndValue
Change-Id: If4a25b9b4df4097b0b3b7e92cbd49e2ac764d075
2016-04-07 15:51:16 +02:00
Romain Goyet
91505631c7 Poincare: Simplification is not a POD object either but uses constexpr
Change-Id: If7b6a33720eddb41b5cdf016e131bde873474043
2016-04-07 15:51:16 +02:00
Romain Goyet
c870c28e61 Poincare: ExpressionBuilder and ExpressionSelector are not PODs anymore
This means we cannot initialize them by using C99-style static init.
C++11 to the rescue: we're using constexpr constructor to build them
statically, without any runtime cost.

This allows us to have private member variables, and a base class.

Change-Id: I0617d196e87f946b48375f42b600eb73e366d87d
2016-04-07 15:51:16 +02:00
Romain Goyet
acef4c079e Poincare: Add a ContiguousTree class
Note that this class is not being used yet.

Change-Id: Iaf58ab2e90f54df11ab81ed4ac62ab26b524b99d
2016-04-07 15:51:16 +02:00
Felix Raimundo
4e8ee1bf02 Prototype of the history for user inputs.
Change-Id: I676e8b80ec092891117827eda5213c6f1cfac733
2016-04-07 12:44:05 +02:00
Felix Raimundo
11a5550bfd Fix issue in a selector.
Change-Id: I8079ffd7aeb4117f0edec9c292cacb56adf20a7f
2016-04-07 12:44:05 +02:00
Felix Raimundo
23aef52622 First part for adding history to the user input.
Change-Id: I9d2ff28641f0d3b7fe382a765ad8cc084840c2ef
2016-04-07 12:44:05 +02:00
Felix Raimundo
7a7df647f3 Fix the printing of integers.
Because yes, multiples of 10 would not print...

Change-Id: Id58305086d499eb091ea5612fedcc5ec6f25c415
2016-04-07 12:44:05 +02:00
Felix Raimundo
5c96e04a6a Add tests for the simplification rules.
Change-Id: I086e18b2fcea5deb725872cf1254b6c2636a032a
2016-04-07 12:44:05 +02:00
Felix Raimundo
906363d4f6 Make simplifictaion able to deal with commutativity.
Change-Id: Ide620b0453ac54f0edbf2efa4c986f969392a701
2016-04-07 12:44:05 +02:00