(A) General Structure of a sample trial of the experimental task. In this task, participants are presented with two images, sequentially, such that only one image is present on the screen at each time. After the second image is presented, participants are asked to determine the numeric value corresponding to the pair of images and to provide their answer via a button box. Feedback is provided after the answer. Crucially, the numeric value depends on the task condition (see B and C). (B) Left: Value matrix in the hierarchical task (HIER). Here, the color of the first object determines the ‘context’ set of possible values ([1, 3] if red and [2, 4] if green). Then the shape category of the second ‘item’ (in relation to the first one) determines the final value of the pair. In this rule system ‘same’ shape does not mean exact visual similarity but rather membership to the same category set (see methods and Figure S3for details). Right: Value matrix in the iterative task (ITER). Each object category is associated with a specific value which does not depend on the context. The value of each pair is the sum of the objects’ individual values. (C) Regions of Interest (ROI) for hypothesis testing ([L]eft and [R]ight). IFG pars opercularis and fronto-medial cortex masks extracted from Harvard-Oxford probabilistic map (http://neuro.debian.net/pkgs/fsl-harvard-oxford-atlases.html) with 50% and 10% threshold, respectively; Hippocampus mask taken from (Tian et al., 2020) and pSTS mask from (Schaefer et al., 2018). These ROIs are based on regions known to yield activity during hierarchical processing either in human language or animal spatial navigation (see literature review in the text).