如何在参数化归纳集上编写自定义归纳规则?

时间:2018-03-24 14:10:40

标签: isabelle induction

我正在尝试为归纳集编写自定义归纳规则。不幸的是,当我尝试将其应用于induction rule: my_induct_rule时,我得到了额外的,无法证明的情况。我有以下内容:

inductive iterate :: "('a ⇒ 'a ⇒ bool) ⇒ 'a ⇒ 'a ⇒ bool" for f where
  iter_refl [simp]: "iterate f a a"
| iter_step [elim]: "f a b ⟹ iterate f b c ⟹ iterate f a c"

theorem my_iterate_induct: "iterate f x y ⟹ (⋀a. P a a) ⟹ 
    (⋀a b c. f a b ⟹ iterate f b c ⟹ P b c ⟹ P a c) ⟹ P x y"
  by (induction x y rule: iterate.induct) simp_all

lemma iter_step_backwards: "iterate f a b ⟹ f b c ⟹ iterate f a c"
  proof (induction a b rule: my_iterate_induct)
    ...
  qed

显然,自定义归纳规则并没有给我任何新的力量(我的真实用例更复杂),但这有点重要。 my_iterate_induct与自动生成的iterate.induct规则完全相同,据我所知,但在证明块中我有以下目标:

goal (3 subgoals):
 1. iterate ?f a b
 2. ⋀a. iterate f a a ⟹ f a c ⟹ iterate f a c
 3. ⋀a b ca. ?f a b ⟹ iterate ?f b ca ⟹ 
      (iterate f b ca ⟹ f ca c ⟹ iterate f b c) ⟹ iterate f a ca ⟹ 
        f ca c ⟹ iterate f a c

目标1似乎是由于某些未能统一?ff与实际参数f,但如果我忽略了f固定并尝试induction f a b rule: my_iterate_induct的事实,我只是得到Failed to apply proof method,正如预期的那样。如何获得常规iterate.induct提供的良好行为?

1 个答案:

答案 0 :(得分:2)

您需要使用override func viewDidLoad() { super.viewDidLoad() setUpChatLogCollection() setupChatLogCollectionConstraints() getChatMessages() } 属性将自定义归纳规则声明为“消耗”一个前提(请参阅Isabelle / Isar参考手册,§6.5.1):

consumes