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
|
@@ -8,369 +8,71 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const _occamlanguages = require("occam-languages");
|
|
12
|
+
const _elements = require("../elements");
|
|
13
|
+
const _json = require("../utilities/json");
|
|
14
|
+
const _default = (0, _elements.define)(class Hypothesis extends _occamlanguages.Element {
|
|
15
|
+
constructor(context, string, node, statement){
|
|
16
|
+
super(context, string, node);
|
|
17
|
+
this.statement = statement;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
21
|
-
try {
|
|
22
|
-
var info = gen[key](arg);
|
|
23
|
-
var value = info.value;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
reject(error);
|
|
26
|
-
return;
|
|
19
|
+
getStatement() {
|
|
20
|
+
return this.statement;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Promise.resolve(value).then(_next, _throw);
|
|
22
|
+
getHypothesisNode() {
|
|
23
|
+
const node = this.getNode(), hypothesisNode = node; ///
|
|
24
|
+
return hypothesisNode;
|
|
32
25
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
41
|
-
}
|
|
42
|
-
function _throw(err) {
|
|
43
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
44
|
-
}
|
|
45
|
-
_next(undefined);
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function _call_super(_this, derived, args) {
|
|
50
|
-
derived = _get_prototype_of(derived);
|
|
51
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
52
|
-
}
|
|
53
|
-
function _class_call_check(instance, Constructor) {
|
|
54
|
-
if (!(instance instanceof Constructor)) {
|
|
55
|
-
throw new TypeError("Cannot call a class as a function");
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function _construct(Parent, args, Class) {
|
|
59
|
-
if (_is_native_reflect_construct()) {
|
|
60
|
-
_construct = Reflect.construct;
|
|
61
|
-
} else {
|
|
62
|
-
_construct = function construct(Parent, args, Class) {
|
|
63
|
-
var a = [
|
|
64
|
-
null
|
|
65
|
-
];
|
|
66
|
-
a.push.apply(a, args);
|
|
67
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
68
|
-
var instance = new Constructor();
|
|
69
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
70
|
-
return instance;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
return _construct.apply(null, arguments);
|
|
74
|
-
}
|
|
75
|
-
function _defineProperties(target, props) {
|
|
76
|
-
for(var i = 0; i < props.length; i++){
|
|
77
|
-
var descriptor = props[i];
|
|
78
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
79
|
-
descriptor.configurable = true;
|
|
80
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
81
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
85
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
86
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
87
|
-
return Constructor;
|
|
88
|
-
}
|
|
89
|
-
function _define_property(obj, key, value) {
|
|
90
|
-
if (key in obj) {
|
|
91
|
-
Object.defineProperty(obj, key, {
|
|
92
|
-
value: value,
|
|
93
|
-
enumerable: true,
|
|
94
|
-
configurable: true,
|
|
95
|
-
writable: true
|
|
96
|
-
});
|
|
97
|
-
} else {
|
|
98
|
-
obj[key] = value;
|
|
99
|
-
}
|
|
100
|
-
return obj;
|
|
101
|
-
}
|
|
102
|
-
function _get_prototype_of(o) {
|
|
103
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
104
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
105
|
-
};
|
|
106
|
-
return _get_prototype_of(o);
|
|
107
|
-
}
|
|
108
|
-
function _inherits(subClass, superClass) {
|
|
109
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
110
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
111
|
-
}
|
|
112
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
113
|
-
constructor: {
|
|
114
|
-
value: subClass,
|
|
115
|
-
writable: true,
|
|
116
|
-
configurable: true
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
120
|
-
}
|
|
121
|
-
function _is_native_function(fn) {
|
|
122
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
123
|
-
}
|
|
124
|
-
function _possible_constructor_return(self, call) {
|
|
125
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
126
|
-
return call;
|
|
127
|
-
}
|
|
128
|
-
return _assert_this_initialized(self);
|
|
129
|
-
}
|
|
130
|
-
function _set_prototype_of(o, p) {
|
|
131
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
132
|
-
o.__proto__ = p;
|
|
133
|
-
return o;
|
|
134
|
-
};
|
|
135
|
-
return _set_prototype_of(o, p);
|
|
136
|
-
}
|
|
137
|
-
function _type_of(obj) {
|
|
138
|
-
"@swc/helpers - typeof";
|
|
139
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
140
|
-
}
|
|
141
|
-
function _wrap_native_super(Class) {
|
|
142
|
-
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
143
|
-
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
144
|
-
if (Class === null || !_is_native_function(Class)) return Class;
|
|
145
|
-
if (typeof Class !== "function") {
|
|
146
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
26
|
+
compareProofAssertion(proofAssertion, context) {
|
|
27
|
+
let comparesToProofAssertion = false;
|
|
28
|
+
const hypothesisString = this.getString(), proofAssertionString = proofAssertion.getString();
|
|
29
|
+
context.trace(`Is the '${hypothesisString}' hypothesis equal to the '${proofAssertionString}' proof assertion...`);
|
|
30
|
+
const proofAssertionStatement = proofAssertion.getStatement(), statementEqualToStepStatement = this.statement.isEqualTo(proofAssertionStatement);
|
|
31
|
+
if (statementEqualToStepStatement) {
|
|
32
|
+
comparesToProofAssertion = true;
|
|
147
33
|
}
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
_cache.set(Class, Wrapper);
|
|
34
|
+
if (comparesToProofAssertion) {
|
|
35
|
+
context.trace(`...the '${hypothesisString}' hypothesis is equal to the '${proofAssertionString}' proof assertion.`);
|
|
151
36
|
}
|
|
152
|
-
|
|
153
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
154
|
-
}
|
|
155
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
156
|
-
constructor: {
|
|
157
|
-
value: Wrapper,
|
|
158
|
-
enumerable: false,
|
|
159
|
-
writable: true,
|
|
160
|
-
configurable: true
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
return _set_prototype_of(Wrapper, Class);
|
|
164
|
-
};
|
|
165
|
-
return _wrap_native_super(Class);
|
|
166
|
-
}
|
|
167
|
-
function _is_native_reflect_construct() {
|
|
168
|
-
try {
|
|
169
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
170
|
-
} catch (_) {}
|
|
171
|
-
return (_is_native_reflect_construct = function() {
|
|
172
|
-
return !!result;
|
|
173
|
-
})();
|
|
174
|
-
}
|
|
175
|
-
function _ts_generator(thisArg, body) {
|
|
176
|
-
var f, y, t, _ = {
|
|
177
|
-
label: 0,
|
|
178
|
-
sent: function() {
|
|
179
|
-
if (t[0] & 1) throw t[1];
|
|
180
|
-
return t[1];
|
|
181
|
-
},
|
|
182
|
-
trys: [],
|
|
183
|
-
ops: []
|
|
184
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
185
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
186
|
-
return this;
|
|
187
|
-
}), g;
|
|
188
|
-
function verb(n) {
|
|
189
|
-
return function(v) {
|
|
190
|
-
return step([
|
|
191
|
-
n,
|
|
192
|
-
v
|
|
193
|
-
]);
|
|
194
|
-
};
|
|
37
|
+
return comparesToProofAssertion;
|
|
195
38
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
break;
|
|
209
|
-
case 4:
|
|
210
|
-
_.label++;
|
|
211
|
-
return {
|
|
212
|
-
value: op[1],
|
|
213
|
-
done: false
|
|
214
|
-
};
|
|
215
|
-
case 5:
|
|
216
|
-
_.label++;
|
|
217
|
-
y = op[1];
|
|
218
|
-
op = [
|
|
219
|
-
0
|
|
220
|
-
];
|
|
221
|
-
continue;
|
|
222
|
-
case 7:
|
|
223
|
-
op = _.ops.pop();
|
|
224
|
-
_.trys.pop();
|
|
225
|
-
continue;
|
|
226
|
-
default:
|
|
227
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
228
|
-
_ = 0;
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
232
|
-
_.label = op[1];
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
236
|
-
_.label = t[1];
|
|
237
|
-
t = op;
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
if (t && _.label < t[2]) {
|
|
241
|
-
_.label = t[2];
|
|
242
|
-
_.ops.push(op);
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
if (t[2]) _.ops.pop();
|
|
246
|
-
_.trys.pop();
|
|
247
|
-
continue;
|
|
39
|
+
async verify(context) {
|
|
40
|
+
let verifies = false;
|
|
41
|
+
await this.break(context);
|
|
42
|
+
const hypothesisString = this.getString(); ///
|
|
43
|
+
context.trace(`Verifying the '${hypothesisString}' hypothesis...`);
|
|
44
|
+
if (false) {
|
|
45
|
+
///
|
|
46
|
+
} else if (this.statement !== null) {
|
|
47
|
+
let statementValidates = false;
|
|
48
|
+
const stated = true, statement = this.statement.validate(stated, context);
|
|
49
|
+
if (statement !== null) {
|
|
50
|
+
statementValidates = true;
|
|
248
51
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
52
|
+
if (statementValidates) {
|
|
53
|
+
const subproofOrProofAssertion = this; ///
|
|
54
|
+
context.assignAssignments();
|
|
55
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
56
|
+
verifies = true;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
context.debug(`Unable to verify the '${hypothesisString}' hypothesis because it is nonsense.`);
|
|
60
|
+
}
|
|
61
|
+
if (verifies) {
|
|
62
|
+
context.debug(`...verified the '${hypothesisString}' hypothesis.`);
|
|
258
63
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
64
|
+
return verifies;
|
|
65
|
+
}
|
|
66
|
+
toJSON() {
|
|
67
|
+
const statementJSON = (0, _json.statementToStatementJSON)(this.statement), statement = statementJSON, json = {
|
|
68
|
+
statement
|
|
263
69
|
};
|
|
70
|
+
return json;
|
|
264
71
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
_inherits(Hypothesis, Element);
|
|
269
|
-
function Hypothesis(context, string, node, statement) {
|
|
270
|
-
_class_call_check(this, Hypothesis);
|
|
271
|
-
var _this;
|
|
272
|
-
_this = _call_super(this, Hypothesis, [
|
|
273
|
-
context,
|
|
274
|
-
string,
|
|
275
|
-
node
|
|
276
|
-
]);
|
|
277
|
-
_this.statement = statement;
|
|
278
|
-
return _this;
|
|
72
|
+
static name = "Hypothesis";
|
|
73
|
+
static fromJSON(json, context) {
|
|
74
|
+
debugger;
|
|
279
75
|
}
|
|
280
|
-
|
|
281
|
-
{
|
|
282
|
-
key: "getStatement",
|
|
283
|
-
value: function getStatement() {
|
|
284
|
-
return this.statement;
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
key: "getHypothesisNode",
|
|
289
|
-
value: function getHypothesisNode() {
|
|
290
|
-
var node = this.getNode(), hypothesisNode = node; ///
|
|
291
|
-
return hypothesisNode;
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
key: "compareProofAssertion",
|
|
296
|
-
value: function compareProofAssertion(proofAssertion, context) {
|
|
297
|
-
var comparesToProofAssertion = false;
|
|
298
|
-
var hypothesisString = this.getString(), proofAssertionString = proofAssertion.getString();
|
|
299
|
-
context.trace("Is the '".concat(hypothesisString, "' hypothesis equal to the '").concat(proofAssertionString, "' proof assertion..."));
|
|
300
|
-
var proofAssertionStatement = proofAssertion.getStatement(), statementEqualToStepStatement = this.statement.isEqualTo(proofAssertionStatement);
|
|
301
|
-
if (statementEqualToStepStatement) {
|
|
302
|
-
comparesToProofAssertion = true;
|
|
303
|
-
}
|
|
304
|
-
if (comparesToProofAssertion) {
|
|
305
|
-
context.trace("...the '".concat(hypothesisString, "' hypothesis is equal to the '").concat(proofAssertionString, "' proof assertion."));
|
|
306
|
-
}
|
|
307
|
-
return comparesToProofAssertion;
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
key: "verify",
|
|
312
|
-
value: function verify(context) {
|
|
313
|
-
return _async_to_generator(function() {
|
|
314
|
-
var verifies, hypothesisString, statementValidates, stated, statement, subproofOrProofAssertion;
|
|
315
|
-
return _ts_generator(this, function(_state) {
|
|
316
|
-
switch(_state.label){
|
|
317
|
-
case 0:
|
|
318
|
-
verifies = false;
|
|
319
|
-
return [
|
|
320
|
-
4,
|
|
321
|
-
this.break(context)
|
|
322
|
-
];
|
|
323
|
-
case 1:
|
|
324
|
-
_state.sent();
|
|
325
|
-
hypothesisString = this.getString(); ///
|
|
326
|
-
context.trace("Verifying the '".concat(hypothesisString, "' hypothesis..."));
|
|
327
|
-
if (false) {
|
|
328
|
-
///
|
|
329
|
-
} else if (this.statement !== null) {
|
|
330
|
-
statementValidates = false;
|
|
331
|
-
stated = true, statement = this.statement.validate(stated, context);
|
|
332
|
-
if (statement !== null) {
|
|
333
|
-
statementValidates = true;
|
|
334
|
-
}
|
|
335
|
-
if (statementValidates) {
|
|
336
|
-
subproofOrProofAssertion = this; ///
|
|
337
|
-
context.assignAssignments();
|
|
338
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
339
|
-
verifies = true;
|
|
340
|
-
}
|
|
341
|
-
} else {
|
|
342
|
-
context.debug("Unable to verify the '".concat(hypothesisString, "' hypothesis because it is nonsense."));
|
|
343
|
-
}
|
|
344
|
-
if (verifies) {
|
|
345
|
-
context.debug("...verified the '".concat(hypothesisString, "' hypothesis."));
|
|
346
|
-
}
|
|
347
|
-
return [
|
|
348
|
-
2,
|
|
349
|
-
verifies
|
|
350
|
-
];
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
}).call(this);
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
key: "toJSON",
|
|
358
|
-
value: function toJSON() {
|
|
359
|
-
var statementJSON = (0, _json.statementToStatementJSON)(this.statement), statement = statementJSON, json = {
|
|
360
|
-
statement: statement
|
|
361
|
-
};
|
|
362
|
-
return json;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
], [
|
|
366
|
-
{
|
|
367
|
-
key: "fromJSON",
|
|
368
|
-
value: function fromJSON(json, context) {
|
|
369
|
-
debugger;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
]);
|
|
373
|
-
return Hypothesis;
|
|
374
|
-
}(_wrap_native_super(_occamlanguages.Element)), _define_property(_Hypothesis, "name", "Hypothesis"), _Hypothesis));
|
|
76
|
+
});
|
|
375
77
|
|
|
376
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lbGVtZW50L2h5cG90aGVzaXMuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCB7IEVsZW1lbnQgfSBmcm9tIFwib2NjYW0tbGFuZ3VhZ2VzXCI7XG5cbmltcG9ydCB7IGRlZmluZSB9IGZyb20gXCIuLi9lbGVtZW50c1wiO1xuaW1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