ekms 9.8.0 → 9.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/common/actions.instance.json +12 -10
  2. package/common/actions.js +14 -12
  3. package/common/angle.instance.json +37 -17
  4. package/common/animals.instance.json +54 -28
  5. package/common/askfor.instance.json +89 -192
  6. package/common/askfor.js +49 -12
  7. package/common/asking.js +13 -5
  8. package/common/avatar.js +3 -3
  9. package/common/can.instance.json +32 -20
  10. package/common/can.js +2 -2
  11. package/common/colors.instance.json +44 -16
  12. package/common/colors.js +1 -1
  13. package/common/comparable.instance.json +25 -22
  14. package/common/compass.instance.json +9 -3
  15. package/common/compass.js +1 -1
  16. package/common/concept.instance.json +14 -6
  17. package/common/concept.js +2 -0
  18. package/common/conjunction.js +20 -12
  19. package/common/control.js +10 -18
  20. package/common/countable.js +4 -3
  21. package/common/crew.instance.json +95 -27
  22. package/common/dateTimeSelectors.instance.json +4 -4
  23. package/common/dateTimeSelectors.js +4 -7
  24. package/common/dates.instance.json +52 -28
  25. package/common/dates.js +16 -11
  26. package/common/debug.instance.json +52 -0
  27. package/common/debug.js +52 -0
  28. package/common/debug.test.json +1 -0
  29. package/common/dialogues.js +126 -70
  30. package/common/dimension.instance.json +259 -492
  31. package/common/dimension.js +72 -12
  32. package/common/drone.instance.json +441 -84
  33. package/common/drone.js +57 -56
  34. package/common/drone_v1.instance.json +36 -12
  35. package/common/drone_v1.js +20 -15
  36. package/common/edible.instance.json +96 -32
  37. package/common/emotions.instance.json +15 -1
  38. package/common/evaluate.js +10 -13
  39. package/common/fastfood.instance.json +282 -100
  40. package/common/fastfood.js +30 -15
  41. package/common/formulas.instance.json +162 -24
  42. package/common/formulas.js +18 -9
  43. package/common/gdefaults.js +20 -96
  44. package/common/helpers/concept.js +2 -9
  45. package/common/helpers/conjunction.js +11 -1
  46. package/common/helpers/dialogues.js +48 -24
  47. package/common/helpers/gdefaults.js +15 -5
  48. package/common/helpers/properties.js +132 -326
  49. package/common/helpers.js +28 -58
  50. package/common/hierarchy.js +71 -41
  51. package/common/kirk.instance.json +3 -1
  52. package/common/latin.instance.json +14 -14
  53. package/common/latin.js +7 -7
  54. package/common/length.instance.json +331 -61
  55. package/common/linear_orderings.instance.json +1 -0
  56. package/common/linear_orderings.js +90 -0
  57. package/common/linear_orderings.test.json +1 -0
  58. package/common/math.instance.json +144 -5
  59. package/common/math.js +18 -7
  60. package/common/menus.instance.json +29 -11
  61. package/common/menus.js +8 -5
  62. package/common/meta.js +14 -13
  63. package/common/nameable.js +9 -5
  64. package/common/numbers.instance.json +8 -3
  65. package/common/numbers.js +59 -35
  66. package/common/ordering.instance.json +53 -4
  67. package/common/ordinals.js +25 -25
  68. package/common/people.instance.json +66 -12
  69. package/common/percentages.js +4 -2
  70. package/common/pipboy.instance.json +89 -44
  71. package/common/pipboy.js +21 -14
  72. package/common/pokemon.instance.json +39 -13
  73. package/common/pressure.instance.json +20 -6
  74. package/common/properties.instance.json +2648 -501
  75. package/common/properties.js +561 -82
  76. package/common/punctuation.js +1 -0
  77. package/common/rates.instance.json +2 -2
  78. package/common/rates.js +3 -3
  79. package/common/reminders.instance.json +16 -0
  80. package/common/reminders.js +24 -20
  81. package/common/reports.instance.json +11 -12
  82. package/common/reports.js +12 -12
  83. package/common/scorekeeper.js +20 -10
  84. package/common/sdefaults.js +30 -9
  85. package/common/spock.instance.json +3 -1
  86. package/common/stm.js +16 -21
  87. package/common/temperature.instance.json +40 -11
  88. package/common/testing.js +2 -2
  89. package/common/time.instance.json +149 -47
  90. package/common/time.js +9 -8
  91. package/common/ui.instance.json +4 -2
  92. package/common/ui.js +5 -5
  93. package/common/weight.instance.json +113 -21
  94. package/common/weight.js +5 -1
  95. package/common/words.js +113 -2
  96. package/common/wp.instance.json +125 -18
  97. package/common/wp.js +6 -2
  98. package/main.js +2 -0
  99. package/package.json +10 -3
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,90 @@
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
+ const { defaultContextCheckProperties } = require('./helpers')
3
+ const tests = require('./linear_orderings.test.json')
4
+ const instance = require('./linear_orderings.instance.json')
5
+ const pos = require('./pos')
6
+ const gdefaults = require('./gdefaults')
7
+ const sdefaults = require('./sdefaults')
8
+
9
+ const config = {
10
+ name: 'linear_orderings',
11
+ operators: [
12
+ "([linearlyOrdered])",
13
+ "(value [linearOrderedRange|to] value)",
14
+ // "([fromLO|from] (linearlyOrdered/*) (to/*) (linearlyOrdered/*))",
15
+ // "at least (linearlyOrdered/*)",
16
+ // "at most (linearlyOrdered/*)",
17
+ ],
18
+ bridges: [
19
+ {
20
+ id: "linearlyOrdered",
21
+ initial: { rangeableWith: ['linearlyOrdered'] },
22
+ },
23
+ {
24
+ id: "linearOrderedRange",
25
+ // isA: ['number'],
26
+ before: ['preposition'],
27
+ selector: {
28
+ match: "applicable",
29
+ left: [ { pattern: '(@<= linearlyOrdered && @<=contexts[1].rangeableWith)' } ],
30
+ right: [ { pattern: '(@<= linearlyOrdered && @<=contexts[-1].rangeableWith)' } ],
31
+ passthrough: true
32
+ },
33
+ enhanced_associations: false,
34
+ bridge: `{
35
+ ...next(operator),
36
+ localHierarchy: [before[0].marker.id],
37
+ operator: operator,
38
+ ...project(before[0], default(before[0].floaters, [])),
39
+ instance: or(before[0].instance, after[0].instance),
40
+ from: before[0],
41
+ to: after[0],
42
+ interpolate: [{ property: 'from' }, { property: 'operator' }, { property: 'to' }]
43
+ }`,
44
+ check: defaultContextCheckProperties(['to', 'from', 'types'])
45
+ },
46
+ ],
47
+ semantics: [
48
+ {
49
+ where: where(),
50
+ match: ({context, debug}) => context.marker == 'unify' && context.terms[0].marker == 'linearOrderedRange',
51
+ apply: async ({context, resolveEvaluate, compare, callId}) => {
52
+ const { from, to } = context.terms[0]
53
+ const value = context.terms[1]
54
+ const f = await compare(from, value)
55
+ const t = await compare(value, to)
56
+ if (f && t && f !== '>' && t !== '>') {
57
+ resolveEvaluate(context, value)
58
+ } else {
59
+ resolveEvaluate(context, false)
60
+ }
61
+ }
62
+ },
63
+ ],
64
+ };
65
+
66
+ function initializer({objects, config, isModule}) {
67
+ config.addArgs(
68
+ ({e, toEValue}) => ({
69
+ compare: async (left, right) => {
70
+ const v = await e({ marker: 'linearlyOrderedCompare', left, right })
71
+ if (v.evalue?.marker !== 'undefined') {
72
+ return v.evalue
73
+ }
74
+ }
75
+ })
76
+ )
77
+ }
78
+
79
+ knowledgeModule( {
80
+ config,
81
+ includes: [pos, gdefaults, sdefaults],
82
+ initializer,
83
+ instance,
84
+ module,
85
+ description: 'talking about linear orderings',
86
+ test: {
87
+ name: './linear_orderings.test.json',
88
+ contents: tests,
89
+ },
90
+ })
@@ -0,0 +1 @@
1
+ []
@@ -87,7 +87,23 @@
87
87
  "isA": [
88
88
  "mathematicalExpression"
89
89
  ],
