stormvogel.model.variable

A model variable.

Attributes

Classes

IntDomain

A bounded integer domain [lo, hi].

BoolDomain

A boolean domain {False, True}.

CategoricalDomain

A finite categorical domain with an explicit ordered set of values.

Variable

Predicate

A named observable predicate with a required domain and an optional defining expression.

Module Contents

class stormvogel.model.variable.IntDomain

A bounded integer domain [lo, hi].

Parameters:
  • lo – Lower bound (inclusive).

  • hi – Upper bound (inclusive).

  • allow_none – Whether None is a valid value.

lo: int
hi: int
allow_none: bool = False
contains(value: Any) bool
__repr__()
class stormvogel.model.variable.BoolDomain

A boolean domain {False, True}.

Parameters:

allow_none – Whether None is a valid value.

allow_none: bool = False
contains(value: Any) bool
__repr__()
class stormvogel.model.variable.CategoricalDomain

A finite categorical domain with an explicit ordered set of values.

Parameters:
  • values – All valid values, as a tuple to preserve order.

  • allow_none – Whether None is a valid value.

values: tuple[Any, Ellipsis]
allow_none: bool = False
contains(value: Any) bool
__repr__()
stormvogel.model.variable.VariableDomain
class stormvogel.model.variable.Variable
label: str
domain: VariableDomain | None = None
__lt__(other)
check_valuation(value: Any) None

Raise ValueError if value is outside this variable’s declared domain.

__repr__()
__str__
class stormvogel.model.variable.Predicate

A named observable predicate with a required domain and an optional defining expression.

Parameters:
  • label – Human-readable name for the predicate.

  • domain – The domain of values this predicate can take.

  • expr – Optional callable f(valuations) -> value that computes the predicate value from a state’s {Variable: value} dict. None when the predicate was imported from an external tool and the expression is not available.

label: str
domain: VariableDomain
expr: collections.abc.Callable[[dict[Variable, Any]], Any] | None = None
check_valuation(value: Any) None

Raise ValueError if value is outside this predicate’s domain.

__repr__()
__str__
stormvogel.model.variable.VariableKey