summaryrefslogtreecommitdiff
path: root/modeling/prod_procedure.py
blob: 9b1cbafc28f6f2c580db0ff60959d9f1858f2fa3 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python3


def procedures(Model):
    prods = []

    proc_start = Model.productionstring(
        name="proc_start",
        string="""
        =g>
        isa         math_goal
        proc        =proc
        op          None
        nextop      None
        ?retrieval>
        state       free
        ==>
        +retrieval>
        isa         procedure
        proc        =proc

    """,
    )
    prods.append(proc_start)

    proc_start_task1 = Model.productionstring(
        name="proc_start_task1",
        string="""
        =g>
        isa         math_goal
        proc        =proc
        op          None
        nextop      None
        =retrieval>
        isa         procedure
        proc        =proc
        result1     None
        op1         =op
        arg1_1      =arg1
        arg1_2      =arg2
        ==>
        +g>
        isa         math_goal
        proc        =proc
        task        1
        op          =op
        arg1        =arg1
        arg2        =arg2
    """,
    )
    prods.append(proc_start_task1)

    proc_harvest_task1 = Model.productionstring(
        name="proc_harvest_task1",
        string="""
        =g>
        isa         math_goal
        proc        =proc
        task        1
        op          done
        nextop      None
        =imaginal>
        isa         math_op
        ?retrieval>
        state       free
        ==>
        +retrieval>
        isa         procedure
        proc        =proc
    """,
    )

    proc_harvest_task1_done = Model.productionstring(
        name="proc_harvest_task1_done",
        string="""
        =g>
        isa         math_goal
        proc        =proc
        task        1
        op          done
        nextop      None
        =imaginal>
        isa         math_op
        result      =result1
        =retrieval>
        isa         procedure
        proc        =proc
        op1         =op1
        arg1_1      =arg1_1
        arg1_2      =arg1_2
        op2         =op2
        arg2_1      =arg2_1
        arg2_2      =arg2_2
        result2     =result2
        ==>
        +g>
        isa         math_goal
        proc        =proc
        +imaginal>
        isa         procedure
        proc        =proc
        op1         =op1
        arg1_1      =arg1_1
        arg1_2      =arg1_2
        result1     =result1
        op2         =op2
        arg2_1      =arg2_1
        arg2_2      =arg2_2
        result2     =result2
    """,
    )