test4.out: $(UTILS) lambda4.cmx test.ml
$(OCAMLC) -o test4.out $(LIB) $^
-simple.out: $(UTILS) simple.ml
- $(OCAMLC) -o simple.out $(LIB) $(UTILS) simple.ml
+simple.out: $(UTILS) simple.cmx
+ $(OCAMLC) -o simple.out $(LIB) $^
simple_test.out: $(UTILS) simple.cmx simple_test.ml
$(OCAMLC) -o simple_test.out $(LIB) $^
;;
let writeall s =
- let _ = Unix.send socket s 0 (String.length s) [] in ()
+ let _ = Unix.send socket (Bytes.of_string s) 0 (String.length s) [] in ()
;;
let concat ls = (String.concat sepx ls) ^ endx;;
let string_of_var l x =
try
List.nth l x
- with Failure "nth" -> "`" ^ string_of_int x
+ with Failure _ -> "`" ^ string_of_int x
;;
let string_of_term p t = print ~l:p.var_names (t :> nf);;
(* let rec string_of_term l = fun _ -> "";; *)
-let rec string_of_term =
+let string_of_term =
let boundvar x = "v" ^ string_of_int x in
let varname lev l n =
if n < lev then boundvar (lev-n-1)
and string_of_term_no_pars lev l = function
| `Lam _ as t -> string_of_term_no_pars_lam lev l t
| #nf as t -> string_of_term_no_pars_app lev l t
- in string_of_term_no_pars 0
+ and string_of_term t = string_of_term_no_pars 0 t in
+ string_of_term
;;
let print ?(l=[]) = string_of_term l;;
;;\r
\r
let implode l =\r
- let res = String.create (List.length l) in\r
+ let res = Bytes.create (List.length l) in\r
let rec aux i = function\r
| [] -> res\r
- | c :: l -> res.[i] <- c; aux (i + 1) l in\r
- aux 0 l\r
+ | c :: l -> Bytes.set res i c; aux (i + 1) l in\r
+ Bytes.to_string (aux 0 l)\r
;;\r
\r
let rec strip_spaces = function\r
(try
let e,t,s' = List.nth e n in
aux g (e,t,s'@s)
- with Invalid_argument "List.nth" | Failure _ -> m
+ with Invalid_argument _ | Failure _ -> m
)
| (e, B, _) -> (e, B, [])
| (e, L t, []) ->
sanity p\r
;;\r
\r
-;;\r
-\r
-\r
let rec auto p =\r
let hd_var, n_args = get_inert p.div in\r
match get_subterm_with_head_and_args hd_var n_args p.conv with\r