ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:19.31KB ,
资源ID:3141727      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-3141727.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Coq中文手册Word下载.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

Coq中文手册Word下载.docx

1、Section Loc. End Loc. Print ident 打印定义,ident 可以是本段定义的任何对象,类型以及本段所包括的库中定义的对象和类型。Example:Print R. Check ident 检查类型,check 可以检查本段定义的对象和类型。Variable tab:Type. Check tab. Definition ident :type := define 定义一个对象,可以选择性声明其类型,但是必须要有定义体,即:=后的内容。Definition setiod:=nat. Variable ident :type 声明一个局部变量,只需给出类型,不需要定义体

2、。当没有 section 包围时,顶级的局部变量等价于全局变量。Variable ck: nat. Parameter ident :声明一个全局变量,只需给出类型,不需要定义体。Parameter ck:nat. Inductive ident := | constru : type1typ2| . 定义一个归纳体,可以包含若干个构造子(constru),但是每个构造子的类型的最后必须是归纳体类型。Inductive expr : Type : | Evar : ident expr | Econst : Z | Eadd : expr | Esub :. Lemma em:定义一个猜想,其

3、类型为 type。通常需要给出证明 Lemma not_all_not_ex :forall P:U Prop, (forall n:U, P n) exists n :U, P n. Fixpoint fun (A:type)(B:type):type:= tail. fixpoint 可以定义递归函数,其中括号中的是传入参数。在 tail 中常使用 match 结构可以对归纳结构进行拆分。Fixpoint tail_plus n m:nat: match n with | 0=m | S n=tail_plus n (S m) end. Compute expr 归纳演算 expr 的值。

4、Compute 1+1. Structure exp := dom1:typ1; dom2:typ2; dom3:typ3:=value 定义结构体,可以包含若干个域,域的名字不能重复,通过 dom1 exp 来访问域的值,利用Build_exp 来构造。Structure person:= name:string; age:nat . Coercion Rela: typ1typ2 建立从 typ1 到 typ2 的强制子类型约束,Rela 是之前定义的转换关系。Variable dog:Type. Variable husky:Variable belong:huskydog. Coerc

5、ion belong:huskySearch keyword 搜索关键字的定义 Search nat. SearchAbout keyword 搜索所有关键字相关的定义 SearchAbout nat. SearchPattern exp 搜索指定形式的定义式。SearchAbout ( _ nat). 特殊库的使用 String:打开字符串库符之后字符串的表述 :“Ser” Check “Ds”. 构造子有 nil 和 n:l 两个,可用+连接两个列表。Ensemble 需要先定义元素类型,然后可以声明集合。Variable I:Variable set1:Ensemble I. Check

6、 Union I set1 set2. Check Intersection I set1 set2 证明相关 Proof. 开始证明 Qed. 证明结束 Hint Resolve lem 将 lem 加入 auto 库 证明策略:intros/intro 用于 goal 里面有 forall,Pintros P H0. intros. unfold 展开非递归函数 unfold is_ture. unfold is_true in H. rewrite H 将 H 的右边当作左边带入 goal 或者指定的目标 rewrite H. rewrite H in H0. rewrite H 将 H

7、 的左边当作右边带入 goal 或指定目标 H. rewrite Q). 高级技法: 证明即程序: Definition half(n:nat):p:nat & n = 2*p +n = S(2*p). induction n. exists 0;left; destruct IHn as x Hx | Hx. exists x;right; exists (S x); Require Import Arith. rewrite Hx; ring. Defined. Print sigT. Compute half 3. Check existT. Definition half(n: nat

8、): nat := match half n with existT p _ = p end. 附录 1:Ensemble 定义:Library Coq.Sets.Ensembles Section Ensembles. Variable U : Type. Definition Ensemble := U Prop. Definition In (A:Ensemble) (x:U) : Prop := A x. Definition Included (B C:Ensemble) := forall x:U, In B x In C x. Inductive Empty_set : Ense

9、mble :=. Inductive Full_set : Full_intro : forall x:U, In Full_set x. NB: The following definition buildsin equality of elements in U as Leibniz equality. This may have to be changed if we replace U by a Setoid on U with its own equality eqs, with In_singleton: (y: U)(eqs x y) (In (Singleton x) y).

10、Inductive Singleton (x: In_singleton : In (Singleton x) x. Inductive Union (B C: | Union_introl : In (Union B C) x | Union_intror :U, In C x In (Union B C) x. Definition Add (B:= Union B (Singleton x). Inductive Intersection (B C: Intersection_intro : In C x In (Intersection B C) x. Inductive Couple

11、 (x y: | Couple_l : In (Couple x y) x | Couple_r : In (Couple x y) y. Inductive Triple (x y z: | Triple_l : In (Triple x y z) x | Triple_m : In (Triple x y z) y | Triple_r : In (Triple x y z) z. Definition Complement (A:= fun x:U = In A x. Definition Setminus (B C: fun x: In B x / In C x. Definition

12、 Subtract (B:= Setminus B (Singleton x). Inductive Disjoint (B C: Disjoint_intro : (forall x:U, In (Intersection B C) x) Disjoint B C. Inductive Inhabited (B: Inhabited_intro : Inhabited B. Definition Strict_Included (B C:= Included B C / B C. Definition Same_set (B C:= Included B C / Included C B.

13、Extensionality Axiom Axiom Extensionality_Ensembles : forall A B:Ensemble, Same_set A B A = B. End Ensembles. Hint Unfold In Included Same_set Strict_Included Add Setminus Subtract: sets v62. Hint Resolve Union_introl Union_intror Intersection_intro In_singleton Couple_l Couple_r Triple_l Triple_m Triple_r Disjoint_intro Extensionality_Ensembles: sets v62.

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2