Skip to content

Commit

Permalink
fix typos in the book
Browse files Browse the repository at this point in the history
  • Loading branch information
ruipedro16 committed Nov 20, 2024
1 parent 63432cf commit 8455f76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions book/src/tutorial/data-invariants.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ elements. We dropped altogether a source of panic!

Soon you want to work with a bigger finite field: say
`F₂₃₄₇`. Representing this many `q` different elements with an Rust
enum would be very painful... The `enum` apporach falls appart.
enum would be very painful... The `enum` approach falls apart.

### Newtype and refinements
Since we don't want an `enum` with 2347 elements, we have to revert to
Expand Down Expand Up @@ -92,5 +92,5 @@ impl Add for F {

Here, F* is able to prove automatically that (1) the addition doesn't
overflow and (2) that the invariant of `F` is preserved. The
definition of type `F` in F* (named `t_F`) very explicitely requires
definition of type `F` in F* (named `t_F`) very explicitly requires
the invariant as a refinement on `v`.
4 changes: 2 additions & 2 deletions book/src/tutorial/panic-freedom.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ fn square_requires(x: u8) -> u8 {
```

With this precondition, F* is able to prove panic freedom. From now
on, it is the responsability of the clients of `square` to respect the
on, it is the responsibility of the clients of `square` to respect the
contact. The next step is thus be to verify, through hax extraction,
that `square` is used correctly at every call site.

## Common panicking situations
Mutipication is not the only panicking function provided by the Rust
Multiplication is not the only panicking function provided by the Rust
library: most of the other integer arithmetic operation have such
informal assumptions.

Expand Down
4 changes: 2 additions & 2 deletions book/src/tutorial/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn square_ensures(x: u8) -> u8 {
```

Such a simple post-condition is automatically proven by F\*. The
properties of our `square` function are not fasinating. Let's study a
properties of our `square` function are not fascinating. Let's study a
more interesting example: [Barrett reduction](https://en.wikipedia.org/wiki/Barrett_reduction).

## A concrete example of contract: Barrett reduction
Expand Down Expand Up @@ -89,7 +89,7 @@ further formal verification and for documentation purposes.

Consider the `encrypt` and `decrypt` functions below. Those functions
have no precondition, don't have particularly interesting properties
individually. However, the compostion of the two yields an useful
individually. However, the composition of the two yields an useful
property: encrypting a ciphertext and decrypting the result with a
same key produces the ciphertext again. `|c| decrypt(c, key)` is the
inverse of `|p| encrypt(p, key)`.
Expand Down

0 comments on commit 8455f76

Please sign in to comment.