# Program Synthesis using Inductive Logic Programming for the Abstraction and Reasoning Corpus
**Authors**: Filipe Marinho Rocha, InĂŞs Dutra, VĂtor Santos Costa
> INESCTEC-FCUP
## Abstract
The Abstraction and Reasoning Corpus (ARC) is a general artificial intelligence benchmark that is currently unsolvable by any Machine Learning method, including Large Language Models (LLMs). It demands strong generalization and reasoning capabilities which are known to be weaknesses of Neural Network based systems. In this work, we propose a Program Synthesis system that uses Inductive Logic Programming (ILP), a branch of Symbolic AI, to solve ARC. We have manually defined a simple Domain Specific Language (DSL) that corresponds to a small set of object-centric abstractions relevant to ARC. This is the Background Knowledge used by ILP to create Logic Programs that provide reasoning capabilities to our system. The full system is capable of generalize to unseen tasks, since ILP can create Logic Program(s) from few examples, in the case of ARC: pairs of Input-Output grids examples for each task. These Logic Programs are able to generate Objects present in the Output grid and the combination of these can form a complete program that transforms an Input grid into an Output grid. We randomly chose some tasks from ARC that don’t require more than the small number of the Object primitives we implemented and show that given only these, our system can solve tasks that require each, such different reasoning.
123
## 1 Introduction
Machine Learning [5], more specifically, Deep Learning [14], has achieved great successes and surpassed human performance in several fields. These successes, though, are in what is called skill-based or narrow AI, since each DL model is prepared to solve a specific task very well but fails at solving different kind of tasks [18] [13].
It is known Artificial Neural Networks (ANNs) and Deep Learning (DL) suffer from lack of generalization capabilities. Their performance degrade when they are applied to Out-of-Distribution data [12] [8] [27].
Large Language Models (LLMs), more recently, have shown amazing capabilities, shortening the gap between Machine and Human Intelligence. But they still show lack of reasoning capabilities and require lots of data and computation.
The ARC challenge was designed by Francois Chollet in order to evaluate whether our artificial intelligent systems have progressed at emulating human like form of general intelligence. ARC can be seen as a general artificial intelligence benchmark, a program synthesis benchmark, or a psychometric intelligence test [6].
It was presented in 2019 but it still remains an unsolved challenge, and even the best DL models, such as LLMs cannot solve it [15] [4] [3]. GPT-4V, which is GPT4 enhanced for visual tasks [1], is unable to solve it too [26] [19] [23].
It targets both humans and artificially intelligent systems and aims to emulate a human-like form of general fluid intelligence. It is somewhat similar in format to Raven’s Progressive Matrices [22], a classic IQ test format.
It requires, what Chollet describes as, developer-aware generalization, which is a stronger form of generalization, than Out-of-Distribution generalization [6]. In ARC, the Evaluation set, with 400 examples, only features tasks that do not appear in the Training set, with also 400 examples, and all each of these tasks require very different Logical patterns to solve, that the developer cannot foresee. There is also a Test set with 200 examples, which is completely private.
For a researcher setting out to solve ARC, it is perhaps best understood as a program synthesis benchmark [6]. Program synthesis [9] [10] is a subfield of AI with the purpose of generating of programs that satisfy a high-level specification, often provided in the form of example pairs of inputs and outputs for the program, which is exactly the ARC format.
Chollet recommends starting by developing a domain-specific language (DSL) capable of expressing all possible solution programs for any ARC task [6]. Since the exact set of ARC tasks is purposely not formally definable, and can be anything that would only involve Core Knowledge priors, this is challenging.
Objectness is considered one of the Core Knowledge prior of humans, necessary to solve ARC [6]. Object-centric abstractions enable object awareness which seems crucial for humans when solving ARC tasks [2] [11] and is central to general human visual understanding [24]. There is previous work using object-centric approaches to ARC that shows its usefulness [16] [2].
Inductive Logic Programming (ILP) [20] is also considered a Machine Learning method, but to our knowledge it was never applied to the ARC challenge. It can perform Program Synthesis [7] and is known for being able to learn and generalize from few training examples [17] [21].
We developed a Program Synthesis system that uses ILP, on top of Object-centric abstractions, manually defined by us. It does Program synthesis by searching the combination of Logic relations between objects existent in the training examples. This Logic relations are defined by Logic Programs, obtained using ILP.
The full program our system builds, is composed by Logic Programs that are capable of generating objects in the Output Grid.
We selected five random examples that contain only simple geometrical objects and applied our system to these.
Figure 1: Example tasks of the ARC Training dataset with the solutions shown. The goal is to produce the Test Output grid given the Test Input grid and the Train Input-Output grid pairs. We can see the logic behind each task is very different and the relations between objects are key to the solutions.
## 2 Object-centric Abstractions and Representations
Object-centric abstractions reduce substantially the search space by enabling the focus on the relations between objects, instead of individual pixels.
However, there may be multiple ways to interpret the same image in terms of objects, therefore, we keep multiple, overlapping Object representations for the same image.
### 2.1 Objects and Relations between Objects
We have defined manually a simple DSL that is composed by the Objects: Point, Line and Rectangle and the Relations between Objects: LineFromPoint, Translate, Copy, PointStraightPathTo.
Table 1: Object types.
| Point | (x, y, color) |
| --- | --- |
| Line | (x1, y1, x2, y2, color, len, orientation, direction) |
| Rectangle | (x1, y1, x2, y2, x3, y3, x4, y4, color, clean, area) |
Table 2: Relations types.
| LineFromPoint | (point, line, len, orientation, direction) |
| --- | --- |
| Translate | (obj1, obj2, xdir, ydir, color2) |
| Copy | (obj1, obj2, color2, clean) |
| PointStraightPathTo | (point, obj, xdir, ydir, orientation, direction) |
### 2.2 Multiple Representations
An image representation in our object-centric approach is defined by a list of objects (possibly overlapping) and a background color. This representation can build a target image from an empty grid by firstly filling the grid with the background color and then drawing each object on top of it.
An image grid can be defined by multiple Object representations. For example a single Rectangle in an empty grid can also be defined as several Line or Point objects that form the same Rectangle.
Since we don’t know from the start, the Logic behind the transformation of the Input grid into the Output grid, we don’t know if the Object Rectangle is key to this logic (relation between rectangles) or if instead the logic demands using a Line representation for it may involve a relation dependent on lines, such as the LineFromPoint relation.
<details>
<summary>extracted/2405.06399v1/multiple_representations.png Details</summary>

