From 6a3c740296e90722603564cad1c4d1acfb0cea5b Mon Sep 17 00:00:00 2001 From: Robbert Krebbers <mail@robbertkrebbers.nl> Date: Mon, 23 Jan 2017 21:23:00 +0100 Subject: [PATCH] Error message when the deprecated * specialization pattern is used. --- theories/proofmode/spec_patterns.v | 6 +++++- theories/proofmode/tactics.v | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/theories/proofmode/spec_patterns.v b/theories/proofmode/spec_patterns.v index 16d5d6f05..8c1d836d3 100644 --- a/theories/proofmode/spec_patterns.v +++ b/theories/proofmode/spec_patterns.v @@ -12,7 +12,8 @@ Inductive spec_pat := | SGoal : spec_goal → spec_pat | SGoalPersistent : spec_pat | SGoalPure : spec_pat - | SName : string → spec_pat. + | SName : string → spec_pat + | SForall : spec_pat. Module spec_pat. Inductive token := @@ -22,6 +23,7 @@ Inductive token := | TBracketR : token | TPersistent : token | TPure : token + | TForall : token | TModal : token | TFrame : token. @@ -35,6 +37,7 @@ Fixpoint tokenize_go (s : string) (k : list token) (kn : string) : list token := | String "]" s => tokenize_go s (TBracketR :: cons_name kn k) "" | String "#" s => tokenize_go s (TPersistent :: cons_name kn k) "" | String "%" s => tokenize_go s (TPure :: cons_name kn k) "" + | String "*" s => tokenize_go s (TForall :: cons_name kn k) "" | String ">" s => tokenize_go s (TModal :: cons_name kn k) "" | String "$" s => tokenize_go s (TFrame :: cons_name kn k) "" | String a s => @@ -57,6 +60,7 @@ Fixpoint parse_go (ts : list token) (k : list spec_pat) : option (list spec_pat) | TBracketL :: ts => parse_goal ts (SpecGoal false false [] []) k | TModal :: TBracketL :: ts => parse_goal ts (SpecGoal true false [] []) k | TModal :: ts => parse_go ts (SGoal (SpecGoal true true [] []) :: k) + | TForall :: ts => parse_go ts (SForall :: k) | _ => None end with parse_goal (ts : list token) (g : spec_goal) diff --git a/theories/proofmode/tactics.v b/theories/proofmode/tactics.v index e84c9e2f8..844c3d69a 100644 --- a/theories/proofmode/tactics.v +++ b/theories/proofmode/tactics.v @@ -285,6 +285,9 @@ Local Tactic Notation "iSpecializePat" constr(H) constr(pat) := let rec go H1 pats := lazymatch pats with | [] => idtac + | SForall :: ?pats => + idtac "the * specialization pattern is deprecated because it is applied implicitly"; + go H1 pats | SName ?H2 :: ?pats => eapply tac_specialize with _ _ H2 _ H1 _ _ _ _; (* (j:=H1) (i:=H2) *) [env_cbv; reflexivity || fail "iSpecialize:" H2 "not found" -- GitLab