← public_eval_b6f77b65 · public_eval_b9e38dc0 →

public_eval_b99e7126

Complete the macro pattern encoded by the anomalous tile's introduced-color mask.

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!
 ;; A modal-color separator lattice contains one ordinary tile pattern and
 ;; repeated copies of one anomalous tile.  The anomalous tile introduces one
 ;; new ink color.  Its ink cells form a micro mask; translate that same mask
 ;; over macro-tile coordinates so that it covers every anomalous clue tile,
 ;; then copy the complete anomalous tile into every selected macro position.
 (lambda (g)
  (let ()
   (define scope-mode 0)
   (define bg (pick-max (grid-colors g) (lambda (v) (count-color g v))))
   (define sep-rows
    (filter (lambda (r) (all? (lambda (c) (= (at g r c) bg)) (range 0 (cols g))))
            (range 0 (rows g))))
   (define sep-cols
    (filter (lambda (c) (all? (lambda (r) (= (at g r c) bg)) (range 0 (rows g))))
            (range 0 (cols g))))
   (define (bands separators)
    (filter (lambda (p) (<= (first p) (second p)))
     (for/list ((i (range 0 (- (length separators) 1))))
      (list (+ (list-ref separators i) 1)
            (- (list-ref separators (+ i 1)) 1)))))
   (define row-bands (bands sep-rows))
   (define col-bands (bands sep-cols))
   (define records
    (for*/list ((ri (range 0 (length row-bands)))
                (ci (range 0 (length col-bands))))
     (let ((rb (list-ref row-bands ri)) (cb (list-ref col-bands ci)))
      (list ri ci (subgrid g (first rb) (first cb) (second rb) (second cb))))))
   (define base-record
    (pick-max records
     (lambda (rec)
      (count-if (lambda (other) (equal? (third rec) (third other))) records))))
   (define base (third base-record))
   (define anomalies (filter (lambda (rec) (not (equal? (third rec) base))) records))
   (define anomaly (third (first anomalies)))
   (define base-colors (grid-colors base))
   (define ink
    (first (filter (lambda (v) (not (member v base-colors))) (grid-colors anomaly))))
   (define full-mask (find-color anomaly ink))
   (define mask-grid (paint-cells (empty-grid (rows anomaly) (cols anomaly) 0) full-mask 1))
   (define components (objects mask-grid 0))
   (define selected-mask
    (if (= scope-mode 0)
        full-mask
        (obj-cells (pick-max components obj-size))))
   (define clues (map (lambda (rec) (list (first rec) (second rec))) anomalies))
   (define anchors
    (for*/list ((ar (range 0 (+ 1 (- (length row-bands) (rows anomaly)))))
                (ac (range 0 (+ 1 (- (length col-bands) (cols anomaly)))))
                #:when
                (all? (lambda (q)
                        (member (list (- (first q) ar) (- (second q) ac)) full-mask))
                      clues))
     (list ar ac)))
   (define anchor (first anchors))
   (define paints
    (apply append
     (for/list ((p selected-mask))
      (let* ((mr (+ (first anchor) (first p)))
             (mc (+ (second anchor) (second p)))
             (rb (list-ref row-bands mr))
             (cb (list-ref col-bands mc)))
       (for*/list ((r (range 0 (rows anomaly))) (c (range 0 (cols anomaly))))
        (list (+ (first rb) r) (+ (first cb) c) (at anomaly r c)))))))
   (paint-cells g paints))))

Provenance

Generator
generators/public_eval_b99e7126/generator.py
Notes and decisions
generators/public_eval_b99e7126/notes.md
Review label
reviewed_safe
Generator SHA-256
806c1046004d212ccb9ca5656c7d724780c7ba97f2cc134eda2eb95a896250df
Rule hash
6c2125953cac
Sources
evaluation, public_eval:b99e7126
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_b99e7126 --count 1 --seed 20261108 --test 1