summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-06-17 14:34:40 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-06-17 14:34:40 +0200
commitd57e3491720e912b4e2fd6c73f9d356901a42df5 (patch)
treebc0feb8577b162e3e735fa57c7b4b0d82be808ce /libs
parent860ad2752ef0544bc6874d895875a78f91db9084 (diff)
downloadscade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.tar.gz
scade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.zip
Write transformation of program into logical formula.
Diffstat (limited to 'libs')
-rw-r--r--libs/util.ml8
1 files changed, 8 insertions, 0 deletions
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)
+