type ('a) list = Cons of 'a * ('a) list | Nil ;; let rec MEM v3 = (fun v4 -> (match v4 with Nil -> false | (Cons (v2, v1)) -> ((v3 = v2) || ((MEM v3) v1)))) ;; type ('a) regexp = Repeat of ('a) regexp | Then of ('a) regexp * ('a) regexp | Or of ('a) regexp * ('a) regexp | Charset of ('a) list | Epsilon ;; type ('a) option = Some of 'a | None ;; let rec match v13 = (fun v14 -> (fun v15 -> (match v13 with Nil -> (match v14 with Nil -> true | (Cons (v2, v1)) -> false) | (Cons (v12, v11)) -> (match v12 with Epsilon -> (((match v11) v14) v15) | (Charset (v5)) -> (match v14 with Nil -> false | (Cons (v4, v3)) -> (((MEM v4) v5) && (((match v11) v3) None))) | (Or (v7, v6)) -> ((((match (Cons (v7, v11))) v14) v15) || (((match (Cons (v6, v11))) v14) v15)) | (Then (v9, v8)) -> (((match (Cons (v9, (Cons (v8, v11))))) v14) v15) | (Repeat (v10)) -> (if (v15 = (Some ((Cons ((Repeat (v10)), v11))))) then false else ((((match v11) v14) v15) || (((match (Cons (v10, (Cons ((Repeat (v10)), v11))))) v14) (Some ((Cons ((Repeat (v10)), v11))))))))))) ;;