coq

    3熱度

    1回答

    我有幾個證據遵循相同的結構。其中第一個可以用trivial完成,其他所有用auto with foo_db完成,其中foo_db是在第一個證明完成後填充提示的提示數據庫。我想寫一個使用auto with foo_db來解決所有這些證明的Ltac程序。但是,當運行該Ltac解決我的第一個證明foo_db尚不存在,所以科克抱怨:Error: No such Hint database: foo_db.

    7熱度

    1回答

    當我使用Coq文件中的Extraction Language Haskell.將Coq提取/編譯成Haskell並運行coqtop -compile mymodule.v > MyModule.hs時,我得到一個以module Main where開頭的Haskell模塊。 是否有選項可以設置生成的Haskell模塊名稱? 我現在管的sed這樣的 - coqtop -compile mymodul

    3熱度

    1回答

    考慮下面的代碼: Inductive Even : nat -> Prop := | EO : Even O | ESS : forall n, Even n -> Even (S (S n)). Fixpoint is_even_prop (n : nat) : Prop := match n with | O => True | S O => False

    0熱度

    2回答

    考慮這個簡單的發展。我有兩個複雜數據類型: Inductive A := | A1 | A2. Inductive B := | B1 : A -> B | B2. 現在我介紹關係的概念和定義排序的數據類型A和B表示爲感應數據類型: Definition relation (X : Type) := X -> X -> Prop. Reserved Notation "a1 '

    2熱度

    2回答

    Inductive ty: Set := | I | O. Definition f (x: ty) (y: ty): nat := if x = y then 0 else 1. 我想要的功能f比較ty類型的兩個方面,但它並不能編譯,我看到這個錯誤: The term x = y has type Prop which is not a (co-)inductive typ

    0熱度

    2回答

    假設我寫勒柯克一個已知點的算法,總結了一個號碼的所有「半」: Fixpoint sum_of_halves (a : nat) : nat := match a with | 0 => 0 | 2 * k => a + (sum_of_halves k) | S (2 * k) => a + (sum_of_halves k) end. 試圖評

    1熱度

    2回答

    在問題Is there a minimal complete set of tactics in Coq?中,回答提到exact就足以證明所有目標。有人可以解釋和舉例嗎?例如,如果A,B作爲Prop的目標A \/ B -> B \/ A如何僅由一堆exact證明?如果您還有其他更好的例子,請不要猶豫,以及回答。重點是對這個問題給出一些解釋並給出一個不平凡的例子。

    0熱度

    1回答

    如何在fq(x)= 0的情況下定義函數,如f(x)= 0? 如果我做這樣的事情在OСaml, Definition test (i:nat):nat := if i < 5 then 0 else 1. 它抱怨 Error: The term i < 5 has type Prop which is not a (co-)inductive type.

    1熱度

    1回答

    我試圖從Software Foundations, vol. 2端口msubst_R Agda。我試圖通過對術語使用類型化表示來避免繁重的工作。下面是我的一切到msubst_R;我認爲以下一切都很好,但這是有問題的部分。 open import Data.Nat open import Relation.Binary.PropositionalEquality hiding (subst) o

    0熱度

    1回答

    Require Import FMapAVL. Require Import OrderedTypeEx. Module M := FMapAVL.Make(Nat_as_OT). Fixpoint cc (n: nat) (c: M.t nat):bool := match M.find n c with | None => false | Some e =