Skip to content

Conversation

Blebowski
Copy link
Contributor

Adds support for PSL nondet built-in.

Supports both: boolean argument as well as value_set argument with individual entries and ranges.

Enforces type of each entry within value set is the same.

Computes total length of all ranges (e.g. for {1,2,7 to 10,12} it is 6) and chooses uniformly a random number
within such range. The generated code then walks the value_set and figures out which entry is the one chosen.
Based on the chosen entry, correct value is returned.

TODO: Standard says the types of arguments can be arbitrary, as long as the context where nondet can accept such type.
Currently, it only works for integers. I think it would be good to do it for enums too. More complex types IMHO do not make much sense.

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

Successfully merging this pull request may close these issues.

1 participant