aboutsummaryrefslogtreecommitdiff
path: root/vernac/comAssumption.ml
AgeCommit message (Collapse)Author
2020-11-22Fixes another instance of bug #7967: restriction of universes in "Context".Hugo Herbelin
2020-11-04Moving interpretation of user-level universes in constrintern.ml.Hugo Herbelin
2020-10-16Fixes/enhancements with local definitions in records.Hugo Herbelin
Fixes implicit arguments from the body of a defined field not taken into account. Get (a bit) more information for detection of SProp relevance in implicitly-typed defined field. (It should be done at the very end of the inference phase, though, because some evars may not yet be instantiated.)
2020-10-16Generalizing and exporting interp_assumption/interp_definition.Hugo Herbelin
This shall be for Record fields consumption.
2020-07-02Fix Context with nonmaximplicit.Gaëtan Gilbert
Fix #12551
2020-06-26[declare] [api] Removal of duplicated type aliases.Emilio Jesus Gallego Arias
2020-06-26[declare] [api] Removal of deprecated functionsEmilio Jesus Gallego Arias
The previous refactoring in `Declare` to add `CInfo.t` makes this a good moment to clean overlays up w.r.t. deprecation. All cases but one is just a matter of simple renaming, for the other the use of an internal API is replaced by newer API.
2020-06-03[declare] Hide internals of variable declaration entries.Emilio Jesus Gallego Arias
In particular this avoids exposing `Evd.side_effects proof_entry` in the API.
2020-05-07[declare] Merge DeclareDef into DeclareEmilio Jesus Gallego Arias
The API in `DeclareDef` should become the recommended API in `Declare`. This greatly reduces the exposure of internals; we still have a large offender in `Lemmas` but that will be taken care of in the next commit; effectively removing quite some chunks from `declare.mli`. This PR originally introduced a dependency cycle due to: - `Declare`: uses `Vernacexpr.decl_notation list` - `Vernacexpr`: uses `ComHint.hint_expr` - `ComHint`: uses `Declare.declare_constant` This is a real cycle in the sense that `ComHint` would have also move to `DeclareDef` in the medium term. There were quite a few ways to solve it, we have chosen to move the hints ast to `Vernacexpr` as it is not very invasive and seems consistent with the current style. Alternatives, which could be considered at a later stage are for example moving the notations AST to `Metasyntax`, having `Declare` not to depend on `Vernacexpr` [which seems actually a good thing to do in the medium term], reworking notation support more deeply...
2020-04-21[declare] [tactics] Move declare to `vernac`Emilio Jesus Gallego Arias
This PR moves `Declare` to `vernac` which will hopefully allow to unify it with `DeclareDef` and avoid exposing entry internals. There are many tradeoffs to be made as interface and placement of tactics is far from clear; I've tried to reach a minimally invasive compromise: - moved leminv to `ltac_plugin`; this is unused in the core codebase and IMO for now it is the best place - hook added for abstract; this should be cleaned up later - hook added for scheme declaration; this should be cleaned up later - separation of hints vernacular and "tactic" part should be also done later, for now I've introduced a `declareUctx` module to avoid being invasive there. In particular this last point strongly suggest that for now, the best place for `Class_tactics` would be also in `ltac`, but I've avoided that for now too. This partially supersedes #10951 for now and helps with #11492 .
2020-04-15Coqdoc: Exporting location and unique id for binding variables.Hugo Herbelin
This provides linking, appropriate coloring and appropriate hovering in coqdoc documents. In particular, this fixes #7697.
2020-03-31Remove special case for implicit inductive parametersMaxime Dénès
Co-authored-by: Jasper Hugunin <jasper@hugunin.net> Co-authored-by: Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>
2020-03-30[declare] Fuse prepare and declare for the non-interactive path.Emilio Jesus Gallego Arias
This will allow to share the definition metadata for example with obligations; a bit more work is needed to finally move the preparation of interactive proofs from Proof_global to `prepare_entry`.
2020-03-30[declareDef] More consistent handling of universe bindersEmilio Jesus Gallego Arias
The only reasons that `prepare_definition` returned a sigma were: - to obtain the universe binders to be passed to declare - to obtain the UState.t to be passed to the equations hook We handle this automatically now; it seems like a reasonably good API improvement. However, it is not clear what we do now is right for all cases; must check.
2020-03-30[declare] Make the type of closed entries opaque.Emilio Jesus Gallego Arias
This is a step in forcing all entry creation go thru the preparation functions. We still need to handle plain `Declare.` calls, but this will be next step. We need to leave a backdoor for interactive proofs until we unify proof preparation happening in `Proof_global` with the one happening in `DeclareDef`, but we are getting there. TODO: see how to avoid the normalization problems in DeclareObl
2020-03-19[declare] Bring more consistency to parameters using labelsEmilio Jesus Gallego Arias
Most of the parameters were named, we fix the remaining cases.
2020-03-18Update headers in the whole code base.Théo Zimmermann
Add headers to a few files which were missing them.
2020-02-25[vernac] Remove deprecated function.Emilio Jesus Gallego Arias
2020-02-04Add syntax for non maximally inserted implicit argumentsSimonBoulier
2019-12-22Rename files with Class in their name to make their role clearer.Pierre-Marie Pédrot
We restrict to those that are actually related to typeclasses, and perform the following renamings: Classops --> Coercionops Class --> ComCoercion
2019-12-16Pretyping.check_evars: make initial evar map optionalGaëtan Gilbert
There are no users in Coq but maybe some plugin wants it so don't completely remove it
2019-11-29Remove deprecated Typeclasses Axioms Are Instances.Théo Zimmermann
2019-10-28Merge PR #10950: [declare] Split universe and inductive declaration code to ↵Gaëtan Gilbert
vernac/ Ack-by: Janno Reviewed-by: SkySkimmer
2019-10-25[declare] Generalize kind type on declareDefEmilio Jesus Gallego Arias
This is useful to remove some duplicate bits in other declare files.
2019-10-24[declare] Split universe declaration code to vernac/Emilio Jesus Gallego Arias
The code is self-contained and only used by commands; this also highlights the several `Libobject.obj` registered for each declaration.
2019-10-14Use kernel info from Global for Lib.sections_{depth,are_opened}Gaëtan Gilbert
2019-10-13Fix #10888: Context import behaviour in modtypeGaëtan Gilbert
2019-10-05Fix #10669 incorrect substitution in context outside sectionGaëtan Gilbert
2019-10-05Cleanup ComAssumptionGaëtan Gilbert
The general idea is to move tests on scope=Discharge and on Lib.sections_are_opened up in the call stack. This allows better control over the universe manipulation. There are some corner case behaviour change, eg: - [Context (foo:=bla)] outside a section correctly declares an axiom (fix #10668) - (not observable) universes for [Variable A B : Type] in section are declared only once - universes and universe names for [Axiom A B : Type] are declared only once. This changes the qualification of the universe name: before it was the last axiom (so [B.u0]), now it's the first one ([A.u0]). Probably nobody cares about this. - context outside section uses different [kind] I'm not sure why context outside a section behaves differently based on whether we're in a module type, I tried to preserve it but maybe we should uniformize. The universe manipulation for Axiom (in the declare_assumptions function) is a bit awkward, maybe when there are multiple monomorphic axioms instead of trying to attach the universes to the first one we should just declare them separately like with Context. OTOH unlike with context dropping the universe names seems incorrect.
2019-10-05Move do_primitive from comassumption to its own module.Gaëtan Gilbert
Primitives don't have anything to do with assumptions.
2019-10-05Declare universes for variables outside of Declare.declare_variableGaëtan Gilbert
(letins still declare universes in declare_variable as they use entries) The section check_same_poly is moved to declare_universe_context (it makes more sense there, universe polymorphism doesn't apply to the variables/letins themselves)
2019-08-19[declare] Use `binding_kind` for implicit kind instead of boolean.Emilio Jesus Gallego Arias
2019-08-08Emit Feedback.AddedAxiom in Declare instead of higher layersGaëtan Gilbert
This lets us remove the passing around of "status" in comassumption and generally makes highlighting axiom adding lines in coqide more reliable as there's no need for per-command code. If a command adds multiple axioms it will emit AddedAxiom multiple times, this doesn't seem to be a problem though. We may wonder if "Fail Fail Axiom" should be highlighted as "Axiom" (both before and after this commit it is).
2019-07-08[api] Deprecate GlobRef constructors.Emilio Jesus Gallego Arias
Not pretty, but it had to be done some day, as `Globnames` seems to be on the way out. I have taken the opportunity to reduce the number of `open` in the codebase. The qualified style would indeed allow us to use a bit nicer names `GlobRef.Inductive` instead of `IndRef`, etc... once we have the tooling to do large-scale refactoring that could be tried.
2019-07-03declare_variable: path is always Lib.cwd()Gaëtan Gilbert
2019-07-03Declare section variables in direct style "without" an objectGaëtan Gilbert
The object was mostly for wrangling universes, but we already have the universe object for that. It's also used by some code which iterates over objects to find variables. Search used to do this but was changed in a previous commit. Prettyp.print_context and derivatives do this and I don't understand it enough to fix it, so I kept a dummy object around. It seems like a not very common used Print family (not documented AFAICT) so maybe we should remove it all instead.
2019-07-01[declare] Separate kinds from entries in constant declarationEmilio Jesus Gallego Arias
They are clearly not at the same importance level, thus we use a named parameter and isolate the kinds as to allow further improvements and refactoring.
2019-07-01[api] Refactor most of `Decl_kinds`Emilio Jesus Gallego Arias
We move the bulk of `Decl_kinds` to a better place [namely `interp/decls`] and refactor the use of this information quite a bit. The information seems to be used almost only for `Dumpglob`, so it certainly should end there to achieve a cleaner core. Note the previous commits, as well as the annotations regarding the dubious use of the "variable" data managed by the `Decls` file. IMO this needs more work, but this should be a good start.
2019-06-25Remove the internal_flag argument from Declare API.Pierre-Marie Pédrot
It was never used actually.
2019-06-24Use named records instead of tuples where `polymorphic` used to be.Gaëtan Gilbert
Followup on "[api] Remove `polymorphic` type alias, use labels instead."
2019-06-24[api] Remove `polymorphic` type alias, use labels instead.Emilio Jesus Gallego Arias
This is more in-line with attributes and the rest of the API, and makes some code significantly clearer (as in `foo true false false`, etc...)
2019-06-24[api] Move `locality` from `library` to `vernac`.Emilio Jesus Gallego Arias
This datatype does belong to this layer.
2019-06-24[lemmas] [proof] Split proof kinds into per-layer components.Emilio Jesus Gallego Arias
We split `{goal,declaration,assumption}_kind` into their components. This makes sense as each part of this triple is handled by a different layer, namely: - `polymorphic` status: necessary for the lower engine layers; - `locality`: only used in `vernac` top-level constants - `kind`: merely used for cosmetic purposes [could indeed be removed / pushed upwards] We also profit from this refactoring to add some named parameters to the top-level definition API which is quite parameter-hungry. More refactoring is possible and will come in further commits, in particular this is a step towards unifying the definition / lemma save path.
2019-06-24Duplicate the type of constant entries in Proof_global.Pierre-Marie Pédrot
This allows to desynchronize the kernel-facing API from the proof-facing one.
2019-06-17Update ml-style headers to new year.Théo Zimmermann
2019-06-16Turning "manual_implicits" into a list of position in impargs.ml.Hugo Herbelin
2019-06-16Adding location in warning telling implicit arguments differ in term and type.Hugo Herbelin
2019-06-08Cleaning the status of Local Definition and similar.Hugo Herbelin
Formerly, knowing if a declaration was to be discharged, to be global but invisible at import, or to be global but visible at import was obtained by combining the parser-level information (i.e. use of Variable/Hypothesis/Let vs use of Axiom/Parameter/Definition/..., use of Local vs Global) with the result of testing whether there were open sections. We change the meaning of the Discharge flag: it does not tell anymore that it was syntactically a Variable/Hypothesis/Let, but tells the expected semantics of the declaration (issuing a warning in the parser-to-interpreter step if the semantics is not the one suggested by the syntax). In particular, the interpretation/command engine becomes independent of the parser. The new "semantic" type is: type import_status = ImportDefaultBehavior | ImportNeedQualified type locality = Discharge | Global of import_status In the process, we found a couple of inconsistencies in the treatment of the locality status. See bug #8722 and test file LocalDefinition.v.
2019-06-08Adding a new kind of assumption to track assumption coming from "Context".Hugo Herbelin
This is to avoid depending on the combination "Discharge" + no opened section to trigger an automatic declaration of instance.
2019-05-23Fixing typos - Part 3JPR