Program
tactic
is to start from a specification and a program and to generate
subgoals either logical or associated with programs. However, to find
the good specification for subprograms is not at all trivial in
general. For instance, if we have to find an invariant for a loop, or
a well founded order in a recursive call.{
and }
and preceding them with :: ::
.
Since annotations are Coq terms, they can involve abstractions over
logical propositions that have to be declared. Annotated-l
have to be written between [{
and }]
.
Annotated-l can be seen like usual l-bindings but
concerning just annotations and not Coq programs.<
type-of-the-result> rec
name-of-the-induction-hypothesis :: :: {
well-founded-order-of-the-recursion }
and then the body of
the program (see section 18.4) which must always begin with
an abstraction [x:A] where A is the type of the arguments of the
function (also on which the ordering relation acts).?
. Match
, a Cases
or a Fix
construction (where
Fix
is a syntax for defining fixpoints).
pgm ::= ident | ? | [ ident : pgm ] pgm | [ ident ] pgm | ( ident : pgm ) pgm | ( pgms ) | Match pgm with pgms end | <
pgm>
Match pgm with pgms end| Cases pgm of [equation | ... | equation] end | <
pgm>
Cases pgm of [equation | ... | equation] end| Fix ident {
fix_pgm with ... with fix_pgm}
| Cofix ident {ident : pgm := pgm with ... with ident : pgm := pgm} | pgm :: :: {term } | [{ ident : term }] pgm | let ( ident , ... , ident , ... , ident ) = pgm in pgm | <
pgm>
let ( ident , ... , ... , ident ) = pgm in pgm| if pgm then pgm else pgm | <
pgm>
if pgm then pgm else pgm| <
pgm>
rec ident :: :: {term}[ ident : pgm ] pgmpgms ::= pgm | pgm pgms fix_pgm ::= ident [ typed_idents ; ... ; typed_idents ] : pgm := pgm | ident / num : pgm := pgm :: :: {term } simple_pattern ::= ident | (
ident ... ident)
equation ::= simple_pattern =>
pgm
Figure 18.1:Syntax of annotated programs
:: ::
binds more than the
abstraction and product constructions.
1.2.