Closed BrunoDutertre closed 2 years ago
Thanks for pointing this out.
Out of curiosity, is this exponential behavior being triggered in proofs generated from cvc5? I've done some preventative measures to avoid this blowup in the cvc5 proof post-processor, although perhaps it is best to simplify the usage of this side condition altogether.
Yes. This happens with real cvc5 proofs. The example above was extracted from a proof that can't be checked (even on a server with more than 200G of memory).
I've hacked a memoization trick to bypass this issue. That may be good to add in general to lfscc.
The memoization is in the side condition evaluator I assume? Or is it in the construction of expressions?
In the evaluator. I also used hash-consing to avoid duplicating (app ..) terms, but that was not enough.
There is a clean solution that avoids the need for this side condition altogether. I've opened https://github.com/cvc5/cvc5/pull/8699 which modifies our policy on how Skolems are defined and makes this side condition unecessary.
OK. I'll give it a try.
It's helping. I'm still running tests. It looks like memory usage is no longer the bottleneck,
but now I see timeouts. I'll investigate more but my guess is that checks for equality (defeq
) are
too expensive. (Caching may help for that too and it's less hawkish than memoization of run_code :smiley:).
I'll have more data by tomorrow.
Good to hear, keep me posted. I would be interested in investigating further bottlenecks at the LFSC level.
In the CVC5 signatures:
skolem_intro
callssc_mk_skolem
which callssc_to_original
.With the current lfscc, evaluation of
sc_to_original
can cause an exponential blowup (in term size and in runtime).Here's the relevant fragment:
The recursive calls do no preserve sharing of common sub-terms (i.e., they convert a DAG to a tree). Also, the
match t
requires beta reduction (a call toCExpr::whr
) which may create more occurrences of sub-terms and make things worse.Here's an example that illustrates this problem:
I've instrumented lfscc to print size of terms (measured as number of nodes in the DAG representation). Here's the blow-up on this input: