@@ -2965,6 +2965,7 @@ effects of the expression's evaluation.
2965
2965
* Ref.Expr.Alt :: Expression for complex conditional branching.
2966
2966
* Ref.Expr.Prove :: Expression for static assertion of typestate.
2967
2967
* Ref.Expr.Check :: Expression for dynamic assertion of typestate.
2968
+ * Ref.Expr.Claim :: Expression for static (unsafe) or dynamic assertion of typestate.
2968
2969
* Ref.Expr.Assert :: Expression for halting the program if a
2969
2970
boolean condition fails to hold.
2970
2971
* Ref.Expr.IfCheck :: Expression for dynamic testing of typestate.
@@ -3629,6 +3630,26 @@ fn test() @{
3629
3630
@}
3630
3631
@end example
3631
3632
3633
+ @node Ref.Expr.Claim
3634
+ @subsection Ref.Expr.Claim
3635
+ @c * Ref.Expr.Claim:: Expression for static (unsafe) or dynamic assertion of typestate.
3636
+ @cindex Claim expression
3637
+ @cindex Typestate system
3638
+
3639
+ A @code {claim } expression is an unsafe variant on a @code {check } expression
3640
+ that is not actually checked at runtime. Thus, using a @code {claim } implies a
3641
+ proof obligation to ensure--- without compiler assistance--- that an assertion
3642
+ always holds.
3643
+
3644
+ With a command-line flag, the compiler can turn all @code {claim } expressions
3645
+ into @code {check } expressions, but the default is to not check the assertion
3646
+ contained in a @code {claim }.
3647
+
3648
+ The idea is to use @code {check } during development, with @code {claim }
3649
+ providing the freedom to disable a few runtime checks in performance-critical
3650
+ locations once code is debugged, while leaving the @code {claim } expressions in
3651
+ the code as documentation.
3652
+
3632
3653
@node Ref.Expr.IfCheck
3633
3654
@subsection Ref.Expr.IfCheck
3634
3655
@c * Ref.Expr.IfCheck:: Expression for dynamic testing of typestate.
0 commit comments