Skip to content

Function synthesis #6669

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

You must be logged in to vote

There is a "macro" finder that detects explicit and implicit definitions.
The default implementation does not find it.

There is an entirely new implementation with the tactic "elim-predicates".
https://microsoft.github.io/z3guide/docs/strategies/summary#tactic-elim-predicates
It works in this case.

from z3 import *

s = Solver()
I = Function('I', IntSort(), IntSort())
x = Int('x')

s.add (ForAll([x], I(x) == If(x<2, 2*x, x+3)))

g = Goal()
g.add(s.assertions())
t = Tactic('elim-predicates')
r = t(g)[0]
print(r)

There are many areas where even the new implementation misses macros.
Good macro finders is one area that may be improved based on benchmarking.

The more general problem of functi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LeventErkok
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