Finite Sets
-----------
-cvc5 supports the theory of finite sets.
-The simplest way to get a sense of the syntax is to look at an example:
-
-.. api-examples::
- <examples>/api/cpp/sets.cpp
- <examples>/api/java/Sets.java
- <examples>/api/python/sets.py
- <examples>/api/smtlib/sets.smt2
-
-The source code of these examples is available at:
-
-* `SMT-LIB 2 language example <https://github.com/cvc5/cvc5/blob/master/examples/api/smtlib/sets.smt2>`__
-* `C++ API example <https://github.com/cvc5/cvc5/blob/master/examples/api/cpp/sets.cpp>`__
-* `Java API example <https://github.com/cvc5/cvc5/blob/master/examples/api/java/Sets.java>`__
-* `Python API example <https://github.com/cvc5/cvc5/blob/master/examples/api/python/sets.py>`__
-
-
-Below is a short summary of the sorts, constants, functions and
-predicates. More details can be found in :cite:`BansalBRT17`.
+cvc5 supports the theory of finite sets using the following sorts, constants,
+functions and predicates. More details can be found in :cite:`BansalBRT17`.
For the C++ API examples in the table below, we assume that we have created
a `cvc5::api::Solver solver` object.
The reason for that is that making this formula (and similar ones) `unsat` is
counter-intuitive when quantifiers are present.
-Finite Relations
-----------------
-Example:
+Below is a more extensive example on how to use finite sets:
.. api-examples::
- <examples>/api/smtlib/relations.smt2
+ <examples>/api/cpp/sets.cpp
+ <examples>/api/java/Sets.java
+ <examples>/api/python/sets.py
+ <examples>/api/smtlib/sets.smt2
-For reference, below is a short summary of the sorts, constants, functions and
-predicates.
+
+Finite Relations
+----------------
+
+cvc5 also supports the theory of finite relations, using the following sorts,
+constants, functions and predicates.
More details can be found in :cite:`MengRTB17`.
+----------------------+----------------------------------------------+------------------------------------------------------------------------------------+
+----------------------+----------------------------------------------+------------------------------------------------------------------------------------+
| Tuple Constructor | ``(tuple <Term_1>, ..., <Term_n>)`` | ``Term t = solver.mkTuple({<Sort_1>, ..., <Sort_n>}, {Term_1>, ..., <Term_n>});`` |
+----------------------+----------------------------------------------+------------------------------------------------------------------------------------+
-| Tuple Selector | ``((_ tuple_select i) t)`` | ``Sort s = solver.mkTupleSort(sorts);`` |
+| Tuple Selector | ``((_ tuple_select i) t)`` | ``Sort s = solver.mkTupleSort(sorts);`` |
| | | |
| | | ``Datatype dt = s.getDatatype();`` |
| | | |
+----------------------+----------------------------------------------+------------------------------------------------------------------------------------+
| Product | ``(rel.product X Y)`` | ``Term t = solver.mkTerm(Kind::RELATION_PRODUCT, X, Y);`` |
+----------------------+----------------------------------------------+------------------------------------------------------------------------------------+
+
+Example:
+
+.. api-examples::
+ <examples>/api/smtlib/relations.smt2