@rsconcept/rstool 0.10.3 → 1.0.0

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 (112) hide show
  1. package/README.md +41 -31
  2. package/dist/agent-workflow-D-PSIb-m.d.ts +70 -0
  3. package/dist/analysis-LLnPhmGa.d.ts +23 -0
  4. package/dist/{common-DxLg3eXX.d.ts → common-DHJalS-Q.d.ts} +6 -1
  5. package/dist/constituenta-DnGR6bnM.d.ts +54 -0
  6. package/dist/diagnostic-D9yl_mEL.d.ts +19 -0
  7. package/dist/evaluation-Cns8BFm4.d.ts +31 -0
  8. package/dist/index.d.ts +11 -11
  9. package/dist/index.js +1 -1
  10. package/dist/mappers/model-adapter.d.ts +3 -3
  11. package/dist/mappers/schema-adapter.d.ts +4 -4
  12. package/dist/mappers/types.d.ts +6 -2
  13. package/dist/mappers/types.js +2 -0
  14. package/dist/mappers/types.js.map +1 -1
  15. package/dist/{model-value-SFAVj0dw.d.ts → model-value-BbonPzMz.d.ts} +14 -3
  16. package/dist/models/agent-workflow.d.ts +2 -0
  17. package/dist/models/agent-workflow.js +1 -0
  18. package/dist/models/analysis.d.ts +1 -1
  19. package/dist/models/common.d.ts +1 -1
  20. package/dist/models/constituenta.d.ts +2 -2
  21. package/dist/models/diagnostic.d.ts +1 -1
  22. package/dist/models/evaluation.d.ts +2 -2
  23. package/dist/models/index.d.ts +11 -11
  24. package/dist/models/index.js +2 -2
  25. package/dist/models/model-value.d.ts +2 -2
  26. package/dist/models/rstool-agent.d.ts +1 -1
  27. package/dist/models/rstool-agent.js +1 -1
  28. package/dist/models/session.d.ts +1 -1
  29. package/dist/models/tool-contract.d.ts +2 -2
  30. package/dist/models/tool-contract.js +2 -1
  31. package/dist/models/tool-contract.js.map +1 -1
  32. package/dist/rstool-agent-_8bplZnb.d.ts +71 -0
  33. package/dist/rstool-agent-kijHA9ML.js +476 -0
  34. package/dist/rstool-agent-kijHA9ML.js.map +1 -0
  35. package/dist/session/session-store.d.ts +18 -5
  36. package/dist/session/session-store.js +1 -64
  37. package/dist/{session-BPgsE80c.d.ts → session-ChexW8i7.d.ts} +11 -8
  38. package/dist/session-store-C3jyOSqI.js +142 -0
  39. package/dist/session-store-C3jyOSqI.js.map +1 -0
  40. package/dist/tool-contract-5_Q44DGE.d.ts +164 -0
  41. package/dist/wrapper/client.d.ts +23 -0
  42. package/dist/wrapper/client.js +17 -0
  43. package/dist/wrapper/client.js.map +1 -1
  44. package/dist/wrapper/stdio-wrapper.js +62 -52
  45. package/dist/wrapper/stdio-wrapper.js.map +1 -1
  46. package/docs/CONSTITUENTA.md +2 -2
  47. package/docs/DIAGNOSTICS.md +6 -5
  48. package/docs/MODEL-TESTING.md +3 -3
  49. package/docs/PORTAL-API.md +24 -18
  50. package/examples/README.md +1 -1
  51. package/examples/agent-client.ts +11 -41
  52. package/examples/build-chocolate-nim-rsform.ts +23 -18
  53. package/examples/chocolate-nim/build-rsform.ts +23 -18
  54. package/examples/chocolate-nim/build-rsmodel.ts +10 -12
  55. package/examples/chocolate-nim/rsform-session.json +290 -290
  56. package/examples/chocolate-nim/rsmodel-session.json +291 -291
  57. package/examples/expression-bank/bank-constituents.ts +304 -53
  58. package/examples/expression-bank/build-rsform.ts +19 -16
  59. package/examples/expression-bank/rsform-session.json +1551 -1551
  60. package/examples/kinship/build-rsform.ts +23 -18
  61. package/examples/kinship/build-rsmodel.ts +13 -15
  62. package/examples/kinship/rsform-session.json +219 -219
  63. package/examples/kinship/rsmodel-session.json +221 -221
  64. package/examples/kinship/session.ts +19 -21
  65. package/examples/movd/build-rsform.ts +23 -18
  66. package/examples/movd/build-rsmodel.ts +18 -20
  67. package/examples/movd/rsform-session.json +262 -262
  68. package/examples/movd/rsmodel-session.json +264 -264
  69. package/examples/sample/build-rsform.ts +19 -50
  70. package/examples/sample/build-rsmodel.ts +25 -44
  71. package/examples/sample/rsform-session.json +36 -33
  72. package/examples/sample/rsmodel-session.json +36 -33
  73. package/examples/template-apply/build-rsform.ts +27 -24
  74. package/examples/template-apply/rsform-session.json +48 -48
  75. package/package.json +2 -2
  76. package/skills/rstool-helper/EXAMPLES.md +44 -116
  77. package/skills/rstool-helper/GUIDE.md +40 -25
  78. package/skills/rstool-helper/REFERENCE.md +40 -177
  79. package/src/index.ts +24 -17
  80. package/src/mappers/portal-adapter.ts +43 -0
  81. package/src/mappers/types.ts +4 -0
  82. package/src/models/agent-workflow.ts +78 -0
  83. package/src/models/analysis.ts +7 -0
  84. package/src/models/common.ts +7 -0
  85. package/src/models/constituenta.ts +24 -6
  86. package/src/models/diagnostic.ts +4 -0
  87. package/src/models/evaluation.ts +11 -0
  88. package/src/models/import-detect.ts +39 -0
  89. package/src/models/import-export.ts +24 -0
  90. package/src/models/index.ts +22 -14
  91. package/src/models/model-value.ts +12 -0
  92. package/src/models/portal-json.ts +44 -0
  93. package/src/models/rstool-agent.test.ts +300 -147
  94. package/src/models/rstool-agent.ts +350 -93
  95. package/src/models/session.ts +8 -5
  96. package/src/models/tool-contract.ts +81 -42
  97. package/src/session/batch-apply.test.ts +28 -0
  98. package/src/session/batch-apply.ts +47 -0
  99. package/src/session/persistence.ts +56 -0
  100. package/src/session/session-store.ts +67 -4
  101. package/src/wrapper/client.ts +23 -0
  102. package/src/wrapper/stdio-wrapper.ts +59 -49
  103. package/dist/analysis-JiwOYDKx.d.ts +0 -16
  104. package/dist/constituenta-Dnd6iToB.d.ts +0 -36
  105. package/dist/diagnostic-BMYvciz8.d.ts +0 -15
  106. package/dist/evaluation-CCVYH0wA.d.ts +0 -21
  107. package/dist/index-uhkmwruf.d.ts +0 -46
  108. package/dist/rstool-agent-BZi5jO1y.js +0 -158
  109. package/dist/rstool-agent-BZi5jO1y.js.map +0 -1
  110. package/dist/rstool-agent-pRaPnZay.d.ts +0 -35
  111. package/dist/session/session-store.js.map +0 -1
  112. package/dist/tool-contract-n1ghUOrK.d.ts +0 -32
