Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Programming in sml

  1. Nov 16, 2004 #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!

    :uhh: :uhh: :uhh:
  2. jcsd
  3. Nov 18, 2004 #2
    read the slides

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook