-- valid function to decide if the application of 
-- an operation to two positive natural numbers
-- gives another positive natural number.

{-

-- valid basic definition:

valid :: Op -> Int -> Int -> Bool
valid Add x y = True
valid Sub x y = x > y
valid Mul x y = True
valid Div x y = x `mod` y == 0

-}

-- valid defintion which exploits algebraic properties:
valid :: Op -> Int -> Int -> Bool
valid Add x y = x <= y
valid :: Op -> Int -> Int -> Bool
valid Add x y = x <= y
valid Add x y = x <= y