datawhalechina/hello-agents · error · Exception

EE check not passed when add init fact {(predicate, instance

Error message

EE check not passed when add init fact {(predicate, instance)}.

What it means

An exception raised during the initialization phase of the symbolic geometry solver (src/gps/symbolic_solver.py) when adding an initial fact from the problem's relation_cdl fails the extended-entity (EE) check. _pass_geometric_constraints verifies that a fact's predicate/instance tuple is consistent with the geometric entities already constructed (points, lines, circles defined in the CDL); failure means the problem's relation statement references entities that do not exist or are structurally invalid.

Source

Thrown at Co-creation-projects/BitSecret-GPSAgent/src/gps/symbolic_solver.py:385

            for a_point in a_points:
                for b_point in b_points:
                    angle = (a_point, v, b_point)
                    extend_constructions['Angle'].add(angle)
                    multiple_sym = symbols(''.join(angle) + f'.ma')
                    self.sym_to_sym[multiple_sym] = sym
                    self.sym_to_syms[sym].add(multiple_sym)

        # 4.9 add extended constructions
        operation_id = self._add_operation(('Preset', 'extend_construction', None))
        for predicate in extend_constructions:
            for instance in extend_constructions[predicate]:
                self._add_fact(predicate, instance, premise_ids, operation_id)

        # 5.Add facts
        operation_id = self._add_operation(('Preset', 'init_fact', None))
        for predicate, instance in self.parsed_cdl['relation_cdl']:
            if not self._pass_geometric_constraints(predicate, instance):
                raise Exception(f'EE check not passed when add init fact {(predicate, instance)}.')
            if (predicate, instance) in self.fact_id:
                continue
            fact_id, _ = self._add_fact(predicate, instance, (), operation_id)
            if fact_id is None:
                raise Exception(f'Error when add init fact {(predicate, instance)}.')

        # 6.Set goal
        init_goal_operation_id = self._add_operation(('Preset', 'init_goal', None))
        goal_ids = self._add_goals([self.parsed_cdl['goal_cdl']], None, init_goal_operation_id)
        if goal_ids is None:
            raise Exception(f"Error when set init goal {self.parsed_cdl['goal_cdl']}.")
        self._check_goals(goal_ids)

    def _add_fact(self, predicate, instance, premise_ids, operation_id):
        if predicate == 'Eq':
            instance = self._adjust_expr(instance)
            if instance is None or len(instance.free_symbols) == 0:
                return None, set()

View on GitHub (pinned to 606a07d341)

Solutions

  1. Inspect the printed (predicate, instance) pair and check every entity it mentions appears in the problem's construction/entity declarations
  2. Fix the CDL: add the missing construction or correct the entity label typo, then re-run
  3. Validate the CDL with the library's parser (parse_cdl / the CDL linting utilities if present) before invoking the solver
  4. If generating problems with an LLM, add a post-generation validation step that cross-checks entity references against declared entities

Example fix

# before (problem CDL, relation references undeclared line)
# constructions omit D, but relation says:
# PerpendicularBetweenLine(AB, CD)

# after
# add construction: D = midpoint(...); line CD declared,
# then PerpendicularBetweenLine(AB, CD) passes the EE check
Defensive patterns

Strategy: validation

Validate before calling

# before solving, cross-check relation entities against constructed ones
constructed = set(entities_defined_in(construction_cdl))
for predicate, instance in parse_relations(relation_cdl):
    used = entities_referenced(instance)
    missing = used - constructed
    if missing:
        raise ValueError(f'relation {predicate}{instance} references undeclared entities: {missing}')

Try / catch

try:
    solver.solve(problem_cdl)
except Exception as e:
    if 'EE check not passed' in str(e):
        report_invalid_problem(cdl=problem_cdl, reason=str(e))  # authoring error, not a solver bug
    else:
        raise

Prevention

When it happens

Trigger: Calling the solver on a CDL problem string whose relation section (relation_cdl) contains a predicate mentioning an entity not declared in the construction section — e.g. 'ParallelBetweenLine(A,B,C,D)' where line CD was never constructed — or an instance whose syntax the constraint checker cannot reconcile with prior constructions. Also triggered by malformed CDL where the relation references point labels outside the diagram.

Common situations: Hand-written or LLM-generated CDL problems with inconsistent entity references; editing an example problem and renaming a point only in some statements; version drift in the CDL grammar changing how constructions must be declared; importing problems authored for a different solver dialect.

Related errors


AI-assisted analysis of datawhalechina/hello-agents@606a07d341 (2026-08-14). Data as JSON: /api/errors/ce6a9db806e0f1c8. Report an issue: GitHub.