【发布时间】:2016-04-11 16:05:53
【问题描述】:
鉴于以下对 和 的否定定义,我可以很容易地证明不同的情况,但我想以某种方式使用 Coq 将这个证明写在一个 forall 语句中。 Forall b1 b2 b3 : bool 其中一个为假返回真,三个为真返回假。如何在 Coq 中编写这个前提,以便我可以使用 split 等策略来分解连词等?
Definition negb (b:bool) : bool :=
match b with
| true => false
| false => true
end.
Definition andb3 (b1:bool) (b2:bool) (b3:bool) : bool :=
match b1 with
| true =>
match b2 with
| true => b3
| false => false
end
| false => false
end.
Definition nandb3 (b1:bool)(b2:bool)(b3:bool):bool :=
negb (andb3 b1 b2 b3).
Example nandb1: (nandb3 true false true) = true.
Proof. reflexivity. Qed.
Example nandb2: (nandb3 false true true) = true.
Proof. reflexivity. Qed.
【问题讨论】:
标签: coq coq-tactic