90
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
90
+ "check": [
91
+ "marker",
92
+ "text",
93
+ "verbatim",
94
+ "value",
95
+ "evalue",
96
+ "isResponse",
97
+ {
98
+ "properties": "modifiers"
99
+ },
100
+ {
101
+ "properties": "postModifiers"
102
+ },
103
+ "x",
104
+ "y"
105
+ ],
106
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
91
107
  },
92
108
  {
93
109
  "where": "/home/dev/code/theprogrammablemind/kms/common/math.js:33",
@@ -118,7 +134,23 @@
118
134
  "isA": [
119
135
  "mathematicalExpression"
120
136
  ],
121
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
137
+ "check": [
138
+ "marker",
139
+ "text",
140
+ "verbatim",
141
+ "value",
142
+ "evalue",
143
+ "isResponse",
144
+ {
145
+ "properties": "modifiers"
146
+ },
147
+ {
148
+ "properties": "postModifiers"
149
+ },
150
+ "x",
151
+ "y"
152
+ ],
153
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
122
154
  },
123
155
  {
124
156
  "where": "/home/dev/code/theprogrammablemind/kms/common/math.js:33",
@@ -158,7 +190,23 @@
158
190
  "isA": [
159
191
  "mathematicalExpression"
160
192
  ],
161
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
193
+ "check": [
194
+ "marker",
195
+ "text",
196
+ "verbatim",
197
+ "value",
198
+ "evalue",
199
+ "isResponse",
200
+ {
201
+ "properties": "modifiers"
202
+ },
203
+ {
204
+ "properties": "postModifiers"
205
+ },
206
+ "x",
207
+ "y"
208
+ ],
209
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
162
210
  },
