- let txt_refpath i r p = txt_inv i; txt_ref r; txt_path out p; out " " in
- let txt_assign (pl, pr) = txt_vvar out (fst pl); out " <- "; txt_path out pr in
- let rec txt_val = function
- | M.Const [s] -> txt_str out s
- | M.Const l -> out "{"; txt_list out (txt_str out) ", " l; out "}"
- | M.VVar vv -> txt_vvar out vv
- | M.Record (rv, p) -> txt_rvar out rv; out "."; txt_vvar out (fst p)
- | M.Fun (s, x) -> out "fun "; txt_str out s; out " "; txt_val x
- | M.Property (i, r, p, x) -> out "property "; txt_refpath i r p; txt_val x
- | M.RefOf x -> out "refof "; txt_set x
- and txt_boole = function
- | M.False -> out "false"
- | M.True -> out "true"
- | M.Ex b x -> out "ex "; txt_boole x
-(* | M.Ex b x -> "ex [" ^ txt_list txt_rvar "," b ^ "] " ^ txt_boole x
-*) | M.Not x -> out "not "; txt_boole x
- | M.And (x, y) -> out "("; txt_boole x; out " and "; txt_boole y; out ")"
- | M.Or (x, y) -> out "("; txt_boole x; out " or "; txt_boole y; out ")"
- | M.Sub (x, y) -> out "("; txt_val x; out " sub "; txt_val y; out ")"
- | M.Meet (x, y) -> out "("; txt_val x; out " meet "; txt_val y; out ")"
- | M.Eq (x, y) -> out "("; txt_val x; out " eq "; txt_val y; out ")"
+ let txt_qualif i r p = txt_inv i; txt_ref r; txt_path out p in
+ let main = function
+ | [] -> ()
+ | p -> out " main "; txt_path out p
+ in
+ let txt_exp = function
+ | (pl, None) -> txt_path out pl
+ | (pl, Some pr) -> txt_path out pl; out " as "; txt_path out pr
+ in
+ let txt_exp_list = function
+ | [] -> ()
+ | l -> out " attr "; txt_list out txt_exp ", " l
+ in
+ let pattern b = if b then out "pattern " in
+ let txt_opt_path = function
+ | None -> ()
+ | Some p -> txt_path out p; out " "
+ in
+ let txt_distr d = if d then out "distr " in
+ let txt_bin = function
+ | M.BinFJoin -> out " union "
+ | M.BinFMeet -> out " intersect "
+ | M.BinFDiff -> out " diff "
+ in
+ let txt_gen = function
+ | M.GenFJoin -> out " sup "
+ | M.GenFMeet -> out " inf "
+ in
+ let txt_test = function
+ | M.Xor -> out " xor "
+ | M.Or -> out " or "
+ | M.And -> out " and "
+ | M.Sub -> out " sub "
+ | M.Meet -> out " meet "
+ | M.Eq -> out " eq "
+ | M.Le -> out " le "
+ | M.Lt -> out " lt "
+ in
+ let txt_log a b =
+ if a then out "xml ";
+ if b then out "source "
+ in
+ let txt_allbut b = if b then out "allbut " in
+ let rec txt_con (pat, p, x) =
+ txt_path out p;
+ if pat then out " match " else out " in ";
+ txt_val x
+ and txt_con_list s = function
+ | [] -> ()
+ | l -> out s; txt_list out txt_con ", " l
+ and txt_istrue lt = txt_con_list " istrue " lt
+ and txt_isfalse lf = txt_con_list " isfalse " lf
+ and txt_ass (p, x) = txt_val x; out " as "; txt_path out p
+ and txt_ass_list l = txt_list out txt_ass ", " l
+ and txt_assg_list g = txt_list out txt_ass_list "; " g
+ and txt_val_list = function
+ | [v] -> txt_val v
+ | l -> out "{"; txt_list out txt_val ", " l; out "}"
+ and txt_grp = function
+ | M.Attr g -> txt_assg_list g
+ | M.From av -> txt_avar av
+ and txt_val = function
+ | M.True -> out "true"
+ | M.False -> out "false"
+ | M.Const s -> txt_str out s
+ | M.Set l -> txt_val_list l
+ | M.VVar vv -> txt_vvar vv
+ | M.Dot av p -> txt_avar av; out "."; txt_path out p
+ | M.Proj op x -> out "proj "; txt_opt_path op; txt_set x
+ | M.Ex b x -> out "ex "; txt_val x
+(* | M.Ex b x -> out "ex ["; txt_list out txt_avar "," b; out "] "; txt_val x
+*) | M.Not x -> out "not "; txt_val x
+ | M.Test k x y -> out "("; txt_val x; txt_test k; txt_val y; out ")"
+ | M.StatVal x -> out "stat "; txt_val x
+ | M.Count x -> out "count "; txt_val x
+ | M.Align s x -> out "align "; txt_str out s; out " in "; txt_val x