huge commit regarding coercions to funclass and eat_prods. before there was a
so broken behaviour that is impossible to describe the changes.
now:
eat_prods he hety args
starts checking if hety is metaclosed, if it is does nothing, if not
unifies it with ?->?-> ... ->? s.t. there is a Pi for every args.
if this unification fails, does nothing (all coercions are in the
second phase.
continues eating prods in hety and args in parallel, if there is an arg
and no more prods, tries to fix the arity of (he already_processed_args).
fix_arity gives a range of possible coercions to funclass s.t.
(c (he ..)) : FunType. The eat prods and args continues, eting the remaining
args toghether with FunType. If it fails, it continues with another c to
another FunType. This recursively (yes, it backtracks. no strong opinion
here, but there is no sane heuristinc to chose one FunType).
the code is reduced to 1/3, but Localization of errors probably need fixing.
Full specification of find. Added notation for If_Then_Else. Probably a delta
on t in the match the decides if it is the case to pass a coercion under a
match whould be nice.
* debian/control
- port Vcs-Svn field to the new syntax
- add XS-Vcs-Browser field pointing to HELM's repository browser
* debian/rules
- enable ocamldoc api reference generation (via CDBS)
* convert comments in .mli interface files to ocamldoc comments
* bump debhelper compatibility level and dependency to 5
- enable generation of ocamldoc api reference (via CDBS)
- added XS-Vcs-* fields pointing to the svn repository
- bumped build dependency on ocaml-nox to >= 3.10.0
1. fix_arity fixed: the code is totally wrong and this is just a quic&dirty
fix
2. first real-word example in coercions_russel: a certified "find" procedure
from the ocaml library
Note: removing the (... : Prop) cast from the example, unification fails badly.
To be understood and fixed somehow (i.e. with an Uncertain in place of a
Failure).
when a coercion is passed through a case on right-params-free term m,
branches and outtype are adjusted to receive an extra argument (refl m)
to have extra assumptions on it substituded. see tests/coercions_russell.ma
1. composition of coercions with saturations > 0 is now implemented
2. as a side effect, there is no longer any difference between composition
of coercions and the compose tactic
TODO: composition of coercions having arity > 0 is not implemented yet
Coercions are now generalized to the general form
f: \forall xs:Ts. \forall a:A xs. \forall ys:Ts'. B xs a ys
where f is declared as a coercion from A ? to B ? ? ? using the syntax
coercion uri arity saturations
where:
1. arity and saturations are optional with default 0
2. the saturations option is the number of ys
Useful example: it is now possible to declare a coercion from
nat to \exists n:nat. 0 \leq n
obtaining something extremely close to Russel (the new implementation of
the Program tactic of Coq) up to the fact that coercions are not propagated
yet under mutcases and fixes.
TODO: composition of coercions having saturations <> 0 is not implemented
yet (but should be easy to do, at least on paper)
Enrico Tassi [Thu, 30 Aug 2007 13:24:13 +0000 (13:24 +0000)]
Coercions rework:
- new functions:
- coerce_to_sort
- coerce_to_something
- coerce_atom_to_something
- added call in Cast
- coerce_to_something goes under lambdas in both
variant and contravarian positions, to if there are
c1: B -> B1 and c2:A1 -> C coercions, you can cast a function
f: A -> B to A1 -> B1.
* definition of implication free propositional formulas
* definition of a classical semantics
* proofs of correctness of some syntactical manipulations to reach
normal forms
* definition of sequent calculus trees
* proof of soundness of sequent calculus derivations
* proof of completeness of sequent calculus derivations (unfinished)
Bug fixed: RewriteLR were not recognized correctly. Moreover they were also
handled incorrectly (according to the is_top_down flag that should be irrelevant).