我在 coq 证明助手中定义自动机时遇到问题,创建此代码时显示错误:
(*automate*)
Record automaton :Type:=
mk_auto {
states : Set;
actions :Set;
initial : states;
transitions : states -> actions -> list states
}.
(*States*)
Inductive st :Set:= q0 | q1 |q2 .
Inductive acts:Set:=pred(p:nat)|event(e:bool).
Definition a :acts:=pred(0).
Definition b:acts:=pred(1).
Definition c:acts:=event(true).
Function trans (q:st)(x:acts) :list st :=
match q, x with
| q0, a => cons q1 nil
| q1, b => cons q0 nil
| q1, c => cons q2 nil
| _,_ => nil (A:=_)
end.
错误是:错误:此子句是多余的。(在本条款下划线“| q1, c => cons q2 nil”)
感谢您的关注。