@@ -247,15 +247,17 @@ End
247
247
| (Tyvar v as tv) -> [tv]
248
248
*)
249
249
250
- val _ = tDefine " tyvars " `
250
+ Definition tyvars_def:
251
251
tyvars x =
252
252
dtcase x of (Tyapp _ args) => itlist union (MAP tyvars args) []
253
- | (Tyvar tv) => [tv]`
254
- (WF_REL_TAC `measure (type_size)` THEN Induct_on `args`
253
+ | (Tyvar tv) => [tv]
254
+ Termination
255
+ WF_REL_TAC `measure (type_size)` THEN Induct_on `args`
255
256
THEN FULL_SIMP_TAC (srw_ss()) [type_size_def]
256
257
THEN REPEAT STRIP_TAC THEN FULL_SIMP_TAC std_ss [] THEN RES_TAC
257
258
THEN REPEAT (POP_ASSUM (MP_TAC o SPEC_ALL)) THEN REPEAT STRIP_TAC
258
- THEN DECIDE_TAC);
259
+ THEN DECIDE_TAC
260
+ End
259
261
260
262
(*
261
263
let rec type_subst i ty =
@@ -274,18 +276,20 @@ Definition rev_assocd_def:
274
276
| ((x,y)::l) => if y = a then x else rev_assocd a l d
275
277
End
276
278
277
- val _ = tDefine " type_subst " `
279
+ Definition type_subst_def:
278
280
type_subst i ty =
279
281
dtcase ty of
280
282
Tyapp tycon args =>
281
283
let args' = MAP (type_subst i) args in
282
284
if args' = args then ty else Tyapp tycon args'
283
- | _ => rev_assocd ty i ty`
284
- (WF_REL_TAC `measure (type_size o SND)` THEN Induct_on `args`
285
+ | _ => rev_assocd ty i ty
286
+ Termination
287
+ WF_REL_TAC `measure (type_size o SND)` THEN Induct_on `args`
285
288
THEN FULL_SIMP_TAC (srw_ss()) [type_size_def]
286
289
THEN REPEAT STRIP_TAC THEN FULL_SIMP_TAC std_ss [] THEN RES_TAC
287
290
THEN REPEAT (POP_ASSUM (MP_TAC o SPEC_ALL)) THEN REPEAT STRIP_TAC
288
- THEN DECIDE_TAC);
291
+ THEN DECIDE_TAC
292
+ End
289
293
290
294
(*
291
295
let bool_ty = mk_type("bool",[]);;
@@ -716,7 +720,7 @@ val ZERO_LT_term_size = Q.prove(
716
720
`!t. 0 < my_term_size t`,
717
721
Cases THEN EVAL_TAC THEN DECIDE_TAC);
718
722
719
- val inst_aux_def = tDefine " inst_aux " `
723
+ Definition inst_aux_def:
720
724
(inst_aux (env:(term # term) list) tyin tm) =
721
725
dtcase tm of
722
726
Var n ty => let ty' = type_subst tyin ty in
@@ -745,12 +749,14 @@ val inst_aux_def = tDefine "inst_aux" `
745
749
t' <- inst_aux ((Var v1 ty,Var v1 ty')::env) tyin
746
750
(vsubst_aux [(Var v1 ty,y)] t) ;
747
751
return (Abs y' t') od)
748
- od`
749
- (WF_REL_TAC `measure (\(env,tyin,tm). my_term_size tm)`
752
+ od
753
+ Termination
754
+ WF_REL_TAC `measure (\(env,tyin,tm). my_term_size tm)`
750
755
THEN SIMP_TAC (srw_ss()) [my_term_size_def]
751
756
THEN REPEAT STRIP_TAC
752
757
THEN FULL_SIMP_TAC std_ss [my_term_size_vsubst_aux]
753
- THEN DECIDE_TAC)
758
+ THEN DECIDE_TAC
759
+ End
754
760
755
761
Definition inst_def:
756
762
inst tyin tm = if tyin = [] then return tm else inst_aux [] tyin tm
0 commit comments