### Visual Description
## Diagram: Input-to-Output Transformation Flow
### Overview
The image depicts a four-quadrant grid-based diagram illustrating a transformation process. The top-left quadrant is labeled "Input," while the remaining three quadrants are labeled "Output 1," "Output 2," and "Output 3." Red arrows indicate directional relationships between these components. Each quadrant contains a 10x10 grid with a centrally positioned red square.
### Components/Axes
1. **Grid Structure**:
- All quadrants share identical grid dimensions (10 rows Ă— 10 columns)
- Grid lines are white on a black background
- Coordinate system: Cartesian-like with equal spacing between grid lines
2. **Key Elements**:
- **Input**: Top-left quadrant with a 3x3 red square centered at (5,5) grid coordinates
- **Output 1**: Top-right quadrant with identical 3x3 red square at (5,5)
- **Output 2**: Bottom-right quadrant with 3x3 red square vertically stretched to 3x6 (rows 4-6, column 5)
- **Output 3**: Bottom-left quadrant with 3x3 red square vertically compressed to 1x3 (row 5, columns 4-6)
3. **Arrows**:
- Red arrows connect "Input" to all three outputs
- Arrow thickness: 2px
- Arrowhead size: 5px
### Detailed Analysis
- **Positional Consistency**: All outputs maintain the central position of the red square relative to their respective grids
- **Dimensional Variations**:
- Output 2: Vertical expansion (height doubled from 3 to 6 units)
- Output 3: Vertical compression (height reduced from 3 to 1 unit)
- Output 1: No dimensional changes
- **Spatial Relationships**:
- Output 1 mirrors Input exactly
- Output 2 extends downward from Input's position
- Output 3 contracts upward from Input's position
### Key Observations
1. **Invariant Positioning**: The red square's center remains at grid coordinates (5,5) across all outputs despite dimensional changes
2. **Directional Flow**: Arrows suggest a one-to-many transformation process from Input to multiple outputs
3. **Structural Preservation**: Grid dimensions remain constant across all quadrants, emphasizing positional rather than spatial transformations
### Interpretation
This diagram appears to represent a data processing or transformation pipeline where:
- The Input serves as a base reference point
- Output 1 represents an identity transformation (no change)
- Output 2 demonstrates vertical expansion while maintaining horizontal alignment
- Output 3 shows vertical compression with horizontal centering
The consistent central positioning across all outputs suggests that the transformation process preserves a core reference point while allowing dimensional modifications. This could symbolize:
1. Feature extraction maintaining key attributes
2. Data normalization processes
3. Dimensionality reduction techniques
4. Signal processing with preserved central frequency
The absence of numerical values or explicit scaling factors leaves the exact nature of transformations ambiguous, but the visual consistency implies a controlled, rule-based transformation system.
</details>
Figure 2: Example of an Input grid with a Rectangle (or with several contiguous Points or Lines) and three possible Output grids, built from the Input, depending on which type of Object representation is used. The Output object can be described by the relation Copy applied to the Input Rectangle or to just one Input Point or Input Line that is part of the same Rectangle.
Likewise, the same image transformation can be explained by different relations.
So we work with multiple and intermingled representations of objects and relations until we get the final program or programs that can transform each of the Training input grids into the output grids and also produce a valid Output grid for the Test Example, which will be the output solution given by our system.
If multiple programs applied separately can produce successfully the same Input-Output Train images transformation, we can use any of this, or select one, for example: the shortest program, which will have more probability of being the correct one, according to the Occam principle.
## 3 ILP
Inductive Logic Programming (ILP) is a form of logic-based Machine Learning. The goal is to induce a hypothesis, a Logic Program or set of Logical Rules, that generalizes given training examples and Background Knowledge (BK). Our DSL composed by Objects and Relations, is the BK given.
As with other forms of ML, the goal is to induce a hypothesis that generalizes training examples. However, whereas most forms of ML use vectors/tensors to represent data, ILP uses logic programs. And whereas most forms of ML learn functions, ILP learns relations.
The fundamental ILP problem is to efficiently search a large hypothesis space. There are ILP approaches that search in either a top-down or bottom-up fashion and others that combine both. We use a top-down approach in our system.
Learning a large program with ILP is very challenging, since the search space can get very big. There are some approaches that try to overcome this.
### 3.1 Divide-and-conquer
Divide-and-conquer approaches [25] divide the examples into subsets and search for a program for each subset. We use a Divide-and-conquer approach but instead of applying it to examples, we apply it to the Objects inside the examples.
## 4 Program Synthesis using ILP
ILP is usually seen as a method for Concept Learning but is capable of building a Logic Program in Prolog, which is Turing-complete, hence, it does Program Synthesis. We extend this by combining Logic Programs to build a bigger program that generates objects in sequence, to fill an empty grid, which corresponds to, procedurally, applying grids transformations to reach the solution.
A Relation can be used to generate objects. All of our Relations, except for PointStraightPathTo, are able to generate Objects given the first Object of the Relation. To generate an unambiguous output, the Relation should be defined by a Logic Program. This Logic Program is built by using ILP in our system.
Example of a logic program in Prolog:
⬇
line_from_point (Point, Line, Len, Orientation, Direction):-
member (Point, Input_points),
equal (Len,5),
equal (Orientation, ’vertical’).
<details>
<summary>extracted/2405.06399v1/line_from_point_example1.png Details</summary>

### Visual Description
## Grid Transformation Diagram: Input to Output Mapping
### Overview
The image depicts a two-stage grid transformation process. A 10x10 grid labeled "Input" on the left contains two colored squares, which are transformed into vertical columns in a second 10x10 grid labeled "Output" on the right. A red arrow indicates the directional flow between the grids.
### Components/Axes
- **Grid Structure**:
- Both grids use a Cartesian coordinate system with axes labeled 1-10 on both X (horizontal) and Y (vertical) dimensions.
- Input grid:
- Red square at (X=3, Y=10)
- Blue square at (X=10, Y=3)
- Output grid:
- Red vertical column spanning Y=1 to Y=5 at X=3
- Blue vertical column spanning Y=1 to Y=5 at X=10
- **Directional Indicator**:
- Red arrow connects Input grid to Output grid, positioned centrally between the two grids.
### Detailed Analysis
1. **Input Grid**:
- Two discrete data points:
- Red square: (3,10) - located in the top row, third column
- Blue square: (10,3) - located in the third row, rightmost column
- Spatial relationship: Points form a diagonal pattern from top-left to bottom-right.
2. **Output Grid**:
- Two vertical columns:
- Red column: X=3, Y=1-5 (height = 5 units)
- Blue column: X=10, Y=1-5 (height = 5 units)
- Spatial relationship: Columns maintain horizontal alignment with their Input counterparts but are vertically compressed.
3. **Transformation Pattern**:
- Horizontal position preserved (X-coordinate remains unchanged)
- Vertical position inverted and scaled:
- Input Y=10 → Output Y=1-5 (top position becomes base of column)
- Input Y=3 → Output Y=1-5 (middle position becomes base of column)
- Magnitude scaling: Single unit input becomes 5-unit output column.
### Key Observations
1. **Positional Inversion**: Input coordinates are mirrored vertically in the Output (e.g., top becomes bottom).
2. **Magnitude Amplification**: Single-unit input points become 5-unit output columns.
3. **Color Consistency**: Color coding (red/blue) is preserved through transformation.
4. **Spatial Compression**: Output columns occupy only the bottom 5 rows of the grid despite Input points being distributed across the full grid height.
### Interpretation
This diagram illustrates a coordinate transformation process with three key characteristics:
1. **Positional Mapping**: Maintains horizontal alignment while inverting vertical positioning
2. **Magnitude Conversion**: Transforms discrete points into aggregated vertical bars
3. **Dimensional Scaling**: Compresses vertical dimension by a factor of 5:1
The transformation appears to represent a data processing pipeline where:
- Input points (possibly raw data samples) are converted into
- Output distributions (possibly frequency counts or aggregated measurements)
The consistent color mapping suggests categorical preservation through the transformation, while the vertical scaling implies a normalization or standardization process. The diagonal Input pattern becoming vertical Output columns may indicate a feature extraction or dimensionality reduction operation.
</details>
Figure 3: Example of an Input-Output transformation when applied a LineFromPoint Logic Program that is able to generate Lines from Points.
This Logic Program can generate unambiguously, two lines in the Output. The variable Direction is not needed for this, since the points are on the edges of the Grid and so, can only grow into lines in one Direction each.
If the program was shorter, it would generate multiple Lines from each Input Point. Example of the same Logic Program without the last term in the body:
⬇
line_from_point (Point, Line, Len, Orientation, Direction):-
member (Point, Input_points),
equal (Len,5).
<details>
<summary>extracted/2405.06399v1/line_from_point_example2.png Details</summary>

