1
1
{-# LANGUAGE OverloadedStrings #-}
2
2
module Main (main ) where
3
3
4
- import qualified Data.Aeson as JSON
5
- import Data.Text (Text )
6
-
7
4
import Argo
8
5
import Argo.DefaultMain
6
+ import qualified Argo.Doc as Doc
9
7
10
8
import SAWServer
11
9
import SAWServer.CryptolSetup
@@ -20,32 +18,79 @@ import SAWServer.SetOption
20
18
21
19
main :: IO ()
22
20
main =
23
- do theApp <- mkApp initialState sawMethods
21
+ do theApp <- mkApp " SAW RPC Server " serverDocs initialState sawMethods
24
22
defaultMain description theApp
25
23
24
+ serverDocs :: [Doc. Block ]
25
+ serverDocs =
26
+ [ Doc. Section " Summary" $ [ Doc. Paragraph
27
+ [Doc. Text " A remote server for " ,
28
+ Doc. Link (Doc. URL " https://saw.galois.com/" ) " SAW" ,
29
+ Doc. Text " for verifying programs with a featureset similar to SAWScript." ]]]
30
+
26
31
description :: String
27
32
description =
28
33
" An RPC server for SAW."
29
34
30
- sawMethods :: [( Text , MethodType , JSON. Value -> Method SAWState JSON. Value ) ]
35
+ sawMethods :: [AppMethod SAWState ]
31
36
sawMethods =
32
37
-- Cryptol
33
- [ (" SAW/Cryptol/load module" , Command , method cryptolLoadModule)
34
- , (" SAW/Cryptol/load file" , Command , method cryptolLoadFile)
35
- , (" SAW/Cryptol/save term" , Command , method saveTerm)
38
+ [ method
39
+ " SAW/Cryptol/load module"
40
+ Command
41
+ cryptolLoadModuleDescr
42
+ cryptolLoadModule
43
+ , method
44
+ " SAW/Cryptol/load file"
45
+ Command
46
+ cryptolLoadFileDescr
47
+ cryptolLoadFile
48
+ , method
49
+ " SAW/Cryptol/save term"
50
+ Command
51
+ saveTermDescr
52
+ saveTerm
36
53
-- JVM
37
54
{-
38
- , ( "SAW/JVM/load class", Command, method jvmLoadClass)
39
- , ( "SAW/JVM/verify", Command, method jvmVerify)
40
- , ( "SAW/JVM/assume", Command, method jvmAssume)
55
+ , method "SAW/JVM/load class" Command (Doc.Paragraph [Doc.Text "TODO"]) jvmLoadClass
56
+ , method "SAW/JVM/verify" Command (Doc.Paragraph [Doc.Text "TODO"]) jvmVerify
57
+ , method "SAW/JVM/assume" Command (Doc.Paragraph [Doc.Text "TODO"]) jvmAssume
41
58
-}
42
59
-- LLVM
43
- , (" SAW/LLVM/load module" , Command , method llvmLoadModule)
44
- , (" SAW/LLVM/verify" , Command , method llvmVerify)
45
- , (" SAW/LLVM/verify x86" , Command , method llvmVerifyX86)
46
- , (" SAW/LLVM/assume" , Command , method llvmAssume)
60
+ , method
61
+ " SAW/LLVM/load module"
62
+ Command
63
+ llvmLoadModuleDescr
64
+ llvmLoadModule
65
+ , method
66
+ " SAW/LLVM/verify"
67
+ Command
68
+ llvmVerifyDescr
69
+ llvmVerify
70
+ , method
71
+ " SAW/LLVM/verify x86"
72
+ Command
73
+ llvmVerifyX86Descr
74
+ llvmVerifyX86
75
+ , method
76
+ " SAW/LLVM/assume"
77
+ Command
78
+ llvmAssumeDescr
79
+ llvmAssume
47
80
-- General
48
- , (" SAW/make simpset" , Command , method makeSimpset)
49
- , (" SAW/prove" , Command , method prove)
50
- , (" SAW/set option" , Command , method setOption)
81
+ , method
82
+ " SAW/make simpset"
83
+ Command
84
+ makeSimpsetDescr
85
+ makeSimpset
86
+ , method
87
+ " SAW/prove"
88
+ Command
89
+ proveDescr
90
+ prove
91
+ , method
92
+ " SAW/set option"
93
+ Command
94
+ setOptionDescr
95
+ setOption
51
96
]
0 commit comments