Forming the episodic memory as a cognitive map

In our formulation, initial state of the external world contains instances of on(Disk,Peg): on(1,1),on(2,1),on(3,1), etc. and the initial state of the goal module of the brain contains instances of goal(Disk,Peg): goal(1,3),goal(2,3),goal(3,3), etc.
When the system runs, it perceives the external world and this creates descriptions. Using the notation module name:module event description, we might have perc1: on(1,1),on(2,1),on(3,1); perc2: top(1,1), where perc1 and perc2 are perceptual modules. This may evoke context ss in the context module, which will transfer the plan ss to the plan module. The plan module generates move(1,2), which is sent to an action module.

The modular events are thus: perc1: on(1,1);perc2:top(1,1); context:context(ss);plan: plan(ss),move(1,2).

The event is: Ev1:(plan:on(1,1) -- move(1,2)), [perc1:on(1,1); perc2:top(1,1); context:context(ss); plan:plan(ss),move(1,2)],

So we have the first episode: Ep1: [evkey1: plan:on(1,1) -- move(1,2); evkey2: plan:on(2,1)-- move(2,3); evkey3: plan:on(3,1) -- move(3,2)]. The key of Ep1, (on(3,1) -- on(3,2)), is used as an index in retrieving this episode from episodic memory.

There is then a sequence of such episodes: Ep2: goal(2,3),move(1,1),move(2,2),move(1,2),move(4,3), evaluation - incorrect, need 5 -- 3, where the episode key is on(4,1) -- on(4,2), and Ep3: move(1,1),move(2,3), no, move(2,2), move(1,-), evaluation - won't work.

At the end of this sequence, the episodic memory in the hippocampal complex contains a cognitive map , formed from the episode hierarchy, which is made up of the following hierarchy using episode keys:
((on(3,1) -- on(4,2)), [on(3,1) -- on(3,2), on(4,1) -- on(4,2), on(1,1) -- on(2,2)]).