...
Write an inductive data definition and template for boolean formulas in if
form, naming this type ifExp
. (Note: make-If
is the only constructor, other than variables and constants, for ifExp
.
A boolExp
is either:
- a boolean value
true
andfalse
; - a symbol
s
representing a boolean variable; (make-Not M)
whereM
is aboolExp
;(make-And M N)
whereM
andN
areboolExps
;(make-Or M N)
whereM
andN
areboolExps
;(make-Implies M N)
whereM
andN
areboolExps
; or(make-If M N P)
whereM
,N
, andP
areboolExps
.
The provided function parse: input -> boolExp
takes a Scheme expression and returns the corresponding boolExp
.
...