BoolEx.hascasl revision bada0c99c6398c209ec9c6a9f5b316b7b5c99b33
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maeder%% Example for testing the translation from HasCASL to haskell.
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederfree type Bool ::= True | False
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederop neg : Bool -> Bool
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederprogram neg x = case x of False -> True | True -> False
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederop wedge : Bool * Bool -> Bool
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederprogram wedge (x,y) = case (x,y) of (False, False) -> False
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maeder | (True, False) -> False
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maeder | (False, True) -> False
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maeder | (True, True) -> True
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederop vee : Bool * Bool -> Bool
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederprogram vee (x,y) = neg (wedge ((neg (x)), (neg (y))))
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederop le : Bool * Bool -> Bool
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederprogram le (x,y) = vee ((neg (x)), y)
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederop eq : Bool * Bool -> Bool
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederprogram eq (x,y) = wedge ((le (x,y)), (le (y,x)))
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederop ne : Bool * Bool -> Bool
bada0c99c6398c209ec9c6a9f5b316b7b5c99b33Christian Maederprogram ne (x,y) = wedge ( (vee(x,y)), (neg(wedge(x,y))) )