← 00b92ce63593 · 00ed2544a15e →

00cccdad1b37

0-bg grid with one red(2) start, one green(3) goal, color-5 walls forming straight / single-gap / staggered-double-gap layouts; rule marks cyan(8) exactly the bg cells lying on EVERY shortest 4-connected path (verified non-empty, with partially- shared cells present and unmarked on pinch boards).

parametric family

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 (dist-from start)
      (define dist (make-hash))
      (define queue (list start))
      (hash-set! dist start 0)
      (define (bfs)
        (unless (empty? queue)
          (let* ((p (first queue)) (r (first p)) (c (second p)) (d0 (hash-ref dist p)))
            (set! queue (rest queue))
            (for ([d (in-list cardinal-deltas)])
              (let ((nr (+ r (first d))) (nc (+ c (second d))))
                (when (and (in-bounds? nr nc (rows g) (cols g))
                           (not (= (at g nr nc) 5))
                           (not (hash-has-key? dist (list nr nc))))
                  (hash-set! dist (list nr nc) (+ d0 1))
                  (set! queue (append queue (list (list nr nc)))))))
            (bfs))))
      (bfs)
      dist)
    (define (ways-from start dist)
      (define ways (make-hash))
      (hash-set! ways start 1)
      (for ([p (in-list (sort (hash-keys dist) (lambda (a b) (< (hash-ref dist a) (hash-ref dist b)))))])
        (for ([d (in-list cardinal-deltas)])
          (let ((n (list (+ (first p) (first d)) (+ (second p) (second d)))))
            (when (and (hash-has-key? dist n) (= (hash-ref dist n) (+ (hash-ref dist p) 1)))
              (hash-set! ways n (+ (hash-ref ways n 0) (hash-ref ways p 0)))))))
      ways)
    (define s (first (find-color g 2)))
    (define t (first (find-color g 3)))
    (define ds (dist-from s))
    (if (not (hash-has-key? ds t))
        g
        (let* ((dg (dist-from t))
               (ws (ways-from s ds))
               (wg (ways-from t dg))
               (best (hash-ref ds t))
               (total (hash-ref ws t)))
          (foldl (lambda (p out)
                   (if (and (= (at g (first p) (second p)) 0)
                            (hash-has-key? ds p)
                            (hash-has-key? dg p)
                            (= (+ (hash-ref ds p) (hash-ref dg p)) best)
                            (= (* (hash-ref ws p 0) (hash-ref wg p 0)) total))
                       (set-cell out (first p) (second p) 8)
                       out))
                 g (grid-positions g))))))

Provenance

Generator
generators/00cccdad1b37/generator.py
Notes and decisions
generators/00cccdad1b37/notes.md
Review label
reviewed_safe
Generator SHA-256
1325ed7810207d91c2da1ed6d05ce83b37eb54170142f1ca7373cd28265f8aa8
Rule hash
e59d43921357
Sources
bank:ce088a50599a
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 00cccdad1b37 --count 1 --seed 20261108 --test 1