| … | … | @@ -18,8 +18,8 @@ building more complex plans out of simpler plans using temporal |
| 18 | 18 | deduction. The optimal strategy is achieved with the following 2 |
| 19 | 19 | plans: |
| 20 | 20 | |
| 21 | 1. `PelletPosition(None)∧AgentPosition(LeftSquare)∧GoRight≺Eat↝Reward` | |
| 22 | 2. `PelletPosition(None)∧AgentPosition(RightSquare)∧GoLeft≺Eat↝Reward` | |
| 21 | 1. `PelletPosition(None) ∧ AgentPosition(LeftSquare) ∧ do(GoRight) ⩘ do(Eat) ↝ Reward(1)` | |
| 22 | 2. `PelletPosition(None) ∧ AgentPosition(RightSquare) ∧ do(GoLeft) ⩘ do(Eat) ↝ Reward(1)` | |
| 23 | 23 | |
| 24 | 24 | represented in Atomese as |
| 25 | 25 |
| … | … | @@ -140,7 +140,7 @@ class OpencogAgent: |
| 140 | 140 | # C ∧ A₁ ↝ D |
| 141 | 141 | # D ∧ A₂ ↝ E |
| 142 | 142 | # ⊢ |
| 143 | # (C ∧ A₁) ≺ A₂ ↝ E | |
| 143 | # (C ∧ A₁) ⩘ A₂ ↝ E | |
| 144 | 144 | # |
| 145 | 145 | # Useful to string together cognitive schematics into larger |
| 146 | 146 | # ones. |
| … | … | @@ -656,7 +656,7 @@ class OpencogAgent: |
| 656 | 656 | C ∧ A₁ ↝ D |
| 657 | 657 | D ∧ A₂ ↝ E |
| 658 | 658 | ⊢ |
| 659 | (C ∧ A₁) ≺ A₂ ↝ E | |
| 659 | (C ∧ A₁) ⩘ A₂ ↝ E | |
| 660 | 660 | |
| 661 | 661 | """ |
| 662 | 662 |
| … | … | @@ -995,7 +995,8 @@ def type_to_human_readable_str(ty) -> str: |
| 995 | 995 | Or -> ∨ |
| 996 | 996 | Not -> ¬ |
| 997 | 997 | GreaterThan -> > |
| 998 | SequentialAnd -> ≺ | |
| 998 | SequentialAnd -> ⩘ | |
| 999 | SequentialOr -> ⩗ | |
| 999 | 1000 | PredictiveImplication[Scope] -> ↝ |
| 1000 | 1001 | Execution -> do |
| 1001 | 1002 | |
| … | … | @@ -1009,7 +1010,8 @@ def type_to_human_readable_str(ty) -> str: |
| 1009 | 1010 | types.OrLink: "∨", |
| 1010 | 1011 | types.GreaterThanLink: ">", |
| 1011 | 1012 | types.ExecutionLink: "do", |
| 1012 | get_type("BackSequentialAndLink"): "≺", | |
| 1013 | get_type("BackSequentialAndLink"): "⩘", | |
| 1014 | get_type("BackSequentialOrLink"): "⩗", | |
| 1013 | 1015 | get_type("BackPredictiveImplicationScope"): "↝", |
| 1014 | 1016 | get_type("BackPredictiveImplicationScopeLink"): "↝", |
| 1015 | 1017 | } |
| … | … | @@ -1069,21 +1071,21 @@ def to_human_readable_str(atom: Atom, parenthesis: bool = False) -> str: |
| 1069 | 1071 | |
| 1070 | 1072 | Precedence order is defined in the syntax_precede function, so that |
| 1071 | 1073 | |
| 1072 | C ∧ A₁ ≺ A₂ ↝ G | |
| 1074 | C ∧ A₁ ⩘ A₂ ↝ G | |
| 1073 | 1075 | |
| 1074 | 1076 | is equivalent to |
| 1075 | 1077 | |
| 1076 | ((C ∧ A₁) ≺ A₂) ↝ G | |
| 1078 | ((C ∧ A₁) ⩘ A₂) ↝ G | |
| 1077 | 1079 | |
| 1078 | Additionally ≺ is left-associative (due to being a | |
| 1080 | Additionally ⩘ is left-associative (due to being a | |
| 1079 | 1081 | BackSequentialAnd, we would probably want it to be |
| 1080 | 1082 | right-associative if it were a ForeSequentialAnd) so that |
| 1081 | 1083 | |
| 1082 | A₁ ≺ A₂ ≺ A₃ | |
| 1084 | A₁ ⩘ A₂ ⩘ A₃ | |
| 1083 | 1085 | |
| 1084 | 1086 | is equivalent to |
| 1085 | 1087 | |
| 1086 | (A₁ ≺ A₂) ≺ A₃ | |
| 1088 | (A₁ ⩘ A₂) ⩘ A₃ | |
| 1087 | 1089 | |
| 1088 | 1090 | TODO: support action with arguments. |
| 1089 | 1091 |
| … | … | @@ -62,7 +62,7 @@ def test_weight(): |
| 62 | 62 | mm.complexity_penalty = 0.5 |
| 63 | 63 | mm.compressiveness = 0.1 |
| 64 | 64 | |
| 65 | # 1. hold(self, key) ∧ do(go_to_house) ≺ do(go_to_diamonds) ↝ Reward(1) | |
| 65 | # 1. hold(self, key) ∧ do(go_to_house) ⩘ do(go_to_diamonds) ↝ Reward(1) | |
| 66 | 66 | cogscm_1 = BackPredictiveImplicationScopeLink( |
| 67 | 67 | VariableSet(), |
| 68 | 68 | SLink(ZLink()), |
| … | … | @@ -81,7 +81,7 @@ def test_weight(): |
| 81 | 81 | tv=createTruthValue(1.0, 0.00780669), |
| 82 | 82 | ) |
| 83 | 83 | |
| 84 | # 2. hold(self, key) ∧ do(go_to_house) ≺ do(go_to_house) ≺ do(go_to_diamonds) ↝ Reward(1) | |
| 84 | # 2. hold(self, key) ∧ do(go_to_house) ⩘ do(go_to_house) ⩘ do(go_to_diamonds) ↝ Reward(1) | |
| 85 | 85 | cogscm_2 = BackPredictiveImplicationScopeLink( |
| 86 | 86 | VariableSet(), |
| 87 | 87 | SLink(ZLink()), |
| … | … | @@ -316,7 +316,7 @@ def test_get_context(): |
| 316 | 316 | assert context_1[0] == expected_1 |
| 317 | 317 | |
| 318 | 318 | # 2. Dioaction plan: |
| 319 | # outside(self, house) ∧ do(go_to_key) ≺ do(go_to_house) ↝ inside(self, house) | |
| 319 | # outside(self, house) ∧ do(go_to_key) ⩘ do(go_to_house) ↝ inside(self, house) | |
| 320 | 320 | cogscm_2 = BackPredictiveImplicationScopeLink( |
| 321 | 321 | VariableSet(), |
| 322 | 322 | SLink(ZLink()), |
| … | … | @@ -345,7 +345,7 @@ def test_get_context(): |
| 345 | 345 | assert context_2[0] == expected_2 |
| 346 | 346 | |
| 347 | 347 | # 3. Triaction plan |
| 348 | # outside(self, house) ∧ do(go_to_key) ≺ do(go_to_house) ≺ do(go_to_diamonds) ↝ Reward(1) | |
| 348 | # outside(self, house) ∧ do(go_to_key) ⩘ do(go_to_house) ⩘ do(go_to_diamonds) ↝ Reward(1) | |
| 349 | 349 | cogscm_3 = BackPredictiveImplicationScopeLink( |
| 350 | 350 | VariableSet(), |
| 351 | 351 | SLink(ZLink()), |