File: errors.rst

package info (click to toggle)
gappa 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,316 kB
  • sloc: cpp: 11,864; python: 59; makefile: 19; sh: 5
file content (351 lines) | stat: -rw-r--r-- 9,798 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
Warning and error messages
==========================

Syntax error messages
---------------------

Error: foobar at line 17 column 42.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Bison front-end has detected a syntax error at the given location.
The error message is usually unusable, so let us hope the location is
enough for you to find what the problem is.

.. code-block:: gappa

   f(x) = x + 1;

::

   Error: syntax error, unexpected '(', expecting FUNID or '=' at line 1 column 2

Error: unrecognized option 'bar'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Gappa was invoked with an unknown option.

Variant: ``unrecognized option 'bar' at line 42``. This error is displayed
for options embedded in the script.

Error: redefinition of identifier 'foo'...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A symbol cannot be defined more than once, even if the right hand sides
of every definitions are equivalent.

.. code-block:: gappa

   a = 1;
   a = 1;

Nor can it be defined after being used as an unbound variable.

.. code-block:: gappa

   b = a * 2;
   a = 1;

Error: invalid parameters for 'foo'...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A function template has been instantiated with an incorrect number of
parameters or with parameters of the wrong type.

.. code-block:: gappa

   x = float<ieee_32,0>(y);

::

   Error: invalid parameters for 'float' at line 1 column 20

Error: incorrect number of arguments for 'foo'...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are either less or more expressions between parentheses than
expected by the function.

.. code-block:: gappa

   x = int<zr>(y, z);

::

   Error: incorrect number of arguments for 'fixed<0,zr>' at line 1 column 17

Other error messages during parsing
-----------------------------------

Error: undefined intervals are restricted to conclusions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You are not allowed to use an interrogation mark for an interval that
appears in negative position in the logical formula.

.. code-block:: gappa

   { x in ? -> x + 1 in [0,1] }

Error: the range of foo is an empty interval.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

An interval has been interpreted as having reverted bounds.

.. code-block:: gappa

   { x in [2,1] }

::

   Error: the range of x is an empty interval.

Interval bounds are replaced by binary floating-point numbers. As a
consequence, Gappa can encounter an empty interval when it tightens a
range appearing in a goal. For example, the empty set is the biggest
representable interval that is a subset of the singleton {1.3}. So Gappa
fails to prove the following property.

.. code-block:: gappa

   { 1.3 in [1.3,1.3] }

::

   Error: the range of 13e-1 is an empty interval.

Error: zero appears as a denominator in a rewriting rule.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Gappa has a detected that a divisor is trivially equal to zero in an
expression that appears in a rewriting rule. This is most certainly an
error.

.. code-block:: gappa

   { 1 in ? }
   y -> y * (x - x) / (x - x);

Proof failures
--------------

Error: no contradiction was found.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The logical formula had no property in negative position or Gappa has
discharged all of them, yet this was not sufficient to prove the
formula.

.. code-block:: gappa

   { x in [1,2] -> not x + 1 in [2,3] }

Error: some enclosures were not satisfied.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Only part of a conjunction of goals was proved to be true. Gappa was
unable to prove some other expressions or formulas, which are displayed
after the message.

.. code-block:: gappa

   { x in [1,2] -> x + 1 in ? /\ x + 2 in [2,3] }

::

   Warning: case split on x + 2 has not produced any interesting new result.
   Results:
     x + 1 in [2, 3]
   Error: some properties were not satisfied:
     BND(x + 2), best: [3, 4]

.. _warning-messages1:

Warning messages during parsing
-------------------------------

Warning: renaming identifier 'foo' as 'bar'...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When a definition ``foo = expr`` is given to Gappa, the name ``foo`` is
associated to the expression ``expr``. This name is then used whenever
Gappa outputs ``expr``. If another definition ``bar = expr`` is later
provided, the new name supersedes the name given previously.

.. code-block:: gappa

   a = 42;
   b = 42;
   { a - b in ? }

::

   Warning: renaming identifier 'a' as 'b' at line 2 column 7
   b - b in [0, 0]

Warning: the expression foo has been assumed to be nonzero when checking a rewriting rule.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When Gappa verifies that both sides of a user rewriting rule are
equivalent, it does not generate additional constraints to verify that
denominators appearing in the expressions are not zero. For example, the
rule ``1 / (1 / x) -> x`` only applies when ``x`` is not zero; yet Gappa
does not test for it.

