Skip to content

Commit 3f4a476

Browse files
author
davidcok
committed
Editing
1 parent b236a87 commit 3f4a476

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

tutorial/ArithmeticModes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ as mathematical---that is, that specifications use infinite precision arithmetic
3131
Consequently, JML defines three *arithmetic modes* (for integer arithmetic):
3232

3333
* 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
3535
* Math (bigint) mode: Values and operations are in mathematical arithmetic---values are unbounded and so there is no over/underflow.
3636

3737
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(...)
8383
These each take one argument and return the value of the argument, but the
8484
argument expression is computed using the given mode. These operations are
8585
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`
8888
* 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).
9090
In this example, both the code and specs are computed with java math, so they agree, even when there is an overflow.
9191

9292
```

tutorial/T_show4.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
( openjml --esc T_show4.java ) 2>&1 | diff - T_show4.out
2+
echo "T_show4.check is nondeterministic -- check it by hand"

tutorial/Visibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ obviates the goal of having hidden an implementation in the first place. If an
3838
implementation is hidden in private declarations, exposed to a client only through
3939
public methods, then we need a specification idiom that respects that.
4040

41-
That is one purpose of model fields, which are preented in the [next lesson](ModelFields).
41+
That is one purpose of model fields, which are presented in a [subsequent lesson](ModelFields).
4242
But here we'll repeat our example using a model field.
4343

4444
```

tutorial/WellDefinedExpressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The rules for well-definedness of a JML expression build up from the leaves of t
3030
* `a.length` is well-defined if `a` is well-defined and not null
3131
* `a[i]` is well-defined if expressions `a` and `i` are well-defined, `a` is not null, and `0 <= i < a.length`
3232
* 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
3434
* 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
3535
* 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
3636
* a `==>` expression is well-defined if the left operand is well-defined and,

0 commit comments

Comments
 (0)