From fb697230cd326802b5ada205eecb470ee507bc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Wi=C3=9Fmann?= <uni@thorsten-wissmann.de> Date: Sun, 19 Jan 2014 15:37:26 +0100 Subject: [PATCH] Add TArray.to_string helper --- CoAlgLogicUtils.ml | 1 + CoAlgLogicUtils.mli | 1 + 2 files changed, 2 insertions(+) diff --git a/CoAlgLogicUtils.ml b/CoAlgLogicUtils.ml index 26b76fc..32c35cd 100644 --- a/CoAlgLogicUtils.ml +++ b/CoAlgLogicUtils.ml @@ -15,6 +15,7 @@ module TArray = struct let elem (x: 'a) (arr: 'a array) = any (fun y -> x == y) arr let included sub sup = all (fun x -> elem x sup) sub + let to_string ts arr = "[| " ^ (Array.fold_right (fun i str -> (ts i) ^" "^ str) arr "|]") end let disjointAgents sort a b = diff --git a/CoAlgLogicUtils.mli b/CoAlgLogicUtils.mli index 08a4207..867064d 100644 --- a/CoAlgLogicUtils.mli +++ b/CoAlgLogicUtils.mli @@ -11,6 +11,7 @@ module TArray : sig val any : ('a -> bool) -> 'a array -> bool val elem : 'a -> 'a array -> bool val included : 'a array -> 'a array -> bool + val to_string : ('a -> string) -> 'a array -> string end val disjointAgents : sort -> localFormula -> localFormula -> bool -- GitLab