occam-verify-cli 0.0.374 → 0.0.375
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.
- package/lib/axiom.js +45 -12
- package/lib/combinator.js +13 -7
- package/lib/conclusion.js +8 -1
- package/lib/constructor.js +24 -8
- package/lib/context/file.js +6 -6
- package/lib/context/release/directory.js +17 -17
- package/lib/context/release/file.js +73 -21
- package/lib/kinds.js +5 -5
- package/lib/label.js +16 -1
- package/lib/premise.js +8 -1
- package/lib/rule.js +39 -12
- package/lib/ruleNames.js +5 -1
- package/lib/type.js +19 -8
- package/package.json +1 -1
- package/src/axiom.js +62 -13
- package/src/combinator.js +14 -2
- package/src/conclusion.js +11 -0
- package/src/constructor.js +23 -2
- package/src/context/file.js +5 -5
- package/src/context/release/directory.js +14 -14
- package/src/context/release/file.js +95 -26
- package/src/kinds.js +1 -1
- package/src/label.js +17 -0
- package/src/premise.js +11 -0
- package/src/rule.js +44 -12
- package/src/ruleNames.js +1 -0
- package/src/type.js +19 -2
package/src/rule.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import Label from "./label";
|
|
4
|
+
import Premise from "./premise";
|
|
5
|
+
import Conclusion from "./conclusion";
|
|
6
|
+
|
|
3
7
|
import { prune } from "./utilities/array";
|
|
4
8
|
import { RULE_KIND } from "./kinds";
|
|
5
9
|
import { someSubArray } from "./utilities/array";
|
|
@@ -62,29 +66,57 @@ export default class Rule {
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
toJSON() {
|
|
65
|
-
const
|
|
69
|
+
const labelsJSON = this.labels.map((label) => {
|
|
70
|
+
const labelJSON = label.toJSON();
|
|
71
|
+
|
|
72
|
+
return labelJSON;
|
|
73
|
+
}),
|
|
74
|
+
premisesJSON = this.premises.map((premise) => {
|
|
66
75
|
const premiseJSON = premise.toJSON();
|
|
67
76
|
|
|
68
77
|
return premiseJSON;
|
|
69
78
|
}),
|
|
70
79
|
conclusionJSON = this.conclusion.toJSON(),
|
|
71
80
|
kind = RULE_KIND,
|
|
81
|
+
labels = labelsJSON, ///
|
|
72
82
|
premises = premisesJSON, ///
|
|
73
83
|
conclusion = conclusionJSON, ///
|
|
74
|
-
json =
|
|
75
|
-
|
|
84
|
+
json = {
|
|
85
|
+
kind,
|
|
86
|
+
labels,
|
|
87
|
+
premises,
|
|
88
|
+
conclusion
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return json;
|
|
92
|
+
}
|
|
76
93
|
|
|
77
|
-
|
|
94
|
+
static fromJSON(json, callback) {
|
|
95
|
+
let { labels, premises, conclusion } = json;
|
|
78
96
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
label,
|
|
82
|
-
premises,
|
|
83
|
-
conclusion
|
|
84
|
-
});
|
|
85
|
-
});
|
|
97
|
+
labels = labels.map((label) => {
|
|
98
|
+
const json = label; ///
|
|
86
99
|
|
|
87
|
-
|
|
100
|
+
label = Label.fromJSON(json, callback);
|
|
101
|
+
|
|
102
|
+
return label;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
premises = premises.map((premise) => {
|
|
106
|
+
const json = premise; ///
|
|
107
|
+
|
|
108
|
+
premise = Premise.fromJSON(json, callback);
|
|
109
|
+
|
|
110
|
+
return premise;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
json = conclusion; ///
|
|
114
|
+
|
|
115
|
+
conclusion = Conclusion.fromJSON(json, callback);
|
|
116
|
+
|
|
117
|
+
const rule = new Rule(labels, premises, conclusion);
|
|
118
|
+
|
|
119
|
+
return rule;
|
|
88
120
|
}
|
|
89
121
|
|
|
90
122
|
static fromLabelsPremisesAndConclusion(labels, premises, conclusion) {
|
package/src/ruleNames.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export const TERM_RULE_NAME = "term";
|
|
4
4
|
export const TYPE_RULE_NAME = "type";
|
|
5
5
|
export const ARGUMENT_RULE_NAME = "argument";
|
|
6
|
+
export const STATEMENT_RULE_NAME = "statement";
|
|
6
7
|
export const METAVARIABLE_RULE_NAME = "metavariable";
|
|
7
8
|
export const METASTATEMENT_RULE_NAME = "metastatement";
|
|
8
9
|
export const META_SUBPROOF_RULE_NAME = "metaSubproof";
|
package/src/type.js
CHANGED
|
@@ -110,15 +110,32 @@ export default class Type {
|
|
|
110
110
|
kind = TYPE_KIND,
|
|
111
111
|
name = this.name,
|
|
112
112
|
superType = superTypeJSON, ///
|
|
113
|
-
json =
|
|
113
|
+
json = {
|
|
114
114
|
kind,
|
|
115
115
|
name,
|
|
116
116
|
superType
|
|
117
|
-
}
|
|
117
|
+
};
|
|
118
118
|
|
|
119
119
|
return json;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
static fromJSON(json) {
|
|
123
|
+
const { name } = json;
|
|
124
|
+
|
|
125
|
+
let { superType } = json;
|
|
126
|
+
|
|
127
|
+
if (superType !== null) {
|
|
128
|
+
json = superType; ///
|
|
129
|
+
|
|
130
|
+
superType = Type.fromJSON(json);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const type = new Type(name, superType);
|
|
134
|
+
|
|
135
|
+
return type;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
122
139
|
static fromTypeName(typeName) {
|
|
123
140
|
const name = typeName, ///
|
|
124
141
|
superType = null,
|