### Visual Description
## Diagram: Input-to-Output Transformation
### Overview
The image depicts a two-grid system labeled "Input" (left) and "Output" (right), connected by a red arrow. Both grids are composed of a 10x10 matrix of black cells, with specific cells colored red or blue. The Input grid contains two colored cells, while the Output grid contains 14 colored cells arranged in a structured pattern.
### Components/Axes
- **Grid Structure**:
- Both grids are 10x10 matrices with no labeled axes or scales.
- Cells are uniformly sized and separated by thin white lines.
- **Color Coding**:
- **Red**: Appears in the Input grid (1 cell) and Output grid (9 cells).
- **Blue**: Appears in the Input grid (1 cell) and Output grid (5 cells).
- No explicit legend is provided to define the meaning of colors.
- **Arrow**: A bold red arrow connects the Input and Output grids, indicating a directional transformation.
### Detailed Analysis
#### Input Grid
- **Red Cell**: Located at the top-center of the grid (row 1, column 5).
- **Blue Cell**: Located at the bottom-center of the grid (row 10, column 5).
#### Output Grid
- **Red Cells**:
- Form a vertical column in the center (rows 1–5, column 5).
- Additional red cells are positioned symmetrically around the central column:
- Row 1, columns 3 and 7.
- Row 3, columns 2 and 8.
- Row 5, columns 1 and 9.
- **Blue Cells**:
- Form a horizontal line at the bottom (rows 6–10, columns 3–7).
### Key Observations
1. **Symmetry and Distribution**:
- The Output grid’s red cells exhibit radial symmetry around the central column, while blue cells form a uniform horizontal band.
2. **Cell Count Increase**:
- Input has 2 colored cells; Output has 14, suggesting a multiplicative or expansive process.
3. **Color Proportions**:
- Red dominates the Output (9/14 cells), while blue is less frequent but spatially concentrated.
### Interpretation
The diagram likely represents a **rule-based transformation** or **state evolution** system. The Input’s two cells (red and blue) may act as "seeds" that propagate into the Output’s complex pattern. The red cells’ radial spread could symbolize activation or influence spreading outward, while the blue cells’ horizontal alignment might indicate stabilization or grounding.
The absence of numerical data or legends limits quantitative analysis, but the spatial logic suggests a **cellular automaton** or **spatial propagation model**. The red arrow emphasizes causality, implying the Input directly generates the Output through predefined rules.
**Notable Anomalies**:
- The Input’s simplicity contrasts sharply with the Output’s complexity, highlighting a non-linear transformation.
- The blue cells in the Output are confined to the lower half, possibly indicating a boundary condition or termination state.
</details>
Figure 4: Example of an Input-Output transformation when applied a LineFromPoint Logic Program without having the Orientation defined.
So by obtaining Logic Programs through ILP we are indeed constructing a program that generates objects that can fill an empty Test Output grid, in order to reach the solution.
## 5 System Overview
### 5.1 Objects and Relations Retrieval
Our system begins by retrieving all Objects defined in our DSL, in the Input and Output grids for each example of a task. As we reported before, we keep multiple object representations that may overlap in terms of occupying the same pixels in a image.
Then we search for Relations defined in our DSL betweeen the found objects. We search for Relations between Objects only present in the Input Grid: Input-Input Relations, only present in the Output Grid: Output-Output Relations and between Objects in the Input Grid and Output Grid: Input-Output Relations.
The type of Objects previously found can constraint the search for Relations, since some Relations are specific to some kind of Objects.
### 5.2 ILP calls
We then call ILP to create Logic Programs to define only the Relations found in the previous step. This also reduces the space of the search. We start with the Input-Output Relations, since we need to build the Output objects using information from the Input. After we generate some Object(s) in the Output grid we can starting using also Output-Output relations to generate Output Objects from other Output Objects. Input-Input relations can appear in the body of the rules but won’t be the Target Relations to be defined by ILP, since they don’t generate any Object in the Output.
After each ILP call what is considered Input information, increases. The relations and Objects returned by the ILP call that produce an updated Grid, are considered now as it were present in the Input, and this updated Grid is taken as the initial Output grid where to build on, in the subsequent ILP calls.
#### 5.2.1 Candidate Generation
The candidates terms to be added to the Body of the Rule (Horn Clause) are the Objects and Relations found in the Retrieval step (5.1) plus the Equal(X,…), GreaterThan(X,…), LowerThan(X,…), Member(X,…) predicates. GreaterThan and Lowerthan relate only number variables. We also consider aX+b , being X a number variable and a and b, constants in some interval we predefine.
Since we are using Typed Objects and Relations we only need to generate those candidates that are related to each Target Relation variable by type.
For example, in building a Logic Program that defines the Relation: LineFromPoint(point,line,len,orientation,direction) we are going to generate candidates that relate Points or attributes of Points in order to instantiate the first variable Point of the relation. Then we proceed to the other variables (besides the line variable): len, orientation and direction. Len is of type Int, so it is only relevant to be related to other Int variables or constants. The variable Line remains free because it is the Object we want the relation to generate.
#### 5.2.2 Positive and Negative examples
As we have seen in Section 3, FOIL requires positive and negative examples to induce a program. ARC dataset is only composed of Positive examples. So we created a way to represent negative examples.
In our system for each Logic Program the Positive examples are the Objects that this program generates that exist in the Training Data, and the Negative examples are the Objects that the program generates, but don’t exist in the Training Data.
For example, imagine the Ouput in Figure 3 is the correct one, but the program generates all the Lines in Figure 4 like the shorter Prolog program we presented. For this Program the positives it covers would be the two Lines in Figure 3 and the negatives covered would be all the Lines in Figure 4, except for the vertical ones.
Here, our Object-centric approach also reduces the complexity of the search, compared with taking the entire Grid into account, to define what is a positive example or not.
#### 5.2.3 Unification between Training examples
An ILP call is made for each Relation and all of the Task’s Training examples. Our ILP system is constrained to produce Programs that can unify between examples, that is, they are abstract and generalize to two or more of the training examples.
Why two and not all of the training examples? One of the five examples we selected to help us develop our system showed us that a program that solves all Training examples can be too complex and not necessary to solve the Test example.
<details>
<summary>extracted/2405.06399v1/example_unification2.png Details</summary>

