<s>
The	O
Liskov	B-Application
substitution	I-Application
principle	I-Application
(	O
LSP	O
)	O
is	O
a	O
particular	O
definition	O
of	O
a	O
subtyping	O
relation	O
,	O
called	O
strong	B-Application
behavioral	I-Application
subtyping	I-Application
,	O
that	O
was	O
initially	O
introduced	O
by	O
Barbara	O
Liskov	O
in	O
a	O
1987	O
conference	O
keynote	B-Protocol
address	O
titled	O
Data	O
abstraction	O
and	O
hierarchy	O
.	O
</s>
<s>
It	O
is	O
based	O
on	O
the	O
concept	O
of	O
"	O
substitutability	B-Application
"	O
a	O
principle	O
in	O
object-oriented	B-Language
programming	I-Language
stating	O
that	O
an	O
object	O
(	O
such	O
as	O
a	O
class	O
)	O
may	O
be	O
replaced	O
by	O
a	O
sub-object	O
(	O
such	O
as	O
a	O
class	O
that	O
extends	O
the	O
first	O
class	O
)	O
without	O
breaking	O
the	O
program	O
.	O
</s>
<s>
It	O
is	O
a	O
semantic	B-Application
rather	O
than	O
merely	O
syntactic	O
relation	O
,	O
because	O
it	O
intends	O
to	O
guarantee	O
semantic	B-Application
interoperability	O
of	O
types	O
in	O
a	O
hierarchy	O
,	O
object	O
types	O
in	O
particular	O
.	O
</s>
<s>
In	O
the	O
same	O
paper	O
,	O
Liskov	O
and	O
Wing	O
detailed	O
their	O
notion	O
of	O
behavioral	B-Application
subtyping	I-Application
in	O
an	O
extension	O
of	O
Hoare	O
logic	O
,	O
which	O
bears	O
a	O
certain	O
resemblance	O
to	O
Bertrand	O
Meyer	O
's	O
design	B-Application
by	I-Application
contract	I-Application
in	O
that	O
it	O
considers	O
the	O
interaction	O
of	O
subtyping	O
with	O
preconditions	O
,	O
postconditions	O
and	O
invariants	B-Application
.	O
</s>
<s>
Liskov	O
's	O
notion	O
of	O
a	O
behavioural	O
subtype	O
defines	O
a	O
notion	O
of	O
substitutability	B-Application
for	O
objects	O
;	O
that	O
is	O
,	O
if	O
S	O
is	O
a	O
subtype	O
of	O
T	O
,	O
then	O
objects	O
of	O
type	O
T	O
in	O
a	O
program	O
may	O
be	O
replaced	O
with	O
objects	O
of	O
type	O
S	O
without	O
altering	O
any	O
of	O
the	O
desirable	O
properties	O
of	O
that	O
program	O
(	O
e.g.	O
</s>
<s>
Liskov	B-Application
substitution	I-Application
principle	I-Application
imposes	O
some	O
standard	O
requirements	O
on	O
signatures	O
that	O
have	O
been	O
adopted	O
in	O
newer	O
object-oriented	B-Language
programming	I-Language
languages	I-Language
(	O
usually	O
at	O
the	O
level	O
of	O
classes	O
rather	O
than	O
types	O
;	O
see	O
nominal	O
vs.	O
structural	O
subtyping	O
for	O
the	O
distinction	O
)	O
:	O
</s>
<s>
These	O
are	O
detailed	O
in	O
a	O
terminology	O
resembling	O
that	O
of	O
design	B-Application
by	I-Application
contract	I-Application
methodology	O
,	O
leading	O
to	O
some	O
restrictions	O
on	O
how	O
contracts	O
can	O
interact	O
with	O
inheritance	B-Language
:	O
</s>
<s>
Invariants	B-Application
must	O
be	O
preserved	O
in	O
the	O
subtype	O
.	O
</s>
<s>
Objects	O
are	O
regarded	O
as	O
being	O
modifiable	O
only	O
through	O
their	O
methods	O
(	O
encapsulation	B-Application
)	O
.	O
</s>
<s>
The	O
rules	O
on	O
pre	O
-	O
and	O
postconditions	O
are	O
identical	O
to	O
those	O
introduced	O
by	O
Bertrand	O
Meyer	O
in	O
his	O
1988	O
book	O
Object-Oriented	B-Language
Software	O
Construction	O
.	O
</s>
<s>
Both	O
Meyer	O
,	O
and	O
later	O
Pierre	O
America	O
,	O
who	O
was	O
the	O
first	O
to	O
use	O
the	O
term	O
behavioral	B-Application
subtyping	I-Application
,	O
gave	O
proof-theoretic	O
definitions	O
of	O
some	O
behavioral	B-Application
subtyping	I-Application
notions	O
,	O
but	O
their	O
definitions	O
did	O
not	O
take	O
into	O
account	O
aliasing	B-Application
that	O
may	O
occur	O
in	O
programming	O
languages	O
that	O
support	O
references	O
or	O
pointers	O
.	O
</s>
<s>
Taking	O
aliasing	B-Application
into	O
account	O
was	O
the	O
major	O
improvement	O
made	O
by	O
Liskov	O
and	O
Wing	O
(	O
1994	O
)	O
,	O
and	O
a	O
key	O
ingredient	O
is	O
the	O
history	O
constraint	O
.	O
</s>
<s>
Under	O
the	O
definitions	O
of	O
Meyer	O
and	O
America	O
,	O
a	O
mutable	O
point	O
would	O
be	O
a	O
behavioral	O
subtype	O
of	O
an	O
immutable	O
point	O
,	O
whereas	O
Liskov	B-Application
substitution	I-Application
principle	I-Application
forbids	O
this	O
.	O
</s>
<s>
While	O
widely	O
used	O
,	O
the	O
characterization	O
of	O
behavioral	B-Application
subtyping	I-Application
as	O
the	O
ability	O
to	O
substitute	O
subtype	O
objects	O
for	O
supertype	O
objects	O
has	O
been	O
said	O
to	O
be	O
flawed	O
.	O
</s>
<s>
Also	O
,	O
more	O
subtly	O
,	O
in	O
the	O
context	O
of	O
object-oriented	B-Language
imperative	O
programming	O
it	O
is	O
difficult	O
to	O
define	O
precisely	O
what	O
it	O
means	O
to	O
universally	O
or	O
existentially	O
quantify	O
over	O
objects	O
of	O
a	O
given	O
type	O
,	O
or	O
to	O
substitute	O
one	O
object	O
for	O
another	O
.	O
</s>
<s>
In	O
an	O
interview	O
in	O
2016	O
,	O
Liskov	O
herself	O
explains	O
that	O
what	O
she	O
presented	O
in	O
her	O
keynote	B-Protocol
address	O
was	O
an	O
"	O
informal	O
rule	O
"	O
,	O
that	O
Jeannette	O
Wing	O
later	O
proposed	O
that	O
they	O
"	O
try	O
to	O
figure	O
out	O
precisely	O
what	O
this	O
means	O
"	O
,	O
which	O
led	O
to	O
their	O
joint	O
publication	O
on	O
behavioral	B-Application
subtyping	I-Application
,	O
and	O
indeed	O
that	O
"	O
technically	O
,	O
it	O
's	O
called	O
behavioral	B-Application
subtyping	I-Application
"	O
.	O
</s>
