Open facundominguez opened 2 years ago
This is not too different to how pirouette does things. It's just that we do it in separate passes. I do like how the expansion is a little more constrained. How do we know "when g
or orBool
need to be evaluated"?
How do we know "when g or orBool need to be evaluated"?
That is a decision made by the algorithm driving the interaction with the SMT Solver. In the case of LH, PLE will unfold all the invocations of non-recursive functions, and all invocations of recursive functions whose guards have been decided (e.g. is the input list empty or not, is the input integer greater than 0, etc).
I want to comment here on the approach that Liquid Haskell uses to defunctionalise and monomorphise expressions for the SMT solver. It looks to me like it is simpler than what is currently being done in pirouette. However, I'm not too familiar with pirouette yet, so I might be unaware of restrictions that render this inapplicable.
Suppose we have functions like
These functions can then be used in formulas, like
g (orBool True) True == True && orBool True True == True
. The formulas are translated to SMTLIB2 as follows.When
g
ororBool
need to be evaluated, their equations are expanded with the actual parameters