src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
changeset 32970 fbd2bb2489a8
parent 32966 5b21661fe618
child 33004 715566791eb0
equal deleted inserted replaced
32969:15489e162b21 32970:fbd2bb2489a8
   659     val (c, T) = dest_Const (fst (strip_intro_concl 0 (prop_of (hd pre_intros))))
   659     val (c, T) = dest_Const (fst (strip_intro_concl 0 (prop_of (hd pre_intros))))
   660     val _ = tracing ("Registering introduction rules of " ^ c)
   660     val _ = tracing ("Registering introduction rules of " ^ c)
   661     val _ = tracing (commas (map (Display.string_of_thm_global thy) pre_intros))
   661     val _ = tracing (commas (map (Display.string_of_thm_global thy) pre_intros))
   662     val nparams = guess_nparams T
   662     val nparams = guess_nparams T
   663     val pre_elim = 
   663     val pre_elim = 
   664       (Drule.standard o (setmp_CRITICAL quick_and_dirty true (SkipProof.make_thm thy)))
   664       (Drule.standard o Skip_Proof.make_thm thy)
   665       (mk_casesrule (ProofContext.init thy) nparams pre_intros)
   665       (mk_casesrule (ProofContext.init thy) nparams pre_intros)
   666   in register_predicate (pre_intros, pre_elim, nparams) thy end
   666   in register_predicate (pre_intros, pre_elim, nparams) thy end
   667 
   667 
   668 fun set_generator_name pred mode name = 
   668 fun set_generator_name pred mode name = 
   669   let
   669   let
  2080         THEN print_tac "after pred_iffI"
  2080         THEN print_tac "after pred_iffI"
  2081         THEN prove_one_direction thy clauses preds modes pred mode moded_clauses
  2081         THEN prove_one_direction thy clauses preds modes pred mode moded_clauses
  2082         THEN print_tac "proved one direction"
  2082         THEN print_tac "proved one direction"
  2083         THEN prove_other_direction thy modes pred mode moded_clauses
  2083         THEN prove_other_direction thy modes pred mode moded_clauses
  2084         THEN print_tac "proved other direction")
  2084         THEN print_tac "proved other direction")
  2085       else (fn _ => setmp_CRITICAL quick_and_dirty true SkipProof.cheat_tac thy))
  2085       else fn _ => Skip_Proof.cheat_tac thy)
  2086   end;
  2086   end;
  2087 
  2087 
  2088 (* composition of mode inference, definition, compilation and proof *)
  2088 (* composition of mode inference, definition, compilation and proof *)
  2089 
  2089 
  2090 (** auxillary combinators for table of preds and modes **)
  2090 (** auxillary combinators for table of preds and modes **)
  2108 fun prove thy clauses preds modes moded_clauses compiled_terms =
  2108 fun prove thy clauses preds modes moded_clauses compiled_terms =
  2109   map_preds_modes (prove_pred thy clauses preds modes)
  2109   map_preds_modes (prove_pred thy clauses preds modes)
  2110     (join_preds_modes moded_clauses compiled_terms)
  2110     (join_preds_modes moded_clauses compiled_terms)
  2111 
  2111 
  2112 fun prove_by_skip thy _ _ _ _ compiled_terms =
  2112 fun prove_by_skip thy _ _ _ _ compiled_terms =
  2113   map_preds_modes (fn pred => fn mode => fn t =>
  2113   map_preds_modes (fn pred => fn mode => fn t => Drule.standard (Skip_Proof.make_thm thy t))
  2114       Drule.standard (setmp_CRITICAL quick_and_dirty true (SkipProof.make_thm thy) t))
       
  2115     compiled_terms
  2114     compiled_terms
  2116     
  2115     
  2117 fun prepare_intrs thy prednames =
  2116 fun prepare_intrs thy prednames =
  2118   let
  2117   let
  2119     val intrs = maps (intros_of thy) prednames
  2118     val intrs = maps (intros_of thy) prednames