← 2dbcb80623f9 · 2e0d26e28a50 →

2e02ca69563c

One to three disjoint rectangular frames on background 0. Each frame has one or two endpoint colors occurring exactly twice locally; colors may recur in other frames. Connect each pair horizontally from the row-major first endpoint, then vertically. Optional singleton/triple colors stay unchanged. Full routed paths are reserved, so no endpoint is overwritten.

parametric familycontainmentindependent subproblemspath tracing

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).

Reference rule (Racket)

(rule!
  (let ((dummy 0))
    (define (rect-border? obj)
      (let* ((bb (obj-bbox obj))
             (h (+ (- (third bb) (first bb)) 1))
             (w (+ (- (fourth bb) (second bb)) 1))
             (border-size (- (* h w) (* (max 0 (- h 2)) (max 0 (- w 2))))))
        (and (>= h 3) (>= w 3) (= (obj-size obj) border-size)
             (all? (lambda (p)
                     (or (= (first p) (first bb)) (= (first p) (third bb))
                         (= (second p) (second bb)) (= (second p) (fourth bb))))
                   (obj-cells obj)))))
    (define (step-range a b)
      (if (<= a b) (range a (+ b 1)) (reverse (range b (+ a 1)))))
    (define (trace a b)
      (let* ((r1 (first a)) (c1 (second a)) (r2 (first b)) (c2 (second b))
             (hpart (map (lambda (c) (list r1 c)) (step-range c1 c2)))
             (vpart (map (lambda (r) (list r c2)) (rest (step-range r1 r2)))))
        (append hpart vpart)))
    (for/fold ([out g]) ([frame (in-list (filter rect-border? (objects g 0)))])
      (let* ((bb (obj-bbox frame))
             (inside-cells (filter (lambda (cell)
                                     (let ((r (first cell)) (c (second cell)) (v (third cell)))
                                       (and (> r (first bb)) (< r (third bb))
                                            (> c (second bb)) (< c (fourth bb))
                                            (not (= v 0)) (not (= v (obj-color frame))))))
                                   (grid-cells g)))
             (colors (remove-duplicates (map third inside-cells))))
        (for/fold ([acc out]) ([color (in-list colors)])
          (let ((pts (map (lambda (cell) (list (first cell) (second cell)))
                          (filter (lambda (cell) (= (third cell) color)) inside-cells))))
            (if (= (length pts) 2)
                (paint-cells acc (trace (first pts) (second pts)) color)
                acc)))))))

Provenance

Generator
generators/2e02ca69563c/generator.py
Notes and decisions
generators/2e02ca69563c/notes.md
Review label
reviewed_safe
Generator SHA-256
c659d6a49ec1af31b1e9811e1425a21029fa5e2368f44fb7ca265fc41b522783
Rule hash
024c6f6dd0fa
Sources
bank:c025e54ed3a2
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 2e02ca69563c --count 1 --seed 20261108 --test 1