Unify abstract values and uninterpreted constants (#7424)
authorAndres Noetzli <andres.noetzli@gmail.com>
Thu, 13 Jan 2022 01:42:26 +0000 (17:42 -0800)
committerGitHub <noreply@github.com>
Thu, 13 Jan 2022 01:42:26 +0000 (01:42 +0000)
commit0f5ee6bb4a4477d40d7f6577ea0c5bac17420935
treeefe500032276b21deca0ccfd079777b02f403711
parente233e778d8b7beb6783e566e0c1659df792b93ba
Unify abstract values and uninterpreted constants (#7424)

This commit unifies abstract values and "uninterpreted constants" into a
single kind. Note that "uninterpreted constants" is a bit of a misnomer
in the context of the new API, since they do not correspond to the
equivalent of a declare-const command, but instead are values for
symbols of an uninterpreted sort (and thus special cases of abstract
values). Instead of treating "uninterpreted constants" as a separate
kind, this commit extends abstract values to hold a type (instead of
marking their type via attribute in NodeManager::mkAbstractValue())
and uses the type of the abstract values to determine whether they are a
value for a constant of uninterpreted sort or not. Unifying these
representations simplifies code and brings the terminology more in line
with the SMT-LIB standard.

This commit also updates the APIs to remove support for creating
abstract values and "uninterpreted constants". Users should never create
those. They can only be returned as a value for a term after a
satisfiability check.

Finally, the commit removes code in the parser for parsing abstract
values and updates the code for getting values involving abstract
values. Since the parser does not allow the declaration/definition of
abstract values, and determining whether a symbol is an abstract value
was broken (not all symbols starting with an @ are abstract values),
the code was effectively dead. Getting values involving "uninterpreted
constants" now no longer requires parsing the string of the values, but
instead, we can use existing API functionality.
51 files changed:
src/api/cpp/cvc5.cpp
src/api/cpp/cvc5.h
src/api/cpp/cvc5_kind.h
src/api/java/io/github/cvc5/api/Solver.java
src/api/java/io/github/cvc5/api/Term.java
src/api/java/jni/solver.cpp
src/api/java/jni/term.cpp
src/api/python/cvc5.pxd
src/api/python/cvc5.pxi
src/expr/CMakeLists.txt
src/expr/node_manager_template.cpp
src/expr/node_manager_template.h
src/expr/skolem_manager.cpp
src/expr/skolem_manager.h
src/expr/uninterpreted_constant.cpp [deleted file]
src/expr/uninterpreted_constant.h [deleted file]
src/parser/parser.cpp
src/parser/smt2/smt2.cpp
src/parser/smt2/smt2.h
src/printer/smt2/smt2_printer.cpp
src/smt/abstract_values.cpp
src/smt/abstract_values.h
src/theory/builtin/kinds
src/theory/builtin/theory_builtin_type_rules.cpp
src/theory/builtin/theory_builtin_type_rules.h
src/theory/builtin/type_enumerator.cpp
src/theory/builtin/type_enumerator.h
src/theory/datatypes/datatypes_rewriter.cpp
src/theory/datatypes/type_enumerator.h
src/theory/evaluator.cpp
src/theory/evaluator.h
src/theory/quantifiers/sygus/sygus_grammar_cons.cpp
src/theory/quantifiers/term_util.cpp
src/theory/theory_model_builder.cpp
src/theory/uf/theory_uf.cpp
src/util/CMakeLists.txt
src/util/abstract_value.cpp [deleted file]
src/util/abstract_value.h [deleted file]
src/util/uninterpreted_sort_value.cpp [new file with mode: 0644]
src/util/uninterpreted_sort_value.h [new file with mode: 0644]
test/regress/regress0/bug421.smt2
test/regress/regress0/bug421b.smt2
test/regress/regress0/parser/issue6908-get-value-uc.smt2
test/unit/api/cpp/solver_black.cpp
test/unit/api/cpp/term_black.cpp
test/unit/api/java/SolverTest.java
test/unit/api/java/TermTest.java
test/unit/api/python/test_solver.py
test/unit/api/python/test_term.py
test/unit/theory/type_enumerator_white.cpp
test/unit/util/array_store_all_white.cpp