Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
113
Issues
113
List
Boards
Labels
Milestones
Merge Requests
13
Merge Requests
13
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
b176f9e1
Commit
b176f9e1
authored
May 13, 2016
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick fix of Einstein's problem in doc
parent
4aa71892
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
11 additions
and
8 deletions
+11
8
doc/syntax.tex
doc/syntax.tex
+11
8
No files found.
doc/syntax.tex
View file @
b176f9e1
...
...
@@ 322,6 +322,9 @@ problem''.%
\footnote
{
This
\why
example was contributed by St
\'
ephane Lescuyer.
}
%END LATEX
%HEVEA {} (This \why example was contributed by St\'ephane Lescuyer.)
The code given below is available in the source distribution in
directory
\verb

examples/logic/einstein.why

.
The problem is stated as follows. Five persons, of five
different nationalities, live in five houses in a row, all
painted with different colors.
...
...
@@ 371,10 +374,10 @@ theory Bijection
type u
function of t : u
function to u : t
function to
_
u : t
axiom To
_
of : forall x : t. to (of x) = x
axiom Of
_
to : forall y : u. of (to y) = y
axiom To
_
of : forall x : t. to
_
(of x) = x
axiom Of
_
to : forall y : u. of (to
_
y) = y
end
\end{whycode}
...
...
@@ 399,7 +402,7 @@ by cloning the \texttt{Bijection} theory appropriately.
clone Bijection as Color with type t = house, type u = color
\end{whycode}
It introduces two functions, namely
\texttt
{
Color.of
}
and
\texttt
{
Color.to
}
, from houses to colors and colors to houses,
\texttt
{
Color.to
\_
}
, from houses to colors and colors to houses,
respectively, and the two axioms relating them.
Similarly, we express that each house is associated bijectively to a
person
...
...
@@ 442,11 +445,11 @@ theory \texttt{Einstein}.
theory EinsteinHints "Hints"
use import Einstein
\end{whycode}
Then each hypothesis is stated in terms of
\texttt
{
to
}
and
\texttt
{
of
}
Then each hypothesis is stated in terms of
\texttt
{
to
\_
}
and
\texttt
{
of
}
functions. For instance, the hypothesis ``The Englishman lives in a
red house'' is declared as the following axiom.
\begin{whycode}
axiom Hint1: Color.of (Owner.to Englishman) = Red
axiom Hint1: Color.of (Owner.to
_
Englishman) = Red
\end{whycode}
And so on for all other hypotheses, up to
``The man who smokes Blends has a neighbour who drinks water'', which completes
...
...
@@ 454,7 +457,7 @@ this theory.
\begin{whycode}
...
axiom Hint15:
neighbour (Owner.to
(Cigar.to Blend)) (Owner.to (Drink.to
Water))
neighbour (Owner.to
_
(Cigar.to
_
Blend)) (Owner.to
_
(Drink.to
_
Water))
end
\end{whycode}
Finally, we declare the goal in the fourth theory:
...
...
@@ 463,7 +466,7 @@ theory Problem "Goal of Einstein's problem"
use import Einstein
use import EinsteinHints
goal G: Pet.to Fish = German
goal G: Pet.to
_
Fish = German
end
\end{whycode}
and we are ready to use
\why
to discharge this goal with any prover
...
...
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