chore(tests): remove most occurrences of 'context' command from the test suite

This commit is contained in:
Leonardo de Moura 2015-04-21 19:33:21 -07:00
parent 76bf8de91a
commit 9fb7aa9f1c
46 changed files with 90 additions and 87 deletions

View file

@ -6,7 +6,7 @@ mk : A → H A
definition foo {A : Type} [h : H A] : A := definition foo {A : Type} [h : H A] : A :=
H.rec (λa, a) h H.rec (λa, a) h
context section
variable A : Type variable A : Type
variable h : H A variable h : H A
definition tst : A := definition tst : A :=

View file

@ -1,6 +1,6 @@
import logic import logic
context section
hypothesis P : Prop. hypothesis P : Prop.
definition crash definition crash

View file

@ -1,7 +1,7 @@
import logic import logic
definition id {A : Type} (a : A) := a definition id {A : Type} (a : A) := a
context section
set_option pp.implicit true set_option pp.implicit true
check id true check id true
end end

View file

@ -1,2 +1,2 @@
@id Prop true : Prop @id Prop true : Prop
id true : Prop @id Prop true : Prop

View file

@ -3,29 +3,32 @@ definition Prop := Type.{0} inductive true : Prop := intro : true inductive fals
inductive prod (A B : Type) := mk : A → B → prod A B infixl `×`:30 := prod inductive prod (A B : Type) := mk : A → B → prod A B infixl `×`:30 := prod
variables a b c : num variables a b c : num
context section
notation `(` t:(foldr `,` (e r, prod.mk e r)) `)` := t local notation `(` t:(foldr `,` (e r, prod.mk e r)) `)` := t
check (a, false, b, true, c) check (a, false, b, true, c)
set_option pp.notation false set_option pp.notation false
check (a, false, b, true, c) check (a, false, b, true, c)
end end
context section
notation `(` t:(foldr `,` (e r, prod.mk r e)) `)` := t local notation `(` t:(foldr `,` (e r, prod.mk r e)) `)` := t
set_option pp.notation true
check (a, false, b, true, c) check (a, false, b, true, c)
set_option pp.notation false set_option pp.notation false
check (a, false, b, true, c) check (a, false, b, true, c)
end end
context section
notation `(` t:(foldl `,` (e r, prod.mk r e)) `)` := t local notation `(` t:(foldl `,` (e r, prod.mk r e)) `)` := t
set_option pp.notation true
check (a, false, b, true, c) check (a, false, b, true, c)
set_option pp.notation false set_option pp.notation false
check (a, false, b, true, c) check (a, false, b, true, c)
end end
context section
notation `(` t:(foldl `,` (e r, prod.mk e r)) `)` := t local notation `(` t:(foldl `,` (e r, prod.mk e r)) `)` := t
set_option pp.notation true
check (a, false, b, true, c) check (a, false, b, true, c)
set_option pp.notation false set_option pp.notation false
check (a, false, b, true, c) check (a, false, b, true, c)

View file

@ -1,7 +1,7 @@
open is_trunc open is_trunc
--structure is_contr [class] (A : Type) : Type --structure is_contr [class] (A : Type) : Type
context section
parameters {P : Π(A : Type), A → Type} parameters {P : Π(A : Type), A → Type}
definition my_contr {A : Type} [H : is_contr A] (a : A) : P A a := sorry definition my_contr {A : Type} [H : is_contr A] (a : A) : P A a := sorry

View file

@ -2,7 +2,7 @@ import algebra.group algebra.precategory.basic
open eq sigma unit category path_algebra open eq sigma unit category path_algebra
context section
parameters {P₀ : Type} [P : precategory P₀] parameters {P₀ : Type} [P : precategory P₀]
structure my_structure := (a : P₀) (b : P₀) (f : @hom P₀ P a b) structure my_structure := (a : P₀) (b : P₀) (f : @hom P₀ P a b)

View file

@ -5,7 +5,7 @@ open eq sigma unit category path_algebra equiv
set_option pp.implicit true set_option pp.implicit true
set_option pp.universes true set_option pp.universes true
set_option pp.notation false set_option pp.notation false
context section
parameters {D₀ : Type} [C : precategory D₀] parameters {D₀ : Type} [C : precategory D₀]
{D₂ : Π ⦃a b c d : D₀⦄ (f : hom a b) (g : hom c d) {D₂ : Π ⦃a b c d : D₀⦄ (f : hom a b) (g : hom c d)
(h : hom a c) (i : hom b d), Type} (h : hom a c) (i : hom b d), Type}

View file