163
211
  {
164
212
  "where": "/home/dev/code/theprogrammablemind/kms/common/math.js:33",
@@ -197,7 +245,29 @@
197
245
  "isA": [
198
246
  "mathematicalExpression"
199
247
  ],
200
- "evaluator": "async ({e, context}) => {\n const x = toValue(await e(context.x)) \n const y = toValue(await e(context.y))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
248
+ "check": [
249
+ "marker",
250
+ "text",
251
+ "verbatim",
252
+ "value",
253
+ "evalue",
254
+ "isResponse",
255
+ {
256
+ "properties": "modifiers"
257
+ },
258
+ {
259
+ "properties": "postModifiers"
260
+ },
261
+ "x",
262
+ "y"
263
+ ],
264
+ "semantic": "async ({e, context}) => {\n const x = toValue(await e(context.x, where())) \n const y = toValue(await e(context.y, where()))\n if (!x || !y) {\n // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }\n context.isResponse = false\n } else {\n context.evalue = { marker: 'number', value: apply(x, y) }\n // context.evalue = apply(x, y)\n context.evalue.isResponse = true\n context.evalue.paraphrase = false\n // context.paraphrase = false\n // context.isResponse = true\n }\n /*\n if (!context.value) {\n context.isResponse = false\n context.paraphrase = true\n }\n */\n }"
265
+ }
266
+ ],
267
+ "semantics": [
268
+ {
269
+ "match": "({context, isA, callId, isMany}) => {\n return context.marker == 'same' && isA(context.two, 'mathematicalExpression') && !isMany(context.one)\n }",
270
+ "apply": "({context}) => {\n // dont so the other one for is\n }"
201
271
  }
202
272
  ]
203
273
  }
@@ -303,7 +373,6 @@
303
373
  "level": 1,
304
374
  "context_index": 1,
305
375
  "topLevel": true,
306
- "context_id": 2,
307
376
  "touchedBy": [
308
377
  "math#call2"
309
378
  ]
@@ -449,6 +518,9 @@
449
518
  }
450
519
  ],
451
520
  "learned_contextual_priorities": [],
521
+ "explain_associations_details": [
522
+ null
523
+ ],
452
524
  "query": "mathematical modifies operator",
453
525
  "key": {
454
526
  "query": "mathematical modifies operator"
@@ -539,6 +611,22 @@
539
611
  "bridge": "{ ...next(operator) }",
540
612
  "isA": [
541
613
  "mathematicalExpression"
614
+ ],
615
+ "check": [
616
+ "marker",
617
+ "text",
618
+ "verbatim",
619
+ "value",
620
+ "evalue",
621
+ "isResponse",
622
+ {
623
+ "properties": "modifiers"
624
+ },
625
+ {
626
+ "properties": "postModifiers"
627
+ },
628
+ "x",
629
+ "y"
542
630
  ]
543
631
  },
