src/ZF/UNITY/Constrains.ML
changeset 14060 c0c4af41fa3b
parent 14046 6616e6c53d48
child 14092 68da54626309
equal deleted inserted replaced
14059:5c457e25c95f 14060:c0c4af41fa3b
   432 (*To allow expansion of the program's definition when appropriate*)
   432 (*To allow expansion of the program's definition when appropriate*)
   433 val program_defs_ref = ref ([] : thm list);
   433 val program_defs_ref = ref ([] : thm list);
   434 
   434 
   435 (*proves "co" properties when the program is specified*)
   435 (*proves "co" properties when the program is specified*)
   436 
   436 
   437 fun constrains_tac i = 
   437 fun gen_constrains_tac(cs,ss) i = 
   438    SELECT_GOAL
   438    SELECT_GOAL
   439       (EVERY [REPEAT (Always_Int_tac 1),
   439       (EVERY [REPEAT (Always_Int_tac 1),
   440               REPEAT (etac Always_ConstrainsI 1
   440               REPEAT (etac Always_ConstrainsI 1
   441                       ORELSE
   441                       ORELSE
   442                       resolve_tac [StableI, stableI,
   442                       resolve_tac [StableI, stableI,
   443                                    constrains_imp_Constrains] 1),
   443                                    constrains_imp_Constrains] 1),
   444               rtac constrainsI 1,
   444               rtac constrainsI 1,
   445               (* Three subgoals *)
   445               (* Three subgoals *)
   446               rewrite_goal_tac [st_set_def] 3,
   446               rewrite_goal_tac [st_set_def] 3,
   447               REPEAT (Force_tac 2),
   447               REPEAT (Force_tac 2),
   448               full_simp_tac (simpset() addsimps !program_defs_ref) 1,
   448               full_simp_tac (ss addsimps !program_defs_ref) 1,
   449               ALLGOALS Clarify_tac,
   449               ALLGOALS (clarify_tac cs),
   450               REPEAT (FIRSTGOAL (etac disjE)),
   450               REPEAT (FIRSTGOAL (etac disjE)),
   451               ALLGOALS Clarify_tac,
   451               ALLGOALS Clarify_tac,
   452               REPEAT (FIRSTGOAL (etac disjE)),
   452               REPEAT (FIRSTGOAL (etac disjE)),
   453               ALLGOALS Clarify_tac,
   453               ALLGOALS (clarify_tac cs),
   454               ALLGOALS Asm_full_simp_tac,
   454               ALLGOALS (asm_full_simp_tac ss),
   455               ALLGOALS Clarify_tac]) i;
   455               ALLGOALS (clarify_tac cs)]) i;
       
   456 
       
   457 fun constrains_tac st = gen_constrains_tac (claset(), simpset()) st;
   456 
   458 
   457 (*For proving invariants*)
   459 (*For proving invariants*)
   458 fun always_tac i = 
   460 fun always_tac i = 
   459     rtac AlwaysI i THEN Force_tac i THEN constrains_tac i;
   461     rtac AlwaysI i THEN Force_tac i THEN constrains_tac i;