Compositionality is a central component of the human faculty for generalization and flexibility.
However, the computations involved are poorly understood, especially in terms of their cognitive costs.
On one hand, compositionality requires searching combinatorially large hypothesis spaces, raising issues of tractability.
On the other hand, compositional representations afford efficient and compact compression.
To shed light on the cognitive resource required for compositionality, we used a within-subject time pressure manipulation to study how participants navigated a series of mazes, generated using recursive operations over spatial primitives.
We find evidence that behavior is guided by the use of primitives and abstract operations over them, where the degree of compositional structure increases performance and speeds up decisions.
And while time pressure led to more random errors, it did not impair the capacity for compositionality.
Rather, participants increased their reliance on reusing and recombining previous computations, suggesting a remarkable robustness of human compositional reasoning.