tiergraph 0.1.0__py3-none-any.whl
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.
- tiergraph/__init__.py +325 -0
- tiergraph/__main__.py +6 -0
- tiergraph/action.py +492 -0
- tiergraph/build.py +838 -0
- tiergraph/cli/__init__.py +804 -0
- tiergraph/clock.py +680 -0
- tiergraph/core.py +1586 -0
- tiergraph/fold.py +831 -0
- tiergraph/grammar.py +1286 -0
- tiergraph/inspect.py +41 -0
- tiergraph/machine.py +1417 -0
- tiergraph/machine_codec.py +106 -0
- tiergraph/path.py +497 -0
- tiergraph/py.typed +0 -0
- tiergraph/root.py +222 -0
- tiergraph/schema.py +537 -0
- tiergraph/selection.py +364 -0
- tiergraph/selection_query.py +277 -0
- tiergraph/semiring.py +660 -0
- tiergraph/spanview.py +491 -0
- tiergraph/traversal.py +634 -0
- tiergraph/value.py +481 -0
- tiergraph/wire.py +626 -0
- tiergraph-0.1.0.dist-info/METADATA +160 -0
- tiergraph-0.1.0.dist-info/RECORD +30 -0
- tiergraph-0.1.0.dist-info/WHEEL +4 -0
- tiergraph-0.1.0.dist-info/entry_points.txt +2 -0
- tiergraph-0.1.0.dist-info/licenses/LICENSE +24 -0
- tiergraph_dot/__init__.py +979 -0
- tiergraph_dot/py.typed +0 -0
tiergraph/__init__.py
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"""tiergraph: ordered tiers, declared relations, and typed values."""
|
|
2
|
+
|
|
3
|
+
from tiergraph.action import (
|
|
4
|
+
ActionDeclaration,
|
|
5
|
+
DistributionWitness,
|
|
6
|
+
ReactDeclaration,
|
|
7
|
+
ReactMode,
|
|
8
|
+
Semimodule,
|
|
9
|
+
WitnessCoordinate,
|
|
10
|
+
YieldNormalization,
|
|
11
|
+
)
|
|
12
|
+
from tiergraph.clock import (
|
|
13
|
+
ClockPosition,
|
|
14
|
+
ClockProfile,
|
|
15
|
+
PhysicalTiming,
|
|
16
|
+
anchored_position,
|
|
17
|
+
)
|
|
18
|
+
from tiergraph.core import (
|
|
19
|
+
AttributeDeclaration,
|
|
20
|
+
AttributeDomain,
|
|
21
|
+
AttributeValue,
|
|
22
|
+
BipartiteRelationDeclaration,
|
|
23
|
+
BoundarySide,
|
|
24
|
+
DurableItemRef,
|
|
25
|
+
DurablePositionRef,
|
|
26
|
+
Graph,
|
|
27
|
+
GraphValidationError,
|
|
28
|
+
Item,
|
|
29
|
+
ItemRef,
|
|
30
|
+
NamespaceDeclaration,
|
|
31
|
+
PolyadicRelationDeclaration,
|
|
32
|
+
PolyadicRelationInstance,
|
|
33
|
+
Position,
|
|
34
|
+
PositionRef,
|
|
35
|
+
QualifiedName,
|
|
36
|
+
RelationEndpointKind,
|
|
37
|
+
RelationInstance,
|
|
38
|
+
RelationSideDeclaration,
|
|
39
|
+
SimpleRelationDeclaration,
|
|
40
|
+
Tier,
|
|
41
|
+
TierDeclaration,
|
|
42
|
+
XsdType,
|
|
43
|
+
)
|
|
44
|
+
from tiergraph.fold import (
|
|
45
|
+
AttributeValuation,
|
|
46
|
+
ChildCombination,
|
|
47
|
+
FoldCost,
|
|
48
|
+
FoldDeclaration,
|
|
49
|
+
FoldHomomorphism,
|
|
50
|
+
FoldResult,
|
|
51
|
+
FoldTransition,
|
|
52
|
+
TiePolicy,
|
|
53
|
+
)
|
|
54
|
+
from tiergraph.grammar import (
|
|
55
|
+
CHART_NAMESPACE,
|
|
56
|
+
COMPLETE_BOUNDARY,
|
|
57
|
+
GRAMMAR_NAMESPACE,
|
|
58
|
+
BestDerivation,
|
|
59
|
+
GrammarChartProfile,
|
|
60
|
+
GrammarDeclaration,
|
|
61
|
+
GrammarHole,
|
|
62
|
+
GrammarRule,
|
|
63
|
+
GrammarTerminal,
|
|
64
|
+
LoweredGrammar,
|
|
65
|
+
ParseForest,
|
|
66
|
+
best,
|
|
67
|
+
count,
|
|
68
|
+
grammar_loads,
|
|
69
|
+
lower_grammar,
|
|
70
|
+
recognize,
|
|
71
|
+
)
|
|
72
|
+
from tiergraph.inspect import graph_summary
|
|
73
|
+
from tiergraph.machine import (
|
|
74
|
+
MACHINE_VERSION,
|
|
75
|
+
MAX_REPEAT_COUNT,
|
|
76
|
+
MAX_TOTAL_OPCODES,
|
|
77
|
+
AddItem,
|
|
78
|
+
AsBuilt,
|
|
79
|
+
AttachValue,
|
|
80
|
+
DeclareAttribute,
|
|
81
|
+
DeclareNamespace,
|
|
82
|
+
DeclareRelation,
|
|
83
|
+
DeclareTier,
|
|
84
|
+
ExecutionError,
|
|
85
|
+
Program,
|
|
86
|
+
PromoteItem,
|
|
87
|
+
PromotePosition,
|
|
88
|
+
Relate,
|
|
89
|
+
Repeat,
|
|
90
|
+
Step,
|
|
91
|
+
execute,
|
|
92
|
+
steps,
|
|
93
|
+
)
|
|
94
|
+
from tiergraph.machine_codec import load_program, program_dumps, program_loads
|
|
95
|
+
from tiergraph.path import (
|
|
96
|
+
AlternativeRef,
|
|
97
|
+
CanonicalPath,
|
|
98
|
+
ItemBinding,
|
|
99
|
+
PathBinding,
|
|
100
|
+
PathKind,
|
|
101
|
+
PathOffender,
|
|
102
|
+
PathProfile,
|
|
103
|
+
PathRefusal,
|
|
104
|
+
PathRefusalCode,
|
|
105
|
+
PositionBinding,
|
|
106
|
+
ResolvedAlternative,
|
|
107
|
+
ResolvedItem,
|
|
108
|
+
ResolvedPosition,
|
|
109
|
+
StructuralPathProfile,
|
|
110
|
+
resolve_path,
|
|
111
|
+
)
|
|
112
|
+
from tiergraph.root import OrderedRootsProfile, PersistedChoiceProfile
|
|
113
|
+
from tiergraph.selection import (
|
|
114
|
+
AttributeSelector,
|
|
115
|
+
BoundariesSelector,
|
|
116
|
+
BoundarySelector,
|
|
117
|
+
ItemSelector,
|
|
118
|
+
ItemsSelector,
|
|
119
|
+
Node,
|
|
120
|
+
NodeKind,
|
|
121
|
+
NodeSet,
|
|
122
|
+
TierSelector,
|
|
123
|
+
TypeSelector,
|
|
124
|
+
select,
|
|
125
|
+
)
|
|
126
|
+
from tiergraph.selection_query import (
|
|
127
|
+
AttributeQuery,
|
|
128
|
+
BoundariesQuery,
|
|
129
|
+
BoundaryQuery,
|
|
130
|
+
DifferenceQuery,
|
|
131
|
+
IntersectionQuery,
|
|
132
|
+
ItemQuery,
|
|
133
|
+
ItemsQuery,
|
|
134
|
+
SelectionQuery,
|
|
135
|
+
TierQuery,
|
|
136
|
+
TypeQuery,
|
|
137
|
+
UnionQuery,
|
|
138
|
+
evaluate_selection,
|
|
139
|
+
selection_query_loads,
|
|
140
|
+
)
|
|
141
|
+
from tiergraph.semiring import BOOLEAN, COUNTING, DECIMAL_TROPICAL, PATH
|
|
142
|
+
from tiergraph.spanview import (
|
|
143
|
+
SpanViewProfile,
|
|
144
|
+
span_view,
|
|
145
|
+
to_html,
|
|
146
|
+
to_json,
|
|
147
|
+
to_jsonl,
|
|
148
|
+
to_text,
|
|
149
|
+
)
|
|
150
|
+
from tiergraph.traversal import (
|
|
151
|
+
NodeSequence,
|
|
152
|
+
OrderedContainment,
|
|
153
|
+
OrderedPolyadicTraversal,
|
|
154
|
+
PolyadicSide,
|
|
155
|
+
Walk,
|
|
156
|
+
WalkDirection,
|
|
157
|
+
WalkResult,
|
|
158
|
+
)
|
|
159
|
+
from tiergraph.value import JsonValueProfile, json_value_graph
|
|
160
|
+
from tiergraph.wire import (
|
|
161
|
+
FORMAT_VERSION,
|
|
162
|
+
MAX_DOCUMENT_BYTES,
|
|
163
|
+
MAX_JSON_DEPTH,
|
|
164
|
+
dump_bytes,
|
|
165
|
+
dump_compact,
|
|
166
|
+
dumps,
|
|
167
|
+
loads,
|
|
168
|
+
to_data,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
__version__ = "0.1.0"
|
|
172
|
+
|
|
173
|
+
__all__ = [
|
|
174
|
+
"ActionDeclaration",
|
|
175
|
+
"AlternativeRef",
|
|
176
|
+
"AddItem",
|
|
177
|
+
"AsBuilt",
|
|
178
|
+
"AttachValue",
|
|
179
|
+
"AttributeDeclaration",
|
|
180
|
+
"AttributeDomain",
|
|
181
|
+
"AttributeSelector",
|
|
182
|
+
"AttributeQuery",
|
|
183
|
+
"AttributeValuation",
|
|
184
|
+
"AttributeValue",
|
|
185
|
+
"BipartiteRelationDeclaration",
|
|
186
|
+
"BoundariesSelector",
|
|
187
|
+
"BoundariesQuery",
|
|
188
|
+
"BoundaryQuery",
|
|
189
|
+
"BoundarySelector",
|
|
190
|
+
"BoundarySide",
|
|
191
|
+
"BestDerivation",
|
|
192
|
+
"ChildCombination",
|
|
193
|
+
"ClockProfile",
|
|
194
|
+
"ClockPosition",
|
|
195
|
+
"CanonicalPath",
|
|
196
|
+
"DeclareAttribute",
|
|
197
|
+
"DeclareNamespace",
|
|
198
|
+
"DeclareRelation",
|
|
199
|
+
"DeclareTier",
|
|
200
|
+
"DistributionWitness",
|
|
201
|
+
"DifferenceQuery",
|
|
202
|
+
"DurableItemRef",
|
|
203
|
+
"DurablePositionRef",
|
|
204
|
+
"ExecutionError",
|
|
205
|
+
"FoldCost",
|
|
206
|
+
"FoldDeclaration",
|
|
207
|
+
"FoldHomomorphism",
|
|
208
|
+
"FoldResult",
|
|
209
|
+
"FoldTransition",
|
|
210
|
+
"Graph",
|
|
211
|
+
"GraphValidationError",
|
|
212
|
+
"GrammarDeclaration",
|
|
213
|
+
"GrammarChartProfile",
|
|
214
|
+
"GrammarHole",
|
|
215
|
+
"GrammarRule",
|
|
216
|
+
"GrammarTerminal",
|
|
217
|
+
"GRAMMAR_NAMESPACE",
|
|
218
|
+
"Item",
|
|
219
|
+
"IntersectionQuery",
|
|
220
|
+
"ItemBinding",
|
|
221
|
+
"ItemRef",
|
|
222
|
+
"ItemQuery",
|
|
223
|
+
"ItemSelector",
|
|
224
|
+
"ItemsSelector",
|
|
225
|
+
"ItemsQuery",
|
|
226
|
+
"JsonValueProfile",
|
|
227
|
+
"LoweredGrammar",
|
|
228
|
+
"MACHINE_VERSION",
|
|
229
|
+
"MAX_REPEAT_COUNT",
|
|
230
|
+
"MAX_TOTAL_OPCODES",
|
|
231
|
+
"MAX_DOCUMENT_BYTES",
|
|
232
|
+
"MAX_JSON_DEPTH",
|
|
233
|
+
"NamespaceDeclaration",
|
|
234
|
+
"Node",
|
|
235
|
+
"NodeKind",
|
|
236
|
+
"NodeSet",
|
|
237
|
+
"NodeSequence",
|
|
238
|
+
"OrderedContainment",
|
|
239
|
+
"OrderedPolyadicTraversal",
|
|
240
|
+
"OrderedRootsProfile",
|
|
241
|
+
"ParseForest",
|
|
242
|
+
"PathBinding",
|
|
243
|
+
"PathKind",
|
|
244
|
+
"PathOffender",
|
|
245
|
+
"PathProfile",
|
|
246
|
+
"PathRefusal",
|
|
247
|
+
"PathRefusalCode",
|
|
248
|
+
"Position",
|
|
249
|
+
"PositionBinding",
|
|
250
|
+
"PositionRef",
|
|
251
|
+
"PhysicalTiming",
|
|
252
|
+
"PersistedChoiceProfile",
|
|
253
|
+
"PolyadicRelationDeclaration",
|
|
254
|
+
"PolyadicRelationInstance",
|
|
255
|
+
"PolyadicSide",
|
|
256
|
+
"Program",
|
|
257
|
+
"load_program",
|
|
258
|
+
"program_dumps",
|
|
259
|
+
"program_loads",
|
|
260
|
+
"PromoteItem",
|
|
261
|
+
"PromotePosition",
|
|
262
|
+
"QualifiedName",
|
|
263
|
+
"ReactDeclaration",
|
|
264
|
+
"ReactMode",
|
|
265
|
+
"Relate",
|
|
266
|
+
"RelationEndpointKind",
|
|
267
|
+
"RelationSideDeclaration",
|
|
268
|
+
"RelationInstance",
|
|
269
|
+
"Repeat",
|
|
270
|
+
"ResolvedItem",
|
|
271
|
+
"ResolvedAlternative",
|
|
272
|
+
"ResolvedPosition",
|
|
273
|
+
"SimpleRelationDeclaration",
|
|
274
|
+
"SelectionQuery",
|
|
275
|
+
"Step",
|
|
276
|
+
"StructuralPathProfile",
|
|
277
|
+
"Semimodule",
|
|
278
|
+
"TiePolicy",
|
|
279
|
+
"Tier",
|
|
280
|
+
"TierDeclaration",
|
|
281
|
+
"TierSelector",
|
|
282
|
+
"TierQuery",
|
|
283
|
+
"TypeSelector",
|
|
284
|
+
"TypeQuery",
|
|
285
|
+
"UnionQuery",
|
|
286
|
+
"XsdType",
|
|
287
|
+
"CHART_NAMESPACE",
|
|
288
|
+
"COMPLETE_BOUNDARY",
|
|
289
|
+
"Walk",
|
|
290
|
+
"WalkDirection",
|
|
291
|
+
"WalkResult",
|
|
292
|
+
"WitnessCoordinate",
|
|
293
|
+
"YieldNormalization",
|
|
294
|
+
"BOOLEAN",
|
|
295
|
+
"COUNTING",
|
|
296
|
+
"DECIMAL_TROPICAL",
|
|
297
|
+
"PATH",
|
|
298
|
+
"SpanViewProfile",
|
|
299
|
+
"FORMAT_VERSION",
|
|
300
|
+
"dump_compact",
|
|
301
|
+
"dump_bytes",
|
|
302
|
+
"dumps",
|
|
303
|
+
"graph_summary",
|
|
304
|
+
"loads",
|
|
305
|
+
"to_data",
|
|
306
|
+
"execute",
|
|
307
|
+
"evaluate_selection",
|
|
308
|
+
"steps",
|
|
309
|
+
"json_value_graph",
|
|
310
|
+
"lower_grammar",
|
|
311
|
+
"recognize",
|
|
312
|
+
"resolve_path",
|
|
313
|
+
"anchored_position",
|
|
314
|
+
"best",
|
|
315
|
+
"count",
|
|
316
|
+
"grammar_loads",
|
|
317
|
+
"select",
|
|
318
|
+
"selection_query_loads",
|
|
319
|
+
"span_view",
|
|
320
|
+
"to_html",
|
|
321
|
+
"to_json",
|
|
322
|
+
"to_jsonl",
|
|
323
|
+
"to_text",
|
|
324
|
+
"__version__",
|
|
325
|
+
]
|