Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive functions in models #791

Closed
Halbaroth opened this issue Aug 30, 2023 · 8 comments
Closed

Recursive functions in models #791

Halbaroth opened this issue Aug 30, 2023 · 8 comments

Comments

@Halbaroth
Copy link
Collaborator

The SMT-LIB standard allows only three statements in models: declare-fun, declare-fun-rec and declare-funs-rec for respectively non-recursive functions, recursive functions and mutually recursive functions. Currently, Alt-Ergo prints all its declarations with declare-fun only.

We could print everything with declare-fun-rec but it would neater to recognize recursive values.

@bclement-ocp
Copy link
Collaborator

declare-fun-rec and declare-funs-rec do not exist in the SMT-LIB standard, do you mean define-fun-rec and define-funs-rec?

In any case, correct me if I'm wrong, but I don't think the solver is able to generate recursive functions atm, so this looks much more involved than printing issues (unless there is support in #776 maybe)?

@Halbaroth
Copy link
Collaborator Author

I meant declare-func-rec ;)

Sure, the solver cannot produce recursive functions yet. I wrote a function to produce dummy values in many cases. If I add the case of recursive functions, the solver should print it with the appropriate SMT-LIB statement.

@Halbaroth
Copy link
Collaborator Author

There is no support in #776 for recursive functions.

@bclement-ocp
Copy link
Collaborator

I meant declare-func-rec ;)

Can you point me to a page in the standard? I can't find declare-func-rec there either.

Sure, the solver cannot produce recursive functions yet. I wrote a function to produce dummy values in many cases. If I add the case of recursive functions, the solver should print it with the appropriate SMT-LIB statement.

I don't understand why we want to have support for printing values we cannot produce. Why can't we deal with this when (if) we add support for producing recursive functions?

@Halbaroth
Copy link
Collaborator Author

Halbaroth commented Sep 5, 2023

When I opened this issue, I thought we could have to produce dummy values for recursive functions but in fact, the only case where we could produce them easily is when there is no constraint at all on the value. But recursiveness is a constraint... So we can always produce non-recursive function for dummy values!

For the standard, looks for model_response.

@bclement-ocp
Copy link
Collaborator

When I opened this issue, I thought we could have to produce dummy values for recursive functions but in fact, the only case where we could produce them easily is when there is no constraint at all on the value. But recursiveness is a constraint... So we can always produce non-recursive function for dummy values!

Yeah, there is no need to build recursive functions for dummy values.

For the standard, looks for model_response.

model_response is defined in terms of define-fun / define-fun-rec / define-funs-rec there is no declare-func-rec? I am still confused.

image

@Halbaroth
Copy link
Collaborator Author

.. I meant define-... XD

@Halbaroth
Copy link
Collaborator Author

Of course, you cannot declare uninterpreted symbol in the model ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants