I have a task of calculating the height of a logical expression (like a∧(b∨c)). I have an algorithm, however there is a mistake that causes 2 errors
this function application is partial
This expression has type int * int -> int * int but an expression was expected of type int I have no clue what I'm doing wrong? Below is the code snippet:
let height f g = let rec aux acc = function | Bot -> acc+1 | Top -> acc+1 | Atome x -> acc+1 | Imp(f, g) -> max(aux(acc+1)f, aux(acc+1)g) | And(f, g) -> max(aux(acc+1)f, aux(acc+1)g) | Or(f, g) -> max(aux(acc+1)f, aux(acc+1)g) in acc 0;;
Thank's a lot in advance.