← public_eval_5dbc8537 · public_eval_64efde09 →
public_eval_62593bfd
Move same-sized object groups to the top and singleton sizes to the bottom.
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 modal background, then discover SAME-COLOR eight-connected objects.
;; Measure each object's occupied area. Objects with another object of equal
;; area rise to the top; unique-area objects sink to the bottom. Colors, shapes,
;; and horizontal coordinates are preserved. Erase before painting, so old
;; locations never mask a translated object. Equal-size groups may exceed two.
;; Admitted generated scenes have disjoint destination footprints.
(lambda (g)
(let ()
(define match-by 'occupied_area)
(define connectivity 8)
(define direction 'normal)
(define exact-pairs #f)
(define bg (mode g -1))
(define components (if (= connectivity 8) (objects-8 g bg) (objects g bg)))
(define (measure obj)
(cond [(equal? match-by 'occupied_area) (obj-size obj)]
[(equal? match-by 'bbox_area) (* (obj-h obj) (obj-w obj))]
[(equal? match-by 'width) (obj-w obj)]
[(equal? match-by 'height) (obj-h obj)]
[(equal? match-by 'bbox_perimeter) (* 2 (+ (obj-h obj) (obj-w obj)))]
[(equal? match-by 'color) (obj-color obj)]
[else (error 'measure "unknown matching key")]))
;; Step A: input-derived measurements and their multiplicities.
(define keys (map measure components))
(define records
(for/list ([obj components] [key keys])
(list obj key (length (filter (lambda (x) (= x key)) keys)))))
;; Step B consumes those multiplicities to choose a per-object translation.
(for/fold ([out (empty-grid (rows g) (cols g) bg)]) ([record records])
(define obj (first record))
(define repeated (if exact-pairs (= (third record) 2) (> (third record) 1)))
(define top
(cond [(equal? direction 'reverse) (not repeated)]
[(equal? direction 'all_top) #t]
[(equal? direction 'all_bottom) #f]
[else repeated]))
(define dr (if top (- (obj-r1 obj)) (- (rows g) 1 (obj-r2 obj))))
(for/fold ([painted out]) ([p (obj-cells obj)])
(set-cell painted (+ (first p) dr) (second p) (obj-color obj)))))))
Provenance
- Generator
- generators/public_eval_62593bfd/generator.py
- Notes and decisions
- generators/public_eval_62593bfd/notes.md
- Review label
- reviewed_safe
- Generator SHA-256
- 46eee67e24a34ea3159fb7c1c880a5442cce29c15728e34885d6490cbdc8b5b5
- Rule hash
- 8953ac3a5b79
- Sources
- evaluation, public_eval:62593bfd
- Lesson seeds
- 20261108, 20261109, 20261110, 20261111, 20261112
- Reproduce lesson 1
arcpuzzles generate public_eval_62593bfd --count 1 --seed 20261108 --test 1