From d57e3491720e912b4e2fd6c73f9d356901a42df5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 17 Jun 2014 14:34:40 +0200 Subject: Write transformation of program into logical formula. --- libs/util.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs') diff --git a/libs/util.ml b/libs/util.ml index 494faac..97aa480 100644 --- a/libs/util.ml +++ b/libs/util.ml @@ -47,3 +47,11 @@ let uid = let c = ref 0 in fun () -> c := !c + 1; string_of_int !c +(* On lists *) + +(* list_fold_op : ('a -> 'a -> 'a) -> 'a list -> 'a *) +let rec list_fold_op op = function + | [] -> invalid_arg "list_fold_opt on empty list" + | [a] -> a + | x::q -> op x (list_fold_op op q) + -- cgit v1.2.3