@ -1,6 +1,6 @@
open is_trunc open is_trunc
context section
parameters {P : Π(A : Type), A → Type} parameters {P : Π(A : Type), A → Type}
definition my_contr {A : Type} [H : is_contr A] (a : A) : P A a := sorry definition my_contr {A : Type} [H : is_contr A] (a : A) : P A a := sorry

View file

@ -2,7 +2,7 @@ import algebra.precategory.basic
open category open category
context section
parameter {D₀ : Type} parameter {D₀ : Type}
parameter (C : precategory D₀) parameter (C : precategory D₀)
parameter (D₂ : Π ⦃a b c d : D₀⦄ (f : hom a b) (g : hom c d) (h : hom a c) (i : hom b d), Type) parameter (D₂ : Π ⦃a b c d : D₀⦄ (f : hom a b) (g : hom c d) (h : hom a c) (i : hom b d), Type)
@ -22,7 +22,7 @@ context
(ID₁ : ID₁_type) (ID₁ : ID₁_type)
end end
context section
parameter {D₀ : Type} parameter {D₀ : Type}
parameter [C : precategory D₀] parameter [C : precategory D₀]
parameter {D₂ : Π ⦃a b c d : D₀⦄ (f : hom a b) (g : hom c d) (h : hom a c) (i : hom b d), Type} parameter {D₂ : Π ⦃a b c d : D₀⦄ (f : hom a b) (g : hom c d) (h : hom a c) (i : hom b d), Type}

View file

@ -1,10 +1,10 @@
context section
open [notations] [coercions] nat open [notations] [coercions] nat
check 1 + 2 check 1 + 2
check add -- Error aliases were not created check add -- Error aliases were not created
end end
context section
open [declarations] [notations] nat open [declarations] [notations] nat
variable a : nat variable a : nat
check a + a check a + a
@ -12,7 +12,7 @@ context
check a + 1 -- Error coercion from num to nat was not loaded check a + 1 -- Error coercion from num to nat was not loaded
end end
context section
open - [classes] nat open - [classes] nat
variable a : nat variable a : nat
check a + a check a + a
@ -22,7 +22,7 @@ context
_ -- Error inhabited instances was not loaded _ -- Error inhabited instances was not loaded
end end
context section
open - [classes] [decls] nat open - [classes] [decls] nat
variable a : nat variable a : nat
check a + a check a + a
@ -32,7 +32,7 @@ context
_ -- Error inhabited instances was not loaded _ -- Error inhabited instances was not loaded
end end
context section
open [classes] nat open [classes] nat
definition foo3 : inhabited nat := definition foo3 : inhabited nat :=
_ _

View file

@ -1,6 +1,6 @@
open eq open eq
context section
parameter (A : Type) parameter (A : Type)
definition foo (a : A) : a = a := refl a definition foo (a : A) : a = a := refl a

View file

@ -1,7 +1,7 @@
import algebra.group import algebra.group
open algebra open algebra
context section
variable {A : Type} variable {A : Type}
variable [s : comm_monoid A] variable [s : comm_monoid A]
include s include s
@ -13,7 +13,7 @@ end
definition one [reducible] (A : Type) [s : has_one A] : A := definition one [reducible] (A : Type) [s : has_one A] : A :=
!has_one.one !has_one.one
context section
variable {A : Type} variable {A : Type}
variable [s : comm_group A] variable [s : comm_group A]
include s include s

View file

@ -3,13 +3,13 @@ import logic
namespace experiment namespace experiment
definition Type1 := Type.{1} definition Type1 := Type.{1}
context section
variable {A : Type} variable {A : Type}
variable f : A → A → A variable f : A → A → A
variable one : A variable one : A
variable inv : A → A variable inv : A → A
infixl `*` := f local infixl `*` := f
postfix `^-1`:100 := inv local postfix `^-1`:100 := inv
definition is_assoc := ∀ a b c, (a*b)*c = a*b*c definition is_assoc := ∀ a b c, (a*b)*c = a*b*c
definition is_id := ∀ a, a*one = a definition is_id := ∀ a, a*one = a
definition is_inv := ∀ a, a*a^-1 = one definition is_inv := ∀ a, a*a^-1 = one

View file

@ -1,8 +1,8 @@
import logic import logic
namespace N1 namespace N1
context section
context section
parameter A : Type parameter A : Type
definition foo (a : A) : Prop := true definition foo (a : A) : Prop := true
check foo check foo
@ -14,7 +14,7 @@ end N1
check N1.foo check N1.foo
namespace N2 namespace N2
context section
parameter A : Type parameter A : Type
inductive list : Type := inductive list : Type :=
| nil {} : list | nil {} : list

