-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Most of our inference functions assume something about the circuit (smoothness, decomposability, determinism, structured decomposability). Currently there are some functions that check these preconditions explicitly in code, some that add them as warnings in the documentation, and some that simply assume the user knows what's safe.
There are 2 possible improvements:
- Provide a cross-API function that can tell the user whether the input circuit is supported by a given function. For example:
prereq(::typeof(issatisfiable), circuit) = isdecomposable(circuit)
prereq(::typeof(istautology), circuit) = isdecomposable(circuit) && isdeterministic(circuit)
> prereq(issatisfiable, circuit)
true
> prereq(issatisfiable, circuit & rain)
false
- Create a wrapper struct for circuits that keeps track of all these properties, that sets/unsets them after transformations, that allows for them to be checked before running inference functions, etc. This change would require duplicating all inference functions into a 'safe' version that takes this new struct and checks properties, and a lower-level 'unsafe' one that assumes the user knows what they're doing (i.e., the current code).
Metadata
Metadata
Assignees
Labels
No labels