Versions Compared

Key

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

...

  • a boolean constant true or false;
  • a symbol S;
  • (list 'not X) where X is a bool-SchemeExp ;
  • (list op X Y) where op is 'and , 'or , or 'implies where X and Y are {{bool-SchemeExp}}sSchemeExps;
  • (list 'if X Y Z) where X, Y, and Z are {{bool-SchemeExp}}sSchemeExps.

The provided functions parse and unparse have the following signatures.

...

We suggest simply traversing the tree using the structural recursion template for type boolExp and converting all structures (other than if}}s) to the corresponding {{if structures.

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.

...