-
Notifications
You must be signed in to change notification settings - Fork 243
Editing files in the library
F★'s standard library currently resides in ulib (as in universes). The lib directory contains the old (stratified) standard library. See https://github.com/FStarLang/FStar/blob/master/src/README to make sure you don't get confused between the (old) stratified code and the (new) universes code. The former shall go away soon, hopefully.
Here are some tips&tricks if you plan to edit these files and/or submit a pull request.
F★ language quirks.
- Always annotate your top-level functions with a
val(because #517, #620, #581). - Always provide the return effect for your functions! The default effect changes in an unpredictable manner; if
FStar.Allis in scope, then the default effect isML, otherwise it isTot. Your file may or may not be parsed withFStar.Allin scope, depending on the (unspecified) ordering of files performed by the dependency analysis and the criterion below. - If your module is in the namespace
FStar, then it only getsopen Primsprepended by default. This is not the behavior of files outside of theFStarnamespace! See Dealing with F★ dependencies for more information.
General recommendations
- The naming convention is in flux. Stay tuned for some consensus, hopefully soon.
-
Seq,Set,Map,OrdMap,OrdSetcontain a minimalistic interface. It is recommended to use thePropertiesmodule (e.g.SeqProperties) to write lemmas / extend these modules. - My understanding is that the
hyperheapfolder is only meant to contain modules that must be overridden via--include path/to/hyperheap. In clear, no new files should be created inhyperheap.
JP: putting some questions below that I and others have.
Questions
-
Why do we have so much emphasis on
Seqinstead ofList? Is it for verification reasons, or just becauseSeqorganically grew to have more lemmas? -
Some naming inconsistencies: --
FStar.TSetvsFStar.List.Tot--FStar.MRefvsFStar.Monotonic.RRef