【问题标题】:In the coq tactics language, what is the difference between intro and intros在coq战术语言中,intro和intros有什么区别
【发布时间】:2018-04-26 01:04:07
【问题描述】:

在 Coq 战术语言中,有什么区别

intro

intros?

【问题讨论】:

    标签: coq coq-tactic


    【解决方案1】:

    如果不提供参数,introintros 的行为会有所不同

    根据reference manual

    如果目标既不是产品,也不是以 let 定义开头,则策略 intro 将应用策略 hnf,直到可以应用策略 intro 或目标不可缩小。

    另一方面,intros,作为intro 策略的变体,

    重复intro,直到遇到head-constant。它永远不会减少 head-constants 并且永远不会失败。

    例子:

    Goal not False.
      (* does nothing *)
      intros.
      (* unfolds `not`, revealing `False -> False`;
         moves the premise to the context *)      
      intro.
    Abort.       
    

    注意:如果提供了参数,introintros 都会做同样的事情 (intro contra / intros contra)。

    intros 是多变量,intro 只能接受 0 或 1 个参数

    Goal True -> True -> True.
      Fail intro t1 t2.
      intros t1 t2.  (* or `intros` if names do not matter *)
    Abort.
    

    intro支持介绍模式

    Goal False -> False.
      Fail intro [].
      intros [].
    Qed.
    

    有关介绍模式的一些信息可以在manualSoftware Foundations 书中找到。另请参阅 this example 几个介绍模式的不那么简单的组合。

    intros不支持after/before/at top/at bottom开关

    假设我们有这样的证明状态

    H1 : True
    H2 : True /\ True
    H3 : True /\ True /\ True
    ==========
    True /\ True /\ True /\ True -> True
    

    然后例如intro H4 after H3 会像这样修改证明状态:

    H1 : True
    H2 : True /\ True
    H4 : True /\ True /\ True /\ True 
    H3 : True /\ True /\ True
    ==========
    True
    

    intro H4 after H1 将产生

    H4 : True /\ True /\ True /\ True 
    H1 : True
    H2 : True /\ True
    H3 : True /\ True /\ True
    ==========
    True
    

    【讨论】:

    • 手册中说intros 重复intro 有点不正确——它从不展开定义,所以repeat introintros 不同。它重复的是 intro 没有 hnf 步骤。
    • 我认为手册说明了您在第二句话中所说的内容:“它永远不会减少 head-constants ...”
    • 是的,这确实有助于澄清,但我仍然认为 intros 不会重复 intro 并且手册可能会强调这种差异(我认为意外展开很重要)。当我遇到github.com/coq/coq/issues/5394 时,这种差异真的让我感到惊讶。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-25
    • 1970-01-01
    • 2015-04-30
    • 1970-01-01
    • 2020-01-29
    • 2010-11-19
    • 2020-03-17
    相关资源
    最近更新 更多