有没有在Coq中可以处理布尔值的集合库?

huangapple go评论64阅读模式
英文:

Is there a library for sets that works with bool in Coq?

问题

我正在寻求使用数学集合和某种通用类型的子集进行工作。
我知道通常这表示为 U -> Prop,就像在Ensembles库中一样。

我想知道是否有一种表示集合的方式是可决定的,也许集合可以表示为 S : U -> bool,我们可以决定任何元素是否在S中,还是这根本不可能?

理想情况下,我希望能够计算出,给定类型U的一组元素,属于某个集合S的这些元素的子集。

英文:

I am looking to work with mathematical sets and subsets of some universal type.
I know this is normally represented as U -> Prop, such as in the Ensembles library.

I was wondering if there is perhaps some representation of sets that is decidable, perhaps where sets are represented as S : U -> bool where we can decide for any element of U whether it is in S, or is this simply impossible?

Ideally, I would like to be able to compute, given a collection of elements of type U, the subset of those elements that are in some set S as well.

答案1

得分: 1

你可能希望查看mathcomp/ssreflect框架的finset库,如果你还不了解它的话:finset.v

英文:

You might want to have a look at the finset library of the mathcomp/ssreflect framework, if you don't know about it already: finset.v.

答案2

得分: 1

以下是要翻译的内容:

在Coq中有几个用于处理集合的库:

通常,一旦您使用了std++或MathComp的某个部分,最好使用全部,部分原因是这些库有一些复杂的学习曲线(我认为是值得的)。

关于集合库的讨论经常出现在Zulip上(12)。

英文:

There are several libraries to work with sets in Coq:

Typically, once you use some part of std++ or of MathComp you are better off using all of it, in part because there is some non-trivial learning curve to these libraries (worth it, IMO).

Discussion on set libraries pops up often on Zulip (1, 2).

huangapple
  • 本文由 发表于 2023年4月13日 18:36:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76004446.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定