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

Extend assertions to check for theory symbols #39

Open
nrueh opened this issue May 7, 2024 · 1 comment
Open

Extend assertions to check for theory symbols #39

nrueh opened this issue May 7, 2024 · 1 comment

Comments

@nrueh
Copy link

nrueh commented May 7, 2024

Extend the assertions Contains and SupersetOf (and SubsetOf?) with an option to check for theory symbols:

This would include adding an argument check_theory: bool = False

And something like the following code in the respective holds_for function:

Contains

if self.__check_theory:
            return self.__symbol in model.symbols(shown=True, theory=True)
return model.contains(self.__symbol)

SupersetOf

return set(model.symbols(shown=True, theory=self.__check_theory)).issuperset(self.__symbols)
@daveraja
Copy link

+1 for this feature... but I think it would be really useful to generalise this feature request beyond being able to check theory atoms.

Sometimes you might want theory atoms but other times you might want to check all atoms and not just shown atoms. We also have some cases where we need to post-process the model and then perform the check on the post-processed facts. So something that could accommodate all these use-cases would be really useful.

Maybe this could be implemented with a wrapper around the model object that allows the user to override what action is performed for the different checks.

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

No branches or pull requests

2 participants