src/Tools/Metis/src/selftest.sml
author blanchet
Mon, 13 Sep 2010 21:09:43 +0200
changeset 39348 6f9c9899f99f
child 39349 2d0a4361c3ef
permissions -rw-r--r--
new version of the Metis files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39348
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     1
(* ========================================================================= *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     2
(* METIS TESTS                                                               *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     3
(* Copyright (c) 2004 Joe Hurd, distributed under the GNU GPL version 2      *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     4
(* ========================================================================= *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     5
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     6
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     7
(* Dummy versions of Moscow ML declarations to stop real compilers barfing.  *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     8
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     9
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    10
(*mlton
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    11
val quotation = ref true;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    12
val quietdec  = ref true;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    13
val loadPath  = ref ([] : string list);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    14
val load = fn (_ : string) => ();
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    15
*)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    16
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    17
(*polyml
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    18
val quotation = ref true;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    19
val quietdec  = ref true;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    20
val loadPath  = ref ([] : string list);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    21
val load = fn (_ : string) => ();
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    22
*)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    23
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    24
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    25
(* Load and open some useful modules                                         *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    26
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    27
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    28
val () = loadPath := !loadPath @ ["../bin/mosml"];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    29
val () = app load ["Options"];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    30
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    31
open Useful;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    32
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    33
val time = Portable.time;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    34
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    35
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    36
(* Problem data.                                                             *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    37
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    38
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    39
val ref oldquietdec = quietdec;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    40
val () = quietdec := true;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    41
val () = quotation := true;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    42
use "../src/problems.sml";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    43
val () = quietdec := oldquietdec;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    44
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    45
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    46
(* Helper functions.                                                         *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    47
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    48
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    49
fun partialOrderToString (SOME LESS) = "SOME LESS"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    50
  | partialOrderToString (SOME GREATER) = "SOME GREATER"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    51
  | partialOrderToString (SOME EQUAL) = "SOME EQUAL"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    52
  | partialOrderToString NONE = "NONE";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    53
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    54
fun SAY s =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    55
    print
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    56
      ("-------------------------------------" ^
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    57
       "-------------------------------------\n" ^ s ^ "\n\n");
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    58
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    59
fun printval p x = (print (Print.toString p x ^ "\n\n"); x);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    60
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    61
fun mkCl p th = Clause.mk {parameters = p, id = Clause.newId (), thm = th};
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    62
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    63
val pvBool = printval Print.ppBool
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    64
and pvPo = printval (Print.ppMap partialOrderToString Print.ppString)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    65
and pvFm = printval Formula.pp
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    66
and pvFms = printval (Print.ppList Formula.pp)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    67
and pvThm = printval Thm.pp
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    68
and pvEqn : Rule.equation -> Rule.equation = printval (Print.ppMap snd Thm.pp)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    69
and pvNet = printval (LiteralNet.pp Print.ppInt)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    70
and pvRw = printval Rewrite.pp
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    71
and pvU = printval Units.pp
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    72
and pvLits = printval LiteralSet.pp
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    73
and pvCl = printval Clause.pp
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    74
and pvCls = printval (Print.ppList Clause.pp)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    75
and pvM = printval Model.pp;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    76
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    77
val NV = Name.fromString
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    78
and NF = Name.fromString
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    79
and NR = Name.fromString;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    80
val V = Term.Var o NV
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    81
and C = (fn c => Term.Fn (NF c, []))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    82
and T = Term.parse
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    83
and A = Atom.parse
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    84
and L = Literal.parse
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    85
and F = Formula.parse
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    86
and S = Subst.fromList;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    87
val LS = LiteralSet.fromList o map L;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    88
val AX = Thm.axiom o LS;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    89
val CL = mkCl Clause.default o AX;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    90
val Q = (fn th => (Thm.destUnitEq th, th)) o AX o singleton
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    91
and U = (fn th => (Thm.destUnit th, th)) o AX o singleton;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    92
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    93
fun test_fun eq p r a =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    94
  if eq r a then p a ^ "\n" else
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    95
    (print ("\n\n" ^
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    96
            "test: should have\n-->" ^ p r ^ "<--\n\n" ^
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    97
            "test: actually have\n-->" ^ p a ^ "<--\n\n");
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    98
     raise Fail "test: failed a test");
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    99
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   100
fun test eq p r a = print (test_fun eq p r a ^ "\n");
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   101
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   102
val test_tm = test Term.equal Term.toString o Term.parse;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   103
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   104
val test_fm = test Formula.equal Formula.toString o Formula.parse;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   105
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   106
fun test_id p f a = test p a (f a);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   107
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   108
fun chop_newline s =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   109
    if String.sub (s,0) = #"\n" then String.extract (s,1,NONE) else s;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   110
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   111
fun unquote (QUOTE q) = q
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   112
  | unquote (ANTIQUOTE _) = raise Fail "unquote";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   113
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   114
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   115
val () = SAY "The parser and pretty-printer";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   116
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   117
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   118
fun prep l = (chop_newline o String.concat o map unquote) l;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   119
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   120
fun mini_print n fm = withRef (Print.lineLength,n) Formula.toString fm;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   121
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   122
fun testlen_pp n q =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   123
    (fn s => test_fun equal I s ((mini_print n o Formula.fromString) s))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   124
      (prep q);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   125
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   126
fun test_pp q = print (testlen_pp 40 q ^ "\n");
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   127
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   128
val () = test_pp `3 = f x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   129
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   130
val () = test_pp `f x y = y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   131
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   132
val () = test_pp `P x y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   133
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   134
val () = test_pp `P (f x) y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   135
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   136
val () = test_pp `f x = 3`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   137
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   138
val () = test_pp `!x. P x y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   139
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   140
val () = test_pp `!x y. P x y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   141
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   142
val () = test_pp `!x y z. P x y z`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   143
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   144
val () = test_pp `x = y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   145
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   146
val () = test_pp `x = 3`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   147
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   148
val () = test_pp `x + y = y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   149
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   150
val () = test_pp `x / y * z = w`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   151
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   152
val () = test_pp `x * y * z = x * (y * z)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   153
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   154
val () = test_pp `!x. ?y. x <= y /\ y <= x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   155
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   156
val () = test_pp `?x. !y. x + y = y /\ y <= x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   157
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   158
val () = test_pp `p /\ q \/ r /\ p ==> q <=> p`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   159
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   160
val () = test_pp `p`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   161
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   162
val () = test_pp `~!x. bool x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   163
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   164
val () = test_pp `p ==> !x. bool x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   165
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   166
val () = test_pp `p ==> ~!x. bool x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   167
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   168
val () = test_pp `~!x. bool x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   169
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   170
val () = test_pp `~~!x. bool x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   171
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   172
val () = test_pp `hello + there <> everybody`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   173
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   174
val () = test_pp `!x y. ?z. x < z /\ y < z`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   175
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   176
val () = test_pp `~(!x. P x) <=> ?y. ~P y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   177
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   178
val () = test_pp `?y. x < y ==> !v. ?w. x * v < y * w`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   179
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   180
val () = test_pp `(<=)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   181
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   182
val () = test_pp `(<=) <= b`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   183
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   184
val () = test_pp `(<=) <= (+)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   185
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   186
val () = test_pp `(<=) x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   187
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   188
val () = test_pp `(<=) <= (+) x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   189
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   190
val () = test_pp `~B (P % ((,) % c_a % v_b))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   191
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   192
val () = test_pp `B ((<=) % 0 % (LENGTH % NIL))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   193
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   194
val () = test_pp `~(a = b)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   195
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   196
val () = test_pp `!x. p x ==> !y. p y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   197
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   198
val () = test_pp `(!x. p x) ==> !y. p y`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   199
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   200
val () = test_pp `!x. ~~x = x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   201
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   202
val () = test_pp `x + (y + z) = a`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   203
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   204
val () = test_pp `(x @ y) @ z = a`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   205
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   206
val () = test_pp `p ((a @ a) @ a = a)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   207
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   208
val () = test_pp `!x y z. (x @ y) @ z = (x @ z) @ y @ z`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   209
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   210
val () = test_pp `~(!x. q x) /\ p`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   211
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   212
val () = test_pp `!x. f (~~x) b (~c)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   213
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   214
val () = test_pp `p ==> ~(a /\ b)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   215
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   216
val () = test_pp `!water. drinks (water)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   217
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   218
val () = test_pp `!vat water. drinks ((vat) p x (water))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   219
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   220
val () = test_pp `!x y. ~{x < y} /\ T`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   221
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   222
val () = test_pp `[3]`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   223
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   224
val () = test_pp `
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   225
!x y z. ?x' y' z'.
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   226
  P x y z ==> P x' y' z'`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   227
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   228
val () = test_pp `
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   229
(!x. P x ==> !x. Q x) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   230
((!x. Q x \/ R x) ==> ?x. Q x /\ R x) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   231
((?x. R x) ==> !x. L x ==> M x) ==>
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   232
!x. P x /\ L x ==> M x`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   233
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   234
val () = test_pp `
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   235
!x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   236
  x12 x13 x14 x15 x16 x17 x18 x19 x20
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   237
  x21 x22 x23 x24 x25 x26 x27 x28 x29
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   238
  x30 x31 x32. ?y0 y1 y2 y3 y4 y5 y6 y7.
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   239
  P`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   240
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   241
val () = test_pp `
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   242
!x x x x x x x x x x x x x x x x x x x x
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   243
  x x x x x x x x x x. ?y y y y y y y y
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   244
  y y y y y y y y y y y.
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   245
  P (x, y) /\ P (x, y) /\ P (x, y) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   246
  P (x, y) /\ P (x, y) /\ P (x, y) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   247
  P (x, y) /\ P (x, y) /\ P (x, y) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   248
  P (x, y) /\ P (x, y) /\ P (x, y) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   249
  P (x, y) /\ P (x, y) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   250
  ~~~~~~~~~~~~~f
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   251
                 (f (f (f x y) (f x y))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   252
                    (f (f x y) (f x y)))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   253
                 (f (f (f x y) (f x y))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   254
                    (f (f x y) (f x y)))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   255
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   256
val () = test_pp `
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   257
(!x.
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   258
   extremely__long__predicate__name) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   259
F`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   260
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   261
val () = test_pp `
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   262
(!x. x = x) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   263
(!x y. ~(x = y) \/ y = x) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   264
(!x y z.
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   265
   ~(x = y) \/ ~(y = z) \/ x = z) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   266
(!x y z. b . x . y . z = x . (y . z)) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   267
(!x y. t . x . y = y . x) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   268
(!x y z. ~(x = y) \/ x . z = y . z) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   269
(!x y z. ~(x = y) \/ z . x = z . y) ==>
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   270
~(b . (b . (t . b) . b) . t . x . y .
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   271
  z = y . (x . z)) ==> F`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   272
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   273
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   274
val () = SAY "Substitution";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   275
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   276
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   277
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   278
    test Name.equal Name.toString (NV"x")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   279
      (Term.variantPrime (NameSet.fromList [NV"y",NV"z" ]) (NV"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   280
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   281
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   282
    test Name.equal Name.toString (NV"x'")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   283
      (Term.variantPrime (NameSet.fromList [NV"x",NV"y" ]) (NV"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   284
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   285
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   286
    test Name.equal Name.toString (NV"x''")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   287
      (Term.variantPrime (NameSet.fromList [NV"x",NV"x'"]) (NV"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   288
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   289
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   290
    test Name.equal Name.toString (NV"x")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   291
      (Term.variantNum (NameSet.fromList [NV"y",NV"z"]) (NV"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   292
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   293
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   294
    test Name.equal Name.toString (NV"x0")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   295
      (Term.variantNum (NameSet.fromList [NV"x",NV"y"]) (NV"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   296
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   297
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   298
    test Name.equal Name.toString (NV"x1")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   299
      (Term.variantNum (NameSet.fromList [NV"x",NV"x0"]) (NV"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   300
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   301
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   302
    test_fm
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   303
      `!x. x = $z`
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   304
      (Formula.subst (S [(NV"y", V"z")]) (F`!x. x = $y`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   305
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   306
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   307
    test_fm
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   308
      `!x'. x' = $x`
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   309
      (Formula.subst (S [(NV"y", V"x")]) (F`!x. x = $y`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   310
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   311
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   312
    test_fm
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   313
      `!x' x''. x' = $x ==> x' = x''`
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   314
      (Formula.subst (S [(NV"y", V"x")])
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   315
         (F`!x x'. x = $y ==> x = x'`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   316
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   317
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   318
val () = SAY "Unification";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   319
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   320
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   321
fun unify_and_apply tm1 tm2 =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   322
    Subst.subst (Subst.unify Subst.empty tm1 tm2) tm1;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   323
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   324
val () = test_tm `c` (unify_and_apply (V"x") (C"c"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   325
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   326
val () = test_tm `c` (unify_and_apply (C"c") (V"x"));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   327
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   328
val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   329
    test_tm
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   330
      `f c`
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   331
      (unify_and_apply
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   332
         (Term.Fn (NF"f", [V"x"]))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   333
         (Term.Fn (NF"f", [C"c"])));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   334
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   335
val () = test_tm `f 0 0 0` (unify_and_apply (T`f 0 $x $x`) (T`f $y $y $z`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   336
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   337
fun f x y = (printval Subst.pp (Atom.unify Subst.empty x y); ());
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   338
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   339
val () = f (NR"P", [V"x"]) (NR"P", [V"x"]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   340
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   341
val () = f (NR"P", [V"x"]) (NR"P", [C"c"]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   342
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   343
val () = f (A`P c_x`) (A`P $x`);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   344
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   345
val () = f (A`q $x (f $x)`) (A`q $y $z`);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   346
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   347
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   348
val () = SAY "The logical kernel";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   349
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   350
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   351
val th0 = AX [`p`,`q`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   352
val th1 = AX [`~p`,`r`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   353
val th2 = Thm.resolve (L`p`) th0 th1;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   354
val _ = printval Proof.pp (Proof.proof th2);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   355
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   356
val th0 = Rule.relationCongruence Atom.eqRelation;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   357
val th1 =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   358
    Thm.subst (S [(NV"y0",T`$x`),(NV"y1",T`$y`),(NV"x1",T`$z`),(NV"x0",T`$x`)]) th0;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   359
val th2 = Thm.resolve (L`$x = $x`) Rule.reflexivity th1;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   360
val th3 = Rule.symNeq (L`~($z = $y)`) th2;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   361
val _ = printval Proof.pp (Proof.proof th3);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   362
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   363
(* Testing the elimination of redundancies in proofs *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   364
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   365
val th0 = Rule.reflexivity;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   366
val th1 = Thm.subst (S [(NV"x", Term.Fn (NF"f", [V"y"]))]) th0;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   367
val th2 = Thm.subst (S [(NV"y", C"c")]) th1;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   368
val _ = printval Proof.pp (Proof.proof th2);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   369
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   370
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   371
val () = SAY "Derived rules of inference";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   372
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   373
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   374
val th0 = pvThm (AX [`$x = a`, `f a = $x`, `~(a = b)`, `a = $x`,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   375
                     `$x = a`, `a = $x`, `~(b = a)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   376
val th1 = pvThm (Rule.removeSym th0);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   377
val th2 = pvThm (Rule.symEq (L`a = $x`) th0);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   378
val th3 = pvThm (Rule.symEq (L`f a = $x`) th0);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   379
val th5 = pvThm (Rule.symNeq (L`~(a = b)`) th0);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   380
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   381
(* Testing the rewrConv conversion *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   382
val (x_y as (x,y), eqTh) = pvEqn (Q`e * (i $z * $z) = e`);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   383
val tm = Term.Fn (NF"f",[x]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   384
val path : int list = [0];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   385
val reflTh = Thm.refl tm;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   386
val reflLit = Thm.destUnit reflTh;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   387
val th = Thm.equality reflLit (1 :: path) y;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   388
val th = Thm.resolve reflLit reflTh th;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   389
val th = pvThm (try (Thm.resolve (Literal.mkEq x_y) eqTh) th);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   390
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   391
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   392
val () = SAY "Discrimination nets for literals";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   393
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   394
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   395
val n = pvNet (LiteralNet.new {fifo = true});
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   396
val n = pvNet (LiteralNet.insert n (L`P (f c $x a)`, 1));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   397
val n = pvNet (LiteralNet.insert n (L`P (f c $y a)`, 2));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   398
val n = pvNet (LiteralNet.insert n (L`P (f c a a)`, 3));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   399
val n = pvNet (LiteralNet.insert n (L`P (f c b a)`, 4));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   400
val n = pvNet (LiteralNet.insert n (L`~Q`, 5));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   401
val n = pvNet (LiteralNet.insert n (L`~Q`, 6));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   402
val n = pvNet (LiteralNet.insert n (L`~Q`, 7));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   403
val n = pvNet (LiteralNet.insert n (L`~Q`, 8));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   404
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   405
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   406
val () = SAY "The Knuth-Bendix ordering on terms";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   407
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   408
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   409
val kboOrder = KnuthBendixOrder.default;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   410
val kboCmp = KnuthBendixOrder.compare kboOrder;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   411
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   412
val x = pvPo (kboCmp (T`f a`, T`g b`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   413
val x = pvPo (kboCmp (T`f a b`, T`g b`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   414
val x = pvPo (kboCmp (T`f $x`, T`g a`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   415
val x = pvPo (kboCmp (T`f a $x`, T`g $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   416
val x = pvPo (kboCmp (T`f $x`, T`g $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   417
val x = pvPo (kboCmp (T`f $x`, T`f $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   418
val x = pvPo (kboCmp (T`$x + $y`, T`$x + $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   419
val x = pvPo (kboCmp (T`$x + $y + $x`, T`$y + $x + $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   420
val x = pvPo (kboCmp (T`$x + $y + $x`, T`$y * $x + $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   421
val x = pvPo (kboCmp (T`a`, T`$x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   422
val x = pvPo (kboCmp (T`f a`, T`$x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   423
val x = pvPo (kboCmp (T`f $x (f $y $z)`, T`f (f $x $y) $z`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   424
val x = pvPo (kboCmp (T`f (g $x a)`, T`f (h a $x)`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   425
val x = pvPo (kboCmp (T`f (g a)`, T`f (h $x)`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   426
val x = pvPo (kboCmp (T`f (h a)`, T`f (g $x)`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   427
val x = pvPo (kboCmp (T`f $y`, T`f (g a b c)`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   428
val x = pvPo (kboCmp (T`$x * $y + $x * $z`, T`$x * ($y + $z)`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   429
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   430
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   431
val () = SAY "Rewriting";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   432
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   433
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   434
val eqnsToRw = Rewrite.addList (Rewrite.new kboCmp) o enumerate;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   435
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   436
val eqns = [Q`e * $x = $x`, Q`$x * e = $x`, Q`i $x * $x = e`, Q`$x * i $x = e`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   437
val ax = pvThm (AX [`e * (i $z * $z) = i e * e`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   438
val th = pvThm (Rewrite.orderedRewrite kboCmp eqns ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   439
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   440
val rw = pvRw (eqnsToRw eqns);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   441
val th = pvThm (snd (try (Rewrite.rewriteConv rw kboCmp) (T`e * e`)));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   442
val th = pvThm (snd (try (Rewrite.rewriteConv rw kboCmp) (T`e * (i $z * $z)`)));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   443
val th = pvThm (try (Rewrite.rewriteRule rw kboCmp) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   444
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   445
(* Bug check: in this one a literal goes missing, due to the Resolve in Subst *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   446
val eqns = [Q`f a = a`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   447
val ax = pvThm (AX [`~(g (f a) = b)`, `~(f a = a)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   448
val th = pvThm (try (Rewrite.orderedRewrite kboCmp eqns) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   449
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   450
(* Bug check: term paths were not being reversed before use *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   451
val eqns = [Q`a = f a`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   452
val ax = pvThm (AX [`a <= f (f a)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   453
val th = pvThm (try (Rewrite.orderedRewrite kboCmp eqns) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   454
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   455
(* Bug check: Equality used to complain if the literal didn't exist *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   456
val eqns = [Q`b = f a`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   457
val ax = pvThm (AX [`~(f a = f a)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   458
val th = pvThm (try (Rewrite.orderedRewrite kboCmp eqns) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   459
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   460
(* Testing the rewriting with disequalities in the same clause *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   461
val ax = pvThm (AX [`~(a = b)`, `P a`, `P b`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   462
val th = pvThm (try (Rewrite.orderedRewrite kboCmp []) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   463
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   464
val ax = pvThm (AX [`~(f $x = $x)`, `P (f a)`, `P (f $x)`, `P (f $y)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   465
val th = pvThm (try (Rewrite.orderedRewrite kboCmp []) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   466
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   467
val ax = pvThm
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   468
  (AX [`~(f (f (f (f (f $x)))) = $x)`,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   469
          `~(f (f (f (f (f (f (f (f $x))))))) = $x)`,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   470
          `P (f $x)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   471
val th = pvThm (try (Rewrite.orderedRewrite kboCmp []) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   472
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   473
(* Symmetry should yield a tautology on ground clauses *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   474
val ax = pvThm (AX [`~(a = b)`, `b = a`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   475
val th = pvThm (try (Rewrite.orderedRewrite kboCmp []) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   476
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   477
(* Transitivity should yield a tautology on ground clauses *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   478
val ax = pvThm (AX [`~(a = b)`, `~(b = c)`, `a = c`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   479
val th = pvThm (try (Rewrite.orderedRewrite kboCmp []) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   480
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   481
(* Extended transitivity should yield a tautology on ground clauses *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   482
val ax = pvThm (AX [`~(a = b)`, `~(b = c)`, `~(c = d)`, `a = d`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   483
val th = pvThm (try (Rewrite.orderedRewrite kboCmp []) ax);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   484
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   485
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   486
val () = SAY "Unit cache";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   487
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   488
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   489
val u = pvU (Units.add Units.empty (U`~p $x`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   490
val u = pvU (Units.add u (U`a = b`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   491
val _ = pvThm (Units.reduce u (AX [`p 0`,`~(b = a)`]));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   492
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   493
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   494
val () = SAY "Negation normal form";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   495
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   496
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   497
val nnf = Normalize.nnf;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   498
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   499
val _ = pvFm (nnf (F`p /\ ~p`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   500
val _ = pvFm (nnf (F`(!x. P x) ==> ((?y. Q y) <=> (?z. P z /\ Q z))`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   501
val _ = pvFm (nnf (F`~(~(p <=> q) <=> r) <=> ~(p <=> ~(q <=> r))`));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   502
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   503
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   504
val () = SAY "Conjunctive normal form";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   505
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   506
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   507
local
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   508
  fun clauseToFormula cl =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   509
      Formula.listMkDisj (LiteralSet.transform Literal.toFormula cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   510
in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   511
  fun clausesToFormula cls = Formula.listMkConj (map clauseToFormula cls);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   512
end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   513
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   514
val cnf' = pvFm o clausesToFormula o Normalize.cnf o F;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   515
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   516
val cnf = pvFm o clausesToFormula o Normalize.cnf o
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   517
          Formula.Not o Formula.generalize o F;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   518
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   519
val _ = cnf `p \/ ~p`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   520
val _ = cnf `~((p /\ (q \/ r /\ s)) /\ (~p \/ ~q \/ ~s))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   521
val _ = cnf `~((p /\ (q \/ r /\ s)) /\ (~p \/ ~q \/ ~s) /\ (p \/ ~p))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   522
val _ = cnf `~(~(p <=> q) <=> r) <=> ~(p <=> ~(q <=> r))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   523
val _ = cnf `((p <=> q) <=> r) <=> (p <=> (q <=> r))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   524
val _ = cnf `~(!x. ?y. x < y ==> !v. ?w. x * v < y * w)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   525
val _ = cnf `~(!x. P x ==> (?y z. Q y \/ ~(?z. P z /\ Q z)))`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   526
val _ = cnf `~(?x y. x + y = 2)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   527
val _ = cnf' `(!x. p x) \/ (!y. r $x y)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   528
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   529
val _ = cnf
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   530
  `(!x. P x ==> (!x. Q x)) /\ ((!x. Q x \/ R x) ==> (?x. Q x /\ R x)) /\
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   531
   ((?x. R x) ==> (!x. L x ==> M x)) ==> (!x. P x /\ L x ==> M x)`;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   532
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   533
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   534
val () = SAY "Finite models";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   535
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   536
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   537
fun checkModelClause M cl =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   538
    let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   539
      val randomSamples = 100
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   540
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   541
      fun addRandomSample {T,F} =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   542
          let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   543
            val {T = T', F = F'} = Model.checkClause {maxChecks = SOME 1} M cl
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   544
          in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   545
            {T = T + T', F = F + F'}
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   546
          end
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   547
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   548
      val {T,F} = funpow randomSamples addRandomSample {T = 0, F = 0}
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   549
      val rx = Real.fromInt T / Real.fromInt (T + F)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   550
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   551
      val {T,F} = Model.checkClause {maxChecks = NONE} M cl
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   552
      val ry = Real.fromInt T / Real.fromInt (T + F)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   553
    in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   554
      [Formula.toString (LiteralSet.disjoin cl),
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   555
       " | random sampling = " ^ percentToString rx,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   556
       " | exhaustive = " ^ percentToString ry]
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   557
    end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   558
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   559
local
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   560
  val format =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   561
      [{leftAlign = true, padChar = #" "},
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   562
       {leftAlign = true, padChar = #" "},
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   563
       {leftAlign = true, padChar = #" "}];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   564
in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   565
  fun checkModel M cls =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   566
      let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   567
        val table = map (checkModelClause M) cls
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   568
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   569
        val rows = alignTable format table
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   570
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   571
        val () = print (join "\n" rows ^ "\n\n")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   572
      in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   573
        ()
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   574
      end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   575
end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   576
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   577
fun perturbModel M cls n =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   578
    let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   579
      val N = {size = Model.size M}
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   580
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   581
      fun perturbClause (fv,cl) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   582
          let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   583
            val V = Model.randomValuation N fv
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   584
          in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   585
            if Model.interpretClause M V cl then ()
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   586
            else Model.perturbClause M V cl
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   587
          end
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   588
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   589
      val cls = map (fn cl => (LiteralSet.freeVars cl, cl)) cls
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   590
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   591
      fun perturbClauses () = app perturbClause cls
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   592
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   593
      val () = funpow n perturbClauses ()
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   594
    in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   595
      M
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   596
    end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   597
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   598
val groupAxioms =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   599
    [LS[`0 + $x = $x`],
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   600
     LS[`~$x + $x = 0`],
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   601
     LS[`$x + $y + $z = $x + ($y + $z)`]];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   602
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   603
val groupThms =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   604
    [LS[`$x + 0 = $x`],
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   605
     LS[`$x + ~$x = 0`],
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   606
     LS[`~~$x = $x`]];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   607
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   608
fun newM fixed = Model.new {size = 8, fixed = fixed};
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   609
val M = pvM (newM Model.basicFixed);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   610
val () = checkModel M (groupAxioms @ groupThms);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   611
val M = pvM (perturbModel M groupAxioms 1000);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   612
val () = checkModel M (groupAxioms @ groupThms);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   613
val M = pvM (newM (Model.unionFixed Model.modularFixed Model.basicFixed));
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   614
val () = checkModel M (groupAxioms @ groupThms);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   615
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   616
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   617
val () = SAY "Checking the standard model";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   618
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   619
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   620
fun ppPercentClause (r,cl) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   621
    let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   622
      val ind = 6
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   623
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   624
      val p = percentToString r
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   625
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   626
      val fm = LiteralSet.disjoin cl
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   627
    in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   628
      Print.blockProgram Print.Consistent ind
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   629
        [Print.addString p,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   630
         Print.addString (nChars #" " (ind - size p)),
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   631
         Formula.pp fm]
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   632
    end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   633
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   634
val standardModel = Model.new Model.default;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   635
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   636
fun checkStandardModelClause cl =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   637
    let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   638
      val {T,F} = Model.checkClause {maxChecks = SOME 1000} standardModel cl
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   639
      val r = Real.fromInt T / Real.fromInt (T + F)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   640
    in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   641
      (r,cl)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   642
    end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   643
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   644
val pvPCl = printval ppPercentClause
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   645
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   646
(* Equality *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   647
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   648
val cl = LS[`$x = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   649
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   650
val cl = LS[`~($x = $y)`,`$y = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   651
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   652
val cl = LS[`~($x = $y)`,`~($y = $z)`,`$x = $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   653
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   654
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   655
(* Projections *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   656
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   657
val cl = LS[`project1 $x1 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   658
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   659
val cl = LS[`project1 $x1 $x2 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   660
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   661
val cl = LS[`project2 $x1 $x2 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   662
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   663
val cl = LS[`project1 $x1 $x2 $x3 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   664
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   665
val cl = LS[`project2 $x1 $x2 $x3 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   666
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   667
val cl = LS[`project3 $x1 $x2 $x3 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   668
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   669
val cl = LS[`project1 $x1 $x2 $x3 $x4 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   670
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   671
val cl = LS[`project2 $x1 $x2 $x3 $x4 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   672
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   673
val cl = LS[`project3 $x1 $x2 $x3 $x4 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   674
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   675
val cl = LS[`project4 $x1 $x2 $x3 $x4 = $x4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   676
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   677
val cl = LS[`project1 $x1 $x2 $x3 $x4 $x5 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   678
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   679
val cl = LS[`project2 $x1 $x2 $x3 $x4 $x5 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   680
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   681
val cl = LS[`project3 $x1 $x2 $x3 $x4 $x5 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   682
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   683
val cl = LS[`project4 $x1 $x2 $x3 $x4 $x5 = $x4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   684
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   685
val cl = LS[`project5 $x1 $x2 $x3 $x4 $x5 = $x5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   686
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   687
val cl = LS[`project1 $x1 $x2 $x3 $x4 $x5 $x6 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   688
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   689
val cl = LS[`project2 $x1 $x2 $x3 $x4 $x5 $x6 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   690
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   691
val cl = LS[`project3 $x1 $x2 $x3 $x4 $x5 $x6 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   692
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   693
val cl = LS[`project4 $x1 $x2 $x3 $x4 $x5 $x6 = $x4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   694
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   695
val cl = LS[`project5 $x1 $x2 $x3 $x4 $x5 $x6 = $x5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   696
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   697
val cl = LS[`project6 $x1 $x2 $x3 $x4 $x5 $x6 = $x6`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   698
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   699
val cl = LS[`project1 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   700
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   701
val cl = LS[`project2 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   702
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   703
val cl = LS[`project3 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   704
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   705
val cl = LS[`project4 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   706
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   707
val cl = LS[`project5 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   708
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   709
val cl = LS[`project6 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x6`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   710
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   711
val cl = LS[`project7 $x1 $x2 $x3 $x4 $x5 $x6 $x7 = $x7`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   712
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   713
val cl = LS[`project1 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   714
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   715
val cl = LS[`project2 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   716
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   717
val cl = LS[`project3 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   718
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   719
val cl = LS[`project4 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   720
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   721
val cl = LS[`project5 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   722
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   723
val cl = LS[`project6 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x6`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   724
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   725
val cl = LS[`project7 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x7`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   726
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   727
val cl = LS[`project8 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 = $x8`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   728
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   729
val cl = LS[`project1 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   730
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   731
val cl = LS[`project2 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   732
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   733
val cl = LS[`project3 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   734
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   735
val cl = LS[`project4 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   736
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   737
val cl = LS[`project5 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   738
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   739
val cl = LS[`project6 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x6`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   740
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   741
val cl = LS[`project7 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x7`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   742
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   743
val cl = LS[`project8 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x8`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   744
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   745
val cl = LS[`project9 $x1 $x2 $x3 $x4 $x5 $x6 $x7 $x8 $x9 = $x9`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   746
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   747
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   748
(* Arithmetic *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   749
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   750
(* Zero *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   751
val cl = LS[`~isZero $x`,`$x = 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   752
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   753
val cl = LS[`isZero $x`,`~($x = 0)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   754
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   755
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   756
(* Positive numerals *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   757
val cl = LS[`0 + 1 = 1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   758
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   759
val cl = LS[`1 + 1 = 2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   760
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   761
val cl = LS[`2 + 1 = 3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   762
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   763
val cl = LS[`3 + 1 = 4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   764
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   765
val cl = LS[`4 + 1 = 5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   766
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   767
val cl = LS[`5 + 1 = 6`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   768
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   769
val cl = LS[`6 + 1 = 7`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   770
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   771
val cl = LS[`7 + 1 = 8`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   772
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   773
val cl = LS[`8 + 1 = 9`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   774
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   775
val cl = LS[`9 + 1 = 10`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   776
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   777
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   778
(* Negative numerals *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   779
val cl = LS[`~1 = negative1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   780
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   781
val cl = LS[`~2 = negative2`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   782
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   783
val cl = LS[`~3 = negative3`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   784
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   785
val cl = LS[`~4 = negative4`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   786
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   787
val cl = LS[`~5 = negative5`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   788
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   789
val cl = LS[`~6 = negative6`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   790
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   791
val cl = LS[`~7 = negative7`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   792
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   793
val cl = LS[`~8 = negative8`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   794
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   795
val cl = LS[`~9 = negative9`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   796
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   797
val cl = LS[`~10 = negative10`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   798
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   799
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   800
(* Addition *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   801
val cl = LS[`0 + $x = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   802
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   803
val cl = LS[`$x + $y = $y + $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   804
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   805
val cl = LS[`$x + ($y + $z) = ($x + $y) + $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   806
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   807
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   808
(* Negation *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   809
val cl = LS[`~$x + $x = 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   810
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   811
val cl = LS[`~~$x = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   812
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   813
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   814
(* Subtraction *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   815
val cl = LS[`$x - $y = $x + ~$y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   816
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   817
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   818
(* Successor *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   819
val cl = LS[`suc $x = $x + 1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   820
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   821
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   822
(* Predecessor *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   823
val cl = LS[`pre $x = $x - 1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   824
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   825
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   826
(* Ordering *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   827
val cl = LS[`$x <= $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   828
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   829
val cl = LS[`~($x <= $y)`,`~($y <= $z)`,`$x <= $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   830
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   831
val cl = LS[`~($x <= $y)`,`~($y <= $x)`,`$x = $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   832
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   833
val cl = LS[`0 <= $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   834
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   835
val cl = LS[`~($x >= $y)`,`$y <= $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   836
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   837
val cl = LS[`$x >= $y`,`~($y <= $x)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   838
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   839
val cl = LS[`$x > $y`,`$x <= $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   840
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   841
val cl = LS[`~($x > $y)`,`~($x <= $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   842
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   843
val cl = LS[`$x < $y`,`$y <= $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   844
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   845
val cl = LS[`~($x < $y)`,`~($y <= $x)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   846
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   847
val cl = LS[`$x = 0`,`~($x <= $y)`,`~$y <= ~$x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   848
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   849
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   850
(* Multiplication *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   851
val cl = LS[`1 * $x = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   852
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   853
val cl = LS[`0 * $x = 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   854
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   855
val cl = LS[`$x * $y = $y * $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   856
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   857
val cl = LS[`$x * ($y * $z) = ($x * $y) * $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   858
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   859
val cl = LS[`$x * ($y + $z) = ($x * $y) + ($x * $z)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   860
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   861
val cl = LS[`$x * ~$y = ~($x * $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   862
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   863
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   864
(* Division *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   865
val cl = LS[`$y = 0`,`$x mod $y < $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   866
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   867
val cl = LS[`$y * ($x div $y) + $x mod $y = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   868
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   869
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   870
(* Exponentiation *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   871
val cl = LS[`exp $x 0 = 1`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   872
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   873
val cl = LS[`$y = 0`,`exp $x $y = $x * exp $x (pre $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   874
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   875
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   876
(* Divides *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   877
val cl = LS[`divides $x $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   878
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   879
val cl = LS[`~(divides $x $y)`,`~(divides $y $z)`,`divides $x $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   880
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   881
val cl = LS[`~(divides $x $y)`,`~(divides $y $x)`,`$x = $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   882
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   883
val cl = LS[`divides 1 $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   884
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   885
val cl = LS[`divides $x 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   886
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   887
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   888
(* Even and odd *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   889
val cl = LS[`even 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   890
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   891
val cl = LS[`$x = 0`,`~(even (pre $x))`,`odd $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   892
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   893
val cl = LS[`$x = 0`,`~(odd (pre $x))`,`even $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   894
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   895
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   896
(* Sets *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   897
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   898
(* The empty set *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   899
val cl = LS[`~member $x empty`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   900
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   901
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   902
(* The universal set *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   903
val cl = LS[`member $x universe`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   904
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   905
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   906
(* Complement *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   907
val cl = LS[`member $x $y`,`member $x (complement $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   908
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   909
val cl = LS[`~(member $x $y)`,`~member $x (complement $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   910
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   911
val cl = LS[`complement (complement $x) = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   912
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   913
val cl = LS[`complement empty = universe`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   914
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   915
val cl = LS[`complement universe = empty`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   916
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   917
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   918
(* The subset relation *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   919
val cl = LS[`subset $x $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   920
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   921
val cl = LS[`~subset $x $y`,`~subset $y $z`,`subset $x $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   922
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   923
val cl = LS[`~subset $x $y`,`~subset $y $x`,`$x = $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   924
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   925
val cl = LS[`subset empty $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   926
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   927
val cl = LS[`subset $x universe`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   928
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   929
val cl = LS[`~subset $x $y`,`subset (complement $y) (complement $x)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   930
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   931
val cl = LS[`~member $x $y`,`~subset $y $z`,`member $x $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   932
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   933
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   934
(* Union *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   935
val cl = LS[`union $x $y = union $y $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   936
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   937
val cl = LS[`union $x (union $y $z) = union (union $x $y) $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   938
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   939
val cl = LS[`union empty $x = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   940
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   941
val cl = LS[`union universe $x = universe`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   942
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   943
val cl = LS[`subset $x (union $x $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   944
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   945
val cl = LS[`~member $x (union $y $z)`,`member $x $y`,`member $x $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   946
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   947
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   948
(* Intersection *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   949
val cl = LS[`intersect $x $y =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   950
             complement (union (complement $x) (complement $y))`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   951
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   952
val cl = LS[`subset (intersect $x $y) $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   953
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   954
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   955
(* Difference *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   956
val cl = LS[`difference $x $y = intersect $x (complement $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   957
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   958
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   959
(* Symmetric difference *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   960
val cl = LS[`symmetricDifference $x $y =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   961
             union (difference $x $y) (difference $y $x)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   962
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   963
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   964
(* Insert *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   965
val cl = LS[`member $x (insert $x $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   966
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   967
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   968
(* Singleton *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   969
val cl = LS[`singleton $x = (insert $x empty)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   970
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   971
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   972
(* Cardinality *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   973
val cl = LS[`card empty = 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   974
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   975
val cl = LS[`member $x $y`,`card (insert $x $y) = suc (card $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   976
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   977
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   978
(* Lists *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   979
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   980
(* Nil *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   981
val cl = LS[`null nil`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   982
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   983
val cl = LS[`~null $x`, `$x = nil`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   984
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   985
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   986
(* Cons *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   987
val cl = LS[`~(nil = $x :: $y)`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   988
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   989
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   990
(* Append *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   991
val cl = LS[`$x @ ($y @ $z) = ($x @ $y) @ $z`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   992
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   993
val cl = LS[`nil @ $x = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   994
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   995
val cl = LS[`$x @ nil = $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   996
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   997
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   998
(* Length *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
   999
val cl = LS[`length nil = 0`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1000
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1001
val cl = LS[`length ($x :: $y) >= length $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1002
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1003
val cl = LS[`length ($x @ $y) >= length $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1004
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1005
val cl = LS[`length ($x @ $y) >= length $y`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1006
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1007
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1008
(* Tail *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1009
val cl = LS[`null $x`,`suc (length (tail $x)) = length $x`];
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1010
val _ = pvPCl (checkStandardModelClause cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1011
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1012
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1013
val () = SAY "Clauses";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1014
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1015
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1016
val cl = pvCl (CL[`P $x`,`P $y`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1017
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1018
val _ = pvCls (Clause.factor cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1019
val cl = pvCl (CL[`P $x`,`~P (f $x)`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1020
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1021
val cl = pvCl (CL[`$x = $y`,`f $y = f $x`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1022
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1023
val cl = pvCl (CL[`$x = f $y`,`f $x = $y`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1024
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1025
val cl = pvCl (CL[`s = a`,`s = b`,`h b c`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1026
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1027
val cl = pvCl (CL[`a = a`,`a = b`,`h b c`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1028
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1029
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1030
(* Test cases contributed by Larry Paulson *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1031
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1032
local
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1033
  val lnFnName = Name.fromString "ln"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1034
  and expFnName = Name.fromString "exp"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1035
  and divFnName = Name.fromString "/"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1036
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1037
  val leRelName = Name.fromString "<";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1038
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1039
  fun weight na =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1040
      case na of
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1041
        (n,1) =>
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1042
        if Name.equal n lnFnName then 500
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1043
        else if Name.equal n expFnName then 500
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1044
        else 1
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1045
      | (n,2) =>
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1046
        if Name.equal n divFnName then 50
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1047
        else if Name.equal n leRelName then 20
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1048
        else 1
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1049
      | _ => 1;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1050
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1051
  val ordering =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1052
      {weight = weight, precedence = #precedence KnuthBendixOrder.default};
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1053
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1054
  val clauseParameters =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1055
      {ordering = ordering,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1056
       orderLiterals = Clause.UnsignedLiteralOrder,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1057
       orderTerms = true};
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1058
in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1059
  val LcpCL = mkCl clauseParameters o AX;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1060
end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1061
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1062
val cl = pvCl (LcpCL[`~($y <= (2 + (2 * $x + pow $x 2)) / 2)`, `~(0 <= $x)`,
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1063
                     `$y <= exp $x`]);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1064
val _ = pvLits (Clause.largestLiterals cl);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1065
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1066
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1067
val () = SAY "Syntax checking the problem sets";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1068
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1069
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1070
local
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1071
  fun same n = raise Fail ("Two goals called " ^ n);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1072
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1073
  fun dup n n' =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1074
      raise Fail ("Goal " ^ n' ^ " is probable duplicate of " ^ n);
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1075
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1076
  fun quot fm =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1077
      let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1078
        fun f (v,s) = Subst.insert s (v,V"_")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1079
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1080
        val sub = NameSet.foldl f Subst.empty (Formula.freeVars fm)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1081
      in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1082
        Formula.subst sub fm
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1083
      end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1084
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1085
  val quot_clauses =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1086
      Formula.listMkConj o sort Formula.compare o
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1087
      map (quot o snd o Formula.stripForall) o Formula.stripConj;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1088
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1089
  fun quotient (Formula.Imp (a, Formula.Imp (b, Formula.False))) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1090
      Formula.Imp (quot_clauses a, Formula.Imp (quot_clauses b, Formula.False))
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1091
    | quotient fm = fm;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1092
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1093
  fun check ({name,goal,...}, acc) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1094
    let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1095
      val g = prep goal
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1096
      val p =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1097
          Formula.fromString g
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1098
          handle Parse.NoParse =>
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1099
                 raise Error ("failed to parse problem " ^ name)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1100
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1101
      val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1102
        case List.find (fn (n,_) => n = name) acc of NONE => ()
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1103
        | SOME _ => same name
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1104
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1105
      val () =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1106
        case List.find (fn (_,x) => Formula.equal x p) acc of NONE => ()
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1107
        | SOME (n,_) => dup n name
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1108
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1109
      val _ =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1110
        test_fun equal I g (mini_print (!Print.lineLength) p)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1111
        handle e => (print ("Error in problem " ^ name ^ "\n\n"); raise e)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1112
    in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1113
      (name,p) :: acc
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1114
    end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1115
in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1116
  fun check_syntax (p : problem list) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1117
      (foldl check [] p; print "ok\n\n");
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1118
end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1119
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1120
val () = check_syntax problems;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1121
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1122
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1123
val () = SAY "Parsing TPTP problems";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1124
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1125
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1126
fun tptp f =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1127
    let
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1128
      val () = print ("parsing " ^ f ^ "... ")
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1129
      val filename = "tptp/" ^ f ^ ".tptp"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1130
      val mapping = Tptp.defaultMapping
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1131
      val goal = Tptp.goal (Tptp.read {filename = filename, mapping = mapping})
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1132
      val () = print "ok\n"
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1133
    in
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1134
      pvFm goal
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1135
    end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1136
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1137
val _ = tptp "PUZ001-1";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1138
val _ = tptp "NUMBERED_FORMULAS";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1139
val _ = tptp "DEFINED_TERMS";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1140
val _ = tptp "SYSTEM_TERMS";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1141
val _ = tptp "QUOTED_TERMS";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1142
val _ = tptp "QUOTED_TERMS_IDENTITY";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1143
val _ = tptp "QUOTED_TERMS_DIFFERENT";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1144
val _ = tptp "QUOTED_TERMS_SPECIAL";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1145
val _ = tptp "RENAMING_VARIABLES";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1146
val _ = tptp "MIXED_PROBLEM";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1147
val _ = tptp "BLOCK_COMMENTS";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1148
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1149
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1150
val () = SAY "The TPTP finite model";
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1151
(* ------------------------------------------------------------------------- *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1152
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
  1153
val _ = printval (Tptp.ppFixedMap Tptp.defaultMapping) Tptp.defaultFixedMap;