merged
authorwenzelm
Mon, 15 Jun 2015 23:56:40 +0200
changeset 60491 2803bc16742c
parent 60487 2abfcf85c627 (current diff)
parent 60490 9b28f446d9c5 (diff)
child 60492 db0f4f4c17c7
merged
--- a/NEWS	Mon Jun 15 21:33:26 2015 +0100
+++ b/NEWS	Mon Jun 15 23:56:40 2015 +0200
@@ -65,6 +65,9 @@
 
 *** Pure ***
 
+* The vacuous fact "TERM x" may be established "by fact" or as `TERM x`
+as well, not just "by this" or "." as before.
+
 * Configuration option rule_insts_schematic has been discontinued
 (intermediate legacy feature in Isabelle2015).  INCOMPATIBILITY.
 
--- a/src/HOL/Tools/functor.ML	Mon Jun 15 21:33:26 2015 +0100
+++ b/src/HOL/Tools/functor.ML	Mon Jun 15 23:56:40 2015 +0200
@@ -9,7 +9,7 @@
   val find_atomic: Proof.context -> typ -> (typ * (bool * bool)) list
   val construct_mapper: Proof.context -> (string * bool -> term)
     -> bool -> typ -> typ -> term
-  val functorx: string option -> term -> local_theory -> Proof.state
+  val functor_: string option -> term -> local_theory -> Proof.state
   val functor_cmd: string option -> string -> Proof.context -> Proof.state
   type entry
   val entries: Proof.context -> entry list Symtab.table
@@ -269,7 +269,7 @@
     |> Proof.theorem NONE after_qed (map (fn t => [(t, [])]) [comp_prop, id_prop])
   end
 
-val functorx = gen_functor Syntax.check_term;
+val functor_ = gen_functor Syntax.check_term;
 val functor_cmd = gen_functor Syntax.read_term;
 
 val _ =
--- a/src/Pure/Isar/proof_context.ML	Mon Jun 15 21:33:26 2015 +0100
+++ b/src/Pure/Isar/proof_context.ML	Mon Jun 15 23:56:40 2015 +0200
@@ -909,12 +909,17 @@
       (fn st => comp_hhf_tac ctxt (Drule.incr_indexes st th) i st) APPEND
       comp_incr_tac ctxt ths i;
 
+val vacuous_facts = [Drule.termI];
+
 in
 
 fun fact_tac ctxt facts = Goal.norm_hhf_tac ctxt THEN' comp_incr_tac ctxt facts;
 
 fun potential_facts ctxt prop =
-  Facts.could_unify (facts_of ctxt) (Term.strip_all_body prop);
+  let
+    val body = Term.strip_all_body prop;
+    val vacuous = filter (fn th => Term.could_unify (body, Thm.concl_of th)) vacuous_facts;
+  in Facts.could_unify (facts_of ctxt) body @ vacuous end;
 
 fun some_fact_tac ctxt = SUBGOAL (fn (goal, i) => fact_tac ctxt (potential_facts ctxt goal) i);
 
--- a/src/Pure/Syntax/syntax_phases.ML	Mon Jun 15 21:33:26 2015 +0100
+++ b/src/Pure/Syntax/syntax_phases.ML	Mon Jun 15 23:56:40 2015 +0200
@@ -399,8 +399,9 @@
           val limit = Config.get ctxt Syntax.ambiguity_limit;
 
           (*brute-force disambiguation via type-inference*)
-          fun check t = (Syntax.check_term ctxt (constrain t); Exn.Res t)
-            handle exn as ERROR _ => Exn.Exn exn;
+          fun check t =
+            (Syntax.check_term (Proof_Context.allow_dummies ctxt) (constrain t); Exn.Res t)
+              handle exn as ERROR _ => Exn.Exn exn;
 
           val results' =
             if parsed_len > 1 then