Proper check for first-class types in datatype subfields (#7712)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 30 Nov 2021 20:13:47 +0000 (14:13 -0600)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 20:13:47 +0000 (20:13 +0000)
commit641c531bcb9df45ca6c19f3f9ccfad08afbe17de
treeaa81b2a9a0eea2376642416264439a636b3670d0
parentc5f96858234d6634b744ef8e4250316c62196430
Proper check for first-class types in datatype subfields (#7712)

Fixes two issues with our check for datatype subfields (isFunctionLike -> isFirstClass): functions should be allowed, RegLan should not.

Fixes cvc5/cvc5-projects#368. That issue now throws an error:

(error "Parse Error: proj-368.smt2:3.39: cannot use fields in datatypes that are not first class types

  (declare-datatype x ((_x (x8 RegLan))))
                                         ^
")
This adds a regression showing we allow functions as subfields.
src/expr/node_manager_template.cpp
src/theory/strings/regexp_enumerator.cpp
test/regress/CMakeLists.txt
test/regress/regress0/ho/datatype-field-ho.smt2 [new file with mode: 0644]