### Visual Description
## Diagram: Task 0a938d79 Color Pattern Generation
### Overview
The diagram illustrates a pattern generation task where input color pairs produce alternating output sequences. The system demonstrates consistent color alternation in outputs based on input combinations, with a clear legend mapping colors to labels (A-D).
### Components/Axes
- **Legend**: Located at the bottom of the diagram, mapping colors to labels:
- Red = A
- Blue = B
- Green = C
- Yellow = D
- **Sections**:
1. **Train Input 1**: Red (A) + Blue (B) → Alternating A/B output
2. **Train Input 2**: Blue (B) + Green (C) → Alternating B/C output
3. **Train Input 3**: Red (A) + Green (C) → Alternating A/C output
4. **Test Input**: Green (C) + Yellow (D) → Alternating C/D output
- **Output Structure**: All outputs show strict alternation of input colors, maintaining positional consistency (e.g., first output matches first input color).
### Detailed Analysis
- **Train Input 1**:
- Input: Red (A) at top-left, Blue (B) at bottom-right
- Output: 12 alternating vertical bars starting with A (Red)
- **Train Input 2**:
- Input: Blue (B) at top-left, Green (C) at bottom-right
- Output: 12 alternating vertical bars starting with B (Blue)
- **Train Input 3**:
- Input: Red (A) at top-left, Green (C) at bottom-right
- Output: 12 alternating vertical bars starting with A (Red)
- **Test Input**:
- Input: Green (C) at top-left, Yellow (D) at bottom-right
- Output: 12 alternating vertical bars starting with C (Green)
### Key Observations
1. **Pattern Consistency**: All outputs strictly alternate between the two input colors, regardless of input order
2. **Positional Fidelity**: First output bar always matches first input color
3. **Color Mapping**: Legend confirms color-to-label correspondence (A-D)
4. **Sequence Length**: All outputs contain exactly 12 bars (6 pairs of alternating colors)
### Interpretation
This diagram demonstrates a sequence generation system that:
- Learns to alternate between two input colors in output sequences
- Maintains positional consistency (first input color becomes first output color)
- Generalizes to unseen color pairs (Test Input C+D follows same pattern as trained A/B, B/C, A/C)
- Shows no positional bias - output sequence length remains constant regardless of input configuration
The system appears to implement a simple state machine where:
1. First input color becomes initial state
2. Alternates between input colors for fixed number of steps
3. Maintains output sequence length invariant to input configuration
No numerical data present - analysis based on categorical pattern recognition.
</details>
Figure 5: Example task that contains two Train examples with vertical lines and two Train examples with horizontal lines, in the Output grids. The Test example only requires vertical Lines in the same way as the first two Train examples.
In Figure 5 we can see a sample task and derive the logic for its solution: draw Lines from Points until the opposite border of the grid and then Translate these Lines repeatedly in the perpendicular direction of the Lines until the end of the grid.
To unify the four Train examples in this task and following the logic we described for this solution, it would require a more complex program than a solution that only unifies the first two examples.
Let’s see one sequence of Logic programs that solves the first two Train examples, and it would also solve, sucessfully, the Test example:
⬇
line_from_point (Point, Line, Len, Orientation, Direction):-
member (Point, Input_points),
equal (Len, X_dim),
equal (Orientation, ’vertical’).
translate (Line1, Line2, X_dir, Y_dir):-
member (Line1, Input_lines),
equal (X_dir,0),
translate (Input_point1, Input_point2, X_dir, Y_dir),
equal (Y_dir,2* Y_dir).
…
(the same translate program three more times)
The sequence of Logic Programs that would solve the last two Train examples with the Horizontal lines, but wouldn’t solve sucessfully the Test example which has Vertical lines:
⬇
line_from_point (Point, Line, Len, Orientation, Direction):-
member (Point, Input_points),
equal (Len, Y_dim),
equal (Orientation, ’horizontal’).
translate (Line1, Line2, X_dir, Y_dir):-
member (Line1, Input_lines),
equal (Y_dir,0),
translate (Input_point1, Input_point2, X_dir, Y_dir),
equal (X_dir,2* X_dir).
…
(the same translate program three more times)
The Test example only needs two translations in the Output Grid, so a program with more translations would work, since it would fill the entire grid and the extra translations just wouldn’t apply. Our system consider this a valid program.
But if the Test grid was longer and required more translations than present in the Training examples, our program wouldn’t work, since the number of translations wouldn’t produce the exact solution, but an incomplete one. For this kind of tasks we would need to use higher-order constructs as: Do Until, Repeat While or Recursion with a condition, to apply the same Relation a number of times or until some condition fails or is triggered. This is scope of future work.
### 5.3 Rules, Grid states and Search
The first ILP call is made on empty grid states. Each ILP call produces a rule that defines a Relation that generates objects, and returns new Output grid states with these objects added, for each example and the Test example. Each subsequent ILP call is made on the updated Output Grid states.
The search will be on finding the right sequence of Logic Programs that can build the Output Grids, starting from the empty grid. When we have one Program that builds at least one complete Training example Output Grid, consisting of a program that is unified between two or more examples and can also produce a valid solution (not necessarily the correct one) in the Test Output Grid, we consider it the final program.
A valid program is one that builds a consistent theory. For example, a program that generates different colored Lines that intersect with each other, is inconsistent, since both Lines cannot exist in the Output grid (one overlaps the other). We consider programs like this invalid, and discard them, when searching for the complete program.
<details>
<summary>extracted/2405.06399v1/output_state_transition.png Details</summary>

### Visual Description
## Diagram: Cellular Automaton Propagation Process
### Overview
The image depicts a four-stage progression of a cellular automaton system. It shows an initial input grid with two colored cells (blue and green) that evolve through three output states before reaching a final output grid. The progression is indicated by red arrows connecting each stage.
### Components/Axes
1. **Grid Structure**:
- All stages use identical 10x10 black grid backgrounds
- Cells are represented as colored squares (blue and green)
- Coordinates appear to be row-column based (top-left origin)
2. **Color Legend** (inferred):
- Blue squares: Initial active state
- Green squares: Propagated state
- No explicit legend present in the diagram
3. **Stage Labels**:
- Input Grid (top)
- Output State 0 (empty)
- Output State 1 (first propagation)
- Output State 2 (expanded propagation)
- Output Grid (final state)
### Detailed Analysis
1. **Input Grid**:
- Blue square at (1,2)
- Green square at (2,1)
- All other cells black/empty
2. **Output State 0**:
- No colored cells present
- Suggests initial state reset or transition phase
3. **Output State 1**:
- Blue square at (1,1)
- Green square at (2,2)
- Indicates diagonal propagation from input positions
4. **Output State 2**:
- Blue squares at (1,1), (1,3), (3,1)
- Green squares at (2,2), (2,4), (4,2)
- Shows expanding pattern with alternating colors
5. **Output Grid**:
- Blue squares at (1,1), (1,3), (1,5), (3,1), (3,5), (5,1), (5,3)
- Green squares at (2,2), (2,4), (2,6), (4,2), (4,4), (4,6), (6,2), (6,4)
- Final pattern shows checkerboard-like distribution with color separation
### Key Observations
1. **Propagation Pattern**:
- Blue squares maintain odd-row/odd-column positions
- Green squares occupy even-row/even-column positions
- Each state shows 2x expansion in both dimensions
2. **Color Separation**:
- No overlapping colors in any state
- Strict alternation between blue and green propagation paths
3. **Temporal Progression**:
- State 1: 2 cells → State 2: 5 cells → Final: 14 cells
- Exponential growth pattern (2 → 5 → 14)
### Interpretation
This diagram illustrates a deterministic cellular automaton system with:
1. **Spatial Rules**:
- Blue cells propagate to adjacent odd positions
- Green cells propagate to adjacent even positions
- No overlap between color domains
2. **Temporal Dynamics**:
- Each state represents a discrete time step
- Growth follows fractal-like expansion pattern
- Final state achieves maximum coverage without collisions
3. **System Behavior**:
- Input cells act as seeds for pattern generation
- Output Grid shows stable equilibrium configuration
- No decay or regression observed in propagation
The system demonstrates properties of:
- **Self-organization**: Pattern emerges from simple rules
- **Determinism**: Identical results for same initial conditions
- **Scalability**: Pattern complexity increases with iterations
Notably, the absence of Output State 0 suggests either:
1. A transitional phase with no visible changes
2. A system reset between input and first output
3. Potential missing intermediate state in the visualization
</details>
Figure 6: Example of a sucessful sequence of transformations to the Output grid state reaching the final state which is the correct Output grid. These transformations correspond to a sequence of Logic Programs: first transition comes from LineFromPoint Input-Output program, the second and third transitions correspond to the Translate Output-Output programs.
### 5.4 Deductive Search
In Figure 7 we can see an example Task that in order to be solved, it would be easier to do it in reverse, that is, the Input Grid being generated from Output information, but since we cannot solve the Test Output Grid by working in this direction, we use a form of Deductive Search to overcome this.
When we apply a Logic Program constructed by ILP, we can have different results depending on the order of the Object Generation. When an Object is generated in the Output Grid, none other Object generated afterwards, can intersect with it.
So the coverage of grid space of the same Logic Program may vary depending on the order of the program application. It is the procedural aspect of our system. When applying several Logic Programs in sequence, this problem gets even bigger.
So when applying the full program to produce the Test Output grid, we use Deductive search to apply the whole program in the way that covers the most surface. Since the final program is one that can cover the whole surface of Train Output grids, we should have a solution that can cover all of the Test Output grid too.
<details>
<summary>extracted/2405.06399v1/last_sample_task.png Details</summary>

