Management of the State of problem solving with the Interactive Consultant.

class State(idp)[source]

Contains a state of problem solving


idp (IDP) –

classmethod make(idp, previous_active, active, ignore=None)[source]

Manage the cache of State

  • idp (IDP) – idp source code

  • previous_active (str) – assignments due to previous full propagation

  • active (str) – assignment choices from client

  • ignore (str) – user-disabled laws to ignore


a State

Return type



Creates an instance of Theory for the list of theories, e.g., Theory(T,S).

  • theories (Union[TheoryBlock, Structure, Theory]) – 1 or more (data) theories.

  • extended (bool, optional) – use True when the truth value of inequalities and quantified formula is of interest (e.g. for the Interactive Consultant). Defaults to False.

  • idp (idp_engine.Parse.IDP) –

add_given(jsonstr, previous, keep_defaults=False)[source]

Add the assignments that the user gave through the interface. These are in the form of a json string.

  • jsonstr (str) – the user’s assignment in json

  • previous (str) – the assignments from the last propagation

  • keep_default – whether default assignments should not be reset

  • jsonstr

  • previous

  • keep_defaults (bool) –


the state has the jsonstr and previous added