8000 Recursive rule calling another rule fails with INT-022 when its second argument is bound · Issue #608 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Recursive rule calling another rule fails with INT-022 when its second argument is bound #608

Closed

Description

@adityamukho

Found by the playground/docs audit (2026-10-15): the sports-league tutorial step sl3-s4 errors on v2.0.6 and on v3.

Repro

(transact [[:a :edge :b] [:b :edge :c]])
(rule [(link ?x ?y) [?x :edge ?y]])
(rule [(chain ?x ?y) (link ?x ?y)])
(rule [(chain ?x ?y) (link ?x ?m) (chain ?m ?y)])

(query [:find ?x :where (chain ?x :c)])      ; INT-022 "datalog evaluator: Unbound variable in rule head: ?m"
(query [:find ?y :where (chain :a ?y)])      ; ok: :b :c
(query [:find ?x ?y :where (chain ?x ?y)])   ; ok: 3 rows

The same chain written with patterns instead of a call to link ([?x :edge ?y] / [?x :edge ?m] (chain ?m ?y)) answers (chain ?x :c) correctly, so the failure is in demand-driven evaluation (magic sets, adornment fb) of a body made of rule calls only. The query is valid and should return ?x = :a, :b.

Same result on main (28f4a4e) and v3 (e078e46). It refuses a query rather than returning wrong rows.

Activity

  1. added this to the v3.0.0 milestone on Oct 15, 2026
  2. added a commit that references this issue on Oct 16, 2026
  3. adityamukho commented on Oct 16, 2026

    @adityamukho
    CollaboratorAuthor

    Fixed on v3 by #609 (magic-sets demand now supplied by every call site). Backport to v2.x follows.

  4. added
    known-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingknown-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0