View file

@ -37,9 +37,9 @@ infix `=`:50 := eq
check eq.{1} check eq.{1}
context section
universe l universe variable l
universe u universe variable u
variable {T1 : Type.{l}} variable {T1 : Type.{l}}
variable {T2 : Type.{l}} variable {T2 : Type.{l}}
variable {T3 : Type.{u}} variable {T3 : Type.{u}}

View file

@ -2,7 +2,7 @@ import logic
definition subsets (P : Type) := P → Prop. definition subsets (P : Type) := P → Prop.
context section
hypothesis A : Type. hypothesis A : Type.
@ -14,7 +14,7 @@ hypothesis retract {P : subsets A} {a : A} : r (i P) a = P a.
definition delta (a:A) : Prop := ¬ (r a a). definition delta (a:A) : Prop := ¬ (r a a).
notation `δ` := delta. local notation `δ` := delta.
-- Crashes unifier! -- Crashes unifier!
theorem false_aux : ¬ (δ (i delta)) theorem false_aux : ¬ (δ (i delta))

View file

@ -2,7 +2,7 @@ import logic
open eq open eq
definition subsets (P : Type) := P → Prop. definition subsets (P : Type) := P → Prop.
context section
hypothesis A : Type. hypothesis A : Type.
@ -14,7 +14,7 @@ hypothesis retract {P : subsets A} {a : A} : r (i P) a = P a.
definition delta (a:A) : Prop := ¬ (r a a). definition delta (a:A) : Prop := ¬ (r a a).
notation `δ` := delta. local notation `δ` := delta.
theorem delta_aux : ¬ (δ (i delta)) theorem delta_aux : ¬ (δ (i delta))
:= assume H : δ (i delta), := assume H : δ (i delta),

View file

@ -1,4 +1,4 @@
context section
open tactic open tactic
definition cases_refl (e : expr) : tactic := definition cases_refl (e : expr) : tactic :=
cases e expr_list.nil; apply rfl cases e expr_list.nil; apply rfl

View file

@ -1,7 +1,7 @@
import data.list import data.list
open nat list open nat list
context section
parameter {A : Type} parameter {A : Type}
parameter (p : A → Prop) parameter (p : A → Prop)
parameter [H : decidable_pred p] parameter [H : decidable_pred p]

View file

@ -1,12 +1,12 @@
import logic import logic
context section
variable {A : Type} variable {A : Type}
variable f : A → A → A variable f : A → A → A
variable one : A variable one : A
variable inv : A → A variable inv : A → A
infixl `*` := f local infixl `*` := f
postfix `^-1`:100 := inv local postfix `^-1`:100 := inv
definition is_assoc := ∀ a b c, (a*b)*c = a*b*c definition is_assoc := ∀ a b c, (a*b)*c = a*b*c
definition is_id := ∀ a, a*one = a definition is_id := ∀ a, a*one = a
definition is_inv := ∀ a, a*a^-1 = one definition is_inv := ∀ a, a*a^-1 = one

View file

@ -1,12 +1,12 @@
import logic import logic
context section
variable {A : Type} variable {A : Type}
variable f : A → A → A variable f : A → A → A
variable one : A variable one : A
variable inv : A → A variable inv : A → A
infixl `*` := f local infixl `*` := f
postfix `^-1`:100 := inv local postfix `^-1`:100 := inv
definition is_assoc := ∀ a b c, (a*b)*c = a*b*c definition is_assoc := ∀ a b c, (a*b)*c = a*b*c
definition is_id := ∀ a, a*one = a definition is_id := ∀ a, a*one = a
definition is_inv := ∀ a, a*a^-1 = one definition is_inv := ∀ a, a*a^-1 = one

View file

@ -43,7 +43,7 @@ section
variables {A : Type} [s : semigroup A] variables {A : Type} [s : semigroup A]
variables a b c : A variables a b c : A
definition mul := semigroup.rec (λmul assoc, mul) s a b definition mul := semigroup.rec (λmul assoc, mul) s a b
context section
infixl `*` := mul infixl `*` := mul
definition assoc : (a * b) * c = a * (b * c) := definition assoc : (a * b) * c = a * (b * c) :=
semigroup.rec (λmul assoc, assoc) s a b c semigroup.rec (λmul assoc, assoc) s a b c
@ -111,7 +111,7 @@ namespace monoid
variables {A : Type} [s : monoid A] variables {A : Type} [s : monoid A]
variables a b c : A variables a b c : A
include s include s
context section
definition mul := monoid.rec (λmul one assoc right_id left_id, mul) s a b definition mul := monoid.rec (λmul one assoc right_id left_id, mul) s a b
definition one := monoid.rec (λmul one assoc right_id left_id, one) s definition one := monoid.rec (λmul one assoc right_id left_id, one) s
infixl `*` := mul infixl `*` := mul

