src/CTT/rew.ML
changeset 0 a5a9c433f639
child 1459 d12da312eff4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/CTT/rew.ML	Thu Sep 16 12:20:38 1993 +0200
     1.3 @@ -0,0 +1,43 @@
     1.4 +(*  Title: 	CTT/rew
     1.5 +    ID:         $Id$
     1.6 +    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
     1.7 +    Copyright   1991  University of Cambridge
     1.8 +
     1.9 +Simplifier for CTT, using Typedsimp
    1.10 +*)
    1.11 +
    1.12 +(*Make list of ProdE RS ProdE ... RS ProdE RS EqE
    1.13 +  for using assumptions as rewrite rules*)
    1.14 +fun peEs 0 = []
    1.15 +  | peEs n = EqE :: map (apl(ProdE, op RS)) (peEs (n-1));
    1.16 +
    1.17 +(*Tactic used for proving conditions for the cond_rls*)
    1.18 +val prove_cond_tac = eresolve_tac (peEs 5);
    1.19 +
    1.20 +
    1.21 +structure TSimp_data: TSIMP_DATA =
    1.22 +  struct
    1.23 +  val refl		= refl_elem
    1.24 +  val sym		= sym_elem
    1.25 +  val trans		= trans_elem
    1.26 +  val refl_red		= refl_red
    1.27 +  val trans_red		= trans_red
    1.28 +  val red_if_equal	= red_if_equal
    1.29 +  val default_rls 	= comp_rls
    1.30 +  val routine_tac 	= routine_tac routine_rls
    1.31 +  end;
    1.32 +
    1.33 +structure TSimp = TSimpFun (TSimp_data);
    1.34 +
    1.35 +val standard_congr_rls = intrL2_rls @ elimL_rls;
    1.36 +
    1.37 +(*Make a rewriting tactic from a normalization tactic*)
    1.38 +fun make_rew_tac ntac =
    1.39 +    TRY eqintr_tac  THEN  TRYALL (resolve_tac [TSimp.split_eqn])  THEN  
    1.40 +    ntac;
    1.41 +
    1.42 +fun rew_tac thms = make_rew_tac
    1.43 +    (TSimp.norm_tac(standard_congr_rls, thms));
    1.44 +
    1.45 +fun hyp_rew_tac thms = make_rew_tac
    1.46 +    (TSimp.cond_norm_tac(prove_cond_tac, standard_congr_rls, thms));