@@ -1,4 +1,6 @@
1
- import { CstType, type AddOrUpdateConstituentaInput } from '../../src';
1
+ import { CstType, type AgentConstituentaPatch } from '../../src';
2
+
3
+ type DraftBatch = { draft: AgentConstituentaPatch };
2
4
 
3
5
  type BankRow = {
4
6
  id: number;
@@ -9,7 +11,7 @@ type BankRow = {
9
11
  convention?: string;
10
12
  };
11
13
 
12
- function row(input: BankRow): AddOrUpdateConstituentaInput {
14
+ function row(input: BankRow): DraftBatch {
13
15
  return {
14
16
  draft: {
15
17
  id: input.id,
@@ -29,7 +31,13 @@ function row(input: BankRow): AddOrUpdateConstituentaInput {
29
31
  const rows: BankRow[] = [
30
32
  // T1 — управляющие конструкции
31
33
  { id: 1, alias: 'T1', cstType: CstType.STATEMENT, term: 'Управляющие конструкции', definitionFormal: '1=1' },
32
- { id: 2, alias: 'F1', cstType: CstType.FUNCTION, term: 'схема ограниченного выделения', definitionFormal: '[α∈ℬ(R1)] D{ ξ∈α | ξ=ξ }' },
34
+ {
35
+ id: 2,
36
+ alias: 'F1',
37
+ cstType: CstType.FUNCTION,
38
+ term: 'схема ограниченного выделения',
39
+ definitionFormal: '[α∈ℬ(R1)] D{ ξ∈α | ξ=ξ }'
40
+ },
33
41
  {
34
42
  id: 3,
35
43
  alias: 'F2',
@@ -37,15 +45,51 @@ const rows: BankRow[] = [
37
45
  term: 'условный переход',
38
46
  definitionFormal: '[α∈ℬ(R1)] debool(I{ α | 1=1} ∪ I{ α\\α | 1≠1})'
39
47
  },
40
- { id: 4, alias: 'F3', cstType: CstType.FUNCTION, term: 'рекурсивное определение', definitionFormal: '[α∈ℬ(R1)] R{ ξ:=α | ξ≠∅ | ξ\\ξ }' },
48
+ {
49
+ id: 4,
50
+ alias: 'F3',
51
+ cstType: CstType.FUNCTION,
52
+ term: 'рекурсивное определение',
53
+ definitionFormal: '[α∈ℬ(R1)] R{ ξ:=α | ξ≠∅ | ξ\\ξ }'
54
+ },
41
55
 
42
56
  // T2 — бинарные отношения двух множеств
43
57
  { id: 5, alias: 'T2', cstType: CstType.STATEMENT, term: 'Бинарные отношения двух множеств', definitionFormal: '1=1' },
44
- { id: 6, alias: 'F4', cstType: CstType.FUNCTION, term: 'обратное отношение', definitionFormal: '[σ∈ℬ(R1×R2)] Pr2,1(σ)' },
45
- { id: 7, alias: 'P1', cstType: CstType.PREDICATE, term: 'свойство всюдуопределенности', definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R2)] Pr1(σ) = α' },
46
- { id: 8, alias: 'P2', cstType: CstType.PREDICATE, term: 'свойство всюдузначности', definitionFormal: '[α∈ℬ(R2), σ∈ℬ(R1×R2)] Pr2(σ) = α' },
47
- { id: 9, alias: 'P3', cstType: CstType.PREDICATE, term: 'свойство прямой однозначности', definitionFormal: '[σ∈ℬ(R1×R2)] card(Pr1(σ)) = card(σ)' },
48
- { id: 10, alias: 'P4', cstType: CstType.PREDICATE, term: 'свойство обратной однозначности', definitionFormal: '[σ∈ℬ(R1×R2)] card(Pr2(σ)) = card(σ)' },
58
+ {
59
+ id: 6,
60
+ alias: 'F4',
61
+ cstType: CstType.FUNCTION,
62
+ term: 'обратное отношение',
63
+ definitionFormal: '[σ∈ℬ(R1×R2)] Pr2,1(σ)'
64
+ },
65
+ {
66
+ id: 7,
67
+ alias: 'P1',
68
+ cstType: CstType.PREDICATE,
69
+ term: 'свойство всюдуопределенности',
70
+ definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R2)] Pr1(σ) = α'
71
+ },
72
+ {
73
+ id: 8,
74
+ alias: 'P2',
75
+ cstType: CstType.PREDICATE,
76
+ term: 'свойство всюдузначности',
77
+ definitionFormal: '[α∈ℬ(R2), σ∈ℬ(R1×R2)] Pr2(σ) = α'
78
+ },
79
+ {
80
+ id: 9,
81
+ alias: 'P3',
82
+ cstType: CstType.PREDICATE,
83
+ term: 'свойство прямой однозначности',
84
+ definitionFormal: '[σ∈ℬ(R1×R2)] card(Pr1(σ)) = card(σ)'
85
+ },
86
+ {
87
+ id: 10,
88
+ alias: 'P4',
89
+ cstType: CstType.PREDICATE,
90
+ term: 'свойство обратной однозначности',
91
+ definitionFormal: '[σ∈ℬ(R1×R2)] card(Pr2(σ)) = card(σ)'
92
+ },
49
93
  {
50
94
  id: 11,
51
95
  alias: 'P5',
@@ -53,12 +97,48 @@ const rows: BankRow[] = [
53
97
  term: 'функция',
54
98
  definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R2)] card(Pr1(σ)) = card(σ) & Pr1(σ) = α'
55
99
  },
56
- { id: 12, alias: 'F5', cstType: CstType.FUNCTION, term: 'образ элемента', definitionFormal: '[α∈R1, σ∈ℬ(R1×R2)] debool(Pr2(Fi1[{α}](σ)))' },
57
- { id: 13, alias: 'F6', cstType: CstType.FUNCTION, term: 'сечение по элементу', definitionFormal: '[α∈R1, σ∈ℬ(R1×R2)] Pr2(Fi1[{α}](σ))' },
58
- { id: 14, alias: 'F7', cstType: CstType.FUNCTION, term: 'прообраз значения', definitionFormal: '[α∈R2, σ∈ℬ(R1×R2)] debool(Pr1(Fi2[{α}](σ)))' },
59
- { id: 15, alias: 'F8', cstType: CstType.FUNCTION, term: 'сечение по значению', definitionFormal: '[α∈R2, σ∈ℬ(R1×R2)] Pr1(Fi2[{α}](σ))' },
60
- { id: 16, alias: 'F9', cstType: CstType.FUNCTION, term: 'образ множества', definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R2)] Pr2(Fi1[α](σ))' },
61
- { id: 17, alias: 'F10', cstType: CstType.FUNCTION, term: 'прообраз множества', definitionFormal: '[α∈ℬ(R2), σ∈ℬ(R1×R2)] Pr1(Fi2[α](σ))' },
100
+ {
101
+ id: 12,
102
+ alias: 'F5',
103
+ cstType: CstType.FUNCTION,
104
+ term: 'образ элемента',
105
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R2)] debool(Pr2(Fi1[{α}](σ)))'
106
+ },
107
+ {
108
+ id: 13,
109
+ alias: 'F6',
110
+ cstType: CstType.FUNCTION,
111
+ term: 'сечение по элементу',
112
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R2)] Pr2(Fi1[{α}](σ))'
113
+ },
114
+ {
115
+ id: 14,
116
+ alias: 'F7',
117
+ cstType: CstType.FUNCTION,
118
+ term: 'прообраз значения',
119
+ definitionFormal: '[α∈R2, σ∈ℬ(R1×R2)] debool(Pr1(Fi2[{α}](σ)))'
120
+ },
121
+ {
122
+ id: 15,
123
+ alias: 'F8',
124
+ cstType: CstType.FUNCTION,
125
+ term: 'сечение по значению',
126
+ definitionFormal: '[α∈R2, σ∈ℬ(R1×R2)] Pr1(Fi2[{α}](σ))'
127
+ },
128
+ {
129
+ id: 16,
130
+ alias: 'F9',
131
+ cstType: CstType.FUNCTION,
132
+ term: 'образ множества',
133
+ definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R2)] Pr2(Fi1[α](σ))'
134
+ },
135
+ {
136
+ id: 17,
137
+ alias: 'F10',
138
+ cstType: CstType.FUNCTION,
139
+ term: 'прообраз множества',
140
+ definitionFormal: '[α∈ℬ(R2), σ∈ℬ(R1×R2)] Pr1(Fi2[α](σ))'
141
+ },
62
142
  {
63
143
  id: 18,
64
144
  alias: 'F11',
@@ -69,7 +149,13 @@ const rows: BankRow[] = [
69
149
 
70
150
  // T3 — бинарные отношения на множестве
71
151
  { id: 19, alias: 'T3', cstType: CstType.STATEMENT, term: 'Бинарные отношения на множестве', definitionFormal: '1=1' },
72
- { id: 20, alias: 'F12', cstType: CstType.FUNCTION, term: 'участники отношения', definitionFormal: '[σ∈ℬ(R1×R1)] Pr1(σ)∪Pr2(σ)' },
152
+ {
153
+ id: 20,
154
+ alias: 'F12',
155
+ cstType: CstType.FUNCTION,
156
+ term: 'участники отношения',
157
+ definitionFormal: '[σ∈ℬ(R1×R1)] Pr1(σ)∪Pr2(σ)'
158
+ },
73
159
  {
74
160
  id: 21,
75
161
  alias: 'P6',
@@ -77,7 +163,13 @@ const rows: BankRow[] = [
77
163
  term: 'свойство полноты (линейности)',
78
164
  definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R1)] σ∪Pr2,1(σ)∪Pr1,1(σ)∪Pr2,2(σ) = α×α'
79
165
  },
80
- { id: 22, alias: 'P7', cstType: CstType.PREDICATE, term: 'свойство симметричности', definitionFormal: '[σ∈ℬ(R1×R1)] Pr2,1(σ) = σ' },
166
+ {
167
+ id: 22,
168
+ alias: 'P7',
169
+ cstType: CstType.PREDICATE,
170
+ term: 'свойство симметричности',
171
+ definitionFormal: '[σ∈ℬ(R1×R1)] Pr2,1(σ) = σ'
172
+ },
81
173
  {
82
174
  id: 23,
83
175
  alias: 'P8',
@@ -85,8 +177,20 @@ const rows: BankRow[] = [
85
177
  term: 'свойство антисимметричности',
86
178
  definitionFormal: '[σ∈ℬ(R1×R1)] (Pr2,1(σ)∩σ)\\Pr1,1(σ)=∅'
87
179
  },
88
- { id: 24, alias: 'P9', cstType: CstType.PREDICATE, term: 'свойство рефлексивности', definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ) ⊆ σ' },
89
- { id: 25, alias: 'P10', cstType: CstType.PREDICATE, term: 'свойство антирефлексивности', definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ)∩σ=∅' },
180
+ {
181
+ id: 24,
182
+ alias: 'P9',
183
+ cstType: CstType.PREDICATE,
184
+ term: 'свойство рефлексивности',
185
+ definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ) ⊆ σ'
186
+ },
187
+ {
188
+ id: 25,
189
+ alias: 'P10',
190
+ cstType: CstType.PREDICATE,
191
+ term: 'свойство антирефлексивности',
192
+ definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ)∩σ=∅'
193
+ },
90
194
  {
91
195
  id: 26,
92
196
  alias: 'P11',
@@ -132,8 +236,20 @@ const rows: BankRow[] = [
132
236
  term: 'эквивалентность',
133
237
  definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ) ⊆ σ & Pr2,1(σ) = σ & ∀(α1,α2),(β1,β2)∈σ (α2=β1 ⇒ (α1,β2)∈σ)'
134
238
  },
