<s>
Whiley	B-Language
is	O
an	O
experimental	O
programming	O
language	O
that	O
combines	O
features	O
from	O
the	O
functional	B-Language
and	O
imperative	B-Application
paradigms	I-Application
,	O
and	O
supports	O
formal	B-Application
specification	I-Application
through	O
function	O
preconditions	O
,	O
postconditions	O
and	O
loop	B-Application
invariants	I-Application
.	O
</s>
<s>
The	O
Whiley	B-Language
project	O
began	O
in	O
2009	O
in	O
response	O
to	O
the	O
"	O
Verifying	O
Compiler	O
Grand	O
Challenge	O
"	O
put	O
forward	O
by	O
Tony	O
Hoare	O
in	O
2003	O
.	O
</s>
<s>
The	O
first	O
public	O
release	O
of	O
Whiley	B-Language
was	O
in	O
June	O
,	O
2010	O
.	O
</s>
<s>
Primarily	O
developed	O
by	O
David	O
Pearce	O
,	O
Whiley	B-Language
is	O
an	O
open	O
source	O
project	O
with	O
contributions	O
from	O
a	O
small	O
community	O
.	O
</s>
<s>
The	O
Whiley	B-Language
compiler	O
generates	O
code	O
for	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
and	O
can	O
inter-operate	O
with	O
Java	B-Language
and	O
other	O
JVM	B-Language
based	O
languages	O
.	O
</s>
<s>
The	O
goal	O
of	O
Whiley	B-Language
is	O
to	O
provide	O
a	O
realistic	O
programming	O
language	O
where	O
verification	O
is	O
used	O
routinely	O
and	O
without	O
thought	O
.	O
</s>
<s>
The	O
primary	O
purpose	O
of	O
such	O
a	O
tool	O
is	O
to	O
improve	O
software	O
quality	O
by	O
ensuring	O
a	O
program	O
meets	O
a	O
formal	B-Application
specification	I-Application
.	O
</s>
<s>
Whiley	B-Language
follows	O
many	O
attempts	O
to	O
develop	O
such	O
tools	O
,	O
including	O
notable	O
efforts	O
such	O
as	O
SPARK/Ada	B-Language
,	O
ESC/Java	B-Application
,	O
Spec#	O
,	O
Dafny	B-Application
,	O
Why3	O
,	O
and	O
Frama-C	B-Language
.	O
</s>
<s>
Most	O
previous	O
attempts	O
to	O
develop	O
a	O
verifying	O
compiler	O
focused	O
on	O
extending	O
existing	O
programming	O
languages	O
with	O
constructs	O
for	O
writing	O
specifications	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
ESC/Java	B-Application
and	O
the	O
Java	B-Language
Modeling	I-Language
Language	I-Language
add	O
annotations	O
for	O
specifying	O
preconditions	O
and	O
postconditions	O
to	O
Java	B-Language
.	O
</s>
<s>
Likewise	O
,	O
Spec#	O
and	O
Frama-C	B-Language
add	O
similar	O
constructs	O
to	O
the	O
C#	B-Application
and	O
C	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
In	O
contrast	O
,	O
the	O
Whiley	B-Language
language	O
was	O
designed	O
from	O
scratch	O
in	O
an	O
effort	O
to	O
avoid	O
common	O
pitfalls	O
and	O
make	O
verification	O
more	O
tractable	O
.	O
</s>
<s>
The	O
syntax	O
of	O
Whiley	B-Language
follows	O
the	O
general	O
appearance	O
of	O
imperative	B-Application
or	O
object-oriented	O
languages	O
.	O
</s>
<s>
Indentation	O
syntax	O
is	O
chosen	O
over	O
the	O
use	O
of	O
braces	O
to	O
delineate	O
statement	O
blocks	O
,	O
given	O
a	O
strong	O
resemblance	O
to	O
Python	B-Language
.	O
</s>
<s>
However	O
,	O
the	O
imperative	B-Application
look	O
of	O
Whiley	B-Language
is	O
somewhat	O
misleading	O
as	O
the	O
language	O
core	O
is	O
functional	B-Language
and	O
pure	B-Application
.	O
</s>
<s>
Whiley	B-Language
distinguishes	O
a	O
function	O
(	O
which	O
is	O
pure	B-Application
)	O
from	O
a	O
method	O
(	O
which	O
may	O
have	O
side-effects	O
)	O
.	O
</s>
<s>
This	O
distinction	O
is	O
necessary	O
as	O
it	O
allows	O
functions	O
to	O
be	O
used	O
in	O
specifications	B-Application
.	O
</s>
<s>
However	O
,	O
unlike	O
most	O
programming	O
languages	O
the	O
integer	O
data	O
type	O
,	O
int	O
,	O
is	O
unbounded	O
and	O
does	O
not	O
correspond	O
to	O
a	O
fixed-width	O
representation	O
such	O
as	O
32-bit	O
two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
.	O
</s>
<s>
Thus	O
,	O
an	O
unconstrained	O
integer	O
in	O
Whiley	B-Language
can	O
take	O
on	O
any	O
possible	O
integer	O
value	O
,	O
subject	O
to	O
the	O
memory	O
constraints	O
of	O
the	O
host	O
environment	O
.	O
</s>
<s>
arrays	O
or	O
records	O
)	O
are	O
not	O
references	O
to	O
values	O
on	O
the	O
heap	O
as	O
they	O
are	O
in	O
languages	O
such	O
as	O
Java	B-Language
or	O
C#	B-Application
but	O
,	O
instead	O
,	O
are	O
immutable	B-Application
values	I-Application
.	O
</s>
<s>
Whiley	B-Language
takes	O
an	O
unusual	O
approach	O
to	O
type	O
checking	O
referred	O
to	O
as	O
"	O
Flow	O
Typing.	O
"	O
</s>
<s>
Flow	O
typing	O
is	O
similar	O
to	O
occurrence	O
typing	O
as	O
found	O
in	O
Racket	B-Operating_System
.	O
</s>
<s>
To	O
aid	O
flow	O
typing	O
,	O
Whiley	B-Language
supports	O
union	O
,	O
intersection	O
and	O
negation	O
types	O
.	O
</s>
<s>
Union	O
types	O
are	O
comparable	O
to	O
sum	B-Language
types	I-Language
found	O
in	O
functional	B-Language
languages	I-Language
like	O
Haskell	B-Language
but	O
,	O
in	O
Whiley	B-Language
,	O
they	O
are	O
not	O
disjoint	O
.	O
</s>
<s>
Whiley	B-Language
uses	O
a	O
structural	O
rather	O
than	O
nominal	O
type	O
system	O
.	O
</s>
<s>
Modula-3	B-Language
,	O
Go	B-Application
and	O
Ceylon	B-Language
are	O
examples	O
of	O
other	O
languages	O
which	O
support	O
structural	O
typing	O
in	O
some	O
form	O
.	O
</s>
<s>
Whiley	B-Language
supports	O
reference	O
lifetimes	O
similar	O
to	O
those	O
found	O
in	O
Rust	B-Application
.	O
</s>
<s>
References	O
to	O
such	O
objects	O
must	O
then	O
include	O
lifetime	O
identifier	O
to	O
prevent	O
dangling	B-Error_Name
references	I-Error_Name
.	O
</s>
<s>
Lifetimes	O
in	O
Whiley	B-Language
differ	O
from	O
Rust	B-Application
in	O
that	O
they	O
do	O
not	O
currently	O
include	O
a	O
concept	O
of	O
ownership	O
.	O
</s>
<s>
Whiley	B-Language
has	O
no	O
built-in	O
support	O
for	O
concurrency	O
and	O
no	O
formal	O
memory	O
model	O
to	O
determine	O
how	O
reading/writing	O
to	O
shared	O
mutable	B-Application
state	O
should	O
be	O
interpreted	O
.	O
</s>
<s>
The	O
following	O
example	O
illustrates	O
many	O
of	O
the	O
interesting	O
features	O
in	O
Whiley	B-Language
,	O
including	O
the	O
use	O
of	O
postconditions	O
,	O
loop	B-Application
invariants	I-Application
,	O
type	O
invariants	O
,	O
union	O
types	O
and	O
flow	O
typing	O
.	O
</s>
<s>
The	O
above	O
example	O
also	O
illustrates	O
the	O
use	O
of	O
an	O
inductive	O
loop	B-Application
invariant	I-Application
.	O
</s>
<s>
The	O
loop	B-Application
invariant	I-Application
must	O
be	O
shown	O
to	O
hold	O
on	O
entry	O
to	O
the	O
loop	O
,	O
for	O
any	O
given	O
iteration	O
of	O
the	O
loop	O
and	O
when	O
the	O
loop	O
exits	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
loop	B-Application
invariant	I-Application
states	O
what	O
is	O
known	O
about	O
the	O
elements	O
of	O
the	O
items	O
examined	O
so	O
far	O
—	O
namely	O
,	O
that	O
none	O
of	O
them	O
matches	O
the	O
given	O
item	O
.	O
</s>
<s>
The	O
loop	B-Application
invariant	I-Application
does	O
not	O
affect	O
the	O
meaning	O
of	O
the	O
program	O
and	O
,	O
in	O
some	O
sense	O
,	O
might	O
be	O
considered	O
as	O
unnecessary	O
.	O
</s>
<s>
However	O
,	O
the	O
loop	B-Application
invariant	I-Application
is	O
required	O
to	O
help	O
the	O
automated	O
verifier	O
using	O
in	O
the	O
Whiley	B-Language
Compiler	O
to	O
prove	O
this	O
function	O
meets	O
its	O
specification	B-Application
.	O
</s>
<s>
The	O
above	O
example	O
also	O
defines	O
the	O
type	O
nat	O
with	O
an	O
appropriate	O
type	B-Application
invariant	I-Application
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
declaration	O
prevents	O
the	O
need	O
for	O
an	O
additional	O
loop	B-Application
invariant	I-Application
of	O
the	O
form	O
where	O
i	O
>=	O
0	O
which	O
would	O
otherwise	O
be	O
necessary	O
.	O
</s>
<s>
Whiley	B-Language
began	O
in	O
2009	O
with	O
the	O
first	O
public	O
release	O
,	O
v0.2.27	O
following	O
in	O
June	O
2010	O
and	O
v0.3.0	O
in	O
September	O
that	O
year	O
.	O
</s>
<s>
Another	O
important	O
milestone	O
in	O
the	O
evolution	O
of	O
Whiley	B-Language
came	O
in	O
version	O
v0.3.40	O
with	O
the	O
inclusion	O
of	O
reference	O
lifetimes	O
,	O
developed	O
by	O
Sebastian	O
Schweizer	O
as	O
part	O
of	O
his	O
Master	O
's	O
Thesis	O
at	O
the	O
University	O
of	O
Kaiserslautern	O
.	O
</s>
