chore: fix tests
This commit is contained in:
parent
346c4beb70
commit
3b259afaf0
34 changed files with 67 additions and 69 deletions
|
|
@ -1,5 +1,5 @@
|
|||
constant f : Nat → Nat
|
||||
constant q : Nat → (Nat → Prop) → Nat
|
||||
opaque f : Nat → Nat
|
||||
opaque q : Nat → (Nat → Prop) → Nat
|
||||
|
||||
@[simp]
|
||||
theorem ex {x : Nat} {p : Nat → Prop} (h₁ : p x) (h₂ : q x p = x) : f x = x :=
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ instance NormedField.toRing [instNF : NormedField α] : Ring α := { add := inst
|
|||
|
||||
instance SemiNormedSpace.toModule [NormedField α] [SemiNormedGroup β] [SemiNormedSpace α β] : Module α β := {}
|
||||
|
||||
constant R : Type := Unit
|
||||
constant foo (a b : R) : R := a
|
||||
opaque R : Type := Unit
|
||||
opaque foo (a b : R) : R := a
|
||||
|
||||
instance R.NormedField : NormedField R := { add := foo, add_comm := sorry }
|
||||
instance R.Ring : Ring R := { add := foo }
|
||||
|
|
|
|||
|
|
@ -110,14 +110,14 @@ theorem congrArg {α : Sort u} {β : Sort v} {a₁ a₂ : α} (f : α → β) (h
|
|||
/-
|
||||
Initialize the Quotient Module, which effectively adds the following definitions:
|
||||
|
||||
constant Quot {α : Sort u} (r : α → α → Prop) : Sort u
|
||||
opaque Quot {α : Sort u} (r : α → α → Prop) : Sort u
|
||||
|
||||
constant Quot.mk {α : Sort u} (r : α → α → Prop) (a : α) : Quot r
|
||||
opaque Quot.mk {α : Sort u} (r : α → α → Prop) (a : α) : Quot r
|
||||
|
||||
constant Quot.lift {α : Sort u} {r : α → α → Prop} {β : Sort v} (f : α → β) :
|
||||
opaque Quot.lift {α : Sort u} {r : α → α → Prop} {β : Sort v} (f : α → β) :
|
||||
(∀ a b : α, r a b → Eq (f a) (f b)) → Quot r → β
|
||||
|
||||
constant Quot.ind {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop} :
|
||||
opaque Quot.ind {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop} :
|
||||
(∀ a : α, β (Quot.mk r a)) → ∀ q : Quot r, β q
|
||||
-/
|
||||
init_quot
|
||||
|
|
@ -212,7 +212,7 @@ theorem neTrueOfEqFalse : {b : Bool} → Eq b false → Not (Eq b true)
|
|||
class Inhabited (α : Sort u) :=
|
||||
(default : α)
|
||||
|
||||
constant arbitrary (α : Sort u) [s : Inhabited α] : α :=
|
||||
opaque arbitrary (α : Sort u) [s : Inhabited α] : α :=
|
||||
@Inhabited.default α s
|
||||
|
||||
instance (α : Sort u) {β : Sort v} [Inhabited β] : Inhabited (α → β) :=
|
||||
|
|
@ -316,4 +316,3 @@ instance {α : Type u} [DecidableEq α] : BEq α :=
|
|||
@[macroInline]
|
||||
def dite {α : Sort u} (c : Prop) [h : Decidable c] (t : c → α) (e : Not c → α) : α :=
|
||||
Decidable.casesOn (motive := fun _ => α) h e t
|
||||
|
||||
|
|
|
|||
|
|
@ -92,14 +92,14 @@ theorem congrArg {α : Sort u} {β : Sort v} {a₁ a₂ : α} (f : α → β) (h
|
|||
/-
|
||||
Initialize the Quotient Module, which effectively adds the following definitions:
|
||||
|
||||
constant Quot {α : Sort u} (r : α → α → Prop) : Sort u
|
||||
opaque Quot {α : Sort u} (r : α → α → Prop) : Sort u
|
||||
|
||||
constant Quot.mk {α : Sort u} (r : α → α → Prop) (a : α) : Quot r
|
||||
opaque Quot.mk {α : Sort u} (r : α → α → Prop) (a : α) : Quot r
|
||||
|
||||
constant Quot.lift {α : Sort u} {r : α → α → Prop} {β : Sort v} (f : α → β) :
|
||||
opaque Quot.lift {α : Sort u} {r : α → α → Prop} {β : Sort v} (f : α → β) :
|
||||
(∀ a b : α, r a b → Eq (f a) (f b)) → Quot r → β
|
||||
|
||||
constant Quot.ind {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop} :
|
||||
opaque Quot.ind {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop} :
|
||||
(∀ a : α, β (Quot.mk r a)) → ∀ q : Quot r, β q
|
||||
-/
|
||||
init_quot
|
||||
|
|
@ -183,7 +183,7 @@ theorem neTrueOfEqFalse : {b : Bool} → Eq b false → Not (Eq b true)
|
|||
class Inhabited (α : Sort u) :=
|
||||
(default : α)
|
||||
|
||||
constant arbitrary (α : Sort u) [s : Inhabited α] : α :=
|
||||
opaque arbitrary (α : Sort u) [s : Inhabited α] : α :=
|
||||
@Inhabited.default α s
|
||||
|
||||
instance (α : Sort u) {β : Sort v} [Inhabited β] : Inhabited (α → β) := {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
constant p : Nat → Prop
|
||||
constant q : Nat → Prop
|
||||
opaque p : Nat → Prop
|
||||
opaque q : Nat → Prop
|
||||
|
||||
theorem p_of_q : q x → p x := sorry
|
||||
|
||||
|
|
|
|||
|
|
@ -103,15 +103,15 @@ example : Id Nat := do
|
|||
n
|
||||
|
||||
|
||||
constant foo : Nat
|
||||
opaque foo : Nat
|
||||
|
||||
#check _root_.foo
|
||||
--^ textDocument/hover
|
||||
|
||||
namespace Bar
|
||||
|
||||
constant foo : Nat
|
||||
--^ textDocument/hover
|
||||
opaque foo : Nat
|
||||
--^ textDocument/hover
|
||||
|
||||
#check _root_.foo
|
||||
--^ textDocument/hover
|
||||
|
|
|
|||
|
|
@ -179,8 +179,8 @@ register_option opt : Nat := {
|
|||
}
|
||||
|
||||
|
||||
constant foo (x : Nat) : Nat
|
||||
constant foo' (x : Nat) : Nat :=
|
||||
opaque foo (x : Nat) : Nat
|
||||
opaque foo' (x : Nat) : Nat :=
|
||||
let y := 5
|
||||
3
|
||||
variable (bar)
|
||||
|
|
@ -201,7 +201,7 @@ def externDef (x : Nat) : Nat :=
|
|||
5
|
||||
|
||||
@[extern "test"]
|
||||
constant externConst (x : Nat) : Nat :=
|
||||
opaque externConst (x : Nat) : Nat :=
|
||||
let y := 3
|
||||
5
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
constant a b c : Nat
|
||||
opaque a b c : Nat
|
||||
|
||||
constant a α β : β → Bool
|
||||
opaque a α β : β → Bool
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
def S := List Nat
|
||||
constant TSpec : NonemptyType
|
||||
opaque TSpec : NonemptyType
|
||||
def T (s : S) : Type := TSpec.type
|
||||
instance (s : S) : Nonempty (T s) :=
|
||||
TSpec.property
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
constant foo : {x : Nat} → Type
|
||||
constant bar : {T : Type} → ({x : T} → Type) → Type
|
||||
opaque foo : {x : Nat} → Type
|
||||
opaque bar : {T : Type} → ({x : T} → Type) → Type
|
||||
structure Baz where
|
||||
baz : {x : Nat} → Type
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ section foo
|
|||
|
||||
axiom foo : Type
|
||||
|
||||
constant bla : Nat
|
||||
opaque bla : Nat
|
||||
|
||||
end foo
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ instance NormedField.toRing [instNF : NormedField α] : Ring α := { add := inst
|
|||
-- @[inferTCGoalsRL]
|
||||
instance SemiNormedSpace.toModule [NormedField α] [SemiNormedGroup β] [SemiNormedSpace α β] : Module α β := {}
|
||||
|
||||
constant R : Type := Unit
|
||||
constant foo (a b : R) : R := a
|
||||
opaque R : Type := Unit
|
||||
opaque foo (a b : R) : R := a
|
||||
|
||||
instance R.NormedField : NormedField R := { add := foo, add_comm := sorry }
|
||||
instance R.Ring : Ring R := { add := foo }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ def empty : Fin 0 → Nat := (nomatch ·)
|
|||
theorem append_empty (x : Fin i → Nat) : x ++ empty = x :=
|
||||
funext fun i => dif_pos _
|
||||
|
||||
constant f : (Fin 0 → Nat) → Prop
|
||||
opaque f : (Fin 0 → Nat) → Prop
|
||||
example : f (empty ++ empty) = f empty := by simp only [append_empty] -- should work
|
||||
|
||||
@[congr] theorem Array.get_congr (as bs : Array α) (h : as = bs) (i : Fin as.size) (j : Nat) (hi : i = j) :
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ where
|
|||
| _ => return ()
|
||||
|
||||
@[implementedBy Expr.dagSizeUnsafe]
|
||||
constant Expr.dagSize (e : Expr) : IO Nat
|
||||
opaque Expr.dagSize (e : Expr) : IO Nat
|
||||
|
||||
def getDeclTypeValueDagSize (declName : Name) : CoreM Nat := do
|
||||
let info ← getConstInfo declName
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ def σ := Nat
|
|||
@[reducible]
|
||||
def β := String
|
||||
|
||||
constant foo : ∀ {α}, IO α → IO α
|
||||
constant bar : StateT σ IO β
|
||||
opaque foo : ∀ {α}, IO α → IO α
|
||||
opaque bar : StateT σ IO β
|
||||
|
||||
def mapped_foo : StateT σ IO β := do
|
||||
let s ← get
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ example : n.succ = 1 → n = 0 := by
|
|||
example (h : n.succ = 1) : n = 0 := by
|
||||
injection h; assumption
|
||||
|
||||
constant T : Type
|
||||
constant T.Pred : T → T → Prop
|
||||
opaque T : Type
|
||||
opaque T.Pred : T → T → Prop
|
||||
|
||||
example {ρ} (hρ : ρ.Pred σ) : T.Pred ρ ρ := sorry
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ example (x : Nat × Nat) : (frob x).2 = 42 := rfl
|
|||
|
||||
example (x y : Unit) : x = y := rfl
|
||||
|
||||
constant f : Nat → Unit
|
||||
constant g : Nat → Unit
|
||||
opaque f : Nat → Unit
|
||||
opaque g : Nat → Unit
|
||||
|
||||
example (x y : Nat) : f x = f y := rfl
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
open Function Bool
|
||||
|
||||
|
||||
constant f : Nat → Bool := default
|
||||
constant g : Nat → Nat := default
|
||||
opaque f : Nat → Bool := default
|
||||
opaque g : Nat → Nat := default
|
||||
|
||||
#check f ∘ g ∘ g
|
||||
|
||||
#check (id : Nat → Nat)
|
||||
|
||||
constant h : Nat → Bool → Nat := default
|
||||
opaque h : Nat → Bool → Nat := default
|
||||
|
||||
|
||||
constant f1 : Nat → Nat → Bool := default
|
||||
constant f2 : Bool → Nat := default
|
||||
opaque f1 : Nat → Nat → Bool := default
|
||||
opaque f2 : Bool → Nat := default
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
constant getA (s : String) : Array String := #[]
|
||||
opaque getA (s : String) : Array String := #[]
|
||||
|
||||
private def resolveLValAux (s : String) (i : Nat) : Nat :=
|
||||
let s1 := s
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ inductive Vec.{u} (α : Type u) : Nat → Type u
|
|||
| nil : Vec α 0
|
||||
| cons : α → {n : Nat} → Vec α n → Vec α (Nat.succ n) -- TODO: investigate why +1 doesn't work here
|
||||
|
||||
constant Vars : Type
|
||||
opaque Vars : Type
|
||||
|
||||
structure Lang :=
|
||||
(funcs : Nat → Type)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ inductive Rbnode (α : Type u)
|
|||
namespace Rbnode
|
||||
variable {α : Type u}
|
||||
|
||||
constant insert (lt : α → α → Prop) [DecidableRel lt] (t : Rbnode α) (x : α) : Rbnode α := Rbnode.leaf
|
||||
opaque insert (lt : α → α → Prop) [DecidableRel lt] (t : Rbnode α) (x : α) : Rbnode α := Rbnode.leaf
|
||||
|
||||
inductive WellFormed (lt : α → α → Prop) : Rbnode α → Prop
|
||||
| leafWff : WellFormed lt leaf
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
constant f : Nat → Nat
|
||||
constant g : Nat → Nat
|
||||
opaque f : Nat → Nat
|
||||
opaque g : Nat → Nat
|
||||
|
||||
namespace Foo
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
constant ID : Type
|
||||
opaque ID : Type
|
||||
|
||||
-- A `Reactor` contains "things" identified by an `ID`. It also contains other `Reactor`s, thereby giving us a tree structure of reactors.
|
||||
inductive Reactor
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
constant f (x : Nat) : Nat
|
||||
opaque f (x : Nat) : Nat
|
||||
@[simp] axiom fEq (x : Nat) : f x = x
|
||||
|
||||
theorem ex1 (x : Nat) : f (f x, x).fst = x := by simp
|
||||
|
||||
theorem ex2 (x : Nat) : f ((fun a => f (f a)) x) = x := by simp
|
||||
|
||||
constant g (x : Nat) : Nat
|
||||
opaque g (x : Nat) : Nat
|
||||
@[simp] axiom gEq (x : Nat) : g x = match x with | 0 => 1 | x+1 => 2
|
||||
@[simp] theorem add1 (x : Nat) : x + 1 = x.succ := rfl
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
constant f : Nat → Nat
|
||||
constant q : Nat → Prop
|
||||
constant r : Nat → Prop
|
||||
opaque f : Nat → Nat
|
||||
opaque q : Nat → Prop
|
||||
opaque r : Nat → Prop
|
||||
|
||||
@[simp] axiom ax1 (p : Prop) : (p ∧ True) ↔ p
|
||||
@[simp] axiom ax2 (x : Nat) : q (f x)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
constant g (x y : Nat) : Nat
|
||||
constant f (x y : Nat) : Nat
|
||||
opaque g (x y : Nat) : Nat
|
||||
opaque f (x y : Nat) : Nat
|
||||
axiom f_def (x y : Nat) : f x y = g x y
|
||||
axiom f_ax (x : Nat) : f x x = x
|
||||
|
||||
theorem ex1 (x : Nat) : g x x = x := by
|
||||
simp [← f_def, f_ax]
|
||||
|
||||
constant p (x y : Nat) : Prop
|
||||
constant q (x y : Nat) : Prop
|
||||
opaque p (x y : Nat) : Prop
|
||||
opaque q (x y : Nat) : Prop
|
||||
axiom p_def (x y : Nat) : p x y ↔ q x y
|
||||
axiom p_ax (x : Nat) : p x x
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
constant n : Nat
|
||||
opaque n : Nat
|
||||
@[simp] axiom prio_1000 : n = 1000
|
||||
@[simp 10] axiom prio_10 : n = 10
|
||||
-- simp should prefer the prio_1000 lemma with the higher priority
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
constant f (x y : Nat) : Nat
|
||||
constant g (x : Nat) : Nat
|
||||
opaque f (x y : Nat) : Nat
|
||||
opaque g (x : Nat) : Nat
|
||||
|
||||
theorem ex1 (x : Nat) (h₁ : f x x = g x) (h₂ : g x = x) : f x (f x x) = x := by
|
||||
simp
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
def Ctx := String → Type
|
||||
abbrev State (Γ : Ctx) := {x : String} → Γ x
|
||||
|
||||
constant p {Γ : Ctx} (s : State Γ) : Prop
|
||||
opaque p {Γ : Ctx} (s : State Γ) : Prop
|
||||
|
||||
theorem ex {Γ : Ctx} (s : State Γ) (h : (a : State Γ) → @p Γ a) : @p Γ s :=
|
||||
h ‹_›
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ partial theorem unsound2 : False := -- Error
|
|||
unsafe theorem unsound3 : False := -- Error
|
||||
unsound3
|
||||
|
||||
constant unsound4 : False -- Error
|
||||
opaque unsound4 : False -- Error
|
||||
|
||||
axiom magic : False -- OK
|
||||
namespace Foo
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
constant f : Nat → Nat
|
||||
opaque f : Nat → Nat
|
||||
@[simp] axiom fEq (x : Nat) (h : x ≠ 0) : f x = x
|
||||
|
||||
example (x : Nat) (h : x ≠ 0) : f x = x + 0 := by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
constant f : Nat → Nat
|
||||
opaque f : Nat → Nat
|
||||
axiom f_eq (x : Nat) : f (f x) = x
|
||||
|
||||
theorem ex1 (x : Nat) (h : f (f x) = x) : (let y := x*x; if f (f x) = x then 1 else y + 1) = 1 := by
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ elab "whnf%" t:term : term <= expectedType => do
|
|||
trace[Meta.debug] "r: {r}"
|
||||
return r
|
||||
|
||||
constant x : Option Nat := some 42
|
||||
opaque x : Option Nat := some 42
|
||||
|
||||
set_option trace.Meta.debug true
|
||||
#eval whnf% x.getD 0
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
structure AddrSpace where
|
||||
index : UInt32
|
||||
|
||||
@[extern "foo"]
|
||||
constant foo (addrSpace : AddrSpace) : IO PUnit
|
||||
opaque foo (addrSpace : AddrSpace) : IO PUnit
|
||||
|
||||
set_option trace.compiler.ir.result true in
|
||||
-- should accept and pass an unboxed `uint32`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue