Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Why3
why3
Commits
efc4acd8
Commit
efc4acd8
authored
Sep 16, 2014
by
MARCHE Claude
Browse files
document transformations, update CHANGES
parent
8fb416d3
Changes
2
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
129 additions
and
26 deletions
+129
26
CHANGES
CHANGES
+26
0
doc/technical.tex
doc/technical.tex
+103
26
No files found.
CHANGES
View file @
efc4acd8
* marks an incompatible change
langage
* fix a soundness bug in the detection of aliases when calling a
WhyML function: some alias could have been forgotten when a type
variable was substituted with a mutable types
sessions
o use the full path of identifiers when the user introduces namespaces
(BTS #17181)
transformations
* fix a soundness bug in "compute_in_goal" regarding the handling of
logical implication.
o several improvements to "compute_in_goal":
. lefthand side of rewrite rules can be any symbols, not only
noninterpreted ones.
. preform betareduction when possible
. the maximal number of reduction steps can be enlarged using meta
"compute_max_steps"
. unfolding of definitions can be controlled using meta
"rewrite_def"
. the transformation is documented in details in the manual
o fixed a bug in "eliminate_if" when applied on inductive definitions
provers
o fixed wrong warning when detecting Isabelle2014
version 0.84, September 1, 2014
===============================
...
...
doc/technical.tex
View file @
efc4acd8
...
...
@@ 141,9 +141,11 @@ are applied to goals.
\section
{
Transformations
}
\label
{
sec:transformations
}
Here is a quick documentation of provided transformations. We give
first the nonsplitting ones,
\eg
those which produce one goal as
result, and others which produces any number of goals.
This section documents the available transformations. We first
describe the most important ones, and then we provide a quick
documentation of the others, first the nonsplitting ones,
\eg
those
which produce exactly one goal as result, and the others which produce any
number of goals.
Notice that the set of available transformations in your own
installation is given by
...
...
@@ 152,7 +154,97 @@ why3 listtransforms
\end{verbatim}
\index
{
listtransforms@
\verb
+
listtransforms
+
}
\subsection
{
Nonsplitting transformations
}
\subsection
{
Inlining definitions
}
Those transformations generally amount to replace some applications of
function or predicate symbols with its definition.
\begin{description}
\item
[inline\_trivial]
expands and removes definitions of the form
\begin{whycode}
function f x
_
1 ... x
_
n = (g e
_
1 ... e
_
k)
predicate p x
_
1 ... x
_
n = (q e
_
1 ... e
_
k)
\end{whycode}
when each
$
e
_
i
$
is either a ground term or one of the
$
x
_
j
$
, and
each
$
x
_
1
\dots
x
_
n
$
occurs at most once in all the
$
e
_
i
$
.
\item
[inline\_goal]
expands all outermost symbols of the goal that
have a nonrecursive definition.
\item
[inline\_all]
expands all nonrecursive definitions.
\end{description}
\subsection
{
Induction Transformations
}
\begin{itemize}
\item
Induction of an algebraic data type:
\verb

induction_ty_lex

[TO BE COMPLETED]
\item
Induction on a inductive predicate:
[TO BE COMPLETED]
\end{itemize}
\subsection
{
Simplification by Computation
}
The transformation
\verb

compute_in_goal

simplifies the goal by applying several kind of simplifications.
\begin{itemize}
\item
Computations with builtin symbols,
\eg
operations on integers,
when applied to explicit constants, are evaluated. This includes
evaluation of equality when a decision can be made (on integer
constants, on constructors of algebraic data types) and Boolean
evaluation. At best, these computation we reduce the goal to
\verb

true

and then just returns no subgoal. For example, a goal
like
\verb

6*7=42

is solved by this transformation.
\item
Unfolding of definitions, as done by
\verb

inline_goal

. By
default, all definitions are unfolded, including recursive ones. The
user can restrict the definitions that are unfolded using the meta
\verb

rewrite_def

attached to logic symbol,
\eg
\begin{whycode}
function sqr (x:int) : int = x * x
meta "rewrite
_
def" function sqr
\end{whycode}
once this meta is used, any other definitions are not unfolded.
\item
Rewriting using axioms or lemmas declared as rewrite rules. When
an axiom (or a lemma) has one of the form
\begin{whycode}
axiom a: forall ... t1 = t2
\end{whycode}
or
\begin{whycode}
axiom a: forall ... f1 <> f2
\end{whycode}
then the user can declare
\begin{whycode}
meta "rewrite" axiom a
\end{whycode}
to turn this axiom into a rewrite rules. Rewriting is always done
from left to right. Beware that there is no check for termination
nor for confluence of the set of rewrite rules declared.
\item
Bound on the number of reduction: the computations performed by
this transformation can take an arbitrarily large number of steps,
or even not terminate. For this reason, the number of steps is
bounded by a maximal value, which is set by default to 1000. This
value can be enlarged by another meta,
\eg
\begin{whycode}
meta "compute
_
max
_
steps" 1
_
000
_
000
\end{whycode}
When this maximal is reached, the current, nonfully reduced, goal
is returned as the result of the transformation.
\end{itemize}
\subsection
{
Other NonSplitting Transformations
}
\begin{description}
...
...
@@ 215,21 +307,6 @@ definitions~\cite{paskevich09rr}.
% \item[hypothesis\_selection] *)
% Filter hypothesis of goals~\cite{couchot07ftp,cruanes10}. *)
\item
[inline\_all]
expands all nonrecursive definitions.
\item
[inline\_goal]
expands all outermost symbols of the goal that
have a nonrecursive definition.
\item
[inline\_trivial]
removes definitions of the form
\begin{whycode}
function f x
_
1 ... x
_
n = (g e
_
1 ... e
_
k)
predicate p x
_
1 ... x
_
n = (q e
_
1 ... e
_
k)
\end{whycode}
when each
$
e
_
i
$
is either a ground term or one of the
$
x
_
j
$
, and
each
$
x
_
1
\dots
x
_
n
$
occurs at most once in all the
$
e
_
i
$
.
\item
[introduce\_premises]
moves antecedents of implications and
universal quantifications of the goal into the premises of the task.
...
...
@@ 258,17 +335,17 @@ if $f$ does not occur in $e$.
\item
[simplify\_trivial\_quantification]
simplifies quantifications of the form
\begin{
verbatim
}
\begin{
whycode
}
forall x, x=t > P(x)
\end{
verbatim
}
\end{
whycode
}
or
\begin{
verbatim
}
\begin{
whycode
}
forall x, t=x > P(x)
\end{
verbatim
}
\end{
whycode
}
when
$
x
$
does not occur in
$
t
$
into
\begin{
verbatim
}
\begin{
whycode
}
P(t)
\end{
verbatim
}
\end{
whycode
}
More generally, it applies this simplification whenever
$
x
=
t
$
appears
in a negative position.
...
...
@@ 280,7 +357,7 @@ P(t)
\end{description}
\subsection
{
Splitting
t
ransformations
}
\subsection
{
Other
Splitting
T
ransformations
}
\begin{description}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment