occam-verify-cli 1.0.230 → 1.0.233

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 (109) hide show
  1. package/lib/context/local.js +1 -14
  2. package/lib/dom/axiom.js +22 -16
  3. package/lib/dom/combinator.js +5 -5
  4. package/lib/dom/conclusion.js +5 -5
  5. package/lib/dom/conjecture.js +9 -9
  6. package/lib/dom/constructor.js +5 -5
  7. package/lib/dom/declaration/combinator.js +14 -14
  8. package/lib/dom/declaration/complexType.js +35 -35
  9. package/lib/dom/declaration/constructor.js +19 -19
  10. package/lib/dom/declaration/metavariable.js +22 -22
  11. package/lib/dom/declaration/simpleType.js +23 -23
  12. package/lib/dom/declaration/variable.js +20 -20
  13. package/lib/dom/declaration.js +4 -2
  14. package/lib/dom/deduction.js +5 -5
  15. package/lib/dom/derivation.js +5 -5
  16. package/lib/dom/error.js +9 -9
  17. package/lib/dom/hypothesis.js +260 -0
  18. package/lib/dom/label.js +18 -24
  19. package/lib/dom/lemma.js +7 -7
  20. package/lib/dom/metaLemma.js +9 -9
  21. package/lib/dom/metaType.js +4 -10
  22. package/lib/dom/metatheorem.js +9 -9
  23. package/lib/dom/metavariable.js +7 -8
  24. package/lib/dom/parameter.js +2 -2
  25. package/lib/dom/premise.js +5 -5
  26. package/lib/dom/procedureCall.js +11 -10
  27. package/lib/dom/proof.js +3 -3
  28. package/lib/dom/property.js +9 -9
  29. package/lib/dom/reference.js +23 -22
  30. package/lib/dom/rule.js +25 -25
  31. package/lib/dom/section.js +146 -0
  32. package/lib/dom/signature.js +5 -5
  33. package/lib/dom/statement.js +25 -20
  34. package/lib/dom/step.js +3 -3
  35. package/lib/dom/subDerivation.js +5 -5
  36. package/lib/dom/subproof.js +7 -7
  37. package/lib/dom/substitution/statement.js +3 -3
  38. package/lib/dom/supposition.js +5 -5
  39. package/lib/dom/term.js +5 -6
  40. package/lib/dom/theorem.js +9 -9
  41. package/lib/dom/topLevelAssertion.js +22 -22
  42. package/lib/dom/topLevelMetaAssertion.js +14 -14
  43. package/lib/dom/type.js +21 -21
  44. package/lib/dom/variable.js +9 -15
  45. package/lib/index.js +3 -1
  46. package/lib/node/hypothesis.js +123 -0
  47. package/lib/node/section.js +116 -0
  48. package/lib/nonTerminalNodeMap.js +5 -3
  49. package/lib/ruleNames.js +9 -1
  50. package/lib/utilities/json.js +59 -59
  51. package/lib/utilities/subproof.js +10 -10
  52. package/lib/verifier/combinator.js +9 -10
  53. package/lib/verifier/constructor.js +10 -11
  54. package/lib/verifier/topLevel.js +38 -31
  55. package/package.json +2 -2
  56. package/src/context/local.js +0 -14
  57. package/src/dom/axiom.js +30 -29
  58. package/src/dom/combinator.js +4 -4
  59. package/src/dom/conclusion.js +5 -5
  60. package/src/dom/conjecture.js +8 -8
  61. package/src/dom/constructor.js +4 -4
  62. package/src/dom/declaration/combinator.js +14 -14
  63. package/src/dom/declaration/complexType.js +35 -35
  64. package/src/dom/declaration/constructor.js +20 -20
  65. package/src/dom/declaration/metavariable.js +22 -22
  66. package/src/dom/declaration/simpleType.js +22 -22
  67. package/src/dom/declaration/variable.js +21 -21
  68. package/src/dom/declaration.js +5 -3
  69. package/src/dom/deduction.js +5 -5
  70. package/src/dom/derivation.js +5 -5
  71. package/src/dom/error.js +8 -8
  72. package/src/dom/hypothesis.js +230 -0
  73. package/src/dom/label.js +17 -19
  74. package/src/dom/lemma.js +8 -8
  75. package/src/dom/metaLemma.js +8 -8
  76. package/src/dom/metaType.js +2 -6
  77. package/src/dom/metatheorem.js +8 -8
  78. package/src/dom/metavariable.js +9 -12
  79. package/src/dom/parameter.js +1 -1
  80. package/src/dom/premise.js +8 -8
  81. package/src/dom/procedureCall.js +9 -9
  82. package/src/dom/proof.js +2 -2
  83. package/src/dom/property.js +8 -8
  84. package/src/dom/reference.js +23 -27
  85. package/src/dom/rule.js +30 -30
  86. package/src/dom/section.js +70 -0
  87. package/src/dom/signature.js +4 -4
  88. package/src/dom/statement.js +24 -32
  89. package/src/dom/step.js +4 -4
  90. package/src/dom/subDerivation.js +5 -5
  91. package/src/dom/subproof.js +8 -8
  92. package/src/dom/substitution/statement.js +5 -5
  93. package/src/dom/supposition.js +7 -7
  94. package/src/dom/term.js +3 -8
  95. package/src/dom/theorem.js +7 -7
  96. package/src/dom/topLevelAssertion.js +29 -30
  97. package/src/dom/topLevelMetaAssertion.js +20 -20
  98. package/src/dom/type.js +22 -22
  99. package/src/dom/variable.js +8 -11
  100. package/src/index.js +2 -0
  101. package/src/node/hypothesis.js +23 -0
  102. package/src/node/section.js +16 -0
  103. package/src/nonTerminalNodeMap.js +7 -1
  104. package/src/ruleNames.js +2 -0
  105. package/src/utilities/json.js +58 -58
  106. package/src/utilities/subproof.js +10 -10
  107. package/src/verifier/combinator.js +6 -11
  108. package/src/verifier/constructor.js +9 -12
  109. package/src/verifier/topLevel.js +42 -30
@@ -9,6 +9,7 @@ const errorNodeQuery = nodeQuery("/error"),
9
9
  ruleNodeQuery = nodeQuery("/rule"),
10
10
  axiomNodeQuery = nodeQuery("/axiom"),
11
11
  lemmaNodeQuery = nodeQuery("/lemma"),
12
+ sectionNodeQuery = nodeQuery("/section"),
12
13
  theoremNodeQuery = nodeQuery("/theorem"),
13
14
  metaLemmaNodeQuery = nodeQuery("/metaLemma"),
14
15
  conjectureNodeQuery = nodeQuery("/conjecture"),
@@ -24,8 +25,9 @@ class TopLevelVerifier extends Verifier {
24
25
  verify(node, fileContext) {
25
26
  let verifiesAtTopLevel;
26
27
 
27
- const nonTerminalNode = node, ///
28
- nonTerminalNodeVerifies = this.verifyNonTerminalNode(nonTerminalNode, fileContext);
28
+ const context = fileContext, ///
29
+ nonTerminalNode = node, ///
30
+ nonTerminalNodeVerifies = this.verifyNonTerminalNode(nonTerminalNode, context);
29
31
 
30
32
  verifiesAtTopLevel = nonTerminalNodeVerifies; ///
31
33
 
@@ -35,9 +37,9 @@ class TopLevelVerifier extends Verifier {
35
37
  static maps = [
36
38
  {
37
39
  nodeQuery: errorNodeQuery,
38
- verify: (errorNode, fileContext) => {
40
+ verify: (errorNode, context) => {
39
41
  const { Error } = dom,
40
- error = Error.fromErrorNode(errorNode, fileContext),
42
+ error = Error.fromErrorNode(errorNode, context),
41
43
  errorVerifies = error.verify();
42
44
 
43
45
  return errorVerifies;
@@ -45,9 +47,9 @@ class TopLevelVerifier extends Verifier {
45
47
  },
46
48
  {
47
49
  nodeQuery: ruleNodeQuery,
48
- verify: (ruleNode, fileContext) => {
50
+ verify: (ruleNode, context) => {
49
51
  const { Rule } = dom,
50
- rule = Rule.fromRuleNode(ruleNode, fileContext),
52
+ rule = Rule.fromRuleNode(ruleNode, context),
51
53
  ruleVerifies = rule.verify();
52
54
 
53
55
  return ruleVerifies;
@@ -55,9 +57,9 @@ class TopLevelVerifier extends Verifier {
55
57
  },
56
58
  {
57
59
  nodeQuery: axiomNodeQuery,
58
- verify: (axiomNode, fileContext) => {
60
+ verify: (axiomNode, context) => {
59
61
  const { Axiom } = dom,
60
- axiom = Axiom.fromAxiomNode(axiomNode, fileContext),
62
+ axiom = Axiom.fromAxiomNode(axiomNode, context),
61
63
  axiomVerifies = axiom.verify();
62
64
 
63
65
  return axiomVerifies;
@@ -65,19 +67,29 @@ class TopLevelVerifier extends Verifier {
65
67
  },
66
68
  {
67
69
  nodeQuery: lemmaNodeQuery,
68
- verify: (lemmaNode, fileContext) => {
70
+ verify: (lemmaNode, context) => {
69
71
  const { Lemma } = dom,
70
- lemma = Lemma.fromLemmaNode(lemmaNode, fileContext),
72
+ lemma = Lemma.fromLemmaNode(lemmaNode, context),
71
73
  lemmaVerifies = lemma.verify();
72
74
 
73
75
  return lemmaVerifies;
74
76
  }
75
77
  },
78
+ {
79
+ nodeQuery: sectionNodeQuery,
80
+ verify: (sectionNode, context) => {
81
+ const { Section } = dom,
82
+ section = Section.fromSectionNode(sectionNode, context),
83
+ sectionVerifies = section.verify();
84
+
85
+ return sectionVerifies;
86
+ }
87
+ },
76
88
  {
77
89
  nodeQuery: theoremNodeQuery,
78
- verify: (theoremNode, fileContext) => {
90
+ verify: (theoremNode, context) => {
79
91
  const { Theorem } = dom,
80
- theorem = Theorem.fromTheoremNode(theoremNode, fileContext),
92
+ theorem = Theorem.fromTheoremNode(theoremNode, context),
81
93
  theoremVerifies = theorem.verify();
82
94
 
83
95
  return theoremVerifies;
@@ -85,9 +97,9 @@ class TopLevelVerifier extends Verifier {
85
97
  },
86
98
  {
87
99
  nodeQuery: metaLemmaNodeQuery,
88
- verify: (metaLemmaNode, fileContext) => {
100
+ verify: (metaLemmaNode, context) => {
89
101
  const { MetaLemma } = dom,
90
- metaLemma = MetaLemma.fromMetaLemmaNode(metaLemmaNode, fileContext),
102
+ metaLemma = MetaLemma.fromMetaLemmaNode(metaLemmaNode, context),
91
103
  metaLemmaVerifies = metaLemma.verify();
92
104
 
93
105
  return metaLemmaVerifies;
@@ -95,9 +107,9 @@ class TopLevelVerifier extends Verifier {
95
107
  },
96
108
  {
97
109
  nodeQuery: conjectureNodeQuery,
98
- verify: (conjectureNode, fileContext) => {
110
+ verify: (conjectureNode, context) => {
99
111
  const { Conjecture } = dom,
100
- conjecture = Conjecture.fromConjectureNode(conjectureNode, fileContext),
112
+ conjecture = Conjecture.fromConjectureNode(conjectureNode, context),
101
113
  conjectureVerifies = conjecture.verify();
102
114
 
103
115
  return conjectureVerifies;
@@ -105,9 +117,9 @@ class TopLevelVerifier extends Verifier {
105
117
  },
106
118
  {
107
119
  nodeQuery: metatheoremNodeQuery,
108
- verify: (metatheoremNode, fileContext) => {
120
+ verify: (metatheoremNode, context) => {
109
121
  const { Metatheorem } = dom,
110
- metatheorem = Metatheorem.fromMetatheoremNode(metatheoremNode, fileContext),
122
+ metatheorem = Metatheorem.fromMetatheoremNode(metatheoremNode, context),
111
123
  metatheoremVerifies = metatheorem.verify();
112
124
 
113
125
  return metatheoremVerifies;
@@ -115,9 +127,9 @@ class TopLevelVerifier extends Verifier {
115
127
  },
116
128
  {
117
129
  nodeQuery: variableDeclarationNodeQuery,
118
- verify: (variableDeclarationNode, fileContext) => {
130
+ verify: (variableDeclarationNode, context) => {
119
131
  const { VariableDeclaration } = dom,
120
- variableDeclaration = VariableDeclaration.fromVariableDeclarationNode(variableDeclarationNode, fileContext),
132
+ variableDeclaration = VariableDeclaration.fromVariableDeclarationNode(variableDeclarationNode, context),
121
133
  variableDeclarationVerifies = variableDeclaration.verify();
122
134
 
123
135
  return variableDeclarationVerifies;
@@ -125,9 +137,9 @@ class TopLevelVerifier extends Verifier {
125
137
  },
126
138
  {
127
139
  nodeQuery: simpleTypeDeclarationNodeQuery,
128
- verify: (simpleTypeDeclarationNode, fileContext) => {
140
+ verify: (simpleTypeDeclarationNode, context) => {
129
141
  const { SimpleTypeDeclaration } = dom,
130
- simpleTypeDeclaration = SimpleTypeDeclaration.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, fileContext),
142
+ simpleTypeDeclaration = SimpleTypeDeclaration.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
131
143
  simpleTypeDeclarationVerifies = simpleTypeDeclaration.verify();
132
144
 
133
145
  return simpleTypeDeclarationVerifies;
@@ -135,9 +147,9 @@ class TopLevelVerifier extends Verifier {
135
147
  },
136
148
  {
137
149
  nodeQuery: combinatorDeclarationNodeQuery,
138
- verify: (combinatorDeclarationNode, fileContext) => {
150
+ verify: (combinatorDeclarationNode, context) => {
139
151
  const { CombinatorDeclaration } = dom,
140
- combinatorDeclaration = CombinatorDeclaration.fromCombinatorDeclarationNode(combinatorDeclarationNode, fileContext),
152
+ combinatorDeclaration = CombinatorDeclaration.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
141
153
  combinatorDeclarationVerifies = combinatorDeclaration.verify();
142
154
 
143
155
  return combinatorDeclarationVerifies;
@@ -145,9 +157,9 @@ class TopLevelVerifier extends Verifier {
145
157
  },
146
158
  {
147
159
  nodeQuery: constructorDeclarationNodeQuery,
148
- verify: (constructorDeclarationNode, fileContext) => {
160
+ verify: (constructorDeclarationNode, context) => {
149
161
  const { ConstructorDeclaration } = dom,
150
- constructorDeclaration = ConstructorDeclaration.fromConstructorDeclarationNode(constructorDeclarationNode, fileContext),
162
+ constructorDeclaration = ConstructorDeclaration.fromConstructorDeclarationNode(constructorDeclarationNode, context),
151
163
  constructorDeclarationVerifies = constructorDeclaration.verify();
152
164
 
153
165
  return constructorDeclarationVerifies;
@@ -155,9 +167,9 @@ class TopLevelVerifier extends Verifier {
155
167
  },
156
168
  {
157
169
  nodeQuery: complexTypeDeclarationNodeQuery,
158
- verify: (complexTypeDeclarationNode, fileContext) => {
170
+ verify: (complexTypeDeclarationNode, context) => {
159
171
  const { ComplexTypeDeclaration } = dom,
160
- complexTypeDeclaration = ComplexTypeDeclaration.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
172
+ complexTypeDeclaration = ComplexTypeDeclaration.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
161
173
  complexTypeDeclarationVerifies = complexTypeDeclaration.verify();
162
174
 
163
175
  return complexTypeDeclarationVerifies;
@@ -165,9 +177,9 @@ class TopLevelVerifier extends Verifier {
165
177
  },
166
178
  {
167
179
  nodeQuery: metavariableDeclarationNodeQuery,
168
- verify: (metavariableDeclarationNode, fileContext) => {
180
+ verify: (metavariableDeclarationNode, context) => {
169
181
  const { MetavariableDeclaration } = dom,
170
- metavariableDeclaration = MetavariableDeclaration.fromMetavariableDeclarationNode(metavariableDeclarationNode, fileContext),
182
+ metavariableDeclaration = MetavariableDeclaration.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
171
183
  metavariableDeclarationVerifies = metavariableDeclaration.verify();
172
184
 
173
185
  return metavariableDeclarationVerifies;