### Visual Description
## Diagram: Task 1500deff5 Transformation Process
### Overview
The image depicts a six-panel diagram illustrating a transformation process for geometric shapes. The panels are divided into two sections: four "Train" examples (top row) and two "Test" examples (bottom row), separated by a dotted line. Each panel shows a gray input shape on the left and a transformed output on the right, using red and blue blocks. A question mark appears between the Test Input and Output panels, indicating uncertainty about the transformation logic.
### Components/Axes
- **Panels**:
- Top row:
1. Train Input (gray shape)
2. Train Output (red/blue blocks)
3. Train Input (gray shape)
4. Train Output (red/blue blocks)
- Bottom row:
1. Test Input (gray shape)
2. Test Output (red/blue blocks with question mark)
- **Colors**:
- Gray: Input shapes
- Red: Horizontal/rectangular blocks in outputs
- Blue: Square blocks in outputs
- **No explicit legend** explaining color meanings or transformation rules.
### Detailed Analysis
1. **Train Examples**:
- **Panel 1**: A complex gray shape (irregular L-shape with protrusions) transforms into a configuration with 3 red blocks and 2 blue blocks.
- **Panel 2**: A simpler gray shape (T-like form) becomes 2 red blocks and 2 blue blocks.
- **Panel 3**: A vertical gray shape (resembling a rotated "I") converts to 1 red block and 3 blue blocks.
- **Panel 4**: A horizontal gray shape (resembling a "Z") becomes 3 red blocks and 1 blue block.
2. **Test Examples**:
- **Test Input**: A gray shape similar to Panel 1 but with a different protrusion pattern.
- **Test Output**: A configuration with 2 red blocks and 3 blue blocks, differing from the Train Output pattern.
### Key Observations
- **Consistency in Train Examples**:
- Red blocks dominate in outputs for shapes with horizontal/elongated features.
- Blue blocks dominate for shapes with vertical/stacked features.
- **Anomaly in Test Output**:
- The Test Output (2 red, 3 blue) does not follow the Train Output pattern (e.g., Panel 1: 3 red, 2 blue).
- The question mark suggests the transformation rule may not apply here or an error exists.
### Interpretation
The diagram demonstrates a shape-to-block transformation task where:
1. **Training Phase**: Input shapes are converted into red/blue block configurations based on geometric features (e.g., horizontal vs. vertical orientation).
2. **Testing Phase**: The Test Input follows the same structural logic as Train Inputs but produces an output that contradicts the established pattern. This discrepancy could indicate:
- A novel transformation rule for edge cases
- An error in the Test Output generation
- An intentional outlier to test model robustness
3. **Uncertainty**: The absence of a legend leaves the exact transformation criteria ambiguous. The question mark explicitly highlights this uncertainty, suggesting the need for further validation or rule clarification.
## Additional Notes
- **Language**: All text is in English.
- **Spatial Grounding**:
- Legend colors (red/blue) are embedded in the output panels but lack explicit labeling.
- The question mark is centrally positioned between Test Input and Output, emphasizing the anomaly.
- **Trend Verification**:
- Train Outputs show a consistent pattern where red blocks correlate with horizontal features and blue with vertical features.
- Test Output breaks this trend, requiring further investigation.
</details>
Figure 7: Example task where the Output Grids are more informative than the Input Grids, to define and apply the Object Relations for the solution.
## 6 Experiments
Our system was applied sucessfully to five tasks, the three tasks in Figure 1: 08ed6ac7, a48eeaf7, 7e0986d6, the task in Figure 5: 0a938d79 and the task in Figure 7: 150deff5.
In the Appendices we present the Output solutions in Prolog for each task.
## 7 Conclusion
We showed our system is able to solve the 5 sample tasks selected. When we finish our software implementation we will apply our system to the full Training and Evaluation datasets.
ILP is at the core of our system and we showed that only by providing it with a small DSL or Background Knowledge, ILP is able to construct and represent the Logic behind solutions of ARC tasks.
ILP gives our system abstract learning and generalization capabilities, which is at the core of the ARC challenge.
Since the other ARC tasks may depend on many different DSL primitives, we plan to develop a way to automate the DSL creation.
As we mentioned before, potentially, we are going to need higher-order constructs to solve other tasks and plan to incorporate this into our system.
## References
- Achiam et al. [2023] J. Achiam, S. Adler, S. Agarwal, L. Ahmad, I. Akkaya, F. L. Aleman, D. Almeida, J. Altenschmidt, S. Altman, S. Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
- Acquaviva et al. [2022] S. Acquaviva, Y. Pu, M. Kryven, T. Sechopoulos, C. Wong, G. Ecanow, M. Nye, M. Tessler, and J. Tenenbaum. Communicating natural programs to humans and machines. Advances in Neural Information Processing Systems, 35:3731–3743, 2022.
- Bober-Irizar and Banerjee [2024] M. Bober-Irizar and S. Banerjee. Neural networks for abstraction and reasoning: Towards broad generalization in machines. arXiv preprint arXiv:2402.03507, 2024.
- Butt et al. [2024] N. Butt, B. Manczak, A. Wiggers, C. Rainone, D. Zhang, M. Defferrard, and T. Cohen. Codeit: Self-improving language models with prioritized hindsight replay. arXiv preprint arXiv:2402.04858, 2024.
- Carbonell et al. [1983] J. G. Carbonell, R. S. Michalski, and T. M. Mitchell. An overview of machine learning. Machine learning, pages 3–23, 1983.
- Chollet [2019] F. Chollet. On the measure of intelligence. arXiv preprint arXiv:1911.01547, 2019.
- Cropper et al. [2022] A. Cropper, S. Dumančić, R. Evans, and S. H. Muggleton. Inductive logic programming at 30. Machine Learning, 111(1):147–172, 2022.
- Farquhar and Gal [2022] S. Farquhar and Y. Gal. What’out-of-distribution’is and is not. In NeurIPS ML Safety Workshop, 2022.
- Gulwani et al. [2015] S. Gulwani, J. Hernández-Orallo, E. Kitzelmann, S. H. Muggleton, U. Schmid, and B. Zorn. Inductive programming meets the real world. Communications of the ACM, 58(11):90–99, 2015.
- Gulwani et al. [2017] S. Gulwani, O. Polozov, R. Singh, et al. Program synthesis. Foundations and Trends® in Programming Languages, 4(1-2):1–119, 2017.
- Johnson et al. [2021] A. Johnson, W. K. Vong, B. M. Lake, and T. M. Gureckis. Fast and flexible: Human program induction in abstract reasoning tasks. arXiv preprint arXiv:2103.05823, 2021.
- Kirchheim et al. [2024] K. Kirchheim, T. Gonschorek, and F. Ortmeier. Out-of-distribution detection with logical reasoning. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2122–2131, 2024.
- Lake et al. [2017] B. M. Lake, T. D. Ullman, J. B. Tenenbaum, and S. J. Gershman. Building machines that learn and think like people. Behavioral and brain sciences, 40:e253, 2017.
- LeCun et al. [2015] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. nature, 521(7553):436–444, 2015.
- Lee et al. [2024] S. Lee, W. Sim, D. Shin, S. Hwang, W. Seo, J. Park, S. Lee, S. Kim, and S. Kim. Reasoning abilities of large language models: In-depth analysis on the abstraction and reasoning corpus. arXiv preprint arXiv:2403.11793, 2024.
- Lei et al. [2024] C. Lei, N. Lipovetzky, and K. A. Ehinger. Generalized planning for the abstraction and reasoning corpus. arXiv preprint arXiv:2401.07426, 2024.
- Lin et al. [2014] D. Lin, E. Dechter, K. Ellis, J. B. Tenenbaum, and S. H. Muggleton. Bias reformulation for one-shot function induction. 2014.
- Marcus [2018] G. Marcus. Deep learning: A critical appraisal. arXiv preprint arXiv:1801.00631, 2018.
- Mitchell et al. [2023] M. Mitchell, A. B. Palmarini, and A. Moskvichev. Comparing humans, gpt-4, and gpt-4v on abstraction and reasoning tasks. arXiv preprint arXiv:2311.09247, 2023.
- Muggleton and De Raedt [1994] S. Muggleton and L. De Raedt. Inductive logic programming: Theory and methods. The Journal of Logic Programming, 19:629–679, 1994.
- Muggleton et al. [2018] S. Muggleton, W.-Z. Dai, C. Sammut, A. Tamaddoni-Nezhad, J. Wen, and Z.-H. Zhou. Meta-interpretive learning from noisy images. Machine Learning, 107:1097–1118, 2018.
- Raven [2003] J. Raven. Raven progressive matrices. In Handbook of nonverbal assessment, pages 223–237. Springer, 2003.
- Singh et al. [2023] M. Singh, J. Cambronero, S. Gulwani, V. Le, and G. Verbruggen. Assessing gpt4-v on structured reasoning tasks. arXiv preprint arXiv:2312.11524, 2023.
- Spelke and Kinzler [2007] E. S. Spelke and K. D. Kinzler. Core knowledge. Developmental science, 10(1):89–96, 2007.
- Witt et al. [2023] J. Witt, S. Rasing, S. Dumančić, T. Guns, and C.-C. Carbon. A divide-align-conquer strategy for program synthesis. arXiv preprint arXiv:2301.03094, 2023.
- Xu et al. [2023] Y. Xu, W. Li, P. Vaezipoor, S. Sanner, and E. B. Khalil. Llms and the abstraction and reasoning corpus: Successes, failures, and the importance of object-based representations. arXiv preprint arXiv:2305.18354, 2023.
- Ye et al. [2022] N. Ye, K. Li, H. Bai, R. Yu, L. Hong, F. Zhou, Z. Li, and J. Zhu. Ood-bench: Quantifying and understanding two dimensions of out-of-distribution generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7947–7958, 2022.
## Appendices
<details>
<summary>extracted/2405.06399v1/08ed6ac7.png Details</summary>

