]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/pp.ml
Fixed nasty bug in maxvar updating
[helm.git] / helm / software / components / ng_paramodulation / pp.ml
index a125101bcf212563b6b6a08f7b8c0cb50a6884e9..537ad02c13e849e6044a1d7a4512f55da4b33d2f 100644 (file)
@@ -36,9 +36,8 @@ let pp_foterm ~formatter:f t =
 ;;
 
 let string_of_rule = function
-  | Terms.SuperpositionRight -> "SupR"
-  | Terms.SuperpositionLeft -> "SupL"
-  | Terms.Demodulation -> "Demod"
+  | Terms.Superposition -> "Super"
+  | Terms.Demodulation ->  "Demod"
 ;;
 
 let string_of_direction = function
@@ -48,12 +47,14 @@ let string_of_direction = function
 ;;
 
 let pp_substitution ~formatter:f subst =
-     (List.iter
-       (fun (i, t) ->
-          (Format.fprintf f "?%d -> " i;
-          pp_foterm f t)
-       )
-       subst)
+  Format.fprintf f "@[<v 2>";
+  List.iter
+    (fun (i, t) ->
+       (Format.fprintf f "?%d -> " i;
+       pp_foterm f t;
+       Format.fprintf f "@;"))
+    subst;
+  Format.fprintf f "@]";
 ;;
 
 let pp_proof bag ~formatter:f p =
@@ -87,18 +88,28 @@ let string_of_comparison = function
 
 let pp_unit_clause ~formatter:f c =
   let (id, l, vars, proof) = c in
-    Format.fprintf f "Id : %d, " id ;
+    Format.fprintf f "Id : %3d, " id ;
     match l with
       | Terms.Predicate t ->
-         pp_foterm f t
+         Format.fprintf f "@[<hv>{";
+         pp_foterm f t;
+         Format.fprintf f "@;[%s] by %s@]"
+            (String.concat ", " (List.map string_of_int vars))
+            (match proof with
+               | Terms.Exact _ -> "axiom"
+               | Terms.Step (rule, id1, id2, _, p, _) -> 
+                   Printf.sprintf "%s %d with %d at %s" 
+                     (string_of_rule rule)
+                     id1 id2 (String.concat
+                               "," (List.map string_of_int p)))
       | Terms.Equation (lhs, rhs, ty, comp) ->
-         Format.fprintf f "{";
+         Format.fprintf f "@[<hv>{";
          pp_foterm f ty;
-         Format.fprintf f "}: ";
+          Format.fprintf f "}:@;@[<hv>";
          pp_foterm f lhs;
-         Format.fprintf f " %s " (string_of_comparison comp);
+          Format.fprintf f "@;%s@;" (string_of_comparison comp);
          pp_foterm f rhs;
-         Format.fprintf f " [%s] by %s"
+          Format.fprintf f "@]@;[%s] by %s@]"
             (String.concat ", " (List.map string_of_int vars))
             (match proof with
             | Terms.Exact _ -> "axiom"
@@ -107,7 +118,6 @@ let pp_unit_clause ~formatter:f c =
                   (string_of_rule rule)
                   id1 id2 (String.concat
                  "," (List.map string_of_int p)))
-
 ;;
 
 let pp_bag ~formatter:f bag =