why3 issueshttps://gitlab.inria.fr/why3/why3/-/issues2021-07-13T14:40:01Zhttps://gitlab.inria.fr/why3/why3/-/issues/525destruct/case transformations incorrectly handle polymorphic formulas2021-07-13T14:40:01ZQuentin Garcherydestruct/case transformations incorrectly handle polymorphic formulasThe transformations `case` and `destruct` don't take into account the fact that the formula they are applied to can be implicitely quantified over a type variable.
This allows us to prove `false` in the following ways :
- apply `case (forall x y : 'a. x = y)` and pass the resulting tasks to Eprover
- first prove that `(forall x y : 'a. x = y) \/ (not forall x y : 'a. x = y)` (by calling CVC4 for example), apply `destruct` to this hypothesis and pass the resulting tasks to Eprover
**What's happening ?**
The formula `forall x y : 'a. x = y` should be understood as `forall 'a. forall x y : 'a. x = y`. When we apply `case` on this formula, the negation incorrectly goes under the type quantification in the second task.The transformations `case` and `destruct` don't take into account the fact that the formula they are applied to can be implicitely quantified over a type variable.
This allows us to prove `false` in the following ways :
- apply `case (forall x y : 'a. x = y)` and pass the resulting tasks to Eprover
- first prove that `(forall x y : 'a. x = y) \/ (not forall x y : 'a. x = y)` (by calling CVC4 for example), apply `destruct` to this hypothesis and pass the resulting tasks to Eprover
**What's happening ?**
The formula `forall x y : 'a. x = y` should be understood as `forall 'a. forall x y : 'a. x = y`. When we apply `case` on this formula, the negation incorrectly goes under the type quantification in the second task.1.4.0Andrei PaskevichAndrei Paskevichhttps://gitlab.inria.fr/why3/why3/-/issues/405Hide does not work2019-11-04T12:43:00ZDAILLER SylvainHide does not workOn the following simple goal, `hide t 1` does not work. It should be investigated.
```
axiom h: 1 = 3
goal G: forall x. x = 1
```On the following simple goal, `hide t 1` does not work. It should be investigated.
```
axiom h: 1 = 3
goal G: forall x. x = 1
```DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/399`apply with` and `rewrite with` should give more details (e.g., quantifier na...2019-10-28T11:38:53ZGuillaume Melquiond`apply with` and `rewrite with` should give more details (e.g., quantifier names) when the number of arguments do not matchDAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/380List transformation with arguments and documentation2019-11-22T15:21:38ZDAILLER SylvainList transformation with arguments and documentationDocument transformations with arguments with examples.
Investigate the possibility to have a more flexible parsing of list arguments in general (remove space constraint in particular `a, b, c`).Document transformations with arguments with examples.
Investigate the possibility to have a more flexible parsing of list arguments in general (remove space constraint in particular `a, b, c`).DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/377Why3 should not introduce spaces in identifiers2019-08-23T12:47:34ZDAILLER SylvainWhy3 should not introduce spaces in identifiersSpaces are introduced in identifiers in some cases. This makes it impossible for the user to use these identifiers in arguments of transformations.
An example with records is the following:
```
use int.Int
type r = {a : int; b : int}
let f (x y: r): bool
ensures {x.a = y.a}
=
true
```
To explicitly show the problem use the following transformations:
`introduce_premises`
`destruct_term x`
`assert (x2 = mk r x1 x)`
@marche suggest to use tick `'` instead of space because the user would still not be able to define those in .mlw file but they would be able to use them. Here, the result would be something along the lines of `r'mk`.
Note that spaces also appear in the names of goals: they could be removed in favor of `'` too. For example: `f'VC`.
On this issue, I will try to make a MR with the simple replacement of `mk ` with `'mk` to see if it could work. Note that I also expect to change accordingly any code that would recognize a record by looking if its name begins with `mk `.Spaces are introduced in identifiers in some cases. This makes it impossible for the user to use these identifiers in arguments of transformations.
An example with records is the following:
```
use int.Int
type r = {a : int; b : int}
let f (x y: r): bool
ensures {x.a = y.a}
=
true
```
To explicitly show the problem use the following transformations:
`introduce_premises`
`destruct_term x`
`assert (x2 = mk r x1 x)`
@marche suggest to use tick `'` instead of space because the user would still not be able to define those in .mlw file but they would be able to use them. Here, the result would be something along the lines of `r'mk`.
Note that spaces also appear in the names of goals: they could be removed in favor of `'` too. For example: `f'VC`.
On this issue, I will try to make a MR with the simple replacement of `mk ` with `'mk` to see if it could work. Note that I also expect to change accordingly any code that would recognize a record by looking if its name begins with `mk `.DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/367Trivial goals are not user-friendly2019-12-04T12:24:11ZGuillaume MelquiondTrivial goals are not user-friendlyWhen doing `split_vc` on the weakest precondition of `bar`
```
let foo () requires { true } = ()
let bar () = foo (); foo ()
```
we get two subgoals `true` marked as unknown. At this point, the user can either apply `split_vc` or launch a prover, on each subgoal. In both cases, this is a waste of user time and processor cycles. This becomes especially noticeable after !207, as the number of trivial goals greatly increases.
Two possible solutions:
1. Automatically mark `true` goals as proved.
2. Prevent `split_vc` from generating them.When doing `split_vc` on the weakest precondition of `bar`
```
let foo () requires { true } = ()
let bar () = foo (); foo ()
```
we get two subgoals `true` marked as unknown. At this point, the user can either apply `split_vc` or launch a prover, on each subgoal. In both cases, this is a waste of user time and processor cycles. This becomes especially noticeable after !207, as the number of trivial goals greatly increases.
Two possible solutions:
1. Automatically mark `true` goals as proved.
2. Prevent `split_vc` from generating them.https://gitlab.inria.fr/why3/why3/-/issues/366Incorrect goal location after splitting.2019-07-16T13:01:08ZGuillaume MelquiondIncorrect goal location after splitting.Testcase:
```
val bar (x:int): unit requires { x <> 0 }
let foo (x:int) : unit = bar x; bar x
```
When clicking the initially unique goal in the IDE, both calls `bar x` are properly highlighted as being the preconditions to prove. After splitting the goal, both goals cause the IDE to highlight the first call `bar x`, while the second goal is meant to be the precondition of the second call.
Note that this happens quite often in practice. For example, the fast exponentiation algorithm (or its variant, the ancient Egyptian multiplication) contains both divisions and modulos, which all have the same precondition, so all the goals point to the same location of the code.Testcase:
```
val bar (x:int): unit requires { x <> 0 }
let foo (x:int) : unit = bar x; bar x
```
When clicking the initially unique goal in the IDE, both calls `bar x` are properly highlighted as being the preconditions to prove. After splitting the goal, both goals cause the IDE to highlight the first call `bar x`, while the second goal is meant to be the precondition of the second call.
Note that this happens quite often in practice. For example, the fast exponentiation algorithm (or its variant, the ancient Egyptian multiplication) contains both divisions and modulos, which all have the same precondition, so all the goals point to the same location of the code.https://gitlab.inria.fr/why3/why3/-/issues/280induction_ty_arg_lex expected behavior2019-03-26T13:59:30ZDAILLER Sylvaininduction_ty_arg_lex expected behaviorThis is to investigate the behavior of induction_ty_arg_lex that apparently does not do induction on the right elements.
It was reported by users that on this:
```
goal list_simpl_r :
forall l1:list 'a, l2:list 'a, l:list 'a. (l1 ++ l) = (l2 ++ l) -> l1 = l2
```
It was impossible to make a recursion on ``l1``.
This issue should also investigate what changed in induction_ty_lex between 0.88 and 1.00 (on this same goal): apparently, the transformation is less clever.This is to investigate the behavior of induction_ty_arg_lex that apparently does not do induction on the right elements.
It was reported by users that on this:
```
goal list_simpl_r :
forall l1:list 'a, l2:list 'a, l:list 'a. (l1 ++ l) = (l2 ++ l) -> l1 = l2
```
It was impossible to make a recursion on ``l1``.
This issue should also investigate what changed in induction_ty_lex between 0.88 and 1.00 (on this same goal): apparently, the transformation is less clever.DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/269transformation replace should replace also under the conditions of `if`2019-02-12T12:55:05ZMARCHE Claudetransformation replace should replace also under the conditions of `if`Apparently `replace` does traverse the conditions of `if` termsApparently `replace` does traverse the conditions of `if` terms1.3.0DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/264destruct improvement with if then else2019-02-08T13:47:07ZDAILLER Sylvaindestruct improvement with if then elseThis issue to keep track of a suggestion by @bbecker to extend destruct to "if .. then .. else":
```
axiom H: if c1 then c2 else c3
```
destruct H would create two branches: one replacing `H` by `c1 `and `c2` and the other one replacing it with `~c1` and `c3`.
Note: Similar behavior can be done for `match`.This issue to keep track of a suggestion by @bbecker to extend destruct to "if .. then .. else":
```
axiom H: if c1 then c2 else c3
```
destruct H would create two branches: one replacing `H` by `c1 `and `c2` and the other one replacing it with `~c1` and `c3`.
Note: Similar behavior can be done for `match`.Benedikt BeckerBenedikt Beckerhttps://gitlab.inria.fr/why3/why3/-/issues/263Removing Inline_trivial2019-02-12T16:55:13ZDAILLER SylvainRemoving Inline_trivialHello,
I don't understand what this transformation is used for. At first, I thought it was there for optimization but it seems that removing it from the driver makes `cvc4 1.5` fail on some files (`bench/ce/array_mono.mlw`).
Am I misunderstanding the use of this transformation ? I think there may be a bug in the rest of the transformations used for CVC4 if not.Hello,
I don't understand what this transformation is used for. At first, I thought it was there for optimization but it seems that removing it from the driver makes `cvc4 1.5` fail on some files (`bench/ce/array_mono.mlw`).
Am I misunderstanding the use of this transformation ? I think there may be a bug in the rest of the transformations used for CVC4 if not.MARCHE ClaudeMARCHE Claudehttps://gitlab.inria.fr/why3/why3/-/issues/259improve destruct_alg2019-01-31T16:26:45ZMARCHE Claudeimprove destruct_algFeature wishes for improvements:
* allow user to provide the introduced names, e.g `destruct_alg t as x1,x2`
* rename it into something better, e.g. `destruct_term`.Feature wishes for improvements:
* allow user to provide the introduced names, e.g `destruct_alg t as x1,x2`
* rename it into something better, e.g. `destruct_term`.DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/238Improve case transformation2019-06-18T07:58:40ZDAILLER SylvainImprove case transformationIt is my feeling that VC generation/split often produces hypotheses containing implications with the same premises (or its negation) such as:
```
H: P -> A
H1: not P -> B
H2: P -> C
```
On these cases, I think the user would like `case P` to remove unsatisfiable hypothesis and premises. This would give two new context:
```
H: A
H2: C
H3: P
```
and
```
H1: B
H: not P
```It is my feeling that VC generation/split often produces hypotheses containing implications with the same premises (or its negation) such as:
```
H: P -> A
H1: not P -> B
H2: P -> C
```
On these cases, I think the user would like `case P` to remove unsatisfiable hypothesis and premises. This would give two new context:
```
H: A
H2: C
H3: P
```
and
```
H1: B
H: not P
```DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/235Avoid substituting to proxy symbols2018-11-16T09:02:53ZDAILLER SylvainAvoid substituting to proxy symbolsWhen using `subst_all` or `split_vc`, it is not rare to substitute variables to a proxy symbol:
```
H : r = (o [@mlw_proxy_symbol])
Goal : r + r = 5
```
With `subst_all` or `split_vc` would become:
`Goal: o + o = 5`
I think it is better to do the substitution from the other side.When using `subst_all` or `split_vc`, it is not rare to substitute variables to a proxy symbol:
```
H : r = (o [@mlw_proxy_symbol])
Goal : r + r = 5
```
With `subst_all` or `split_vc` would become:
`Goal: o + o = 5`
I think it is better to do the substitution from the other side.DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/232instantiate should be able to remove the general hypothesis2019-09-24T10:34:43ZDAILLER Sylvaininstantiate should be able to remove the general hypothesisAdd an optional argument so that on hypothesis:
`H : forall x. x = 0`
`instantiate H 1` generate the following hypotheses (name change and remove hypothesis):
`H : 1 = 0`
instead of
```
H : forall x. x = 0
H_inst : 1 = 0
```Add an optional argument so that on hypothesis:
`H : forall x. x = 0`
`instantiate H 1` generate the following hypotheses (name change and remove hypothesis):
`H : 1 = 0`
instead of
```
H : forall x. x = 0
H_inst : 1 = 0
```DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/231Add a transformation destruct*2018-11-08T10:28:04ZDAILLER SylvainAdd a transformation destruct*Add a transformation that performs destruct recursively on an hypothesis. It should handle all currently handled constructs: disjunction, conjunction, implications.
```
predicate p1
predicate p2
predicate p3
axiom H: p1 -> p2 -> p3
goal G: 1 = 1
```
destruct H should produce 3 new goals for p1, p2 and H : p3 |- G ?
[EDIT: To be more clear]
This should produce 3 new subgoals which are the following:
```
predicate p1
predicate p2
predicate p3
goal G : p1
```
```
predicate p1
predicate p2
predicate p3
goal G : p2
```
```
predicate p1
predicate p2
predicate p3
axiom H : p3
goal G : 1 = 1
```
Sorry for the misleading notations.Add a transformation that performs destruct recursively on an hypothesis. It should handle all currently handled constructs: disjunction, conjunction, implications.
```
predicate p1
predicate p2
predicate p3
axiom H: p1 -> p2 -> p3
goal G: 1 = 1
```
destruct H should produce 3 new goals for p1, p2 and H : p3 |- G ?
[EDIT: To be more clear]
This should produce 3 new subgoals which are the following:
```
predicate p1
predicate p2
predicate p3
goal G : p1
```
```
predicate p1
predicate p2
predicate p3
goal G : p2
```
```
predicate p1
predicate p2
predicate p3
axiom H : p3
goal G : 1 = 1
```
Sorry for the misleading notations.DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/226Restricting behavior of rewrite_list2018-11-07T09:37:53ZDAILLER SylvainRestricting behavior of rewrite_listHello,
Currently `rewrite_list` uses the argument `with_terms` but I think it is difficult for the user to understand what these with_terms corresponds to with this transformation. This list of terms is supposed to be used by `apply/rewrite` after matching. For example,
```
module Rewrite
use int.Int
function f int : int
predicate p int
axiom A: forall a. f (a+1) = f 42
axiom B: forall a. f a = f (43 + 1)
goal g : 5 = f 42
end
```
`rewrite <- A with 43 (* To instantiate a *)`
`rewrite <- B with 43 (* To instantiate a *)`
To me, it makes less sense to try to do the same when rewriting several hypothesis at once:
`rewrite_list <- A,B with 43`
Also, I am not sure that it works when trying to instantiate with a different value for A and B. Should we remove this feature ?Hello,
Currently `rewrite_list` uses the argument `with_terms` but I think it is difficult for the user to understand what these with_terms corresponds to with this transformation. This list of terms is supposed to be used by `apply/rewrite` after matching. For example,
```
module Rewrite
use int.Int
function f int : int
predicate p int
axiom A: forall a. f (a+1) = f 42
axiom B: forall a. f a = f (43 + 1)
goal g : 5 = f 42
end
```
`rewrite <- A with 43 (* To instantiate a *)`
`rewrite <- B with 43 (* To instantiate a *)`
To me, it makes less sense to try to do the same when rewriting several hypothesis at once:
`rewrite_list <- A,B with 43`
Also, I am not sure that it works when trying to instantiate with a different value for A and B. Should we remove this feature ?Raphaël Rieu-HelftRaphaël Rieu-Helfthttps://gitlab.inria.fr/why3/why3/-/issues/210--list-transform should print all transformations2018-11-13T08:45:47ZDAILLER Sylvain--list-transform should print all transformations`--list-transform` should also print transformation with arguments.`--list-transform` should also print transformation with arguments.DAILLER SylvainDAILLER Sylvainhttps://gitlab.inria.fr/why3/why3/-/issues/195New split_vc sometimes crashes2018-10-05T09:26:19ZRaphaël Rieu-HelftNew split_vc sometimes crashesFollowing commit 22ab5177b, attempting to use split_vc on lemma `valuation_monotonous` in `examples/multiprecision/valuation.mlw` results in a failure (with the new popup!) due to an uncaught NoTerminationProof exception.Following commit 22ab5177b, attempting to use split_vc on lemma `valuation_monotonous` in `examples/multiprecision/valuation.mlw` results in a failure (with the new popup!) due to an uncaught NoTerminationProof exception.1.1.0MARCHE ClaudeMARCHE Claudehttps://gitlab.inria.fr/why3/why3/-/issues/188Modify split_vc to not use simplify_trivial_quantification2018-10-04T13:07:54ZRaphaël Rieu-HelftModify split_vc to not use simplify_trivial_quantification1.1.0MARCHE ClaudeMARCHE Claude