occam-verify-cli 1.0.662 → 1.0.664
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/.swcrc +3 -0
- package/lib/abbreviations.js +10 -10
- package/lib/action/help.js +27 -2
- package/lib/action/verify.js +33 -205
- package/lib/action/version.js +6 -6
- package/lib/commands.js +4 -4
- package/lib/constants.js +16 -16
- package/lib/context/ephemeral.js +337 -540
- package/lib/context/file/nominal.js +545 -1040
- package/lib/context/liminal.js +159 -325
- package/lib/context/literal.js +34 -138
- package/lib/context/nominal.js +29 -124
- package/lib/context/scoped.js +163 -325
- package/lib/context/synthetic.js +31 -126
- package/lib/context.js +230 -482
- package/lib/defaults.js +8 -8
- package/lib/element/assertion/contained.js +159 -299
- package/lib/element/assertion/defined.js +145 -279
- package/lib/element/assertion/property.js +132 -266
- package/lib/element/assertion/satisfies.js +108 -239
- package/lib/element/assertion/subproof.js +88 -207
- package/lib/element/assertion/type.js +132 -262
- package/lib/element/assertion.js +17 -156
- package/lib/element/assumption.js +187 -386
- package/lib/element/combinator/bracketed.js +19 -142
- package/lib/element/combinator.js +65 -228
- package/lib/element/conclusion.js +72 -370
- package/lib/element/constructor/bracketed.js +34 -157
- package/lib/element/constructor.js +81 -253
- package/lib/element/declaration/combinator.js +41 -286
- package/lib/element/declaration/complexType.js +184 -452
- package/lib/element/declaration/constructor.js +69 -323
- package/lib/element/declaration/metavariable.js +70 -317
- package/lib/element/declaration/simpleType.js +117 -378
- package/lib/element/declaration/typePrefix.js +54 -299
- package/lib/element/declaration/variable.js +74 -328
- package/lib/element/declaration.js +3 -114
- package/lib/element/deduction.js +76 -378
- package/lib/element/derivation.js +31 -340
- package/lib/element/equality.js +152 -347
- package/lib/element/equivalence.js +160 -385
- package/lib/element/equivalences.js +132 -356
- package/lib/element/error.js +16 -290
- package/lib/element/frame.js +210 -418
- package/lib/element/hypothesis.js +56 -354
- package/lib/element/judgement.js +120 -305
- package/lib/element/label.js +62 -236
- package/lib/element/metaType.js +35 -200
- package/lib/element/metavariable.js +249 -459
- package/lib/element/parameter.js +39 -202
- package/lib/element/procedureCall.js +74 -381
- package/lib/element/procedureReference.js +27 -186
- package/lib/element/proof.js +38 -349
- package/lib/element/proofAssertion/premise.js +174 -466
- package/lib/element/proofAssertion/step.js +144 -495
- package/lib/element/proofAssertion/supposition.js +170 -466
- package/lib/element/proofAssertion.js +47 -195
- package/lib/element/property.js +36 -201
- package/lib/element/propertyRelation.js +62 -223
- package/lib/element/reference.js +173 -378
- package/lib/element/rule.js +178 -673
- package/lib/element/section.js +47 -356
- package/lib/element/signature.js +96 -264
- package/lib/element/statement.js +195 -395
- package/lib/element/subDerivation.js +32 -341
- package/lib/element/subproof.js +73 -448
- package/lib/element/substitution/frame.js +114 -257
- package/lib/element/substitution/reference.js +108 -248
- package/lib/element/substitution/statement.js +223 -397
- package/lib/element/substitution/term.js +123 -266
- package/lib/element/substitution.js +97 -296
- package/lib/element/term.js +139 -339
- package/lib/element/topLevelAssertion/axiom.js +153 -459
- package/lib/element/topLevelAssertion/conjecture.js +24 -295
- package/lib/element/topLevelAssertion/lemma.js +22 -289
- package/lib/element/topLevelAssertion/theorem.js +24 -295
- package/lib/element/topLevelAssertion.js +218 -718
- package/lib/element/topLevelMetaAssertion/metaLemma.js +24 -290
- package/lib/element/topLevelMetaAssertion/metatheorem.js +24 -290
- package/lib/element/topLevelMetaAssertion.js +109 -509
- package/lib/element/type.js +198 -435
- package/lib/element/typePrefix.js +27 -186
- package/lib/element/variable.js +119 -308
- package/lib/elements.js +4 -4
- package/lib/index.js +4 -4
- package/lib/main.js +18 -18
- package/lib/messages.js +2 -2
- package/lib/metaTypeNames.js +4 -4
- package/lib/metaTypes.js +10 -10
- package/lib/node/argument.js +15 -109
- package/lib/node/assertion/contained.js +33 -130
- package/lib/node/assertion/defined.js +29 -123
- package/lib/node/assertion/property.js +18 -112
- package/lib/node/assertion/satisfies.js +14 -105
- package/lib/node/assertion/subproof.js +10 -98
- package/lib/node/assertion/type.js +14 -105
- package/lib/node/assertion.js +5 -89
- package/lib/node/assumption.js +12 -103
- package/lib/node/body/axiom.js +5 -89
- package/lib/node/body/conjecture.js +5 -89
- package/lib/node/body/lemma.js +5 -89
- package/lib/node/body/metaLemma.js +5 -89
- package/lib/node/body/metatheorem.js +5 -89
- package/lib/node/body/rule.js +26 -126
- package/lib/node/body/theorem.js +5 -89
- package/lib/node/body.js +15 -109
- package/lib/node/combinator.js +9 -97
- package/lib/node/conclusion.js +12 -103
- package/lib/node/constructor.js +9 -97
- package/lib/node/declaration/combinator.js +10 -98
- package/lib/node/declaration/complexType.js +53 -162
- package/lib/node/declaration/constructor.js +29 -123
- package/lib/node/declaration/metavariable.js +18 -112
- package/lib/node/declaration/property.js +26 -123
- package/lib/node/declaration/simpleType.js +52 -158
- package/lib/node/declaration/typePrefix.js +14 -105
- package/lib/node/declaration/variable.js +33 -130
- package/lib/node/declaration.js +5 -89
- package/lib/node/deduction.js +12 -103
- package/lib/node/derivation.js +12 -125
- package/lib/node/document.js +5 -89
- package/lib/node/equality.js +17 -111
- package/lib/node/equivalence.js +9 -97
- package/lib/node/equivalences.js +5 -89
- package/lib/node/error.js +5 -89
- package/lib/node/frame.js +26 -123
- package/lib/node/header/axiom.js +10 -98
- package/lib/node/header/conjecture.js +5 -89
- package/lib/node/header/lemma.js +5 -89
- package/lib/node/header/metaLemma.js +5 -89
- package/lib/node/header/metatheorem.js +5 -89
- package/lib/node/header/rule.js +5 -89
- package/lib/node/header/theorem.js +5 -89
- package/lib/node/header.js +30 -130
- package/lib/node/hypothesis.js +12 -103
- package/lib/node/judgement.js +15 -109
- package/lib/node/label.js +9 -97
- package/lib/node/labels.js +9 -97
- package/lib/node/metaArgument.js +9 -97
- package/lib/node/metaType.js +16 -104
- package/lib/node/metavariable.js +23 -117
- package/lib/node/parameter.js +32 -123
- package/lib/node/parenthesisedLabel.js +9 -97
- package/lib/node/parenthesisedLabels.js +12 -103
- package/lib/node/placeholder.js +5 -89
- package/lib/node/procedureCall.js +15 -109
- package/lib/node/procedureReference.js +16 -104
- package/lib/node/proof.js +9 -97
- package/lib/node/proofAssertion/premise.js +10 -98
- package/lib/node/proofAssertion/step.js +32 -132
- package/lib/node/proofAssertion/supposition.js +10 -98
- package/lib/node/proofAssertion.js +12 -103
- package/lib/node/property.js +15 -106
- package/lib/node/propertyRelation.js +15 -109
- package/lib/node/qualification.js +12 -103
- package/lib/node/reference.js +9 -97
- package/lib/node/rule.js +26 -129
- package/lib/node/section.js +22 -122
- package/lib/node/signature.js +9 -97
- package/lib/node/statement.js +93 -238
- package/lib/node/subDerivation.js +12 -125
- package/lib/node/subproof.js +18 -115
- package/lib/node/substitution/frame.js +22 -119
- package/lib/node/substitution/reference.js +22 -119
- package/lib/node/substitution/statement.js +42 -151
- package/lib/node/substitution/term.js +22 -119
- package/lib/node/substitution.js +5 -89
- package/lib/node/term.js +51 -160
- package/lib/node/topLevelAssertion/axiom.js +8 -105
- package/lib/node/topLevelAssertion/conjecture.js +8 -105
- package/lib/node/topLevelAssertion/lemma.js +8 -105
- package/lib/node/topLevelAssertion/theorem.js +8 -105
- package/lib/node/topLevelAssertion.js +29 -135
- package/lib/node/topLevelMetaAssertion/metaLemma.js +8 -105
- package/lib/node/topLevelMetaAssertion/metatheorem.js +8 -105
- package/lib/node/topLevelMetaAssertion.js +25 -128
- package/lib/node/type.js +43 -140
- package/lib/node/typePrefix.js +16 -104
- package/lib/node/types.js +9 -97
- package/lib/node/variable.js +16 -104
- package/lib/nominal/lexer.js +3 -68
- package/lib/nominal/parser.js +7 -85
- package/lib/nonTerminalNodeMap.js +171 -101
- package/lib/options.js +6 -6
- package/lib/preamble.js +62 -62
- package/lib/prepare.js +4 -4
- package/lib/process/assign.js +20 -20
- package/lib/process/equate.js +39 -117
- package/lib/process/instantiate.js +10 -9
- package/lib/process/unify.js +199 -325
- package/lib/process/validate.js +87 -195
- package/lib/process/verify.js +263 -786
- package/lib/ruleNames.js +84 -84
- package/lib/tokenTypes.js +3 -3
- package/lib/utilities/bnf.js +7 -7
- package/lib/utilities/brackets.js +18 -18
- package/lib/utilities/clock.js +8 -8
- package/lib/utilities/context.js +23 -191
- package/lib/utilities/element.js +276 -276
- package/lib/utilities/equivalence.js +7 -7
- package/lib/utilities/fileContext.js +9 -9
- package/lib/utilities/instance.js +14 -14
- package/lib/utilities/json.js +211 -211
- package/lib/utilities/releaseContext.js +19 -147
- package/lib/utilities/statement.js +10 -10
- package/lib/utilities/string.js +47 -47
- package/lib/utilities/substitutions.js +19 -19
- package/lib/utilities/type.js +5 -5
- package/lib/utilities/unification.js +196 -426
- package/lib/utilities/validation.js +72 -72
- package/package.json +1 -1
package/lib/element/subproof.js
CHANGED
|
@@ -8,466 +8,91 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
21
|
-
}
|
|
22
|
-
function _assert_this_initialized(self) {
|
|
23
|
-
if (self === void 0) {
|
|
24
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
11
|
+
const _occamlanguages = require("occam-languages");
|
|
12
|
+
const _elements = require("../elements");
|
|
13
|
+
const _context = require("../utilities/context");
|
|
14
|
+
const { asyncEvery } = _occamlanguages.asynchronousUtilities;
|
|
15
|
+
const _default = (0, _elements.define)(class Subproof extends _occamlanguages.Element {
|
|
16
|
+
constructor(context, string, node, suppositions, subDerivation){
|
|
17
|
+
super(context, string, node);
|
|
18
|
+
this.suppositions = suppositions;
|
|
19
|
+
this.subDerivation = subDerivation;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
29
|
-
try {
|
|
30
|
-
var info = gen[key](arg);
|
|
31
|
-
var value = info.value;
|
|
32
|
-
} catch (error) {
|
|
33
|
-
reject(error);
|
|
34
|
-
return;
|
|
21
|
+
getSuppositions() {
|
|
22
|
+
return this.suppositions;
|
|
35
23
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} else {
|
|
39
|
-
Promise.resolve(value).then(_next, _throw);
|
|
24
|
+
getSubDerivation() {
|
|
25
|
+
return this.subDerivation;
|
|
40
26
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var self = this, args = arguments;
|
|
45
|
-
return new Promise(function(resolve, reject) {
|
|
46
|
-
var gen = fn.apply(self, args);
|
|
47
|
-
function _next(value) {
|
|
48
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
49
|
-
}
|
|
50
|
-
function _throw(err) {
|
|
51
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
52
|
-
}
|
|
53
|
-
_next(undefined);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function _call_super(_this, derived, args) {
|
|
58
|
-
derived = _get_prototype_of(derived);
|
|
59
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
60
|
-
}
|
|
61
|
-
function _class_call_check(instance, Constructor) {
|
|
62
|
-
if (!(instance instanceof Constructor)) {
|
|
63
|
-
throw new TypeError("Cannot call a class as a function");
|
|
27
|
+
getSubproofNode() {
|
|
28
|
+
const node = this.getNode(), subproofNode = node; ///
|
|
29
|
+
return subproofNode;
|
|
64
30
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (_is_native_reflect_construct()) {
|
|
68
|
-
_construct = Reflect.construct;
|
|
69
|
-
} else {
|
|
70
|
-
_construct = function construct(Parent, args, Class) {
|
|
71
|
-
var a = [
|
|
72
|
-
null
|
|
73
|
-
];
|
|
74
|
-
a.push.apply(a, args);
|
|
75
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
76
|
-
var instance = new Constructor();
|
|
77
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
78
|
-
return instance;
|
|
79
|
-
};
|
|
31
|
+
getLastProofAssertion() {
|
|
32
|
+
return this.subDerivation.getLastProofAssertion();
|
|
80
33
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
34
|
+
getStatements() {
|
|
35
|
+
const lastProofAssertion = this.getLastProofAssertion(), suppositionStatements = this.suppositions.map((supposition)=>{
|
|
36
|
+
const suppositionStatement = supposition.getStatement();
|
|
37
|
+
return suppositionStatement;
|
|
38
|
+
}), lastProofAssertionStatement = lastProofAssertion.getStatement(), statements = [
|
|
39
|
+
...suppositionStatements,
|
|
40
|
+
lastProofAssertionStatement
|
|
41
|
+
];
|
|
42
|
+
return statements;
|
|
90
43
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
95
|
-
return Constructor;
|
|
96
|
-
}
|
|
97
|
-
function _define_property(obj, key, value) {
|
|
98
|
-
if (key in obj) {
|
|
99
|
-
Object.defineProperty(obj, key, {
|
|
100
|
-
value: value,
|
|
101
|
-
enumerable: true,
|
|
102
|
-
configurable: true,
|
|
103
|
-
writable: true
|
|
104
|
-
});
|
|
105
|
-
} else {
|
|
106
|
-
obj[key] = value;
|
|
44
|
+
isProofAssertion() {
|
|
45
|
+
const proofAssertion = false;
|
|
46
|
+
return proofAssertion;
|
|
107
47
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
112
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
113
|
-
};
|
|
114
|
-
return _get_prototype_of(o);
|
|
115
|
-
}
|
|
116
|
-
function _inherits(subClass, superClass) {
|
|
117
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
118
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
119
|
-
}
|
|
120
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
121
|
-
constructor: {
|
|
122
|
-
value: subClass,
|
|
123
|
-
writable: true,
|
|
124
|
-
configurable: true
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
128
|
-
}
|
|
129
|
-
function _is_native_function(fn) {
|
|
130
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
131
|
-
}
|
|
132
|
-
function _iterable_to_array(iter) {
|
|
133
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
134
|
-
}
|
|
135
|
-
function _non_iterable_spread() {
|
|
136
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
137
|
-
}
|
|
138
|
-
function _possible_constructor_return(self, call) {
|
|
139
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
140
|
-
return call;
|
|
48
|
+
compareStatement(statement, context) {
|
|
49
|
+
const statementUnifies = false;
|
|
50
|
+
return statementUnifies;
|
|
141
51
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (!o) return;
|
|
160
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
161
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
162
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
163
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
164
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
165
|
-
}
|
|
166
|
-
function _wrap_native_super(Class) {
|
|
167
|
-
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
168
|
-
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
169
|
-
if (Class === null || !_is_native_function(Class)) return Class;
|
|
170
|
-
if (typeof Class !== "function") {
|
|
171
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
172
|
-
}
|
|
173
|
-
if (typeof _cache !== "undefined") {
|
|
174
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
175
|
-
_cache.set(Class, Wrapper);
|
|
176
|
-
}
|
|
177
|
-
function Wrapper() {
|
|
178
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
179
|
-
}
|
|
180
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
181
|
-
constructor: {
|
|
182
|
-
value: Wrapper,
|
|
183
|
-
enumerable: false,
|
|
184
|
-
writable: true,
|
|
185
|
-
configurable: true
|
|
52
|
+
async verify(context) {
|
|
53
|
+
let verifies = false;
|
|
54
|
+
await (0, _context.asyncScope)(async ()=>{
|
|
55
|
+
const suppositionsVerify = await asyncEvery(this.suppositions, async (supposition)=>{
|
|
56
|
+
const suppositionVerifies = await supposition.verify(context);
|
|
57
|
+
if (suppositionVerifies) {
|
|
58
|
+
const subproofOrProofAssertion = supposition; ////
|
|
59
|
+
context.assignAssignments(context);
|
|
60
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (suppositionsVerify) {
|
|
65
|
+
const subDerivationVerifies = await this.subDerivation.verify(context);
|
|
66
|
+
if (subDerivationVerifies) {
|
|
67
|
+
verifies = true;
|
|
68
|
+
}
|
|
186
69
|
}
|
|
187
|
-
});
|
|
188
|
-
return
|
|
189
|
-
};
|
|
190
|
-
return _wrap_native_super(Class);
|
|
191
|
-
}
|
|
192
|
-
function _is_native_reflect_construct() {
|
|
193
|
-
try {
|
|
194
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
195
|
-
} catch (_) {}
|
|
196
|
-
return (_is_native_reflect_construct = function() {
|
|
197
|
-
return !!result;
|
|
198
|
-
})();
|
|
199
|
-
}
|
|
200
|
-
function _ts_generator(thisArg, body) {
|
|
201
|
-
var f, y, t, _ = {
|
|
202
|
-
label: 0,
|
|
203
|
-
sent: function() {
|
|
204
|
-
if (t[0] & 1) throw t[1];
|
|
205
|
-
return t[1];
|
|
206
|
-
},
|
|
207
|
-
trys: [],
|
|
208
|
-
ops: []
|
|
209
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
210
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
211
|
-
return this;
|
|
212
|
-
}), g;
|
|
213
|
-
function verb(n) {
|
|
214
|
-
return function(v) {
|
|
215
|
-
return step([
|
|
216
|
-
n,
|
|
217
|
-
v
|
|
218
|
-
]);
|
|
219
|
-
};
|
|
70
|
+
}, context);
|
|
71
|
+
return verifies;
|
|
220
72
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
case 4:
|
|
235
|
-
_.label++;
|
|
236
|
-
return {
|
|
237
|
-
value: op[1],
|
|
238
|
-
done: false
|
|
239
|
-
};
|
|
240
|
-
case 5:
|
|
241
|
-
_.label++;
|
|
242
|
-
y = op[1];
|
|
243
|
-
op = [
|
|
244
|
-
0
|
|
245
|
-
];
|
|
246
|
-
continue;
|
|
247
|
-
case 7:
|
|
248
|
-
op = _.ops.pop();
|
|
249
|
-
_.trys.pop();
|
|
250
|
-
continue;
|
|
251
|
-
default:
|
|
252
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
253
|
-
_ = 0;
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
257
|
-
_.label = op[1];
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
261
|
-
_.label = t[1];
|
|
262
|
-
t = op;
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
if (t && _.label < t[2]) {
|
|
266
|
-
_.label = t[2];
|
|
267
|
-
_.ops.push(op);
|
|
268
|
-
break;
|
|
73
|
+
unifyWithSatisfiesAssertion(satisfiesAssertion, context) {
|
|
74
|
+
let unifiesWithSatisfiesAssertion = false;
|
|
75
|
+
const subproofString = this.getString(), satisfiesAssertionString = satisfiesAssertion.getString();
|
|
76
|
+
context.trace(`Unifying the '${subproofString}' subproof with the '${satisfiesAssertionString}' satisfies assertion...`);
|
|
77
|
+
const reference = satisfiesAssertion.getReference(), axiom = context.findAxiomByReference(reference);
|
|
78
|
+
if (axiom !== null) {
|
|
79
|
+
const axiomSatisfiable = axiom.isSatisfiable();
|
|
80
|
+
if (axiomSatisfiable) {
|
|
81
|
+
const subproof = this, substitutions = [], statementUnifies = axiom.unifySubproof(subproof, substitutions, context);
|
|
82
|
+
if (statementUnifies) {
|
|
83
|
+
const substitutionsCompare = satisfiesAssertion.compareSubstitutions(substitutions, context);
|
|
84
|
+
if (substitutionsCompare) {
|
|
85
|
+
unifiesWithSatisfiesAssertion = true;
|
|
269
86
|
}
|
|
270
|
-
if (t[2]) _.ops.pop();
|
|
271
|
-
_.trys.pop();
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
op = body.call(thisArg, _);
|
|
275
|
-
} catch (e) {
|
|
276
|
-
op = [
|
|
277
|
-
6,
|
|
278
|
-
e
|
|
279
|
-
];
|
|
280
|
-
y = 0;
|
|
281
|
-
} finally{
|
|
282
|
-
f = t = 0;
|
|
283
|
-
}
|
|
284
|
-
if (op[0] & 5) throw op[1];
|
|
285
|
-
return {
|
|
286
|
-
value: op[0] ? op[1] : void 0,
|
|
287
|
-
done: true
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
var _Subproof;
|
|
292
|
-
var asyncEvery = _occamlanguages.asynchronousUtilities.asyncEvery;
|
|
293
|
-
var _default = (0, _elements.define)((_Subproof = /*#__PURE__*/ function(Element) {
|
|
294
|
-
_inherits(Subproof, Element);
|
|
295
|
-
function Subproof(context, string, node, suppositions, subDerivation) {
|
|
296
|
-
_class_call_check(this, Subproof);
|
|
297
|
-
var _this;
|
|
298
|
-
_this = _call_super(this, Subproof, [
|
|
299
|
-
context,
|
|
300
|
-
string,
|
|
301
|
-
node
|
|
302
|
-
]);
|
|
303
|
-
_this.suppositions = suppositions;
|
|
304
|
-
_this.subDerivation = subDerivation;
|
|
305
|
-
return _this;
|
|
306
|
-
}
|
|
307
|
-
_create_class(Subproof, [
|
|
308
|
-
{
|
|
309
|
-
key: "getSuppositions",
|
|
310
|
-
value: function getSuppositions() {
|
|
311
|
-
return this.suppositions;
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
key: "getSubDerivation",
|
|
316
|
-
value: function getSubDerivation() {
|
|
317
|
-
return this.subDerivation;
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
key: "getSubproofNode",
|
|
322
|
-
value: function getSubproofNode() {
|
|
323
|
-
var node = this.getNode(), subproofNode = node; ///
|
|
324
|
-
return subproofNode;
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
key: "getLastProofAssertion",
|
|
329
|
-
value: function getLastProofAssertion() {
|
|
330
|
-
return this.subDerivation.getLastProofAssertion();
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
key: "getStatements",
|
|
335
|
-
value: function getStatements() {
|
|
336
|
-
var lastProofAssertion = this.getLastProofAssertion(), suppositionStatements = this.suppositions.map(function(supposition) {
|
|
337
|
-
var suppositionStatement = supposition.getStatement();
|
|
338
|
-
return suppositionStatement;
|
|
339
|
-
}), lastProofAssertionStatement = lastProofAssertion.getStatement(), statements = _to_consumable_array(suppositionStatements).concat([
|
|
340
|
-
lastProofAssertionStatement
|
|
341
|
-
]);
|
|
342
|
-
return statements;
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
key: "isProofAssertion",
|
|
347
|
-
value: function isProofAssertion() {
|
|
348
|
-
var proofAssertion = false;
|
|
349
|
-
return proofAssertion;
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
key: "compareStatement",
|
|
354
|
-
value: function compareStatement(statement, context) {
|
|
355
|
-
var statementUnifies = false;
|
|
356
|
-
return statementUnifies;
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
key: "verify",
|
|
361
|
-
value: function verify(context) {
|
|
362
|
-
return _async_to_generator(function() {
|
|
363
|
-
var _this, verifies;
|
|
364
|
-
return _ts_generator(this, function(_state) {
|
|
365
|
-
switch(_state.label){
|
|
366
|
-
case 0:
|
|
367
|
-
_this = this;
|
|
368
|
-
verifies = false;
|
|
369
|
-
return [
|
|
370
|
-
4,
|
|
371
|
-
(0, _context.asyncScope)(function() {
|
|
372
|
-
return _async_to_generator(function() {
|
|
373
|
-
var suppositionsVerify, subDerivationVerifies;
|
|
374
|
-
return _ts_generator(this, function(_state) {
|
|
375
|
-
switch(_state.label){
|
|
376
|
-
case 0:
|
|
377
|
-
return [
|
|
378
|
-
4,
|
|
379
|
-
asyncEvery(this.suppositions, function(supposition) {
|
|
380
|
-
return _async_to_generator(function() {
|
|
381
|
-
var suppositionVerifies, subproofOrProofAssertion;
|
|
382
|
-
return _ts_generator(this, function(_state) {
|
|
383
|
-
switch(_state.label){
|
|
384
|
-
case 0:
|
|
385
|
-
return [
|
|
386
|
-
4,
|
|
387
|
-
supposition.verify(context)
|
|
388
|
-
];
|
|
389
|
-
case 1:
|
|
390
|
-
suppositionVerifies = _state.sent();
|
|
391
|
-
if (suppositionVerifies) {
|
|
392
|
-
subproofOrProofAssertion = supposition; ////
|
|
393
|
-
context.assignAssignments(context);
|
|
394
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
395
|
-
return [
|
|
396
|
-
2,
|
|
397
|
-
true
|
|
398
|
-
];
|
|
399
|
-
}
|
|
400
|
-
return [
|
|
401
|
-
2
|
|
402
|
-
];
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
})();
|
|
406
|
-
})
|
|
407
|
-
];
|
|
408
|
-
case 1:
|
|
409
|
-
suppositionsVerify = _state.sent();
|
|
410
|
-
if (!suppositionsVerify) return [
|
|
411
|
-
3,
|
|
412
|
-
3
|
|
413
|
-
];
|
|
414
|
-
return [
|
|
415
|
-
4,
|
|
416
|
-
this.subDerivation.verify(context)
|
|
417
|
-
];
|
|
418
|
-
case 2:
|
|
419
|
-
subDerivationVerifies = _state.sent();
|
|
420
|
-
if (subDerivationVerifies) {
|
|
421
|
-
verifies = true;
|
|
422
|
-
}
|
|
423
|
-
_state.label = 3;
|
|
424
|
-
case 3:
|
|
425
|
-
return [
|
|
426
|
-
2
|
|
427
|
-
];
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
}).call(_this);
|
|
431
|
-
}, context)
|
|
432
|
-
];
|
|
433
|
-
case 1:
|
|
434
|
-
_state.sent();
|
|
435
|
-
return [
|
|
436
|
-
2,
|
|
437
|
-
verifies
|
|
438
|
-
];
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
}).call(this);
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
key: "unifyWithSatisfiesAssertion",
|
|
446
|
-
value: function unifyWithSatisfiesAssertion(satisfiesAssertion, context) {
|
|
447
|
-
var unifiesWithSatisfiesAssertion = false;
|
|
448
|
-
var subproofString = this.getString(), satisfiesAssertionString = satisfiesAssertion.getString();
|
|
449
|
-
context.trace("Unifying the '".concat(subproofString, "' subproof with the '").concat(satisfiesAssertionString, "' satisfies assertion..."));
|
|
450
|
-
var reference = satisfiesAssertion.getReference(), axiom = context.findAxiomByReference(reference);
|
|
451
|
-
if (axiom !== null) {
|
|
452
|
-
var axiomSatisfiable = axiom.isSatisfiable();
|
|
453
|
-
if (axiomSatisfiable) {
|
|
454
|
-
var subproof = this, substitutions = [], statementUnifies = axiom.unifySubproof(subproof, substitutions, context);
|
|
455
|
-
if (statementUnifies) {
|
|
456
|
-
var substitutionsCompare = satisfiesAssertion.compareSubstitutions(substitutions, context);
|
|
457
|
-
if (substitutionsCompare) {
|
|
458
|
-
unifiesWithSatisfiesAssertion = true;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
if (unifiesWithSatisfiesAssertion) {
|
|
464
|
-
context.debug("...unified the '".concat(subproofString, "' subproof with the '").concat(satisfiesAssertionString, "' satisfies assertion."));
|
|
465
87
|
}
|
|
466
|
-
return unifiesWithSatisfiesAssertion;
|
|
467
88
|
}
|
|
468
89
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
90
|
+
if (unifiesWithSatisfiesAssertion) {
|
|
91
|
+
context.debug(`...unified the '${subproofString}' subproof with the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
92
|
+
}
|
|
93
|
+
return unifiesWithSatisfiesAssertion;
|
|
94
|
+
}
|
|
95
|
+
static name = "Subproof";
|
|
96
|
+
});
|
|
472
97
|
|
|
473
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb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