← 9713c70409d0 · 9758187b19ad →

974fee515740

The first two nonzero cells of the top row encode a boolean operation (3 union, 4 intersection, 6 xor, 7 red-minus-blue) and a clockwise quarter-turn count (1 identity, 2/3/4 = 90/180/270 degrees). The first red object and first blue object are normalized, blue is rotated, the masks are combined, and the minimal result is rendered in cyan.

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!
  (let ((dummy 0))
    (define (same-pos? a b)
      (and (= (fst a) (fst b)) (= (snd a) (snd b))))
    (define (has-cell? p cells)
      (any? (lambda (q) (same-pos? p q)) cells))
    (define (rotate-by cells code)
      (cond
        [(= code 2) (normalize-cells (rotate-cells-cw cells))]
        [(= code 3) (normalize-cells (rotate-cells-cw (rotate-cells-cw cells)))]
        [(= code 4) (normalize-cells (rotate-cells-cw (rotate-cells-cw (rotate-cells-cw cells))))]
        [else (normalize-cells cells)]))
    (define (render cells)
      (if (empty? cells)
          (list (list 0))
          (let* ((norm (normalize-cells cells))
                 (bb (bbox-of-cells norm))
                 (out-h (+ 1 (third bb)))
                 (out-w (+ 1 (fourth bb))))
            (grid-from-fn out-h out-w
              (lambda (r c) (if (has-cell? (list r c) norm) 8 0))))))
    (let* ((nz (filter (lambda (v) (not (= v 0))) (row-at g 0)))
           (op-raw (if (empty? nz) 6 (first nz)))
           (rot-raw (if (> (length nz) 1) (second nz) 1))
           (op (if (member? op-raw (list 3 4 6 7)) op-raw 6))
           (rot-code (if (member? rot-raw (list 1 2 3 4)) rot-raw 1))
           (red-obj (first (filter (lambda (obj) (= (obj-color obj) 2)) (objects g 0))))
           (blue-obj (first (filter (lambda (obj) (= (obj-color obj) 1)) (objects g 0))))
           (red (normalize-cells (obj-cells red-obj)))
           (blue (rotate-by (normalize-cells (obj-cells blue-obj)) rot-code))
           (result
             (cond
               [(= op 3) (append red (filter (lambda (p) (not (has-cell? p red))) blue))]
               [(= op 4) (filter (lambda (p) (has-cell? p blue)) red)]
               [(= op 6)
                (append
                  (filter (lambda (p) (not (has-cell? p blue))) red)
                  (filter (lambda (p) (not (has-cell? p red))) blue))]
               [else (filter (lambda (p) (not (has-cell? p blue))) red)])))
      (render result))))

Provenance

Generator
generators/974fee515740/generator.py
Notes and decisions
generators/974fee515740/notes.md
Review label
reviewed_safe
Generator SHA-256
867b0f64a809b9354d20597f3e5961eb3489fbe06a44e07f76b42e98a55d642f
Rule hash
fa743bc61f9d
Sources
bank:f6c2fd26c5e5
Lesson seeds
20261108, 20261109, 20261110, 20261111, 20261112
Reproduce lesson 1
arcpuzzles generate 974fee515740 --count 1 --seed 20261108 --test 1