← 0a9926d504f3 · 0a9ee3cbb232 →

0a9e3d364bb3

A 2x2 corner key maps the first non-key body marker colour to the four quadrants of the opposite body rectangle. Exact midpoint cells use the bottom/right key entry. A later second body colour, when present, is a distractor and remains unchanged.

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! (lambda (g)
  (let* ((h (rows g))
         (w (cols g))
         ;; Scan the four 2x2 corner slots in reading order.  The first slot
         ;; whose top edge is neither background 0 nor separator 8 is the key.
         (key-r #f)
         (key-c #f)
         (key-scan
          (for ((pos (list (list 0 0)
                           (list 0 (- w 2))
                           (list (- h 2) 0)
                           (list (- h 2) (- w 2)))))
            (let ((kr (first pos)) (kc (second pos)))
              (when (and (not key-r)
                         (!= (at g kr kc) 0)
                         (!= (at g kr kc) 8)
                         (!= (at g kr (+ kc 1)) 0)
                         (!= (at g kr (+ kc 1)) 8))
                (set! key-r kr)
                (set! key-c kc)))))
         ;; The four key cells are the output colors for TL/TR/BL/BR.
         (k00 (at g key-r key-c))
         (k01 (at g key-r (+ key-c 1)))
         (k10 (at g (+ key-r 1) key-c))
         (k11 (at g (+ key-r 1) (+ key-c 1)))
         (key-set (make-hash))
         (key-set-init
          (begin
            (hash-set! key-set (list key-r key-c) #t)
            (hash-set! key-set (list key-r (+ key-c 1)) #t)
            (hash-set! key-set (list (+ key-r 1) key-c) #t)
            (hash-set! key-set (list (+ key-r 1) (+ key-c 1)) #t)))
         ;; The first non-key, non-0/8 cell in reading order names the marker
         ;; color.  Later body colors are distractors and must stay unchanged.
         (marker #f)
         (marker-scan
          (for* ((r (range 0 h)) (c (range 0 w)))
            (when (and (not marker)
                       (!= (at g r c) 0)
                       (!= (at g r c) 8)
                       (not (hash-has-key? key-set (list r c))))
              (set! marker (at g r c)))))
         ;; Zeros count toward the body bbox; only separator 8 and the key are
         ;; excluded.  Exact midpoint cells therefore belong bottom/right.
         (body-cells
          (for*/list ((r (range 0 h)) (c (range 0 w))
                      #:when (and (!= (at g r c) 8)
                                  (not (hash-has-key? key-set (list r c)))))
            (list r c)))
         (r1 (min-of first body-cells))
         (r2 (max-of first body-cells))
         (c1 (min-of second body-cells))
         (c2 (max-of second body-cells))
         (mid-r2 (+ r1 r2))
         (mid-c2 (+ c1 c2)))
    (build-grid h w (r c)
      (let ((v (at g r c)))
        (if (and (= v marker)
                 (not (hash-has-key? key-set (list r c))))
            (let ((qr (if (< (* 2 r) mid-r2) 0 1))
                  (qc (if (< (* 2 c) mid-c2) 0 1)))
              (cond ((and (zero? qr) (zero? qc)) k00)
                    ((and (zero? qr) (= qc 1)) k01)
                    ((and (= qr 1) (zero? qc)) k10)
                    (else k11)))
            v))))))

Provenance

Generator
generators/0a9e3d364bb3/generator.py
Notes and decisions
generators/0a9e3d364bb3/notes.md
Review label
reviewed_safe
Generator SHA-256
42cf51fb28002b7a663a6816387b5050047798392f5f79827a7204336511ed42
Rule hash
debd91c13f07
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 0a9e3d364bb3 --count 1 --seed 20261108 --test 1