544
632
  {
@@ -568,6 +656,22 @@
568
656
  "bridge": "{ ...next(operator) }",
569
657
  "isA": [
570
658
  "mathematicalExpression"
659
+ ],
660
+ "check": [
661
+ "marker",
662
+ "text",
663
+ "verbatim",
664
+ "value",
665
+ "evalue",
666
+ "isResponse",
667
+ {
668
+ "properties": "modifiers"
669
+ },
670
+ {
671
+ "properties": "postModifiers"
672
+ },
673
+ "x",
674
+ "y"
571
675
  ]
572
676
  },
573
677
  {
@@ -606,6 +710,22 @@
606
710
  "bridge": "{ ...next(operator) }",
607
711
  "isA": [
608
712
  "mathematicalExpression"
713
+ ],
714
+ "check": [
715
+ "marker",
716
+ "text",
717
+ "verbatim",
718
+ "value",
719
+ "evalue",
720
+ "isResponse",
721
+ {
722
+ "properties": "modifiers"
723
+ },
724
+ {
725
+ "properties": "postModifiers"
726
+ },
727
+ "x",
728
+ "y"
609
729
  ]
610
730
  },
611
731
  {
@@ -643,8 +763,27 @@
643
763
  "bridge": "{ ...next(operator) }",
644
764
  "isA": [
645
765
  "mathematicalExpression"
766
+ ],
767
+ "check": [
768
+ "marker",
769
+ "text",
770
+ "verbatim",
771
+ "value",
772
+ "evalue",
773
+ "isResponse",
774
+ {
775
+ "properties": "modifiers"
776
+ },
777
+ {
778
+ "properties": "postModifiers"
779
+ },
780
+ "x",
781
+ "y"
646
782
  ]
647
783
  }
784
+ ],
785
+ "semantics": [
786
+ {}
648
787
  ]
649
788
  }
650
789
  ],
package/common/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
2
+ const { defaultContextCheck, defaultContextCheckProperties } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const numbers = require('./numbers')
5
5
  const punctuation = require('./punctuation')
