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/ArithmeticModes.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ as mathematical---that is, that specifications use infinite precision arithmetic
31
31
Consequently, JML defines three *arithmetic modes* (for integer arithmetic):
32
32
33
33
* Java mode: arithmetic behaves precisely as in Java, with silent wrap-around of overflowing and underflowing operations
34
-
* Safe mode: the results of arithmetic operations are the same as in Java mode, but verification errors are issued if the operation may overflow
34
+
* Safe mode: the results of arithmetic operations are the same as in Java mode, but verification errors are issued if the operation may over/underflow
35
35
* Math (bigint) mode: Values and operations are in mathematical arithmetic---values are unbounded and so there is no over/underflow.
36
36
37
37
The default is *safe mode* for expressions in Java code and *math mode* for
@@ -83,10 +83,10 @@ specific arithmetic mode using the functions `\java_math(...)`, `\safe_math(...)
83
83
These each take one argument and return the value of the argument, but the
84
84
argument expression is computed using the given mode. These operations are
85
85
not available for Java code, because there are no such operations in Java.
86
-
* The mode for a proof attempt using OpenJML can be set using command-line options: `-code-math=...` and `-spec-math=...` to set the mode for Java code and specifications, respectively, with possible values of `java`, `safe`, and `bigint`.
87
-
For example, to turn off overflow warnings in the Java code one can set the global default using `-code-math=java`
86
+
* The mode for a proof attempt using OpenJML can be set using command-line options: `--code-math=...` and `--spec-math=...` to set the mode for Java code and specifications, respectively, with possible values of `java`, `safe`, and `bigint`.
87
+
For example, to turn off overflow warnings in the Java code one can set the global default using `--code-math=java`
88
88
* You can set the mode for a particular method using the modifiers
89
-
`code_java_math`, `spec_java_math`, `code_safe_math`, `spec_safe_math` and `spec_bigint_math` (`code-bigint-math` is not an operational mode at present).
89
+
`code_java_math`, `spec_java_math`, `code_safe_math`, `spec_safe_math` and `spec_bigint_math` (`code_bigint_math` is not an operational mode at present).
90
90
In this example, both the code and specs are computed with java math, so they agree, even when there is an overflow.
Copy file name to clipboardExpand all lines: tutorial/WellDefinedExpressions.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
@@ -30,7 +30,7 @@ The rules for well-definedness of a JML expression build up from the leaves of t
30
30
*`a.length` is well-defined if `a` is well-defined and not null
31
31
*`a[i]` is well-defined if expressions `a` and `i` are well-defined, `a` is not null, and `0 <= i < a.length`
32
32
* all unary and binary operator expressions (excluding `&&` and `||` and `==>`)
33
-
are well-defined if (a) the operands are well-defined, (b) for division (`/`) and modulo (`%`), the right operand is not zero, (c) the result of the operation is in range of the result type (depending on the [arithmetic mode](ArithmeticModes), and (d) for bit-shift operations (`<<`, `>>`, '>>>`), the value is the right operand is non-negative and less than the number of bits in the type of the left operand
33
+
are well-defined if (a) the operands are well-defined, (b) for division (`/`) and modulo (`%`), the right operand is not zero, (c) the result of the operation is in range of the result type (depending on the [arithmetic mode](ArithmeticModes)), and (d) for bit-shift operations (`<<`, `>>`, `>>>`), the value of the right operand is non-negative and less than the number of bits in the type of the left operand
34
34
* the short-circuiting `&&` is well-defined if the left operand is well-defined and, if the left operand is true, the right operand is well-defined
35
35
* the short-circuiting `||` is well-defined if the left operand is well-defined and, if the left operand is false, the right operand is well-defined
36
36
* a `==>` expression is well-defined if the left operand is well-defined and,
0 commit comments