opam
packages
for Coq 8.13, 8.14 and 8.15. See the release notes and updated reference manual for details.
This new major version cleans up the input syntax (allowing to use less “;”), makes the interpretation of patterns more robust
(disallowing dangerous shadowings) and better preserves user-given names by the dependent elimination
and funelim
tactics for more robust proof scripts.
– Matthieu Sozeau
]]>opam
package coq-equations.1.3~beta2+8.13
,
for Coq 8.13. See the release notes and updated reference manual for details.
This beta version cleans up the interpretation of patterns and allow better preservation of user-given names
by the dependent elimination
and funelim
tactics for more robust proof scripts.
– Matthieu Sozeau
]]>opam
package coq-equations.1.3~beta+8.13
,
for Coq 8.13. See the release notes and updated
reference manual for details.
– Matthieu Sozeau
]]>opam
packages coq-equations.1.2.4+8.13
, coq-equations.1.2.4+8.12
and coq-equations.1.2.4+8.11
for Coq 8.11-8.13.
See the release notes for details.
– Matthieu Sozeau
]]>opam
packages coq-equations.1.2.2+8.11
, coq-equations.1.2.2+8.12
for Coq 8.11 and Coq 8.12. This is a bugfix release and the first version available
for Coq 8.12. See the release notes for details.
– Matthieu Sozeau
]]>opam
packages coq-equations.1.2.1+8.11
,
See release notes for details on this release.
– Matthieu Sozeau
]]>opam
packages coq-equations.1.2+8.8
,
coq-equations.1.2+8.9
, coq-equations.1.2+8.10
for Coq 8.8 and Coq
8.9 and Coq 8.10beta1 (the later in the extra-dev
repository).
I am pleased to announce release 1.2 of the Equations package. Equations is a function definition plugin for Coq, that supports the definition of functions by dependent pattern-matching and structural or well-founded, mutual or nested recursion and compiles them into core Coq terms without axioms. It automatically derives the clauses’ equations, the graph of the function and its associated elimination principle.
This release contains a few fixes and improvements with respect to the 1.2beta2 version:
Fixed an annoying backtracking bug when using Equations?
(issue
#179, thanks to Pierre-Marie Pédrot for help fixing this).
Fixed the treatment of with
with more than 2 arguments (issue
#190)
Fixed “cannot be used as a hint” errors (issue #193), now turned into warnings.
Granted with #187: global Set Equations Derive Equations/Eliminator
options.
The previous beta1 and beta2 announcements describe the new features of the 1.2 version. See the reference manual for up-to-date syntax and description of the new features. The Equations Reloaded paper also provides an introduction to the new version.
– Matthieu Sozeau
]]>opam
packages coq-equations.1.2.1+8.9
, coq-equations.1.2.1+8.10
for Coq 8.9 and Coq 8.10.
The 8.10 version (only) includes support for the HoTT library (currently available
in Coq’s extra-dev
repository only as coq-hott-8.10.dev
). Install coq-hott
before
Equations to get a version that uses the HoTT library.
Note that only one of the HoTT variant or the standard variant can be installed
at any given time. Using hoqtop
or hoqc
, one needs to pass the following additional
options:
hoqtop/hoqc -I `coqc -where`/user-contrib/Equations -Q `coqc -where`/user-contrib ""
Then, one can import the plugin in Coq, using:
From Equations Require Import HoTT.All.
See the Reference Manual for an introduction to Equations, or the ICFP paper.
– Matthieu Sozeau
]]>opam
(packages coq-equations.1.2~beta2+8.8
and
coq-equations.1.2~beta2+8.9
for Coq 8.8 and Coq 8.9).
I am pleased to announce release 1.2beta2 of the Equations package. Equations is a function definition plugin for Coq, that supports the definition of functions by dependent pattern-matching and structural or well-founded, mutual or nested recursion and compiles them into core Coq terms without axioms. It automatically derives the clauses’ equations, the graph of the function and its associated elimination principle.
This release contains many fixes and improvements with respect to the 1.2beta version:
A new flag With Funext
(on by default) can be used to disable the
use of functional extensionality in proofs of unfolding lemmas for
well-founded definitions. When off, the automation might fail to
prove the extensionality of the functional defined by Equations. The
user can then prove the obligation on its own, with the help of the
Equations.Init.unfold_recursor
tactic and dependent
elimination tactics. After this proof the equations and the
elimination principle of the definition are still derived
automatically.
Flags WithK
and WithKDec
are deprecated in favor of a single
With UIP
flag (off by default). When set, this flag lets Equations
use instances of the class UIP
to simplify pattern-matching
problems. The user can add a general UIP
axiomatic instance for
all types to allow the general K
rule if desired.
Two instances of the library are provided, one using Coq’s standard
library equality in Prop
(default) and another one using a
proof-relevant equality in Type
, and proof-relevant notion of
accessibility. The later can be used by requiring
Equations.Type.All
instead of Equations.Equations
. In this
setting, Equations definitions are compatible with the univalence
axiom and proof-relevant reasoning in general. Note that extracted
programs will keep all the proof-relevant manipulations of equality
and accessibility in that case. A branch of Equations compatible
with the Coq-HoTT
library is also available, but will stay in a
beta stage until the release of Coq 8.10.
Graphs of functions and elimination principles are now defined
in Type
if possible (e.g. if the program does not produce a
proposition which might involved case-splitting on other
propositions). This allows applying the eliminator in proof-relevant
contexts, e.g. when building reflect
proofs.
The funelim
tactic produces less generated names, but is still
fragile with respect to naming. An alternative apply_funelim
tactic can be used instead of the funelim
tactic, generating
simpler subgoals and leaving introductions to the user, but not
generalizing the initial goals by equalities. Similarly to Coq’s
built-in induction
tactic, the user must do induction loading
explicitely, generalizing the goal by equalities or variables to
ensure that subgoals are provable when using this variant.
The dependent elimination
tactic should also produce less
generated names (prefering a user-given name in case of unification
with a generated one) and is now robust with respect to the
presence of let-bound variables in the context.
See the reference manual for details on these new features.
– Matthieu Sozeau
]]>opam
(packages coq-equations.1.2~beta+8.8
and
coq-equations.1.2~beta+8.9
for Coq 8.8 and Coq 8.9).
I am pleased to announce release 1.2beta of the Equations package. Equations is a function definition plugin for Coq, that supports the definition of functions by dependent pattern-matching and structural or well-founded, mutual or nested recursion and compiles them into core Coq terms without axioms. It automatically derives the clauses’ equations, the graph of the function and its associated elimination principle.
This version of Equations is based on an improved simplification
engine for the dependent equalities appearing during dependent
eliminations that is also usable as a separate dependent elimination
tactic, providing an axiom-free variant of dependent destruction
and a
more powerful form of inversion
. Along with bug fixes, this version
introduces a few important changes:
At the syntax level, patterns on the left-hand sides of definitions are now interpreted using Coq’s standard term interpreter, so that they naturally support implicit arguments and notations. Recursive and local notations are also available. Finally one does not have to introduce binders for arguments in the function’s prototype, e.g.:
Equations plus : nat -> nat -> nat :=
{ 0 + m := m;
S n + m := S (n + m) }
where "x + y" := (plus x y).
The annotations for recursive programs are now written using a
by
annotation before the program’s clauses, as in:
Equations gcd (x y : nat) : nat by wf (x + y) lt :=
gcd 0 x := x ;
gcd x 0 := x ;
gcd x y with gt_eq_gt_dec x y := {
| inleft (left ygtx) := gcd x (y - x) ;
| inleft (right refl) := x ;
| inright xgty := gcd (x - y) y }.
The reference manual defines the input syntax precisely.
An homogeneous no-confusion principle on indexed families can be
automatically derived for those families whose no-confusion property
does not require uniqueness of identity proofs. This includes, e.g.
fin
, vector
and many other indexed data structures
(examples: definterp, polynomials).
Support for nested well-founded recursion, which naturally express standard patterns of functional programming like the worker/wrapper pattern (example: accumulator).
Mutual well-founded recursive definitions can be implemented by mixing well-founded recursion and dependent pattern-matching (example: mutualwfrec).
Dependent where
clauses help incrementally build dependently-typed
values. A notation for pattern-matching lambdas, which are elaborated
to where
clauses is also available (example: definterp).
An experimental refinement mode opens the proof mode to fill the
holes of an Equations program, making expected types and contexts of
partial definitions easier to see, and lets one seamlessly switch
between refinement and proof mode. BEWARE: abstract
does not work
well in that case. The syntax to switch to this mode is currently
Equations?
. Otherwise, the obligations are generated as for
Program.
A relocatable library of support lemmas allows one to use Equations in the context of HoTT-Coq or to benefit from strict propositions (WIP).
The main features of Equations include:
Dependent pattern-matching in the style of Agda/Epigram, with
inaccessible patterns, with
and where
clauses. The use of the K
axiom or a proof of K is configurable.
Support for mutual and nested well-founded recursion using by wf
annotations, and automatic derivation of the subterm relation for
inductive families.
Support for mutual and nested structural recursion using with
and
where
auxiliary definitions, allowing one to factor multiple uses
of the same nested fixpoint definition. It proves the expected
elimination principles for mutual and nested definitions.
Automatic generation of the defining equations as rewrite rules for every definition.
Automatic generation of the unfolding lemma for well-founded definitions (requiring the functional extensionality axiom).
Automatic derivation of the graph of the function and its elimination principle.
A new dependent elimination
tactic based on the same splitting
tree compilation scheme that can advantageously replace dependent
destruction
and inversion
. The as
clause of dependent
elimination
can be used to specify exactly the patterns and naming of
new variables needed by an elimination.
A set of Derive
commands for automatic derivation of constructions
from an inductive type: its signature, no-confusion properties,
well-founded subterm relation and decidable equality proof, if applicable.
The current system is usable for developing non-toy programs and proofs (see examples), although it still has some limitations. Documentation is available on the website, including a reference manual with an introduction to the features of the plugin. Feedback is very welcome!
– Matthieu Sozeau
]]>