- 注释
使用(* COMMENTS HERE *)进行注释
- 分隔符
每个Coq命令都要加上.表示结束.
逻辑命题(Prop),数学集合(Set)和 抽象类型(Type)
- Check 检测表达式是否合理/以及表达式的类型
Coq < Check True.
True : Prop
Coq < Check ((3=5)/\True).
3 = 5 /\ True : Prop
Coq < Check (fun x:nat => x = 3).
fun x : nat => x = 3 : nat -> Prop
Coq < Check (forall x:nat, x < 3 \/ (exists y:nat, x = y + 3)).
forall x : nat, x < 3 \/ (exists y : nat, x = y + 3) : Prop
Coq < Check (let f := fun x => (x * 3,x) in f 3).
let f := fun x : nat => (x * 3, x) in f 3 : nat * nat
- Locate 找到隐藏在符号[ *,>,<,-> .... ]后面的函数
Coq < Locate "_ * _".
Notation
"x * y" := Nat.mul x y : nat_scope (default interpretation)
"x * y" := prod x y : type_scope
Coq < Locate "_ <= _".
Notation
"n <= m" := le n m : nat_scope (default interpretation)
Coq < Locate "_ -> _".
Notation
"A -> B" := forall _ : A, B : type_scope (default interpretation)