@@ -47,9 +47,10 @@ function mathematicalOperator(name, words, apply, before = []) {
47
47
  bridge: "{ ...next(operator) }",
48
48
  isA: ['mathematicalExpression'],
49
49
  // generatorp: async ({gp, context}) => `${await gp(context.x)} ${context.word} ${await gp(context.y)}`,
50
- evaluator: async ({e, context}) => {
51
- const x = toValue(await e(context.x))
52
- const y = toValue(await e(context.y))
50
+ check: defaultContextCheckProperties(['x', 'y']),
51
+ semantic: async ({e, context}) => {
52
+ const x = toValue(await e(context.x, where()))
53
+ const y = toValue(await e(context.y, where()))
53
54
  if (!x || !y) {
54
55
  // context.evalue = { ...context, paraphrase: true, x: { ...context.x, value: x }, y: { ...context.y, value: y } }
55
56
  context.isResponse = false
@@ -90,8 +91,6 @@ const config = {
90
91
  bridges: [
91
92
  {
92
93
  id: "mathematicalExpression",
93
- // isA: ['queryable', 'theAble'],
94
- //isA: ['concept', 'number'],
95
94
  isA: ['concept'],
96
95
  },
97
96
  {
@@ -107,6 +106,16 @@ const config = {
107
106
  ...mathematicalOperator('times', ['times', '*'], (x, y) => x * y, [['plusOperator', 0], ['minusOperator', 0]]),
108
107
  ...mathematicalOperator('divideBy', ['/'], (x, y) => x / y, [['plusOperator', 0], ['minusOperator', 0]]),
109
108
  ],
109
+ semantics: [
110
+ {
111
+ match: ({context, isA, callId, isMany}) => {
112
+ return context.marker == 'same' && isA(context.two, 'mathematicalExpression') && !isMany(context.one)
113
+ },
114
+ apply: ({context}) => {
115
+ // dont so the other one for is
116
+ }
117
+ },
118
+ ],
110
119
  };
111
120
 
112
121
  const template = {
@@ -129,7 +138,9 @@ knowledgeModule( {
129
138
  name: './math.test.json',
130
139
  contents: tests,
131
140
  checks: {
132
- context: [defaultContextCheck()],
141
+ context: [
142
+ defaultContextCheck()
143
+ ],
133
144
  }
134
145
  },
135
146
  })
@@ -14,6 +14,7 @@
14
14
  "bridges": [
15
15
  {
16
16
  "id": "close_menus",
17
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:130",
17
18
  "isA": [
18
19
  "verb"
19
20
  ],
@@ -25,11 +26,12 @@
25
26
  },
26
27
  {
27
28
  "id": "show_menus",
29
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:141",
28
30
  "isA": [
29
31
  "verb"
30
32
  ],
31
33
  "bridge": "{ ...next(operator), show: after[0], generate: ['this', 'show'] }",
32
- "semantic": "({context, api}) => {\n if (context.show.instance) {\n api.show(context.show.value)\n }\n }"
34
+ "semantic": "({context, api}) => {\n if (context.show.isInstance) {\n api.show(context.show.value)\n }\n }"
33
35
  },
34
36
  {
35
37
  "id": "typeOfMenu_menus",
@@ -43,7 +45,7 @@
43
45
  "semantics": [
44
46
  {
45
47
  "match": "({context, isA}) => isA(context, 'showable_menus')",
46
- "apply": "async ({context, insert, s, fragments}) => {\n const instantiation = await fragments(\"show showable\", { 'showable_menus': context })\n await s(instantiation)\n }"
48
+ "apply": "async ({context, insert, e, fragments}) => {\n const instantiation = await fragments(\"show showable\", { 'showable_menus': context })\n await e(instantiation, where())\n }"
47
49
  }
48
50
  ]
49
51
  },
@@ -114,7 +116,6 @@
114
116
  "level": 1,
115
117
  "context_index": 1,
116
118
  "topLevel": true,
117
- "context_id": 2,
118
119
  "touchedBy": [
119
120
  "menus#call2"
120
121
  ]
@@ -205,6 +206,9 @@
205
206
  }
206
207
  ],
207
208
  "learned_contextual_priorities": [],
209
+ "explain_associations_details": [
210
+ null
211
+ ],
208
212
  "query": "setidsuffix _menus",
209
213
  "key": {
210
214
  "query": "setidsuffix _menus"
@@ -345,7 +349,6 @@
345
349
  "level": 2,
346
350
  "context_index": 1,
347
351
  "topLevel": true,
348
- "context_id": 2,
349
352
  "touchedBy": [
350
353
  "menus#call2"
351
354
  ]
@@ -526,6 +529,9 @@
526
529
  }
527
530
  ],
528
531
  "learned_contextual_priorities": [],
532
+ "explain_associations_details": [
533
+ null
534
+ ],
529
535
  "query": "menu is a concept",
530
536
  "key": {
531
537
  "query": "menu is a concept"
@@ -666,7 +672,6 @@
666
672
  "level": 2,
667
673
  "context_index": 1,
668
674
  "topLevel": true,
669
- "context_id": 2,
670
675
  "touchedBy": [
671
676
  "menus#call2"
672
677
  ]
@@ -847,6 +852,9 @@
847
852
  }
848
853
  ],
849
854
  "learned_contextual_priorities": [],
855
+ "explain_associations_details": [
856
+ null
857
+ ],
850
858
  "query": "item is a concept",
851
859
  "key": {
852
860
  "query": "item is a concept"
@@ -952,7 +960,6 @@
952
960
  "level": 1,
953
961
  "context_index": 1,
954
962
  "topLevel": true,
955
- "context_id": 2,
956
963
  "touchedBy": [
957
964
  "menus#call2"
958
965
  ]
@@ -1098,6 +1105,9 @@
1098
1105
  }
1099
1106
  ],
1100
1107
  "learned_contextual_priorities": [],
1108
+ "explain_associations_details": [
1109
+ null
1110
+ ],
1101
1111
  "query": "menu modifies item",
1102
1112
  "key": {
1103
1113
  "query": "menu modifies item"
@@ -1346,7 +1356,6 @@
1346
1356
  "level": 2,
1347
1357
  "context_index": 1,
1348
1358
  "topLevel": true,
1349
- "context_id": 2,
1350
1359
  "touchedBy": [
1351
1360
  "menus#call2"
1352
1361
  ]
@@ -1677,6 +1686,9 @@
1677
1686
  }
1678
1687
  ],
1679
1688
  "learned_contextual_priorities": [],
1689
+ "explain_associations_details": [
1690
+ null
1691
+ ],
1680
1692
  "query": "menus and menu items are showable",
1681
1693
  "key": {
1682
1694
  "query": "menus and menu items are showable"
@@ -1692,6 +1704,7 @@
1692
1704
  "bridges": [
1693
1705
  {
1694
1706
  "id": "close_menus",
1707
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:130",
1695
1708
  "isA": [
1696
1709
  "verb"
1697
1710
  ],
@@ -1702,6 +1715,7 @@
1702
1715
  },
1703
1716
  {
1704
1717
  "id": "show_menus",
1718
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:141",
1705
1719
  "isA": [
1706
1720
  "verb"
1707
1721
  ],
@@ -1718,7 +1732,7 @@
1718
1732
  ],
1719
1733
  "semantics": [
1720
1734
  {
1721
- "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:156"
1735
+ "where": "/home/dev/code/theprogrammablemind/kms/common/menus.js:159"
1722
1736
  }
1723
1737
  ]
1724
1738
  },
@@ -1742,7 +1756,6 @@
1742
1756
  "level": 0,
1743
1757
  "context_index": 1,
1744
1758
  "topLevel": true,
1745
- "context_id": 2,
1746
1759
  "touchedBy": [
1747
1760
  "menus#call2"
1748
1761
  ]
@@ -1783,6 +1796,9 @@
1783
1796
  }
1784
1797
  ],
