occam-verify-cli 1.0.301 → 1.0.302

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.
Files changed (41) hide show
  1. package/lib/context/file.js +25 -33
  2. package/lib/dom/assertion/property.js +4 -4
  3. package/lib/dom/conclusion.js +3 -3
  4. package/lib/dom/declaration.js +98 -35
  5. package/lib/dom/deduction.js +3 -3
  6. package/lib/dom/frame.js +34 -73
  7. package/lib/dom/metavariable.js +1 -70
  8. package/lib/dom/premise.js +5 -5
  9. package/lib/dom/procedureCall.js +3 -3
  10. package/lib/dom/statement.js +12 -9
  11. package/lib/dom/supposition.js +5 -5
  12. package/lib/index.js +1 -2
  13. package/lib/node/declaration.js +8 -1
  14. package/lib/node/statement.js +1 -8
  15. package/lib/nonTerminalNodeMap.js +2 -3
  16. package/lib/ruleNames.js +1 -5
  17. package/lib/unifier/metaLevel.js +4 -4
  18. package/package.json +1 -1
  19. package/src/context/file.js +25 -33
  20. package/src/dom/assertion/property.js +3 -3
  21. package/src/dom/conclusion.js +2 -2
  22. package/src/dom/declaration.js +111 -42
  23. package/src/dom/deduction.js +2 -2
  24. package/src/dom/frame.js +36 -92
  25. package/src/dom/metavariable.js +0 -103
  26. package/src/dom/premise.js +4 -4
  27. package/src/dom/procedureCall.js +2 -2
  28. package/src/dom/statement.js +12 -8
  29. package/src/dom/supposition.js +4 -4
  30. package/src/index.js +0 -1
  31. package/src/node/declaration.js +7 -0
  32. package/src/node/statement.js +0 -8
  33. package/src/nonTerminalNodeMap.js +0 -3
  34. package/src/ruleNames.js +0 -1
  35. package/src/unifier/metaLevel.js +3 -3
  36. package/lib/context/partial/substitution/reference.js +0 -158
  37. package/lib/dom/substitution/reference.js +0 -203
  38. package/lib/node/substitution/reference.js +0 -123
  39. package/src/context/partial/substitution/reference.js +0 -18
  40. package/src/dom/substitution/reference.js +0 -75
  41. package/src/node/substitution/reference.js +0 -23
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return ReferenceSubstitutionNode;
9
- }
10
- });
11
- var _nonTerminal = /*#__PURE__*/ _interop_require_default(require("../../node/nonTerminal"));
12
- var _ruleNames = require("../../ruleNames");
13
- function _assert_this_initialized(self) {
14
- if (self === void 0) {
15
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16
- }
17
- return self;
18
- }
19
- function _call_super(_this, derived, args) {
20
- derived = _get_prototype_of(derived);
21
- return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
22
- }
23
- function _class_call_check(instance, Constructor) {
24
- if (!(instance instanceof Constructor)) {
25
- throw new TypeError("Cannot call a class as a function");
26
- }
27
- }
28
- function _defineProperties(target, props) {
29
- for(var i = 0; i < props.length; i++){
30
- var descriptor = props[i];
31
- descriptor.enumerable = descriptor.enumerable || false;
32
- descriptor.configurable = true;
33
- if ("value" in descriptor) descriptor.writable = true;
34
- Object.defineProperty(target, descriptor.key, descriptor);
35
- }
36
- }
37
- function _create_class(Constructor, protoProps, staticProps) {
38
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
39
- if (staticProps) _defineProperties(Constructor, staticProps);
40
- return Constructor;
41
- }
42
- function _get_prototype_of(o) {
43
- _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
44
- return o.__proto__ || Object.getPrototypeOf(o);
45
- };
46
- return _get_prototype_of(o);
47
- }
48
- function _inherits(subClass, superClass) {
49
- if (typeof superClass !== "function" && superClass !== null) {
50
- throw new TypeError("Super expression must either be null or a function");
51
- }
52
- subClass.prototype = Object.create(superClass && superClass.prototype, {
53
- constructor: {
54
- value: subClass,
55
- writable: true,
56
- configurable: true
57
- }
58
- });
59
- if (superClass) _set_prototype_of(subClass, superClass);
60
- }
61
- function _interop_require_default(obj) {
62
- return obj && obj.__esModule ? obj : {
63
- default: obj
64
- };
65
- }
66
- function _possible_constructor_return(self, call) {
67
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
68
- return call;
69
- }
70
- return _assert_this_initialized(self);
71
- }
72
- function _set_prototype_of(o, p) {
73
- _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
74
- o.__proto__ = p;
75
- return o;
76
- };
77
- return _set_prototype_of(o, p);
78
- }
79
- function _type_of(obj) {
80
- "@swc/helpers - typeof";
81
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
82
- }
83
- function _is_native_reflect_construct() {
84
- try {
85
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
86
- } catch (_) {}
87
- return (_is_native_reflect_construct = function() {
88
- return !!result;
89
- })();
90
- }
91
- var ReferenceSubstitutionNode = /*#__PURE__*/ function(NonTerminalNode) {
92
- _inherits(ReferenceSubstitutionNode, NonTerminalNode);
93
- function ReferenceSubstitutionNode() {
94
- _class_call_check(this, ReferenceSubstitutionNode);
95
- return _call_super(this, ReferenceSubstitutionNode, arguments);
96
- }
97
- _create_class(ReferenceSubstitutionNode, [
98
- {
99
- key: "getLastReferenceNode",
100
- value: function getLastReferenceNode() {
101
- var ruleName = _ruleNames.REFERENCE_RULE_NAME, lastReferenceNode = this.getLastNodeByRuleName(ruleName);
102
- return lastReferenceNode;
103
- }
104
- },
105
- {
106
- key: "getFirstReferenceNode",
107
- value: function getFirstReferenceNode() {
108
- var ruleName = _ruleNames.REFERENCE_RULE_NAME, firstReferenceNode = this.getFirstNodeByRuleName(ruleName);
109
- return firstReferenceNode;
110
- }
111
- }
112
- ], [
113
- {
114
- key: "fromRuleNameChildNodesOpacityAndPrecedence",
115
- value: function fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) {
116
- return _nonTerminal.default.fromRuleNameChildNodesOpacityAndPrecedence(ReferenceSubstitutionNode, ruleName, childNodes, opacity, precedence);
117
- }
118
- }
119
- ]);
120
- return ReferenceSubstitutionNode;
121
- }(_nonTerminal.default);
122
-
123
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ub2RlL3N1YnN0aXR1dGlvbi9yZWZlcmVuY2UuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCBOb25UZXJtaW5hbE5vZGUgZnJvbSBcIi4uLy4uL25vZGUvbm9uVGVybWluYWxcIjtcblxuaW1wb3J0IHsgUkVGRVJFTkNFX1JVTEVfTkFNRSB9IGZyb20gXCIuLi8uLi9ydWxlTmFtZXNcIjtcblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgUmVmZXJlbmNlU3Vic3RpdHV0aW9uTm9kZSBleHRlbmRzIE5vblRlcm1pbmFsTm9kZSB7XG4gIGdldExhc3RSZWZlcmVuY2VOb2RlKCkge1xuICAgIGNvbnN0IHJ1bGVOYW1lID0gUkVGRVJFTkNFX1JVTEVfTkFNRSxcbiAgICAgICAgICBsYXN0UmVmZXJlbmNlTm9kZSA9IHRoaXMuZ2V0TGFzdE5vZGVCeVJ1bGVOYW1lKHJ1bGVOYW1lKTtcblxuICAgIHJldHVybiBsYXN0UmVmZXJlbmNlTm9kZTtcbiAgfVxuXG4gIGdldEZpcnN0UmVmZXJlbmNlTm9kZSgpIHtcbiAgICBjb25zdCBydWxlTmFtZSA9IFJFRkVSRU5DRV9SVUxFX05BTUUsXG4gICAgICAgICAgZmlyc3RSZWZlcmVuY2VOb2RlID0gdGhpcy5nZXRGaXJzdE5vZGVCeVJ1bGVOYW1lKHJ1bGVOYW1lKTtcblxuICAgIHJldHVybiBmaXJzdFJlZmVyZW5jZU5vZGU7XG4gIH1cblxuICBzdGF0aWMgZnJvbVJ1bGVOYW1lQ2hpbGROb2Rlc09wYWNpdHlBbmRQcmVjZWRlbmNlKHJ1bGVOYW1lLCBj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MscUJBQXFCLENBQUNIO2dCQUVyRCxPQUFPRTtZQUNUOzs7WUFFQUUsS0FBQUE7bUJBQUFBLFNBQUFBO2dCQUNFLElBQU1KLFdBQVdDLDhCQUFtQixFQUM5QkkscUJBQXFCLElBQUksQ0FBQ0Msc0JBQXNCLENBQUNOO2dCQUV2RCxPQUFPSztZQUNUOzs7O1lBRU9FLEtBQUFBO21CQUFQLFNBQU9BLDJDQUEyQ1AsUUFBUSxFQUFFUSxVQUFVLEVBQUVDLE9BQU8sRUFBRUMsVUFBVTtnQkFBSSxPQUFPQyxvQkFBZSxDQUFDSiwwQ0FBMEMsQ0FmN0lULDJCQWV5S0UsVUFBVVEsWUFBWUMsU0FBU0M7WUFBYTs7O1dBZnJOWjtFQUFrQ2Esb0JBQWUifQ==
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- import PartialContext from "../../../context/partial";
4
-
5
- import { ruleFromBNF } from "../../../context/partial";
6
-
7
- const bnf = `
8
-
9
- _ ::= referenceSubstitution... <END_OF_LINE> ;
10
-
11
- `,
12
- rule = ruleFromBNF(bnf);
13
-
14
- export default class ReferenceSubstitutionPartialContext extends PartialContext {
15
- static rule = rule;
16
-
17
- static fromStringLexerAndParser(string, lexer, parser) { return PartialContext.fromStringLexerAndParser(ReferenceSubstitutionPartialContext, string, lexer, parser); }
18
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- import dom from "../../dom";
4
- import Substitution from "../substitution";
5
- import ReferenceSubstitutionPartialContext from "../../context/partial/substitution/reference";
6
-
7
- import { domAssigned } from "../../dom";
8
-
9
- export default domAssigned(class ReferenceSubstitution extends Substitution {
10
- constructor(string, node, tokens, reference, metavariable) {
11
- super(string, node, tokens);
12
-
13
- this.reference = reference;
14
- this.metavariable = metavariable;
15
- }
16
-
17
- getReference() {
18
- return this.reference;
19
- }
20
-
21
- getMetavariable() {
22
- return this.metavariable;
23
- }
24
-
25
- isReferenceEqualTo(reference) { return this.reference.isEqualTo(reference); }
26
-
27
- isMetavariableEqualTo(metavariable) { return this.metavariable.isEqualTo(metavariable); }
28
-
29
- static fromStatementNode(statementNode, context) {
30
- let referenceSubstitution = null;
31
-
32
- const referenceSubstitutionNode = statementNode.getReferenceSubstitutionNode();
33
-
34
- if (referenceSubstitutionNode !== null) {
35
- const lastReferenceNode = referenceSubstitutionNode.getLastReferenceNode(),
36
- firstReferenceNode = referenceSubstitutionNode.getFirstReferenceNode(),
37
- singularMetavariableNode = lastReferenceNode.getSingularMetavariableNode();
38
-
39
- if (singularMetavariableNode !== null) {
40
- const { Reference, Metavariable } = dom,
41
- referenceNode = firstReferenceNode, ///
42
- metavariableNode = singularMetavariableNode, ///
43
- reference = Reference.fromReferenceNode(referenceNode, context),
44
- metavariable = Metavariable.fromMetavariableNode(metavariableNode, context),
45
- node = referenceSubstitutionNode, ///
46
- tokens = context.nodeAsTokens(node),
47
- string = stringFromReferenceAndMetavariable(reference, metavariable);
48
-
49
- referenceSubstitution = new ReferenceSubstitution(string, node, tokens, reference, metavariable);
50
- }
51
- }
52
-
53
- return referenceSubstitution;
54
- }
55
-
56
- static fromReferenceAndMetavariable(reference, metavariable, context) {
57
- const string = stringFromReferenceAndMetavariable(reference, metavariable),
58
- lexer = context.getLexer(),
59
- parser = context.getParser(),
60
- referenceSubstitutionPartialContext = ReferenceSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
61
- node = referenceSubstitutionPartialContext.getNode(),
62
- tokens = referenceSubstitutionPartialContext.getTokens(),
63
- referenceSubstitution = new ReferenceSubstitution(string, node, tokens, reference, metavariable);
64
-
65
- return referenceSubstitution;
66
- }
67
- });
68
-
69
- function stringFromReferenceAndMetavariable(reference, metavariable) {
70
- const referenceString = reference.getString(),
71
- metavariableString = metavariable.getString(),
72
- string = `[${referenceString} for ${metavariableString}]`;
73
-
74
- return string;
75
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- import NonTerminalNode from "../../node/nonTerminal";
4
-
5
- import { REFERENCE_RULE_NAME } from "../../ruleNames";
6
-
7
- export default class ReferenceSubstitutionNode extends NonTerminalNode {
8
- getLastReferenceNode() {
9
- const ruleName = REFERENCE_RULE_NAME,
10
- lastReferenceNode = this.getLastNodeByRuleName(ruleName);
11
-
12
- return lastReferenceNode;
13
- }
14
-
15
- getFirstReferenceNode() {
16
- const ruleName = REFERENCE_RULE_NAME,
17
- firstReferenceNode = this.getFirstNodeByRuleName(ruleName);
18
-
19
- return firstReferenceNode;
20
- }
21
-
22
- static fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) { return NonTerminalNode.fromRuleNameChildNodesOpacityAndPrecedence(ReferenceSubstitutionNode, ruleName, childNodes, opacity, precedence); }
23
- }