feat: implement Chapter 7

This commit is contained in:
Glen Whitney 2021-01-20 11:05:33 -08:00
parent 76456b2c21
commit 98bb2088e4
3 changed files with 55 additions and 0 deletions

15
trans/chap7.str Normal file
View file

@ -0,0 +1,15 @@
module chap7
imports libstrategolib signatures/-
rules
A : Or(False(), x) -> x
B : Or(Impl(True(),x), y) -> Or(x, Impl(True(), y))
strategies
BthenA = B; A
Btwice = B; B
maybeB-id-thenB = (B <+ id); B
maybeBtwice-idthenB = Btwice <+ (id; B)
repeatmaybeAB = repeat(A <+ B)

View file

@ -14,6 +14,7 @@ imports
prop-eval2
prop-desugar
chap6
chap7
rules // Debugging