anatoliykmetyuk / free-acp

A rewriting-based process algebra engine
7 stars 3 forks source link

Special elements and properties #26

Open AndreVanDelft opened 7 years ago

AndreVanDelft commented 7 years ago

Special elements ..., break and break? are useful to have, but they mess up axioms and properties.

E.g.

property("Commutativity of +" ) = forAll { (x: Language, y: Language) => x + y <-> y + x }

This does not hold for x or y being such a special element.

property("Associativity of *") = forAll { (x: Language, y: Language, z: Language) => (x * y) * z <-> x * (y * z) }

This should not hold if x, y or z is .... Or maybe it should, and is the problem that we need an alternative for the parentheses (Call(...)?), as long as we are sticking to Scala syntax. BTW x*y*z should be yet another thing.

anatoliykmetyuk commented 7 years ago

Related to #28. Indeed, we need a way to explicitly say where we want to place the parentheses. I am very reluctant to introduce custom parsers as we did in SubScript, since the learning curve increases and the attractiveness for the users decreases as a result.

AndreVanDelft commented 7 years ago

We could propose to the Dotty team that their parse tree contains the parentheses, if it doesn't already do so. Then a macro could do the work for us, I think.