You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: saw-remote-api/docs/SAW.rst
+159-23
Original file line number
Diff line number
Diff line change
@@ -13,39 +13,37 @@ The server supports three transport methods:
13
13
14
14
15
15
``stdio``
16
-
in which the server communicates over ``stdin`` and ``stdout``
16
+
in which the server communicates over ``stdin`` and ``stdout`` using `netstrings. <http://cr.yp.to/proto/netstrings.txt>`_
17
17
18
18
19
19
20
-
Socket
21
-
in which the server communicates over ``stdin`` and ``stdout``
20
+
``socket``
21
+
in which the server communicates over a socket using `netstrings. <http://cr.yp.to/proto/netstrings.txt>`_
22
22
23
23
24
24
25
-
HTTP
26
-
in which the server communicates over HTTP
25
+
``http``
26
+
in which the server communicates over a socket using HTTP.
27
27
28
28
29
-
In both ``stdio`` and socket mode, messages are delimited using `netstrings. <http://cr.yp.to/proto/netstrings.txt>`_
30
-
31
29
32
30
Application State
33
31
~~~~~~~~~~~~~~~~~
34
32
35
33
According to the JSON-RPC specification, the ``params`` field in a message object must be an array or object. In this protocol, it is always an object. While each message may specify its own arguments, every message has a parameter field named ``state``.
36
34
37
-
When the first message is sent from the client to the server, the ``state`` parameter should be initialized to the JSON null value ``null``. Replies from the server may contain a new state that should be used in subsequent requests, so that state changes executed by the request are visible. Prior versions of this protocol represented the initial state as the empty array ``[]``, but this is now deprecated and will be removed.
35
+
When the first message is sent from the client to the server, the ``state`` parameter should be initialized to the JSON null value ``null``. Replies from the server may contain a new state that should be used in subsequent requests, so that state changes executed by the request are visible.
38
36
39
37
In particular, per JSON-RPC, non-error replies are always a JSON object that contains a ``result`` field. The result field always contains an ``answer`` field and a ``state`` field, as well as ``stdout`` and ``stderr``.
40
38
41
39
42
40
``answer``
43
-
The value returned as a response to the request (the precise contents depend on which request was sent)
41
+
The value returned as a response to the request (the precise contents depend on which request was sent).
44
42
45
43
46
44
47
45
``state``
48
-
The state, to be sent in subsequent requests. If the server did not modify its state in response to the command, then this state may be the same as the one sent by the client.
46
+
The state, to be sent in subsequent requests. If the server did not modify its state in response to the command, then this state may be the same as the one sent by the client. When a new state is in a server response, the previous state may no longer be available for requests.
49
47
50
48
51
49
@@ -69,28 +67,53 @@ Methods
69
67
SAW/Cryptol/load module (command)
70
68
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
69
70
+
Load the specified Cryptol module.
71
+
72
+
Parameter fields
73
+
++++++++++++++++
74
+
72
75
73
76
``module name``
74
77
Name of module to load.
75
78
76
79
77
-
Load the specified Cryptol module.
80
+
81
+
Return fields
82
+
+++++++++++++
83
+
84
+
No return fields
85
+
78
86
79
87
80
88
SAW/Cryptol/load file (command)
81
89
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82
90
91
+
Load the given file as a Cryptol module.
92
+
93
+
Parameter fields
94
+
++++++++++++++++
95
+
83
96
84
97
``file``
85
98
File to load as a Cryptol module.
86
99
87
100
88
-
Load the given file as a Cryptol module.
101
+
102
+
Return fields
103
+
+++++++++++++
104
+
105
+
No return fields
106
+
89
107
90
108
91
109
SAW/Cryptol/save term (command)
92
110
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93
111
112
+
Save a term to be referenced later by name.
113
+
114
+
Parameter fields
115
+
++++++++++++++++
116
+
94
117
95
118
``name``
96
119
The name to assign to the expression for later reference.
@@ -101,12 +124,22 @@ SAW/Cryptol/save term (command)
The server name to use to access the ghost variable later.
252
325
253
326
254
-
Create a ghost global variable to represent proof-specific program state.
327
+
328
+
Return fields
329
+
+++++++++++++
330
+
331
+
No return fields
332
+
255
333
256
334
257
335
SAW/make simpset (command)
258
336
~~~~~~~~~~~~~~~~~~~~~~~~~~
259
337
338
+
Create a simplification rule set from the given rules.
339
+
340
+
Parameter fields
341
+
++++++++++++++++
342
+
260
343
261
344
``elements``
262
345
The items to include in the simpset.
@@ -267,12 +350,22 @@ SAW/make simpset (command)
267
350
The name to assign to this simpset.
268
351
269
352
270
-
Create a simplification rule set from the given rules.
353
+
354
+
Return fields
355
+
+++++++++++++
356
+
357
+
No return fields
358
+
271
359
272
360
273
361
SAW/prove (command)
274
362
~~~~~~~~~~~~~~~~~~~
275
363
364
+
Attempt to prove the given term representing a theorem, given a proof script context.
365
+
366
+
Parameter fields
367
+
++++++++++++++++
368
+
276
369
277
370
``script``
278
371
Script to use to prove the term.
@@ -283,37 +376,80 @@ SAW/prove (command)
283
376
The goal to interpret as a theorm and prove.
284
377
285
378
286
-
Attempt to prove the given term representing a theorem, given a proof script context.
379
+
380
+
Return fields
381
+
+++++++++++++
382
+
383
+
384
+
``status``
385
+
A string (one of ``valid````, ````invalid``, or ``unknown``) indicating whether the proof went through successfully or not.
386
+
387
+
388
+
389
+
``counterexample``
390
+
Only used if the ``status`` is ``invalid``. An array of objects where each object has a ``name`` string and a :ref:`JSON Cryptol expression <Expression>` ``value``.
391
+
392
+
287
393
288
394
289
395
SAW/set option (command)
290
396
~~~~~~~~~~~~~~~~~~~~~~~~
291
397
398
+
Set a SAW option in the server.
399
+
400
+
Parameter fields
401
+
++++++++++++++++
402
+
292
403
293
404
``option``
294
405
The option to set and its accompanying value (i.e., true or false); one of the following:``lax arithmetic``, ``SMT array memory model``, or ``What4 hash consing``
295
406
296
407
297
-
Set a SAW option in the server.
408
+
409
+
Return fields
410
+
+++++++++++++
411
+
412
+
No return fields
413
+
298
414
299
415
300
416
SAW/clear state (notification)
301
417
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302
418
419
+
Clear a particular state from the SAW server (making room for subsequent/unrelated states).
420
+
421
+
Parameter fields
422
+
++++++++++++++++
423
+
303
424
304
425
``state to clear``
305
426
The state to clear from the server to make room for other unrelated states.
306
427
307
428
308
-
Clear a particular state from the SAW server (making room for subsequent/unrelated states).
429
+
430
+
Return fields
431
+
+++++++++++++
432
+
433
+
No return fields
434
+
309
435
310
436
311
437
SAW/clear all states (notification)
312
438
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313
439
440
+
Clear all states from the SAW server (making room for subsequent/unrelated states).
441
+
442
+
Parameter fields
443
+
++++++++++++++++
444
+
314
445
No parameters
315
446
316
-
Clear all states from the SAW server (making room for subsequent/unrelated states).
0 commit comments