You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial/Debugging.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ First note that there are different kinds of problems that can lead to a failed
15
15
* The prover is missing some vital information that prevents it from making the necessary proof steps. For this situation you can add lemmas or other assumptions [here](Lemmas).
16
16
17
17
It is worth restating a few points:
18
-
* Just because a specification and implementation agree (`openjml` verifies) does not mean that they are correct. They could still be both wrong in the same way compared to what is really desired of the program. Careful human review and understanding of requirements cannot replace either traditional testing or verification, though both of those are necessary in giving confidence in a program's correctness.
18
+
* Just because a specification and implementation agree (`openjml` verifies) does not mean that they are correct. They could still be both wrong in the same way compared to what is really desired of the program. Careful human review and understanding of requirements cannot be replaced by either traditional testing or verification, though both of those are necessary in giving confidence in a program's correctness.
19
19
* The techniques presented here are largely specific to `openjml`, at least in the details. Each tool and prover has different ways in which it has difficulties, though some general ideas and techniques may translate from one situation to another.
20
20
* Start with simple problems, understand them well, and then move on to complex situations.
Copy file name to clipboardExpand all lines: tutorial/InspectingCounterexamples.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ which produces
25
25
{% include_relative T_show2.out %}
26
26
```
27
27
The values shown are the result of a non-deterministic search; they might very well be different values on subsequent runs.
28
-
Nevertheless, for the values of `a`, `b`, `c`, and `d` shown here, the result is equal to `b` or `d`, instead of, for these values, the value of `a`.
28
+
Nevertheless, for the values of `a`, `b`, `c`, and `d` shown here, the result is equal to `b`, instead of, for these values, the value of `d`.
29
29
Some code inspection shows that there is a cut&paste error on line 9.
30
30
31
31
The counterexample is always in terms of concrete values --- that is how the underlying solvers work. One would much rather have a symbolic condition that represents the cases that fail, but that is beyond the current state of the art. At present, the best one can do is do some human induction based on a few examples to understand when a program or its specification fails.
Copy file name to clipboardExpand all lines: tutorial/type-bigint.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,9 @@ type `\bigint` and `i` a value of a Java numeric type.
20
20
*`j / k` is mathematical integer division (truncation toward zero); `k` must not be 0; `j/k` is negative or zero if `j` and `k` have different signs and is positive or zero if `j` and `k` have the same sign
21
21
*`j % k` is mathematical integer modulo, but is similar to Java's `%` operation: `k` may not be zero, `j%k` has the same sign as `j` and is independent of the sign of `k`, and for `k != 0`, `(j/k)*k + (j%k) == j`
22
22
*`<` and `<=` and `>` and `>=` have their expected meanings with the result type being boolean
23
-
* casts are allowed to and from other numeric types, such as `(\bigint)i` or `(int)j`. When casting from `\bigint` to a bounded type, a range check is performed, depending on the [arithmetic mode](ArithmeticModes).
23
+
* implicit conversions are allowed from Java integral types to `\bigint`
24
+
* casts are allowed to and from other numeric types, such as `(\bigint)i` or `(int)j`. When casting from `\bigint` to a bounded type, a range check is performed, depending on the [arithmetic mode](ArithmeticModes); when casting from `\real`, `double`, or `float`, the value is truncated toward zero.
25
+
* implicit conversion of `java.math.BigInteger` to `\bigint` is permitted; use `i.bigValue()` to convert a `\bigint` value `i` to `java.math.BigInteger`
Copy file name to clipboardExpand all lines: tutorial/type-real.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,10 @@ type `\real`.
17
17
*`j - k` is mathematical real subtraction
18
18
*`j * k` is mathematical real multiplication
19
19
*`j / k` is mathematical real division (not rounded to an integer); `k` must not be 0
20
-
*`j % k` is mathematical real modulo, but is similar to Java's `%` operation: `k` may not be zero, `j%k` has the same sign as `j` and is independent of the sign of `k`, and for `k != 0`, `(j/k)*k + (j%k) == j`.
20
+
*`j % k` is mathematical real modulo, but is similar to Java's `%` operation: `k` may not be zero, `j%k` has the same sign as `j` and is independent of the sign of `k`, and for `k != 0`, `((\bigint)(j/k))*k + (j%k) == j`.
21
21
*`<` and `<=` and `>` and `>=` have their expected meanings with the result type being boolean
22
-
* casts are allowed to and from other numeric types, such as `(\bigint)j`, which truncates towards zero.
22
+
* implicit conversions are allowed from `double`, `real`, `\bigint` and Java integral types
23
+
* explicit casts are allowed to and from other numeric types, such as `(\bigint)j`, which truncates towards zero.
23
24
24
25
```diff
25
26
! Caveat: Though real numbers are supported in OpenJML, the connection between real numbers and floating point numbers is incomplete and in some cases (such as handling NaN and infinite fp numbers) wrong
@@ -32,7 +33,7 @@ type `\real`.
32
33
//@ set rr = r * 2;
33
34
```
34
35
35
-
As for `\bigint`, many of the methods in `java.lang.Math` have been specified for `real` values:
36
+
Just like for `\bigint`, many of the methods in `java.lang.Math` have been specified for `real` values:
0 commit comments