booleans.nbt 403 B

12345678910111213141516
  1. fn not(a: Bool) = if a then false else true
  2. fn and(a: Bool, b: Bool) = if a then b else false
  3. fn or(a: Bool, b: Bool) = if a then true else b
  4. assert(not(false))
  5. assert(not(not(true)))
  6. assert(and(true, true))
  7. assert(not(and(true, false)))
  8. assert(not(and(false, true)))
  9. assert(not(and(false, false)))
  10. assert(or(true, true))
  11. assert(or(true, false))
  12. assert(or(false, true))
  13. assert(not(or(false, false)))