spoofax_prop/trans/prop-dnf5.str
Glen Whitney ba130ecb0f feat: Implement Chapter9
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.
2021-01-22 09:29:57 -08:00

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)