-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstructure.proto
119 lines (95 loc) · 3.07 KB
/
structure.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package pomagma.atlas.protobuf;
//----------------------------------------------------------------------------
// raw data
message ObMap {
// Either key,val are both set, or key_diff_minus_one,val_diff are both set.
repeated uint32 key = 1 [packed=true];
repeated uint32 val = 2 [packed=true];
repeated uint32 key_diff_minus_one = 3 [packed=true];
repeated int32 val_diff = 4 [packed=true];
}
message ObSet {
required bytes dense = 1;
}
//----------------------------------------------------------------------------
// algebraic structure
message Carrier {
optional string name = 1;
optional bytes hash = 2;
optional uint32 item_count = 3;
}
message NullaryFunction {
optional string name = 1;
optional bytes hash = 2;
optional uint32 val = 3;
repeated bytes blobs = 15;
}
message UnaryFunction {
optional string name = 1;
optional bytes hash = 2;
optional ObMap map = 3;
repeated bytes blobs = 15;
}
message BinaryFunction {
message Row {
required uint32 lhs = 1;
required ObMap rhs_val = 2;
}
optional string name = 1;
optional bytes hash = 2;
repeated Row rows = 3;
repeated bytes blobs = 15;
}
message UnaryRelation {
optional string name = 1;
optional bytes hash = 2;
optional ObSet set = 3;
repeated bytes blobs = 15;
}
message BinaryRelation {
message Row {
required uint32 lhs = 1;
required ObSet rhs = 2;
}
optional string name = 1;
optional bytes hash = 2;
repeated Row rows = 3;
repeated bytes blobs = 15;
}
message Structure {
optional string name = 1;
optional bytes hash = 2;
optional Carrier carrier = 3;
repeated NullaryFunction nullary_functions = 4;
// reserved 5; // For unary_functions.
repeated UnaryFunction injective_functions = 6;
repeated BinaryFunction binary_functions = 7;
repeated BinaryFunction symmetric_functions = 8;
repeated UnaryRelation unary_relations = 9;
repeated BinaryRelation binary_relations = 10;
}
//----------------------------------------------------------------------------
// chart
// Charts are small so that many can fit in an Atlas.
message Chart {
// Presentation blobs refer to pomagma.compiler.protobuf.Presentation protos.
// The min_presentation contains only those terms which are present in the
// structure, and a theory wrt which the structure has been saturated.
// The max_presentation.signature contains at least all terms that are
// present, and max_presentation.theory contains at least all facts that have
// ever been applied, or a theory entailing such.
// Lemma: min_presentation.signature is a subset of
// max_presentation.signature.
// Lemma: min_presentation.theory is entailed by max_presentation.theory.
required bytes min_presentation_blob = 1;
required bytes max_presentation_blob = 2;
required bytes structure_blob = 3;
repeated bytes subsumed_structure_blobs = 4;
}
//----------------------------------------------------------------------------
// atlas
message Atlas {
// This represents a map from the .max_presentation_blob field to Charts;
// elements should be sorted.
repeated Chart charts = 1;
}