### Visual Description
## Bar Chart: Task 08ed6ac7
### Overview
The image contains two adjacent bar charts labeled "Test Input" (left) and "Test Output" (right), both with black backgrounds. Each chart has four bars of varying heights, with distinct color coding in the "Test Output" chart.
### Components/Axes
- **Titles**:
- Left chart: "Test Input"
- Right chart: "Test Output"
- **X-Axis**:
- No explicit labels for categories; four bars per chart, ordered left to right.
- "Test Input" bars are uniformly gray.
- "Test Output" bars use distinct colors: blue (1st), yellow (2nd), red (3rd), green (4th).
- **Y-Axis**:
- Scale from 0 to 100 (approximate).
- No gridlines or tick marks visible.
- **Legend**:
- No explicit legend present. Color assignments inferred from bar order and labels.
### Detailed Analysis
#### Test Input (Left Chart)
- **Bar Heights (approximate)**:
1. Tallest bar: ~90
2. Shortest bar: ~30
3. Medium bar: ~80
4. Medium bar: ~60
- **Trend**:
- Bimodal distribution: Two taller bars (1st and 3rd) and two shorter bars (2nd and 4th).
#### Test Output (Right Chart)
- **Bar Heights (approximate)**:
1. Tallest bar: ~85 (blue)
2. Shortest bar: ~25 (yellow)
3. Medium bar: ~75 (red)
4. Medium bar: ~55 (green)
- **Trend**:
- Similar bimodal pattern to "Test Input," but with reduced magnitude in the second bar (~25 vs. ~30).
### Key Observations
1. **Consistent Structure**: Both charts share the same bar order and height distribution pattern.
2. **Color Coding**: "Test Output" uses distinct colors for each bar, suggesting categorical differentiation (e.g., status, priority, or classification).
3. **Height Reduction**: The second bar in "Test Output" is slightly shorter than its counterpart in "Test Input," while the fourth bar is marginally shorter.
4. **No Explicit Legend**: Color meanings are ambiguous without additional context.
### Interpretation
- The "Test Output" chart likely represents a processed or categorized version of the "Test Input" data. The preserved bimodal pattern suggests the transformation maintains core trends but introduces categorical distinctions via color.
- The slight reduction in the second and fourth bars’ heights may indicate filtering, normalization, or prioritization during processing.
- The absence of a legend limits definitive interpretation of color assignments, but the order (blue → yellow → red → green) could imply a sequential or hierarchical relationship (e.g., priority levels).
- The uniform gray in "Test Input" implies a baseline or raw data state, while the colored bars in "Test Output" suggest post-processing categorization.
## Additional Notes
- **Language**: All text is in English.
- **Spatial Grounding**:
- "Test Input" is positioned to the left of "Test Output."
- Bars within each chart are ordered left to right, with colors assigned sequentially.
- **Uncertainties**:
- Exact y-axis values are estimates due to lack of gridlines.
- Color semantics (e.g., blue = high priority, green = low priority) require external context.
</details>
⬇
copy (Line1, Line_out, Color_out, Clean):-
member (Line1, Input_lines),
member (Line2, Input_lines),
member (Line3, Input_lines),
member (Line4, Input_lines),
line_attrs (Line1, X11, Y11, X12, Y12, Color1, Len1,
Orientation1, Direction1),
line_attrs (Line2, X21, Y21, X22, Y22, Color2, Len2,
Orientation2, Direction2),
line_attrs (Line3, X31, Y31, X32, Y32, Color3, Len3,
Orientation3, Direction3),
line_attrs (Line4, X41, Y41, X42, Y42, Color4, Len4,
Orientation4, Direction4),
equal (Color_out, ’blue’),
equal (Clean,100),
greaterthan (Len1, Len2),
greaterthan (Len1, Len3),
greaterthan (Len1, Len4).
copy (Line1, Line_out, Color_out, Clean):-
member (Line1, Input_lines),
member (Line2, Input_lines),
member (Line3, Input_lines),
member (Line4, Input_lines),
line_attrs (Line1, X11, Y11, X12, Y12, Color1, Len1,
Orientation1, Direction1),
line_attrs (Line2, X21, Y21, X22, Y22, Color2, Len2,
Orientation2, Direction2),
line_attrs (Line3, X31, Y31, X32, Y32, Color3, Len3,
Orientation3, Direction3),
line_attrs (Line4, X41, Y41, X42, Y42, Color4, Len4,
Orientation4, Direction4),
equal (Color_out, ’red’),
equal (Clean,100),
lowerthan (Len1, Len2),
greaterthan (Len1, Len3),
greaterthan (Len1, Len4).
copy (Line1, Line_out, Color_out, Clean):-
member (Line1, Input_lines),
member (Line2, Input_lines),
member (Line3, Input_lines),
member (Line4, Input_lines),
line_attrs (Line1, X11, Y11, X12, Y12, Color1, Len1,
Orientation1, Direction1),
line_attrs (Line2, X21, Y21, X22, Y22, Color2, Len2,
Orientation2, Direction2),
line_attrs (Line3, X31, Y31, X32, Y32, Color3, Len3,
Orientation3, Direction3),
line_attrs (Line4, X41, Y41, X42, Y42, Color4, Len4,
Orientation4, Direction4),
equal (Color_out, ’green’),
equal (Clean,100),
lowerthan (Len1, Len2),
lowerthan (Len1, Len3),
greaterthan (Len1, Len4).
copy (Line1, Line_out, Color_out, Clean):-
member (Line1, Input_lines),
member (Line2, Input_lines),
member (Line3, Input_lines),
member (Line4, Input_lines),
line_attrs (Line1, X11, Y11, X12, Y12, Color1, Len1,
Orientation1, Direction1),
line_attrs (Line2, X21, Y21, X22, Y22, Color2, Len2,
Orientation2, Direction2),
line_attrs (Line3, X31, Y31, X32, Y32, Color3, Len3,
Orientation3, Direction3),
line_attrs (Line4, X41, Y41, X42, Y42, Color4, Len4,
Orientation4, Direction4),
equal (Color_out, ’yellow’),
equal (Clean,100),
lowerthan (Len1, Len2),
lowerthan (Len1, Len3),
lowerthan (Len1, Len4).
<details>
<summary>extracted/2405.06399v1/a48eeaf7.png Details</summary>