135
- { id: 32, alias: 'P18', cstType: CstType.PREDICATE, term: 'толерантность', definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ) ⊆ σ & Pr2,1(σ) = σ' },
136
- { id: 33, alias: 'F15', cstType: CstType.FUNCTION, term: 'класс эквивалентности элемента', definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] Pr2(Fi1[{α}](σ))' },
239
+ {
240
+ id: 32,
241
+ alias: 'P18',
242
+ cstType: CstType.PREDICATE,
243
+ term: 'толерантность',
244
+ definitionFormal: '[σ∈ℬ(R1×R1)] Pr1,1(σ) ⊆ σ & Pr2,1(σ) = σ'
245
+ },
246
+ {
247
+ id: 33,
248
+ alias: 'F15',
249
+ cstType: CstType.FUNCTION,
250
+ term: 'класс эквивалентности элемента',
251
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] Pr2(Fi1[{α}](σ))'
252
+ },
137
253
 
138
254
  // T4 — цепочки
139
255
  { id: 34, alias: 'T4', cstType: CstType.STATEMENT, term: 'Цепочки', definitionFormal: '1=1' },
@@ -145,10 +261,34 @@ const rows: BankRow[] = [
145
261
  definitionFormal:
146
262
  '[σ∈ℬ(R1×R1)] card(Pr1(σ))=card(σ) & card(Pr2(σ))=card(σ) & card(Pr1(σ)\\Pr2(σ))=1 & card(Pr2(σ)\\Pr1(σ))=1'
147
263
  },
