Skip to content

Conversation

@aehyvari
Copy link
Member

Our current method of printing interpolants and models in Interpret relies on Logic::pp, which is a recursive implementation. This PR presents a more robust implementation called TermPrinter, which is iterative and therefore requires a fixed-size stack. The printer still blows up the PTRef dag to a tree, similar to Logic::pp.

The implementation is based on the Rewriter class. However, since the does not actually rewrite anything, I created a Visitor class which allows passing Logic const &.

Between Visitor and Rewriter codes there's some code duplication that maybe could be removed, but I'm not sure how right now.

I didn't remove Logic::pp because I think it still has its place, at least when running stuff from debugger, but maybe also (as it currently is done) for some error messages.

@aehyvari aehyvari marked this pull request as draft February 18, 2022 18:04
aehyvari added 6 commits April 1, 2022 09:22
For a let term
`(let ((l1 phi1) ... (ln phin)) psi[l1/phi1 ...  ln/phin])`
it must not be the case that `li` appears in `psi[l1/phi1 ...  ln/phin]`
as a free variable.  This commit guarantees this by introducing a let
prefix in `Logic` and modifying it whenever a new variable is introduced
such that its name is a proper prefix of the current let prefix.

The current let prefix is modified by postfixing it with a character
different from the first character after the proper prefix in the new
variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants