← 7aee010af40d · 7b0c20fe6f33 →

7b088f161470

Count full ladder rungs per floor and encode three colored bars with maroon and one gray minimum marker.

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 (grid)
         (let* ((h (rows grid))
                (w (cols grid))
                (floor-rows (filter (lambda (r)
                                      (let ((v (at grid r 0)))
                                        (and
                                          (!= v 0)
                                          (andmap (lambda (c) (= (at grid r c) v))
                                                  (range 1 w)))))
                                    (range 0 h)))
                (floor-colors (map (lambda (r) (at grid r 0)) floor-rows))
                (maroon-color (last floor-colors))
                (non-maroon-floors (drop-right floor-rows 1))
                (non-maroon-colors (drop-right floor-colors 1))
                (rung-counts (map (lambda (i)
                                    (let* ((floor-r (list-ref floor-rows i))
                                           (next-floor-r (list-ref floor-rows (+ i 1)))
                                           (color (list-ref floor-colors i))
                                           (potential-rows (range (+ floor-r 1)
                                                                  next-floor-r))
                                           (rung-rs (filter (lambda (r)
                                                              (let ((cells-of-color (filter (lambda (c)
                                                                                              (= (at grid
                                                                                                     r
                                                                                                     c)
                                                                                                 color))
                                                                                            (range 0
                                                                                                   w))))
                                                                (and
                                                                  (>= (length cells-of-color)
                                                                      3)
                                                                  (= (- (last cells-of-color)
                                                                        (first cells-of-color))
                                                                     (- (length cells-of-color)
                                                                        1)))))
                                                            potential-rows)))
                                      (length rung-rs)))
                                  (range 0 (length non-maroon-floors))))
                (gray-cells (find-color grid 5))
                (has-gray (not (empty? gray-cells)))
                (rungs-with-idx (map (lambda (i) (list (list-ref rung-counts i) i))
                                     (range 0 (length rung-counts))))
                (positive (filter (lambda (p) (> (first p) 0)) rungs-with-idx))
                (sorted2 (sort-by positive
                                  (lambda (p) (+ (* (first p) 100) (- 100 (second p))))))
                (gray-floor-idx (if (empty? sorted2) 0 (second (first sorted2))))
                (n-floors (length non-maroon-floors)))
           (build-grid n-floors
                       5
                       (r c)
                       (cond
                         ((= c 3) maroon-color)
                         ((and (= c 4) has-gray (= r gray-floor-idx)) 5)
                         ((>= c 3) 0)
                         (else (let ((cnt (list-ref rung-counts r))
                                     (color (list-ref non-maroon-colors r)))
                                 (if (< c cnt) color 0))))))))

Provenance

Generator
generators/7b088f161470/generator.py
Notes and decisions
generators/7b088f161470/notes.md
Review label
reviewed_safe
Generator SHA-256
ee796bd6fc60f5b0bb9664351830177d22c4b00a8fcdcc15164ba93ce1100a45
Rule hash
5cb6f6518f37
Sources
augmented, training
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 7b088f161470 --count 1 --seed 20261108 --test 1