View file

@ -3,7 +3,7 @@ structure is_equiv [class] {A B : Type} (f : A → B) :=
check @is_equiv.inv check @is_equiv.inv
namespace is_equiv namespace is_equiv
context section
parameters A B : Type parameters A B : Type
parameter f : A → B parameter f : A → B
parameter c : is_equiv f parameter c : is_equiv f

View file

@ -1,6 +1,6 @@
set_option pp.implicit true set_option pp.implicit true
set_option pp.universes true set_option pp.universes true
context section
parameter {A : Type} parameter {A : Type}
definition foo : A → A → Type := (λ x y, Type) definition foo : A → A → Type := (λ x y, Type)
inductive bar {a b : A} (f : foo a b) := inductive bar {a b : A} (f : foo a b) :=

View file

@ -1,6 +1,6 @@
open nat open nat
context section
inductive NatA := inductive NatA :=
| a : NatA | a : NatA
| s : NatA → NatA | s : NatA → NatA

View file

@ -21,7 +21,7 @@ protected theorem dec_eq : ∀ x y : nat, decidable (x = y)
| inr H := inr (λ h : succ x = succ y, nat.no_confusion h (λ heq : x = y, absurd heq H)) | inr H := inr (λ h : succ x = succ y, nat.no_confusion h (λ heq : x = y, absurd heq H))
end end
context section
open list open list
parameter {A : Type} parameter {A : Type}
parameter (p : A → Prop) parameter (p : A → Prop)

View file

@ -1,16 +1,16 @@
prelude prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
context section
variable N : Type.{1} variable N : Type.{1}
variables a b c : N variables a b c : N
variable and : Prop → Prop → Prop variable and : Prop → Prop → Prop
infixr `∧`:35 := and local infixr `∧`:35 := and
variable le : N → N → Prop variable le : N → N → Prop
variable lt : N → N → Prop variable lt : N → N → Prop
precedence `≤`:50 precedence `≤`:50
precedence `<`:50 precedence `<`:50
infixl ≤ := le local infixl ≤ := le
infixl < := lt local infixl < := lt
check a ≤ b check a ≤ b
definition T : Prop := a ≤ b definition T : Prop := a ≤ b
check T check T

View file

@ -10,7 +10,7 @@ unit : one2
check one2 check one2
context foo section foo
universe l2 universe l2
parameter A : Type.{l2} parameter A : Type.{l2}

View file

@ -2,10 +2,10 @@ import logic data.unit
set_option pp.universes true set_option pp.universes true
context section
parameter (A : Type) parameter (A : Type)
context section
parameter (B : Type) parameter (B : Type)
structure point := structure point :=

View file

@ -1,6 +1,6 @@
import logic import logic
context section
parameter A : Type parameter A : Type
definition foo : ∀ ⦃ a b : A ⦄, a = b → a = b := definition foo : ∀ ⦃ a b : A ⦄, a = b → a = b :=
take a b H, H take a b H, H

View file

@ -1,4 +1,4 @@
context section
parameter (A : Type) parameter (A : Type)
definition foo := A definition foo := A
theorem bar {X : Type} {A : X} : foo := theorem bar {X : Type} {A : X} : foo :=

View file

@ -3,13 +3,13 @@ import logic
set_option pp.universes true set_option pp.universes true
set_option pp.implicit true set_option pp.implicit true
context section
universe k universe k
parameter A : Type parameter A : Type
context context
universe l universe variable l
universe u universe variable u
parameter B : Type parameter B : Type
definition foo (a : A) (b : B) := b definition foo (a : A) (b : B) := b

View file

@ -1,6 +1,6 @@
prelude prelude
definition Prop : Type.{1} := Type.{0} definition Prop : Type.{1} := Type.{0}
context section
parameter A : Type parameter A : Type
definition eq (a b : A) : Prop definition eq (a b : A) : Prop

View file

@ -3,7 +3,7 @@ variable (A : Type)
structure foo (a : A) := structure foo (a : A) :=
(eqpr : a = a) (eqpr : a = a)
context section
parameter (B : Type) parameter (B : Type)
structure foo2 (b : B) := structure foo2 (b : B) :=

View file

