<s>
Agda	B-Language
is	O
a	O
dependently	O
typed	O
functional	B-Language
programming	I-Language
language	I-Language
originally	O
developed	O
by	O
Ulf	O
Norell	O
at	O
Chalmers	O
University	O
of	O
Technology	O
with	O
implementation	O
described	O
in	O
his	O
PhD	O
thesis	O
.	O
</s>
<s>
The	O
original	O
Agda	B-Language
system	O
was	O
developed	O
at	O
Chalmers	O
by	O
Catarina	O
Coquand	O
in	O
1999	O
.	O
</s>
<s>
The	O
current	O
version	O
,	O
originally	O
known	O
as	O
Agda	B-Language
2	O
,	O
is	O
a	O
full	O
rewrite	O
,	O
which	O
should	O
be	O
considered	O
a	O
new	O
language	O
that	O
shares	O
a	O
name	O
and	O
tradition	O
.	O
</s>
<s>
Agda	B-Language
is	O
also	O
a	O
proof	O
assistant	O
based	O
on	O
the	O
propositions-as-types	O
paradigm	O
,	O
but	O
unlike	O
Coq	B-Application
,	O
has	O
no	O
separate	O
tactics	O
language	O
,	O
and	O
proofs	O
are	O
written	O
in	O
a	O
functional	B-Language
programming	I-Language
style	O
.	O
</s>
<s>
The	O
language	O
has	O
ordinary	O
programming	O
constructs	O
such	O
as	O
data	O
types	O
,	O
pattern	B-Language
matching	I-Language
,	O
records	O
,	O
let	B-Application
expressions	I-Application
and	O
modules	O
,	O
and	O
a	O
Haskell-like	O
syntax	O
.	O
</s>
<s>
The	O
system	O
has	O
Emacs	B-Application
and	O
Atom	B-Application
interfaces	O
but	O
can	O
also	O
be	O
run	O
in	O
batch	O
mode	O
from	O
the	O
command	O
line	O
.	O
</s>
<s>
Agda	B-Language
is	O
based	O
on	O
Zhaohui	O
Luo	O
's	O
unified	O
theory	O
of	O
dependent	O
types	O
(	O
UTT	O
)	O
,	O
a	O
type	O
theory	O
similar	O
to	O
Martin-Löf	O
type	O
theory	O
.	O
</s>
<s>
Agda	B-Language
is	O
named	O
after	O
the	O
Swedish	O
song	O
"	O
Hönan	O
Agda	B-Language
"	O
,	O
written	O
by	O
Cornelis	O
Vreeswijk	O
,	O
which	O
is	O
about	O
a	O
hen	O
named	O
Agda	B-Language
.	O
</s>
<s>
This	O
alludes	O
to	O
the	O
name	O
of	O
the	O
theorem	O
prover	O
Coq	B-Application
,	O
which	O
was	O
named	O
after	O
Thierry	O
Coquand	O
,	O
Catarina	O
Coquand	O
's	O
husband	O
.	O
</s>
<s>
The	O
main	O
way	O
of	O
defining	O
data	O
types	O
in	O
Agda	B-Language
is	O
via	O
inductive	O
data	O
types	O
which	O
are	O
similar	O
to	O
algebraic	O
data	O
types	O
in	O
non-dependently	O
typed	O
programming	O
languages	O
.	O
</s>
<s>
Here	O
is	O
a	O
definition	O
of	O
Peano	O
numbers	O
in	O
Agda	B-Language
:	O
</s>
<s>
In	O
Agda	B-Language
,	O
dependently	O
typed	O
pattern	B-Language
matching	I-Language
is	O
used	O
instead	O
.	O
</s>
<s>
In	O
Agda	B-Language
,	O
dependently	O
typed	O
pattern	B-Language
matching	I-Language
is	O
a	O
primitive	O
of	O
the	O
language	O
;	O
the	O
core	O
language	O
lacks	O
the	O
induction/recursion	O
principles	O
that	O
pattern	B-Language
matching	I-Language
translates	O
to	O
.	O
</s>
<s>
One	O
of	O
the	O
distinctive	O
features	O
of	O
Agda	B-Language
,	O
when	O
compared	O
with	O
other	O
similar	O
systems	O
such	O
as	O
Coq	B-Application
,	O
is	O
heavy	O
reliance	O
on	O
metavariables	O
for	O
program	O
construction	O
.	O
</s>
<s>
For	O
example	O
,	O
one	O
can	O
write	O
functions	O
like	O
this	O
in	O
Agda	B-Language
:	O
</s>
<s>
When	O
interacting	O
with	O
the	O
system	O
in	O
emacs	B-Application
mode	O
,	O
it	O
will	O
show	O
the	O
user	O
expected	O
type	O
and	O
allow	O
them	O
to	O
refine	O
the	O
metavariable	O
,	O
i.e.	O
,	O
to	O
replace	O
it	O
with	O
more	O
detailed	O
code	O
.	O
</s>
<s>
This	O
feature	O
allows	O
incremental	O
program	O
construction	O
in	O
a	O
way	O
similar	O
to	O
tactics-based	O
proof	O
assistants	O
such	O
as	O
Coq	B-Application
.	O
</s>
<s>
Although	O
Agda	B-Language
has	O
no	O
separate	O
tactics	O
language	O
,	O
it	O
is	O
possible	O
to	O
program	O
useful	O
tactics	O
within	O
Agda	B-Language
itself	O
.	O
</s>
<s>
Typically	O
,	O
this	O
works	O
by	O
writing	O
an	O
Agda	B-Language
function	O
that	O
optionally	O
returns	O
a	O
proof	O
of	O
some	O
property	O
of	O
interest	O
.	O
</s>
<s>
Additionally	O
,	O
to	O
write	O
more	O
complex	O
tactics	O
,	O
Agda	B-Language
has	O
support	O
for	O
automation	O
via	O
reflection	B-Language
.	O
</s>
<s>
The	O
reflection	B-Language
mechanism	O
allows	O
one	O
to	O
quote	O
program	O
fragments	O
into	O
–	O
or	O
unquote	O
them	O
from	O
–	O
the	O
abstract	O
syntax	O
tree	O
.	O
</s>
<s>
The	O
way	O
reflection	B-Language
is	O
used	O
is	O
similar	O
to	O
the	O
way	O
Template	O
Haskell	B-Language
works	O
.	O
</s>
<s>
Another	O
mechanism	O
for	O
proof	O
automation	O
is	O
proof	O
search	O
action	O
in	O
emacs	B-Application
mode	O
.	O
</s>
<s>
This	O
action	O
accepts	O
hints	O
,	O
e.g.	O
,	O
which	O
theorems	O
and	O
from	O
which	O
modules	O
can	O
be	O
used	O
,	O
whether	O
the	O
action	O
can	O
use	O
pattern	B-Language
matching	I-Language
,	O
etc	O
.	O
</s>
<s>
Agda	B-Language
is	O
a	O
total	B-Application
language	I-Application
,	O
i.e.	O
,	O
each	O
program	O
in	O
it	O
must	O
terminate	O
and	O
all	O
possible	O
patterns	O
must	O
be	O
matched	O
.	O
</s>
<s>
For	O
termination	O
checking	O
,	O
Agda	B-Language
uses	O
the	O
approach	O
of	O
the	O
Foetus	O
termination	O
checker	O
.	O
</s>
<s>
Agda	B-Language
has	O
an	O
extensive	O
de	O
facto	O
standard	O
library	O
,	O
which	O
includes	O
many	O
useful	O
definitions	O
and	O
theorems	O
about	O
basic	O
data	O
structures	O
,	O
such	O
as	O
natural	O
numbers	O
,	O
lists	O
,	O
and	O
vectors	O
.	O
</s>
<s>
One	O
of	O
the	O
more	O
notable	O
features	O
of	O
Agda	B-Language
is	O
a	O
heavy	O
reliance	O
on	O
Unicode	O
in	O
program	O
source	O
code	O
.	O
</s>
<s>
The	O
standard	O
emacs	B-Application
mode	O
uses	O
shortcuts	O
for	O
input	O
,	O
such	O
as	O
\Sigma	O
for	O
Σ	O
.	O
</s>
<s>
There	O
are	O
two	O
compiler	O
backends	O
,	O
MAlonzo	O
for	O
Haskell	B-Language
and	O
one	O
for	O
JavaScript	B-Language
.	O
</s>