1785
1798
  "learned_contextual_priorities": [],
1799
+ "explain_associations_details": [
1800
+ null
1801
+ ],
1786
1802
  "query": "resetidsuffix",
1787
1803
  "key": {
1788
1804
  "query": "resetidsuffix"
@@ -1859,8 +1875,7 @@
1859
1875
  ],
1860
1876
  "level": 1,
1861
1877
  "context_index": 1,
1862
- "topLevel": true,
1863
- "context_id": 2
1878
+ "topLevel": true
1864
1879
  }
1865
1880
  ],
1866
1881
  "generated": [
@@ -1948,6 +1963,9 @@
1948
1963
  }
1949
1964
  ],
1950
1965
  "learned_contextual_priorities": [],
1966
+ "explain_associations_details": [
1967
+ null
1968
+ ],
1951
1969
  "query": "show showable",
1952
1970
  "skipSemantics": true,
1953
1971
  "key": {
package/common/menus.js CHANGED
@@ -77,7 +77,7 @@ class MenusAPI {
77
77
  id: `${languageId}`,
78
78
  associations: [languageId, 'menus'],
79
79
  isA: ['menu_menus'],
80
- words: [{ word: name, value: id, instance: true }],
80
+ words: [{ word: name, value: id, isInstance: true }],
81
81
  })
82
82
  this._objects.menuDefs.push({
83
83
  key: name,
@@ -96,7 +96,7 @@ class MenusAPI {
96
96
  id: `${languageId}`,
97
97
  associations: [menuId.languageId, 'menus'],
98
98
  isA: ['menu_menus_item_menus'],
99
- words: [{ word: name, value: id, path: [menuId.id, id], instance: true }],
99
+ words: [{ word: name, value: id, path: [menuId.id, id], isInstance: true }],
100
100
  })
101
101
  const menu = this._objects.menuDefs.find((md) => md.key == menuId.id)
102
102
  menu.children.push({
@@ -127,6 +127,7 @@ const template = {
127
127
  bridges: [
128
128
  {
129
129
  id: 'close_menus',
130
+ where: where(),
130
131
  isA: ['verb'],
131
132
  associations: ['menus'],
132
133
  bridge: "{ ...next(operator), closee: after[0], generate: ['this', 'closee'] }",
@@ -136,10 +137,12 @@ const template = {
136
137
  },
137
138
  {
138
139
  id: 'show_menus',
140
+ where: where(),
141
+ where: where(),
139
142
  isA: ['verb'],
140
143
  bridge: "{ ...next(operator), show: after[0], generate: ['this', 'show'] }",
141
144
  semantic: ({context, api}) => {
142
- if (context.show.instance) {
145
+ if (context.show.isInstance) {
143
146
  api.show(context.show.value)
144
147
  }
145
148
  }
@@ -155,9 +158,9 @@ const template = {
155
158
  {
156
159
  where: where(),
157
160
  match: ({context, isA}) => isA(context, 'showable_menus'),
158
- apply: async ({context, insert, s, fragments}) => {
161
+ apply: async ({context, insert, e, fragments}) => {
159
162
  const instantiation = await fragments("show showable", { 'showable_menus': context })
160
- await s(instantiation)
163
+ await e(instantiation, where())
161
164
  }
162
165
  },
163
166
  ]