@ -27,7 +27,7 @@ section
check point3d_color.to_point check point3d_color.to_point
end end
context section
universe l universe l
parameters A : Type.{l} parameters A : Type.{l}
parameters B : Type.{l} parameters B : Type.{l}

View file

@ -2,7 +2,7 @@ constant A : Type.{1}
constants a b c : A constants a b c : A
constant f : A → A → A constant f : A → A → A
check f a b check f a b
context section
parameters A B : Type parameters A B : Type
parameters {C D : Type} parameters {C D : Type}
parameters [e d : A] parameters [e d : A]

View file

@ -19,7 +19,7 @@ end S2
namespace S3 namespace S3
context section
hypothesis I : Type hypothesis I : Type
definition F (X : Type) : Type := (X → Prop) → Prop definition F (X : Type) : Type := (X → Prop) → Prop
hypothesis unfold : I → F I hypothesis unfold : I → F I

View file

@ -1,7 +1,7 @@
import algebra.category.basic import algebra.category.basic
set_option pp.universes true set_option pp.universes true
context section
universes l₁ l₂ l₃ l₄ universes l₁ l₂ l₃ l₄
parameter C : Category.{l₁ l₂} parameter C : Category.{l₁ l₂}
parameter f : Category.{l₁ l₂} → Category.{l₃ l₄} parameter f : Category.{l₁ l₂} → Category.{l₃ l₄}

View file

@ -1,4 +1,4 @@
context section
parameter A : Type parameter A : Type
definition tst (a : A) := a definition tst (a : A) := a
set_option pp.universes true set_option pp.universes true

View file

@ -5,25 +5,25 @@ prelude namespace foo
constant c : A constant c : A
end foo end foo
context section
open foo (renaming a->b x->y) (hiding c) open foo (renaming a->b x->y) (hiding c)
check b check b
check y check y
check c -- Error check c -- Error
end end
context section
open foo (a x) open foo (a x)
check a check a
check x check x
check c -- Error check c -- Error
end end
context section
open foo (a x) (hiding c) -- Error open foo (a x) (hiding c) -- Error
end end
context section
open foo open foo
check a check a
check c check c
@ -35,18 +35,18 @@ namespace foo
infix `*`:75 := f infix `*`:75 := f
end foo end foo
context section
open foo open foo
check a * c check a * c
end end
context section
open [notations] foo -- use only the notation open [notations] foo -- use only the notation
check foo.a * foo.c check foo.a * foo.c
check a * c -- Error check a * c -- Error
end end
context section
open [decls] foo -- use only the declarations open [decls] foo -- use only the declarations
check f a c check f a c
check a*c -- Error check a*c -- Error

View file

@ -7,13 +7,13 @@ namespace tst
end tst end tst
print raw Type.{tst.v} print raw Type.{tst.v}
print raw Type.{v} -- Error: alias 'v' is not available anymore print raw Type.{v} -- Error: alias 'v' is not available anymore
context section
universe z -- Remark: this is a local universe universe variable z -- Remark: this is a local universe
print raw Type.{z} print raw Type.{z}
end end
print raw Type.{z} -- Error: local universe 'z' is gone print raw Type.{z} -- Error: local universe 'z' is gone
context section
namespace foo -- Error: we cannot create a namespace inside a context namespace foo -- Error: we cannot create a namespace inside a section
end end
namespace tst namespace tst
print raw Type.{v} -- Remark: alias 'v' is available again print raw Type.{v} -- Remark: alias 'v' is available again

View file

@ -13,7 +13,7 @@ constant f (a b : N) : N
constant len.{l} (A : Type.{l}) (n : N) (v : vec.{l} A n) : N constant len.{l} (A : Type.{l}) (n : N) (v : vec.{l} A n) : N
check f check f
check len.{1} check len.{1}
context section
parameter A : Type parameter A : Type
parameter B : Prop parameter B : Prop
hypothesis H : B hypothesis H : B

View file

@ -1,6 +1,6 @@
prelude definition Prop : Type.{1} := Type.{0} prelude definition Prop : Type.{1} := Type.{0}
constant and : Prop → Prop → Prop constant and : Prop → Prop → Prop
context section
parameter {A : Type} -- Mark A as implicit parameter parameter {A : Type} -- Mark A as implicit parameter
parameter R : A → A → Prop parameter R : A → A → Prop
parameter B : Type parameter B : Type

View file

@ -1,7 +1,7 @@
import logic import logic
context section
variable A : Type variable A : Type
parameter a : A parameter a : A
end end

View file

@ -1,7 +1,7 @@
import logic import logic
context section
universe l universe l
variable A : Type.{l} variable A : Type.{l}
variable a : A variable a : A