← defba1ab4f90 · df0d6baae973 →

df0b5d094b2d

Two to four colored rectangles each have one bbox corner replaced by 8; replace the markers and move every full rectangle one diagonal step toward its marked corner on background 7.

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)))
           (begin
             (define bg 7)
             (define colors
               (filter (lambda (c) (and (!= c bg) (!= c 8))) (grid-colors g)))
             (define empty-g (cellmap g (r c v) bg))
             (define (process-color c)
               (let* ((cells (find-color g c))
                      (rs (map first cells))
                      (cs (map second cells))
                      (br1 (min-list rs))
                      (br2 (max-list rs))
                      (bc1 (min-list cs))
                      (bc2 (max-list cs))
                      (corners (list (list br1 bc1)
                                     (list br1 bc2)
                                     (list br2 bc1)
                                     (list br2 bc2)))
                      (missing-corner (find (lambda (corner)
                                              (not (any? (lambda (p)
                                                           (and
                                                             (= (first p)
                                                                (first corner))
                                                             (= (second p)
                                                                (second corner))))
                                                         cells)))
                                            corners))
                      (mr (first missing-corner))
                      (mc (second missing-corner))
                      (dr (if (= mr br1) -1 1))
                      (dc (if (= mc bc1) -1 1)))
                 (list c br1 bc1 br2 bc2 dr dc)))
             (define processed (map process-color colors))
             (reduce (lambda (gg p)
                       (let* ((c (nth p 0))
                              (r1 (+ (nth p 1) (nth p 5)))
                              (c1 (+ (nth p 2) (nth p 6)))
                              (r2 (+ (nth p 3) (nth p 5)))
                              (c2 (+ (nth p 4) (nth p 6)))
                              (cells (apply append
                                            (map (lambda (r)
                                                   (map (lambda (cc) (list r cc))
                                                        (range c1 (+ c2 1))))
                                                 (range r1 (+ r2 1))))))
                         (reduce (lambda (gx pp)
                                   (if (and
                                         (>= (first pp) 0)
                                         (< (first pp) h)
                                         (>= (second pp) 0)
                                         (< (second pp) w))
                                       (set-cell gx (first pp) (second pp) c)
                                       gx))
                                 gg
                                 cells)))
                     empty-g
                     processed)))))

Provenance

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