Follow Deductions

class DeductionType(*values)

Bases: str, Enum

RULE = 'rule'
AR = 'ar'
NUM = 'num'
REFLEXIVITY = 'refl'
class CachedRuleDeduction(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

deduction_type: Literal[DeductionType.RULE]
rule: Rule
premises: tuple[PredicateConstruction, ...]
conclusions: tuple[PredicateConstruction, ...]
point_deps: list[str]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ARPremiseConstruction(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

predicate_construction: PredicateConstruction
coefficient: ARCoefficient
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class CachedARDeduction(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

deduction_type: Literal[DeductionType.AR]
ar_reason: ARReason
premises: tuple[ARPremiseConstruction, ...]
conclusions: tuple[PredicateConstruction, ...]
point_deps: list[str]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class CachedNumericalCheckDeduction(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

deduction_type: Literal[DeductionType.NUM]
conclusions: tuple[PredicateConstruction, ...]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class CachedReflexivityDeduction(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

deduction_type: Literal[DeductionType.REFLEXIVITY]
conclusions: tuple[PredicateConstruction, ...]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class DeductionProvider

Bases: ABC

abstractmethod ordered_deductions_for_problem(problem)
Return type:

list[CachedRuleDeduction | CachedARDeduction | CachedNumericalCheckDeduction | CachedReflexivityDeduction]

abstract property precomputation_input_str: str
class FollowDeductionsStats(**data)

Bases: BaseModel

Statistics for the FollowDeductions agent.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

agent_type: Literal['follow_deductions']
n_deductions_stored: int

The number of deductions stored.

n_deductions_followed: int

The list of deductions followed.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class FollowDeductions(deductions_provider)

Bases: DeductiveAgent

get_stats()

Get the statistics of the agent.

Return type:

FollowDeductionsStats

step(proof, rules)

Perform a single reasoning step on the given proof with given rules, and return if the agent is exausted.

Return type:

bool

Returns:

True if the agent is considered exausted, False otherwise.

reset()
Return type:

None

exception DoubleCheckError

Bases: Exception

A deduction given is not valid to be followed.