my first coq
2012-02-17 23:43
134 查看
形式化方法作业
写下第一题
一个好的开始
(** **** Exercise: 1 star (nandb) *)
(** Complete the definition of the following function, then make
sure that the [Example] assertions below each can be verified by
Coq. *)
(** This function should return [true] if either or both of
its inputs are [false]. *)
Definition nandb (b1:bool) (b2:bool) : bool :=
(* FILL IN HERE *)
match b1 with
| true => (negb b2)
| false => true
end.
(** Remove "[Admitted.]" and fill in each proof with
"[Proof. simpl. reflexivity. Qed.]" *)
Example test_nandb1: (nandb true false) = true.
Proof. simpl. reflexivity. Qed.
Example test_nandb2: (nandb false false) = true.
Proof. simpl. reflexivity. Qed.
Example test_nandb3: (nandb false true) = true.
Proof. simpl. reflexivity. Qed.
Example test_nandb4: (nandb true true) = false.
Proof. simpl. reflexivity. Qed.
写下第一题
一个好的开始
(** **** Exercise: 1 star (nandb) *)
(** Complete the definition of the following function, then make
sure that the [Example] assertions below each can be verified by
Coq. *)
(** This function should return [true] if either or both of
its inputs are [false]. *)
Definition nandb (b1:bool) (b2:bool) : bool :=
(* FILL IN HERE *)
match b1 with
| true => (negb b2)
| false => true
end.
(** Remove "[Admitted.]" and fill in each proof with
"[Proof. simpl. reflexivity. Qed.]" *)
Example test_nandb1: (nandb true false) = true.
Proof. simpl. reflexivity. Qed.
Example test_nandb2: (nandb false false) = true.
Proof. simpl. reflexivity. Qed.
Example test_nandb3: (nandb false true) = true.
Proof. simpl. reflexivity. Qed.
Example test_nandb4: (nandb true true) = false.
Proof. simpl. reflexivity. Qed.
相关文章推荐
- This is my first C# BBS blog!
- My First Blog Article
- My first blog
- These are the problems and solutions that I discovered while writing my first Cocoa program for Mac
- All came true,My first day in new company
- My first techological blog
- my first blog article
- (1)写一个程序,用于分析一个字符串中各个单词出现的频率,并将单词和它出现的频率输出显示。(单词之间用空格隔开,如“Hello World My First Unit Test”); (2)编写单元测试进行测试; (3)用ElcEmma查看代码覆盖率,要求覆盖率达到100%。
- My first bash program (running on Ubuntu 9.04) and Learnning tips
- My first blog on csdn
- cellular genetic algorithm:my first algorithm creation
- 【面试】My first interview_大联大商贸有限公司(深圳)
- My first day
- My first post in CSDN
- This is to memorize my first day in this blog.
- My First ACM
- Python sample code of hudson remote api, my first Python hello world
- 7 lessons I wish I learned before starting my first game internship
- HDU3706 Second My Problem First
- My first Blog