Skip to content
Snippets Groups Projects

Added strings to prelude to fix printing of strings.length

Closed Michael Sammler requested to merge msammler/strings_in_prelude into master
2 unresolved threads
1 file
+ 9
0
Compare changes
  • Side-by-side
  • Inline
+ 9
0
@@ -10,4 +10,13 @@ From stdpp Require Export
@@ -10,4 +10,13 @@ From stdpp Require Export
fin_sets
fin_sets
listset
listset
list
list
 
(* This must be exported after base (which exports Coq.List) since
Please register or sign in to reply
 
it exports the length notation to ensure that we use List.length and
 
not Strings.length. If we don't export strings here and some file
 
imports strings and then the prelude (which seems to happen with
 
Iris), the definition in Coq.List will shadow the notation in
    • Wouldn't it make more sense for Iris to import the prelude first?

      • I don't know where strings gets imported in Iris. It can also be that something in iris exports the prelude, then strings and then the prelude again (this can easily happen because many files in iris export the prelude since it it exported transitively).

      • algebra/base.v exports prelude.

        There are a bunch of spurious exports of std.strings here and there, but probably all of those can be removed:

        $ mgrep std.*string
        theories/proofmode/sel_patterns.v:From stdpp Require Export strings.
        theories/proofmode/intro_patterns.v:From stdpp Require Export strings.
        theories/proofmode/spec_patterns.v:From stdpp Require Export strings.
        theories/proofmode/notation.v:From stdpp Require Export strings.
        theories/proofmode/base.v:From stdpp Require Export strings.
        theories/heap_lang/lang.v:From stdpp Require Export binders strings.
      • Please register or sign in to reply
Please register or sign in to reply
 
stdpp.strings and length will be printed as strings.length since Coq
 
prefers printing the notation (strings.length) instead of the
 
definition which shadows it. *)
 
strings
lexico.
lexico.
Loading