Search code examples
isabelle

Eisbach term parameters and subgoal_tac


I'm currently trying to get into Eisbach.

How can I achieve that in the subgoal_tac (see below) the value of the parameter A is used, and that A is not interpreted as some variable name? Is there some general way to do this or would this need special tailoring of the subgoal_tac tactic?

theory Scratch (* Isabelle2019 *)
imports
Main
"HOL-Eisbach.Eisbach"
begin

method test for A :: nat =
  subgoal_tac "A = 5"

lemma "True"
  apply (test 1)
(* 
proof (prove)
goal (2 subgoals):
 1. A = 5 ⟹ True
 2. A = 5
 *)
(* The A has a yellow background in the output pane*)
  oops

end

Solution

  • I don't know why it does not work with subgoal_tac. I think I read somewhere that all methods ending with _tac are kind of deprecated now.

    As a workaround you could use a Lemma:

    method test for A :: nat =
      (rule meta_mp[where P="A = 5"])
    
    lemma "True"
      apply (test 1)
    (*
    goal (2 subgoals):
     1. 1 = 5 ⟹ True
     2. 1 = 5
    *)