From 1681b494287c789ff57503918a1219b4bc65d9f9 Mon Sep 17 00:00:00 2001 From: Ralf Jung <jung@mpi-sws.org> Date: Thu, 20 May 2021 11:01:13 +0200 Subject: [PATCH] explicitly declare visibility of Scope actions --- Makefile.coq.local | 3 ++- theories/streams.v | 2 +- theories/strings.v | 4 ++-- theories/vector.v | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.coq.local b/Makefile.coq.local index 00c3e49a..e623454d 100644 --- a/Makefile.coq.local +++ b/Makefile.coq.local @@ -13,9 +13,10 @@ NORMALIZER:=test-normalizer.sed test: $(TESTFILES:.v=.vo) # Make sure everything imports the options, and all Instance/Argument/Hint are qualified. + $(SHOW)"Performing some style checks..." $(HIDE)for FILE in $(VFILES); do \ if ! fgrep -q 'From stdpp Require Import options.' "$$FILE"; then echo "ERROR: $$FILE does not import 'options'."; echo; exit 1; fi ; \ - if egrep '^\s*(Instance|Arguments|Remove|Hint (Extern|Constructors|Resolve|Immediate|Mode|Opaque|Transparent|Unfold))\s' "$$FILE"; then echo "ERROR: $$FILE contains unqualified 'Instance'/'Arguments'/'Hint'."; echo "Please add 'Global' or 'Local' as appropriate."; echo; exit 1; fi \ + if egrep '^\s*(Instance|Arguments|Remove|Hint\s+(Extern|Constructors|Resolve|Immediate|Mode|Opaque|Transparent|Unfold)|(Open|Close)\s+Scope)\s' "$$FILE"; then echo "ERROR: $$FILE contains unqualified 'Instance'/'Arguments'/'Hint'/'Scope' (see above)."; echo "Please add 'Global' or 'Local' as appropriate."; echo; exit 1; fi \ done .PHONY: test diff --git a/theories/streams.v b/theories/streams.v index 3c2736a2..32baa73d 100644 --- a/theories/streams.v +++ b/theories/streams.v @@ -3,7 +3,7 @@ From stdpp Require Import options. Declare Scope stream_scope. Delimit Scope stream_scope with stream. -Open Scope stream_scope. +Global Open Scope stream_scope. CoInductive stream (A : Type) : Type := scons : A → stream A → stream A. Global Arguments scons {_} _ _ : assert. diff --git a/theories/strings.v b/theories/strings.v index f41aa1fb..5cf255a6 100644 --- a/theories/strings.v +++ b/theories/strings.v @@ -9,10 +9,10 @@ imported hereditarily somewhere. *) Notation length := List.length. (** * Fix scopes *) -Open Scope string_scope. +Global Open Scope string_scope. (* Make sure [list_scope] has priority over [string_scope], so that the "++" notation designates list concatenation. *) -Open Scope list_scope. +Global Open Scope list_scope. Infix "+:+" := String.append (at level 60, right associativity) : stdpp_scope. Global Arguments String.append : simpl never. diff --git a/theories/vector.v b/theories/vector.v index 6cff743f..c95ffd1f 100644 --- a/theories/vector.v +++ b/theories/vector.v @@ -5,7 +5,7 @@ naming conventions in this development. *) From stdpp Require Import countable. From stdpp Require Export fin list. From stdpp Require Import options. -Open Scope vector_scope. +Global Open Scope vector_scope. (** The type [vec n] represents lists of consisting of exactly [n] elements. Whereas the standard library declares exactly the same notations for vectors as -- GitLab