|
4 | 4 | (= (SubgoalPriority $EPrio $ConcTV) (* $EPrio (Truth_Expectation $ConcTV)))
|
5 | 5 |
|
6 | 6 | ;Expectation of an operation is the truth expectation of its desire value
|
7 |
| -(= (OpExpectation (Decision ($Opname $DVOp) $Subgoal) $t) (Truth_Expectation $DVOp)) |
| 7 | +(= (OpExpectation ('Decision ($Opname $DVOp) $Subgoal) $t) (Truth_Expectation $DVOp)) |
8 | 8 |
|
9 | 9 | ;Inject executed operation as an event and return its name
|
10 | 10 | (= (Execute $Opname) (superpose ((AddBeliefEvent ($Opname (1.0 0.9))) $Opname)))
|
11 | 11 |
|
12 | 12 | ;Add subgoals to the PQ
|
13 | 13 | (= (DeriveSubgoals $Options)
|
14 |
| - (do (let (Decision $Op (Event $S $Metadata)) (superpose $Options) |
15 |
| - (let $Subgoal (Event (trace! (! $S) $S) $Metadata) |
16 |
| - (add-atom &goal_events $Subgoal))))) |
| 14 | + (do (let ('Decision $Op ('Event $S $Metadata)) (superpose $Options) |
| 15 | + (let $Subgoal ('Event (trace! (! $S) $S) $Metadata) |
| 16 | + (add-atom '&goal_events $Subgoal))))) |
17 | 17 |
|
18 | 18 | ;execute the operation which most likely gets the goal achieved in current contexts, and if contexts are not yet fulfilled, derive them as subgoals
|
19 |
| -(= (BestDecision $t (Event ($Term $DV) ($GoalTime $GoalEvBase $GoalPrio)) $FIFO) |
20 |
| - (let $Options (collapse (let* (((Event ((($Prec &/ (^ $Op)) =/> $Term) $ImpTV) ($ImpTime $ImpEvBase $ImpPrio)) |
21 |
| - (EternalQuestion (($Prec &/ (^ $Op)) =/> $Term))) |
| 19 | +(= (BestDecision $t ('Event ($Term $DV) ($GoalTime $GoalEvBase $GoalPrio)) $FIFO) |
| 20 | + (let $Options (collapse (let* ((('Event ((($Prec '&/ ('^ $Op)) '=/> $Term) $ImpTV) ($ImpTime $ImpEvBase $ImpPrio)) |
| 21 | + (EternalQuestion (($Prec '&/ ('^ $Op)) '=/> $Term))) |
22 | 22 | ($DVPrecOp (Truth_Deduction $DV $ImpTV))
|
23 |
| - ((Event ($PrecTerm $PrecTV) $PrecMetadata) |
| 23 | + (('Event ($PrecTerm $PrecTV) $PrecMetadata) |
24 | 24 | (Projection (EventQuestion $Prec) $t))
|
25 | 25 | ($DVOp (Truth_Deduction $PrecTV $DVPrecOp))
|
26 | 26 | ($DVPrec (Truth_StructuralDeduction $DVPrecOp))
|
27 | 27 | ($SubgoalStamp (TupleConcat $GoalEvBase $ImpEvBase)))
|
28 | 28 | (If (StampDisjoint $SubgoalStamp)
|
29 |
| - (Decision ((^ $Op) $DVOp) (Event ($Prec (Truth_StructuralDeduction $DVPrecOp)) |
| 29 | + ('Decision (('^ $Op) $DVOp) ('Event ($Prec (Truth_StructuralDeduction $DVPrecOp)) |
30 | 30 | ($t $SubgoalStamp ($t (SubgoalPriority (EventPriorityNow $GoalPrio $t) $DVPrec))))))))
|
31 |
| - (let (Decision ($Opname $DVOp) $Subgoal) (BestCandidate $Options OpExpectation $t) |
| 31 | + (let ('Decision ($Opname $DVOp) $Subgoal) (BestCandidate $Options OpExpectation $t) |
32 | 32 | (If (> (Truth_Expectation $DVOp) 0.5)
|
33 | 33 | (Execute $Opname)
|
34 | 34 | (DeriveSubgoals $Options)))))
|
35 | 35 |
|
36 | 36 | ;select the highest priority goal event from the PQ and use it for decision making
|
37 |
| -(= (GoalCycle $t) (sequential ((let $Ev (SelectHighestPriorityEvent &goal_events $t) |
38 |
| - (sequential ((do (remove-atom &goal_events $Ev)) |
39 |
| - (BestDecision $t $Ev (get-state &FIFO))))) |
| 37 | +(= (GoalCycle $t) (sequential ((let $Ev (SelectHighestPriorityEvent '&goal_events $t) |
| 38 | + (sequential ((do (remove-atom '&goal_events $Ev)) |
| 39 | + (BestDecision $t $Ev (get-state '&FIFO))))) |
40 | 40 | (do (UpdateReasonerState))
|
41 |
| - (do (BoundEvents &goal_events 0.0 0.1 (GoalEventsMax) $t))))) |
| 41 | + (do (BoundEvents '&goal_events 0.0 0.1 (GoalEventsMax 'dummy) $t))))) |
42 | 42 |
|
43 | 43 | ;Input procedure
|
44 | 44 | (= (AddGoalEvent $Sentence)
|
45 |
| - (let* ((($t $evidentialBase) (GetReasonerState)) |
46 |
| - ($InputEvent (Event (trace! (! $Sentence) $Sentence) ($t $evidentialBase ($t 1.0))))) |
47 |
| - (sequential ((do (add-atom &goal_events $InputEvent)) |
| 45 | + (let* ((($t $evidentialBase) (GetReasonerState 'dummy)) |
| 46 | + ($InputEvent ('Event (trace! (! $Sentence) $Sentence) ($t $evidentialBase ($t 1.0))))) |
| 47 | + (sequential ((do (add-atom '&goal_events $InputEvent)) |
48 | 48 | (GoalCycle $t)))))
|
0 commit comments