Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 and false;
  • a symbol s representing a boolean variable;
  • (make-Not M) where M is a boolExp;
  • (make-And M N) where M and N are boolExps;
  • (make-Or M N) where M and N are boolExps;
  • (make-Implies M N) where M and N are boolExps; or
  • (make-If M N P) where M, N, and P are boolExps.

The provided function parse: input -> boolExp takes a Scheme expression and returns the corresponding boolExp.

...