### Visual Description
## Diagram: Task a48eeaf7 (Input/Output Transformation)
### Overview
The image depicts a two-panel comparison labeled "Test Input" (left) and "Test Output" (right). Both panels feature a black background with geometric shapes: a red square and multiple gray squares. The arrangement of shapes differs between panels, suggesting a transformation or processing step.
### Components/Axes
- **Title**: "Task a48eeaf7" (centered at the top).
- **Panels**:
- **Test Input**: Left panel with a red square and four gray squares.
- **Test Output**: Right panel with a red square and four gray squares.
- **No axes, legends, or numerical scales are present.**
### Detailed Analysis
#### Test Input (Left Panel):
- **Red Square**: Positioned at the bottom-left quadrant.
- **Gray Squares**:
1. Top-left quadrant.
2. Top-right quadrant.
3. Middle-right quadrant.
4. Bottom-left quadrant (overlapping with the red square).
#### Test Output (Right Panel):
- **Red Square**: Moved to the center-left quadrant.
- **Gray Squares**:
1. Top-left quadrant.
2. Top-right quadrant.
3. Middle-right quadrant.
4. Bottom-left quadrant (now separated from the red square).
#### Spatial Relationships:
- The red square shifts **rightward** by approximately 25% of the panel width.
- Gray squares in the output are repositioned to avoid overlapping with the red square.
- No new shapes are introduced; only positional adjustments occur.
### Key Observations
1. **Red Square Movement**: The red square’s horizontal displacement suggests a directional transformation rule.
2. **Gray Square Rearrangement**: Gray squares maintain their quadrant distribution but adjust spacing to avoid collision with the red square.
3. **No Color Changes**: All shapes retain their original colors (red/gray).
### Interpretation
The diagram likely illustrates a **spatial reasoning task** where an input configuration (Test Input) is processed to produce an output configuration (Test Output). The red square’s movement and the gray squares’ repositioning imply:
- **Collision Avoidance**: The system prioritizes separating the red square from gray squares in the output.
- **Positional Logic**: The red square’s central placement in the output may indicate a "focus" or "anchor" point for subsequent operations.
- **Minimalist Design**: The absence of labels or legends suggests the task relies on visual pattern recognition rather than explicit instructions.
This could model scenarios like object avoidance in robotics, layout optimization, or rule-based spatial transformations.
</details>
⬇
translate (Point1, Point2, X_dir, Y_dir):-
member (Point1, Input_points),
member (Rectangle1, Input_rectangles),
point_straight_path_to (Point1, Rectangle1, X_dir,
Y_dir, Orientation, Direction).
copy (Rectangle1, Rectangle2, Color_out, Clean_out):-
member (Rectangle1, Input_rectangles),
rectangle_attrs (Rectangle1, X1, Y1, X2, Y2, X3, Y3, X4,
Y4, Color, Clean, Area),
equal (Color_out, Color),
equal (Clean_out,100).
<details>
<summary>extracted/2405.06399v1/7e0986d6.png Details</summary>

### Visual Description
## Diagram: Task 7e0986d6 - Input/Output Configuration Comparison
### Overview
The image presents a side-by-side comparison of two configurations labeled "Test Input" (left) and "Test Output" (right). Both sections use a grid-based layout with colored geometric shapes (gray rectangles and yellow squares) against a black background. No numerical data or axes are present.
### Components/Axes
- **Title**: "Task 7e0986d6" (centered at the top).
- **Labels**:
- "Test Input" (above the left grid).
- "Test Output" (above the right grid).
- **Visual Elements**:
- **Test Input**:
- 3 large gray rectangles (positions: top-left, top-right, bottom-center).
- 8 small yellow squares distributed across the grid (e.g., clustered near gray rectangles).
- **Test Output**:
- 3 large gray rectangles (positions: top-left, top-right, bottom-center).
- No yellow squares present.
### Detailed Analysis
- **Test Input**:
- Gray rectangles are smaller and irregularly spaced.
- Yellow squares are scattered, with some overlapping gray rectangles and others isolated.
- **Test Output**:
- Gray rectangles are larger and more uniformly spaced.
- No yellow squares remain; all yellow elements from the input are absent.
### Key Observations
1. **Structural Transformation**: The output configuration simplifies the input by removing yellow squares and enlarging gray rectangles.
2. **Positional Consistency**: The placement of gray rectangles remains consistent between input and output (top-left, top-right, bottom-center).
3. **Color Coding**: Yellow squares in the input likely represent distinct entities (e.g., data points, nodes) that are consolidated or removed in the output.
### Interpretation
The diagram suggests a process of **data aggregation or simplification**. The removal of yellow squares in the output implies that secondary elements (possibly noise, outliers, or redundant data) were filtered out, while the gray rectangles (primary entities) were expanded to represent consolidated information. This could reflect a workflow step such as:
- **Data preprocessing**: Eliminating irrelevant features.
- **Hierarchical clustering**: Merging smaller clusters into larger groups.
- **Visualization optimization**: Reducing clutter for clearer representation.
The absence of a legend or explicit legend colors leaves the exact meaning of colors ambiguous, but the contrast between yellow (small, numerous) and gray (large, consolidated) strongly implies a hierarchical relationship.
</details>
⬇
copy (Rectangle1, Rectangle2, Color_out, Clean):-
member (Rectangle1, Input_rectangles),
rectangle_attrs (Rectangle1, X1, Y1, X2, Y2, X3, Y3, X4,
Y4, Color, Clean, Area),
equal (Color_out, Color),
equal (Clean,100).
<details>
<summary>extracted/2405.06399v1/0a938d79.png Details</summary>

