-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathagent.soar
51 lines (45 loc) · 979 Bytes
/
agent.soar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Initialization operator
sp {propose*initialize-eater
(state <s> ^superstate nil
-^name)
-->
(<s> ^operator <o> +)
(<o> ^name eater)
}
sp {apply*initialize-eater
(state <s> ^operator <op>)
(<op> ^name eater)
-->
(<s> ^name eater)
}
# cleans the output-link once commands complete
sp {apply*cleanup*output-link
(state <s> ^operator <op>
^superstate nil
^io.output-link <out>)
(<out> ^<cmd> <id>)
(<id> ^status)
-->
(<out> ^<cmd> <id> -)
}
# misc useful elaboration rules
sp {elaborate*state*name
(state <s> ^superstate.operator.name <name>)
-->
(<s> ^name <name>)
}
sp {elaborate*state*top-state
(state <s> ^superstate.top-state <ts>)
-->
(<s> ^top-state <ts>)
}
sp {elaborate*top-state*top-state
(state <s> ^superstate nil)
-->
(<s> ^top-state <s>)
}
sp {elaborate*state*io
(state <s> ^superstate.io <io>)
-->
(<s> ^io <io>)
}