Simplify internal representation of instantiated sorts (#8620)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 26 Apr 2022 01:16:55 +0000 (20:16 -0500)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 01:16:55 +0000 (01:16 +0000)
commit7f445f50998e787915052e125c85077c69fd8a0f
tree6f6d96235a7bdb16c030e8408c53b73b3c6a9ac8
parentc821125b219f3c347414896accd9bb6bdf443b6d
Simplify internal representation of instantiated sorts (#8620)

Previously, sort constructors were stored as underlying operator of the NodeValue of instantiated sorts. This made it very difficult to access what sort constructor was used to construct the uninterpreted sort. Moreover, this representation made it virtually impossible to have a clean implementation of the LFSC printer for instantiated uninterpreted sorts, which requires renaming sort constructors.

This introduces a new kind INSTANTIATED_SORT_TYPE, which acts as an uninterpreted sort. The sort constructor is stored as the first child in its AST, which is analogous to parametric datatypes. It furthermore restricts SORT_TYPE to 0 children.

This is work towards having correct LFSC proof output when the input contains instantiated uninterpreted sorts.
src/expr/dtype_cons.cpp
src/expr/node_manager_template.cpp
src/expr/type_node.cpp
src/printer/smt2/smt2_printer.cpp
src/theory/builtin/kinds
src/theory/builtin/type_enumerator.cpp
src/theory/datatypes/theory_datatypes_type_rules.cpp