Glen Whitney
ba130ecb0f
Also provides proper associativity on the operators, to avoid ambiguous parses. This completes all of the examples in the Spoofax Tutorial/Reference that use the propositional signature.
13 lines
441 B
Plaintext
13 lines
441 B
Plaintext
module prop-dnf5
|
|
imports libstrategolib prop-laws
|
|
|
|
rules
|
|
dnft5 : Not(x) -> <dnfred5> Not (<dnf5>x)
|
|
dnft5 : And(x, y) -> <dnfred5> And (<dnf5>x, <dnf5>y)
|
|
dnft5 : Or(x, y) -> Or (<dnf5>x, <dnf5>y)
|
|
dnft5 : Impl(x, y) -> <dnfred5> Impl(<dnf5>x, <dnf5>y)
|
|
dnft5 : Eq(x, y) -> <dnfred5> Eq (<dnf5>x, <dnf5>y)
|
|
strategies
|
|
dnf5 = try(dnft5)
|
|
dnfred5 = try(DN <+ (DefI <+ DefE <+ DMA <+ DMO <+ DAOL <+ DAOR); dnf5)
|