148
- { id: 36, alias: 'F16', cstType: CstType.FUNCTION, term: 'начало цепочки', definitionFormal: '[σ∈ℬ(R1×R1)] debool(Pr1(σ) \\ Pr2(σ))' },
149
- { id: 37, alias: 'F17', cstType: CstType.FUNCTION, term: 'конец цепочки', definitionFormal: '[σ∈ℬ(R1×R1)] debool(Pr2(σ) \\ Pr1(σ))' },
150
- { id: 38, alias: 'F18', cstType: CstType.FUNCTION, term: 'следующий за данным элемент цепочки', definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] debool(Pr2(Fi1[{α}](σ)))' },
151
- { id: 39, alias: 'F19', cstType: CstType.FUNCTION, term: 'предшествующий данному элемент цепочки', definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] debool(Pr1(Fi2[{α}](σ)))' },
264
+ {
265
+ id: 36,
266
+ alias: 'F16',
267
+ cstType: CstType.FUNCTION,
268
+ term: 'начало цепочки',
269
+ definitionFormal: '[σ∈ℬ(R1×R1)] debool(Pr1(σ) \\ Pr2(σ))'
270
+ },
271
+ {
272
+ id: 37,
273
+ alias: 'F17',
274
+ cstType: CstType.FUNCTION,
275
+ term: 'конец цепочки',
276
+ definitionFormal: '[σ∈ℬ(R1×R1)] debool(Pr2(σ) \\ Pr1(σ))'
277
+ },
278
+ {
279
+ id: 38,
280
+ alias: 'F18',
281
+ cstType: CstType.FUNCTION,
282
+ term: 'следующий за данным элемент цепочки',
283
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] debool(Pr2(Fi1[{α}](σ)))'
284
+ },
285
+ {
286
+ id: 39,
287
+ alias: 'F19',
288
+ cstType: CstType.FUNCTION,
289
+ term: 'предшествующий данному элемент цепочки',
290
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] debool(Pr1(Fi2[{α}](σ)))'
291
+ },
152
292
 
