Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjitjhala committed Sep 21, 2020
1 parent a507847 commit da96f82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Tutorial_04_Polymorphism.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@ absoluteSum = undefined
\newthought{Inference}
LiquidHaskell verifies `vectorSum` -- or, to be precise,
the safety of the vector accesses `vec ! i`.
**Note** you need to run `liquid` with the option `--no-termination` or make
sure your source file has `{-@ LIQUID "--no-termination" @-}.
The verification works out because LiquidHaskell is able to
*automatically infer* ^[In your editor, click on `go` to see the inferred type.]
Expand All @@ -317,6 +315,12 @@ between `0` and the length of `vec` (inclusive). LiquidHaskell
uses this and the test that `i < sz` to establish that `i` is
between `0` and `(vlen vec)` to prove safety.
**Note** you need to run `liquid` with the option `--no-termination`
or make sure your source file has `{-@ LIQUID "--no-termination" @-},
otherwise the code for `go` fails the now default termination check.
We will come back to this example later to see how to verify termination
using metrics.
<div class="hwex" id="Off by one?">
Why does the type of `go` have `v <= sz` and not `v < sz` ?
</div>
Expand Down

0 comments on commit da96f82

Please sign in to comment.