Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let join l sep = match l with
- | [] -> ""
- | h :: t ->
- let s = List.fold_left (fun s e -> sprintf "%s%s%s" s sep e) "" t in
- sprintf "%s%s%s" h sep s
- let constraints g =
- let nodes = G.fold_vertex (fun r l -> r :: l) g [] in
- let nodes_constraints = List.map (fun (s,t) ->
- sprintf "%s >= %s" (pprint_term s) (pprint_term t)
- ) nodes in
- let nodes_constraints_strict = List.map (fun (s,t) ->
- sprintf "%s > %s" (pprint_term s) (pprint_term t)
- ) nodes in
- let nodes_conjuct = join nodes_constraints " /\\ " in
- let nodes_disjunct_strict = join nodes_constraints_strict " \\/ " in
- let nodes_disjunct_strict = sprintf "(%s)" nodes_disjunct_strict in
- let uts = RuleSet.elements (ut_composante nodes) in
- let uts_constraints = List.map (fun (s,t) ->
- sprintf "%s >= %s" (pprint_term s) (pprint_term t)
- ) uts in
- let uts_conjuct = join uts_constraints " /\\ " in
- join [nodes_conjuct; uts_conjuct; nodes_disjunct_strict] " /\\ "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement