Problem
Define the problem setup taken as input by Newclid.
- class PredicateConstruction(**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.
- string: str
String representation of the construction.
- property predicate_type: PredicateType
- property args: tuple[PredicateArgument, ...]
- canonicalize()
- Return type:
Self
- classmethod from_tuple(construction_tuple)
- Return type:
- classmethod from_str(construction_str)
- Return type:
- classmethod from_predicate_type_and_args(predicate_type, args)
- Return type:
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- predicate_from_str(predicate_str, points)
- Return type:
Circumcenter
|Cong
|Coll
|NColl
|Cyclic
|ConstantAngle
|ACompute
|LCompute
|ConstantLength
|ConstantRatio
|EqAngle
|Diff
|RCompute
|ObtuseAngle
|MidPoint
|EqRatio
|Perp
|NPerp
|Para
|NPara
|SameClock
|SameSide
|NSameSide
|PythagoreanPremises
|PythagoreanConclusions
|SquaredConstantLength
|SquaredConstantRatio
|SimtriClock
|SimtriReflect
|ContriClock
|ContriReflect
|AngleEquation
|LengthEquation
- predicate_to_construction(predicate)
- Return type:
- is_numerical_argument(arg)
- Return type:
bool
- predicate_points(predicate)
- Return type:
set
[NewType
(PredicateArgument
,str
)]
- rename_predicate_construction(predicate_construction, mapping)
Rename the points in a predicate construction.
- Return type:
- class ProblemSetup(**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.
- name: str
- points: tuple[Point, ...]
- assumptions: tuple[PredicateConstruction, ...]
- goals: tuple[PredicateConstruction, ...]
- check_assumptions_and_goals_refer_to_existing_points()
- Return type:
Self
- with_new(*, new_points=(), new_assumptions=(), new_goals=())
- Return type:
- pretty_str()
- Return type:
str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nc_problem_is_valid(problem)
Check if a problem is valid.
- Return type:
bool
- rename_points_in_nc_problem(nc_problem, mapping)
Rename the points in the problem and the apply the change to the assumptions and goals.
Points not present in the mapping will be ignored.
- Return type:
- filter_points_from_nc_problem(nc_problem, points_to_keep)
Filter the points in the problem and remove the assumptions and goals that refer to unkept points.
- Return type: