← 25e78410d5bb · 2636c90a673a →

2602c3d31d21

Build the right-edge-keyed matrix of equal versus unequal pairwise-squared-distance shape signatures.

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))
                (key-colors (filter (lambda (v) (!= v 0))
                                    (map (lambda (r) (at g r (- w 1))) (range 0 h))))
                (n (length key-colors))
                (objs (objects g 0))
                (shapes (filter (lambda (o) (> (obj-size o) 1)) objs))
                (spd-for (lambda (color)
                           (let* ((obj (find (lambda (o) (= (obj-color o) color))
                                             shapes)))
                             (if (not obj)
                                 -1
                                 (let* ((cells (obj-cells obj))
                                        (sz (obj-size obj)))
                                   (for/sum ((i (range 0 sz)))
                                     (for/sum ((j (range (+ i 1) sz)))
                                       (let* ((c1 (nth cells i))
                                              (c2 (nth cells j)))
                                         (+ (* (- (first c1) (first c2))
                                               (- (first c1) (first c2)))
                                            (* (- (second c1) (second c2))
                                               (- (second c1) (second c2))))))))))))
                (total (- (* (+ n 1) 3) 1)))
           (grid-from-fn total
                         total
                         (lambda (r c)
                           (let* ((bi (quotient r 3))
                                  (bj (quotient c 3))
                                  (lr (modulo r 3))
                                  (lc (modulo c 3)))
                             (if (or (= lr 2) (= lc 2))
                                 0
                                 (if (and (zero? bi) (zero? bj))
                                     0
                                     (if (zero? bi)
                                         (nth key-colors (- bj 1))
                                         (if (zero? bj)
                                             (nth key-colors (- bi 1))
                                             (if (= bi bj)
                                                 0
                                                 (if (= (spd-for (nth key-colors
                                                                      (- bi 1)))
                                                        (spd-for (nth key-colors
                                                                      (- bj 1))))
                                                     2
                                                     5))))))))))))

Provenance

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