diff options
author | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-17 14:34:40 +0200 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-17 14:34:40 +0200 |
commit | d57e3491720e912b4e2fd6c73f9d356901a42df5 (patch) | |
tree | bc0feb8577b162e3e735fa57c7b4b0d82be808ce /libs | |
parent | 860ad2752ef0544bc6874d895875a78f91db9084 (diff) | |
download | scade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.tar.gz scade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.zip |
Write transformation of program into logical formula.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/util.ml | 8 |
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) + |