src/Cube/ex.ML
author clasohm
Thu, 16 Sep 1993 12:20:38 +0200
changeset 0 a5a9c433f639
child 1459 d12da312eff4
permissions -rw-r--r--
Initial revision
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(* Examples taken from
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
	H. Barendregt. Introduction to Generalised Type Systems.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
	J. Functional Programming.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Cube_build_completed;    (*Cause examples to fail if Cube did*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
proof_timing := true;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
fun strip_asms_tac thms  i =
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
    REPEAT(resolve_tac[strip_b,strip_s]i THEN DEPTH_SOLVE_1(ares_tac thms i));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
val imp_elim = prove_goal thy "[| f:A->B; a:A; f^a:B ==> PROP P |] ==> PROP P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
	(fn asms => [REPEAT(resolve_tac (app::asms) 1)]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
val pi_elim = prove_goal thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
	"[| F:Prod(A,B); a:A; F^a:B(a) ==> PROP P |] ==> PROP P"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
	(fn asms => [REPEAT(resolve_tac (app::asms) 1)]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
(* SIMPLE TYPES *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
goal thy "A:* |- A->A : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
by (DEPTH_SOLVE (ares_tac simple 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
goal thy "A:* |- Lam a:A.a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
by (DEPTH_SOLVE (ares_tac simple 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
goal thy "A:* B:* b:B |- Lam x:A.b : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
by (DEPTH_SOLVE (ares_tac simple 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
goal thy "A:* b:A |- (Lam a:A.a)^b: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
by (DEPTH_SOLVE (ares_tac simple 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
goal thy "A:* B:* c:A b:B |- (Lam x:A.b)^ c: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
by (DEPTH_SOLVE (ares_tac simple 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
goal thy "A:* B:* |- Lam a:A.Lam b:B.a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
by (DEPTH_SOLVE (ares_tac simple 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
(* SECOND-ORDER TYPES *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
goal L2_thy "|- Lam A:*. Lam a:A.a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
by (DEPTH_SOLVE (ares_tac L2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
goal L2_thy "A:* |- (Lam B:*.Lam b:B.b)^A : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
by (DEPTH_SOLVE (ares_tac L2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
goal L2_thy "A:* b:A |- (Lam B:*.Lam b:B.b) ^ A ^ b: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
by (DEPTH_SOLVE (ares_tac L2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
goal L2_thy "|- Lam B:*.Lam a:(Pi A:*.A).a ^ ((Pi A:*.A)->B) ^ a: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
by (DEPTH_SOLVE (ares_tac L2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
(* Weakly higher-order proposiional logic *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
goal Lomega_thy "|- Lam A:*.A->A : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
by (DEPTH_SOLVE (ares_tac Lomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
goal Lomega_thy "B:* |- (Lam A:*.A->A) ^ B : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
by (DEPTH_SOLVE (ares_tac Lomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
goal Lomega_thy "B:* b:B |- (Lam y:B.b): ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
by (DEPTH_SOLVE (ares_tac Lomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
goal Lomega_thy "A:* F:*->* |- F^(F^A): ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
by (DEPTH_SOLVE (ares_tac Lomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
goal Lomega_thy "A:* |- Lam F:*->*.F^(F^A): ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
by (DEPTH_SOLVE (ares_tac Lomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
(* LF *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
goal LP_thy "A:* |- A -> * : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
goal LP_thy "A:* P:A->* a:A |- P^a: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
goal LP_thy "A:* P:A->A->* a:A |- Pi a:A.P^a^a: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
goal LP_thy "A:* P:A->* Q:A->* |- Pi a:A.P^a -> Q^a: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
goal LP_thy "A:* P:A->* |- Pi a:A.P^a -> P^a: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
goal LP_thy "A:* P:A->* |- Lam a:A.Lam x:P^a.x: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
goal LP_thy "A:* P:A->* Q:* |- (Pi a:A.P^a->Q) -> (Pi a:A.P^a) -> Q : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
goal LP_thy "A:* P:A->* Q:* a0:A |- \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
\	Lam x:Pi a:A.P^a->Q. Lam y:Pi a:A.P^a. x^a0^(y^a0): ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
by (DEPTH_SOLVE (ares_tac LP 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
(* OMEGA-ORDER TYPES *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
goal L2_thy "A:* B:* |- Pi C:*.(A->B->C)->C : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
by (DEPTH_SOLVE (ares_tac L2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
goal LOmega_thy "|- Lam A:*.Lam B:*.Pi C:*.(A->B->C)->C : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   128
by (DEPTH_SOLVE (ares_tac LOmega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
goal LOmega_thy "|- Lam A:*.Lam B:*.Lam x:A.Lam y:B.x : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
by (DEPTH_SOLVE (ares_tac LOmega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
goal LOmega_thy "A:* B:* |- ?p : (A->B) -> ((B->Pi P:*.P)->(A->Pi P:*.P))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
by (strip_asms_tac LOmega 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
by (DEPTH_SOLVE_1(ares_tac LOmega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
by (DEPTH_SOLVE_1(ares_tac LOmega 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
by (DEPTH_SOLVE_1(ares_tac LOmega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
by (DEPTH_SOLVE_1(ares_tac LOmega 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
by (DEPTH_SOLVE_1(ares_tac LOmega 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
by (etac pi_elim 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
by (etac pi_elim 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
(* Second-order Predicate Logic *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
goal LP2_thy "A:* P:A->* |- Lam a:A.P^a->(Pi A:*.A) : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
by (DEPTH_SOLVE (ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
goal LP2_thy "A:* P:A->A->* |- \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
\	(Pi a:A.Pi b:A.P^a^b->P^b^a->Pi P:*.P) -> Pi a:A.P^a^a->Pi P:*.P : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
by (DEPTH_SOLVE (ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
(* Antisymmetry implies irreflexivity: *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
goal LP2_thy "A:* P:A->A->* |- \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
\	?p: (Pi a:A.Pi b:A.P^a^b->P^b^a->Pi P:*.P) -> Pi a:A.P^a^a->Pi P:*.P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
by (strip_asms_tac LP2 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
by (DEPTH_SOLVE_1(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
by (DEPTH_SOLVE_1(ares_tac LP2 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
by (DEPTH_SOLVE_1(ares_tac LP2 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
by (DEPTH_SOLVE_1(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
by (DEPTH_SOLVE_1(ares_tac LP2 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
by (REPEAT(EVERY[etac pi_elim 1, assume_tac 1, TRY(assume_tac 1)]));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
(* LPomega *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
goal LPomega_thy "A:* |- Lam P:A->A->*.Lam a:A.P^a^a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
by (DEPTH_SOLVE (ares_tac LPomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   185
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
goal LPomega_thy "|- Lam A:*.Lam P:A->A->*.Lam a:A.P^a^a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
by (DEPTH_SOLVE (ares_tac LPomega 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   190
(* CONSTRUCTIONS *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
goal CC_thy "|- Lam A:*.Lam P:A->*.Lam a:A.P^a->Pi P:*.P: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   193
by (DEPTH_SOLVE (ares_tac CC 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
goal CC_thy "|- Lam A:*.Lam P:A->*.Pi a:A.P^a: ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
by (DEPTH_SOLVE (ares_tac CC 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
goal CC_thy "A:* P:A->* a:A |- ?p : (Pi a:A.P^a)->P^a";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
by (strip_asms_tac CC 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203
by (DEPTH_SOLVE_1(ares_tac CC 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   204
by (DEPTH_SOLVE_1(ares_tac CC 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
by (EVERY[etac pi_elim 1, assume_tac 1, assume_tac 1]);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   207
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
(* Some random examples *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
goal LP2_thy "A:* c:A f:A->A |- \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   211
\	Lam a:A. Pi P:A->*.P^c -> (Pi x:A. P^x->P^(f^x)) -> P^a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
by (DEPTH_SOLVE(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   213
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
goal CC_thy "Lam A:*.Lam c:A.Lam f:A->A. \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
\	Lam a:A. Pi P:A->*.P^c -> (Pi x:A. P^x->P^(f^x)) -> P^a : ?T";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   217
by (DEPTH_SOLVE(ares_tac CC 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   218
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   219
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
(* Symmetry of Leibnitz equality *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
goal LP2_thy "A:* a:A b:A |- ?p: (Pi P:A->*.P^a->P^b) -> (Pi P:A->*.P^b->P^a)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   222
by (strip_asms_tac LP2 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   223
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   224
by (DEPTH_SOLVE_1(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   225
by (DEPTH_SOLVE_1(ares_tac LP2 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   226
by (eres_inst_tac [("a","Lam x:A.Pi Q:A->*.Q^x->Q^a")] pi_elim 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   227
by (DEPTH_SOLVE_1(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   228
by (rewtac beta);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   229
by (etac imp_elim 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   230
by (rtac lam_bs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   231
by (DEPTH_SOLVE_1(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   232
by (DEPTH_SOLVE_1(ares_tac LP2 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   233
by (rtac lam_ss 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   234
by (DEPTH_SOLVE_1(ares_tac LP2 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   235
by (DEPTH_SOLVE_1(ares_tac LP2 2));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   236
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   237
by (assume_tac 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   238
uresult();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   239
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   240
maketest"END: file for Lambda-Cube examples";