19 lines
542 B
Plaintext
19 lines
542 B
Plaintext
module sec9_1
|
|
imports libstrategolib signatures/- prop-laws prop-desugar
|
|
|
|
strategies
|
|
conj(s) = And(conj(s), conj(s)) <+ s
|
|
disj(s) = Or (disj(s), disj(s)) <+ s
|
|
|
|
// Conjunctive normal form
|
|
conj-nf = conj(disj(Not(Atom(id)) <+ Atom(id)))
|
|
|
|
// Disjunctive normal form
|
|
disj-nf = disj(conj(Not(Atom(id)) <+ Atom(id)))
|
|
|
|
// Second exercise, Section 9.1.2
|
|
path-dep-xform = DN <+ IDefI
|
|
inner-soln = repeat(oncebu(path-dep-xform))
|
|
outer-soln = repeat(oncetd(path-dep-xform))
|
|
random-soln = repeat(rec x(one(x) + path-dep-xform))
|