Original Slides: slides-01-lambda

EXERCISE: Boolean Operators

let NOT = \b     -> b FALSE TRUE
let NOT = \b     -> ITE b FALSE TRUE
let NOT = \b     -> (\x y -> b y x)
 
let OR  = \b1 b2 -> ITE b1 TRUE b2
let AND = \b1 b2 -> ITE b1 (ITE b2 TRUE FALSE) FALSE
        = \b1 b2 -> ITE b1 b2 FALSE
 

s.t.

eval ex_not_t:
  NOT TRUE =*> FALSE
  
  NOT (\x y -> x) =*> (\x y -> y)
  
  
eval ex_not_f:
  NOT FALSE =*> TRUE 
  
eval ex_or_ff:
  OR FALSE FALSE =*> FALSE
 
eval ex_or_ft:
  OR FALSE TRUE =*> TRUE
  
eval ex_or_ft:
  OR TRUE FALSE =*> TRUE
 
eval ex_or_tt:
  OR TRUE TRUE =*> TRUE
  
eval ex_and_ff:
  AND FALSE FALSE =*> FALSE
 
eval ex_and_ft:
  AND FALSE TRUE =*> FALSE
  
eval ex_and_ft:
  AND TRUE FALSE =*> FALSE
 
eval ex_and_tt:
  AND TRUE TRUE =*> TRUE