aboutsummaryrefslogtreecommitdiff
path: root/plugins/ssr
AgeCommit message (Collapse)Author
2019-05-27Merge PR #10237: Fix some incorrect uses of proof-local environmentPierre-Marie Pédrot
Reviewed-by: gares Reviewed-by: ppedrot
2019-05-24Stop using pstate in global print queriesGaëtan Gilbert
Using pstate makes no sense for printing global stuff
2019-05-23Fixing typos - Part 3JPR
2019-05-23Fixing typos - Part 2JPR
2019-05-13Passing evar_map to evars_of_term rather than expecting the term to be evar-nf.Hugo Herbelin
2019-05-13Moving Evd.evars_of_term from constr to econstr + consequences.Hugo Herbelin
This impacts a lot of code, apparently in the good, removing several conversions back and forth constr.
2019-05-13Merge PR #9887: [api] Remove 8.10 deprecations.Gaëtan Gilbert
Reviewed-by: SkySkimmer
2019-05-10Split the hypothesis conversion check in a conversion + ordering check.Pierre-Marie Pédrot
2019-05-10Make the check flag of conversion functions mandatory.Pierre-Marie Pédrot
The current situation is a mess, some functions set it by default, but other no. Making it mandatory ensures that the expected value is the correct one.
2019-05-10[api] Remove 8.10 deprecations.Emilio Jesus Gallego Arias
Some of them are significant so presumably it will take a bit of effort to fix overlays. I left out the removal of `nf_enter` for now as MTac2 needs some serious porting in order to avoid it.
2019-04-30fix `simpl_rel` and notations, `{pred T}` alias, `nonPropType` interfaceGeorges Gonthier
** Changed definition of `simpl_rel` to `T -> `simpl_pred T`, so that `inE` will now expand `a \in r b`, when `r := [rel x y | R]` to `R{b/x, a/y}`, as the expanding coercion is now only inserted in the _last_ application. The old definition made it possible to have a `simpl_rel >-> rel` coercion that does not block expansion, but this can now be achieved more economically with the `Arguments … /.` annotation. ** Deleted the `[rel of P]` notation which is no longer needed with the new `simpl_rel` definition, and was broken anyway. ** Added `relpre f R` definition of functional preimage of a notation. ** `comp` and `idfun` are now proper definitions, using the `Arguments … /.` annotation to specify simplification on application. ** Added `{pred T}` syntax for the alias of `pred T` in the `pred_sort` coercion class; deleted the `pred_class` alias: one should either use `pred_sort` in `Coercion` declarations, or `{pred T}` in type casts. Used `{pred T}` as appropriate in localised predicate (`{in …, …}`) theory. Extended and corrected `pred` coercion internal documentation. ** Simplified the `predType` structure by removing the redundant explicit `mem_pred` subfield, and replacing it with an interlocked projection; deleted `mkPredType`, now replaced by `PredType`. ** Added (and extensively documented) a `nonPropType` interface matching types that do _not_ have sort `Prop`, and used it to remove the non-standard maximal implicits annotation on `Some_inj` introduced in #6911 by @anton-trumov; included `test-suite` entry for `nonPropType`. ** Documented the design of the four structures used to control the matching of `inE` and related predicate rewriting lemmas; added `test-suite` entry covering the `pred` rewriting control idioms. ** Used `only printing` annotations to get rid of token concatenation hacks. ** Fixed boolean and general `if b return t then …` notation so that `b` is bound in `t`. This is a minor source of incompatibility for misuses of this syntax when `b` is _not_ bound in `t`, and `(if b then …) : t` should have been used instead. ** Reserved all `ssreflect`, `ssrfun` and `ssrbool` notation at the top of the file, adding some printing boxes, and removing some spurious `[pred .. => ..]` reserved notation. ** Fixed parsing precedence and format of `<hidden n>` notation, and declared and put it in an explicit `ssr_scope`. ** Used module-and-functor idiom to ensure that the `simpl_pred T >- pred T` _and_ `simpl_pred T >-> {pred T}` coercions are realised by the _same_ Gallina constant. ** Updated `CREDITS`. The policy implied by this PR: that `{pred T}` should systematically be used as the generic collective predicate type, was implemented in MathComp math-comp/math-comp#237. As a result `simpl_pred >-> pred_sort` coercions became more frequent, as it turned out they were not, as incorrectly stated in `ssrbool` internal comments, impossible: while the `simplPredType` canonical instance does solve all `simpl_pred T =~= pred_sort ?pT` instances, it does _not_ solve `simpl_pred T =~= {pred T}`, and so the coercion will be used in that case. However it appeared that having two different coercion constants confused the SSReflect keyed matching heuristic, hence the fix introduced here. This has entailed some rearrangement of `ssrbool`: the large `Predicates` section had to be broken up as the module-functor idiom for aliasing coercions cannot be used inside a section.
2019-04-29Merge PR #9983: Hypothesis conversion allocates a single evarHugo Herbelin
Reviewed-by: gares Ack-by: herbelin
2019-04-29Merge PR #9651: [ssr] Add tactics under and overCyril Cohen
Reviewed-by: CohenCyril Ack-by: Zimmi48 Ack-by: erikmd Ack-by: gares Ack-by: jfehrle
2019-04-25Add a typing colon in the output of the Search ssreflect vernacularErik Martin-Dorel
See also PR math-comp/math-comp#73
2019-04-23Deprecate the *_no_check variants of conversion tactics.Pierre-Marie Pédrot
2019-04-23[ssr] set under's tactic argument at LEVEL 3Erik Martin-Dorel
So if the underlying tactic "contains a ;" one should actually write: under eq_bigl => i do [rewrite andb_idl; first by move/eqP->].
2019-04-23[ssr] under: optimization of the tactic for (under eq_bigl => *)Erik Martin-Dorel
so it acts "more naturally" like (under eq_bigl; [hnf|]); move=> [*|]. Also: replace "by over." in the doc example with "over."
2019-04-23[ssr] Define over as a rewrite rule & Merge 'Under[ _ ] notationsErik Martin-Dorel
as suggested by @gares, and: * Rename some Under_* terms for better uniformity; * Update & Improve minor details in the documentation.
2019-04-23[ssr] under: Fix the defective form ("=> [*|*]" implied) and its docErik Martin-Dorel
* Add tests accordingly.
2019-04-23[ssr] under: Add iff support in side-conditionsErik Martin-Dorel
2019-04-23[ssr] under: use varnames from the 1st ipat with multi-goal under lemmasErik Martin-Dorel
In particular, this enhances support for lemma eq_big (with 2 side-conditions).
2019-04-23[ssr] new syntax for the under tacticEnrico Tassi
2019-04-23[ssr] under: Simplify the over tacticErik Martin-Dorel
* Use ssr `by […|…]` and `apply:`
2019-04-23[ssr] under: Add comment to justify the need for check_numgoalsErik Martin-Dorel
2019-04-23[ssr] over: Expose the new type of tactic for Ssrfwd.overtacErik Martin-Dorel
2019-04-23[ssr] Remove the unify_helper tactic that appears unnecessaryErik Martin-Dorel
It was only required in the (not realistic) test case "test_over_2_2", which happened to introduce evars after the context variables.
2019-04-23[ssr] under: Fix rewrite goals order when called from underErik Martin-Dorel
* "under"-specific behavior: the order of goals is kept even if one issues Global Set SsrOldRewriteGoalsOrder. * href: https://github.com/math-comp/math-comp/blob/mathcomp-1.7.0/mathcomp/ssreflect/ssreflect.v
2019-04-23[ssr] over: Add Ssrfwd.overtac in the .mliErik Martin-Dorel
2019-04-23[ssr] under: Check that the number of hints and focused goals matchErik Martin-Dorel
2019-04-23[ssr] under(one-liner version): Do nf_betaiota in the last goalErik Martin-Dorel
As a result, the following: under i: eq_bigr by rewrite adnnC. (* ensure 1 Under subogal is created *) under i: eq_big by [rewrite adnnC | rewrite addnC]. (* 2 Under subgoals *) amounts to: under i: eq_bigr; [rewrite adnnC; over | cbv beta iota]. under i: eq_big; [rewrite adnnC; over | rewrite adnnC; over | cbv beta iota].
2019-04-23[ssr] under: Change the style of a few tests (over tactic vs. lemma)Erik Martin-Dorel
2019-04-23[ssr] under: Move {beta_expand, unify_helper} in the module type (qualify them)Erik Martin-Dorel
2019-04-23[ssr] under: Strenghten over & Add test_big_andbErik Martin-Dorel
* Rely on a new tactic unify_helper that workarounds the fact [apply Under.under_done] cannot unify (?G i...) with (expr i...) in [|- @Under T (expr i...) (?G i...)] when expr is a constant expression, or has more than one var (i...). Idea: massage the expression with Ltac to obtain a beta redex. * Simplify test-suite/ssr/under.v by using TestSuite.ssr_mini_mathcomp and add a test-case [test_big_andb]. * Summary of commands to quickly test [under]: $ cd .../coq $ make plugins/ssr/ssreflect.vo plugins/ssr/ssrfun.vo plugins/ssr/ssrbool.vo $ cd test-suite $ touch prerequisite/ssr_mini_mathcomp.v $ make $ emacs under.v
2019-04-23[ssr] under: Extend the test-suite to exemplify most use casesErik Martin-Dorel
2019-04-23[ssr] under: generate missing Under subgoal for eq_bigl/eq_bigErik Martin-Dorel
in the particular case where the side-condition is phrased (_ : @eqfun bool I P1 P2) instead of (_ : forall x : I, P1 x = P2 x)
2019-04-23[ssr] under: Add support for one-liners "under (…) by [tac1|tac2]."Erik Martin-Dorel
Supported syntax: under i: eq_bigr by rewrite adnnC. (* ensure 1 Under subogal is created *) under i: eq_big by [rewrite adnnC | rewrite addnC]. (* 2 Under subgoals *) Equivalent, expanded form: under i: eq_bigr; [rewrite adnnC; over | idtac]. under i: eq_big; [rewrite adnnC; over | rewrite adnnC; over | idtac].
2019-04-23[ssr] over: also works on universally quantified goalsErik Martin-Dorel
2019-04-23[ssr] Define both a lemma "over" (in sig UNDER) and an ltac "over"Erik Martin-Dorel
Both can be use to close the "under goals", in rewrite style or in closing-tactic style. Contrarily to the previous implementation that assumed "over : forall (T : Type) (x : T), @Under T x x <-> True" this new design won't require the Setoid library. Extend the test-suite (in test-suite/ssr/under.v)
2019-04-23[ssr] under: Rename bound variables a posteriori for cosmetic purposeEnrico Tassi
Rename the bound variables of the last (lambda) argument of the redex w.r.t. the varnames specified by the user. Co-authored-by: Erik Martin-Dorel <erik.martin-dorel@irit.fr>
2019-04-17Merge PR #9876: Command-line setters for optionsEmilio Jesus Gallego Arias
Ack-by: SkySkimmer Reviewed-by: Zimmi48 Reviewed-by: ejgallego Reviewed-by: gares
2019-04-16Clean the representation of recursive annotation in ConstrexprMaxime Dénès
We make clearer which arguments are optional and which are mandatory. Some of these representations are tricky because of small differences between Program and Function, which share the same infrastructure. As a side-effect of this cleanup, Program Fixpoint can now be used with e.g. {measure (m + n) R}. Previously, parentheses were required around R.
2019-04-12Unify Set and Unset handling for optionsGaëtan Gilbert
Not sure if the idetop.set_options was correctly changed, ocaml types pass at least.
2019-04-10Remove calls to global env in InductiveopsMaxime Dénès
2019-04-10Remove one call to Global.env in DetypingMaxime Dénès
One other call still remains, but will require to refactor some section-handling code.
2019-04-10Remove calls to global env from indrecMaxime Dénès
2019-04-02[ssr] rewrite takes optional function to make the new valued of the redexEnrico Tassi
2019-04-02[ssr] implement "under i: ext_lemma" by rewrite ruleEnrico Tassi
Still to do: renaming the bound variables afterwards
2019-04-02[ssr] under: Add opaque modules for tagging and notation supportErik Martin-Dorel
(Note: coq notations cannot contain \n) Co-authored-by: Enrico Tassi <Enrico.Tassi@inria.fr>
2019-04-02[ssr] fix implementation of refine ~first_goes_lastEnrico Tassi
2019-04-02[ssr] clean up type declaration of ssrrewritetacEnrico Tassi