简体   繁体   English

无法专注于 Coq 中剩余的未重点目标

[英]Cannot focus on a remaining unfocused goal in Coq

I am trying to prove the pumping Lemma (which is one of the exercises of the Logical Foundations book).我试图证明抽引引理(这是逻辑基础书的练习之一)。 I thought I had completed the MStarApp case but the interpreter tells me that there are still unfocused goals remaining.我以为我已经完成了MStarApp案例,但口译员告诉我仍然存在不集中的目标。 Only I can't bring this remaining goal to the front.只有我不能把这个剩下的目标带到前面。 I tried every bullet level but each time I get [Focus] Wrong bullet: No more goals.我尝试了每个子弹级别,但每次我得到[Focus] Wrong bullet: No more goals. I don't know if something is wrong with my proof or if it's a bug in the interpreter.我不知道我的证明是否有问题,或者它是否是解释器中的错误。 Any help would be much appreciated.任何帮助将非常感激。

- (* MStarApp *)
    intros.
    destruct s1.
    -- replace ([ ] ++ s2) with s2 in *. apply (IH2 H).
       reflexivity.
    -- pose proof (lt_ge_cases (length (x::s1)) (pumping_constant re)) as [
    Hs1lt | Hs1ge].
      --- exists [ ], (x::s1), s2. repeat split.
        + unfold not. intro. inversion H0.
        + simpl. simpl in Hs1lt. 
          apply n_lt_m__n_le_m in Hs1lt.
          apply Hs1lt.
        + simpl. intro m. 
          apply (napp_star T m (x::s1) s2 re Hmatch1 Hmatch2).
      --- unfold ge in Hs1ge. pose proof (IH1 Hs1ge) as [
        s2' [s3' [s4' [Hxs1Eq [Hs3notEmpty [
        Hlens2's3' Hnapp]]]]]].
        exists s2', s3', (s4' ++ s2). repeat split.
        + rewrite Hxs1Eq. repeat rewrite <- app_assoc.
          reflexivity.
        + assumption.
        + simpl. assumption.
        + intro m. pose proof Hnapp m.
          replace (s2' ++ napp m s3' ++ s4' ++ s2) with 
          ((s2' ++ napp m s3' ++ s4') ++ s2).
          constructor.
          ++ assumption.
          ++ assumption.
          ++ repeat rewrite <- app_assoc. reflexivity.
(* 'There are unfocused goals.' *)

Edit : I don't know if this is relevant, but higher in my proof (in the MApp case) I have an assert whose closing curly bracket is highlighted in an unusual way (in yellow instead of green -- I am using the Coq language support extension in VSCode).编辑:我不知道这是否相关,但在我的证明中更高(在MApp案例中)我有一个assert ,其右大括号以不寻常的方式突出显示(黄色而不是绿色 - 我正在使用 Coq VSCode 中的语言支持扩展)。

不寻常的突出显示

You have unfinished business in some of the earlier proof branches.您在一些较早的证明分支中有未完成的工作。 The one you are providing does not have any unfinished goals.您提供的没有任何未完成的目标。 You have left unfinished or admit ed some of the earlier goals.你还没有完成或admit了一些早期的目标。 Or probably you didn't finish the assert properly.或者您可能没有正确完成assert You need to show that part of the proof if you want help with that.如果您需要帮助,您需要出示证明的那一部分。

This is the proof state where your proof begins, and it is solved by your proof script.这是您的证明开始的证明状态,它由您的证明脚本解决。


Lemma foo   
(T: Type)
(s1 s2: list T)
(re: reg_exp T)
(Hmatch1: s1 =~ re)
(Hmatch2: s2 =~ Star re)
(IH1: pumping_constant re <= length s1 ->
      exists s2 s3 s4 : list T,
        s1 = s2 ++ s3 ++ s4 /\
        s3 <> [ ] /\
        length s2 + length s3 <= pumping_constant re /\
        (forall m : nat, s2 ++ napp m s3 ++ s4 =~ re))
(IH2: pumping_constant (Star re) <= length s2 ->
      exists s1 s3 s4 : list T,
        s2 = s1 ++ s3 ++ s4 /\
        s3 <> [ ] /\
        length s1 + length s3 <= pumping_constant (Star re) /\
        (forall m : nat, s1 ++ napp m s3 ++ s4 =~ Star re))
:
pumping_constant (Star re) <= length (s1 ++ s2) ->
exists s0 s3 s4 : list T,
  s1 ++ s2 = s0 ++ s3 ++ s4 /\
  s3 <> [ ] /\
  length s0 + length s3 <= pumping_constant (Star re) /\
  (forall m : nat, s0 ++ napp m s3 ++ s4 =~ Star re)
.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM