@nahisaho/musubix-lean 1.8.5

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 (89) hide show
  1. package/dist/converters/EarsToLeanConverter.d.ts +61 -0
  2. package/dist/converters/EarsToLeanConverter.d.ts.map +1 -0
  3. package/dist/converters/EarsToLeanConverter.js +300 -0
  4. package/dist/converters/EarsToLeanConverter.js.map +1 -0
  5. package/dist/converters/TypeScriptSpecifier.d.ts +63 -0
  6. package/dist/converters/TypeScriptSpecifier.d.ts.map +1 -0
  7. package/dist/converters/TypeScriptSpecifier.js +307 -0
  8. package/dist/converters/TypeScriptSpecifier.js.map +1 -0
  9. package/dist/converters/index.d.ts +7 -0
  10. package/dist/converters/index.d.ts.map +1 -0
  11. package/dist/converters/index.js +7 -0
  12. package/dist/converters/index.js.map +1 -0
  13. package/dist/environment/LeanEnvironmentDetector.d.ts +57 -0
  14. package/dist/environment/LeanEnvironmentDetector.d.ts.map +1 -0
  15. package/dist/environment/LeanEnvironmentDetector.js +221 -0
  16. package/dist/environment/LeanEnvironmentDetector.js.map +1 -0
  17. package/dist/environment/LeanProjectInitializer.d.ts +49 -0
  18. package/dist/environment/LeanProjectInitializer.d.ts.map +1 -0
  19. package/dist/environment/LeanProjectInitializer.js +232 -0
  20. package/dist/environment/LeanProjectInitializer.js.map +1 -0
  21. package/dist/environment/index.d.ts +7 -0
  22. package/dist/environment/index.d.ts.map +1 -0
  23. package/dist/environment/index.js +7 -0
  24. package/dist/environment/index.js.map +1 -0
  25. package/dist/errors.d.ts +141 -0
  26. package/dist/errors.d.ts.map +1 -0
  27. package/dist/errors.js +254 -0
  28. package/dist/errors.js.map +1 -0
  29. package/dist/hybrid/HybridVerifier.d.ts +113 -0
  30. package/dist/hybrid/HybridVerifier.d.ts.map +1 -0
  31. package/dist/hybrid/HybridVerifier.js +247 -0
  32. package/dist/hybrid/HybridVerifier.js.map +1 -0
  33. package/dist/hybrid/index.d.ts +6 -0
  34. package/dist/hybrid/index.d.ts.map +1 -0
  35. package/dist/hybrid/index.js +6 -0
  36. package/dist/hybrid/index.js.map +1 -0
  37. package/dist/index.d.ts +21 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +50 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/infrastructure/LeanFileGenerator.d.ts +70 -0
  42. package/dist/infrastructure/LeanFileGenerator.d.ts.map +1 -0
  43. package/dist/infrastructure/LeanFileGenerator.js +253 -0
  44. package/dist/infrastructure/LeanFileGenerator.js.map +1 -0
  45. package/dist/infrastructure/LeanRunner.d.ts +93 -0
  46. package/dist/infrastructure/LeanRunner.d.ts.map +1 -0
  47. package/dist/infrastructure/LeanRunner.js +296 -0
  48. package/dist/infrastructure/LeanRunner.js.map +1 -0
  49. package/dist/infrastructure/index.d.ts +7 -0
  50. package/dist/infrastructure/index.d.ts.map +1 -0
  51. package/dist/infrastructure/index.js +7 -0
  52. package/dist/infrastructure/index.js.map +1 -0
  53. package/dist/integration/LeanIntegration.d.ts +138 -0
  54. package/dist/integration/LeanIntegration.d.ts.map +1 -0
  55. package/dist/integration/LeanIntegration.js +352 -0
  56. package/dist/integration/LeanIntegration.js.map +1 -0
  57. package/dist/proof/ProofGenerator.d.ts +53 -0
  58. package/dist/proof/ProofGenerator.d.ts.map +1 -0
  59. package/dist/proof/ProofGenerator.js +324 -0
  60. package/dist/proof/ProofGenerator.js.map +1 -0
  61. package/dist/proof/ReProverClient.d.ts +58 -0
  62. package/dist/proof/ReProverClient.d.ts.map +1 -0
  63. package/dist/proof/ReProverClient.js +260 -0
  64. package/dist/proof/ReProverClient.js.map +1 -0
  65. package/dist/proof/index.d.ts +7 -0
  66. package/dist/proof/index.d.ts.map +1 -0
  67. package/dist/proof/index.js +7 -0
  68. package/dist/proof/index.js.map +1 -0
  69. package/dist/reporting/VerificationReporter.d.ts +89 -0
  70. package/dist/reporting/VerificationReporter.d.ts.map +1 -0
  71. package/dist/reporting/VerificationReporter.js +296 -0
  72. package/dist/reporting/VerificationReporter.js.map +1 -0
  73. package/dist/reporting/index.d.ts +6 -0
  74. package/dist/reporting/index.d.ts.map +1 -0
  75. package/dist/reporting/index.js +6 -0
  76. package/dist/reporting/index.js.map +1 -0
  77. package/dist/traceability/TraceabilityManager.d.ts +104 -0
  78. package/dist/traceability/TraceabilityManager.d.ts.map +1 -0
  79. package/dist/traceability/TraceabilityManager.js +299 -0
  80. package/dist/traceability/TraceabilityManager.js.map +1 -0
  81. package/dist/traceability/index.d.ts +6 -0
  82. package/dist/traceability/index.d.ts.map +1 -0
  83. package/dist/traceability/index.js +6 -0
  84. package/dist/traceability/index.js.map +1 -0
  85. package/dist/types.d.ts +466 -0
  86. package/dist/types.d.ts.map +1 -0
  87. package/dist/types.js +17 -0
  88. package/dist/types.js.map +1 -0
  89. package/package.json +78 -0
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @fileoverview Lean project initialization
3
+ * @module @nahisaho/musubix-lean/environment
4
+ * @traceability REQ-LEAN-CORE-002
5
+ */
6
+ import type { LeanConfig } from '../types.js';
7
+ /**
8
+ * Options for project initialization
9
+ */
10
+ export interface InitializeOptions {
11
+ /** Project name */
12
+ name: string;
13
+ /** Target directory */
14
+ directory: string;
15
+ /** Include Mathlib dependency */
16
+ useMathlib?: boolean;
17
+ /** Custom lakefile content */
18
+ customLakefile?: string;
19
+ }
20
+ /**
21
+ * Initialize a new Lean 4 project
22
+ * @traceability REQ-LEAN-CORE-002
23
+ */
24
+ export declare function initializeLeanProject(options: InitializeOptions): Promise<void>;
25
+ /**
26
+ * Check if a Lean project exists at the given path
27
+ */
28
+ export declare function isLeanProject(directory: string): Promise<boolean>;
29
+ /**
30
+ * LeanProjectInitializer class implementation
31
+ * @traceability REQ-LEAN-CORE-002
32
+ */
33
+ export declare class LeanProjectInitializer {
34
+ private readonly config;
35
+ constructor(config?: Partial<LeanConfig>);
36
+ /**
37
+ * Initialize a new Lean project
38
+ */
39
+ initialize(options: InitializeOptions): Promise<void>;
40
+ /**
41
+ * Check if directory is already a Lean project
42
+ */
43
+ isProject(directory: string): Promise<boolean>;
44
+ /**
45
+ * Add MUSUBIX module to existing project
46
+ */
47
+ addMusubixModule(directory: string): Promise<void>;
48
+ }
49
+ //# sourceMappingURL=LeanProjectInitializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeanProjectInitializer.d.ts","sourceRoot":"","sources":["../../src/environment/LeanProjectInitializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAiDf;AAkJD;;GAEG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOvE;AAED;;;GAGG;AACH,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,GAAE,OAAO,CAAC,UAAU,CAAM;IAE7D;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3D;;OAEG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIpD;;OAEG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAczD"}
@@ -0,0 +1,232 @@
1
+ /**
2
+ * @fileoverview Lean project initialization
3
+ * @module @nahisaho/musubix-lean/environment
4
+ * @traceability REQ-LEAN-CORE-002
5
+ */
6
+ import { mkdir, writeFile, access } from 'node:fs/promises';
7
+ import { join } from 'node:path';
8
+ import { exec } from 'node:child_process';
9
+ import { promisify } from 'node:util';
10
+ import { LeanFileGenerationError } from '../errors.js';
11
+ const execAsync = promisify(exec);
12
+ /**
13
+ * Initialize a new Lean 4 project
14
+ * @traceability REQ-LEAN-CORE-002
15
+ */
16
+ export async function initializeLeanProject(options) {
17
+ const { name, directory, useMathlib = false } = options;
18
+ try {
19
+ // Create directory structure
20
+ await mkdir(directory, { recursive: true });
21
+ await mkdir(join(directory, name), { recursive: true });
22
+ // Generate lakefile.lean
23
+ const lakefileContent = options.customLakefile || generateLakefile(name, useMathlib);
24
+ await writeFile(join(directory, 'lakefile.lean'), lakefileContent, 'utf-8');
25
+ // Generate lean-toolchain
26
+ await writeFile(join(directory, 'lean-toolchain'), 'leanprover/lean4:stable\n', 'utf-8');
27
+ // Generate Main.lean
28
+ const mainContent = generateMainLean(name);
29
+ await writeFile(join(directory, `${name}.lean`), mainContent, 'utf-8');
30
+ // Generate MUSUBIX tactics library
31
+ const tacticsContent = generateMusubixTactics();
32
+ await writeFile(join(directory, name, 'Tactics.lean'), tacticsContent, 'utf-8');
33
+ // Generate basic definitions
34
+ const basicsContent = generateBasics();
35
+ await writeFile(join(directory, name, 'Basics.lean'), basicsContent, 'utf-8');
36
+ // Run lake build to verify setup
37
+ try {
38
+ await execAsync('lake build', { cwd: directory, timeout: 60000 });
39
+ }
40
+ catch {
41
+ // Build failure is acceptable for initial setup
42
+ // The user may need to configure Lean first
43
+ }
44
+ }
45
+ catch (error) {
46
+ throw new LeanFileGenerationError(directory, error instanceof Error ? error.message : String(error));
47
+ }
48
+ }
49
+ /**
50
+ * Generate lakefile.lean content
51
+ */
52
+ function generateLakefile(name, useMathlib) {
53
+ let content = `import Lake
54
+ open Lake DSL
55
+
56
+ package «${name}» where
57
+ version := v!"0.1.0"
58
+ keywords := #["musubix", "verification"]
59
+ leanOptions := #[
60
+ ⟨\`pp.unicode.fun, true⟩,
61
+ ⟨\`autoImplicit, false⟩
62
+ ]
63
+
64
+ `;
65
+ if (useMathlib) {
66
+ content += `require mathlib from git
67
+ "https://github.com/leanprover-community/mathlib4"
68
+
69
+ `;
70
+ }
71
+ content += `@[default_target]
72
+ lean_lib «${name}» where
73
+ srcDir := "."
74
+ roots := #[\`${name}]
75
+ `;
76
+ return content;
77
+ }
78
+ /**
79
+ * Generate main Lean file content
80
+ */
81
+ function generateMainLean(name) {
82
+ return `/-
83
+ ${name} - MUSUBIX Verification Project
84
+
85
+ This project contains formal verification proofs generated by MUSUBIX.
86
+ Requirements are converted from EARS format to Lean theorems.
87
+ -/
88
+
89
+ import ${name}.Tactics
90
+ import ${name}.Basics
91
+
92
+ namespace ${name}
93
+
94
+ -- Requirements will be added here by MUSUBIX
95
+
96
+ end ${name}
97
+ `;
98
+ }
99
+ /**
100
+ * Generate MUSUBIX tactics library
101
+ */
102
+ function generateMusubixTactics() {
103
+ return `/-
104
+ MUSUBIX Custom Tactics
105
+
106
+ This module provides custom tactics for verifying MUSUBIX requirements.
107
+ -/
108
+
109
+ namespace Musubix.Tactics
110
+
111
+ /-- Try common tactics in sequence -/
112
+ macro "musubix_auto" : tactic =>
113
+ \`(tactic| first
114
+ | rfl
115
+ | decide
116
+ | simp [*]
117
+ | trivial
118
+ | assumption
119
+ | contradiction)
120
+
121
+ /-- Verify a requirement with common patterns -/
122
+ macro "verify_req" : tactic =>
123
+ \`(tactic| (
124
+ try intros
125
+ try simp only []
126
+ try musubix_auto
127
+ try omega
128
+ ))
129
+
130
+ /-- Split goals for event-driven requirements -/
131
+ macro "split_event" : tactic =>
132
+ \`(tactic| (
133
+ intro h_event
134
+ constructor <;> try musubix_auto
135
+ ))
136
+
137
+ end Musubix.Tactics
138
+ `;
139
+ }
140
+ /**
141
+ * Generate basic definitions for MUSUBIX verification
142
+ */
143
+ function generateBasics() {
144
+ return `/-
145
+ MUSUBIX Basic Definitions
146
+
147
+ Common types and predicates used in MUSUBIX verification.
148
+ -/
149
+
150
+ namespace Musubix
151
+
152
+ /-- Result type for operations that can fail -/
153
+ inductive Result (α : Type) (ε : Type) where
154
+ | ok : α → Result α ε
155
+ | err : ε → Result α ε
156
+
157
+ /-- Check if result is successful -/
158
+ def Result.isOk {α ε : Type} : Result α ε → Bool
159
+ | .ok _ => true
160
+ | .err _ => false
161
+
162
+ /-- Check if result is an error -/
163
+ def Result.isErr {α ε : Type} : Result α ε → Bool
164
+ | .ok _ => false
165
+ | .err _ => true
166
+
167
+ /-- Natural number bounds predicate -/
168
+ def InRange (n : Nat) (lo hi : Nat) : Prop :=
169
+ lo ≤ n ∧ n ≤ hi
170
+
171
+ /-- Integer bounds predicate -/
172
+ def IntInRange (n : Int) (lo hi : Int) : Prop :=
173
+ lo ≤ n ∧ n ≤ hi
174
+
175
+ /-- Non-empty string predicate -/
176
+ def NonEmptyString (s : String) : Prop :=
177
+ s.length > 0
178
+
179
+ /-- Valid identifier predicate -/
180
+ def ValidIdentifier (s : String) : Prop :=
181
+ s.length > 0 ∧ s.all (fun c => c.isAlphanum || c == '_')
182
+
183
+ end Musubix
184
+ `;
185
+ }
186
+ /**
187
+ * Check if a Lean project exists at the given path
188
+ */
189
+ export async function isLeanProject(directory) {
190
+ try {
191
+ await access(join(directory, 'lakefile.lean'));
192
+ return true;
193
+ }
194
+ catch {
195
+ return false;
196
+ }
197
+ }
198
+ /**
199
+ * LeanProjectInitializer class implementation
200
+ * @traceability REQ-LEAN-CORE-002
201
+ */
202
+ export class LeanProjectInitializer {
203
+ config;
204
+ constructor(config = {}) {
205
+ this.config = config;
206
+ }
207
+ /**
208
+ * Initialize a new Lean project
209
+ */
210
+ async initialize(options) {
211
+ return initializeLeanProject({
212
+ ...options,
213
+ useMathlib: options.useMathlib ?? this.config.mathlibEnabled,
214
+ });
215
+ }
216
+ /**
217
+ * Check if directory is already a Lean project
218
+ */
219
+ async isProject(directory) {
220
+ return isLeanProject(directory);
221
+ }
222
+ /**
223
+ * Add MUSUBIX module to existing project
224
+ */
225
+ async addMusubixModule(directory) {
226
+ const musubixDir = join(directory, 'Musubix');
227
+ await mkdir(musubixDir, { recursive: true });
228
+ await writeFile(join(musubixDir, 'Tactics.lean'), generateMusubixTactics(), 'utf-8');
229
+ await writeFile(join(musubixDir, 'Basics.lean'), generateBasics(), 'utf-8');
230
+ }
231
+ }
232
+ //# sourceMappingURL=LeanProjectInitializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeanProjectInitializer.js","sourceRoot":"","sources":["../../src/environment/LeanProjectInitializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAgBlC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAA0B;IAE1B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAExD,IAAI,CAAC;QACH,6BAA6B;QAC7B,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAExD,yBAAyB;QACzB,MAAM,eAAe,GACnB,OAAO,CAAC,cAAc,IAAI,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC/D,MA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AK,CAAC,gBAAgB,CAAC,SAAiB;QACtC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,MAAM,SAAS,CACb,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAChC,sBAAsB,EAAE,EACxB,OAAO,CACR,CAAC;QACF,MAAM,SAAS,CACb,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAC/B,cAAc,EAAE,EAChB,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Environment module exports
3
+ * @module @nahisaho/musubix-lean/environment
4
+ */
5
+ export { LeanEnvironmentDetector, detectLeanEnvironment, validateLeanVersion, ensureLeanInstalled, getInstallationInstructions, clearEnvironmentCache, } from './LeanEnvironmentDetector.js';
6
+ export { LeanProjectInitializer, initializeLeanProject, isLeanProject, type InitializeOptions, } from './LeanProjectInitializer.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,KAAK,iBAAiB,GACvB,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Environment module exports
3
+ * @module @nahisaho/musubix-lean/environment
4
+ */
5
+ export { LeanEnvironmentDetector, detectLeanEnvironment, validateLeanVersion, ensureLeanInstalled, getInstallationInstructions, clearEnvironmentCache, } from './LeanEnvironmentDetector.js';
6
+ export { LeanProjectInitializer, initializeLeanProject, isLeanProject, } from './LeanProjectInitializer.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,GAEd,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * @fileoverview Custom error classes for musubix-lean package
3
+ * @module @nahisaho/musubix-lean/errors
4
+ * @traceability REQ-LEAN-ERR-001, REQ-LEAN-ERR-002
5
+ */
6
+ /**
7
+ * Base error class for Lean-related errors
8
+ */
9
+ export declare class LeanError extends Error {
10
+ readonly code: string;
11
+ readonly cause?: Error | undefined;
12
+ constructor(message: string, code: string, cause?: Error | undefined);
13
+ }
14
+ /**
15
+ * Error thrown when Lean 4 is not installed
16
+ * @traceability REQ-LEAN-ERR-001
17
+ */
18
+ export declare class LeanNotFoundError extends LeanError {
19
+ constructor(os: string);
20
+ }
21
+ /**
22
+ * Error thrown when Lean version is below minimum required
23
+ * @traceability REQ-LEAN-ERR-001
24
+ */
25
+ export declare class LeanVersionError extends LeanError {
26
+ readonly required: string;
27
+ readonly actual: string;
28
+ constructor(required: string, actual: string);
29
+ }
30
+ /**
31
+ * Error thrown when EARS-to-Lean conversion fails
32
+ * @traceability REQ-LEAN-ERR-002
33
+ */
34
+ export declare class EarsConversionError extends LeanError {
35
+ readonly requirementId: string;
36
+ readonly reason: string;
37
+ constructor(requirementId: string, reason: string);
38
+ }
39
+ /**
40
+ * Error thrown when EARS parsing fails
41
+ */
42
+ export declare class EarsParseError extends LeanError {
43
+ readonly text: string;
44
+ readonly reason: string;
45
+ constructor(text: string, reason: string);
46
+ }
47
+ /**
48
+ * Error thrown when TypeScript specification fails
49
+ */
50
+ export declare class TypeScriptSpecificationError extends LeanError {
51
+ readonly functionName: string;
52
+ readonly reason: string;
53
+ constructor(functionName: string, reason: string);
54
+ }
55
+ /**
56
+ * Error thrown when proof generation times out
57
+ * @traceability REQ-LEAN-PERF-002
58
+ */
59
+ export declare class ProofTimeoutError extends LeanError {
60
+ readonly theoremName: string;
61
+ readonly timeout: number;
62
+ constructor(theoremName: string, timeout: number);
63
+ }
64
+ /**
65
+ * Error thrown when proof generation fails
66
+ */
67
+ export declare class ProofGenerationError extends LeanError {
68
+ readonly theoremName: string;
69
+ readonly reason: string;
70
+ constructor(theoremName: string, reason: string);
71
+ }
72
+ /**
73
+ * Error thrown when ReProver connection fails
74
+ * @traceability REQ-LEAN-REPROVER-001
75
+ */
76
+ export declare class ReProverConnectionError extends LeanError {
77
+ readonly endpoint: string;
78
+ readonly reason: string;
79
+ constructor(endpoint: string, reason: string);
80
+ }
81
+ /**
82
+ * Error thrown when Lean file generation fails
83
+ */
84
+ export declare class LeanFileGenerationError extends LeanError {
85
+ readonly filePath: string;
86
+ readonly reason: string;
87
+ constructor(filePath: string, reason: string);
88
+ }
89
+ /**
90
+ * Error thrown when Lean execution fails
91
+ */
92
+ export declare class LeanExecutionError extends LeanError {
93
+ readonly command: string;
94
+ readonly exitCodeOrMessage: number | string;
95
+ readonly stderr: string;
96
+ constructor(command: string, exitCodeOrMessage: number | string, stderr: string);
97
+ }
98
+ /**
99
+ * Get installation instructions for the given OS
100
+ * @traceability REQ-LEAN-ERR-001
101
+ */
102
+ declare function getInstallInstructions(os: string): string;
103
+ export { getInstallInstructions };
104
+ /**
105
+ * Error thrown when Lean environment detection fails
106
+ */
107
+ export declare class LeanEnvironmentError extends LeanError {
108
+ constructor(message: string);
109
+ }
110
+ /**
111
+ * Error thrown when Lean conversion fails
112
+ */
113
+ export declare class LeanConversionError extends LeanError {
114
+ constructor(message: string);
115
+ }
116
+ /**
117
+ * Error thrown when Lean verification fails
118
+ */
119
+ export declare class LeanVerificationError extends LeanError {
120
+ readonly errors: string[];
121
+ constructor(message: string, errors?: string[]);
122
+ }
123
+ /**
124
+ * Error thrown when Lean proof generation fails
125
+ */
126
+ export declare class LeanProofError extends LeanError {
127
+ constructor(message: string);
128
+ }
129
+ /**
130
+ * Error thrown when Lean integration fails
131
+ */
132
+ export declare class LeanIntegrationError extends LeanError {
133
+ constructor(message: string);
134
+ }
135
+ /**
136
+ * Error thrown when ReProver fails
137
+ */
138
+ export declare class ReProverError extends LeanError {
139
+ constructor(message: string);
140
+ }
141
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;aAGhB,IAAI,EAAE,MAAM;aACZ,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,EAAE,EAAE,MAAM;CAQvB;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;aAE3B,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAE,MAAM;gBADd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM;CAQjC;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;aAE9B,aAAa,EAAE,MAAM;aACrB,MAAM,EAAE,MAAM;gBADd,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM;CAQjC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,SAAS;aAEzB,IAAI,EAAE,MAAM;aACZ,MAAM,EAAE,MAAM;gBADd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM;CAKjC;AAED;;GAEG;AACH,qB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