From 12224395ae556a5b06ce095dda62212134dbcb8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Tue, 22 Jun 2010 09:22:19 +0200 Subject: [PATCH] Fix printing --- compiler/heptagon/analysis/causal.ml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/compiler/heptagon/analysis/causal.ml b/compiler/heptagon/analysis/causal.ml index 1e5d108..a9fe32e 100644 --- a/compiler/heptagon/analysis/causal.ml +++ b/compiler/heptagon/analysis/causal.ml @@ -18,6 +18,7 @@ open Heptagon open Location open Graph open Format +open Pp_tools (* x = x + 1 is rejected because read(x) < write(x) is not causal *) (* build a dependency graph an checks for cycles *) @@ -54,15 +55,6 @@ and nc = | Aac of ac | Aempty -let rec print_list ff print sep l = - match l with - | [] -> () - | [x] -> print ff x - | x :: l -> - print ff x; - fprintf ff "%s@ " sep; - print_list ff print sep l - let output_ac ff ac = let rec print priority ff ac = fprintf ff "@["; @@ -78,12 +70,10 @@ let output_ac ff ac = else fprintf ff "%a || %a") (print 0) ac1 (print 0) ac2 | Atuple(acs) -> - fprintf ff "("; - print_list ff (print 1) ", " acs ; - fprintf ff ")" - | Awrite(m) -> fprintf ff "%s" (sourcename m) - | Aread(m) -> fprintf ff "^%s" (sourcename m) - | Alastread(m) -> fprintf ff "last %s" (sourcename m) + print_list_r (print 1) "(" "," ")" ff acs + | Awrite(m) -> fprintf ff "%s" (name m) + | Aread(m) -> fprintf ff "^%s" (name m) + | Alastread(m) -> fprintf ff "last %s" (name m) end; fprintf ff "@]" in fprintf ff "@[%a@]@?" (print 0) ac