← bca4f37ec5e9 · bd05f2963d17 →

bcac0c8a0478

Dense color-8 mazes with start 2, goal 3, checkpoint 5, and one or two required portal pairs (6/7). The selected BFS tracks whether checkpoint 5 has been visited; generated lessons refute goal-first, direct-path, and ignore-portals rivals.

pathfindingportalsstate

Generated by the released generator before publication; every output was computed by its Racket reference rule. White outlines mark the cells the rule changed. Lesson check:

refuted: a demonstration contradicts the rival. survived_all: it fits every demonstration and also gives the intended answer, so it cannot mislead here. ambiguous: it fits every demonstration but answers the query differently. Names are as declared by the generator; a declared shortcut is not guaranteed to fit the original pairs (see the paper’s Limitations).

Original task pairs

From the source task; the reference rule must reproduce them.

Reference rule (Racket)

(rule! (let ((dummy 0)) (define (positions-of-color grid color) (filter (lambda (p) (= (at grid (first p) (second p)) color)) (grid-positions grid))) (let* ((start (first (positions-of-color g 2))) (goal (first (positions-of-color g 3))) (checkpoint (first (positions-of-color g 5))) (queue (list (list (first start) (second start) 0))) (prev (make-hash)) (end-state #f)) (define (portal-dest pos) (let* ((v (at g (first pos) (second pos))) (ps (positions-of-color g v))) (if (and (member? v (list 6 7)) (= (length ps) 2)) (if (equal? pos (first ps)) (second ps) (first ps)) pos))) (hash-set! prev (first queue) #f) (define (search) (unless (or (empty? queue) end-state) (define cur (first queue)) (set! queue (rest queue)) (define r (first cur)) (define c (second cur)) (define hit (third cur)) (when (and (= r (first goal)) (= c (second goal)) (= hit 1)) (set! end-state cur)) (unless end-state (for ((d (in-list cardinal-deltas))) (define nr0 (+ r (first d))) (define nc0 (+ c (second d))) (when (and (in-bounds? nr0 nc0 (rows g) (cols g)) (not (= (at g nr0 nc0) 8))) (define hit0 (if (or (= hit 1) (and (= nr0 (first checkpoint)) (= nc0 (second checkpoint)))) 1 0)) (define dest (if (member? (at g nr0 nc0) (list 6 7)) (portal-dest (list nr0 nc0)) (list nr0 nc0))) (define hit2 (if (or (= hit0 1) (and (= (first dest) (first checkpoint)) (= (second dest) (second checkpoint)))) 1 0)) (define st (list (first dest) (second dest) hit2)) (when (not (hash-has-key? prev st)) (hash-set! prev st cur) (set! queue (append queue (list st))))))) (search))) (search) (if (not end-state) g (let rebuild ((cur end-state) (out g)) (if (eq? cur #f) out (let* ((r (first cur)) (c (second cur)) (next (if (= (at out r c) 0) (set-cell out r c 4) out))) (rebuild (hash-ref prev cur #f) next))))))))

Provenance

Generator
generators/bcac0c8a0478/generator.py
Notes and decisions
generators/bcac0c8a0478/notes.md
Review label
reviewed_safe
Generator SHA-256
0a81fd0feea8978daa5584364100493c4161318f569c78b9c428d11d6d0214e0
Rule hash
076228df68df
Sources
bank:fec6a16dfcc9
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate bcac0c8a0478 --count 1 --seed 20261108 --test 1