153
293
  // T5 — графы
154
294
  { id: 40, alias: 'T5', cstType: CstType.STATEMENT, term: 'Графы', definitionFormal: '1=1' },
@@ -159,11 +299,35 @@ const rows: BankRow[] = [
159
299
  term: 'неориентированный граф',
160
300
  definitionFormal: '[γ∈ℬ(R1)×ℬ(R1×R1)] pr2(γ) = Pr2,1(pr2(γ))'
161
301
  },
162
- { id: 42, alias: 'F20', cstType: CstType.FUNCTION, term: 'истоки', definitionFormal: '[σ∈ℬ(R1×R1)] Pr1(σ) \\ Pr2(σ)' },
302
+ {
303
+ id: 42,
304
+ alias: 'F20',
305
+ cstType: CstType.FUNCTION,
306
+ term: 'истоки',
307
+ definitionFormal: '[σ∈ℬ(R1×R1)] Pr1(σ) \\ Pr2(σ)'
308
+ },
163
309
  { id: 43, alias: 'F21', cstType: CstType.FUNCTION, term: 'стоки', definitionFormal: '[σ∈ℬ(R1×R1)] Pr2(σ) \\ Pr1(σ)' },
164
- { id: 44, alias: 'F22', cstType: CstType.FUNCTION, term: 'изолированные вершины', definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R1)] α \\ (Pr2(σ) ∪ Pr1(σ))' },
165
- { id: 45, alias: 'F23', cstType: CstType.FUNCTION, term: 'потребители', definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] Pr2(Fi1[{α}](σ))' },
166
- { id: 46, alias: 'F24', cstType: CstType.FUNCTION, term: 'поставщики', definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] Pr1(Fi2[{α}](σ))' },
310
+ {
311
+ id: 44,
312
+ alias: 'F22',
313
+ cstType: CstType.FUNCTION,
314
+ term: 'изолированные вершины',
315
+ definitionFormal: '[α∈ℬ(R1), σ∈ℬ(R1×R1)] α \\ (Pr2(σ) ∪ Pr1(σ))'
316
+ },
317
+ {
318
+ id: 45,
319
+ alias: 'F23',
320
+ cstType: CstType.FUNCTION,
321
+ term: 'потребители',
322
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] Pr2(Fi1[{α}](σ))'
323
+ },
324
+ {
325
+ id: 46,
326
+ alias: 'F24',
327
+ cstType: CstType.FUNCTION,
328
+ term: 'поставщики',
329
+ definitionFormal: '[α∈R1, σ∈ℬ(R1×R1)] Pr1(Fi2[{α}](σ))'
330
+ },
167
331
  {
168
332
  id: 47,
169
333
  alias: 'F25',
@@ -204,8 +368,20 @@ const rows: BankRow[] = [
204
368
 
205
369
  // T6 — целые числа
206
370
  { id: 52, alias: 'T6', cstType: CstType.STATEMENT, term: 'Целые числа', definitionFormal: '1=1' },
207
- { id: 53, alias: 'F31', cstType: CstType.FUNCTION, term: 'минимум набора чисел', definitionFormal: '[σ∈ℬ(Z)] debool(D{ξ∈σ | ∀α∈σ α ≥ ξ})' },
208
- { id: 54, alias: 'F32', cstType: CstType.FUNCTION, term: 'максимум набора чисел', definitionFormal: '[σ∈ℬ(Z)] debool(D{ξ∈σ | ∀α∈σ α ≤ ξ})' },
371
+ {
372
+ id: 53,
373
+ alias: 'F31',
374
+ cstType: CstType.FUNCTION,
375
+ term: 'минимум набора чисел',
376
+ definitionFormal: '[σ∈ℬ(Z)] debool(D{ξ∈σ | ∀α∈σ α ≥ ξ})'
377
+ },
378
+ {
379
+ id: 54,
380
+ alias: 'F32',
381
+ cstType: CstType.FUNCTION,
382
+ term: 'максимум набора чисел',
383
+ definitionFormal: '[σ∈ℬ(Z)] debool(D{ξ∈σ | ∀α∈σ α ≤ ξ})'
384
+ },
209
385
  {
210
386
  id: 55,
211
387
  alias: 'F33',
@@ -213,8 +389,20 @@ const rows: BankRow[] = [
213
389
  term: 'натуральные числа, меньшие или равные данному',
214
390
  definitionFormal: '[α∈Z] R{(ξ,σ):=(0, {0}) | ξ<α | (ξ+1, σ ∪ {ξ+1})}'
215
391
  },
216
- { id: 56, alias: 'P25', cstType: CstType.PREDICATE, term: 'набор чисел, удовлетворяющий данному периоду', definitionFormal: '[σ∈ℬ(Z), τ∈Z] ∀α∈σ (α+τ ≤ F32[σ] ⇒ α+τ∈σ)' },
217
- { id: 57, alias: 'F35', cstType: CstType.FUNCTION, term: 'остаток от деления', definitionFormal: '[α∈Z, β∈Z] R{ξ:=α | ξ≥β & β>0 | ξ-β}' },
392
+ {
393
+ id: 56,
394
+ alias: 'P25',
395
+ cstType: CstType.PREDICATE,
396
+ term: 'набор чисел, удовлетворяющий данному периоду',
397
+ definitionFormal: '[σ∈ℬ(Z), τ∈Z] ∀α∈σ (α+τ ≤ F32[σ] ⇒ α+τ∈σ)'
398
+ },
399
+ {
400
+ id: 57,
401
+ alias: 'F35',
402
+ cstType: CstType.FUNCTION,
403
+ term: 'остаток от деления',
404
+ definitionFormal: '[α∈Z, β∈Z] R{ξ:=α | ξ≥β & β>0 | ξ-β}'
405
+ },
218
406
 
219
407
  // T7 — последовательности
220
408
  { id: 58, alias: 'T7', cstType: CstType.STATEMENT, term: 'Последовательности', definitionFormal: '1=1' },
@@ -225,9 +413,27 @@ const rows: BankRow[] = [
225
413
  term: 'корректная последовательность (позиции с нуля)',
226
414
  definitionFormal: '[σ∈ℬ(R1×Z)] card(σ)=card(Pr2(σ)) & ∀λ∈Pr2(σ) λ < card(σ)'
227
415
  },
228
- { id: 60, alias: 'P28', cstType: CstType.PREDICATE, term: 'подпоследовательность', definitionFormal: '[σ∈ℬ(R1×Z)] card(σ) = card(Pr2(σ))' },
229
- { id: 61, alias: 'F36', cstType: CstType.FUNCTION, term: 'начало последовательности', definitionFormal: '[σ∈ℬ(R1×Z)] debool(Pr1(Fi2[{0}](σ)))' },
230
- { id: 62, alias: 'F37', cstType: CstType.FUNCTION, term: 'конец последовательности', definitionFormal: '[σ∈ℬ(R1×Z)] debool(Pr1(Fi2[{card(σ) - 1}](σ)))' },
416
+ {
417
+ id: 60,
418
+ alias: 'P28',
419
+ cstType: CstType.PREDICATE,
420
+ term: 'подпоследовательность',
421
+ definitionFormal: '[σ∈ℬ(R1×Z)] card(σ) = card(Pr2(σ))'
422
+ },
423
+ {
424
+ id: 61,
425
+ alias: 'F36',
426
+ cstType: CstType.FUNCTION,
427
+ term: 'начало последовательности',
428
+ definitionFormal: '[σ∈ℬ(R1×Z)] debool(Pr1(Fi2[{0}](σ)))'
429
+ },
430
+ {
431
+ id: 62,
432
+ alias: 'F37',
433
+ cstType: CstType.FUNCTION,
434
+ term: 'конец последовательности',
435
+ definitionFormal: '[σ∈ℬ(R1×Z)] debool(Pr1(Fi2[{card(σ) - 1}](σ)))'
436
+ },
231
437
  {
232
438
  id: 63,
233
439
  alias: 'F40',
@@ -265,8 +471,7 @@ const rows: BankRow[] = [
265
471
  alias: 'F44',
266
472
  cstType: CstType.FUNCTION,
267
473
  term: 'нейтральные элементы',
268
- definitionFormal:
269
- '[σ∈ℬ((R1×R1)×R1)] D{ξ∈Pr1(Pr1(σ)) | ∀α∈Pr1(Pr1(σ)) (((α,ξ),α)∈σ & ((ξ,α),α)∈σ)}'
474
+ definitionFormal: '[σ∈ℬ((R1×R1)×R1)] D{ξ∈Pr1(Pr1(σ)) | ∀α∈Pr1(Pr1(σ)) (((α,ξ),α)∈σ & ((ξ,α),α)∈σ)}'
270
475
  },
271
476
  {
272
477
  id: 68,
@@ -280,16 +485,14 @@ const rows: BankRow[] = [
280
485
  alias: 'F46',
281
486
  cstType: CstType.FUNCTION,
282
487
  term: 'обратные элементы для данного элемента',
283
- definitionFormal:
284
- '[α∈R1, σ∈ℬ((R1×R1)×R1)] D{ω∈Pr1(Pr1(σ)) | F42[α,ω,σ]∈F44[σ] & F42[ω,α,σ]∈F44[σ]}'
488
+ definitionFormal: '[α∈R1, σ∈ℬ((R1×R1)×R1)] D{ω∈Pr1(Pr1(σ)) | F42[α,ω,σ]∈F44[σ] & F42[ω,α,σ]∈F44[σ]}'
285
489
  },
286
490
  {
287
491
  id: 70,
288
492
  alias: 'F47',
289
493
  cstType: CstType.FUNCTION,
290
494
  term: 'элемент, являющийся данной степенью данного элемента',
291
- definitionFormal:
292
- '[α∈R1, λ∈Z, σ∈ℬ((R1×R1)×R1)] pr1(R{(ξ, μ) := (α, 1) | μ<λ & λ>0 | (F42[ξ,α,σ], μ + 1)})'
495
+ definitionFormal: '[α∈R1, λ∈Z, σ∈ℬ((R1×R1)×R1)] pr1(R{(ξ, μ) := (α, 1) | μ<λ & λ>0 | (F42[ξ,α,σ], μ + 1)})'
293
496
  },
294
497
  {
295
498
  id: 71,
@@ -305,7 +508,13 @@ const rows: BankRow[] = [
305
508
  term: 'свойство ассоциативности',
306
509
  definitionFormal: '[σ∈ℬ((R1×R1)×R1)] ∀α,β,γ∈Pr1(Pr1(σ)) F42[F42[α,β,σ],γ,σ] = F42[α,F42[β,γ,σ],σ]'
307
510
  },
308
- { id: 73, alias: 'P31', cstType: CstType.PREDICATE, term: 'свойство коммутативности', definitionFormal: '[σ∈ℬ((R1×R1)×R1)] ∀((α1,α2),γ)∈σ ((α2,α1),γ)∈σ' },
511
+ {
512
+ id: 73,
513
+ alias: 'P31',
514
+ cstType: CstType.PREDICATE,
515
+ term: 'свойство коммутативности',
516
+ definitionFormal: '[σ∈ℬ((R1×R1)×R1)] ∀((α1,α2),γ)∈σ ((α2,α1),γ)∈σ'
517
+ },
309
518
  {
310
519
  id: 74,
311
520
  alias: 'P35',
@@ -331,7 +540,14 @@ const rows: BankRow[] = [
331
540
  },
332
541
 
333
542
  // T9 — кольца
334
- { id: 77, alias: 'T9', cstType: CstType.STATEMENT, term: 'Кольца', definitionFormal: '1=1', convention: 'Операции по умолчанию — группоиды' },
543
+ {
544
+ id: 77,
545
+ alias: 'T9',
546
+ cstType: CstType.STATEMENT,
547
+ term: 'Кольца',
548
+ definitionFormal: '1=1',
549
+ convention: 'Операции по умолчанию — группоиды'
550
+ },
335
551
  {
336
552
  id: 78,
337
553
  alias: 'P39',
@@ -345,16 +561,33 @@ const rows: BankRow[] = [
345
561
  alias: 'P41',
346
562
  cstType: CstType.PREDICATE,
347
563
  term: 'полукольцо',
348
- definitionFormal:
349
- '[α∈ℬ(R1), φ∈ℬ((R1×R1)×R1), ψ∈ℬ((R1×R1)×R1)] P36[α, φ] & P31[φ] & P35[α, ψ] & P39[φ, ψ]',
564
+ definitionFormal: '[α∈ℬ(R1), φ∈ℬ((R1×R1)×R1), ψ∈ℬ((R1×R1)×R1)] P36[α, φ] & P31[φ] & P35[α, ψ] & P39[φ, ψ]',
350
565
  convention: 'сложение — моноид + коммутативность; умножение — полугруппа'
351
566
  },
352
567
 
353
568
  // T10 — множества подмножеств
354
569
  { id: 80, alias: 'T10', cstType: CstType.STATEMENT, term: 'Множества подмножеств', definitionFormal: '1=1' },
355
- { id: 81, alias: 'P46', cstType: CstType.PREDICATE, term: 'свойство покрытия', definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] α⊆red(σ)' },
356
- { id: 82, alias: 'P47', cstType: CstType.PREDICATE, term: 'свойство попарного непересечения', definitionFormal: '[σ∈ℬℬ(R1)] ∀α,β∈σ (α≠β ⇒ α∩β=∅)' },
357
- { id: 83, alias: 'P48', cstType: CstType.PREDICATE, term: 'свойство замкнутости по объединению', definitionFormal: '[σ∈ℬℬ(R1)] ∀α,β∈σ α∪β∈σ' },
570
+ {
571
+ id: 81,
572
+ alias: 'P46',
573
+ cstType: CstType.PREDICATE,
574
+ term: 'свойство покрытия',
575
+ definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] α⊆red(σ)'
576
+ },
577
+ {
578
+ id: 82,
579
+ alias: 'P47',
580
+ cstType: CstType.PREDICATE,
581
+ term: 'свойство попарного непересечения',
582
+ definitionFormal: '[σ∈ℬℬ(R1)] ∀α,β∈σ (α≠β ⇒ α∩β=∅)'
583
+ },
584
+ {
585
+ id: 83,
586
+ alias: 'P48',
587
+ cstType: CstType.PREDICATE,
588
+ term: 'свойство замкнутости по объединению',
589
+ definitionFormal: '[σ∈ℬℬ(R1)] ∀α,β∈σ α∪β∈σ'
590
+ },
358
591
  {
359
592
  id: 84,
360
593
  alias: 'P52',
@@ -362,9 +595,27 @@ const rows: BankRow[] = [
362
595
  term: 'разбиение',
363
596
  definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] red(σ)=α & card(σ)>1 & ∅∉σ & ∀ξ1,ξ2∈σ (ξ1≠ξ2 ⇒ ξ1∩ξ2=∅)'
364
597
  },
365
- { id: 85, alias: 'F48', cstType: CstType.FUNCTION, term: 'фильтр по вхождению элемента', definitionFormal: '[α∈R1, σ∈ℬℬ(R1)] D{ξ∈σ | α∈ξ}' },
366
- { id: 86, alias: 'F49', cstType: CstType.FUNCTION, term: 'фильтр по подмножеству', definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] D{ξ∈σ | α⊆ξ}' },
367
- { id: 87, alias: 'F50', cstType: CstType.FUNCTION, term: 'фильтр по надмножеству', definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] D{ξ∈σ | ξ⊆α}' }
598
+ {
599
+ id: 85,
600
+ alias: 'F48',
601
+ cstType: CstType.FUNCTION,
602
+ term: 'фильтр по вхождению элемента',
603
+ definitionFormal: '[α∈R1, σ∈ℬℬ(R1)] D{ξ∈σ | α∈ξ}'
604
+ },
605
+ {
606
+ id: 86,
607
+ alias: 'F49',
608
+ cstType: CstType.FUNCTION,
609
+ term: 'фильтр по подмножеству',
610
+ definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] D{ξ∈σ | α⊆ξ}'
611
+ },
612
+ {
613
+ id: 87,
614
+ alias: 'F50',
615
+ cstType: CstType.FUNCTION,
616
+ term: 'фильтр по надмножеству',
617
+ definitionFormal: '[α∈ℬ(R1), σ∈ℬℬ(R1)] D{ξ∈σ | ξ⊆α}'
618
+ }
368
619
  ];
369
620
 
370
- export const BANK_DRAFTS: AddOrUpdateConstituentaInput[] = rows.map(row);
621
+ export const BANK_DRAFTS: DraftBatch[] = rows.map(row);
@@ -19,22 +19,25 @@ async function run() {
19
19
  await client.waitUntilReady();
20
20
  const session = await client.call<{ sessionId: string; contractVersion: string }>('createSession');
21
21
 
22
- for (const input of BANK_DRAFTS) {
23
- const result = await client.call<{
24
- state: { alias: string; analysis: { success: boolean } };
25
- diagnostics: unknown[];
26
- }>('addOrUpdateConstituenta', {
27
- sessionId: session.sessionId,
28
- input
29
- });
30
- const ok = result.state.analysis.success;
31
- const diagCount = result.diagnostics?.length ?? 0;
32
- console.log(`${input.draft.alias}: ${ok ? 'OK' : 'FAIL'} (${diagCount} diagnostics)`);
33
- if (!ok) {
34
- const diags = await client.call('listDiagnostics', { sessionId: session.sessionId });
35
- console.log(JSON.stringify(diags, null, 2));
36
- throw new Error(`${input.draft.alias}: analysis failed (${diagCount} diagnostics)`);
37
- }
22
+ const patch = await client.call<{
23
+ success: boolean;
24
+ diagnostics: unknown[];
25
+ failed: Array<{ draft: { alias: string }; diagnostics: unknown[] }>;
26
+ summary: { items: Array<{ alias: string; analysisSuccess: boolean }> };
27
+ }>('applySchemaPatch', {
28
+ sessionId: session.sessionId,
29
+ mode: 'atomic',
30
+ items: BANK_DRAFTS.map(entry => entry.draft)
31
+ });
32
+
33
+ for (const item of patch.summary.items) {
34
+ console.log(`${item.alias}: ${item.analysisSuccess ? 'OK' : 'FAIL'}`);
35
+ }
36
+ if (!patch.success) {
37
+ const diags = await client.call('listDiagnostics', { sessionId: session.sessionId });
38
+ console.log(JSON.stringify(diags, null, 2));
39
+ const failedAlias = patch.failed[0]?.draft.alias ?? 'unknown';
40
+ throw new Error(`${failedAlias}: analysis failed`);
38
41
  }
39
42
 
40
43
  await client.call('commitStep', {