aboutsummaryrefslogtreecommitdiff
path: root/clib/hMap.ml
AgeCommit message (Collapse)Author
2020-05-18[obligations] Pre-functionalize Program stateEmilio Jesus Gallego Arias
In our quest to unify all the declaration paths, an important step is to account for the state pertaining to `Program` declarations. Whereas regular proofs keep are kept in a stack-like structure; obligations for constants defined by `Program` are stored in a global map which is manipulated by almost regular open/close proof primitives. This PR is in preparation for the switch to a purely functional state in #11836 ; the full switch requires deeper changes so it is helpful to have this PR preparing most of the structure. Most of the PR is routine; only remarkable change is that the hook for admitted obligations is now called explicitly in `finish_admitted` as it had to learn about the different types of proof_endings. Before, obligations set it in `start_lemma` but only used in the `Admitted` path.
2020-03-18Update headers in the whole code base.Théo Zimmermann
Add headers to a few files which were missing them.
2019-10-24Raise an anomaly when looking up unknown constant/inductiveGaëtan Gilbert
If you have access to a kernel name you also should have the environment in which it is defined, barring hacks. In order to disfavor hacks we make the standard lookups raise anomalies so that people are forced to admit they rely on the internals of the environment. We find that hackers operated on the code for side effects, for finding inductive schemes, for simpl and for Print Assumptions. They attempted to operate on funind but the error handling code they wrote would have raised another Not_found instead of being useful. All these uses are indeed hacky so I am satisfied that we are not forcing new hacks on callers.
2019-06-17Update ml-style headers to new year.Théo Zimmermann
2019-05-02Add union in Map interfaceMaxime Dénès
2019-02-22Implement hmap.updateGaëtan Gilbert
2019-02-22[lib] Add `Map.update` from OCaml 4.06Emilio Jesus Gallego Arias
It will take more than a year to bump the OCaml version, this is in response of a request by @Skyskimmer. We also update our internal repr to make it closer to the one in modern OCaml.
2018-12-17Add Map.find_optGaëtan Gilbert
2018-10-18[clib] Provide `filter_range` function.Emilio Jesus Gallego Arias
This is very useful to compute efficiently a list of prefixes. Will be used in conjunction with the nametab to provide completion. Example of use: ``` let cprefix x y = String.(compare x (sub y 0 (min (length x) (length y)))) in M.filter_range (cprefix "foo") m ``` We could of course maintain a trie, but this is less invasive an should work at our scale.
2018-10-06[api] Remove (most) 8.9 deprecated objects.Emilio Jesus Gallego Arias
A few of them will be of help for future cleanups. We have spared the stuff in `Names` due to bad organization of this module following the split from `Term`, which really difficult things removing the constructors.
2018-05-23Collecting Map.smart_* functions into a module Map.Smart.Hugo Herbelin
2018-02-27Update headers following #6543.Théo Zimmermann
2017-12-23[lib] Split auxiliary libraries into Coq-specific and general.Emilio Jesus Gallego Arias
Up to this point the `lib` directory contained two different library archives, `clib.cma` and `lib.cma`, which a rough splitting between Coq-specific libraries and general-purpose ones. We know split the directory in two, as to make the distinction clear: - `clib`: contains libraries that are not Coq specific and implement common data structures and programming patterns. These libraries could be eventually replace with external dependencies and the rest of the code base wouldn't notice much. - `lib`: contains Coq-specific common libraries in widespread use along the codebase, but that are not considered part of other components. Examples are printing, error handling, or flags. In some cases we have coupling due to utility files depending on Coq specific flags, however this commit doesn't modify any files, but only moves them around, further cleanup is welcome, as indeed a few files in `lib` should likely be placed in `clib`. Also note that `Deque` is not used ATM.