← public_eval_89565ca0 · public_eval_8b7bacbf →

public_eval_898e7135

Match scaled outside pieces to template holes under D4 symmetry, fill, and enlarge the template.

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!
 ;; Infer the common integer scale of the outside colored pieces. Match their
 ;; shapes, under rotation/reflection, to the holes of the unique perforated
 ;; full-border rectangle. Color each hole, then enlarge the completed template.
 (lambda (g)
  (let ()
    (define os (objects g 0))
    ;; A frame has a complete rectangular perimeter and at least one zero cavity.
    (define frame
      (for/first ((o os)
                  #:when
                  (and (> (obj-h o) 2) (> (obj-w o) 2)
                       (for/and ((p (positions-in-rect (obj-r1 o) (obj-c1 o) (obj-r2 o) (obj-c2 o))))
                         (if (or (= (first p) (obj-r1 o)) (= (first p) (obj-r2 o))
                                 (= (second p) (obj-c1 o)) (= (second p) (obj-c2 o)))
                             (= (at g (first p) (second p)) (obj-color o))
                             (or (= (at g (first p) (second p)) 0)
                                 (= (at g (first p) (second p)) (obj-color o)))))
                       (> (count-color (subgrid g (obj-r1 o) (obj-c1 o) (obj-r2 o) (obj-c2 o)) 0) 0)))
        o))
    (define frame-color (obj-color frame))
    (define template (subgrid g (obj-r1 frame) (obj-c1 frame) (obj-r2 frame) (obj-c2 frame)))
    (define holes (objects template frame-color))
    (define pieces (filter (lambda (o) (not (equal? o frame))) os))
    (define (expanded cells k)
      (for*/list ((p (normalize-cells cells)) (dr (range k)) (dc (range k)))
        (list (+ (* (first p) k) dr) (+ (* (second p) k) dc))))
    (define (matching hole k)
      (define target (sort (expanded (obj-cells hole) k) cell<))
      (filter (lambda (o) (member target (all-transforms (obj-cells o)))) pieces))
    ;; A single scale must fit EVERY cavity, not just the first or largest one.
    (define scale
      (for/first ((k (range 1 (+ 1 (quotient 30 (max (rows template) (cols template))))))
                  #:when (for/and ((hole holes)) (not (null? (matching hole k))))) k))
    (define solved
      (for/fold ((out template)) ((hole holes))
        (recolor-cells out (obj-cells hole) (obj-color (first (matching hole scale))))))
    (build-grid (* scale (rows solved)) (* scale (cols solved)) (r c)
      (at solved (quotient r scale) (quotient c scale))))))

Provenance

Generator
generators/public_eval_898e7135/generator.py
Notes and decisions
generators/public_eval_898e7135/notes.md
Review label
reviewed_safe
Generator SHA-256
50c9c43e59078ec5be8f3b7dfbe67773171e3e046d9eac5f72a02666951a050e
Rule hash
538303bb7db3
Sources
evaluation, public_eval:898e7135
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate public_eval_898e7135 --count 1 --seed 20261108 --test 1