9 Commits

Author SHA1 Message Date
Mathias Preiner
56e14c4639 Move public headers into top-level include directory. (#9555)
This PR moves the public API headers into a top-level include directory. This makes it easier to find the public API of cvc5 and makes the install headers script obsolete.

Fixes #9553
Fixes #9556
2023-03-07 23:39:29 +00:00
Andrew Reynolds
f4176a5d4f Proper memory management of parsed commands (#9511) 2023-03-07 17:40:06 +00:00
Andrew Reynolds
eabeb34e89 Bind declarations and definitions only when commands are invoked (#9355)
This corrects issues in our parser related to when symbols should be added to our symbol table.

In particular, symbols should be bound only when commands are executed and not as they are parsed. Binding during parsing leads to errors in interactive mode where those symbols are bound more than once, say if a command is partially parsed and then re-parsed based on our line buffering. This required further modifications to the interactive shell to execute commands immediately as they are parsed, since executing them may impact parsing (say if a declare-fun was on the same line as the subsequent command).

This adds new methods for accessing the binding methods of the underlying symbol table of symbol manager.

There are further issues of this form to correct, e.g. for define-fun-rec, which will be addressed in a separate PR.
2023-01-05 21:12:37 +00:00
Andrew Reynolds
ee97e826a5 Decouple parser state from ANTLR specific parsing (#9312)
This renames Smt2 and Tptp to Smt2State and TptpState, and decouples their implementation from ANTLR specific parsing. The Smt2State will be reused in the new flex parser.

It introduces ANTLR-specific wrappers of these classes (called by their previous names Smt2 and Tptp to avoid propagating further name changes), having the same functionality for parsing.

Followup PRs will clean Smt2State / TptpState and move them to smt2_state.h / tptp_state.h.
2022-12-13 17:25:32 -06:00
Andres Noetzli
66d374cd5c Move Command infrastructure to parser (#8893)
This commit moves the `Command` infrastructure to the parser (to
`src/parser/api/cpp`) and moves it to the `cvc5::parser` namespace. The
`Command`-related files are compiled with `-D__BUILDING_CVC5LIB`,
because they need access to the internal printers. The commit refactors
the internal code to not depend on `Command` anymore. To do this, the
commit refactors printing derived classes of `CommandStatus` to follow a
similar structure to printing commands (so that we can also print
command statuses internally without creating instances of
`Commandstatus`). This is a step towards a parser API.
2022-09-16 18:57:55 -07:00
Mathias Preiner
d01e59c13b Update copyright headers for release 1.0 (#8539) 2022-04-05 20:38:57 +00:00
Mathias Preiner
bbcd471ed4 Introduce internal namespace and remove api namespace. (#8443)
The public cvc5 API now lives in the cvc5 namespace. All internal parts were moved into the (new) internal namespace.
The final hierarchy will be as follows:

cvc5
  ~~ public API
  ::context
  ::internal
  ::parser
  ::main

After this PR it will be:

cvc5
  ~~ public API
  ::internal
      ::context
      ::main
  ::parser
2022-03-29 23:23:01 +00:00
Gereon Kremer
561b989855 Refactor IO stream manipulators (#7555)
This PR consolidates SetLanguage, ExprSetDepth and ExprDag into a single consistent utility. Also, it makes it play more nicely with users setting these options and removes some obsolete code.
2021-11-22 22:31:31 +00:00
yoni206
40272d5f3a Translating API tests to Python — part 1 (#7597)
This PR translates some of the API tests from here to Python. The other tests are translated in a private branch and will be added in a separate PR.
2021-11-16 18:56:37 +00:00