No warning messages are displayed when constraints are added to the
rewriting rule (whether these constraints are sufficient or not). E.g.
``1 / (1/ x) -> x { x <> 0 }``.

This warning is controlled by options :option:`-Wnull-denominator`
and :option:`-Wno-null-denominator`.

Warning: foo and bar are not trivially equal.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When Gappa verifies the rule ``foo -> bar``, it first performs the
subtraction of both sides. Then it normalizes this expression in the
field of polynomial fractions with integer coefficients. If this result
is not zero, Gappa warns about it.

As the normalization only deals with polynomials and integers, false
positive may appear when the expressions involve numerical values or
square roots or absolute values.

.. code-block:: gappa

   { 1 in ? }
   x * (y - 2) -> x * y - x;  # not equal
   1b-2 -> 0.2 + 0.05;        # equal, but needs numerical computations
   sqrt(x * x) -> |x|;        # equal, but involves square root and absolute value

::

   Warning: x * (y - 2) and x * y - x are not trivially equal.
            Difference: -(x)
   Warning: 1b-2 and 2e-1 + 5e-2 are not trivially equal.
            Difference: -(2e-1) - (5e-2) + (1b-2)
   Warning: sqrt(x * x) and |x| are not trivially equal.
            Difference: (sqrt(x * x)) - (|x|)
   Results:
     1 in [1, 1]

This warning is controlled by options :option:`-Whint-difference`
and :option:`-Wno-hint-difference`.

Warning: bar is a variable without definition, yet it is unbound.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Identifier ``bar`` neither represents an expression nor is it a sub-term
of any of the bounded expressions of the logical property. This may mean
an identifier was mistyped.

.. code-block:: gappa

   { x - x in ? }

::

   Warning: x is a variable without definition, yet it is unbound.


This warning is controlled by options :option:`-Wunbound-variable`
and :option:`-Wno-unbound-variable`.

Warning: no path was found for foo.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The expression ``foo`` appears in one of the goals, yet Gappa does not
have any theorem that could be used to compute this expression or one of
its sub-terms.

.. _warning-messages2:

Warning messages during proof computation
-----------------------------------------

Warning: when foo is in i1, bar cannot be proved.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When Gappa applies a case splitting ``bar $ foo``, it splits the
interval of ``foo`` until the property about ``bar`` holds for any
sub-interval. If the maximal dichotomy depth has been reached yet the
property still does not hold, the warning message displays the failing
sub-interval (the leftmost one).

.. code-block:: gappa

   { x in [-2,1] -> x / x in [1,1] }
   x / x $ x;

::

   Warning: when x is in [-1b-99 {-1.57772e-30, -2^(-99)}, 1b-100 {7.88861e-31, 2^(-100)}], BND(x / x, [1, 1]) cannot be proved.
   Error: some properties were not satisfied:
     BND(x / x)

This warning is controlled by options :option:`-Wdichotomy-failure`
and :option:`-Wno-dichotomy-failure`.

Warning: case split on foo has not produced any interesting new result.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This warning is displayed when Gappa is successful in finding a case
split that satisfies the goals, yet the results obtained on the
sub-intervals are not interesting: they have already been proved through
a simpler analysis.

.. code-block:: gappa

   { x in [1,2] -> x + 1 in ? }
   $ x;

::

   Warning: case split on x has not produced any interesting new result.
   Results:
     x + 1 in [2, 3]


This warning is controlled by options :option:`-Wdichotomy-failure`
and :option:`-Wno-dichotomy-failure`.

Warning: case split on foo has no range to split.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This warning is displayed when Gappa is unable to find the initial range
on which to split cases.

.. code-block:: gappa

   { x in [-1,1] -> 1 in ? }
   $ 1 / x;

::

   Warning: case split on 1 / x has no range to split.
   Results:
     1 in [1, 1]


This warning is controlled by options :option:`-Wdichotomy-failure`
and :option:`-Wno-dichotomy-failure`.

Warning: case split on foo is not goal-driven anymore.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This warning is displayed when Gappa is supposed to find the best case
split for proving a property, yet it does not know the range for this
property or it has already proved it.

.. code-block:: gappa

   { x in [-1,1] -> x + 1 in ? }
   x + 1 $ x;

::

   Warning: case split on x is not goal-driven anymore.
   Results:
     x + 1 in [0, 2]

This warning is controlled by options :option:`-Wdichotomy-failure`
and :option:`-Wno-dichotomy-failure`.