(* problem 1*)
type btree = Empty | Node of int * btree * btree
let mirror : btree -> btree
= fun t -> (* TODO *)
(* problem 2*)
type nat = ZERO | SUCC of nat
let natadd : nat -> nat -> nat
= fun n1 n2 -> (* TODO *)
let natmul : nat -> nat -> nat
= fun n1 n2 -> (* TODO *)
let natexp : nat -> nat -> nat
= fun n1 n2 -> (* TODO *)
(* problem 3*)
type formula =
True
| False
| Var of string
| Neg of formula
| And of formula * formula
| Or of formula * formula
| Imply of formula * formula
| Iff of formula * formula
let sat : formula -> bool
= fun f -> (* TODO *)
(* problem 4*)
type aexp =
| Const of int
| Var of string
| Power of string * int
| Times of aexp list
| Sum of aexp list
let diff : aexp * string -> aexp
= fun (e,x) -> (* TODO *)
(* problem 5*)
type exp = X
| INT of int
| ADD of exp * exp
| SUB of exp * exp
| MUL of exp * exp
| DIV of exp * exp
| SIGMA of exp * exp * exp
let calculator : exp -> int
= fun e -> (* TODO *)
(* problem 6*)
type mobile = branch * branch (* left and rigth branches *)
and branch = SimpleBranch of length * weight
| CompoundBranch of length * mobile
and length = int
and weight = int
let balanced : mobile -> bool
= fun m -> (* TODO *)
(* problem 7*)
type digit = ZERO | ONE
type bin = digit list
let bmul : bin -> bin -> bin
= fun b1 b2 -> (* TODO *)