Skip to content

Parse datatypes and define-funs from string #5743

Answered by NikolajBjorner
leonardoalt asked this question in Q&A
Discussion options

You must be logged in to vote

This isn't a supported scenario at this point.

The pretty printer for the solver object will not even show you all declarations that were used in the string passed to solver::from_string(..).

The rationale for not going there is that you can call the C++ API directly to create datatypes.
There are maybe SMTLIB2 tools that can give you back an abstract syntax tree that can be used to then call C++ API functions that create Datatypes.

The following methods are available over the C API:

  • expose a method on a DATATYPE_SORT to return set of constructors
  • expose methods on a constructor to return accessors and testers

They are:

Z3_get_datatype_sort_num_constructors
Z3_get_datatype_sort_constructor

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by leonardoalt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5742 on December 28, 2021 19:05.