Skip to content

Better ways to check/enforce prerequisite properties (decomposability, etc.) #61

@guyvdbroeck

Description

@guyvdbroeck

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:

  1. 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
  1. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions