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

Generate New Script #32

Open
benbrastmckie opened this issue Jul 7, 2024 · 1 comment
Open

Generate New Script #32

benbrastmckie opened this issue Jul 7, 2024 · 1 comment

Comments

@benbrastmckie
Copy link
Owner

This issue picks up a thread from #31:

On a related note, I remember you wanted to have constraints print to another file that the user could then run. I didn't think that would be possible bc it would print it as a string but you'd need Z3 objects to run the file, but it seems it may be possible with the eval() and exec() methods—I used them in this code; you might want to play around with them if that's still an idea you're interested in

I have added a flag which generates a script, but right now it is of limited value since it just prints all the constraints in a list. The thought was to then call this list of constraints instead of generating constraints, allowing the user to make minor tweaks to test things. I haven't really needed to use this workflow but figured that it might be useful for troubleshooting semantic clauses (say during their design, or while comparing them to others). I'd be curious to know more about eval() and exec(). Is there some documentation that you could link?

@mbuit82
Copy link
Collaborator

mbuit82 commented Jul 7, 2024

exec() and eval() are both built in functions to python—here's the documentation for eval (exec is right below it): https://docs.python.org/3/library/functions.html#eval

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