Skip to content

Commit 5cdcf53

Browse files
committed
Add in-REPL documentation for several crucible-related functions.
See #202.
1 parent 16cddd4 commit 5cdcf53

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/SAWScript/Interpreter.hs

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ primitives = Map.fromList
14861486

14871487
, prim "load_crucible_llvm_module" "String -> TopLevel ()"
14881488
(bicVal load_crucible_llvm_module)
1489-
[ "Load an LLVM bitcode file into the Crucible symbolic simulator"
1489+
[ "Load an LLVM bitcode file into the Crucible symbolic simulator."
14901490
]
14911491

14921492
, prim "load_llvm_cfg" "String -> TopLevel CFG"
@@ -1517,7 +1517,14 @@ primitives = Map.fromList
15171517

15181518
, prim "crucible_points_to" "SetupValue -> SetupValue -> CrucibleSetup ()"
15191519
(bicVal crucible_points_to)
1520-
[ "TODO" ]
1520+
[ "Declare that the memory location indicated by the given pointer (first"
1521+
, "argument) contains the given value (second argument)."
1522+
, ""
1523+
, "In the pre-state section (before crucible_execute_func) this specifies"
1524+
, "the initial memory layout before function execution. In the post-state"
1525+
, "section (after crucible_execute_func), this specifies an assertion"
1526+
, "about the final memory state after running the function."
1527+
]
15211528

15221529
, prim "crucible_equal" "SetupValue -> SetupValue -> CrucibleSetup ()"
15231530
(bicVal crucible_equal)
@@ -1533,11 +1540,20 @@ primitives = Map.fromList
15331540

15341541
, prim "crucible_execute_func" "[SetupValue] -> CrucibleSetup ()"
15351542
(bicVal crucible_execute_func)
1536-
[ "TODO" ]
1543+
[ "Specify the given list of values as the arguments of the function."
1544+
, ""
1545+
, "The crucible_execute_func statement also serves to separate the pre-state"
1546+
, "section of the spec (before crucible_execute_func) from the post-state"
1547+
, "section (after crucible_execute_func). The effects of some CrucibleSetup"
1548+
, "statements depend on whether they occur in the pre-state or post-state"
1549+
, "section."
1550+
]
15371551

15381552
, prim "crucible_return" "SetupValue -> CrucibleSetup ()"
15391553
(bicVal crucible_return)
1540-
[ "TODO" ]
1554+
[ "Specify the given value as the return value of the function. A"
1555+
, "crucible_return statement is required if and only if the function"
1556+
, "has a non-void return type." ]
15411557

15421558
, prim "crucible_llvm_verify"
15431559
"String -> [CrucibleMethodSpec] -> CrucibleSetup () -> Bool -> ProofScript SatResult -> TopLevel CrucibleMethodSpec"
@@ -1552,12 +1568,14 @@ primitives = Map.fromList
15521568
, prim "crucible_array"
15531569
"[SetupValue] -> SetupValue"
15541570
(pureVal CIR.SetupArray)
1555-
[ "TODO" ]
1571+
[ "Create a SetupValue representing an array, with the given list of"
1572+
, "values as elements. The list must be non-empty." ]
15561573

15571574
, prim "crucible_struct"
15581575
"[SetupValue] -> SetupValue"
15591576
(pureVal CIR.SetupStruct)
1560-
[ "TODO" ]
1577+
[ "Create a SetupValue representing a struct, with the given list of"
1578+
, "values as elements." ]
15611579

15621580
, prim "crucible_elem"
15631581
"SetupValue -> Int -> SetupValue"
@@ -1568,12 +1586,13 @@ primitives = Map.fromList
15681586
, prim "crucible_null"
15691587
"SetupValue"
15701588
(pureVal CIR.SetupNull)
1571-
[ "TODO" ]
1589+
[ "A SetupValue representing a null pointer value." ]
15721590

15731591
, prim "crucible_global"
15741592
"String -> SetupValue"
15751593
(pureVal CIR.SetupGlobal)
1576-
[ "TODO" ]
1594+
[ "Return a SetupValue representing a pointer to the named global."
1595+
, "The String may be either the name of a global value or a function name." ]
15771596

15781597
, prim "crucible_term"
15791598
"Term -> SetupValue"

0 commit comments

Comments
 (0)