@@ -135,13 +135,41 @@ producing detailed error information, in the form of an HTML error
135
135
report.
136
136
137
137
Let’s return to the type error from earlier -- ` add ` without
138
- precondition -- and take a closer look at this report. It
139
- comprises two sections:
140
-
141
- <!-- TODO: BCP: It looks quite different now! -->
138
+ precondition -- and take a closer look at this report.
142
139
143
140
_ CN error report_
144
- ![ * CN error report* ] ( images/0.error.png )
141
+ ![ * CN error report: 0* ] ( images/0_error.png )
142
+
143
+ _ Definitions and constraints not handled automatically_
144
+
145
+ CN checks that the code matches its specification with the help of an SMT
146
+ solver. CN passes a set of constraints along with program context to the SMT
147
+ solver, which either confirms that a given constraint will always hold in
148
+ that program context, provides a counterexample in which the constraint does
149
+ not hold, or times out. To avoid timeouts, CN avoids passing some definitions
150
+ to the solver, including recursive functions, some predicates with branching,
151
+ and constraints with ` forall ` . The error file displays in this section which
152
+ definitions and constraints CN did not pass to the solver.
153
+
154
+ _ Resources that do not satisfy predicate definitions_
155
+
156
+ Because CN does not pass certain definitions to the solver, it may return
157
+ spurious counterexamples that do not respect those definitions. Consider this
158
+ example:
159
+
160
+ ![ * CN error report: string* ] ( images/string_error.png )
161
+
162
+ ` String ` is a predicate representing a null-terminated string.
163
+ In general, CN does not know how much to unfold the mutually recursive
164
+ predicates ` String ` and ` StringAux ` , so it does not pass their full
165
+ definition to the solver. This leads to a spurious counterexample: ` sIn ` is the
166
+ singleton string containing exactly the null character ` 0u8 ` . This is
167
+ impossible; the predicate leaves out the null when constructing the logical
168
+ representation of a string. To make clear that this is a bad counterexample,
169
+ the error file lists ` String(s) (sIn) ` under _ Resources that do not satisfy
170
+ predicate definitions_ .
171
+
172
+ <!-- TODO: BCP: It looks quite different now! -->
145
173
146
174
_ Path to error._ The first section contains information about the
147
175
control-flow path leading to the error.
0 commit comments