idp_solver.Assignments

Classes to store assignments of values to questions

class idp_solver.Assignments.Status[source]

Describes how the value of a question was obtained

class idp_solver.Assignments.Assignment(sentence: idp_solver.Expression.Expression, value: Optional[idp_solver.Expression.Expression], status: Optional[idp_solver.Assignments.Status], relevant: Optional[bool] = False)[source]

Represent the assignment of a value to a question. Questions can be:

  • predicates and functions applied to arguments,
  • comparisons,
  • outermost quantified expressions

A value is a rigid term.

An assignment also has a reference to the symbol under which it should be displayed.

sentence

the question to be assigned a value

Type:Expression
value

a rigid term

Type:Expression, optional
status

qualifies how the value was obtained

Type:Status, optional
relevant

states whether the sentence is relevant

Type:bool, optional
symbol_decl

declaration of the symbol under which

Type:SymbolDeclaration
it should be displayed.
same_as(other: idp_solver.Assignments.Assignment) → bool[source]

returns True if self has the same sentence and truth value as other.

Parameters:other (Assignment) – an assignment
Returns:True if self has the same sentence and truth value as other.
Return type:bool
negate()[source]

returns an Assignment for the same sentence, but an opposite truth value.

Raises:AssertionError – Cannot negate a non-boolean assignment
Returns:returns an Assignment for the same sentence, but an opposite truth value.
Return type:[type]
as_set_condition()[source]

returns an equivalent set condition, or None

Returns:meaning “appSymb is (not) in enumeration”
Return type:Tuple[Optional[AppliedSymbol], Optional[bool], Optional[Enumeration]]
class idp_solver.Assignments.Assignments(*arg, **kw)[source]

Contains a set of Assignment

copy() → a shallow copy of D[source]