### Visual Description
## Diagram: Task 0a938d79 Processing Flow
### Overview
The image depicts a two-part diagram labeled "Test Input" (left) and "Test Output" (right), connected by an implied transformation process. The input contains two colored elements, while the output consists of five vertical bars with alternating colors.
### Components/Axes
- **Title**: "Task 0a938d79" (centered at the top)
- **Left Section**:
- Label: "Test Input" (above the input area)
- Elements:
- Green square (top-left position)
- Yellow square (bottom-center position)
- **Right Section**:
- Label: "Test Output" (above the output area)
- Elements:
- Five vertical bars alternating between green and yellow (left-to-right order: green, yellow, green, yellow, green)
### Detailed Analysis
- **Input Elements**:
- Two discrete colored blocks (green and yellow) with no explicit labels or numerical values.
- Spatial positioning: Green block is isolated at the top-left; yellow block is centered at the bottom.
- **Output Elements**:
- Five vertical bars with consistent width and height.
- Color pattern: Alternating green/yellow, starting and ending with green.
- No numerical labels, axis markers, or legends present.
### Key Observations
1. **Color Consistency**: The same two colors (green and yellow) are used in both input and output, suggesting a direct relationship between input elements and output states.
2. **Output Pattern**: The alternating color sequence in the output implies a cyclical or state-dependent transformation.
3. **Input-Output Ratio**: Two input elements produce five output elements, indicating a non-1:1 mapping.
### Interpretation
The diagram likely represents a state transition or process flow where:
- The **green input** triggers an initial state (first green bar).
- The **yellow input** introduces a secondary state (first yellow bar).
- The alternating output pattern suggests a feedback loop or iterative process, with the final green bar possibly indicating a return to the initial state.
The absence of numerical data or explicit labels limits quantitative analysis, but the spatial and color-based relationships imply a deterministic transformation rule. The task ID "0a938d79" may reference a specific algorithm or test case in a larger system.
</details>
⬇
line_from_point (Point, Line, Len, Orientation, Direction):-
member (Point, Input_points),
equal (Len, X_dim),
equal (Orientation, ’vertical’).
translate (Line1, Line2, X_dir, Y_dir):-
member (Line1, Input_lines),
equal (X_dir,0),
translate (Input_point1, Input_point2, X_dir, Y_dir),
equal (Y_dir,2* Y_dir).
translate (Line1, Line2, X_dir, Y_dir):-
member (Line1, Input_lines),
equal (X_dir,0),
translate (Input_point1, Input_point2, X_dir, Y_dir),
equal (Y_dir,2* Y_dir).
translate (Line1, Line2, X_dir, Y_dir):-
member (Line1, Input_lines),
equal (X_dir,0),
translate (Input_point1, Input_point2, X_dir, Y_dir),
equal (Y_dir,2* Y_dir).
translate (Line1, Line2, X_dir, Y_dir):-
member (Line1, Input_lines),
equal (X_dir,0),
translate (Input_point1, Input_point2, X_dir, Y_dir),
equal (Y_dir,2* Y_dir).
<details>
<summary>extracted/2405.06399v1/150deff5.png Details</summary>

### Visual Description
## Diagram: Task 150deff5 Visual Transformation
### Overview
The image depicts a side-by-side comparison of two visual representations labeled "Test Input" (left) and "Test Output" (right). Both sections feature abstract geometric shapes on a black background, with the output introducing color coding (red and blue) absent in the input.
### Components/Axes
- **Left Section (Test Input)**:
- Background: Solid black
- Shapes: Irregular gray blocks/rectangles with jagged edges
- Positioning: Clustered toward the top-left quadrant
- Notable: No labels or annotations within the shapes
- **Right Section (Test Output)**:
- Background: Solid black
- Shapes: Mirrored arrangement of the input shapes, now colored
- Colors:
- Red: Horizontal/elongated shapes (top-left and middle-right)
- Blue: Vertical/rectangular shapes (center and bottom-right)
- Positioning: Symmetrical to the input but with inverted spatial relationships
### Detailed Analysis
- **Shape Transformation**:
- Input shapes (gray) are converted to colored shapes in the output
- Spatial relationships inverted: Top-left input shape becomes bottom-right output shape
- Color coding suggests categorical differentiation (red vs. blue)
- **Color Distribution**:
- Red occupies 40% of output shapes (horizontal/elongated forms)
- Blue occupies 60% of output shapes (vertical/rectangular forms)
- No overlap between red and blue shapes
### Key Observations
1. **Mirrored Layout**: Output shapes maintain positional symmetry relative to input but with inverted vertical/horizontal orientation
2. **Color Encoding**: Red and blue shapes show distinct geometric characteristics (horizontal vs. vertical)
3. **Shape Complexity**: Input shapes have 7 distinct blocks; output simplifies to 6 colored shapes
4. **Edge Treatment**: Jagged edges in input become smooth boundaries in output
### Interpretation
This appears to represent a pattern recognition or classification task where:
- **Input**: Raw geometric patterns (potentially representing data features)
- **Output**: Categorized/segmented patterns with color-coded classifications
- The transformation suggests:
1. Feature extraction from raw patterns
2. Dimensionality reduction (7→6 shapes)
3. Semantic segmentation via color coding
4. Spatial relationship inversion as part of the processing pipeline
The task likely demonstrates a machine learning model's ability to:
- Convert unstructured visual data into structured categories
- Maintain positional relationships while transforming data representations
- Apply color-based classification to abstract patterns
No numerical data or explicit labels beyond "Test Input/Output" are present, indicating this may be a visualization of an intermediate step in a computer vision pipeline.
</details>
⬇
copy (Rectangle1, Rectangle2, Color_out, Clear):-
member (Rectangle1, Input_rectangles),
rectangle_attrs (X1, Y1, X2, Y2, X3, Y3, X4, Y4, Color,
Rectangle1, Clear, Area),
equiv (Area,4),
equal (Color_out, ’blue’),
equal (Clear,100).
copy (Line1, Line2, Color_out, Clear):-
member (Line1, Input_lines),
line_attrs (Line1, X1, Y1, X2, Y2, Color, Len,
Orientation, Direction),
equiv (Len,3),
equal (Color_out, ’red’),
equal (Clear,100).