Skip to content

Commit 34d0cd8

Browse files
Apply suggestions from code review
Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
1 parent 9c7b0aa commit 34d0cd8

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ compute the value of the corresponding stream expression
7676
evaluated at index `n`, assuming the C program has been fed
7777
inputs corresponding to the first `n` values of the external stream
7878
inputs. Moreover, the trigger functions should be called from
79-
the `step` function exactly at time values when the stream expressions
79+
the `step` function exactly at the time values when the stream expressions
8080
evaluate to true.
8181

8282
The notion of correspondence for the values flowing in streams is
8383
relatively straightforward: these values consist of fixed-width
8484
machine integers, floating-point values, structs and fixed-length
8585
arrays. For each, the appropriate notion of equality is fairly clear.
8686

87-
Both the original Stream program and the generated C program
87+
Both the original `Stream` program and the generated C program
8888
can be viewed straightforwardly as a transition system, and under
8989
this view, the correspondence we want to establish is a bisimulation
9090
between the states of the high-level stream program and the low-level
9191
C program. The proof method for bisimulation requires us to provide
9292
a "correspondence" relation between the program states, and then prove
9393
three things about this relation:
9494

95-
1. that the initial states of thee programs are in the relation;
95+
1. that the initial states of the programs are in the relation;
9696
2. if we assume two arbitrary program states begin in the relation
9797
and each takes a single transition (consuming corresponding inputs),
9898
the resulting states are back in the relation;
@@ -113,15 +113,15 @@ let `buf` be the global variable name of the ring-buffer in the C
113113
program, and `idx` be the global variable name maintaining the
114114
current index into the ring buffer. Then the correspondence
115115
relation is basically that `0 <= idx < k` and
116-
`s[n+i] =buf[(idx+i) mod k]` as `i` ranges from `0 .. k-1`.
116+
`s[n+i] = buf[(idx+i) mod k]` as `i` ranges from `0 .. k-1`.
117117
By abuse of notation, here we mean that `s[j]` is
118118
the value of the stream expression `s` evaluated at index `j`,
119119
whereas `buf[j]` means the value obtained by reading the `j`th value
120120
of the buffer `buf` from memory. The overall correspondence relation
121121
is a conjunction of statements like this, one for each stream
122122
expression that is realized via a buffer.
123123

124-
### Implementing the Bismulation proof steps
124+
### Implementing the Bisimulation proof steps
125125

126126
The kind of program correspondence property we desire is a largely
127127
mechanical affair. As the code under consideration is automatically
@@ -171,12 +171,12 @@ compute the value of each stream at time `n+k`.
171171

172172
Next we set up an initial state of the C program by choosing,
173173
for each ring buffer, an arbitrary value for its current index
174-
within it's allowed range, and then writing the variables
174+
within its allowed range, and then writing the variables
175175
corresponding to each stream value into the buffers at
176176
their appropriate offsets. The symbolic simulator is then
177177
invoked to compute the state update effects of the `step()`
178178
function. Afterward, we read the poststate values from the
179-
ring-buffers and verify that the correspond to the stream
179+
ring-buffers and verify that they correspond to the stream
180180
values from `n+1` up to `n+k`.
181181

182182
As part of symbolic simulation, Crucible may also generate
@@ -188,7 +188,7 @@ submitted to an SMT solver.
188188
#### Observable effects
189189

190190
For our purposes, the only observable effects of a Copilot program
191-
relate to any "trigger" functions defined in the spec. Our task it to
191+
relate to any "trigger" functions defined in the spec. Our task is to
192192
show that the generated C code calls the external trigger functions if
193193
and only if the corresponding guard condition is true, and that the
194194
arguments passed to those functions are as expected.
@@ -228,7 +228,7 @@ and produce LLVM intermediate language, which then becomes the input
228228
to the later verification steps. To the extent that the input program
229229
is not fully-portable C, `clang` may make implementation-specific
230230
decisions about how to compile the program which might be made
231-
different if compiled by a different compiler, (e.g. `gcc`). We expect
231+
different if compiled by a different compiler (e.g. `gcc`). We expect
232232
this aspect to be mitigated by the fact that Copilot programs are
233233
automatically generated into a rather simple subset of the C language,
234234
and is designed to be as simple as possible.
@@ -252,7 +252,7 @@ this risk other than manual examination and comparison against the
252252
intended semantics of Copilot, as encoded in the interpreter.
253253

254254
There is limited SMT solver support for floating-point values,
255-
especially for trancendental functions like the trig primitives. As a
255+
especially for transcendental functions like the trig primitives. As a
256256
result, we reason about floating point expressions via uninterpreted
257257
functions. In other words, we leave the semantics of the
258258
floating-point operations totally abstract, and simply verify that the

0 commit comments

Comments
 (0)