Guarded Fresh Goals: Dependency-Directed Introduction of Fresh Logic Variables
summary
Adds guarded fresh to a smalltalk miniKanren to record that subgoals depend on a complex term, suspend those subgoals when their external variables are free, queue them in a schedule queue, and only commit to fresh bindings when no other goals remain. Implements heuristics for immediate evaluation of ground cases and prioritizing goals; tests compare to traditional fresh on boolean, recursive-list and quines synthesis. Results: boolean and many recursive benchmarks run much faster under guarded fresh, fair-only scheduling performs far worse, but quines much slower under guarded fresh—so it helps often but sometimes hurts.
AI-written summary · about
