不能专注于COQ中剩余的未关注目标

发布于 2025-02-13 20:11:13 字数 1657 浏览 0 评论 0原文

我试图证明抽水引理(这是逻辑基础书的练习之一)。我以为我已经完成了mstarapp案例,但解释器告诉我,仍然存在未加注的目标。只有我不能将剩余的目标带到前面。我尝试了每个子弹级级别,但是每次我得到[focus]错误的子弹:不再是目标。我不知道我的证明是否有问题,还是解释器中的错误。任何帮助都将不胜感激。

- (* 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 :我不知道这是否相关,但在我的证明中更高(在mapp案例中)我有一个servert其关闭卷曲支架以不寻常的方式突出显示(以黄色而不是绿色 - 我正在使用VSCODE中的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. 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. 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).

unusual highlighting

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱了心跳 2025-02-20 20:11:13

您在一些早期的证明分支机构中没有完成业务。您提供的一个目标没有任何未完成的目标。您已经将未完成或录取 提出了一些较早的目标。或者可能您没有正确完成断言。如果您需要帮助,则需要显示证明的一部分。

这是您的证明开始的证明状态,并由您的解决方案解决
证明脚本。


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)
.

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 admited some of the earlier goals. Or probably you didn't finish the assert properly. 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)
.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文