SNAPKITTYWEST commited on
Commit
63a8a7c
·
verified ·
1 Parent(s): 8882e55

add lean4/src/SovereignCorpus/Bridge/Granite4Schema.lean

Browse files
lean4/src/SovereignCorpus/Bridge/Granite4Schema.lean ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Lean.Data.Json.FromToJson
2
+
3
+ namespace SovereignCorpus.Bridge
4
+
5
+ open Lean
6
+
7
+ structure ProblemMeta where
8
+ source : String
9
+ timestamp : String
10
+ operatorSig : String
11
+ maxSteps : Nat
12
+ allowedTactics : List String
13
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
14
+
15
+ structure GraniteProblem where
16
+ id : String
17
+ statement : String
18
+ context : List String
19
+ tacticHint : Option String
20
+ meta : ProblemMeta
21
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
22
+
23
+ inductive ResponseStatus where
24
+ | proposed
25
+ | corrected
26
+ | failed
27
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
28
+
29
+ inductive DiagnosticSeverity where
30
+ | info
31
+ | warning
32
+ | error
33
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
34
+
35
+ structure Span where
36
+ startLine : Nat
37
+ startCol : Nat
38
+ endLine : Nat
39
+ endCol : Nat
40
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
41
+
42
+ structure Diagnostic where
43
+ severity : DiagnosticSeverity
44
+ message : String
45
+ span : Option Span
46
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
47
+
48
+ structure GraniteResponse where
49
+ problemId : String
50
+ status : ResponseStatus
51
+ proofScript : String
52
+ diagnostics : List Diagnostic
53
+ deriving Repr, Inhabited, Lean.FromJson, Lean.ToJson
54
+
55
+ end SovereignCorpus.Bridge