CPSolver.ConstraintStore behaviour (Fixpoint v0.10.2)

Constraint store is a key-value store, where key is a variable id, and value is a implementation-dependent structure that allows to update and keep track of variables' domains.

Summary

Types

get_operation()

@type get_operation() :: CPSolver.Common.domain_get_operation() | nil

update_operation()

@type update_operation() :: CPSolver.Common.domain_update_operation()

Callbacks

create(variables, opts)

@callback create(variables :: Enum.t(), opts :: Keyword.t()) ::
  {:ok, any()} | {:error, any()}

dispose(store, variables)

@callback dispose(store :: any(), variables :: [CPSolver.Variable.t()]) ::
  :ok | :not_found

domain(store, variable)

@callback domain(store :: any(), variable :: CPSolver.Variable.t()) ::
  {:ok, any()} | {:error, any()}

get(store, variable, get_operation, list)

@callback get(store :: any(), variable :: CPSolver.Variable.t(), get_operation(), [any()]) ::
  {:ok, any()} | {:error, any()}

on_change(store, variable, change)

@callback on_change(
  store :: any(),
  variable :: CPSolver.Variable.t(),
  change :: CPSolver.Common.domain_change()
) :: any()

on_fail(store, variable)

@callback on_fail(store :: any(), variable :: CPSolver.Variable.t()) :: any()

on_fix(store, variable, value)

@callback on_fix(store :: any(), variable :: CPSolver.Variable.t(), value :: any()) ::
  any()

on_no_change(store, variable)

@callback on_no_change(store :: any(), variable :: CPSolver.Variable.t()) :: any()

update(store, variable, update_operation, list)

@callback update(store :: any(), variable :: CPSolver.Variable.t(), update_operation(), [
  any()
]) :: any()

update_domain(store, variable, update_operation, list)

@callback update_domain(
  store :: any(),
  variable :: CPSolver.Variable.t(),
  update_operation(),
  [any()]
) ::
  any()

Functions

create_store(variables, opts \\ [])

default_store()

default_store_opts()

dispose(store, variables)

domain(variable)

domain(store, variable)

fixed?(variable)

get(store, variable, operation, args \\ [])

set_store(store)

update(store, variable, operation, args \\ [])