我想通过为true,true匹配大小写添加一个额外的大小写来更改函数boolfunction。现在,该函数为case true,true返回true,我希望将此case也编码为false。我想知道是否有一种方法可以在Coq中进行编码。
Definition boolfunction (c d : bool) : bool :=
match c,d with
| _, false=> true
|false, true => false
| true,true => true
end.发布于 2019-08-21 09:19:53
函数可以生成不同的类型,而不是bool。如果要生成多个值,一种方法是生成值列表。这是表示非确定性函数的一种方式。
Require Import List.
Import ListNotations.
Definition boolfunction (c d : bool) : list bool :=
match c, d with
| _, false => [true]
| false, true => [false]
| true, true => [true, false]
end.如果没有更多关于你正在寻找的东西的细节,就很难更准确了。
https://stackoverflow.com/questions/57583217
复制相似问题