- #1
Monsu
- 38
- 1
hi, pleaaaaaaaaaase! i need help urgently! I am completely stuck! I have no idea what to do on this question, it reads thus:
Given the following datatypes for boolean formulae and the truth values
datatype boolexp = bez | beo (*0 and 1*)
| bep of boolexp * boolexp (*plus*)
| bet of boolexp * boolexp (*times*)
| bec of boolexp (*complement*)
| bev of int (*variables*)
datatype mybool = mytrue | myfalse
write a cascading evaluation function eval : (int -> mybool) -> boolexp -> mybool
that takes an assignment $ and a boolean formula & and returns I$(&) as a value .
write a simplified version of the function evalbib : (int -> bool) -> boolexp -> bool. (without using "if" constructs)
I'm clueless as to how to begin this, and I am a novice in all languages, any acclaration and explanations will be highly appreciated, thanks in advance!
Given the following datatypes for boolean formulae and the truth values
datatype boolexp = bez | beo (*0 and 1*)
| bep of boolexp * boolexp (*plus*)
| bet of boolexp * boolexp (*times*)
| bec of boolexp (*complement*)
| bev of int (*variables*)
datatype mybool = mytrue | myfalse
write a cascading evaluation function eval : (int -> mybool) -> boolexp -> mybool
that takes an assignment $ and a boolean formula & and returns I$(&) as a value .
write a simplified version of the function evalbib : (int -> bool) -> boolexp -> bool. (without using "if" constructs)
I'm clueless as to how to begin this, and I am a novice in all languages, any acclaration and explanations will be highly appreciated, thanks in advance!