Skip to content

Commit e7d0aea

Browse files
fosslinuxAurel300
authored andcommitted
Remove import <decreases/*.vpr>
It is no longer needed since release 2023.7 to import, they are imported automatically. Signed-off-by: Samuel Tyler <samuel@samuelt.me>
1 parent 1a772f7 commit e7d0aea

6 files changed

Lines changed: 1 addition & 18 deletions

src/termination-conditional.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ Here, `<condition>` is a boolean expression under which the decreases clause is
1818
The following example illustrates combined conditional termination clauses: function `sign` promises to decrease `x` if positive, and something (wildcard) if `x` is negative. In case `x` is zero, function `sign` does not (promise to) terminate.
1919

2020
```viper,editable,playground
21-
import <decreases/int.vpr>
22-
2321
function sign(x: Int): Int
2422
decreases x if 1 <= x
2523
decreases _ if x <= -1

src/termination-custom-orders.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ As previously mentioned, Viper offers [predefined orders](./termination-measures
55
In the remainder of this subsection, both approaches will be illustrated using a combination of the `MyInt` example (from the earlier subsection on domains) and a `factorial` function operating on `MyInt`. In the example below, the destructor `get` is used to map a `MyInt` to a regular `Int`, which indirectly allows using `MyInt` in the function's decreases clause.
66

77
```viper,editable,playground
8-
import <decreases/int.vpr>
9-
108
domain MyInt {
119
function put(i: Int): MyInt // Constructor
1210
function get(m: MyInt): Int // Destructor

src/termination-measures.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Here, `<tuple>` denotes the termination measure: a tuple of comma-separated expr
1111
A common example for termination is the standard `factorial` function, which terminates because its argument decreases with respect to the usual well-founded order over non-negative numbers.
1212

1313
```viper,editable,playground
14-
import <decreases/int.vpr>
15-
1614
function factorial(n:Int) : Int
1715
requires 0 <= n
1816
decreases n
@@ -25,7 +23,7 @@ Viper successfully verifies that `factorial` terminates: at each recursive invoc
2523

2624
## Predefined Well-Founded Orders {#term_prov_wfo}
2725

28-
Viper's standard library provides definitions of well-founded orders for most types built into Viper, all of which can be imported from the `decreases` folder. The following table lists all provided orders; we write `s1 <_ s2` if `s1` is less than `s2` with respect to the order.
26+
Viper's standard library provides definitions of well-founded orders for most types built into Viper. They are automatically imported upon use of a `decreases` statement. Alternatively, they can also be imported from the `decreases` folder. The following table lists all provided orders; we write `s1 <_ s2` if `s1` is less than `s2` with respect to the order.
2927

3028
| Build-In Type<br>(file name) | Provided Well-Founded Order |
3129
| ---- | ---- |
@@ -44,8 +42,6 @@ All definitions are straightforward, except the last one, which is concerned wit
4442
Viper uses this nesting depth to enable termination checks based on predicate instances, as illustrated by the next example, the recursive computation of the length of a linked list: intuitively, the remainder of the linked list, represented by predicate instance `list(this)`, is used as the termination measure. This works because the recursive call is nested under the unfolding of `list(this)`, and takes the smaller predicate instance `list(this.next)`.
4543

4644
```viper,editable,playground
47-
import <decreases/predicate_instance.vpr>
48-
4945
field next: Ref
5046
5147
predicate list(this: Ref) {

src/termination-mutual-recursion.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ For mutually recursive functions, Viper implements the following approach (as, e
55
A simple case of mutual recursion is illustrated next, by functions `is_even` and `is_odd`:
66

77
```viper,editable,playground
8-
import <decreases/int.vpr>
9-
108
function is_even(x: Int): Bool
119
requires x >= 0
1210
decreases x
@@ -27,9 +25,6 @@ Consider function `is_even`: its termination measure `x` decreases at the indire
2725
In the example above, the two termination measures are tuples of equal length and type. However, this is not required of mutually recursive functions in order to prove their termination. Consider the next example (which verifies successfully):
2826

2927
```viper,editable,playground
30-
import <decreases/int.vpr>
31-
import <decreases/bool.vpr>
32-
3328
function fun1(y: Int, b: Bool): Int
3429
decreases y, b
3530
{

src/termination-statement.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ The currently implemented approach to checking termination of methods is similar
5959
A straightforward example is method `sum`, shown next:
6060

6161
```viper,editable,playground
62-
import <decreases/int.vpr>
63-
6462
method sum(n: Int) returns (res: Int)
6563
requires 0 <= n
6664
decreases

src/termination-syntax.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Special cases, such as empty tuples, tuples of different length, and tuples of d
1515
A typical example of a function for which a tuple as termination measure is used, is the Ackermann function:
1616

1717
```viper,editable,playground
18-
import <decreases/int.vpr>
19-
2018
function ack(m:Int, n:Int):Int
2119
decreases m, n
2220
requires m >= 0

0 commit comments

Comments
 (0)