diff --git a/extras/latex/lstlean.md b/extras/latex/lstlean.md deleted file mode 100644 index 0df6203deb..0000000000 --- a/extras/latex/lstlean.md +++ /dev/null @@ -1,47 +0,0 @@ -lstlean.tex -=========== - -The file `lstlean.tex` contains /Lean/ style definitions for the -`listings` package, which can be used to typeset Lean code in a -Latex document. For more information, see the documentation for the -`listings` package and the sample document `sample.tex`. - -You need the following packages installed: - -- `listings` -- `inputenc` -- `color` - -Because `listings` does not work well with unicode, the style -replaces all unicode characters with Latex equivalents. Some of the -replacment symbols require the `amssymb` package. - -To use the style, all you need to do is include `lstlean.tex` in -the same directory as your Latex source, and include the following -preamble in your document: -``` -\documentclass{article} - -\usepackage[utf8x]{inputenc} -\usepackage{amssymb} - -\usepackage{color} -\definecolor{keywordcolor}{rgb}{0.7, 0.1, 0.1} % red -\definecolor{commentcolor}{rgb}{0.4, 0.4, 0.4} % grey -\definecolor{symbolcolor}{rgb}{0.0, 0.1, 0.6} % blue -\definecolor{sortcolor}{rgb}{0.1, 0.5, 0.1} % green - -\usepackage{listings} -\def\lstlanguagefiles{lstlean.tex} -\lstset{language=lean} -``` - -The `inputenc` package is needed to handle unicode input. Of -course, you can set the colors any way you want. In your document, -you can then in-line code with the `\lstinline{...}`, and add a code -block with the `\begin{lstlisting} ... \end{lstlisting}` -environment. - -Note that if you use a unicode symbol that is not currently handled in -`lstlean.tex`, you can simply add it to the list there, together -with the Latex equivalent you would like to use. diff --git a/extras/latex/lstlean.tex b/extras/latex/lstlean.tex deleted file mode 100644 index 39abddb475..0000000000 --- a/extras/latex/lstlean.tex +++ /dev/null @@ -1,276 +0,0 @@ -% Listing style definition for the Lean Theorem Prover. -% Defined by Jeremy Avigad, 2015, by modifying Assia Mahboubi's SSR style. -% Unicode replacements taken from Olivier Verdier's unixode.sty - -\lstdefinelanguage{lean} { - -% Anything betweeen $ becomes LaTeX math mode -mathescape=true, -% Comments may or not include Latex commands -texcl=false, - -% keywords, list taken from lean-syntax.el -morekeywords=[1]{ -import, prelude, protected, private, noncomputable, definition, meta, renaming, -hiding, exposing, parameter, parameters, begin, conjecture, constant, constants, -hypothesis, lemma, corollary, variable, variables, premise, premises, theory, -print, theorem, proposition, example, abstract, -open, as, export, override, axiom, axioms, inductive, with, without, -structure, record, universe, universes, -alias, help, precedence, reserve, declare_trace, add_key_equivalence, -match, infix, infixl, infixr, notation, postfix, prefix, instance, -eval, vm_eval, check, coercion, end, this, suppose, -using, using_well_founded, namespace, section, fields, -attribute, local, set_option, extends, include, omit, classes, class, -instances, coercions, attributes, raw, replacing, -calc, have, show, suffices, by, in, at, let, forall, Pi, fun, -exists, if, dif, then, else, assume, take, obtain, from, aliases, register_simp_ext, -mutual, def, run_command -}, - -% Sorts -morekeywords=[2]{Type, Prop, Type*, Type₀, Type₁, Type₂, Type₃}, - -% tactics, list taken from lean-syntax.el -% morekeywords=[3]{ -% Cond, or_else, then, try, when, assumption, eassumption, rapply, -% apply, fapply, eapply, rename, intro, intros, all_goals, fold, focus, focus_at, -% generalize, generalizes, clear, clears, revert, reverts, back, beta, done, exact, rexact, -% refine, repeat, whnf, rotate, rotate_left, rotate_right, inversion, cases, rewrite, -% xrewrite, krewrite, blast, simp, esimp, unfold, change, check_expr, contradiction, -% exfalso, split, existsi, constructor, fconstructor, left, right, injection, congruence, reflexivity, -% symmetry, transitivity, state, induction, induction_using, fail, append, -% substvars, now, with_options, with_attributes, with_attrs, note -% }, - -% modifiers, taken from lean-syntax.el -% note: 'otherkeywords' is needed because these use a different symbol. -% this command doesn't allow us to specify a number -- they are put with [1] -% otherkeywords={ -% [persistent], [notation], [visible], [instance], [trans_instance], -% [class], [parsing-only], [coercion], [unfold_full], [constructor], -% [reducible], [irreducible], [semireducible], [quasireducible], [wf], -% [whnf], [multiple_instances], [none], [decl], [declaration], -% [relation], [symm], [subst], [refl], [trans], [simp], [congr], [unify], -% [backward], [forward], [no_pattern], [begin_end], [tactic], [abbreviation], -% [reducible], [unfold], [alias], [eqv], [intro], [intro!], [elim], [grinder], -% [localrefinfo], [recursor] -% }, - -% Various symbols -literate= -{α}{{\ensuremath{\mathrm{\alpha}}}}1 -{β}{{\ensuremath{\mathrm{\beta}}}}1 -{γ}{{\ensuremath{\mathrm{\gamma}}}}1 -{δ}{{\ensuremath{\mathrm{\delta}}}}1 -{ε}{{\ensuremath{\mathrm{\varepsilon}}}}1 -{ζ}{{\ensuremath{\mathrm{\zeta}}}}1 -{η}{{\ensuremath{\mathrm{\eta}}}}1 -{θ}{{\ensuremath{\mathrm{\theta}}}}1 -{ι}{{\ensuremath{\mathrm{\iota}}}}1 -{κ}{{\ensuremath{\mathrm{\kappa}}}}1 -{μ}{{\ensuremath{\mathrm{\mu}}}}1 -{ν}{{\ensuremath{\mathrm{\nu}}}}1 -{ξ}{{\ensuremath{\mathrm{\xi}}}}1 -{π}{{\ensuremath{\mathrm{\mathnormal{\pi}}}}}1 -{ρ}{{\ensuremath{\mathrm{\rho}}}}1 -{σ}{{\ensuremath{\mathrm{\sigma}}}}1 -{τ}{{\ensuremath{\mathrm{\tau}}}}1 -{φ}{{\ensuremath{\mathrm{\varphi}}}}1 -{χ}{{\ensuremath{\mathrm{\chi}}}}1 -{ψ}{{\ensuremath{\mathrm{\psi}}}}1 -{ω}{{\ensuremath{\mathrm{\omega}}}}1 - -{Γ}{{\ensuremath{\mathrm{\Gamma}}}}1 -{Δ}{{\ensuremath{\mathrm{\Delta}}}}1 -{Θ}{{\ensuremath{\mathrm{\Theta}}}}1 -{Λ}{{\ensuremath{\mathrm{\Lambda}}}}1 -{Σ}{{\ensuremath{\mathrm{\Sigma}}}}1 -{Φ}{{\ensuremath{\mathrm{\Phi}}}}1 -{Ξ}{{\ensuremath{\mathrm{\Xi}}}}1 -{Ψ}{{\ensuremath{\mathrm{\Psi}}}}1 -{Ω}{{\ensuremath{\mathrm{\Omega}}}}1 - -{ℵ}{{\ensuremath{\aleph}}}1 - -{≤}{{\ensuremath{\leq}}}1 -{≥}{{\ensuremath{\geq}}}1 -{≠}{{\ensuremath{\neq}}}1 -{≈}{{\ensuremath{\approx}}}1 -{≡}{{\ensuremath{\equiv}}}1 -{≃}{{\ensuremath{\simeq}}}1 - -{≤}{{\ensuremath{\leq}}}1 -{≥}{{\ensuremath{\geq}}}1 - -{∂}{{\ensuremath{\partial}}}1 -{∆}{{\ensuremath{\triangle}}}1 % or \laplace? - -{∫}{{\ensuremath{\int}}}1 -{∑}{{\ensuremath{\mathrm{\Sigma}}}}1 -{Π}{{\ensuremath{\mathrm{\Pi}}}}1 - -{⊥}{{\ensuremath{\perp}}}1 -{∞}{{\ensuremath{\infty}}}1 -{∂}{{\ensuremath{\partial}}}1 - -{∓}{{\ensuremath{\mp}}}1 -{±}{{\ensuremath{\pm}}}1 -{×}{{\ensuremath{\times}}}1 - -{⊕}{{\ensuremath{\oplus}}}1 -{⊗}{{\ensuremath{\otimes}}}1 -{⊞}{{\ensuremath{\boxplus}}}1 - -{∇}{{\ensuremath{\nabla}}}1 -{√}{{\ensuremath{\sqrt}}}1 - -{⬝}{{\ensuremath{\cdot}}}1 -{•}{{\ensuremath{\cdot}}}1 -{∘}{{\ensuremath{\circ}}}1 - -%{⁻}{{\ensuremath{^{\textup{\kern1pt\rule{2pt}{0.3pt}\kern-1pt}}}}}1 -{⁻}{{\ensuremath{^{-}}}}1 -{▸}{{\ensuremath{\blacktriangleright}}}1 - -{∧}{{\ensuremath{\wedge}}}1 -{∨}{{\ensuremath{\vee}}}1 -{¬}{{\ensuremath{\neg}}}1 -{⊢}{{\ensuremath{\vdash}}}1 - -%{⟨}{{\ensuremath{\left\langle}}}1 -%{⟩}{{\ensuremath{\right\rangle}}}1 -{⟨}{{\ensuremath{\langle}}}1 -{⟩}{{\ensuremath{\rangle}}}1 - -{↦}{{\ensuremath{\mapsto}}}1 -{→}{{\ensuremath{\rightarrow}}}1 -{↔}{{\ensuremath{\leftrightarrow}}}1 -{⇒}{{\ensuremath{\Rightarrow}}}1 -{⟹}{{\ensuremath{\Longrightarrow}}}1 -{⇐}{{\ensuremath{\Leftarrow}}}1 -{⟸}{{\ensuremath{\Longleftarrow}}}1 - -{∩}{{\ensuremath{\cap}}}1 -{∪}{{\ensuremath{\cup}}}1 -{⊂}{{\ensuremath{\subseteq}}}1 -{⊆}{{\ensuremath{\subseteq}}}1 -{⊄}{{\ensuremath{\nsubseteq}}}1 -{⊈}{{\ensuremath{\nsubseteq}}}1 -{⊃}{{\ensuremath{\supseteq}}}1 -{⊇}{{\ensuremath{\supseteq}}}1 -{⊅}{{\ensuremath{\nsupseteq}}}1 -{⊉}{{\ensuremath{\nsupseteq}}}1 -{∈}{{\ensuremath{\in}}}1 -{∉}{{\ensuremath{\notin}}}1 -{∋}{{\ensuremath{\ni}}}1 -{∌}{{\ensuremath{\notni}}}1 -{∅}{{\ensuremath{\emptyset}}}1 - -{∖}{{\ensuremath{\setminus}}}1 -{†}{{\ensuremath{\dag}}}1 - -{ℕ}{{\ensuremath{\mathbb{N}}}}1 -{ℤ}{{\ensuremath{\mathbb{Z}}}}1 -{ℝ}{{\ensuremath{\mathbb{R}}}}1 -{ℚ}{{\ensuremath{\mathbb{Q}}}}1 -{ℂ}{{\ensuremath{\mathbb{C}}}}1 -{⌞}{{\ensuremath{\llcorner}}}1 -{⌟}{{\ensuremath{\lrcorner}}}1 -{⦃}{{\ensuremath{\{\!|}}}1 -{⦄}{{\ensuremath{|\!\}}}}1 - -{₁}{{\ensuremath{_1}}}1 -{₂}{{\ensuremath{_2}}}1 -{₃}{{\ensuremath{_3}}}1 -{₄}{{\ensuremath{_4}}}1 -{₅}{{\ensuremath{_5}}}1 -{₆}{{\ensuremath{_6}}}1 -{₇}{{\ensuremath{_7}}}1 -{₈}{{\ensuremath{_8}}}1 -{₉}{{\ensuremath{_9}}}1 -{₀}{{\ensuremath{_0}}}1 - -{¹}{{\ensuremath{^1}}}1 - -{ₙ}{{\ensuremath{_n}}}1 -{ₘ}{{\ensuremath{_m}}}1 -{↑}{{\ensuremath{\uparrow}}}1 -{↓}{{\ensuremath{\downarrow}}}1 - -{▸}{{\ensuremath{\triangleright}}}1 - -{Σ}{{\color{symbolcolor}\ensuremath{\Sigma}}}1 -{Π}{{\color{symbolcolor}\ensuremath{\Pi}}}1 -{∀}{{\color{symbolcolor}\ensuremath{\forall}}}1 -{∃}{{\color{symbolcolor}\ensuremath{\exists}}}1 -{λ}{{\color{symbolcolor}\ensuremath{\mathrm{\lambda}}}}1 - -{:=}{{\color{symbolcolor}:=}}1 -{=}{{\color{symbolcolor}=}}1 -{<}{{\color{symbolcolor}<}}1 -{+}{{\color{symbolcolor}+}}1 -{*}{{\color{symbolcolor}*}}1, - -% Comments -%comment=[s][\itshape \color{commentcolor}]{/-}{-/}, -morecomment=[s][\color{commentcolor}]{/-}{-/}, -morecomment=[l][\itshape \color{commentcolor}]{--}, - -% Spaces are not displayed as a special character -showstringspaces=false, - -% keep spaces -keepspaces=true, - -% String delimiters -morestring=[b]", -morestring=[d]’, - -% Size of tabulations -tabsize=3, - -% Enables ASCII chars 128 to 255 -extendedchars=false, - -% Case sensitivity -sensitive=true, - -% Automatic breaking of long lines -breaklines=true, - -% Default style fors listingsred -basicstyle=\ttfamily, - -% Position of captions is bottom -captionpos=b, - -% Full flexible columns -columns=[l]fullflexible, - - -% Style for (listings') identifiers -identifierstyle={\ttfamily\color{black}}, -% Note : highlighting of Coq identifiers is done through a new -% delimiter definition through an lstset at the begining of the -% document. Don't know how to do better. - -% Style for declaration keywords -keywordstyle=[1]{\ttfamily\color{keywordcolor}}, - -% Style for sorts -keywordstyle=[2]{\ttfamily\color{sortcolor}}, - -% Style for tactics keywords -% keywordstyle=[3]{\ttfamily\color{tacticcolor}}, - -% Style for attributes -% keywordstyle=[4]{\ttfamily\color{attributecolor}}, - -% Style for strings -stringstyle=\ttfamily, - -% Style for comments -% commentstyle={\ttfamily\footnotesize }, - -} diff --git a/extras/latex/sample.tex b/extras/latex/sample.tex deleted file mode 100644 index 7a578fcb29..0000000000 --- a/extras/latex/sample.tex +++ /dev/null @@ -1,71 +0,0 @@ -\documentclass{article} - -\usepackage[utf8x]{inputenc} -\usepackage{amssymb} - -\usepackage{color} -\definecolor{keywordcolor}{rgb}{0.7, 0.1, 0.1} % red -\definecolor{commentcolor}{rgb}{0.4, 0.4, 0.4} % grey -\definecolor{symbolcolor}{rgb}{0.0, 0.1, 0.6} % blue -\definecolor{sortcolor}{rgb}{0.1, 0.5, 0.1} % green - -\usepackage{listings} -\def\lstlanguagefiles{lstlean.tex} -\lstset{language=lean} - -\title{The Lean listing style} -\author{Jeremy Avigad} - -\begin{document} - -\maketitle - -This is an example of how to use \verb=lstlean.tex= to typeset your Lean code. Here is some code: \lstinline{theorem foo (x y : ℕ), x + y = y + x}. Here are the translations of some unicode symbols: -\begin{lstlisting} -Some symbols: ℕ ℤ ∩ ⊂ ∀ ∃ Π α β γ ∈ ⦃ ⦄ -\end{lstlisting} -Here is a block of code: -\begin{lstlisting} -/- -Basic properties of lists. --/ - -inductive list (α : Type) : Type -| nil {} : list -| cons : α → list → list - -namespace list - -notation h :: t := cons h t -notation `[` l:(foldr `,` (h t, cons h t) nil `]`) := l - -variable {α : Type} - -/- append -/ - -def append : list α → list α → list α -| [] l := l -| (h :: s) t := h :: (append s t) - -notation l₁ ++ l₂ := append l₁ l₂ - -theorem nil_append (t : list α) : [] ++ t = t := rfl - -theorem append_cons (x : α) (s t : list α) : (x::s) ++ t = x::(s ++ t) := rfl - -theorem append_nil : ∀ (t : list α), t ++ [] = t -| [] := rfl -| (a :: l) := calc - (a :: l) ++ [] = a :: (l ++ []) : rfl - ... = a :: l : by rw append_nil l - -theorem append.assoc : ∀ (s t u : list α), s ++ t ++ u = s ++ (t ++ u) -| [] t u := rfl -| (a :: l) t u := - show a :: (l ++ t ++ u) = (a :: l) ++ (t ++ u), - begin rw (append.assoc l t u), reflexivity end - -end list -\end{lstlisting} - -\end{document} diff --git a/leanpkg/.gitignore b/leanpkg/.gitignore deleted file mode 100644 index b62f4dcf77..0000000000 --- a/leanpkg/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/leanpkg/config_vars.lean diff --git a/old_tests/tests/.gitignore b/old_tests/tests/.gitignore deleted file mode 100644 index 0003b3abe9..0000000000 --- a/old_tests/tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.produced.out -*.test_suite.out -*.status diff --git a/old_tests/tests/lean/.gitignore b/old_tests/tests/lean/.gitignore deleted file mode 100644 index d50efe2e3f..0000000000 --- a/old_tests/tests/lean/.gitignore +++ /dev/null @@ -1 +0,0 @@ -io_fs.txt diff --git a/old_tests/tests/lean/1162.lean b/old_tests/tests/lean/1162.lean deleted file mode 100644 index cbd89fe63a..0000000000 --- a/old_tests/tests/lean/1162.lean +++ /dev/null @@ -1,13 +0,0 @@ -inductive weekday : Type -| sunday : weekday -| monday : weekday -| tuesday : weekday -| wednesday : weekday - -def ppday (d : weekday) : nat := -match d with -| sunday := 0 -| monday := 1 -| tuesday := 2 -| wednesday := 3 -end diff --git a/old_tests/tests/lean/1162.lean.expected.out b/old_tests/tests/lean/1162.lean.expected.out deleted file mode 100644 index ca190c0186..0000000000 --- a/old_tests/tests/lean/1162.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -1162.lean:10:12: error: equation compiler error, equation #2 has not been used in the compilation, note that the left-hand-side of equation #1 is a variable -1162.lean:11:12: error: equation compiler error, equation #3 has not been used in the compilation, note that the left-hand-side of equation #1 is a variable -1162.lean:12:12: error: equation compiler error, equation #4 has not been used in the compilation, note that the left-hand-side of equation #1 is a variable diff --git a/old_tests/tests/lean/1207.lean b/old_tests/tests/lean/1207.lean deleted file mode 100644 index 01957fa371..0000000000 --- a/old_tests/tests/lean/1207.lean +++ /dev/null @@ -1,30 +0,0 @@ -example : true := -begin - have H : true := (by trivial), - exact H -end - -example : true := -begin - have H : true := (by tactic.triv), - exact H -end - -meta example (h : tactic unit) : true := -begin - h, -- ERROR h should not be visible here - trivial -end - -example : false := -begin - have H : true := (by foo), -- ERROR - exact sorry -end - -constant P : Prop -example (p : P) : true := -begin - have H : P := by do { p ← tactic.get_local `p, tactic.exact p }, - trivial -end diff --git a/old_tests/tests/lean/1207.lean.expected.out b/old_tests/tests/lean/1207.lean.expected.out deleted file mode 100644 index b35a43e798..0000000000 --- a/old_tests/tests/lean/1207.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -1207.lean:15:2: error: unknown identifier 'h' -1207.lean:15:2: error: don't know how to synthesize placeholder -context: -h : tactic unit, -_example : true -⊢ Type ? -1207.lean:21:23: error: unknown identifier 'foo' -1207.lean:21:23: error: don't know how to synthesize placeholder -context: -⊢ Type ? -state: -⊢ false diff --git a/old_tests/tests/lean/1258.lean b/old_tests/tests/lean/1258.lean deleted file mode 100644 index 6e785b9eaa..0000000000 --- a/old_tests/tests/lean/1258.lean +++ /dev/null @@ -1,4 +0,0 @@ -constant P : list ℕ → list ℕ → Prop -lemma foo (xs : list ℕ) : Π (ns : list ℕ), P xs ns -| [] := sorry -| (n::ns) := begin cases xs, exact sorry, exact sorry end diff --git a/old_tests/tests/lean/1258.lean.expected.out b/old_tests/tests/lean/1258.lean.expected.out deleted file mode 100644 index d759e73b42..0000000000 --- a/old_tests/tests/lean/1258.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -1258.lean:4:19: error: failed to revert 'xs', 'foo' depends on it, and 'foo' is an auxiliary declaration introduced by the equation compiler (possible solution: use tactic 'clear' to remove 'foo' from the local context) -state: -xs : list ℕ, -foo : ∀ (ns : list ℕ), P xs ns, -n : ℕ, -ns : list ℕ -⊢ P xs (n :: ns) diff --git a/old_tests/tests/lean/1277.lean b/old_tests/tests/lean/1277.lean deleted file mode 100644 index cb4050ed89..0000000000 --- a/old_tests/tests/lean/1277.lean +++ /dev/null @@ -1,9 +0,0 @@ -variables {α₁ : Type} {α₂ : α₁ → Type} {β₁ : Type} {β₂ : β₁ → Type} - -def map (f₁ : α₁ → β₁) (f₂ : Π⦃a⦄, α₂ a → β₂ (f₁ a)) : (Σa, α₂ a) → (Σb, β₂ b) -| ⟨a₁, a₂⟩ := ⟨f₁ a₁, f₂ a₂⟩ - -example (f₁ : α₁ → α₁) (f₂ : Π⦃a⦄, α₂ a → α₂ (f₁ a)) (eq₁ : f₁ = id) : map f₁ f₂ = id := -begin - rw [eq₁], -end diff --git a/old_tests/tests/lean/1277.lean.expected.out b/old_tests/tests/lean/1277.lean.expected.out deleted file mode 100644 index f3a2730945..0000000000 --- a/old_tests/tests/lean/1277.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -1277.lean:8:2: error: rewrite tactic failed, motive is not type correct -nested exception message: -check failed, application type mismatch (use 'set_option trace.check true' for additional details) -state: -α₁ : Type, -α₂ : α₁ → Type, -f₁ : α₁ → α₁, -f₂ : Π ⦃a : α₁⦄, α₂ a → α₂ (f₁ a), -eq₁ : f₁ = id -⊢ map f₁ f₂ = id diff --git a/old_tests/tests/lean/1279.lean b/old_tests/tests/lean/1279.lean deleted file mode 100644 index fe3930e4f5..0000000000 --- a/old_tests/tests/lean/1279.lean +++ /dev/null @@ -1,12 +0,0 @@ -structure Category : Type 2 := - (Obj : Type) - (Hom : Obj → Obj → Type) - (compose : Π ⦃A B C : Obj⦄, Hom A B → Hom B C → Hom A C) - -open Category - -structure Functor (source target : Category) : Type := - (onObjects : Obj source → Obj target) - (onMorphisms : Π ⦃A B : Obj source⦄, Hom source A B → Hom target (onObjects A) (onObjects B)) - (functoriality : Π ⦃A B C : Obj source⦄ (f : Hom source A B) (g : Hom source B C), - onMorphisms (compose source g f) = compose target (onMorphisms g) (onMorphisms f)) diff --git a/old_tests/tests/lean/1279.lean.expected.out b/old_tests/tests/lean/1279.lean.expected.out deleted file mode 100644 index 96706aa67a..0000000000 --- a/old_tests/tests/lean/1279.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -1279.lean:12:33: error: type mismatch at application - source.compose g f -term - f -has type - source.Hom A B -but is expected to have type - source.Hom C ?m_1 diff --git a/old_tests/tests/lean/1290.lean b/old_tests/tests/lean/1290.lean deleted file mode 100644 index 325c8deea6..0000000000 --- a/old_tests/tests/lean/1290.lean +++ /dev/null @@ -1,12 +0,0 @@ -structure Category := - (Obj : Type) - (Hom : Obj -> Obj -> Type) - -structure Isomorphism ( C: Category ) { A B : C^.Obj } := - (morphism : C^.Hom A B) - -instance Isomorphism_coercion_to_morphism { C : Category } { A B C^.Obj } : has_coe (Isomorphism C A B) (C^.Hom A B) := - (coe: Isomorphism.morphism) - -instance Isomorphism_coercion_to_morphism_fixed { C : Category } { A B : C^.Obj } : has_coe (Isomorphism C) (C^.Hom A B) := -{coe := Isomorphism.morphism} diff --git a/old_tests/tests/lean/1290.lean.expected.out b/old_tests/tests/lean/1290.lean.expected.out deleted file mode 100644 index 924e2737d4..0000000000 --- a/old_tests/tests/lean/1290.lean.expected.out +++ /dev/null @@ -1,31 +0,0 @@ -1290.lean:8:66: error: invalid declaration, '}' expected -1290.lean:8:61: error: don't know how to synthesize placeholder -context: -C : Category -⊢ Sort ? -1290.lean:8:63: error: don't know how to synthesize placeholder -context: -C : Category, -A : ⁇ -⊢ Sort ? -1290.lean:8:65: error: don't know how to synthesize placeholder -context: -C : Category, -A : ⁇, -B : ⁇ -⊢ Sort ? -1290.lean:8:9: error: don't know how to synthesize placeholder -context: -C : Category, -A : ⁇, -B : ⁇, -C : ⁇ -⊢ Sort ? -1290.lean:8:9: error: don't know how to synthesize placeholder -context: -C : Category, -A : ⁇, -B : ⁇, -C : ⁇ -⊢ Sort ? -1290.lean:8:66: error: command expected diff --git a/old_tests/tests/lean/1292.lean b/old_tests/tests/lean/1292.lean deleted file mode 100644 index 7ef0bf342c..0000000000 --- a/old_tests/tests/lean/1292.lean +++ /dev/null @@ -1,8 +0,0 @@ -def fn (n : nat) : nat := -match n with - -#exit - -theorem thm : true := begin end - -example : has_add nat := sorry diff --git a/old_tests/tests/lean/1292.lean.expected.out b/old_tests/tests/lean/1292.lean.expected.out deleted file mode 100644 index 289b5a044a..0000000000 --- a/old_tests/tests/lean/1292.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -1292.lean:4:0: error: invalid expression, unexpected token -1292.lean:2:0: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) -1292.lean:4:0: warning: using 'exit' to interrupt Lean diff --git a/old_tests/tests/lean/1293.lean b/old_tests/tests/lean/1293.lean deleted file mode 100644 index d0bb50baa8..0000000000 --- a/old_tests/tests/lean/1293.lean +++ /dev/null @@ -1,15 +0,0 @@ -open expr tactic - -example : true := by whnf (var 0) >> return () - -example : true := by whnf (app (var 0) (var 0)) >> return () - -example : true := by head_zeta (var 0) >> return () - -example : true := by unify (var 0) (var 0) >> return () - -example : true := by is_def_eq (var 0) (var 0) >> return () - -example (foo trivial) := by do -t ← infer_type (var 0), -to_expr ``(trivial) >>= apply diff --git a/old_tests/tests/lean/1293.lean.expected.out b/old_tests/tests/lean/1293.lean.expected.out deleted file mode 100644 index c053675933..0000000000 --- a/old_tests/tests/lean/1293.lean.expected.out +++ /dev/null @@ -1,32 +0,0 @@ -1293.lean:3:21: error: tactic 'whnf' failed, given expression should not contain de-Bruijn variables, they should be replaced with local constants before using this tactic -state: -⊢ true -1293.lean:5:21: error: tactic 'whnf' failed, given expression should not contain de-Bruijn variables, they should be replaced with local constants before using this tactic -state: -⊢ true -1293.lean:7:21: error: tactic 'head_zeta' failed, given expression should not contain de-Bruijn variables, they should be replaced with local constants before using this tactic -state: -⊢ true -1293.lean:9:21: error: tactic 'unify' failed, given expression should not contain de-Bruijn variables, they should be replaced with local constants before using this tactic -state: -⊢ true -1293.lean:11:21: error: tactic 'is_def_eq' failed, given expression should not contain de-Bruijn variables, they should be replaced with local constants before using this tactic -state: -⊢ true -1293.lean:13:28: error: tactic 'infer_type' failed, given expression should not contain de-Bruijn variables, they should be replaced with local constants before using this tactic -state: -foo : ?m_1, -trivial : ?m_2 -⊢ ?m_3 -1293.lean:13:9: error: don't know how to synthesize placeholder -context: -⊢ Sort ? -1293.lean:13:13: error: don't know how to synthesize placeholder -context: -foo : ⁇ -⊢ Sort ? -1293.lean:13:8: error: don't know how to synthesize placeholder -context: -foo : ⁇, -trivial : ⁇ -⊢ Sort ? diff --git a/old_tests/tests/lean/1299.lean b/old_tests/tests/lean/1299.lean deleted file mode 100644 index 65b10447b4..0000000000 --- a/old_tests/tests/lean/1299.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic expr - -def d1 : true = true := by do -trace (("a", "a")), -prt ← to_expr ``(true = true), -add_decl (declaration.ax `new_ax [] prt), -l ← to_expr ```(new_ax), -apply l - -#check d1 -#print d1 - -theorem d2 : true = true := by do -trace (("a", "a")), -prt ← to_expr ``(true = true), -add_decl (declaration.ax `new_ax2 [] prt), -l ← to_expr ```(new_ax2), -apply l - -#print d2 diff --git a/old_tests/tests/lean/1299.lean.expected.out b/old_tests/tests/lean/1299.lean.expected.out deleted file mode 100644 index 6ef86bd2ef..0000000000 --- a/old_tests/tests/lean/1299.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -(a, a) -d1 : true = true -def d1 : true = true := -new_ax -(a, a) -1299.lean:13:8: error: invalid theorem 'd2', theorems should not depend on axioms introduced using tactics (solution: mark theorem as a definition) -theorem d2 : true = true := -⁇ diff --git a/old_tests/tests/lean/1327.lean b/old_tests/tests/lean/1327.lean deleted file mode 100644 index b1f546483d..0000000000 --- a/old_tests/tests/lean/1327.lean +++ /dev/null @@ -1,4 +0,0 @@ -example (n) : nat.pred n = n := -begin - dsimp {fail_if_unchanged := ff} -end diff --git a/old_tests/tests/lean/1327.lean.expected.out b/old_tests/tests/lean/1327.lean.expected.out deleted file mode 100644 index 75d6171788..0000000000 --- a/old_tests/tests/lean/1327.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -1327.lean:4:0: error: tactic failed, there are unsolved goals -state: -n : ℕ -⊢ nat.pred n = n diff --git a/old_tests/tests/lean/1334a.lean b/old_tests/tests/lean/1334a.lean deleted file mode 100644 index 847680c9f8..0000000000 --- a/old_tests/tests/lean/1334a.lean +++ /dev/null @@ -1,12 +0,0 @@ -inductive nlist : Type -| atom : nlist -| mk : list nlist → nlist - -open nlist list - -def fn : nlist → nlist -| (mk l) := mk [] -| _ := atom - -#check fn.equations._eqn_1 -#check fn.equations._eqn_2 diff --git a/old_tests/tests/lean/1334a.lean.expected.out b/old_tests/tests/lean/1334a.lean.expected.out deleted file mode 100644 index 577fe6211a..0000000000 --- a/old_tests/tests/lean/1334a.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -fn.equations._eqn_1 : fn atom = atom -fn.equations._eqn_2 : ∀ (l : list nlist), fn (mk l) = mk nil diff --git a/old_tests/tests/lean/1334b.lean b/old_tests/tests/lean/1334b.lean deleted file mode 100644 index fcb4e9d069..0000000000 --- a/old_tests/tests/lean/1334b.lean +++ /dev/null @@ -1,26 +0,0 @@ -inductive term : Type -| var : nat → term -| app : list term → term -| cnst : string → term - -def var_of : term → option nat -| (term.var n) := some n -| _ := none - -#check var_of.equations._eqn_1 -#check var_of.equations._eqn_2 -#check var_of.equations._eqn_3 - -def list_of : term → list term -| (term.app ts) := ts -| _ := [] - -#check list_of.equations._eqn_1 -#check list_of.equations._eqn_2 -#check list_of.equations._eqn_3 - -example (a : nat) (ls : list term) : term.var a = term.app ls → false := -by contradiction - -example (a : nat) (s : string) : ¬ term.var a = term.cnst s := -by contradiction diff --git a/old_tests/tests/lean/1334b.lean.expected.out b/old_tests/tests/lean/1334b.lean.expected.out deleted file mode 100644 index 452fff3ee3..0000000000 --- a/old_tests/tests/lean/1334b.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -var_of.equations._eqn_1 : ∀ (n : ℕ), var_of (term.var n) = some n -var_of.equations._eqn_2 : ∀ (a : list term), var_of (term.app a) = none -var_of.equations._eqn_3 : ∀ (a : string), var_of (term.cnst a) = none -list_of.equations._eqn_1 : ∀ (a : ℕ), list_of (term.var a) = list.nil -list_of.equations._eqn_2 : ∀ (ts : list term), list_of (term.app ts) = ts -list_of.equations._eqn_3 : ∀ (a : string), list_of (term.cnst a) = list.nil diff --git a/old_tests/tests/lean/1369.lean b/old_tests/tests/lean/1369.lean deleted file mode 100644 index 31f17b8101..0000000000 --- a/old_tests/tests/lean/1369.lean +++ /dev/null @@ -1,41 +0,0 @@ -open nat -open tactic - -meta def match_le (e : expr) : tactic (expr × expr) := -match expr.is_le e with -| (some r) := return r -| none := tactic.fail "expression is not a leq" -end - -meta def nat_lit_le : tactic unit := do - (base_e, bound_e) ← tactic.target >>= match_le, - base ← tactic.eval_expr ℕ base_e, - skip - -example : 17 ≤ 555555 := -begin - nat_lit_le, - admit -end - -example : { k : ℕ // k ≤ 555555 } := -begin - refine subtype.mk _ _, - exact 17, - target >>= trace, - trace_state, - nat_lit_le, - admit -end - -set_option pp.instantiate_mvars false - -example : { k : ℕ // k ≤ 555555 } := -begin - refine subtype.mk _ _, - exact 17, - target >>= trace, - trace_state, - nat_lit_le, - admit -end diff --git a/old_tests/tests/lean/1369.lean.expected.out b/old_tests/tests/lean/1369.lean.expected.out deleted file mode 100644 index fe30fcc18c..0000000000 --- a/old_tests/tests/lean/1369.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -1369.lean:15:0: warning: declaration '[anonymous]' uses sorry -17 ≤ 555555 -⊢ 17 ≤ 555555 -1369.lean:21:0: warning: declaration '[anonymous]' uses sorry -?m_1 ≤ 555555 -⊢ ?m_1 ≤ 555555 -1369.lean:33:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/1467.lean b/old_tests/tests/lean/1467.lean deleted file mode 100644 index 0e0fd6abfa..0000000000 --- a/old_tests/tests/lean/1467.lean +++ /dev/null @@ -1,43 +0,0 @@ -constants f g h : ℕ → ℕ -axiom H_f_g : ∀ n, f (g n) = n - -example (m : ℕ) : h m = h m := -begin -let n : ℕ := g m, -have H : f n = m := begin rw H_f_g end, -subst H, -- Error here -end - -set_option pp.instantiate_mvars false - -example (m : ℕ) : h m = h m := -begin -let n : ℕ, -- add metavar -exact g m, -have H : f n = m := begin rw H_f_g end, -subst H, -- Error here -end - -example (m : ℕ) : h m = h m := -begin -let n : ℕ := g m, -have H : f n = m := begin rw H_f_g end, -subst m, -- Error here -end - -set_option pp.instantiate_mvars false - -example (m : ℕ) : h m = h m := -begin -let n : ℕ, -- add metavar -exact g m, -have H : f n = m := begin rw H_f_g end, -subst m, -- Error here -end - -example (m p: ℕ) : h m = h m := -begin -let a : ℕ := g p, -let n : ℕ := g a, -clear p -- Error here -end diff --git a/old_tests/tests/lean/1467.lean.expected.out b/old_tests/tests/lean/1467.lean.expected.out deleted file mode 100644 index 1b43004c60..0000000000 --- a/old_tests/tests/lean/1467.lean.expected.out +++ /dev/null @@ -1,30 +0,0 @@ -1467.lean:8:0: error: subst tactic failed, hypothesis 'H' is not of the form (x = t) or (t = x) -state: -m : ℕ, -n : ℕ := g m, -H : f n = m -⊢ h m = h m -1467.lean:18:0: error: subst tactic failed, hypothesis 'H' is not of the form (x = t) or (t = x) -state: -m : ℕ, -n : ℕ := ?m_1, -H : f n = m -⊢ h m = h m -1467.lean:25:0: error: subst tactic failed, hypothesis 'm' is not a variable nor an equation of the form (x = t) or (t = x) -state: -m : ℕ, -n : ℕ := g m, -H : f n = m -⊢ h m = h m -1467.lean:35:0: error: subst tactic failed, hypothesis 'm' is not a variable nor an equation of the form (x = t) or (t = x) -state: -m : ℕ, -n : ℕ := ?m_1, -H : f n = m -⊢ h m = h m -1467.lean:42:0: error: clear tactic failed, hypothesis 'a' depends on 'p' -state: -m p : ℕ, -a : ℕ := g p, -n : ℕ := g a -⊢ h m = h m diff --git a/old_tests/tests/lean/1487.lean b/old_tests/tests/lean/1487.lean deleted file mode 100644 index 4bbc1857bb..0000000000 --- a/old_tests/tests/lean/1487.lean +++ /dev/null @@ -1,4 +0,0 @@ -def ex (α : Sort _) (a b : α) : a = b := -begin [smt] - close -- Should fail -end diff --git a/old_tests/tests/lean/1487.lean.expected.out b/old_tests/tests/lean/1487.lean.expected.out deleted file mode 100644 index 25521b858d..0000000000 --- a/old_tests/tests/lean/1487.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -1487.lean:3:2: error: smt_tactic.close failed -state: -α : Sort ?, -a b : α -⊢ a = b diff --git a/old_tests/tests/lean/1513.lean b/old_tests/tests/lean/1513.lean deleted file mode 100644 index f82e90f451..0000000000 --- a/old_tests/tests/lean/1513.lean +++ /dev/null @@ -1,8 +0,0 @@ -example (n : ℕ) (h : n = 0) : n = 0 := -by rename n m - -example (n : ℕ) : let x := 10 in n > 0 → x > 5 → n ≠ x → x + 1 = 1 + x := -begin - intros, - rename x y -end diff --git a/old_tests/tests/lean/1513.lean.expected.out b/old_tests/tests/lean/1513.lean.expected.out deleted file mode 100644 index 292a7d3185..0000000000 --- a/old_tests/tests/lean/1513.lean.expected.out +++ /dev/null @@ -1,13 +0,0 @@ -1513.lean:2:3: error: tactic failed, there are unsolved goals -state: -m : ℕ, -h : m = 0 -⊢ m = 0 -1513.lean:8:0: error: tactic failed, there are unsolved goals -state: -n : ℕ, -a : n > 0, -y : ℕ := 10, -a_1 : y > 5, -a_2 : n ≠ y -⊢ y + 1 = 1 + y diff --git a/old_tests/tests/lean/1598.lean b/old_tests/tests/lean/1598.lean deleted file mode 100644 index 72e928e4a2..0000000000 --- a/old_tests/tests/lean/1598.lean +++ /dev/null @@ -1,4 +0,0 @@ -lemma notc : exists b, b = false := -begin - existsi 0, -- ERROR here -end diff --git a/old_tests/tests/lean/1598.lean.expected.out b/old_tests/tests/lean/1598.lean.expected.out deleted file mode 100644 index 0de20f19a1..0000000000 --- a/old_tests/tests/lean/1598.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -1598.lean:3:3: error: existsi tactic failed, type mismatch between given term witness and expected type -state: -⊢ 0 = false diff --git a/old_tests/tests/lean/1603.lean b/old_tests/tests/lean/1603.lean deleted file mode 100644 index cdf3759f91..0000000000 --- a/old_tests/tests/lean/1603.lean +++ /dev/null @@ -1,9 +0,0 @@ -def some_lets : ℕ → ℕ → ℕ -| 0 v := v -| (nat.succ n) v := let k := some_lets n v + v in k - -def some_unfolded_lets (n : ℕ) : ∃ v : ℕ , v = some_lets 5 n := -begin - dunfold some_lets, - -- admit -end diff --git a/old_tests/tests/lean/1603.lean.expected.out b/old_tests/tests/lean/1603.lean.expected.out deleted file mode 100644 index d9567aa8b3..0000000000 --- a/old_tests/tests/lean/1603.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -1603.lean:9:0: error: tactic failed, there are unsolved goals -state: -n : ℕ -⊢ ∃ (v : ℕ), - v = - let k : ℕ := - (let k : ℕ := (let k : ℕ := (let k : ℕ := (let k : ℕ := n + n in k) + n in k) + n in k) + n in k) + - n - in k diff --git a/old_tests/tests/lean/1638.lean b/old_tests/tests/lean/1638.lean deleted file mode 100644 index cf564349d8..0000000000 --- a/old_tests/tests/lean/1638.lean +++ /dev/null @@ -1,20 +0,0 @@ -meta def mk_cycle : tactic unit := -do [g] <- tactic.get_goals, - tactic.refine (pexpr.of_expr g) - -example : true := -by mk_cycle - -meta def mk_cycle2 : tactic unit := -do [g] <- tactic.get_goals, - tactic.exact g - -example : true := -by mk_cycle2 - -meta def mk_cycle3 : tactic unit := -do [g] <- tactic.get_goals, - tactic.refine ``(id %%g) - -example : true := -by mk_cycle3 diff --git a/old_tests/tests/lean/1638.lean.expected.out b/old_tests/tests/lean/1638.lean.expected.out deleted file mode 100644 index 80c3f001d4..0000000000 --- a/old_tests/tests/lean/1638.lean.expected.out +++ /dev/null @@ -1,17 +0,0 @@ -1638.lean:6:3: error: invalid exact tactic, trying to solve goal using itself -state: -2 goals -⊢ true - -⊢ true -1638.lean:13:3: error: invalid exact tactic, trying to solve goal using itself -state: -⊢ true -1638.lean:20:3: error: exact tactic failed, failed to assign - id ?m_1 -to metavariable ?m_1 (possible cause: occurs check failed) -state: -2 goals -⊢ true - -⊢ true diff --git a/old_tests/tests/lean/1639.lean b/old_tests/tests/lean/1639.lean deleted file mode 100644 index 333023544b..0000000000 --- a/old_tests/tests/lean/1639.lean +++ /dev/null @@ -1,20 +0,0 @@ -def some_lets : ℕ → ℕ → ℕ -| 0 v := v -| (nat.succ n) v := let k := some_lets n v + some_lets n v in some_lets n k - -def some_unfolded_lets (n : ℕ) : Σ' v : ℕ , v = some_lets 5 n := -begin - econstructor; dunfold some_lets; econstructor -end - -meta def foo : tactic unit := - do [g] <- tactic.get_goals, - tactic.to_expr (``(1)) >>= tactic.unify g -def some_lifted_lets (n : ℕ) : Σ' (v : ℕ), v = psigma.fst (some_unfolded_lets n) := -begin - econstructor; dunfold some_unfolded_lets psigma.fst; symmetry; transitivity; symmetry; - { - foo -- unify_reify_rhs_to_let_in - } - -end diff --git a/old_tests/tests/lean/1639.lean.expected.out b/old_tests/tests/lean/1639.lean.expected.out deleted file mode 100644 index 6136f4e703..0000000000 --- a/old_tests/tests/lean/1639.lean.expected.out +++ /dev/null @@ -1,176 +0,0 @@ -1639.lean:17:4: error: unify tactic failed, failed to unify - ?m_1 - : ?m_2 = - let k : ℕ := - (let k : ℕ := - (let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k -and - 1 : ℕ -state: -n : ℕ -⊢ ?m_1 = - let k : ℕ := - (let k : ℕ := - (let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k) + - let k : ℕ := (let k : ℕ := n + n in k) + let k : ℕ := n + n in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k) + - let k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := - (let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, k : ℕ := k + k in k) + - let k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k, - k : ℕ := (let k : ℕ := k + k in k) + let k : ℕ := k + k in k, - k : ℕ := k + k - in k diff --git a/old_tests/tests/lean/1669.lean b/old_tests/tests/lean/1669.lean deleted file mode 100644 index 26ce7ed58c..0000000000 --- a/old_tests/tests/lean/1669.lean +++ /dev/null @@ -1,3 +0,0 @@ -def f : ℕ → ℕ -| a := f a -using_well_founded ⟨{0}, well_founded_tactics.default_dec_tac⟩ diff --git a/old_tests/tests/lean/1669.lean.expected.out b/old_tests/tests/lean/1669.lean.expected.out deleted file mode 100644 index 349e62da0e..0000000000 --- a/old_tests/tests/lean/1669.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -1669.lean:3:20: error: failed to synthesize type class instance for -⊢ has_emptyc (expr → list expr → tactic unit) -1669.lean:3:20: error: failed to synthesize type class instance for -⊢ has_insert ?m_1 (expr → list expr → tactic unit) -1669.lean:1:4: error: failed to create auxiliary definition diff --git a/old_tests/tests/lean/1723.lean b/old_tests/tests/lean/1723.lean deleted file mode 100644 index ad962fc91b..0000000000 --- a/old_tests/tests/lean/1723.lean +++ /dev/null @@ -1,8 +0,0 @@ -#reduce int.shiftl (-1) (-1) -#eval int.shiftl (-1) (-1) - -#reduce int.shiftl (-4) (-2) -#eval int.shiftl (-4) (-2) - -#reduce int.shiftl (-5) (-2) -#eval int.shiftl (-5) (-2) diff --git a/old_tests/tests/lean/1723.lean.expected.out b/old_tests/tests/lean/1723.lean.expected.out deleted file mode 100644 index d1121d976d..0000000000 --- a/old_tests/tests/lean/1723.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ --[1+ 0] --1 --[1+ 0] --1 --[1+ 1] --2 diff --git a/old_tests/tests/lean/1745.lean b/old_tests/tests/lean/1745.lean deleted file mode 100644 index 853896cd75..0000000000 --- a/old_tests/tests/lean/1745.lean +++ /dev/null @@ -1 +0,0 @@ -def foo: list nat := [ 1,2, ] \ No newline at end of file diff --git a/old_tests/tests/lean/1745.lean.expected.out b/old_tests/tests/lean/1745.lean.expected.out deleted file mode 100644 index f5d61ec180..0000000000 --- a/old_tests/tests/lean/1745.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -1745.lean:1:28: error: invalid expression -1745.lean:1:0: warning: declaration 'foo' uses sorry diff --git a/old_tests/tests/lean/1760.lean b/old_tests/tests/lean/1760.lean deleted file mode 100644 index 4399bcf006..0000000000 --- a/old_tests/tests/lean/1760.lean +++ /dev/null @@ -1,7 +0,0 @@ -section -parameter big_type : Type 1 -parameter x : big_type -parameter f {A : Type} : A → bool - -def foo : bool := f x -end diff --git a/old_tests/tests/lean/1760.lean.expected.out b/old_tests/tests/lean/1760.lean.expected.out deleted file mode 100644 index a1212d9143..0000000000 --- a/old_tests/tests/lean/1760.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -1760.lean:6:18: error: type mismatch at application - f x -term - x -has type - big_type : Type 1 -but is expected to have type - ?m_1 : Type diff --git a/old_tests/tests/lean/1766.lean b/old_tests/tests/lean/1766.lean deleted file mode 100644 index 6a0bca5328..0000000000 --- a/old_tests/tests/lean/1766.lean +++ /dev/null @@ -1,32 +0,0 @@ -inductive is_some (x : option nat) : Prop - | mk : ∀ value : nat, x = some value → is_some - -def value_1 (x : option nat) (H : is_some x) - : nat := -begin - destruct x; intros, - {destruct H, -- ERROR: `is_some` can only eliminate into Prop - intros, clear a_2, rw a at a_1, contradiction}, - {assumption} -end - -def value_2 (x : option nat) (H : is_some x) - : x = x := -begin - destruct x; intros, - {destruct H, - intros, rw a at a_1}, - {refl} -end - -inductive is_some' (x : option nat) : Type - | mk : ∀ value : nat, x = some value → is_some' - -def value_3 (x : option nat) (H : is_some' x) - : nat := -begin - destruct x; intros, - {destruct H, - intros, clear a_2, rw a at a_1, contradiction}, - {assumption} -end diff --git a/old_tests/tests/lean/1766.lean.expected.out b/old_tests/tests/lean/1766.lean.expected.out deleted file mode 100644 index 2b194362e7..0000000000 --- a/old_tests/tests/lean/1766.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -1766.lean:8:4: error: destruct tactic failed, recursor 'is_some.cases_on' can only eliminate into Prop -state: -x : option ℕ, -H : is_some x, -a : x = none -⊢ ℕ diff --git a/old_tests/tests/lean/1786.lean b/old_tests/tests/lean/1786.lean deleted file mode 100644 index 0a64cb734e..0000000000 --- a/old_tests/tests/lean/1786.lean +++ /dev/null @@ -1,4 +0,0 @@ -theorem nil_subset : (true ∧ true) = true := by simp -open list - -example (x : ℕ) : x = x := by simp [nil_subset] diff --git a/old_tests/tests/lean/1786.lean.expected.out b/old_tests/tests/lean/1786.lean.expected.out deleted file mode 100644 index c012b48236..0000000000 --- a/old_tests/tests/lean/1786.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -1786.lean:4:30: error: ambiguous overload, possible interpretations - nil_subset - list.nil_subset -state: -x : ℕ -⊢ x = x diff --git a/old_tests/tests/lean/1794.lean b/old_tests/tests/lean/1794.lean deleted file mode 100644 index 4cd1944f0b..0000000000 --- a/old_tests/tests/lean/1794.lean +++ /dev/null @@ -1,22 +0,0 @@ -inductive test : nat -> list nat -> Prop -| zero: test 0 list.nil ---n remains even -| nil: forall {n: nat}, test n list.nil -> test (n+2) list.nil ---n flips between even and odd -| cons: forall {n i: nat} {is: list nat}, test n is -> test (n+3) (list.cons i is) - -lemma example3 : forall (n m: nat), test (n+n) [m] -> false := -begin -intros n m, -generalize def_n' : n + n = n', -generalize def_is : [m] = is, -intro h, -revert def_n' def_is, -cases h; try {intros, contradiction}, -- smart unfolding prevents the generation of unwieldy terms, -trace_state, -have : nat.succ (nat.add h_n (nat.add 2 0)) = h_n + 3, from rfl, -simp [this], intro h_1, -have : n + n = h_n + 3 → false, from sorry, -intros, -exact this h_1, -end diff --git a/old_tests/tests/lean/1794.lean.expected.out b/old_tests/tests/lean/1794.lean.expected.out deleted file mode 100644 index d6963d3316..0000000000 --- a/old_tests/tests/lean/1794.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -case test.cons -n m h_n h_i : ℕ, -h_is : list ℕ, -h_a : test h_n h_is, -h : test (nat.succ (nat.add h_n (nat.add 2 0))) (h_i :: h_is) -⊢ n + n = nat.succ (nat.add h_n (nat.add 2 0)) → [m] = h_i :: h_is → false -1794.lean:8:0: warning: declaration 'example3' uses sorry diff --git a/old_tests/tests/lean/1814.lean b/old_tests/tests/lean/1814.lean deleted file mode 100644 index 686f82937c..0000000000 --- a/old_tests/tests/lean/1814.lean +++ /dev/null @@ -1,12 +0,0 @@ -example : ∀ (p q : Prop), p → q → p := -begin - intros p p h1 h2, - exact h2, -end - -example : ∀ (p q : Prop), p → q → p := -begin - intros p p h1 h2, - dedup, - exact h2, -end diff --git a/old_tests/tests/lean/1814.lean.expected.out b/old_tests/tests/lean/1814.lean.expected.out deleted file mode 100644 index ba007a2d04..0000000000 --- a/old_tests/tests/lean/1814.lean.expected.out +++ /dev/null @@ -1,20 +0,0 @@ -1814.lean:4:8: error: invalid type ascription, term has type - p -but is expected to have type - p -types contain aliased name(s): p -remark: the tactic `dedup` can be used to rename aliases -state: -p p : Prop, -h1 : p, -h2 : p -⊢ p -1814.lean:11:8: error: invalid type ascription, term has type - p_1 -but is expected to have type - p -state: -p p_1 : Prop, -h1 : p, -h2 : p_1 -⊢ p diff --git a/old_tests/tests/lean/1817.lean b/old_tests/tests/lean/1817.lean deleted file mode 100644 index e77ba29c23..0000000000 --- a/old_tests/tests/lean/1817.lean +++ /dev/null @@ -1,19 +0,0 @@ -def f : int → int := λ _, 0 - -#check int.add (-1) 1 - -#check (-1 : int) - -#check 2 + (-1 : int) - -#check (2 + -1 : int) - -#check f (-1) - -#check 2 * (-1 : int) - -#check (2 * -1 : int) - -#check f 1 < -2 - -#check (- - 2 : int) diff --git a/old_tests/tests/lean/1817.lean.expected.out b/old_tests/tests/lean/1817.lean.expected.out deleted file mode 100644 index 966fd8827d..0000000000 --- a/old_tests/tests/lean/1817.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -int.add (-1) 1 : ℤ --1 : ℤ -2 + -1 : ℤ -2 + -1 : ℤ -f (-1) : ℤ -2 * -1 : ℤ -2 * -1 : ℤ -f 1 < -2 : Prop -- -2 : ℤ diff --git a/old_tests/tests/lean/1836.lean b/old_tests/tests/lean/1836.lean deleted file mode 100644 index 8f50c62f52..0000000000 --- a/old_tests/tests/lean/1836.lean +++ /dev/null @@ -1,21 +0,0 @@ -structure pType := - (carrier : Type) - (Point : carrier) - -structure pmap (A B : pType) : Type := - (f : A.carrier → B.carrier) - (p : f A.Point = B.Point) - -def ex1 {A B : pType} (f : pmap A B) : f = f := -begin - induction B with B b, induction f with f pf, - cases pf -- should fail because of dependency -end - -def ex2 {A B : pType} (f : pmap A B) : f = f := -begin - induction B with B b, induction f with f pf, - dsimp at f, /- break dependency using reduction -/ - cases pf, - refl -end diff --git a/old_tests/tests/lean/1836.lean.expected.out b/old_tests/tests/lean/1836.lean.expected.out deleted file mode 100644 index 8fb0f44fb1..0000000000 --- a/old_tests/tests/lean/1836.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -1836.lean:12:2: error: cases tactic failed, when eliminating equality right-hand-side depends on left-hand-side -state: -A : pType, -B : Type, -b : B, -f : A.carrier → {carrier := B, Point := b}.carrier, -pf : f (A.Point) = {carrier := B, Point := b}.Point -⊢ b = f (A.Point) → pf == _ → {f := f, p := pf} = {f := f, p := pf} diff --git a/old_tests/tests/lean/1859.lean b/old_tests/tests/lean/1859.lean deleted file mode 100644 index 8214454980..0000000000 --- a/old_tests/tests/lean/1859.lean +++ /dev/null @@ -1,8 +0,0 @@ -prelude -class T1 (α : Type) := (O : Type) -class T2 (α : Type) extends T1 α -class T3 (α : Type) extends T1 α -class A (α : Type) [T1 α] := (x : T1.O α) -class B (α : Type) [T3 α] extends A α -def X {α : Type} [T2 α] : A α := sorry -example {α : Type} [T3 α] : B α := { X with } diff --git a/old_tests/tests/lean/1859.lean.expected.out b/old_tests/tests/lean/1859.lean.expected.out deleted file mode 100644 index 0488b14843..0000000000 --- a/old_tests/tests/lean/1859.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -1859.lean:7:0: warning: declaration 'X' uses sorry -1859.lean:8:35: error: type mismatch at field 'x' - A.x ?m_1 -has type - T1.O ?m_1 -but is expected to have type - T1.O α diff --git a/old_tests/tests/lean/1860.lean b/old_tests/tests/lean/1860.lean deleted file mode 100644 index ddd6a65efd..0000000000 --- a/old_tests/tests/lean/1860.lean +++ /dev/null @@ -1 +0,0 @@ -run_cmd tactic.trace $ let let_val := (2 : ℕ) in `(id let_val) diff --git a/old_tests/tests/lean/1860.lean.expected.out b/old_tests/tests/lean/1860.lean.expected.out deleted file mode 100644 index e2f972777d..0000000000 --- a/old_tests/tests/lean/1860.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -id 2 diff --git a/old_tests/tests/lean/1861.lean b/old_tests/tests/lean/1861.lean deleted file mode 100644 index d41cd1b32d..0000000000 --- a/old_tests/tests/lean/1861.lean +++ /dev/null @@ -1,22 +0,0 @@ -def int' := int - -#eval id_rhs int' (-1 : ℤ) --- #2147483647 - -instance : has_repr int' := -by unfold int'; apply_instance - -#eval id_rhs int' (-1 : ℤ) --- -1 - -@[reducible] def int'' := int - -/- Don't need to define has_repr instance for int'' because it is reducible -/ -#eval id_rhs int'' (-1 : ℤ) --- -1 - -inductive foo -| mk₁ : bool → foo -| mk₂ : bool → foo - -#eval foo.mk₁ tt diff --git a/old_tests/tests/lean/1861.lean.expected.out b/old_tests/tests/lean/1861.lean.expected.out deleted file mode 100644 index e7fb137a01..0000000000 --- a/old_tests/tests/lean/1861.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -1861.lean:3:0: warning: result type does not have an instance of type class 'has_repr', dumping internal representation -#2147483647 --1 --1 -1861.lean:22:0: warning: result type does not have an instance of type class 'has_repr', dumping internal representation -(#0 #1) diff --git a/old_tests/tests/lean/1862.lean b/old_tests/tests/lean/1862.lean deleted file mode 100644 index f6bfab2eb3..0000000000 --- a/old_tests/tests/lean/1862.lean +++ /dev/null @@ -1,10 +0,0 @@ -variable R : Type -variable [ring R] - -example : -(-(1:R)) = 1 := -begin - trace_state, - exact neg_neg 1, -end - -#check - -(1:R) diff --git a/old_tests/tests/lean/1862.lean.expected.out b/old_tests/tests/lean/1862.lean.expected.out deleted file mode 100644 index 5baaadd5a5..0000000000 --- a/old_tests/tests/lean/1862.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -R : Type, -_inst_1 : ring R -⊢ - -1 = 1 -- -1 : R diff --git a/old_tests/tests/lean/1870.lean b/old_tests/tests/lean/1870.lean deleted file mode 100644 index 036fb2bccf..0000000000 --- a/old_tests/tests/lean/1870.lean +++ /dev/null @@ -1,4 +0,0 @@ -structure T := (x y : nat) -example : T := by refine { x := 1, y := _} -example : T := by refine { x := 1, ..} -example : T := { x := 1, ..} diff --git a/old_tests/tests/lean/1870.lean.expected.out b/old_tests/tests/lean/1870.lean.expected.out deleted file mode 100644 index f5c9f1ec6e..0000000000 --- a/old_tests/tests/lean/1870.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -1870.lean:2:18: error: tactic failed, there are unsolved goals -state: -⊢ ℕ -1870.lean:3:18: error: tactic failed, there are unsolved goals -state: -⊢ ℕ -1870.lean:4:15: error: don't know how to synthesize placeholder -context: -⊢ ℕ diff --git a/old_tests/tests/lean/1898.lean b/old_tests/tests/lean/1898.lean deleted file mode 100644 index 1a329b76a2..0000000000 --- a/old_tests/tests/lean/1898.lean +++ /dev/null @@ -1 +0,0 @@ -def X (R : Type) [H : comm_ring R] := H.0 diff --git a/old_tests/tests/lean/1898.lean.expected.out b/old_tests/tests/lean/1898.lean.expected.out deleted file mode 100644 index f7fd3dce29..0000000000 --- a/old_tests/tests/lean/1898.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -1898.lean:1:39: error: invalid projection, index must be greater than 0 -1898.lean:1:4: error: don't know how to synthesize placeholder -context: -R : Type, -H : comm_ring R -⊢ Sort ? diff --git a/old_tests/tests/lean/1917.lean b/old_tests/tests/lean/1917.lean deleted file mode 100644 index 004062d35d..0000000000 --- a/old_tests/tests/lean/1917.lean +++ /dev/null @@ -1,18 +0,0 @@ -def foo : ℕ → false -| x := -match x with - y := let z := y in foo z /- should fail -/ -end - -meta def foo2 : ℕ → false -| x := -match x with - y := let z := y in foo2 z /- should work -/ -end - -def boo : ℕ → ℕ → bool -| 0 m := ff -| (n + 1) m := - match m with - o := let z := n in boo n (m+1) - end diff --git a/old_tests/tests/lean/1917.lean.expected.out b/old_tests/tests/lean/1917.lean.expected.out deleted file mode 100644 index f36fe1bb83..0000000000 --- a/old_tests/tests/lean/1917.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -1917.lean:4:21: error: failed to prove recursive application is decreasing, well founded relation - @has_well_founded.r ℕ (@has_well_founded_of_has_sizeof ℕ nat.has_sizeof) -Possible solutions: - - Use 'using_well_founded' keyword in the end of your definition to specify tactics for synthesizing well founded relations and decreasing proofs. - - The default decreasing tactic uses the 'assumption' tactic, thus hints (aka local proofs) can be provided using 'have'-expressions. -The nested exception contains the failure state for the decreasing tactic. -nested exception message: -failed -state: -foo : ℕ → false, -x y : ℕ -⊢ y < x diff --git a/old_tests/tests/lean/1922.lean b/old_tests/tests/lean/1922.lean deleted file mode 100644 index 088a539ea3..0000000000 --- a/old_tests/tests/lean/1922.lean +++ /dev/null @@ -1,8 +0,0 @@ -set_option pp.implicit true - -structure C := -( d : Π { X : Type }, list X → list X ) - -def P(c : C):= c.d [0] - -#print P diff --git a/old_tests/tests/lean/1922.lean.expected.out b/old_tests/tests/lean/1922.lean.expected.out deleted file mode 100644 index ed3ace130e..0000000000 --- a/old_tests/tests/lean/1922.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -def P : C → list ℕ := -λ (c : C), @C.d c ℕ [0] diff --git a/old_tests/tests/lean/1930.lean b/old_tests/tests/lean/1930.lean deleted file mode 100644 index 9aea0beecc..0000000000 --- a/old_tests/tests/lean/1930.lean +++ /dev/null @@ -1,3 +0,0 @@ -structure S := (f : ℕ) - -def F : S := { f := prod.1 } diff --git a/old_tests/tests/lean/1930.lean.expected.out b/old_tests/tests/lean/1930.lean.expected.out deleted file mode 100644 index 8871a8a871..0000000000 --- a/old_tests/tests/lean/1930.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -1930.lean:3:24: error: invalid field notation, type is not of the form (C ...) where C is a constant - prod -has type - Type ? → Type ? → Type (max ? ?) diff --git a/old_tests/tests/lean/1952.lean b/old_tests/tests/lean/1952.lean deleted file mode 100644 index e21dcaff4c..0000000000 --- a/old_tests/tests/lean/1952.lean +++ /dev/null @@ -1,16 +0,0 @@ -structure foo := -(fn : nat → nat) -(fn_ax : ∀ a : nat, fn a = a) - -/- -set_option pp.all true -set_option pp.universes false -- universes are probably irrelevant -set_option pp.purify_metavars false -set_option trace.type_context.is_def_eq true -set_option trace.type_context.is_def_eq_detail true --/ - -def bla : foo := { fn_ax := λ x, rfl } - - -instance foo2 (α : Type) : group α := { mul_assoc := λ x y z, rfl } diff --git a/old_tests/tests/lean/1952.lean.expected.out b/old_tests/tests/lean/1952.lean.expected.out deleted file mode 100644 index 7fda685f51..0000000000 --- a/old_tests/tests/lean/1952.lean.expected.out +++ /dev/null @@ -1,19 +0,0 @@ -1952.lean:13:17: error: invalid structure value { ... }, field 'fn' was not provided -1952.lean:13:28: error: type mismatch at field 'fn_ax' - λ (x : ℕ), rfl -has type - ∀ (x : ℕ), ?m_2[x] = ?m_2[x] -but is expected to have type - ∀ (a : ℕ), ⁇ a = a -1952.lean:16:38: error: invalid structure value { ... }, field 'mul' was not provided -1952.lean:16:38: error: invalid structure value { ... }, field 'one' was not provided -1952.lean:16:38: error: invalid structure value { ... }, field 'one_mul' was not provided -1952.lean:16:38: error: invalid structure value { ... }, field 'mul_one' was not provided -1952.lean:16:38: error: invalid structure value { ... }, field 'inv' was not provided -1952.lean:16:38: error: invalid structure value { ... }, field 'mul_left_inv' was not provided -1952.lean:16:53: error: type mismatch at field 'mul_assoc' - λ (x y z : α), rfl -has type - ∀ (x y z : α), ?m_2[x, y, z] = ?m_2[x, y, z] -but is expected to have type - ∀ (a b c : α), a * b * c = a * (b * c) diff --git a/old_tests/tests/lean/1952b.lean b/old_tests/tests/lean/1952b.lean deleted file mode 100644 index 50bc42e6eb..0000000000 --- a/old_tests/tests/lean/1952b.lean +++ /dev/null @@ -1,14 +0,0 @@ -structure presheaf_of_types (α : Type*) := -(F : Π U : set α, Type*) -(res : ∀ (U V : set α) , - (F U) → (F V)) -(Hidem : ∀ U : set α, res U U = (res U U) ∘ (res U U)) - --- set_option trace.type_context.is_def_eq true --- set_option trace.type_context.is_def_eq_detail true - -definition presheaf_of_types_pushforward - {β : Type*} - : presheaf_of_types β := - { Hidem := λ U, rfl, -} diff --git a/old_tests/tests/lean/1952b.lean.expected.out b/old_tests/tests/lean/1952b.lean.expected.out deleted file mode 100644 index 5f372a21f5..0000000000 --- a/old_tests/tests/lean/1952b.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -1952b.lean:13:2: error: invalid structure value { ... }, field 'F' was not provided -1952b.lean:13:2: error: invalid structure value { ... }, field 'res' was not provided -1952b.lean:13:13: error: type mismatch at field 'Hidem' - λ (U : set β), rfl -has type - ∀ (U : set β), ?m_2[U] = ?m_2[U] -but is expected to have type - ∀ (U : set β), ⁇ U U = ⁇ U U ∘ ⁇ U U diff --git a/old_tests/tests/lean/584a.lean b/old_tests/tests/lean/584a.lean deleted file mode 100644 index 08279c6c7d..0000000000 --- a/old_tests/tests/lean/584a.lean +++ /dev/null @@ -1,19 +0,0 @@ -universe variables u -variables (A : Type u) [H : inhabited A] (x : A) -include H - -definition foo := x -#check foo -- A and x are explicit - -variables {A x} -definition foo' := x -#check @foo' -- A is explicit, x is implicit - -open nat - -#check foo nat 10 - -definition test : @foo' ℕ _ 10 = (10:nat) := rfl - -set_option pp.implicit true -#print test diff --git a/old_tests/tests/lean/584a.lean.expected.out b/old_tests/tests/lean/584a.lean.expected.out deleted file mode 100644 index e9343289d3..0000000000 --- a/old_tests/tests/lean/584a.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -foo : Π (A : Type u_1) [H : inhabited A], A → A -foo' : Π {A : Type u_1} [H : inhabited A] {x : A}, A -foo ℕ 10 : ℕ -def test : ∀ {A : Type u} [H : inhabited A], @foo' ℕ nat.inhabited (5 + 5) = 10 := -λ {A : Type u} [H : inhabited A], @rfl ℕ (@foo' ℕ nat.inhabited (5 + 5)) diff --git a/old_tests/tests/lean/584b.lean b/old_tests/tests/lean/584b.lean deleted file mode 100644 index 15d54110f8..0000000000 --- a/old_tests/tests/lean/584b.lean +++ /dev/null @@ -1,27 +0,0 @@ -section - universe variable u variable (A : Type u) - - section - variables (a b : A) - variable (H : a = b) - - definition tst₁ := a - - #check @tst₁ - - variable {A} - - definition tst₂ := a - - #check @tst₂ -- A is implicit - - lemma symm₂ : b = a := eq.symm H - - #check @symm₂ - end - - variable (a : A) - definition tst₃ := a - - #check @tst₃ -- A is explicit again -end diff --git a/old_tests/tests/lean/584b.lean.expected.out b/old_tests/tests/lean/584b.lean.expected.out deleted file mode 100644 index 1780d281c3..0000000000 --- a/old_tests/tests/lean/584b.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -tst₁ : Π (A : Type u_1), A → A -tst₂ : Π {A : Type u_1}, A → A -symm₂ : ∀ {A : Type u_1} (a b : A), a = b → b = a -tst₃ : Π (A : Type u_1), A → A diff --git a/old_tests/tests/lean/584c.lean b/old_tests/tests/lean/584c.lean deleted file mode 100644 index abddd52a26..0000000000 --- a/old_tests/tests/lean/584c.lean +++ /dev/null @@ -1,29 +0,0 @@ -section - universe variables u parameter (A : Type u) - - section - parameters (a b : A) - parameter (H : a = b) - - definition tst₁ := a - - parameter {A} - - definition tst₂ := a - - lemma symm₂ : b = a := eq.symm H - - parameters {a b} - lemma foo (c : A) (h₂ : c = b) : c = a := - eq.trans h₂ symm₂ - end - - parameter (a : A) - definition tst₃ := a -end - -#check @tst₁ -#check @tst₂ -- A is implicit -#check @symm₂ -#check @tst₃ -- A is explicit again -#check @foo diff --git a/old_tests/tests/lean/584c.lean.expected.out b/old_tests/tests/lean/584c.lean.expected.out deleted file mode 100644 index a7f415d768..0000000000 --- a/old_tests/tests/lean/584c.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -tst₁ : Π (A : Type u_1), A → A -tst₂ : Π {A : Type u_1}, A → A -symm₂ : ∀ {A : Type u_1} (a b : A), a = b → b = a -tst₃ : Π (A : Type u_1), A → A -foo : ∀ {A : Type u_1} {a b : A}, a = b → ∀ (c : A), c = b → c = a diff --git a/old_tests/tests/lean/634.lean b/old_tests/tests/lean/634.lean deleted file mode 100644 index 1d132077a5..0000000000 --- a/old_tests/tests/lean/634.lean +++ /dev/null @@ -1,17 +0,0 @@ -open nat -namespace foo -section - parameter (X : Type) - definition A {n : ℕ} : Type := X - variable {n : ℕ} - set_option pp.implicit true - #check @A n - set_option pp.full_names true - #check @foo.A n - #check @A n - - set_option pp.full_names false - #check @foo.A n - #check @A n -end -end foo diff --git a/old_tests/tests/lean/634.lean.expected.out b/old_tests/tests/lean/634.lean.expected.out deleted file mode 100644 index d611f8123d..0000000000 --- a/old_tests/tests/lean/634.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -@A n : Type -@foo.A n : Type -@foo.A n : Type -@A n : Type -@A n : Type diff --git a/old_tests/tests/lean/634b.lean b/old_tests/tests/lean/634b.lean deleted file mode 100644 index 4540e244a1..0000000000 --- a/old_tests/tests/lean/634b.lean +++ /dev/null @@ -1,41 +0,0 @@ -open nat -namespace foo -section - parameter (X : Type) - definition A {n : ℕ} : Type := X - definition B : Type := X - variable {n : ℕ} - #check @A n - #check foo.A - #check foo.A - #check @foo.A 10 - #check @foo.A n - #check @foo.A n - #check @foo.A n - - set_option pp.full_names true - #check A - #check foo.A - #check @foo.A 10 - #check @foo.A n - #check @foo.A n - - set_option pp.full_names false - - set_option pp.implicit true - #check @A n - #check @foo.A 10 - #check @foo.A n - set_option pp.full_names true - #check @foo.A n - #check @A n - - set_option pp.full_names false - #check @foo.A n - #check @foo.A n - #check @foo.A n - #check @foo.A n - #check @foo.A n - #check @A n -end -end foo diff --git a/old_tests/tests/lean/634b.lean.expected.out b/old_tests/tests/lean/634b.lean.expected.out deleted file mode 100644 index 2ff1762fc3..0000000000 --- a/old_tests/tests/lean/634b.lean.expected.out +++ /dev/null @@ -1,23 +0,0 @@ -A : Type -A : Type -A : Type -A : Type -A : Type -A : Type -A : Type -foo.A : Type -foo.A : Type -foo.A : Type -foo.A : Type -foo.A : Type -@A n : Type -@A 10 : Type -@A n : Type -@foo.A n : Type -@foo.A n : Type -@A n : Type -@A n : Type -@A n : Type -@A n : Type -@A n : Type -@A n : Type diff --git a/old_tests/tests/lean/634c.lean b/old_tests/tests/lean/634c.lean deleted file mode 100644 index 94ae3fb162..0000000000 --- a/old_tests/tests/lean/634c.lean +++ /dev/null @@ -1,38 +0,0 @@ -open nat -section - parameter (X : Type) - definition A {n : ℕ} : Type := X - definition B : Type := X - variable {n : ℕ} - #check @A n - #check _root_.A nat - #check _root_.A (X × B) - #check @_root_.A (X × B) 10 - #check @_root_.A (_root_.B (@_root_.A X n)) n - #check @_root_.A (@_root_.B (@_root_.A nat n)) n - - set_option pp.full_names true - #check A - #check _root_.A nat - #check @_root_.A (X × B) 10 - #check @_root_.A (@_root_.B (@_root_.A X n)) n - #check @_root_.A (@_root_.B (@_root_.A nat n)) n - - set_option pp.full_names false - - set_option pp.implicit true - #check @A n - #check @_root_.A nat 10 - #check @_root_.A X n - set_option pp.full_names true - #check @_root_.A X n - #check @_root_.A B n - - set_option pp.full_names false - #check @_root_.A X n - #check @_root_.A B n - #check @_root_.A (@_root_.B (@A n)) n - #check @_root_.A (@_root_.B (@_root_.A X n)) n - #check @_root_.A (@_root_.B (@_root_.A nat n)) n - #check @A n -end diff --git a/old_tests/tests/lean/634c.lean.expected.out b/old_tests/tests/lean/634c.lean.expected.out deleted file mode 100644 index 69045bddc5..0000000000 --- a/old_tests/tests/lean/634c.lean.expected.out +++ /dev/null @@ -1,22 +0,0 @@ -A : Type -_root_.A ℕ : Type -_root_.A (X × B) : Type -_root_.A (X × B) : Type -_root_.A (_root_.B A) : Type -_root_.A (_root_.B (_root_.A ℕ)) : Type -A : Type -_root_.A ℕ : Type -_root_.A (X × B) : Type -_root_.A (_root_.B A) : Type -_root_.A (_root_.B (_root_.A ℕ)) : Type -@A n : Type -@_root_.A ℕ 10 : Type -@A n : Type -@A n : Type -@_root_.A B n : Type -@A n : Type -@_root_.A B n : Type -@_root_.A (_root_.B (@A n)) n : Type -@_root_.A (_root_.B (@A n)) n : Type -@_root_.A (_root_.B (@_root_.A ℕ n)) n : Type -@A n : Type diff --git a/old_tests/tests/lean/634d.lean b/old_tests/tests/lean/634d.lean deleted file mode 100644 index 2723066ee7..0000000000 --- a/old_tests/tests/lean/634d.lean +++ /dev/null @@ -1,23 +0,0 @@ -section - universe l - definition A {n : ℕ} (t : Sort l) := t - #check A - #check _root_.A.{1} - set_option pp.universes true - #check A - #check _root_.A.{1} -end - -section - universe l - parameters {B : Sort l} - definition P {n : ℕ} (b : B) := b - #check P - #check @_root_.P.{1} nat - set_option pp.universes true - #check P - #check _root_.P.{1} - set_option pp.implicit true - #check @P 2 - #check @_root_.P.{1} nat -end diff --git a/old_tests/tests/lean/634d.lean.expected.out b/old_tests/tests/lean/634d.lean.expected.out deleted file mode 100644 index 05560ab3a9..0000000000 --- a/old_tests/tests/lean/634d.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -A : Sort l → Sort l -_root_.A : Type → Type -A : Sort l → Sort l -_root_.A.{1} : Type → Type -P : B → B -_root_.P : Π {n : ℕ}, ℕ → ℕ -P : B → B -_root_.P.{1} : ?M_1 → ?M_1 -@P 2 : B → B -@_root_.P.{1} ℕ : Π {n : ℕ}, ℕ → ℕ diff --git a/old_tests/tests/lean/652.lean b/old_tests/tests/lean/652.lean deleted file mode 100644 index 35c79846d9..0000000000 --- a/old_tests/tests/lean/652.lean +++ /dev/null @@ -1,25 +0,0 @@ -section - parameters {b c : bool} - - definition R : Prop := (b = c) - - parameters (b c) - definition R2 := R - parameter (c) - parameter (b) - definition R3 := R - parameter {c} - parameter (b) - definition R4 := R - parameters {c b} - definition R5 := R - parameters (c) - definition R6 := R -end - -#check @R -#check @R2 -#check @R3 -#check @R4 -#check @R5 -#check @R6 diff --git a/old_tests/tests/lean/652.lean.expected.out b/old_tests/tests/lean/652.lean.expected.out deleted file mode 100644 index f4402e127c..0000000000 --- a/old_tests/tests/lean/652.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -R : Π {b c : bool}, Prop -R2 : bool → bool → Prop -R3 : bool → bool → Prop -R4 : bool → Π {c : bool}, Prop -R5 : Π {b c : bool}, Prop -R6 : Π {b : bool}, bool → Prop diff --git a/old_tests/tests/lean/671.lean b/old_tests/tests/lean/671.lean deleted file mode 100644 index cfa8400466..0000000000 --- a/old_tests/tests/lean/671.lean +++ /dev/null @@ -1 +0,0 @@ -#print nat.add diff --git a/old_tests/tests/lean/671.lean.expected.out b/old_tests/tests/lean/671.lean.expected.out deleted file mode 100644 index d7f2428f20..0000000000 --- a/old_tests/tests/lean/671.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -@[pattern] -protected def nat.add : ℕ → ℕ → ℕ := -nat.add._main diff --git a/old_tests/tests/lean/712.lean b/old_tests/tests/lean/712.lean deleted file mode 100644 index 24555fc456..0000000000 --- a/old_tests/tests/lean/712.lean +++ /dev/null @@ -1,30 +0,0 @@ -reserve infix `~~~`:50 -reserve notation `[` a `][` b:10 `]` - -section -local infix `~~~` := eq - -#print notation ~~~ - -local infix `~~~`:50 := eq - -#print notation ~~~ - -local infix `~~~`:100 := eq - -infix `~~~`:100 := eq -- FAIL - -#print notation ~~~ - -local notation `[` a `][`:10 b:20 `]` := a = b - -#print notation ][ -end - -notation `[` a `][`:10 b:20 `]` := a = b -- FAIL - -notation `[` a `][` b `]` := a = b -infix `~~~` := eq - -#print notation ~~~ -#print notation ][ diff --git a/old_tests/tests/lean/712.lean.expected.out b/old_tests/tests/lean/712.lean.expected.out deleted file mode 100644 index 1ee2ecf9cd..0000000000 --- a/old_tests/tests/lean/712.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -_ `~~~`:50 _:50 := eq #1 #0 -_ `~~~`:50 _:50 := eq #1 #0 -712.lean:15:11: error: invalid notation declaration, invalid ':' occurrence (declaration matches reserved notation) -_ `~~~`:100 _:100 := eq #1 #0 -`[`:1024 _:1 `][`:10 _:20 `]`:0 := eq #1 #0 -712.lean:24:24: error: invalid notation declaration, invalid ':' occurrence (declaration prefix matches reserved notation) -_ `~~~`:50 _:50 := eq #1 #0 -`[`:1024 _:1 `][`:1 _:10 `]`:0 := eq #1 #0 diff --git a/old_tests/tests/lean/858.lean b/old_tests/tests/lean/858.lean deleted file mode 100644 index 43aeb6ad59..0000000000 --- a/old_tests/tests/lean/858.lean +++ /dev/null @@ -1,3 +0,0 @@ -section - parameter (n : Πa, nat) -end diff --git a/old_tests/tests/lean/858.lean.expected.out b/old_tests/tests/lean/858.lean.expected.out deleted file mode 100644 index e97403066f..0000000000 --- a/old_tests/tests/lean/858.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -858.lean:2:18: error: don't know how to synthesize placeholder -context: -⊢ Sort ? diff --git a/old_tests/tests/lean/alias.lean b/old_tests/tests/lean/alias.lean deleted file mode 100644 index d6c1d81eb2..0000000000 --- a/old_tests/tests/lean/alias.lean +++ /dev/null @@ -1,24 +0,0 @@ --- - -namespace N1 - constant num : Type.{1} - constant foo : num → num → num -end N1 - -namespace N2 - constant val : Type.{1} - constant foo : val → val → val -end N2 - -open N2 -open N1 -constants a b : N1.num -#print raw foo a b -open N2 -#print raw foo a b -open N1 -#print raw foo a b -open N1 -#print raw foo a b -open N2 -#print raw foo a b diff --git a/old_tests/tests/lean/alias.lean.expected.out b/old_tests/tests/lean/alias.lean.expected.out deleted file mode 100644 index d5c8f8fd8c..0000000000 --- a/old_tests/tests/lean/alias.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -[choice foo foo] a b -[choice foo foo] a b -[choice foo foo] a b -[choice foo foo] a b -[choice foo foo] a b diff --git a/old_tests/tests/lean/alias2.lean b/old_tests/tests/lean/alias2.lean deleted file mode 100644 index 6cc5a0f870..0000000000 --- a/old_tests/tests/lean/alias2.lean +++ /dev/null @@ -1,11 +0,0 @@ --- - -namespace foo - definition t := true -end foo -open foo - -namespace bla - definition t := false - #check foo.t -- <<< must print foo.t : Prop instead of t : Prop -end bla diff --git a/old_tests/tests/lean/alias2.lean.expected.out b/old_tests/tests/lean/alias2.lean.expected.out deleted file mode 100644 index d89d0ce7ca..0000000000 --- a/old_tests/tests/lean/alias2.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -foo.t : Prop diff --git a/old_tests/tests/lean/anc1.lean b/old_tests/tests/lean/anc1.lean deleted file mode 100644 index 8cb093a896..0000000000 --- a/old_tests/tests/lean/anc1.lean +++ /dev/null @@ -1,48 +0,0 @@ -#check (⟨1, 2⟩ : nat × nat) - -#check (⟨trivial, trivial⟩ : true ∧ true) - -example : true := sorry - -#check (⟨1, sorry⟩ : Σ' x : nat, x > 0) - -open tactic - -#check show true, from ⟨⟩ - -#check (⟨1, by intro1 >> contradiction⟩ : ∃ x : nat, 1 ≠ 0) -universe variables u v -#check λ (A B C : Prop), - assume (Ha : A) (Hb : B) (Hc : C), - show B ∧ A, from - ⟨Hb, Ha⟩ - -#check λ (A B C : Prop), - assume (Ha : A) (Hb : B) (Hc : C), - show B ∧ A ∧ C ∧ A, from - ⟨Hb, ⟨Ha, ⟨Hc, Ha⟩⟩⟩ - -#check λ (A B C : Prop), - assume (Ha : A) (Hb : B) (Hc : C), - show B ∧ A ∧ C ∧ A, from - ⟨Hb, Ha, Hc, Ha⟩ - -#check λ (A B C : Prop), - assume (Ha : A) (Hb : B) (Hc : C), - show ((B ∧ true) ∧ A) ∧ (C ∧ A), from - ⟨⟨⟨Hb, ⟨⟩⟩, Ha⟩, ⟨Hc, Ha⟩⟩ - -#check λ (A : Type u) (P : A → Prop) (Q : A → Prop), - assume (a : A), assume (H1 : P a) (H2 : Q a), - show ∃ x, P x ∧ Q x, from - ⟨a, ⟨H1, H2⟩⟩ - -#check λ (A : Type u) (P : A → Prop) (Q : A → Prop), - assume (a : A) (b : A), assume (H1 : P a) (H2 : Q b), - show ∃ x y, P x ∧ Q y, from - ⟨a, ⟨b, ⟨H1, H2⟩⟩⟩ - -#check λ (A : Type u) (P : A → Prop) (Q : A → Prop), - assume (a : A) (b : A), assume (H1 : P a) (H2 : Q b), - show ∃ x y, P x ∧ Q y, from - ⟨a, b, H1, H2⟩ diff --git a/old_tests/tests/lean/anc1.lean.expected.out b/old_tests/tests/lean/anc1.lean.expected.out deleted file mode 100644 index ae60f01479..0000000000 --- a/old_tests/tests/lean/anc1.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -(1, 2) : ℕ × ℕ -⟨trivial, trivial⟩ : true ∧ true -anc1.lean:5:0: warning: declaration '[anonymous]' uses sorry -⟨1, _⟩ : Σ' (x : ℕ), x > 0 -show true, from true.intro : true -Exists.intro 1 (id (λ (a : 1 = 0), nat.no_confusion a)) : ∃ (x : ℕ), 1 ≠ 0 -λ (A B C : Prop) (Ha : A) (Hb : B) (Hc : C), show B ∧ A, from ⟨Hb, Ha⟩ : - ∀ (A B C : Prop), A → B → C → B ∧ A -λ (A B C : Prop) (Ha : A) (Hb : B) (Hc : C), show B ∧ A ∧ C ∧ A, from ⟨Hb, ⟨Ha, ⟨Hc, Ha⟩⟩⟩ : - ∀ (A B C : Prop), A → B → C → B ∧ A ∧ C ∧ A -λ (A B C : Prop) (Ha : A) (Hb : B) (Hc : C), show B ∧ A ∧ C ∧ A, from ⟨Hb, ⟨Ha, ⟨Hc, Ha⟩⟩⟩ : - ∀ (A B C : Prop), A → B → C → B ∧ A ∧ C ∧ A -λ (A B C : Prop) (Ha : A) (Hb : B) (Hc : C), - show ((B ∧ true) ∧ A) ∧ C ∧ A, from ⟨⟨⟨Hb, true.intro⟩, Ha⟩, ⟨Hc, Ha⟩⟩ : - ∀ (A B C : Prop), A → B → C → ((B ∧ true) ∧ A) ∧ C ∧ A -λ (A : Type u) (P Q : A → Prop) (a : A) (H1 : P a) (H2 : Q a), - show ∃ (x : A), P x ∧ Q x, from Exists.intro a ⟨H1, H2⟩ : - ∀ (A : Type u) (P Q : A → Prop) (a : A), P a → Q a → (∃ (x : A), P x ∧ Q x) -λ (A : Type u) (P Q : A → Prop) (a b : A) (H1 : P a) (H2 : Q b), - show ∃ (x y : A), P x ∧ Q y, from Exists.intro a (Exists.intro b ⟨H1, H2⟩) : - ∀ (A : Type u) (P Q : A → Prop) (a b : A), P a → Q b → (∃ (x y : A), P x ∧ Q y) -λ (A : Type u) (P Q : A → Prop) (a b : A) (H1 : P a) (H2 : Q b), - show ∃ (x y : A), P x ∧ Q y, from Exists.intro a (Exists.intro b ⟨H1, H2⟩) : - ∀ (A : Type u) (P Q : A → Prop) (a b : A), P a → Q b → (∃ (x y : A), P x ∧ Q y) diff --git a/old_tests/tests/lean/andthen_focus_error_message.lean b/old_tests/tests/lean/andthen_focus_error_message.lean deleted file mode 100644 index 8a519c2bc5..0000000000 --- a/old_tests/tests/lean/andthen_focus_error_message.lean +++ /dev/null @@ -1,29 +0,0 @@ -lemma ex3 (a b c : nat) : a + 0 = 0 + a ∧ b = b := -begin - constructor ; [skip, skip, skip] - --^ The "insufficient number of goals" error message should be reported here. -end - -lemma ex4 (a b c : nat) : a + 0 = 0 + a ∧ b = b := -begin - constructor; [skip, skip, skip] ---^ Flycheck reports the error here if the `;` occurs immediately after the first tactic. --- This is not ideal, but this is a flycheck issue. Ther error is reported in the right place by Lean. -end - -lemma ex5 (a : nat) : a = a ∧ a = a := -begin - constructor ; [refl] - --^ "insufficient number of tactics" error -end - -lemma ex6 (a : nat) : a = a ∧ a = a := -begin - constructor ; [] - --^ "insufficient number of tactics" error -end - -lemma ex7 (a : nat) : a = a ∧ a = a := -begin - constructor ; [refl, refl] -end diff --git a/old_tests/tests/lean/andthen_focus_error_message.lean.expected.out b/old_tests/tests/lean/andthen_focus_error_message.lean.expected.out deleted file mode 100644 index 6189cb07a0..0000000000 --- a/old_tests/tests/lean/andthen_focus_error_message.lean.expected.out +++ /dev/null @@ -1,16 +0,0 @@ -andthen_focus_error_message.lean:3:14: error: focus tactic failed, insufficient number of goals -state: -a b c : ℕ -⊢ b = b -andthen_focus_error_message.lean:9:13: error: focus tactic failed, insufficient number of goals -state: -a b c : ℕ -⊢ b = b -andthen_focus_error_message.lean:16:14: error: focus tactic failed, insufficient number of tactics -state: -a : ℕ -⊢ a = a -andthen_focus_error_message.lean:22:14: error: focus tactic failed, insufficient number of tactics -state: -a : ℕ -⊢ a = a diff --git a/old_tests/tests/lean/apply_elim.lean b/old_tests/tests/lean/apply_elim.lean deleted file mode 100644 index 96269eb14d..0000000000 --- a/old_tests/tests/lean/apply_elim.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -def nat.ind_on {p : nat → Prop} (n : nat) (h₁ : p 0) (h₂ : ∀ n, p n → p (succ n)) : p n := -nat.rec_on n h₁ h₂ - -example : ∀ a b : nat, a + b = b + a := -begin - intro a, - apply nat.ind_on a, - trace_state, - repeat {admit} -end diff --git a/old_tests/tests/lean/apply_elim.lean.expected.out b/old_tests/tests/lean/apply_elim.lean.expected.out deleted file mode 100644 index 3ebb79e077..0000000000 --- a/old_tests/tests/lean/apply_elim.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -2 goals -a : ℕ -⊢ ∀ (b : ℕ), 0 + b = b + 0 - -a : ℕ -⊢ ∀ (n : ℕ), (∀ (b : ℕ), n + b = b + n) → ∀ (b : ℕ), succ n + b = b + succ n -apply_elim.lean:6:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/apply_tac.lean b/old_tests/tests/lean/apply_tac.lean deleted file mode 100644 index e93bb5a0e6..0000000000 --- a/old_tests/tests/lean/apply_tac.lean +++ /dev/null @@ -1,94 +0,0 @@ -example (a b c : nat) (h₁ : a = b) (h₂ : b = c) : a = c := -begin - apply eq.trans _ h₂, - -- the metavars created during elaboration become new goals - trace_state, - exact h₁ -end - -example (a : nat) : ∃ x, x = a := -begin - apply exists.intro, - -- the goal for the witness should occur "after" the goal for x = a - trace_state, - refl -end - -example (a : nat) : ∃ x, x = a := -begin - eapply exists.intro, - -- only metavars with out forward dependencies are added as goals. - trace_state, - refl -end - -example (a : nat) : ∃ x, x = a := -begin - fapply exists.intro, - -- all unassigned metavars are added as new goals using the order they were created. - trace_state, - exact a, - trace_state, - refl -end - -example {α : Type} [partial_order α] (a : α) : a = a := -begin - apply le_antisymm, - apply le_refl, - apply le_refl -end - -def f (a := 10) : ℕ := a + 1 - -def bla : nat := -begin - apply f -- uses opt_param for solving goal -end - -example : bla = 11 := -rfl - -open tactic - -lemma foo {a b c : nat} (h₁ : a = b) (h₂ : b = c . assumption) : a = c := -eq.trans h₁ h₂ - -example (a b c : nat) (h₁ : a = b) (h₂ : b = c) : a = c := -begin - apply @foo a b c h₁ -- uses auto_param for solving goal -end - -lemma my_div_self (a : nat) (h : a ≠ 0 . assumption) : a / a = 1 := -sorry - -example (a : nat) (h : a ≠ 0) : a / a = 1 := -begin - apply my_div_self -- uses auto_param for solving goal -end - -example (a b c : nat) (h₁ : a = b) (h₂ : b = c) : a = c := -begin - apply_with (@foo a b c h₁) {auto_param := ff}, - assumption -end - -example (a : nat) (h : a ≠ 0) : a / a = 1 := -begin - apply_with my_div_self {auto_param := ff}, - assumption -end - -example (a : nat) (h : a ≠ 0) : a / a = 1 := -begin - apply_with my_div_self {opt_param := ff} -- uses auto_param for solving goal -end - -def bla2 : nat := -begin - apply_with f {opt_param := ff}, - exact 20 -end - -example : bla2 = 21 := -rfl diff --git a/old_tests/tests/lean/apply_tac.lean.expected.out b/old_tests/tests/lean/apply_tac.lean.expected.out deleted file mode 100644 index 3911e0d2f8..0000000000 --- a/old_tests/tests/lean/apply_tac.lean.expected.out +++ /dev/null @@ -1,21 +0,0 @@ -a b c : ℕ, -h₁ : a = b, -h₂ : b = c -⊢ a = b -2 goals -a : ℕ -⊢ ?m_1 = a - -a : ℕ -⊢ ℕ -a : ℕ -⊢ ?m_1 = a -2 goals -a : ℕ -⊢ ℕ - -a : ℕ -⊢ ?m_1 = a -a : ℕ -⊢ a = a -apply_tac.lean:62:0: warning: declaration 'my_div_self' uses sorry diff --git a/old_tests/tests/lean/as_is_leak_bug.lean b/old_tests/tests/lean/as_is_leak_bug.lean deleted file mode 100644 index 0c51bede19..0000000000 --- a/old_tests/tests/lean/as_is_leak_bug.lean +++ /dev/null @@ -1,14 +0,0 @@ -section -set_option pp.annotations true -parameters {α : Type} [has_to_string α] -def f (a : α) : string := to_string a -def g := f -def g' := (f, α) -def h := (f, g, g', α) - -#print f -#print g -#print g' -#print h - -end diff --git a/old_tests/tests/lean/as_is_leak_bug.lean.expected.out b/old_tests/tests/lean/as_is_leak_bug.lean.expected.out deleted file mode 100644 index 074366fefc..0000000000 --- a/old_tests/tests/lean/as_is_leak_bug.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -def f : Π {α : Type} [_inst_1 : has_to_string α], α → string := -λ {α : Type} [_inst_1 : has_to_string α] (a : α), to_string a -def g : Π {α : Type} [_inst_1 : has_to_string α], α → string := -λ {α : Type} [_inst_1 : has_to_string α], f -def g' : Π {α : Type} [_inst_1 : has_to_string α], (α → string) × Type := -λ {α : Type} [_inst_1 : has_to_string α], (f, α) -def h : Π {α : Type} [_inst_1 : has_to_string α], (α → string) × (α → string) × ((α → string) × Type) × Type := -λ {α : Type} [_inst_1 : has_to_string α], (f, g, g', α) diff --git a/old_tests/tests/lean/as_pattern.lean b/old_tests/tests/lean/as_pattern.lean deleted file mode 100644 index bc6aede0a2..0000000000 --- a/old_tests/tests/lean/as_pattern.lean +++ /dev/null @@ -1,54 +0,0 @@ -namespace as_pattern -inductive foo -| a | b | c - -inductive bar : foo → Type -| a : bar foo.a -| b : bar foo.b - -def basic : list foo → list foo -| x@([_]) := x -- `@[` starts an attribute -| x@_ := x -#print prefix as_pattern.basic.equations - -def nested : list foo → list foo -| (x@foo.b :: _) := [x] -| x := x -#print prefix as_pattern.nested.equations - -def value : option ℕ → option ℕ -| (some x@2) := some x -| x := x -#print prefix as_pattern.value.equations - -def weird_but_ok : ℕ → ℕ -| x@y@z := x+y+z -#print prefix as_pattern.weird_but_ok.equations - -def too_many : ℕ → ℕ -| x@_ := x -| x@0 := x -| x@_ := x -| x := x - -def too_many2 : ℕ → ℕ -| x@x@0 := x -| x@x := x - -def dependent : Π (f : foo), bar f → foo -| x@foo.a bar.a := x -| x@_ bar.b := x -#print prefix as_pattern.dependent.equations - -section involved -universe variables u v -inductive imf {A : Type u} {B : Type v} (f : A → B) : B → Type (max 1 u v) -| mk : ∀ (a : A), imf (f a) - -definition inv_1 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| x@.(f w) y@(imf.mk z@.(f) w@a) := w -end involved - -def unicode : ℕ → ℕ -| n₁@_ := n₁ -end as_pattern diff --git a/old_tests/tests/lean/as_pattern.lean.expected.out b/old_tests/tests/lean/as_pattern.lean.expected.out deleted file mode 100644 index b9835b7f1a..0000000000 --- a/old_tests/tests/lean/as_pattern.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -as_pattern.basic.equations._eqn_1 : basic list.nil = list.nil -as_pattern.basic.equations._eqn_2 : ∀ (_x : foo), basic [_x] = [_x] -as_pattern.basic.equations._eqn_3 : ∀ (hd hd_1 : foo) (tl : list foo), basic (hd :: hd_1 :: tl) = hd :: hd_1 :: tl -as_pattern.nested.equations._eqn_1 : nested list.nil = list.nil -as_pattern.nested.equations._eqn_2 : ∀ (tl : list foo), nested (foo.a :: tl) = foo.a :: tl -as_pattern.nested.equations._eqn_3 : ∀ (_x : list foo), nested (foo.b :: _x) = [foo.b] -as_pattern.nested.equations._eqn_4 : ∀ (tl : list foo), nested (foo.c :: tl) = foo.c :: tl -as_pattern.value.equations._eqn_1 : value none = none -as_pattern.value.equations._eqn_2 : value (some 2) = some 2 -as_pattern.value.equations._eqn_3 : ∀ (val : ℕ), ¬val = 2 → value (some val) = some val -as_pattern.weird_but_ok.equations._eqn_1 : ∀ (z : ℕ), weird_but_ok z = z + z + z -as_pattern.lean:30:6: error: equation compiler error, equation #2 has not been used in the compilation, note that the left-hand-side of equation #1 is a variable -as_pattern.lean:31:6: error: equation compiler error, equation #3 has not been used in the compilation, note that the left-hand-side of equation #1 is a variable -as_pattern.lean:32:6: error: equation compiler error, equation #4 has not been used in the compilation, note that the left-hand-side of equation #1 is a variable -as_pattern.lean:35:4: error: invalid pattern, 'x' already appeared in this pattern -as_pattern.lean:36:4: error: invalid pattern, 'x' already appeared in this pattern -as_pattern.dependent.equations._eqn_1 : dependent foo.a bar.a = foo.a -as_pattern.dependent.equations._eqn_2 : dependent foo.b bar.b = foo.b diff --git a/old_tests/tests/lean/assert_tac3.lean b/old_tests/tests/lean/assert_tac3.lean deleted file mode 100644 index 98fde8c928..0000000000 --- a/old_tests/tests/lean/assert_tac3.lean +++ /dev/null @@ -1,25 +0,0 @@ -open tactic - -definition tst2 (a : nat) : a = a := -by do - define `x (expr.const `nat []), - rotate 1, - trace_state, - a ← get_local `a, - mk_app `eq.refl [a] >>= exact, - a ← get_local `a, - exact a, - return () - -#print tst2 - -definition tst3 (a b : nat) : a = a := -by do - define `x (expr.const `nat []), - rotate 1, - trace_state, - x ← get_local `x, - mk_app `eq.refl [x] >>= exact, - trace "-- second goal was indirectly solved by the previous tactic", - trace_state, - return () diff --git a/old_tests/tests/lean/assert_tac3.lean.expected.out b/old_tests/tests/lean/assert_tac3.lean.expected.out deleted file mode 100644 index 2136a65a82..0000000000 --- a/old_tests/tests/lean/assert_tac3.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -2 goals -a : ℕ, -x : ℕ := ?m_1 -⊢ a = a - -a : ℕ -⊢ ℕ -def tst2 : ∀ (a : ℕ), a = a := -λ (a : ℕ), let x : ℕ := a in eq.refl a -2 goals -a b : ℕ, -x : ℕ := ?m_1 -⊢ a = a - -a b : ℕ -⊢ ℕ --- second goal was indirectly solved by the previous tactic -no goals diff --git a/old_tests/tests/lean/assertion1.lean b/old_tests/tests/lean/assertion1.lean deleted file mode 100644 index 0622cd0b1c..0000000000 --- a/old_tests/tests/lean/assertion1.lean +++ /dev/null @@ -1,38 +0,0 @@ -universe variables u v - -structure Category := - (Obj : Type u) - (Hom : Obj → Obj → Type v) - -universe variables u1 v1 u2 v2 - -structure Functor (C : Category.{ u1 v1 }) (D : Category.{ u2 v2 }) := - (onObjects : C^.Obj → D^.Obj) - -@[reducible] definition ProductCategory (C : Category) (D : Category) : - Category := - { - Obj := C^.Obj × D^.Obj, - Hom := (λ X Y : C^.Obj × D^.Obj, C^.Hom (X^.fst) (Y^.fst) × D^.Hom (X^.snd) (Y^.snd)) - } - -namespace ProductCategory - notation C `×` D := ProductCategory C D -end ProductCategory - -@[reducible] definition TensorProduct ( C: Category ) := Functor ( C × C ) C - -structure MonoidalCategory - extends carrier : Category := - (tensor : TensorProduct carrier) - -instance MonoidalCategory_coercion : has_coe MonoidalCategory Category := - ⟨MonoidalCategory.carrier⟩ - --- Convenience methods which take two arguments, rather than a pair. (This seems to often help the elaborator avoid getting stuck on `prod.mk`.) -@[reducible] definition MonoidalCategory.tensorObjects { C : MonoidalCategory } ( X Y : C^.Obj ) : C^.Obj := C^.tensor^.onObjects (X, Y) - -definition tensor_on_left { C: MonoidalCategory.{u v} } ( Z: C^.Obj ) : Functor.{u v u v} C C := -{ - onObjects := λ X, C^.tensorObjects Z X -} diff --git a/old_tests/tests/lean/assertion1.lean.expected.out b/old_tests/tests/lean/assertion1.lean.expected.out deleted file mode 100644 index 2f31b707b2..0000000000 --- a/old_tests/tests/lean/assertion1.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -assertion1.lean:37:21: error: invalid field notation, function 'MonoidalCategory.tensorObjects' does not have explicit argument with type (MonoidalCategory ...) diff --git a/old_tests/tests/lean/assumption_tac_notation.lean b/old_tests/tests/lean/assumption_tac_notation.lean deleted file mode 100644 index 228257ba93..0000000000 --- a/old_tests/tests/lean/assumption_tac_notation.lean +++ /dev/null @@ -1,4 +0,0 @@ -example (A : Type) (a : A) : A := ‹A› -example (A : Type) (a : A) := ‹A› -example (A : Type) : A := ‹A› -example (A : Type) := ‹A› diff --git a/old_tests/tests/lean/assumption_tac_notation.lean.expected.out b/old_tests/tests/lean/assumption_tac_notation.lean.expected.out deleted file mode 100644 index 2b55cbe7bb..0000000000 --- a/old_tests/tests/lean/assumption_tac_notation.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -assumption_tac_notation.lean:3:26: error: assumption tactic failed -state: -A : Type -⊢ A -assumption_tac_notation.lean:4:22: error: assumption tactic failed -state: -A : Type -⊢ A diff --git a/old_tests/tests/lean/attribute_bug1.lean b/old_tests/tests/lean/attribute_bug1.lean deleted file mode 100644 index 242c0bf745..0000000000 --- a/old_tests/tests/lean/attribute_bug1.lean +++ /dev/null @@ -1,19 +0,0 @@ -open tactic - -constant f : nat → nat -constant fdef : ∀ n, f n = n + 1 - -example (n : nat) : f n = n + 1 := -by simp -- Failed as expected, since fdef is not marked as [simp] - -local attribute [simp] fdef - -example (n : nat) : f n = n + 1 := -by simp -- Succeeded as expected - -local attribute [-simp] fdef - -#print fdef -- we don't get the [simp] attribute when printing fdef - -example (n : nat) : f n = n + 1 := -by simp -- Failed as expected, since we removed [simp] attribute diff --git a/old_tests/tests/lean/attribute_bug1.lean.expected.out b/old_tests/tests/lean/attribute_bug1.lean.expected.out deleted file mode 100644 index 3a50dab17b..0000000000 --- a/old_tests/tests/lean/attribute_bug1.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -attribute_bug1.lean:7:3: error: simplify tactic failed to simplify -state: -n : ℕ -⊢ f n = n + 1 -constant fdef : ∀ (n : ℕ), f n = n + 1 -attribute_bug1.lean:19:3: error: simplify tactic failed to simplify -state: -n : ℕ -⊢ f n = n + 1 diff --git a/old_tests/tests/lean/attributes.lean b/old_tests/tests/lean/attributes.lean deleted file mode 100644 index 329e62201d..0000000000 --- a/old_tests/tests/lean/attributes.lean +++ /dev/null @@ -1,9 +0,0 @@ -universe variables u -definition foo (A : Type u) := A - -local attribute [reducible] foo -local attribute [-reducible] foo -- use [semireducible] instead - --- - -local attribute [-instance] nat.has_one diff --git a/old_tests/tests/lean/attributes.lean.expected.out b/old_tests/tests/lean/attributes.lean.expected.out deleted file mode 100644 index ab5ab01360..0000000000 --- a/old_tests/tests/lean/attributes.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -attributes.lean:5:0: error: cannot remove attribute [reducible] -attributes.lean:9:0: error: cannot remove attribute [instance] diff --git a/old_tests/tests/lean/auto_quote_error.lean b/old_tests/tests/lean/auto_quote_error.lean deleted file mode 100644 index ea2c2851cd..0000000000 --- a/old_tests/tests/lean/auto_quote_error.lean +++ /dev/null @@ -1,6 +0,0 @@ -example (a b c : nat) : a = b → b = c → c = a := -begin - intro h1, - intro h2, - exact eq.symm (eq.trans h1 _), -end diff --git a/old_tests/tests/lean/auto_quote_error.lean.expected.out b/old_tests/tests/lean/auto_quote_error.lean.expected.out deleted file mode 100644 index 60978bd456..0000000000 --- a/old_tests/tests/lean/auto_quote_error.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -auto_quote_error.lean:5:29: error: don't know how to synthesize placeholder -context: -a b c : ℕ, -h1 : a = b, -h2 : b = c -⊢ b = c -state: -a b c : ℕ, -h1 : a = b, -h2 : b = c -⊢ c = a diff --git a/old_tests/tests/lean/auto_quote_error2.lean b/old_tests/tests/lean/auto_quote_error2.lean deleted file mode 100644 index c177715843..0000000000 --- a/old_tests/tests/lean/auto_quote_error2.lean +++ /dev/null @@ -1,53 +0,0 @@ -example (a b c : nat) : a = b → b = c → c = a := -begin - tactic.intros, - apply eq.symm, - apply eq.refl, -- Error: unification - assumption, - assumption -end - -example (a b c : nat) : a = b → b = c → c = a := -begin - tactic.intros, - apply eq.symm, - begin - tactic.trace "hello world", - end, -- Error unsolved goals - assumption, - assumption -end - -example (a b c : nat) : a = b → b = c → c = a := -begin - tactic.intros, - apply eq.symm, - apply eq.trans, - begin - tactic.trace "hello world", - end, -- Error unsolved goals (remark: nested 'begin ... end' blocks focus on the main goal) - assumption -end - -example (a b c : nat) : a = b → b = c → c = a := -begin - intro h1, intro h2, - apply eq.symm, - begin - exact eq.trans h1 _, -- Error unsolved - end, -end - -example (a b : nat) : a = 0 → b = 0 → a = b ∧ b = a := -begin - intros h1 h2, - split, - { subst h1 }, - --^ error should be at `}` -end - -example : true := -begin - { have h' := eq.refl _ }, - --^ error should be at `}` -end diff --git a/old_tests/tests/lean/auto_quote_error2.lean.expected.out b/old_tests/tests/lean/auto_quote_error2.lean.expected.out deleted file mode 100644 index c3c5b0bf62..0000000000 --- a/old_tests/tests/lean/auto_quote_error2.lean.expected.out +++ /dev/null @@ -1,48 +0,0 @@ -auto_quote_error2.lean:5:2: error: invalid apply tactic, failed to unify - a = c -with - ?m_2 = ?m_2 -state: -a b c : ℕ, -a_1 : a = b, -a_2 : b = c -⊢ a = c -hello world -auto_quote_error2.lean:16:2: error: solve1 tactic failed, focused goal has not been solved -state: -a b c : ℕ, -a_1 : a = b, -a_2 : b = c -⊢ a = c -hello world -auto_quote_error2.lean:28:2: error: solve1 tactic failed, focused goal has not been solved -state: -a b c : ℕ, -a_1 : a = b, -a_2 : b = c -⊢ a = ?m_1 -auto_quote_error2.lean:37:22: error: don't know how to synthesize placeholder -context: -a b c : ℕ, -h1 : a = b, -h2 : b = c -⊢ b = c -state: -a b c : ℕ, -h1 : a = b, -h2 : b = c -⊢ a = c -auto_quote_error2.lean:45:14: error: solve1 tactic failed, focused goal has not been solved -state: -b : ℕ, -h2 : b = 0 -⊢ 0 = b -auto_quote_error2.lean:51:25: error: solve1 tactic failed, focused goal has not been solved -state: -3 goals -h' : ?m_2 = ?m_2 -⊢ true - -⊢ Sort ? - -⊢ ?m_1 diff --git a/old_tests/tests/lean/aux_decl_zeta.lean b/old_tests/tests/lean/aux_decl_zeta.lean deleted file mode 100644 index b456cff8b5..0000000000 --- a/old_tests/tests/lean/aux_decl_zeta.lean +++ /dev/null @@ -1,22 +0,0 @@ -inductive vec (A : Sort*) : nat → Sort* -| nil : vec 0 -| cons : Π {n}, A → vec n → vec (n+1) - -definition f : bool → Prop -| x := - let m := 10, - n := m in - match x with - | tt := true - | ff := ∀ (x : vec nat 10) (w : vec nat n), x = w - end - -set_option eqn_compiler.zeta true -definition g : bool → Prop -| x := - let m := 10, - n := m in - match x with - | tt := true - | ff := ∀ (x : vec nat 10) (w : vec nat n), x = w - end diff --git a/old_tests/tests/lean/aux_decl_zeta.lean.expected.out b/old_tests/tests/lean/aux_decl_zeta.lean.expected.out deleted file mode 100644 index 7382fbffeb..0000000000 --- a/old_tests/tests/lean/aux_decl_zeta.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -aux_decl_zeta.lean:11:48: error: equation compiler failed to create auxiliary declaration 'f._match_1', auxiliary declaration has references to let-declarations (possible solution: use 'set_option eqn_compiler.zeta true') -nested exception message: -type mismatch at application - x = w -term - w -has type - vec ℕ n -but is expected to have type - vec ℕ 10 diff --git a/old_tests/tests/lean/bad_end.lean b/old_tests/tests/lean/bad_end.lean deleted file mode 100644 index afdac78d10..0000000000 --- a/old_tests/tests/lean/bad_end.lean +++ /dev/null @@ -1 +0,0 @@ -end foo diff --git a/old_tests/tests/lean/bad_end.lean.expected.out b/old_tests/tests/lean/bad_end.lean.expected.out deleted file mode 100644 index ca70fde287..0000000000 --- a/old_tests/tests/lean/bad_end.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -bad_end.lean:1:0: error: invalid 'end', there is no open namespace/section diff --git a/old_tests/tests/lean/bad_end_error_pos.lean b/old_tests/tests/lean/bad_end_error_pos.lean deleted file mode 100644 index 4d495c50d8..0000000000 --- a/old_tests/tests/lean/bad_end_error_pos.lean +++ /dev/null @@ -1,13 +0,0 @@ -example (a b c : nat) (f : nat → nat) : f (a + b + c) = f (b + c + a) := -by ac_refl - -example (a b c : nat) (f : nat → nat) : f (a + b + (c * b * a)) = f (b + (a * c * b) + a) := -by ac_refl - -end - -example (a b c : nat) (f : nat → nat → nat) : f (b * c) (c * b * a) = f (c * b) (a * c * b) := -by ac_refl - -example (a b c : nat) (f : nat → nat) : f (a + (b * c) + (c * b * a)) = f ((c * b) + (a * c * b) + a) := -by ac_refl diff --git a/old_tests/tests/lean/bad_end_error_pos.lean.expected.out b/old_tests/tests/lean/bad_end_error_pos.lean.expected.out deleted file mode 100644 index 01ad8e6202..0000000000 --- a/old_tests/tests/lean/bad_end_error_pos.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -bad_end_error_pos.lean:7:0: error: invalid 'end', there is no open namespace/section diff --git a/old_tests/tests/lean/bad_error1.lean b/old_tests/tests/lean/bad_error1.lean deleted file mode 100644 index 07ff05714c..0000000000 --- a/old_tests/tests/lean/bad_error1.lean +++ /dev/null @@ -1,4 +0,0 @@ -open nat - -protected lemma bit0_ne_bit1 : ∀ (n m : ℕ), bit0 n ≠ bit1 m := -λ n m : nat, ne.symm (nat.bit1_ne_bit0 n m) diff --git a/old_tests/tests/lean/bad_error1.lean.expected.out b/old_tests/tests/lean/bad_error1.lean.expected.out deleted file mode 100644 index 05e95b2343..0000000000 --- a/old_tests/tests/lean/bad_error1.lean.expected.out +++ /dev/null @@ -1,20 +0,0 @@ -bad_error1.lean:4:22: error: unexpected argument at application - nat.bit1_ne_bit0 n -given argument - n -expected argument - m -bad_error1.lean:4:22: error: unexpected argument at application - nat.bit1_ne_bit0 n m -given argument - m -expected argument - n -bad_error1.lean:4:13: error: type mismatch at application - ne.symm (nat.bit1_ne_bit0 n m) -term - nat.bit1_ne_bit0 n m -has type - bit1 n ≠ bit0 m -but is expected to have type - bit1 m ≠ bit0 n diff --git a/old_tests/tests/lean/bad_error2.lean b/old_tests/tests/lean/bad_error2.lean deleted file mode 100644 index f0f6afa860..0000000000 --- a/old_tests/tests/lean/bad_error2.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -example {k n m : ℕ} (h : k + n ≤ k + m) : n ≤ m := -match le.dest h with -| ⟨w, hw⟩ := @le.intro _ _ w - begin - -- hw is beta reduced after we added the equation compiler preprocessor. - -- So, this test is not really relevant anymore. - rw [nat.add_assoc] at hw, - apply nat.add_left_cancel hw - end -end diff --git a/old_tests/tests/lean/bad_error2.lean.expected.out b/old_tests/tests/lean/bad_error2.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/bad_error3.lean b/old_tests/tests/lean/bad_error3.lean deleted file mode 100644 index fe7dc8ee67..0000000000 --- a/old_tests/tests/lean/bad_error3.lean +++ /dev/null @@ -1,7 +0,0 @@ -example (p : nat → nat → Prop) : p 0 := -begin -end - -def ex (p : nat → nat → Prop) : p 0 := -begin -end diff --git a/old_tests/tests/lean/bad_error3.lean.expected.out b/old_tests/tests/lean/bad_error3.lean.expected.out deleted file mode 100644 index aabbd0ff36..0000000000 --- a/old_tests/tests/lean/bad_error3.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -bad_error3.lean:1:33: error: type expected at - p 0 -term has type - ℕ → Prop -bad_error3.lean:5:32: error: type expected at - p 0 -term has type - ℕ → Prop diff --git a/old_tests/tests/lean/bad_error4.lean b/old_tests/tests/lean/bad_error4.lean deleted file mode 100644 index 5569189f20..0000000000 --- a/old_tests/tests/lean/bad_error4.lean +++ /dev/null @@ -1,5 +0,0 @@ -structure foo := -(f: unit -> unit) - -definition bar : foo := -{ f := λ a b, _ } diff --git a/old_tests/tests/lean/bad_error4.lean.expected.out b/old_tests/tests/lean/bad_error4.lean.expected.out deleted file mode 100644 index c2bedada18..0000000000 --- a/old_tests/tests/lean/bad_error4.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -bad_error4.lean:5:7: error: type mismatch at field 'f' - λ (a : unit) (b : ?m_1[a]), ?m_2[a, b] -has type - Π (a : unit) (b : ?m_1[a]), ?m_2[a, b] -but is expected to have type - unit → unit diff --git a/old_tests/tests/lean/bad_error5.lean b/old_tests/tests/lean/bad_error5.lean deleted file mode 100644 index 13a5f18fe5..0000000000 --- a/old_tests/tests/lean/bad_error5.lean +++ /dev/null @@ -1,13 +0,0 @@ -structure S := - (α : Type) - (β : unit) - -structure T (c : S) - -structure U (c: S) (A : c^.α) - -definition V (c : S) : S := -{ - α := T c, - β := by sorry -} diff --git a/old_tests/tests/lean/bad_error5.lean.expected.out b/old_tests/tests/lean/bad_error5.lean.expected.out deleted file mode 100644 index 29529c20d9..0000000000 --- a/old_tests/tests/lean/bad_error5.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -bad_error5.lean:9:0: warning: declaration 'V' uses sorry diff --git a/old_tests/tests/lean/bad_id.lean b/old_tests/tests/lean/bad_id.lean deleted file mode 100644 index 9a7239a0b5..0000000000 --- a/old_tests/tests/lean/bad_id.lean +++ /dev/null @@ -1,5 +0,0 @@ --- - -definition x.y : nat := 10 - -definition x.1 :nat := 10 diff --git a/old_tests/tests/lean/bad_id.lean.expected.out b/old_tests/tests/lean/bad_id.lean.expected.out deleted file mode 100644 index 2d5c6828b4..0000000000 --- a/old_tests/tests/lean/bad_id.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -bad_id.lean:5:12: error: invalid definition, '|' or ':=' expected -bad_id.lean:5:11: error: don't know how to synthesize placeholder -context: -⊢ Sort ? -bad_id.lean:5:12: error: command expected diff --git a/old_tests/tests/lean/bad_inaccessible.lean b/old_tests/tests/lean/bad_inaccessible.lean deleted file mode 100644 index 0450738da8..0000000000 --- a/old_tests/tests/lean/bad_inaccessible.lean +++ /dev/null @@ -1,15 +0,0 @@ --- These definitions can be processed by the new equation compiler without producing errors. -universe variables u -definition f1 : nat → nat → nat -| a .(a) := a - -definition f2 : ∀ (a b c : nat), a = c → c = a -| a b .(b) rfl := rfl - -inductive vec (A : Type u) : nat → Type (max 1 u) -| nil {} : vec 0 -| cons : Π {n}, A → vec n → vec (n+1) - -definition foo (A : Type u) (f : A → A → A) : Π {n}, vec A n → vec A n → vec A n -| ._ vec.nil vec.nil := vec.nil -| ._ (vec.cons a₁ l₁) (vec.cons a₂ l₂) := vec.cons (f a₁ a₂) (foo l₁ l₂) diff --git a/old_tests/tests/lean/bad_inaccessible.lean.expected.out b/old_tests/tests/lean/bad_inaccessible.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/bad_inaccessible2.lean b/old_tests/tests/lean/bad_inaccessible2.lean deleted file mode 100644 index f4147a47ba..0000000000 --- a/old_tests/tests/lean/bad_inaccessible2.lean +++ /dev/null @@ -1,21 +0,0 @@ -universe variables u -inductive vec (A : Type u) : nat → Type (max 1 u) -| nil {} : vec 0 -| cons : Π {n}, A → vec n → vec (n+1) - -open vec - -variables {A : Type u} -variables f : A → A → A - -/- The new equation compiler can process this example. - So, this is not a test about error messages anymore. --/ -def map_head : ∀ {n}, vec A n → vec A n → vec A n -| .(0) nil nil := nil -| .(n+1) (@cons .(A) .(n) a va) (@cons .(A) n b vb) := cons (f a b) va - -/- The following shorter version is also accepted. -/ -def map_head2 : ∀ {n}, vec A n → vec A n → vec A n -| _ nil nil := nil -| _ (cons a va) (cons b vb) := cons (f a b) va diff --git a/old_tests/tests/lean/bad_inaccessible2.lean.expected.out b/old_tests/tests/lean/bad_inaccessible2.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/bad_index.lean b/old_tests/tests/lean/bad_index.lean deleted file mode 100644 index 9d46300ef5..0000000000 --- a/old_tests/tests/lean/bad_index.lean +++ /dev/null @@ -1,5 +0,0 @@ -inductive foo1 : Type -> Type -| mk : foo1 (list (foo1 punit)) -> foo1 (list (foo1 punit)) - -inductive foo2 : Type -> Type -| mk : foo2 (foo2 punit) -> foo2 (foo2 punit) diff --git a/old_tests/tests/lean/bad_index.lean.expected.out b/old_tests/tests/lean/bad_index.lean.expected.out deleted file mode 100644 index b5455eaa23..0000000000 --- a/old_tests/tests/lean/bad_index.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -bad_index.lean:1:0: error: arg #1 of 'foo1.mk' contains a non valid occurrence of the datatypes being declared -bad_index.lean:4:0: error: arg #1 of 'foo2.mk' contains a non valid occurrence of the datatypes being declared diff --git a/old_tests/tests/lean/bad_notation.lean b/old_tests/tests/lean/bad_notation.lean deleted file mode 100644 index f4490679cc..0000000000 --- a/old_tests/tests/lean/bad_notation.lean +++ /dev/null @@ -1,9 +0,0 @@ --- -open nat - -section - variable a : nat - notation `a1`:max := a + 1 -end - -definition foo := a1 diff --git a/old_tests/tests/lean/bad_notation.lean.expected.out b/old_tests/tests/lean/bad_notation.lean.expected.out deleted file mode 100644 index 91858dfa53..0000000000 --- a/old_tests/tests/lean/bad_notation.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -bad_notation.lean:6:23: error: invalid notation declaration, contains reference to local variables -bad_notation.lean:9:18: error: unknown identifier 'a1' -bad_notation.lean:9:11: error: don't know how to synthesize placeholder -context: -⊢ Sort ? diff --git a/old_tests/tests/lean/bad_open.lean b/old_tests/tests/lean/bad_open.lean deleted file mode 100644 index b846d30f5d..0000000000 --- a/old_tests/tests/lean/bad_open.lean +++ /dev/null @@ -1 +0,0 @@ -open "nat" diff --git a/old_tests/tests/lean/bad_open.lean.expected.out b/old_tests/tests/lean/bad_open.lean.expected.out deleted file mode 100644 index 10f2607e19..0000000000 --- a/old_tests/tests/lean/bad_open.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -bad_open.lean:1:5: error: invalid 'open/export' command, identifier expected -bad_open.lean:1:5: error: invalid namespace name '_' diff --git a/old_tests/tests/lean/bad_pattern2.lean b/old_tests/tests/lean/bad_pattern2.lean deleted file mode 100644 index c3488d3251..0000000000 --- a/old_tests/tests/lean/bad_pattern2.lean +++ /dev/null @@ -1,2 +0,0 @@ -definition foo : nat → nat -| bla.boo := bla.boo diff --git a/old_tests/tests/lean/bad_pattern2.lean.expected.out b/old_tests/tests/lean/bad_pattern2.lean.expected.out deleted file mode 100644 index 3457b87bff..0000000000 --- a/old_tests/tests/lean/bad_pattern2.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -bad_pattern2.lean:2:2: error: invalid pattern: variable, constructor or constant tagged as pattern expected -bad_pattern2.lean:2:13: error: unknown identifier 'bla.boo' -bad_pattern2.lean:2:2: error: type mismatch at application - foo bla.boo -term - bla.boo -has type - _ -but is expected to have type - ℕ -bad_pattern2.lean:2:10: error: ill-formed match/equation expression diff --git a/old_tests/tests/lean/bad_print.lean b/old_tests/tests/lean/bad_print.lean deleted file mode 100644 index b66b451600..0000000000 --- a/old_tests/tests/lean/bad_print.lean +++ /dev/null @@ -1,9 +0,0 @@ -constant boo : nat - -#print definition boo - -#print 2 - -#print fields nat - -#print nat.addd \ No newline at end of file diff --git a/old_tests/tests/lean/bad_print.lean.expected.out b/old_tests/tests/lean/bad_print.lean.expected.out deleted file mode 100644 index 306f13d3a5..0000000000 --- a/old_tests/tests/lean/bad_print.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -bad_print.lean:3:18: error: invalid '#print definition', 'boo' is not a definition -bad_print.lean:5:7: error: invalid #print command -bad_print.lean:7:14: error: invalid '#print fields' command, 'nat' is not a structure -bad_print.lean:9:15: error: unknown identifier nat.addd diff --git a/old_tests/tests/lean/bad_quoted_symbol.lean b/old_tests/tests/lean/bad_quoted_symbol.lean deleted file mode 100644 index a75c825d3e..0000000000 --- a/old_tests/tests/lean/bad_quoted_symbol.lean +++ /dev/null @@ -1,5 +0,0 @@ -notation a ` \/ ` b := a ∨ b -notation a `1\/` b := a ∨ b -notation a ` 1\/` b := a ∨ b -notation a ` \ / ` b := a ∨ b -notation a ` ` b := a ∨ b diff --git a/old_tests/tests/lean/bad_quoted_symbol.lean.expected.out b/old_tests/tests/lean/bad_quoted_symbol.lean.expected.out deleted file mode 100644 index 0e76c9c665..0000000000 --- a/old_tests/tests/lean/bad_quoted_symbol.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -bad_quoted_symbol.lean:2:13: error: first character of a quoted symbols cannot be a digit -bad_quoted_symbol.lean:3:14: error: first character of a quoted symbols cannot be a digit -bad_quoted_symbol.lean:4:16: error: unexpected space inside of quoted symbol -bad_quoted_symbol.lean:5:14: error: unexpected end of quoted symbol diff --git a/old_tests/tests/lean/bad_set_option.lean b/old_tests/tests/lean/bad_set_option.lean deleted file mode 100644 index b65e023626..0000000000 --- a/old_tests/tests/lean/bad_set_option.lean +++ /dev/null @@ -1,3 +0,0 @@ -set_option boo true - -set_option pp.unicode a diff --git a/old_tests/tests/lean/bad_set_option.lean.expected.out b/old_tests/tests/lean/bad_set_option.lean.expected.out deleted file mode 100644 index 78ce16f5d7..0000000000 --- a/old_tests/tests/lean/bad_set_option.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -bad_set_option.lean:1:11: error: unknown option 'boo', type 'help options.' for list of available options -bad_set_option.lean:3:22: error: invalid Boolean option value, 'true' or 'false' expected diff --git a/old_tests/tests/lean/bad_structures.lean b/old_tests/tests/lean/bad_structures.lean deleted file mode 100644 index f0aeab7cce..0000000000 --- a/old_tests/tests/lean/bad_structures.lean +++ /dev/null @@ -1,12 +0,0 @@ -prelude namespace foo structure {l} prod (A : Sort l) (B : Sort l) := -(pr1 : A) (pr2 : B) - -structure {l} prod1 (A : Sort l) (B : Sort l) : Type := -(pr1 : A) (pr2 : B) - -structure {l} prod2 (A : Sort l) (B : Sort l) : Sort l := -(pr1 : A) (pr2 : B) - -structure {l} prod3 (A : Sort l) (B : Sort l) : Sort (max 1 l) := -(pr1 : A) (pr2 : B) -end foo diff --git a/old_tests/tests/lean/bad_structures.lean.expected.out b/old_tests/tests/lean/bad_structures.lean.expected.out deleted file mode 100644 index 24dfaffb2c..0000000000 --- a/old_tests/tests/lean/bad_structures.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -bad_structures.lean:4:0: error: universe level of type_of(arg #3) of 'foo.prod1.mk' is too big for the corresponding inductive datatype -bad_structures.lean:7:55: error: invalid universe polymorphic structure declaration, the resultant universe is not Prop (i.e., 0), but it may be Prop for some parameter values (solution: use 'l+1' or 'max 1 l') diff --git a/old_tests/tests/lean/bad_structures2.lean b/old_tests/tests/lean/bad_structures2.lean deleted file mode 100644 index 66d3f4b997..0000000000 --- a/old_tests/tests/lean/bad_structures2.lean +++ /dev/null @@ -1,32 +0,0 @@ -structure foo := -(x : bool) - -structure boo := -(x : nat) - -structure bla extends foo, boo - -structure boo2 := -{x : bool} - -structure bla extends foo, boo2 - -structure bla extends foo := -(x : nat) - -structure bla extends foo := -( : nat) - -structure bla extends foo := -mk :: y z : nat - -structure bla2 extends nat - -structure bla2 extends Type - - -structure bla2 : Prop := -(x : Prop) - -structure bla3 : Prop := -(x : nat) diff --git a/old_tests/tests/lean/bad_structures2.lean.expected.out b/old_tests/tests/lean/bad_structures2.lean.expected.out deleted file mode 100644 index a007cfec98..0000000000 --- a/old_tests/tests/lean/bad_structures2.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -bad_structures2.lean:7:27: error: invalid 'structure' header, field 'x' from 'boo' has already been declared -bad_structures2.lean:12:27: error: invalid 'structure' header, field 'x' from 'boo2' has already been declared -bad_structures2.lean:15:1: error: field 'x' has been declared in parent structure -bad_structures2.lean:18:2: error: invalid field, identifier expected -bad_structures2.lean:21:6: error: command expected -bad_structures2.lean:23:23: error: invalid 'structure' extends, 'nat' is not a structure -bad_structures2.lean:25:23: error: invalid 'structure', expression must be a 'parent' structure -bad_structures2.lean:28:0: error: failed to generate projection 'bla2.x' for 'bla2', type is an inductive predicate, but field is not a proposition -bad_structures2.lean:31:0: error: failed to generate projection 'bla3.x' for 'bla3', type is an inductive predicate, but field is not a proposition diff --git a/old_tests/tests/lean/bad_unification_hint.lean b/old_tests/tests/lean/bad_unification_hint.lean deleted file mode 100644 index 8720444b54..0000000000 --- a/old_tests/tests/lean/bad_unification_hint.lean +++ /dev/null @@ -1,14 +0,0 @@ --- Good hint -@[unify] def {u} cons_append_hint (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint := -{ pattern := (a :: l₁) ++ l₂ =?= b :: l₃, - constraints := [l₃ =?= l₁ ++ l₂, a =?= b] } - --- Bad hint: pattern is incorrect -@[unify] def {u} append_cons_hint (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint := -{ pattern := l₁ ++ (a :: l₂) =?= b :: l₃, - constraints := [l₃ =?= l₁ ++ l₂, a =?= b] } - --- Bad hint: constraint #1 is incorrect -@[unify] def {u} cons_append_hint' (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint := -{ pattern := (a :: l₁) ++ l₂ =?= b :: l₃, - constraints := [l₃ =?= l₁ ++ l₃, a =?= b] } diff --git a/old_tests/tests/lean/bad_unification_hint.lean.expected.out b/old_tests/tests/lean/bad_unification_hint.lean.expected.out deleted file mode 100644 index 3ef588db90..0000000000 --- a/old_tests/tests/lean/bad_unification_hint.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -bad_unification_hint.lean:7:13: error: invalid unification hint, failed to unify pattern after unifying constraints -bad_unification_hint.lean:12:13: error: invalid unification hint, failed to unify constraint #1 diff --git a/old_tests/tests/lean/begin_end_bug.lean b/old_tests/tests/lean/begin_end_bug.lean deleted file mode 100644 index df3a2299b1..0000000000 --- a/old_tests/tests/lean/begin_end_bug.lean +++ /dev/null @@ -1,8 +0,0 @@ -example (a b c : nat) : a = b → a = c → b = c := -assume hab hac, -have b = a, begin trace a, symmetry, assumption end, -begin - transitivity, - exact this, - exact hac -end diff --git a/old_tests/tests/lean/begin_end_bug.lean.expected.out b/old_tests/tests/lean/begin_end_bug.lean.expected.out deleted file mode 100644 index 59fa19bdbf..0000000000 --- a/old_tests/tests/lean/begin_end_bug.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -begin_end_bug.lean:3:24: error: unknown identifier 'a' -begin_end_bug.lean:3:18: error: don't know how to synthesize placeholder -context: -a b c : ℕ, -hab : a = b, -hac : a = c -⊢ Type diff --git a/old_tests/tests/lean/bug1.lean b/old_tests/tests/lean/bug1.lean deleted file mode 100644 index 55bb23ab28..0000000000 --- a/old_tests/tests/lean/bug1.lean +++ /dev/null @@ -1,23 +0,0 @@ -prelude definition bool : Type := Sort 0 -definition and (p q : bool) : bool := ∀ c : bool, (p → q → c) → c -infixl ` ∧ `:25 := and - -constant a : bool - --- Error -theorem and_intro1 (p q : bool) (H1 : p) (H2 : q) : a -:= fun (c : bool) (H : p -> q -> c), H H1 H2 - --- Error -theorem and_intro2 (p q : bool) (H1 : p) (H2 : q) : p ∧ p -:= fun (c : bool) (H : p -> q -> c), H H1 H2 - --- Error -theorem and_intro3 (p q : bool) (H1 : p) (H2 : q) : q ∧ p -:= fun (c : bool) (H : p -> q -> c), H H1 H2 - --- Correct -theorem and_intro4 (p q : bool) (H1 : p) (H2 : q) : p ∧ q -:= fun (c : bool) (H : p -> q -> c), H H1 H2 - -#check and_intro4 diff --git a/old_tests/tests/lean/bug1.lean.expected.out b/old_tests/tests/lean/bug1.lean.expected.out deleted file mode 100644 index f547d766dc..0000000000 --- a/old_tests/tests/lean/bug1.lean.expected.out +++ /dev/null @@ -1,19 +0,0 @@ -bug1.lean:9:3: error: type mismatch, term - λ (c : bool) (H : p → q → c), H H1 H2 -has type - ∀ (c : bool), (p → q → c) → c -but is expected to have type - a -bug1.lean:13:3: error: type mismatch, term - λ (c : bool) (H : p → q → c), H H1 H2 -has type - ∀ (c : bool), (p → q → c) → c -but is expected to have type - p ∧ p -bug1.lean:17:3: error: type mismatch, term - λ (c : bool) (H : p → q → c), H H1 H2 -has type - ∀ (c : bool), (p → q → c) → c -but is expected to have type - q ∧ p -and_intro4 : ∀ (p q : bool), p → q → p ∧ q diff --git a/old_tests/tests/lean/by_contradiction.lean b/old_tests/tests/lean/by_contradiction.lean deleted file mode 100644 index 7d216cbe51..0000000000 --- a/old_tests/tests/lean/by_contradiction.lean +++ /dev/null @@ -1,36 +0,0 @@ -open tactic nat - -example (a b : nat) : a ≠ b → ¬ a = b := -by do - intros, - by_contradiction `H, - trace_state, - contradiction - -#print "-------" - -example (a b : nat) : ¬¬ a = b → a = b := -by do - intros, - by_contradiction `H, - trace_state, - contradiction - -#print "-------" - -example (p q : Prop) : ¬¬ p → p := -by do - intros, - by_contradiction `H, -- should fail - trace_state - -#print "-------" - -local attribute [instance] classical.prop_decidable -- Now all propositions are decidable - -example (p q : Prop) : ¬¬p → p := -by do - intros, - by_contradiction `H, - trace_state, - contradiction diff --git a/old_tests/tests/lean/by_contradiction.lean.expected.out b/old_tests/tests/lean/by_contradiction.lean.expected.out deleted file mode 100644 index bbbe8b0a40..0000000000 --- a/old_tests/tests/lean/by_contradiction.lean.expected.out +++ /dev/null @@ -1,20 +0,0 @@ -a b : ℕ, -a_1 : a ≠ b, -H : a = b -⊢ false -------- -a b : ℕ, -a_1 : ¬¬a = b, -H : ¬a = b -⊢ false -------- -by_contradiction.lean:22:3: error: tactic by_contradiction failed, target is not a negation nor a decidable proposition (remark: when 'local attribute classical.prop_decidable [instance]' is used all propositions are decidable) -state: -p q : Prop, -a : ¬¬p -⊢ p -------- -p q : Prop, -a : ¬¬p, -H : ¬p -⊢ false diff --git a/old_tests/tests/lean/caching_user_attribute.lean b/old_tests/tests/lean/caching_user_attribute.lean deleted file mode 100644 index b5459dc53b..0000000000 --- a/old_tests/tests/lean/caching_user_attribute.lean +++ /dev/null @@ -1,22 +0,0 @@ -@[user_attribute] -meta def foo_attr : user_attribute string := -{ name := `foo, descr := "bar", - cache_cfg := { - mk_cache := λ ns, return $ string.join (list.map (λ n, to_string n ++ "\n") ns), - dependencies := []} } - -attribute [foo] eq.refl eq.mp - -set_option trace.user_attributes_cache true - -run_cmd do - s : string ← foo_attr.get_cache, - tactic.trace s, - s : string ← foo_attr.get_cache, - tactic.trace s, - foo_attr.set `eq.mpr () tt, - s : string ← foo_attr.get_cache, - tactic.trace s, - tactic.set_basic_attribute `reducible ``eq.mp, -- should not affect [foo] cache - s : string ← foo_attr.get_cache, - tactic.trace s diff --git a/old_tests/tests/lean/caching_user_attribute.lean.expected.out b/old_tests/tests/lean/caching_user_attribute.lean.expected.out deleted file mode 100644 index b09f771e61..0000000000 --- a/old_tests/tests/lean/caching_user_attribute.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -[user_attributes_cache] no cached result for [foo] -[user_attributes_cache] recomputing cache for [foo] -eq.mp -eq.refl - -eq.mp -eq.refl - -[user_attributes_cache] cached result for [foo] has been found, but cache fingerprint does not match -[user_attributes_cache] recomputing cache for [foo] -eq.mpr -eq.mp -eq.refl - -eq.mpr -eq.mp -eq.refl - diff --git a/old_tests/tests/lean/calc1.lean b/old_tests/tests/lean/calc1.lean deleted file mode 100644 index ca10125e06..0000000000 --- a/old_tests/tests/lean/calc1.lean +++ /dev/null @@ -1,49 +0,0 @@ -prelude constant A : Type.{1} -definition bool : Type.{1} := Type.{0} -constant eq : A → A → bool -infixl ` = `:50 := eq -axiom subst (P : A → bool) (a b : A) (H1 : a = b) (H2 : P a) : P b -axiom eq_trans (a b c : A) (H1 : a = b) (H2 : b = c) : a = c -axiom eq_refl (a : A) : a = a -constant le : A → A → bool -infixl ` ≤ `:50 := le -axiom le_trans (a b c : A) (H1 : a ≤ b) (H2 : b ≤ c) : a ≤ c -axiom le_refl (a : A) : a ≤ a -axiom eq_le_trans (a b c : A) (H1 : a = b) (H2 : b ≤ c) : a ≤ c -axiom le_eq_trans (a b c : A) (H1 : a ≤ b) (H2 : b = c) : a ≤ c -attribute [subst] subst -attribute [refl] eq_refl -attribute [refl] le_refl -attribute [trans] eq_trans -attribute [trans] le_trans -attribute [trans] eq_le_trans -attribute [trans] le_eq_trans -constants a b c d e f : A -axiom H1 : a = b -axiom H2 : b ≤ c -axiom H3 : c ≤ d -axiom H4 : d = e -#check calc a = b : H1 - ... ≤ c : H2 - ... ≤ d : H3 - ... = e : H4 - -constant lt : A → A → bool -infixl ` < `:50 := lt -axiom lt_trans (a b c : A) (H1 : a < b) (H2 : b < c) : a < c -axiom le_lt_trans (a b c : A) (H1 : a ≤ b) (H2 : b < c) : a < c -axiom lt_le_trans (a b c : A) (H1 : a < b) (H2 : b ≤ c) : a < c -axiom H5 : c < d --- #check calc b ≤ c : H2 --- ... < d : H5 -- Error le_lt_trans was not registered yet -attribute [trans] le_lt_trans -#check calc b ≤ c : H2 - ... < d : H5 - -constant le2 : A → A → bool -infixl ` ≤ `:50 := le2 -constant le2_trans (a b c : A) (H1 : le2 a b) (H2 : le2 b c) : le2 a c -attribute [trans] le2_trans --- print raw calc b ≤ c : H2 --- ... ≤ d : H3 --- ... ≤ e : H4 diff --git a/old_tests/tests/lean/calc1.lean.expected.out b/old_tests/tests/lean/calc1.lean.expected.out deleted file mode 100644 index 55fa91adf9..0000000000 --- a/old_tests/tests/lean/calc1.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -le_eq_trans a d e (le_trans a c d (eq_le_trans a b c H1 H2) H3) H4 : a ≤ e -le_lt_trans b c d H2 H5 : b < d diff --git a/old_tests/tests/lean/case.lean b/old_tests/tests/lean/case.lean deleted file mode 100644 index f96715e88e..0000000000 --- a/old_tests/tests/lean/case.lean +++ /dev/null @@ -1,34 +0,0 @@ -example (xs : list ℕ) : ℕ := -begin - induction xs, - case list.cons {} -end - -example (xs : list ℕ) : ℕ := -begin - cases xs, - case list.cons {} -end - -example (xs : list ℕ) : ℕ := -begin - induction xs, - case list.cons : x xs { - cases xs, - case list.cons : x xs {} - } -end - -open list -example (xs : list ℕ) : ℕ := -begin - induction xs, - case cons {} -end - -example (xs : list ℕ) : ℕ := -begin - induction xs, - case list.cons : x xs ih { apply ih }, - case list.nil { apply 0 } -end diff --git a/old_tests/tests/lean/case.lean.expected.out b/old_tests/tests/lean/case.lean.expected.out deleted file mode 100644 index aad09b3300..0000000000 --- a/old_tests/tests/lean/case.lean.expected.out +++ /dev/null @@ -1,26 +0,0 @@ -case.lean:4:2: error: solve1 tactic failed, focused goal has not been solved -state: -case list.cons -xs_hd : ℕ, -xs_tl : list ℕ, -xs_ih : ℕ -⊢ ℕ -case.lean:10:2: error: solve1 tactic failed, focused goal has not been solved -state: -case list.cons -xs_hd : ℕ, -xs_tl : list ℕ -⊢ ℕ -case.lean:18:4: error: solve1 tactic failed, focused goal has not been solved -state: -case list.cons -xs_ih x x : ℕ, -xs : list ℕ -⊢ ℕ -case.lean:26:2: error: solve1 tactic failed, focused goal has not been solved -state: -case list.cons -xs_hd : ℕ, -xs_tl : list ℕ, -xs_ih : ℕ -⊢ ℕ diff --git a/old_tests/tests/lean/cases_ginductive.lean b/old_tests/tests/lean/cases_ginductive.lean deleted file mode 100644 index e1ad2d68c4..0000000000 --- a/old_tests/tests/lean/cases_ginductive.lean +++ /dev/null @@ -1,96 +0,0 @@ -inductive term -| const (c : string) : term -| app (fn : string) (ts : list term) : term - -mutual inductive is_rename, is_rename_lst -with is_rename : term → string → string → term → Prop -| const_eq (c₁ c₂) : is_rename (term.const c₁) c₁ c₂ (term.const c₂) -| const_ne (c₁ c₂ c₃) (hne : c₁ ≠ c₂) : is_rename (term.const c₁) c₂ c₃ (term.const c₁) -| app (fn c₁ c₂ ts₁ ts₂) (h₁ : is_rename_lst ts₁ c₁ c₂ ts₂) : is_rename (term.app fn ts₁) c₁ c₂ (term.app fn ts₂) -with is_rename_lst : list term → string → string → list term → Prop -| nil (c₁ c₂) : is_rename_lst [] c₁ c₂ [] -| cons (t₁ ts₁ t₂ ts₂ c₁ c₂) (h₁ : is_rename t₁ c₁ c₂ t₂) (h₂ : is_rename_lst ts₁ c₁ c₂ ts₂) : is_rename_lst (t₁::ts₁) c₁ c₂ (t₂::ts₂) - -mutual def term.ind, term_list.ind - (p : term → Prop) (ps : list term → Prop) - (h₁ : ∀ c, p (term.const c)) - (h₂ : ∀ fn ts, ps ts → p (term.app fn ts)) - (h₃ : ps []) - (h₄ : ∀ t ts, p t → ps ts → ps (t::ts)) -with term.ind : ∀ t : term, p t -| (term.const c) := h₁ c -| (term.app fn ts) := h₂ fn ts (term_list.ind ts) -with term_list.ind : ∀ ts : list term, ps ts -| [] := h₃ -| (t::ts) := h₄ t ts (term.ind t) (term_list.ind ts) - -lemma term.ind_on - (p : term → Prop) (ps : list term → Prop) - (t : term) - (h₁ : ∀ c, p (term.const c)) - (h₂ : ∀ fn ts, ps ts → p (term.app fn ts)) - (h₃ : ps []) - (h₄ : ∀ t ts, p t → ps ts → ps (t::ts)) : p t := -term.ind p ps h₁ h₂ h₃ h₄ t - -lemma is_rename_det : ∀ t₁ t₂ t₂' c₁ c₂, is_rename t₁ c₁ c₂ t₂ → is_rename t₁ c₁ c₂ t₂' → t₂ = t₂' := -begin - intro t₁, - apply term.ind_on - (λ t₁ : term, ∀ t₂ t₂' c₁ c₂, is_rename t₁ c₁ c₂ t₂ → is_rename t₁ c₁ c₂ t₂' → t₂ = t₂') - (λ ts₁ : list term, ∀ ts₂ ts₂' c₁ c₂, is_rename_lst ts₁ c₁ c₂ ts₂ → is_rename_lst ts₁ c₁ c₂ ts₂' → ts₂ = ts₂') - t₁, - { intros c₁ t₂ t₂' c₁' c₂ h₁ h₂, - cases h₁; cases h₂; trace_state; { refl <|> contradiction } }, - { intros fn ts ih t₂ t₂' c₁ c₂ h₁ h₂, cases h₁; cases h₂, trace_state, - have := ih _ _ _ _ h₁_h₁ h₂_h₁, - simp [*] }, - { intros ts₂ ts₂' c₁ c₂ h₁ h₂, - cases h₁; cases h₂; refl }, - { intros t ts ih₁ ih₂ ts₂ ts₂' c₁ c₂ h₁ h₂, - cases h₁; cases h₂, - have := ih₁ _ _ _ _ h₁_h₁ h₂_h₁, - have := ih₂ _ _ _ _ h₁_h₂ h₂_h₂, - simp [*] } -end - -mutual def is_rename.ind, is_rename_lst.ind - (p : ∀ {t₁ c₁ c₂ t₂}, is_rename t₁ c₁ c₂ t₂ → Prop) - (ps : ∀ {ts₁ c₁ c₂ ts₂}, is_rename_lst ts₁ c₁ c₂ ts₂ → Prop) - (h₁ : ∀ (c₁ c₂ : string), p (is_rename.const_eq c₁ c₂)) - (h₂ : ∀ (c₁ c₂ c₃ : string) (hne : c₁ ≠ c₂), p (is_rename.const_ne c₁ c₂ c₃ hne)) - (h₃ : ∀ (fn c₁ c₂ ts₁ ts₂ h) (ih : ps h), p (is_rename.app fn c₁ c₂ ts₁ ts₂ h)) - (h₄ : ∀ (c₁ c₂ : string), ps (is_rename_lst.nil c₁ c₂)) - (h₅ : ∀ (t₁ ts₁ t₂ ts₂ c₁ c₂ h₁ h₂) (ih₁ : p h₁) (ih₂ : ps h₂), ps (is_rename_lst.cons t₁ ts₁ t₂ ts₂ c₁ c₂ h₁ h₂)) -with is_rename.ind : ∀ (t₁ c₁ c₂ t₂) (h : is_rename t₁ c₁ c₂ t₂), p h -| (term.const c) := - begin - intros c₁ c₂ t₂ hr, - cases t₂; cases hr, - { apply h₁ }, - { apply h₂, assumption } - end -| (term.app fn ts₁) := - have ih : ∀ (c₁ c₂ ts₂) (h : is_rename_lst ts₁ c₁ c₂ ts₂), ps h, from is_rename_lst.ind ts₁, - begin - intros c₁ c₂ t₂ hr, - cases t₂; cases hr, - apply h₃, apply ih, assumption - end - -with is_rename_lst.ind : ∀ (ts₁ c₁ c₂ ts₂) (h : is_rename_lst ts₁ c₁ c₂ ts₂), ps h -| [] := - begin - intros c₁ c₂ ts₂ hr, - cases ts₂; cases hr, apply h₄ - end -| (t₁::ts₁) := - have ih₁ : ∀ (c₁ c₂ t₂) (h : is_rename t₁ c₁ c₂ t₂), p h, from is_rename.ind t₁, - have ih₂ : ∀ (c₁ c₂ ts₂) (h : is_rename_lst ts₁ c₁ c₂ ts₂), ps h, from is_rename_lst.ind ts₁, - begin - intros c₁ c₂ ts₂ hr, - cases ts₂; cases hr, - fapply h₅, exact hr_h₁, exact hr_h₂, - exact ih₁ _ _ _ hr_h₁, - exact ih₂ _ _ _ hr_h₂ - end diff --git a/old_tests/tests/lean/cases_ginductive.lean.expected.out b/old_tests/tests/lean/cases_ginductive.lean.expected.out deleted file mode 100644 index 19b1f2ebdf..0000000000 --- a/old_tests/tests/lean/cases_ginductive.lean.expected.out +++ /dev/null @@ -1,41 +0,0 @@ -case is_rename.const_eq -t₁ : term, -c₁ c₂ : string, -h₁ h₂ : is_rename (term.const c₁) c₁ c₂ (term.const c₂) -⊢ term.const c₂ = term.const c₂ -case is_rename.const_ne -t₁ : term, -c₁ c₂ : string, -h₁ : is_rename (term.const c₁) c₁ c₂ (term.const c₂), -h₂_hne : c₁ ≠ c₁, -h₂ : is_rename (term.const c₁) c₁ c₂ (term.const c₁) -⊢ term.const c₂ = term.const c₁ -case is_rename.const_eq -t₁ : term, -c₁ c₂ : string, -h₁_hne : c₁ ≠ c₁, -h₁ : is_rename (term.const c₁) c₁ c₂ (term.const c₁), -h₂ : is_rename (term.const c₁) c₁ c₂ (term.const c₂) -⊢ term.const c₁ = term.const c₂ -case is_rename.const_ne -t₁ : term, -c₁ c₁' c₂ : string, -h₁_hne : c₁ ≠ c₁', -h₁ : is_rename (term.const c₁) c₁' c₂ (term.const c₁), -h₂_hne : c₁ ≠ c₁', -h₂ : is_rename (term.const c₁) c₁' c₂ (term.const c₁) -⊢ term.const c₁ = term.const c₁ -t₁ : term, -fn : string, -ts : list term, -ih : - ∀ (ts₂ ts₂' : list term) (c₁ c₂ : string), - is_rename_lst ts c₁ c₂ ts₂ → is_rename_lst ts c₁ c₂ ts₂' → ts₂ = ts₂', -c₁ c₂ : string, -h₁_ts₂ : list term, -h₁_h₁ : is_rename_lst ts c₁ c₂ h₁_ts₂, -h₁ : is_rename (term.app fn ts) c₁ c₂ (term.app fn h₁_ts₂), -h₂_ts₂ : list term, -h₂_h₁ : is_rename_lst ts c₁ c₂ h₂_ts₂, -h₂ : is_rename (term.app fn ts) c₁ c₂ (term.app fn h₂_ts₂) -⊢ term.app fn h₁_ts₂ = term.app fn h₂_ts₂ diff --git a/old_tests/tests/lean/cases_induction_fresh.lean b/old_tests/tests/lean/cases_induction_fresh.lean deleted file mode 100644 index 7c27773163..0000000000 --- a/old_tests/tests/lean/cases_induction_fresh.lean +++ /dev/null @@ -1,37 +0,0 @@ -example (p q r s: Prop): p ∧ q → r ∧ s → s ∧ q := -begin - intros h1 h2, - cases h1, - cases h2, - trace_state, - constructor; assumption -end - -example (p q r s: Prop): p ∧ q → r ∧ s → s ∧ q := -begin - intros a a_1, - cases a, - cases a_1, - trace_state, - constructor; assumption -end - -#print "------------" - -example (p q r s: Prop): p ∧ q → r ∧ s → s ∧ q := -begin - intros h1 h2, - induction h1, - induction h2, - trace_state, - constructor; assumption -end - -example (p q r s: Prop): p ∧ q → r ∧ s → s ∧ q := -begin - intros a a_1, - induction a, - induction a_1, - trace_state, - constructor; assumption -end diff --git a/old_tests/tests/lean/cases_induction_fresh.lean.expected.out b/old_tests/tests/lean/cases_induction_fresh.lean.expected.out deleted file mode 100644 index 4f2fab0507..0000000000 --- a/old_tests/tests/lean/cases_induction_fresh.lean.expected.out +++ /dev/null @@ -1,25 +0,0 @@ -p q r s : Prop, -h1_left : p, -h1_right : q, -h2_left : r, -h2_right : s -⊢ s ∧ q -p q r s : Prop, -a_left : p, -a_right : q, -a_1_left : r, -a_1_right : s -⊢ s ∧ q ------------- -p q r s : Prop, -h1_left : p, -h1_right : q, -h2_left : r, -h2_right : s -⊢ s ∧ q -p q r s : Prop, -a_left : p, -a_right : q, -a_1_left : r, -a_1_right : s -⊢ s ∧ q diff --git a/old_tests/tests/lean/cases_unsupported_equality.lean b/old_tests/tests/lean/cases_unsupported_equality.lean deleted file mode 100644 index d69e75de9e..0000000000 --- a/old_tests/tests/lean/cases_unsupported_equality.lean +++ /dev/null @@ -1,6 +0,0 @@ -inductive foo : ℕ → Type -| a : foo 0 -| b : ∀ n, foo (n+1) - -example (n) (f : ℕ → ℕ) (h : foo (f n)) : true := -by cases h \ No newline at end of file diff --git a/old_tests/tests/lean/cases_unsupported_equality.lean.expected.out b/old_tests/tests/lean/cases_unsupported_equality.lean.expected.out deleted file mode 100644 index 1129dd63b3..0000000000 --- a/old_tests/tests/lean/cases_unsupported_equality.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -cases_unsupported_equality.lean:6:3: error: cases tactic failed, unsupported equality between type and constructor indices -(only equalities between constructors and/or variables are supported, try cases on the indices): -f n = 0 - -state: -n : ℕ, -f : ℕ → ℕ, -h : foo (f n) -⊢ f n = 0 → h == foo.a → true diff --git a/old_tests/tests/lean/change1.lean b/old_tests/tests/lean/change1.lean deleted file mode 100644 index db2d87a9d4..0000000000 --- a/old_tests/tests/lean/change1.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic nat expr option - -attribute [simp] -lemma succ_eq_add (n : nat) : succ n = n + 1 := -rfl - -example (a b : nat) : a = b → succ (succ a) = succ (b + 1) := -by do intro `Heq, - trace_state, - s ← simp_lemmas.mk_default, - t' ← target >>= s^.dsimplify, - change t', - trace "---- after change ----", - trace_state, - get_local `a >>= subst, - t ← target, - match (is_eq t) with - | (some (lhs, rhs)) := do pr ← mk_app `eq.refl [lhs], exact pr - | none := failed - end diff --git a/old_tests/tests/lean/change1.lean.expected.out b/old_tests/tests/lean/change1.lean.expected.out deleted file mode 100644 index 9dfb8f1a63..0000000000 --- a/old_tests/tests/lean/change1.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -a b : ℕ, -Heq : a = b -⊢ succ (succ a) = succ (b + 1) ----- after change ---- -a b : ℕ, -Heq : a = b -⊢ a + 1 + 1 = b + 1 + 1 diff --git a/old_tests/tests/lean/change2.lean b/old_tests/tests/lean/change2.lean deleted file mode 100644 index c23cb87498..0000000000 --- a/old_tests/tests/lean/change2.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic nat expr option - -attribute [simp] -lemma succ_eq_add (n : nat) : succ n = n + 0 + 1 := -rfl - -example (a b : nat) : a = b → succ (succ a) = succ (b + 1) := -by do intro `Heq, - get_local `a >>= subst, - trace_state, - dsimp_target, - trace "---- after dsimp ----", - trace_state, - t ← target, - match (is_eq t) with - | (some (lhs, rhs)) := do pr ← mk_app `eq.refl [lhs], exact pr - | none := failed - end diff --git a/old_tests/tests/lean/change2.lean.expected.out b/old_tests/tests/lean/change2.lean.expected.out deleted file mode 100644 index 7fc2483301..0000000000 --- a/old_tests/tests/lean/change2.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -b : ℕ -⊢ succ (succ b) = succ (b + 1) ----- after dsimp ---- -b : ℕ -⊢ b + 0 + 1 + 0 + 1 = b + 1 + 0 + 1 diff --git a/old_tests/tests/lean/change_tac.lean b/old_tests/tests/lean/change_tac.lean deleted file mode 100644 index da2b9cb838..0000000000 --- a/old_tests/tests/lean/change_tac.lean +++ /dev/null @@ -1,47 +0,0 @@ -example : 1 + 2 = 3 := -begin - change 2 + 1 = 3, - trace_state, - refl -end - -example : 1 + 2 = 3 := -begin - change 2 + 2 = 3 -- ERROR -end - -example (h : 1 + 2 = 3) : 2 + 2 = 4 := -begin - change 2 + 1 = 3 at h, - trace_state, - refl -end - -example (h : 1 + 2 = 3) : 2 + 2 = 4 := -begin - change 2 + 1 = 3 at h h, -- ERROR -end - -example (h : 1 + 2 = 3) : 2 + 2 = 4 := -begin - change 2 + 1 = 3 at *, -- ERROR -end - -example (h : 1 + 2 = 3) : 1 + 2 = 3 := -begin - change 1 + 2 with 2 + 1 at h, - trace_state, - refl -end - -example (h : 1 + 2 = 1 + 2 + 1) : 1 + 2 = 3 := -begin - change 1 + 2 with 3 at *, - trace_state, - refl -end - -example (h : 1 + 2 = 1 + 2 + 1) : 1 + 2 = 3 := -begin - change 1 + 2 with 4 at *, -- ERROR -end diff --git a/old_tests/tests/lean/change_tac.lean.expected.out b/old_tests/tests/lean/change_tac.lean.expected.out deleted file mode 100644 index ccd81954f2..0000000000 --- a/old_tests/tests/lean/change_tac.lean.expected.out +++ /dev/null @@ -1,27 +0,0 @@ -⊢ 2 + 1 = 3 -change_tac.lean:10:2: error: tactic.change failed, given type - 2 + 2 = 3 -is not definitionally equal to - 1 + 2 = 3 -state: -⊢ 1 + 2 = 3 -h : 2 + 1 = 3 -⊢ 2 + 2 = 4 -change_tac.lean:22:2: error: change-at does not support multiple locations -state: -h : 1 + 2 = 3 -⊢ 2 + 2 = 4 -change_tac.lean:27:2: error: change-at does not support multiple locations -state: -h : 1 + 2 = 3 -⊢ 2 + 2 = 4 -h : 2 + 1 = 3 -⊢ 1 + 2 = 3 -h : 3 = 3 + 1 -⊢ 3 = 3 -change_tac.lean:46:2: error: tactic.change failed, given type - 4 = 4 + 1 → 1 + 2 = 3 -is not definitionally equal to - 1 + 2 = 1 + 2 + 1 → 1 + 2 = 3 -state: -⊢ 1 + 2 = 1 + 2 + 1 → 1 + 2 = 3 diff --git a/old_tests/tests/lean/char_lits.lean b/old_tests/tests/lean/char_lits.lean deleted file mode 100644 index 6963041efb..0000000000 --- a/old_tests/tests/lean/char_lits.lean +++ /dev/null @@ -1,22 +0,0 @@ -import system.io -open io -#check 'a' -#check '\\' -#check 'α' - -#eval 'a' -#eval '\n' -#eval '\\' - -#eval put_str ("aaa".str '\\') -#eval put_str $ repr '\n' -#eval put_str $ string.singleton '\n' -#eval put_str ("aaa".str '\'') - -#check ['\x7f', '\x00', '\x11'] --- ^^ all characters should be pretty-printed using \x escapes - -#eval 'α' -#eval 'β' -#eval '\u03B1' -#eval '\u03B2' diff --git a/old_tests/tests/lean/char_lits.lean.expected.out b/old_tests/tests/lean/char_lits.lean.expected.out deleted file mode 100644 index e7a2cb5618..0000000000 --- a/old_tests/tests/lean/char_lits.lean.expected.out +++ /dev/null @@ -1,15 +0,0 @@ -'a' : char -'\\' : char -'α' : char -'a' -'\n' -'\\' -aaa\ -'\n' - -aaa' -['\x7f', '\x00', '\x11'] : list char -'α' -'β' -'α' -'β' diff --git a/old_tests/tests/lean/check.lean b/old_tests/tests/lean/check.lean deleted file mode 100644 index 092c1427e8..0000000000 --- a/old_tests/tests/lean/check.lean +++ /dev/null @@ -1,6 +0,0 @@ --- - -#check and.intro -#check or.elim -#check eq -#check eq.rec diff --git a/old_tests/tests/lean/check.lean.expected.out b/old_tests/tests/lean/check.lean.expected.out deleted file mode 100644 index 1fc5b28442..0000000000 --- a/old_tests/tests/lean/check.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -and.intro : ?M_1 → ?M_2 → ?M_1 ∧ ?M_2 -or.elim : ?M_1 ∨ ?M_2 → (?M_1 → ?M_3) → (?M_2 → ?M_3) → ?M_3 -eq : ?M_1 → ?M_1 → Prop -eq.rec : ?M_3 ?M_2 → Π {a : ?M_1}, ?M_2 = a → ?M_3 a diff --git a/old_tests/tests/lean/check2.lean b/old_tests/tests/lean/check2.lean deleted file mode 100644 index b5ee7ee528..0000000000 --- a/old_tests/tests/lean/check2.lean +++ /dev/null @@ -1,3 +0,0 @@ --- - -#check eq.rec_on diff --git a/old_tests/tests/lean/check2.lean.expected.out b/old_tests/tests/lean/check2.lean.expected.out deleted file mode 100644 index ca383fa4af..0000000000 --- a/old_tests/tests/lean/check2.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -eq.rec_on : ?M_2 = ?M_4 → ?M_3 ?M_2 → ?M_3 ?M_4 diff --git a/old_tests/tests/lean/choice_expl.lean b/old_tests/tests/lean/choice_expl.lean deleted file mode 100644 index d3fafec0dc..0000000000 --- a/old_tests/tests/lean/choice_expl.lean +++ /dev/null @@ -1,15 +0,0 @@ -universe variables u -namespace N1 - definition pr {A : Type u} (a b : A) := a -end N1 - -namespace N2 - definition pr {A : Type u} (a b : A) := b -end N2 - -open N1 N2 -constant N : Type.{1} -constants a b : N -#check @N1.pr -#check @N2.pr N a b -#check pr a b diff --git a/old_tests/tests/lean/choice_expl.lean.expected.out b/old_tests/tests/lean/choice_expl.lean.expected.out deleted file mode 100644 index 362aab759a..0000000000 --- a/old_tests/tests/lean/choice_expl.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -pr : Π {A : Type u_1}, A → A → A -pr a b : N -choice_expl.lean:15:7: error: ambiguous overload, possible interpretations - N2.pr a b - N1.pr a b -Additional information: -choice_expl.lean:15:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available diff --git a/old_tests/tests/lean/class_instance_param.lean b/old_tests/tests/lean/class_instance_param.lean deleted file mode 100644 index a870e9637f..0000000000 --- a/old_tests/tests/lean/class_instance_param.lean +++ /dev/null @@ -1,9 +0,0 @@ -universes u - -class densely_ordered (α : Type u) [preorder α] : Prop := -(dense : ∀ a c : α, a < c → ∃ b, a < b ∧ b < c) - --- [preorder α] should be instance implicit in all of the following: -#check @densely_ordered -#check @densely_ordered.mk -#check @densely_ordered.dense diff --git a/old_tests/tests/lean/class_instance_param.lean.expected.out b/old_tests/tests/lean/class_instance_param.lean.expected.out deleted file mode 100644 index 8590607010..0000000000 --- a/old_tests/tests/lean/class_instance_param.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -densely_ordered : Π (α : Type u_1) [_inst_1 : preorder α], Prop -densely_ordered.mk : - ∀ {α : Type u_1} [_inst_1 : preorder α], - (∀ (a c : α), a < c → (∃ (b : α), a < b ∧ b < c)) → densely_ordered α -densely_ordered.dense : - ∀ {α : Type u_1} [_inst_1 : preorder α] [c : densely_ordered α] (a c : α), - a < c → (∃ (b : α), a < b ∧ b < c) diff --git a/old_tests/tests/lean/cls_err.lean b/old_tests/tests/lean/cls_err.lean deleted file mode 100644 index c33b8ab57e..0000000000 --- a/old_tests/tests/lean/cls_err.lean +++ /dev/null @@ -1,14 +0,0 @@ --- -universe variables u -class inductive H (A : Type u) -| mk : A → H - -definition foo {A : Type u} [h : H A] : A := -H.rec (λa, a) h - -section - variable A : Type u - variable h : H A - definition tst : A := - foo -end diff --git a/old_tests/tests/lean/cls_err.lean.expected.out b/old_tests/tests/lean/cls_err.lean.expected.out deleted file mode 100644 index 56275436c4..0000000000 --- a/old_tests/tests/lean/cls_err.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -cls_err.lean:13:2: error: failed to synthesize type class instance for -A : Type u -⊢ H A diff --git a/old_tests/tests/lean/cmd_meta_errors.lean b/old_tests/tests/lean/cmd_meta_errors.lean deleted file mode 100644 index 4b381c5873..0000000000 --- a/old_tests/tests/lean/cmd_meta_errors.lean +++ /dev/null @@ -1,20 +0,0 @@ -/-- docs -/ -run_cmd - -@[class] -run_cmd - -private run_cmd - -meta axiom - -private protected def f := 42 -private private def f := 42 - -private inductive -protected inductive -noncomputable inductive - -private instance -protected instance -mutual instance diff --git a/old_tests/tests/lean/cmd_meta_errors.lean.expected.out b/old_tests/tests/lean/cmd_meta_errors.lean.expected.out deleted file mode 100644 index 3953906b4b..0000000000 --- a/old_tests/tests/lean/cmd_meta_errors.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -cmd_meta_errors.lean:2:0: error: command does not accept doc string -cmd_meta_errors.lean:5:0: error: command does not accept attributes -cmd_meta_errors.lean:7:8: error: command does not accept modifiers -cmd_meta_errors.lean:9:5: error: invalid 'meta' modifier for axiom -cmd_meta_errors.lean:11:8: error: unexpected definition modifier -cmd_meta_errors.lean:12:8: error: unexpected definition modifier -cmd_meta_errors.lean:14:0: error: invalid 'private' modifier for inductive type -cmd_meta_errors.lean:15:0: error: invalid 'protected' modifier for inductive type -cmd_meta_errors.lean:16:0: error: invalid 'noncomputable' modifier for inductive type -cmd_meta_errors.lean:18:8: error: invalid 'private' modifier for instance command -cmd_meta_errors.lean:19:10: error: invalid 'protected' modifier for instance command -cmd_meta_errors.lean:20:7: error: invalid 'mutual' modifier for instance command diff --git a/old_tests/tests/lean/coe1.lean b/old_tests/tests/lean/coe1.lean deleted file mode 100644 index fa47b9aa9f..0000000000 --- a/old_tests/tests/lean/coe1.lean +++ /dev/null @@ -1,41 +0,0 @@ -namespace hidden -#check if tt then "a" else "b" -/- Remark: in the standard library nat_to_int and int_to_real are has_lift instances - instead of has_coe. -/ -constant int : Type -constant real : Type -constant nat_to_int : has_coe nat int -constant int_to_real : has_coe int real -attribute [instance] nat_to_int int_to_real - -constant sine : real → real -constants n m : nat -constants i j : int -constants x y : real - -#check sine x -#check sine n -#check sine i - -constant int_has_add : has_add int -constant real_has_add : has_add real -attribute [instance] int_has_add real_has_add - -#check x + i - -/- The following one does not work because the implicit argument ?A of add is bound to int - when x is processed. -/ -#check i + x -- FAIL - -/- The workaround is to use the explicit lift -/ -#check ↑i + x - -#check x + n - -#check n + x -- FAIL - -#check ↑n + x - -#check (i:real) + x -#check (n:real) + x -end hidden diff --git a/old_tests/tests/lean/coe1.lean.expected.out b/old_tests/tests/lean/coe1.lean.expected.out deleted file mode 100644 index c12964325d..0000000000 --- a/old_tests/tests/lean/coe1.lean.expected.out +++ /dev/null @@ -1,26 +0,0 @@ -ite ↥tt "a" "b" : string -sine x : real -sine ↑n : real -sine ↑i : real -x + ↑i : real -coe1.lean:28:9: error: type mismatch at application - i + x -term - x -has type - real -but is expected to have type - int -↑i + x : real -x + ↑n : real -coe1.lean:35:9: error: type mismatch at application - n + x -term - x -has type - real -but is expected to have type - ℕ -↑n + x : real -↑i + x : real -↑n + x : real diff --git a/old_tests/tests/lean/coe2.lean b/old_tests/tests/lean/coe2.lean deleted file mode 100644 index 84c2e92ab2..0000000000 --- a/old_tests/tests/lean/coe2.lean +++ /dev/null @@ -1,40 +0,0 @@ -namespace hidden -set_option pp.coercions false -#check if tt then "a" else "b" - -/- Remark: in the standard library nat_to_int and int_to_real are has_lift instances - instead of has_coe. -/ -constant int : Type -constant real : Type -constant nat_to_int : has_coe nat int -constant int_to_real : has_coe int real -attribute [instance] nat_to_int int_to_real - -constant sine : real → real -constants n m : nat -constants i j : int -constants x y : real - -#check sine x -#check sine n -#check sine i - -constant int_has_add : has_add int -constant real_has_add : has_add real -attribute [instance] int_has_add real_has_add - -#check x + i - -/- The following one does not work because the implicit argument ?A of add is bound to int - when x is processed. -/ -#check i + x -- FAIL - -/- The workaround is to use the explicit lift -/ -#check ↑i + x - -#check x + n - -#check n + x -- FAIL - -#check ↑n + x -end hidden diff --git a/old_tests/tests/lean/coe2.lean.expected.out b/old_tests/tests/lean/coe2.lean.expected.out deleted file mode 100644 index 0d9f349b97..0000000000 --- a/old_tests/tests/lean/coe2.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -ite ↥tt "a" "b" : string -sine x : real -sine n : real -sine i : real -x + i : real -coe2.lean:30:9: error: type mismatch at application - i + x -term - x -has type - real -but is expected to have type - int -i + x : real -x + n : real -coe2.lean:37:9: error: type mismatch at application - n + x -term - x -has type - real -but is expected to have type - ℕ -n + x : real diff --git a/old_tests/tests/lean/coe3.lean b/old_tests/tests/lean/coe3.lean deleted file mode 100644 index 4d858789a9..0000000000 --- a/old_tests/tests/lean/coe3.lean +++ /dev/null @@ -1,16 +0,0 @@ -constants A B₁ B₂ C D : Type - -constant A_to_B₁ : has_coe A B₁ -constant A_to_B₂ : has_coe A B₂ -constant B₁_to_C : has_coe B₁ C -constant B₂_to_D : has_coe B₂ D - -attribute [instance] A_to_B₁ A_to_B₂ B₁_to_C B₂_to_D - -constant a : A -constant f : C → C -constant g : D → D - -#check f a - -#check g a diff --git a/old_tests/tests/lean/coe3.lean.expected.out b/old_tests/tests/lean/coe3.lean.expected.out deleted file mode 100644 index be52cbcdd2..0000000000 --- a/old_tests/tests/lean/coe3.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -f ↑a : C -g ↑a : D diff --git a/old_tests/tests/lean/coe4.lean b/old_tests/tests/lean/coe4.lean deleted file mode 100644 index cec6e6fc49..0000000000 --- a/old_tests/tests/lean/coe4.lean +++ /dev/null @@ -1,25 +0,0 @@ -universe variables u - -structure Functor (A : Type u) := -(fn : A → A → A) (inj : ∀ x y, fn x = fn y → x = y) - -attribute [instance] -definition coe_functor_to_fn (A : Type u) : has_coe_to_fun (Functor A) := -{ F := λ f, A → A → A, - coe := Functor.fn } - -constant f : Functor nat - -#check f 0 1 - -set_option pp.coercions false - -#check f 0 1 - -set_option pp.coercions true - -#check f 0 1 - -set_option pp.all true - -#check f 0 1 diff --git a/old_tests/tests/lean/coe4.lean.expected.out b/old_tests/tests/lean/coe4.lean.expected.out deleted file mode 100644 index 17b20e9476..0000000000 --- a/old_tests/tests/lean/coe4.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -⇑f 0 1 : ℕ -f 0 1 : ℕ -⇑f 0 1 : ℕ -@coe_fn.{1 1} (Functor.{0} nat) (coe_functor_to_fn.{0} nat) f (@has_zero.zero.{0} nat nat.has_zero) - (@has_one.one.{0} nat nat.has_one) : - nat diff --git a/old_tests/tests/lean/coe5.lean b/old_tests/tests/lean/coe5.lean deleted file mode 100644 index 050b751742..0000000000 --- a/old_tests/tests/lean/coe5.lean +++ /dev/null @@ -1,23 +0,0 @@ -open tactic - -attribute [instance] -meta def expr_to_app : has_coe_to_fun expr := -{ F := λ e, expr → expr, - coe := expr.app } - -meta constants f a b : expr - -#check f a - -#check f a b - -#check f a b a - -set_option pp.coercions false - -#check f a b a - -set_option pp.all true -set_option pp.coercions true - -#check f a b diff --git a/old_tests/tests/lean/coe5.lean.expected.out b/old_tests/tests/lean/coe5.lean.expected.out deleted file mode 100644 index 7a5d753f0d..0000000000 --- a/old_tests/tests/lean/coe5.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -⇑f a : expr -⇑(⇑f a) b : expr -⇑(⇑(⇑f a) b) a : expr -f a b a : expr -@coe_fn.{1 1} (expr bool.tt) expr_to_app (@coe_fn.{1 1} (expr bool.tt) expr_to_app f a) b : expr bool.tt diff --git a/old_tests/tests/lean/coe6.lean b/old_tests/tests/lean/coe6.lean deleted file mode 100644 index 3aa5bfb174..0000000000 --- a/old_tests/tests/lean/coe6.lean +++ /dev/null @@ -1,12 +0,0 @@ -universe variables u -structure Group := -(carrier : Type u) (mul : carrier → carrier → carrier) (one : carrier) - -attribute [instance] -definition Group_to_Type : has_coe_to_sort Group := -{ S := Type u, coe := λ g, g^.carrier } - -constant g : Group.{1} -set_option pp.binder_types true - -#check λ a b : g, Group.mul g a b diff --git a/old_tests/tests/lean/coe6.lean.expected.out b/old_tests/tests/lean/coe6.lean.expected.out deleted file mode 100644 index 5b070023d5..0000000000 --- a/old_tests/tests/lean/coe6.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -λ (a b : ↥g), g.mul a b : ↥g → ↥g → g.carrier diff --git a/old_tests/tests/lean/combinators1.lean b/old_tests/tests/lean/combinators1.lean deleted file mode 100644 index 5cf58034b5..0000000000 --- a/old_tests/tests/lean/combinators1.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -example (p q : Prop) : p → q → (p ∧ p) ∧ q := -by do - intros, constructor, focus [trace "first goal" >> trace_state >> constructor >> skip, trace "--- Second goal: " >> trace_state >> assumption], - trace "--- After", trace_state, - solve [trace "should not work", assumption], - first [trace "should not work" >> failed, constructor >> skip, trace "should work" >> assumption] - -example (p q : Prop) : p → q → p ∧ q := -by do intros, constructor >> skip; assumption diff --git a/old_tests/tests/lean/combinators1.lean.expected.out b/old_tests/tests/lean/combinators1.lean.expected.out deleted file mode 100644 index 11a2248961..0000000000 --- a/old_tests/tests/lean/combinators1.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -first goal -p q : Prop, -a : p, -a_1 : q -⊢ p ∧ p ---- Second goal: -p q : Prop, -a : p, -a_1 : q -⊢ q ---- After -2 goals -p q : Prop, -a : p, -a_1 : q -⊢ p - -p q : Prop, -a : p, -a_1 : q -⊢ p -should not work -should not work -should work diff --git a/old_tests/tests/lean/concrete_instance.lean b/old_tests/tests/lean/concrete_instance.lean deleted file mode 100644 index 46b4535d43..0000000000 --- a/old_tests/tests/lean/concrete_instance.lean +++ /dev/null @@ -1,12 +0,0 @@ -variables a b : nat - -set_option pp.all true - -#check a * b -#check a + b - --- instance : semigroup nat := sorry --- instance : add_semigroup nat := sorry - -#check a * b -#check a + b diff --git a/old_tests/tests/lean/concrete_instance.lean.expected.out b/old_tests/tests/lean/concrete_instance.lean.expected.out deleted file mode 100644 index b0f7c8f2d4..0000000000 --- a/old_tests/tests/lean/concrete_instance.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -@has_mul.mul.{0} nat nat.has_mul a b : nat -@has_add.add.{0} nat nat.has_add a b : nat -@has_mul.mul.{0} nat nat.has_mul a b : nat -@has_add.add.{0} nat nat.has_add a b : nat diff --git a/old_tests/tests/lean/const.lean b/old_tests/tests/lean/const.lean deleted file mode 100644 index c86f45bf99..0000000000 --- a/old_tests/tests/lean/const.lean +++ /dev/null @@ -1,17 +0,0 @@ --- - -universe variables u -definition foo {A : Type u} [H : inhabited A] : A := -inhabited.rec (λa, a) H - -constant bla {A : Type u} [H : inhabited A] : Type 1 - -set_option pp.implicit true - -section - variable A : Type u - variable S : inhabited A - variable B : @bla A S - #check B - #check @foo A S -end diff --git a/old_tests/tests/lean/const.lean.expected.out b/old_tests/tests/lean/const.lean.expected.out deleted file mode 100644 index 453e9b6777..0000000000 --- a/old_tests/tests/lean/const.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -B : @bla A S -@foo A S : A diff --git a/old_tests/tests/lean/crash.lean b/old_tests/tests/lean/crash.lean deleted file mode 100644 index 73caa27b9f..0000000000 --- a/old_tests/tests/lean/crash.lean +++ /dev/null @@ -1,11 +0,0 @@ --- - -section -parameter P : Prop. - -definition crash - := assume H : P, - have H' : ¬ P, - from H, - _. -end diff --git a/old_tests/tests/lean/crash.lean.expected.out b/old_tests/tests/lean/crash.lean.expected.out deleted file mode 100644 index c07b5893d5..0000000000 --- a/old_tests/tests/lean/crash.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -crash.lean:9:17: error: invalid have-expression, term - H -has type - P -but is expected to have type - ¬P -crash.lean:10:12: error: don't know how to synthesize placeholder -context: -P : Prop, -H : P, -H' : ¬P -⊢ Sort ? diff --git a/old_tests/tests/lean/ctx.lean b/old_tests/tests/lean/ctx.lean deleted file mode 100644 index 21acb10f1e..0000000000 --- a/old_tests/tests/lean/ctx.lean +++ /dev/null @@ -1,3 +0,0 @@ -open prod universe variables u -definition foo {A B : Type u} (a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 : nat) (b1 b2 b3 : bool) (h : A = B) (p1 p2 : A × B) : nat := -_ diff --git a/old_tests/tests/lean/ctx.lean.expected.out b/old_tests/tests/lean/ctx.lean.expected.out deleted file mode 100644 index a31a6df19a..0000000000 --- a/old_tests/tests/lean/ctx.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -ctx.lean:3:0: error: don't know how to synthesize placeholder -context: -A B : Type u, -a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 : ℕ, -b1 b2 b3 : bool, -h : A = B, -p1 p2 : A × B -⊢ ℕ diff --git a/old_tests/tests/lean/ctx_error_msgs.lean b/old_tests/tests/lean/ctx_error_msgs.lean deleted file mode 100644 index aef8c9811e..0000000000 --- a/old_tests/tests/lean/ctx_error_msgs.lean +++ /dev/null @@ -1,26 +0,0 @@ -open tactic - -example (f : nat) (a : nat) : true := -by do - f ← get_local `f, - a ← get_local `a, - infer_type (expr.app f a) >>= trace, - constructor - -example (a : nat) : true := -by do - a ← get_local `a, - clear a, - infer_type a >>= trace, - constructor - -example (a : nat) : true := -by do - infer_type (expr.const `eq []) >>= trace, - constructor - -example (a : nat) : true := -by do - l ← return $ level.zero, - infer_type (expr.const `eq [l, l]) >>= trace, - constructor diff --git a/old_tests/tests/lean/ctx_error_msgs.lean.expected.out b/old_tests/tests/lean/ctx_error_msgs.lean.expected.out deleted file mode 100644 index bba957dec5..0000000000 --- a/old_tests/tests/lean/ctx_error_msgs.lean.expected.out +++ /dev/null @@ -1,23 +0,0 @@ -ctx_error_msgs.lean:4:3: error: infer type failed, function expected at - f a -term - f -has type - ℕ -state: -f a : ℕ -⊢ true -ctx_error_msgs.lean:11:3: error: infer type failed, unknown variable - a -state: -⊢ true -ctx_error_msgs.lean:18:3: error: infer type failed, incorrect number of universe levels - eq -state: -a : ℕ -⊢ true -ctx_error_msgs.lean:23:3: error: infer type failed, incorrect number of universe levels - eq.{0 0} -state: -a : ℕ -⊢ true diff --git a/old_tests/tests/lean/ctxopt.lean b/old_tests/tests/lean/ctxopt.lean deleted file mode 100644 index fee9de0b61..0000000000 --- a/old_tests/tests/lean/ctxopt.lean +++ /dev/null @@ -1,9 +0,0 @@ --- - - -section - set_option pp.implicit true - #check id true -end - -#check id true diff --git a/old_tests/tests/lean/ctxopt.lean.expected.out b/old_tests/tests/lean/ctxopt.lean.expected.out deleted file mode 100644 index d75e4dd642..0000000000 --- a/old_tests/tests/lean/ctxopt.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -@id Prop true : Prop -id true : Prop diff --git a/old_tests/tests/lean/curly_notation.lean b/old_tests/tests/lean/curly_notation.lean deleted file mode 100644 index f3588b07a5..0000000000 --- a/old_tests/tests/lean/curly_notation.lean +++ /dev/null @@ -1,26 +0,0 @@ -#check ({1, 2, 3} : set nat) -#check ({1} : set nat) -#check ({} : set nat) - -definition s1 : set nat := {1, 2+3, 3, 4} -#print s1 - -definition s2 : set char := {'a', 'b', 'c'} -#print s2 - -definition s3 : set string := {"hello", "world"} -#print s3 - -#check { a ∈ s1 | a > 1 } -#check { a in s1 | a > 1 } -set_option pp.unicode false -#check { a ∈ s1 | a > 2 } - - -definition a := 10 - -#check ({a, a} : set nat) -#check ({a, 1, a} : set nat) -#check ({a} : set nat) - -#check { a // a > 0 } diff --git a/old_tests/tests/lean/curly_notation.lean.expected.out b/old_tests/tests/lean/curly_notation.lean.expected.out deleted file mode 100644 index 816c0556a2..0000000000 --- a/old_tests/tests/lean/curly_notation.lean.expected.out +++ /dev/null @@ -1,16 +0,0 @@ -{1, 2, 3} : set ℕ -{1} : set ℕ -∅ : set ℕ -def s1 : set ℕ := -{1, 2 + 3, 3, 4} -def s2 : set char := -{'a', 'b', 'c'} -def s3 : set string := -{"hello", "world"} -{a ∈ s1 | a > 1} : set ℕ -{a ∈ s1 | a > 1} : set ℕ -{a in s1 | a > 2} : set nat -{a, a} : set nat -{a, 1, a} : set nat -{a} : set nat -{a // a > 0} : Type diff --git a/old_tests/tests/lean/cyclic_default_fields.lean b/old_tests/tests/lean/cyclic_default_fields.lean deleted file mode 100644 index 873683b051..0000000000 --- a/old_tests/tests/lean/cyclic_default_fields.lean +++ /dev/null @@ -1,8 +0,0 @@ -class Eq (α : Type) := -(eq : α → α → Prop) -(ne : α → α → Prop := λ a b, ¬eq a b) -(eq := λ a b, ¬ne a b) - -#check ({} : Eq ℕ) -#check ({eq := (=)} : Eq ℕ) -#check ({ne := (≠)} : Eq ℕ) diff --git a/old_tests/tests/lean/cyclic_default_fields.lean.expected.out b/old_tests/tests/lean/cyclic_default_fields.lean.expected.out deleted file mode 100644 index 25579279c4..0000000000 --- a/old_tests/tests/lean/cyclic_default_fields.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -cyclic_default_fields.lean:6:8: error: Failed to insert value for 'Eq.eq', it depends on field(s) 'ne', but the value for these fields is not available. -Unfolded type/default value: - - λ (a b : ℕ), ¬?ne a b - -Failed to insert value for 'Eq.ne', it depends on field(s) 'eq', but the value for these fields is not available. -Unfolded type/default value: - - λ (a b : ℕ), ¬?eq a b -⁇ : Eq ℕ -{eq := eq ℕ, ne := λ (a b : ℕ), ¬a = b} : Eq ℕ -{eq := λ (a b : ℕ), ¬a ≠ b, ne := ne ℕ} : Eq ℕ diff --git a/old_tests/tests/lean/def1.lean b/old_tests/tests/lean/def1.lean deleted file mode 100644 index 83156af66c..0000000000 --- a/old_tests/tests/lean/def1.lean +++ /dev/null @@ -1,5 +0,0 @@ -universe variable u -variable {A : Type u} - -lemma foo (f : A → A → A) (a b c : A) (H₁ : a = b) (H₂ : c = b) : f a = f c := -H₂ ▸ eq.symm H₁ ▸ rfl diff --git a/old_tests/tests/lean/def1.lean.expected.out b/old_tests/tests/lean/def1.lean.expected.out deleted file mode 100644 index 573ea4efe6..0000000000 --- a/old_tests/tests/lean/def1.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -def1.lean:5:16: error: "eliminator" elaborator type mismatch, term - rfl -has type - ?m_2 = ?m_2 -but is expected to have type - f b = f c -Additional information: -def1.lean:5:16: context: the inferred motive for the eliminator-like application is - λ (_x : A), f _x = f c diff --git a/old_tests/tests/lean/def2.lean b/old_tests/tests/lean/def2.lean deleted file mode 100644 index f72b34308e..0000000000 --- a/old_tests/tests/lean/def2.lean +++ /dev/null @@ -1,10 +0,0 @@ -axiom val : nat - -definition foo : nat := -val - -noncomputable definition foo2 : nat := -val - -definition bla : nat := -2 diff --git a/old_tests/tests/lean/def2.lean.expected.out b/old_tests/tests/lean/def2.lean.expected.out deleted file mode 100644 index 2d379e5040..0000000000 --- a/old_tests/tests/lean/def2.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -def2.lean:3:11: error: definition 'foo' is noncomputable, it depends on 'val' diff --git a/old_tests/tests/lean/def3.lean b/old_tests/tests/lean/def3.lean deleted file mode 100644 index dadd04787a..0000000000 --- a/old_tests/tests/lean/def3.lean +++ /dev/null @@ -1,10 +0,0 @@ -universe variable u -section - variable (A : Type u) - - definition f : A → A := - λ x, x - - #check f - -end diff --git a/old_tests/tests/lean/def3.lean.expected.out b/old_tests/tests/lean/def3.lean.expected.out deleted file mode 100644 index d854b17aca..0000000000 --- a/old_tests/tests/lean/def3.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -f : Π (A : Type u_1), A → A diff --git a/old_tests/tests/lean/def4.lean b/old_tests/tests/lean/def4.lean deleted file mode 100644 index c54926e4ca..0000000000 --- a/old_tests/tests/lean/def4.lean +++ /dev/null @@ -1,22 +0,0 @@ -universe variable u -section - parameter (A : Type u) - - definition f : A → A := - λ x, x - - #check f - #check f (0:nat) -- error - - parameter {A} - - definition g : A → A := - λ x, x - - #check g - #check g (0:nat) -- error -end - -#check f -#check f _ (0:nat) -#check g 0 diff --git a/old_tests/tests/lean/def4.lean.expected.out b/old_tests/tests/lean/def4.lean.expected.out deleted file mode 100644 index 1996f1fea6..0000000000 --- a/old_tests/tests/lean/def4.lean.expected.out +++ /dev/null @@ -1,21 +0,0 @@ -f : A → A -def4.lean:9:9: error: type mismatch at application - f 0 -term - 0 -has type - ℕ : Type -but is expected to have type - A : Type u -g : A → A -def4.lean:17:9: error: type mismatch at application - g 0 -term - 0 -has type - ℕ : Type -but is expected to have type - A : Type u -f : Π (A : Type u_1), A → A -f ℕ 0 : ℕ -g 0 : ℕ diff --git a/old_tests/tests/lean/def_inaccessible_issue.lean b/old_tests/tests/lean/def_inaccessible_issue.lean deleted file mode 100644 index 361df887b4..0000000000 --- a/old_tests/tests/lean/def_inaccessible_issue.lean +++ /dev/null @@ -1,17 +0,0 @@ -open nat - -set_option pp.binder_types true - -inductive bv : nat → Type -| nil : bv 0 -| cons : ∀ (n) (hd : bool) (tl : bv n), bv (n+1) - -open bv - -variable (f : bool → bool → bool) - -definition map2 : ∀ {n}, bv n → bv n → bv n -| 0 nil nil := nil -| (n+1) (cons .(n) b1 v1) (cons .(n) b2 v2) := cons n (f b1 b2) (map2 v1 v2) - -#check map2.equations._eqn_2 diff --git a/old_tests/tests/lean/def_inaccessible_issue.lean.expected.out b/old_tests/tests/lean/def_inaccessible_issue.lean.expected.out deleted file mode 100644 index 5599ccc6b4..0000000000 --- a/old_tests/tests/lean/def_inaccessible_issue.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -map2.equations._eqn_2 : - ∀ (f : bool → bool → bool) (n : ℕ) (b1 : bool) (v1 : bv n) (b2 : bool) (v2 : bv n), - map2 f (cons n b1 v1) (cons n b2 v2) = cons n (f b1 b2) (map2 f v1 v2) diff --git a/old_tests/tests/lean/def_ite_value.lean b/old_tests/tests/lean/def_ite_value.lean deleted file mode 100644 index 82cb26b3e4..0000000000 --- a/old_tests/tests/lean/def_ite_value.lean +++ /dev/null @@ -1,12 +0,0 @@ -set_option eqn_compiler.lemmas false -- TODO(Leo): remove -definition f : string → nat → nat -| "hello world" 1 := 0 -| "hello world" _ := 1 -| "bye" 1 := 2 -| _ _ := 3 - -#eval f "hello world" 1 -#eval f "hello world" 2 -#eval f "bye" 1 -#eval f "bye" 2 -#eval f "hello" 1 diff --git a/old_tests/tests/lean/def_ite_value.lean.expected.out b/old_tests/tests/lean/def_ite_value.lean.expected.out deleted file mode 100644 index 0e53a35ebe..0000000000 --- a/old_tests/tests/lean/def_ite_value.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -0 -1 -2 -3 -3 diff --git a/old_tests/tests/lean/defeq1.lean b/old_tests/tests/lean/defeq1.lean deleted file mode 100644 index 178fb2a044..0000000000 --- a/old_tests/tests/lean/defeq1.lean +++ /dev/null @@ -1,14 +0,0 @@ -open nat tactic -universe variables u variables {A : Type u} - -attribute [simp] -lemma succ_eq_add (n : nat) : succ n = n + 1 := -rfl - -example (n m : nat) (H : succ (succ n) = succ m) : true := -by do H ← get_local `H, - t ← infer_type H, - s ← simp_lemmas.mk_default, - t' ← s^.dsimplify [] t, - trace t', - exact (expr.const `trivial []) diff --git a/old_tests/tests/lean/defeq1.lean.expected.out b/old_tests/tests/lean/defeq1.lean.expected.out deleted file mode 100644 index 9cc4d0f149..0000000000 --- a/old_tests/tests/lean/defeq1.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -n + 1 + 1 = m + 1 diff --git a/old_tests/tests/lean/defeq_simp1.lean b/old_tests/tests/lean/defeq_simp1.lean deleted file mode 100644 index d802dfe940..0000000000 --- a/old_tests/tests/lean/defeq_simp1.lean +++ /dev/null @@ -1,23 +0,0 @@ -@[reducible] -def nat_has_add2 : has_add nat := -⟨λ x y : nat, nat.add x y⟩ - -set_option pp.all true - -open tactic -local attribute [-simp] id.def -example (a b : nat) (H : @has_add.add nat (id (id nat.has_add)) a b = @has_add.add nat nat_has_add2 a b) : true := -by do - s ← simp_lemmas.mk_default, - get_local `H >>= infer_type >>= s^.dsimplify >>= trace, - constructor - -example (a b : nat) (H : (λ x : nat, @has_add.add nat (id (id nat.has_add)) a b) = (λ x : nat, @has_add.add nat nat_has_add2 a x)) : true := -by do - s ← simp_lemmas.mk_default, - get_local `H >>= infer_type >>= s^.dsimplify >>= trace, - constructor - -attribute [reducible] -definition nat_has_add3 : nat → has_add nat := -λ n, has_add.mk (λ x y : nat, x + y) diff --git a/old_tests/tests/lean/defeq_simp1.lean.expected.out b/old_tests/tests/lean/defeq_simp1.lean.expected.out deleted file mode 100644 index 3b6864c668..0000000000 --- a/old_tests/tests/lean/defeq_simp1.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -@eq.{1} nat (@has_add.add.{0} nat (@id.{1} (has_add.{0} nat) (@id.{1} (has_add.{0} nat) nat.has_add)) a b) (nat.add a b) -@eq.{1} (nat → nat) - (λ (x : nat), @has_add.add.{0} nat (@id.{1} (has_add.{0} nat) (@id.{1} (has_add.{0} nat) nat.has_add)) a b) - (nat.add a) diff --git a/old_tests/tests/lean/defeq_simp2.lean b/old_tests/tests/lean/defeq_simp2.lean deleted file mode 100644 index 0a5d968c90..0000000000 --- a/old_tests/tests/lean/defeq_simp2.lean +++ /dev/null @@ -1,37 +0,0 @@ -open tactic - -constant f (n : nat) : n ≥ 0 → nat - -axiom foo1 (n : nat) : n ≥ 0 -axiom foo2 (n : nat) : n ≥ 0 -axiom foo3 (n : nat) : n ≥ 0 - - -- by default we dont canonize proofs -example (a b : nat) (H : f a (foo1 a) = f a (foo2 a)) : true := -by do - s ← simp_lemmas.mk_default, - e ← get_local `H >>= infer_type, s^.dsimplify [] e {fail_if_unchanged := ff} >>= trace, - constructor - -constant x1 : nat -- update the environment to force defeq_canonize cache to be reset - -example (a b : nat) (H : f a (foo1 a) = f a (foo2 a)) : true := -by do - s ← simp_lemmas.mk_default, - e ← get_local `H >>= infer_type, s^.dsimplify [] e {fail_if_unchanged := ff} >>= trace, - constructor - -constant x2 : nat -- update the environment to force defeq_canonize cache to be reset - -example (a b : nat) (H : f a (id (id (id (foo1 a)))) = f a (foo2 a)) : true := -by do - s ← simp_lemmas.mk_default, - get_local `H >>= infer_type >>= s^.dsimplify >>= trace, - constructor - --- Example that does not work -example (a b : nat) (H : (λ x, f x (id (id (id (foo1 x))))) = (λ x, f x (foo2 x))) : true := -by do - s ← simp_lemmas.mk_default, - get_local `H >>= infer_type >>= s^.dsimplify >>= trace, - constructor diff --git a/old_tests/tests/lean/defeq_simp2.lean.expected.out b/old_tests/tests/lean/defeq_simp2.lean.expected.out deleted file mode 100644 index 842a4afaf9..0000000000 --- a/old_tests/tests/lean/defeq_simp2.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -f a _ = f a _ -f a _ = f a _ -f a _ = f a _ -(λ (x : ℕ), f x _) = λ (x : ℕ), f x _ diff --git a/old_tests/tests/lean/defeq_simp3.lean b/old_tests/tests/lean/defeq_simp3.lean deleted file mode 100644 index 9768789142..0000000000 --- a/old_tests/tests/lean/defeq_simp3.lean +++ /dev/null @@ -1,16 +0,0 @@ -attribute [reducible] -definition nat_has_add2 : has_add nat := -has_add.mk (λ x y : nat, x + y) - -attribute [reducible] -definition nat_has_add3 : nat → has_add nat := -λ n, has_add.mk (λ x y : nat, x + y) - -open tactic -set_option pp.all true - -example (a b : nat) (H : (λ x : nat, @has_add.add nat nat_has_add2 a x) = (λ x : nat, @has_add.add nat (nat_has_add3 x) a b)) : true := -by do - s ← simp_lemmas.mk_default, - get_local `H >>= infer_type >>= s^.dsimplify >>= trace, - constructor diff --git a/old_tests/tests/lean/defeq_simp3.lean.expected.out b/old_tests/tests/lean/defeq_simp3.lean.expected.out deleted file mode 100644 index b2c1d2fe82..0000000000 --- a/old_tests/tests/lean/defeq_simp3.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -@eq.{1} (nat → nat) (@has_add.add.{0} nat nat.has_add a) (λ (x : nat), @has_add.add.{0} nat nat.has_add a b) diff --git a/old_tests/tests/lean/defeq_simp4.lean b/old_tests/tests/lean/defeq_simp4.lean deleted file mode 100644 index 41703ad2b9..0000000000 --- a/old_tests/tests/lean/defeq_simp4.lean +++ /dev/null @@ -1,25 +0,0 @@ -attribute [reducible] -definition nat_has_add2 : has_add nat := -has_add.mk (λ x y : nat, x + y) - -attribute [reducible] -definition nat_has_add3 : nat → has_add nat := -λ n, has_add.mk (λ x y : nat, x + y) - -open tactic -set_option pp.all true - --- Example where instance canonization does not work. --- Remark: we can "fix" it by re-running defeq_simp until there is no change. --- However, this is too expensive. Well, if users want they can define their own defeq_simp that implements this --- behavior. -example (a b : nat) (H : (λ x : nat, @has_add.add nat (nat_has_add3 x) a b) = (λ x : nat, @has_add.add nat nat_has_add2 a x)) : true := -by do - s ← simp_lemmas.mk_default, - e ← get_local `H >>= infer_type, s^.dsimplify [] e {fail_if_unchanged := ff} >>= trace, - trace "---------", - -- The following should work - e ← get_local `H >>= infer_type, - e ← s^.dsimplify [] e {fail_if_unchanged := ff}, - s^.dsimplify [] e {fail_if_unchanged := ff} >>= trace, - constructor diff --git a/old_tests/tests/lean/defeq_simp4.lean.expected.out b/old_tests/tests/lean/defeq_simp4.lean.expected.out deleted file mode 100644 index dc01e3458a..0000000000 --- a/old_tests/tests/lean/defeq_simp4.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -@eq.{1} (nat → nat) (λ (x : nat), @has_add.add.{0} nat nat.has_add a b) (@has_add.add.{0} nat nat.has_add a) ---------- -@eq.{1} (nat → nat) (λ (x : nat), @has_add.add.{0} nat nat.has_add a b) (@has_add.add.{0} nat nat.has_add a) diff --git a/old_tests/tests/lean/defeq_simp5.lean b/old_tests/tests/lean/defeq_simp5.lean deleted file mode 100644 index efde3736a1..0000000000 --- a/old_tests/tests/lean/defeq_simp5.lean +++ /dev/null @@ -1,21 +0,0 @@ -attribute [reducible] -definition nat_has_add2 : has_add nat := -has_add.mk (λ x y : nat, x + y) - -attribute [reducible] -definition nat_has_add3 : nat → has_add nat := -λ n, has_add.mk (λ x y : nat, x + y) - -open tactic -set_option pp.all true - --- Example where instance canonization does not work. --- This is a different issue. We can only make them work if we normalize (nat_has_add3 x) and (nat_has_add3 y). --- Again, the user can workaround it by manually normalizing these instances before invoking defeq_simp. -example (a b : nat) - (H : (λ x y : nat, @has_add.add nat (nat_has_add3 x) a b) = - (λ x y : nat, @has_add.add nat (nat_has_add3 y) a x)) : true := -by do - s ← simp_lemmas.mk_default, - get_local `H >>= infer_type >>= s^.dsimplify >>= trace, - constructor diff --git a/old_tests/tests/lean/defeq_simp5.lean.expected.out b/old_tests/tests/lean/defeq_simp5.lean.expected.out deleted file mode 100644 index 92d6111f52..0000000000 --- a/old_tests/tests/lean/defeq_simp5.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -@eq.{1} (nat → nat → nat) (λ (x y : nat), @has_add.add.{0} nat nat.has_add a b) - (λ (x y : nat), @has_add.add.{0} nat nat.has_add a x) diff --git a/old_tests/tests/lean/dep_bug.lean b/old_tests/tests/lean/dep_bug.lean deleted file mode 100644 index a87316a5f7..0000000000 --- a/old_tests/tests/lean/dep_bug.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - - - -example (a b c : nat) (H : c = b) : a + c = a + b := -by do - N ← to_expr ``(nat), - define `v N, - trace_state, - trace "------------", - to_expr ```(a + b) >>= exact, - trace_state, - trace "------------", - get_local `H >>= subst, - trace_state, - to_expr ```(eq.refl v) >>= exact diff --git a/old_tests/tests/lean/dep_bug.lean.expected.out b/old_tests/tests/lean/dep_bug.lean.expected.out deleted file mode 100644 index 7a313fc5c0..0000000000 --- a/old_tests/tests/lean/dep_bug.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -2 goals -a b c : ℕ, -H : c = b -⊢ ℕ - -a b c : ℕ, -H : c = b, -v : ℕ := ?m_1 -⊢ a + c = a + b ------------- -a b c : ℕ, -H : c = b, -v : ℕ := a + b -⊢ a + c = a + b ------------- -a c : ℕ, -v : ℕ := a + c -⊢ a + c = a + c diff --git a/old_tests/tests/lean/dep_cases_clear_hyp.lean b/old_tests/tests/lean/dep_cases_clear_hyp.lean deleted file mode 100644 index 2136832812..0000000000 --- a/old_tests/tests/lean/dep_cases_clear_hyp.lean +++ /dev/null @@ -1,21 +0,0 @@ -universes u v - -inductive tree (α : Type u) -| leaf {} : tree -| node (l : tree) (v : α) (r : tree) : tree - -namespace tree -variables {α : Type u} - -inductive is_searchable (lt : α → α → Prop) : tree α → α → α → Prop -| leaf_s {lo hi} : lt lo hi → is_searchable leaf lo hi -| node_s {l r v lo hi} (hs₁ : is_searchable l lo v) (hs₂ : is_searchable r v hi) : is_searchable (node l v r) lo hi - -example (l r : tree α) {lo v hi lt} (h : is_searchable lt (node l v r) lo hi) : true := -begin - cases h, - trace_state, /- Should not contain h -/ - trivial -end - -end tree diff --git a/old_tests/tests/lean/dep_cases_clear_hyp.lean.expected.out b/old_tests/tests/lean/dep_cases_clear_hyp.lean.expected.out deleted file mode 100644 index 9266c36dae..0000000000 --- a/old_tests/tests/lean/dep_cases_clear_hyp.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -α : Type u, -l r : tree α, -lo v hi : α, -lt : α → α → Prop, -h_hs₁ : is_searchable lt l lo v, -h_hs₂ : is_searchable lt r v hi -⊢ true diff --git a/old_tests/tests/lean/derive.lean b/old_tests/tests/lean/derive.lean deleted file mode 100644 index f1ea5bdb53..0000000000 --- a/old_tests/tests/lean/derive.lean +++ /dev/null @@ -1,16 +0,0 @@ -@[derive has_reflect] -inductive foo (α β : Type*) -| bar : ℕ → foo -| baz : foo → α → foo - -#check foo.has_reflect - --- indexed families - -@[derive [decidable_eq, has_sizeof]] -inductive {u} foo' (α β : Type u) (n : nat) : nat → Type u -| bar : ℕ → foo' 0 -| baz (n : nat) : foo' n → α → foo' (nat.succ n) - -#check foo'.decidable_eq -#check foo'.has_sizeof diff --git a/old_tests/tests/lean/derive.lean.expected.out b/old_tests/tests/lean/derive.lean.expected.out deleted file mode 100644 index 35bb0971d4..0000000000 --- a/old_tests/tests/lean/derive.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -foo.has_reflect : - Π (α : Type) [a : has_reflect α] (β : Type) [a : has_reflect β] [a : reflected α] [a : reflected β], - has_reflect (foo α β) -foo'.decidable_eq : - Π (α : Type u_1) [a : decidable_eq α] (β : Type u_1) [a : decidable_eq β] (n a : ℕ), - decidable_eq (foo' α β n a) -foo'.has_sizeof : - Π (α : Type u_1) [a : has_sizeof α] (β : Type u_1) [a : has_sizeof β] (n a : ℕ), has_sizeof (foo' α β n a) diff --git a/old_tests/tests/lean/div_eqn.lean b/old_tests/tests/lean/div_eqn.lean deleted file mode 100644 index 091f0768e3..0000000000 --- a/old_tests/tests/lean/div_eqn.lean +++ /dev/null @@ -1,9 +0,0 @@ -def Div : nat → nat → nat -| x y := - if h : 0 < y ∧ y ≤ x then - have x - y < x, from nat.sub_lt (nat.lt_of_lt_of_le h.left h.right) h.left, - Div (x - y) y + 1 - else - 0 - -#check Div.equations._eqn_1 diff --git a/old_tests/tests/lean/div_eqn.lean.expected.out b/old_tests/tests/lean/div_eqn.lean.expected.out deleted file mode 100644 index c4fe063bd3..0000000000 --- a/old_tests/tests/lean/div_eqn.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -Div.equations._eqn_1 : ∀ (x y : ℕ), Div x y = ite (0 < y ∧ y ≤ x) (Div (x - y) y + 1) 0 diff --git a/old_tests/tests/lean/do_match_fail.lean b/old_tests/tests/lean/do_match_fail.lean deleted file mode 100644 index 4ce087c014..0000000000 --- a/old_tests/tests/lean/do_match_fail.lean +++ /dev/null @@ -1,25 +0,0 @@ -open tactic - -meta def no_intros : tactic unit := -do [] ← intros, return () - -example (p q : Prop) : p → q → p := -begin - no_intros -- Should fail -end - -example (p q : Prop) : p → q → p := -begin - intros, - no_intros, -- Should work - assumption -end - -example : list nat := -do l ← return $ [1, 2, 3], - h::l ← return l, -- non-exhaustive set of equations - return 1 - -meta example : tactic nat := -do (a, b) ← return (1, 2), -- Ok - return a diff --git a/old_tests/tests/lean/do_match_fail.lean.expected.out b/old_tests/tests/lean/do_match_fail.lean.expected.out deleted file mode 100644 index 503362deca..0000000000 --- a/old_tests/tests/lean/do_match_fail.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -do_match_fail.lean:8:2: error: match failed -state: -p q : Prop, -a : p, -a_1 : q -⊢ p -do_match_fail.lean:20:3: error: non-exhaustive match, the following cases are missing: -_example._match_1 list.nil -do_match_fail.lean:18:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/dsimp_whnf.lean b/old_tests/tests/lean/dsimp_whnf.lean deleted file mode 100644 index d4ea67b6b8..0000000000 --- a/old_tests/tests/lean/dsimp_whnf.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic - -example (a b : nat) : ((a + 1, b).1) = a + 1 := -by do - dsimp_target, - trace_state, - reflexivity diff --git a/old_tests/tests/lean/dsimp_whnf.lean.expected.out b/old_tests/tests/lean/dsimp_whnf.lean.expected.out deleted file mode 100644 index 64b591f6dc..0000000000 --- a/old_tests/tests/lean/dsimp_whnf.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -a b : ℕ -⊢ a + 1 = a + 1 diff --git a/old_tests/tests/lean/dsimp_whnf_post.lean b/old_tests/tests/lean/dsimp_whnf_post.lean deleted file mode 100644 index 8c944e6d88..0000000000 --- a/old_tests/tests/lean/dsimp_whnf_post.lean +++ /dev/null @@ -1,6 +0,0 @@ -structure Foo := (foo : unit) - -def my_foo : Foo := Foo.mk () -@[simp] lemma my_foo.def : my_foo = Foo.mk () := rfl - -example : Foo.foo my_foo = () := by dsimp diff --git a/old_tests/tests/lean/dsimp_whnf_post.lean.expected.out b/old_tests/tests/lean/dsimp_whnf_post.lean.expected.out deleted file mode 100644 index c639c7f44c..0000000000 --- a/old_tests/tests/lean/dsimp_whnf_post.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -dsimp_whnf_post.lean:6:36: error: tactic failed, there are unsolved goals -state: -⊢ () = () diff --git a/old_tests/tests/lean/dunfold_constant.lean b/old_tests/tests/lean/dunfold_constant.lean deleted file mode 100644 index cb6c3ca0e5..0000000000 --- a/old_tests/tests/lean/dunfold_constant.lean +++ /dev/null @@ -1,2 +0,0 @@ -def foo : list ℕ := [2] -lemma bar : foo = foo := by dunfold foo diff --git a/old_tests/tests/lean/dunfold_constant.lean.expected.out b/old_tests/tests/lean/dunfold_constant.lean.expected.out deleted file mode 100644 index b74eea8e5c..0000000000 --- a/old_tests/tests/lean/dunfold_constant.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -dunfold_constant.lean:2:28: error: tactic failed, there are unsolved goals -state: -⊢ [2] = [2] diff --git a/old_tests/tests/lean/elab1.lean b/old_tests/tests/lean/elab1.lean deleted file mode 100644 index 5d356af7d5..0000000000 --- a/old_tests/tests/lean/elab1.lean +++ /dev/null @@ -1,25 +0,0 @@ -definition foo.subst := @eq.subst -definition boo.subst := @eq.subst - -definition foo.add := @has_add.add -definition boo.add := @has_add.add - -set_option pp.all true - -open foo boo has_add -#print raw subst -- subst is overloaded -#print raw add -- add is overloaded - -#check @subst - -#check @@subst - -open eq - -#check subst - -constants a b : nat -constant H1 : a = b -constant H2 : a + b > 0 - -#check eq.subst H1 H2 diff --git a/old_tests/tests/lean/elab1.lean.expected.out b/old_tests/tests/lean/elab1.lean.expected.out deleted file mode 100644 index ec6956041f..0000000000 --- a/old_tests/tests/lean/elab1.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -[choice boo.subst foo.subst] -[choice has_add.add boo.add foo.add] -elab1.lean:13:7: error: invalid '@', function is overloaded, use fully qualified names (overloads: boo.subst, foo.subst) -elab1.lean:15:7: error: invalid '@@', function is overloaded, use fully qualified names (overloads: boo.subst, foo.subst) -elab1.lean:19:7: error: invalid overloaded application, elaborator has special support for 'eq.subst' (it is handled as an "eliminator"), but this kind of constant cannot be overloaded (solution: use fully qualified names) (overloads: eq.subst, boo.subst, foo.subst) -elab1.lean:25:7: error: invalid 'eq.subst' application, elaborator has special support for this kind of application (it is handled as an "eliminator"), but the expected type must be known diff --git a/old_tests/tests/lean/elab11.lean b/old_tests/tests/lean/elab11.lean deleted file mode 100644 index ae334479c1..0000000000 --- a/old_tests/tests/lean/elab11.lean +++ /dev/null @@ -1,16 +0,0 @@ -constant boo.f : nat → bool -constant bla.f : nat → nat - -open boo bla - -#check f 1 - -set_option pp.full_names true - -#check (f 1 : nat) - -#check (f 1 : bool) - -set_option pp.full_names false - -#check (f 1 : string) diff --git a/old_tests/tests/lean/elab11.lean.expected.out b/old_tests/tests/lean/elab11.lean.expected.out deleted file mode 100644 index 4f8bb05ed7..0000000000 --- a/old_tests/tests/lean/elab11.lean.expected.out +++ /dev/null @@ -1,44 +0,0 @@ -elab11.lean:6:7: error: ambiguous overload, possible interpretations - bla.f 1 - boo.f 1 -Additional information: -elab11.lean:6:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -bla.f 1 : ℕ -boo.f 1 : bool -elab11.lean:16:8: error: none of the overloads are applicable -error for bla.f -invalid overload, term - f 1 -has type - ℕ -but is expected to have type - string - -error for boo.f -invalid overload, term - f 1 -has type - bool -but is expected to have type - string -Additional information: -elab11.lean:16:8: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type, because failed to elaborate all candidates using the expected type - string -this can happen because, for example, coercions were not considered in the process -none of the overloads are applicable -error for bla.f -type mismatch, term - f ?m_1 -has type - ℕ -but is expected to have type - string - -error for boo.f -type mismatch, term - f ?m_1 -has type - bool -but is expected to have type - string -⁇ : string diff --git a/old_tests/tests/lean/elab12.lean b/old_tests/tests/lean/elab12.lean deleted file mode 100644 index c7ed5d7321..0000000000 --- a/old_tests/tests/lean/elab12.lean +++ /dev/null @@ -1,14 +0,0 @@ -#check (assume a : nat, have H : 0, from rfl a, - (H a a) : ∀ a : nat, a = a) - -#check (assume a : nat, have H : a = a, from rfl a, - (H a a) : ∀ a : nat, a = a) - -#check (assume a : nat, have H : a = a, from a + 0, - (H a a) : ∀ a : nat, a = a) - -#check (assume a : nat, have H : a = a, from rfl, - (H a) : ∀ a : nat, a = a) - -#check (assume a : nat, have H : a = a, from rfl, - H : ∀ a : nat, a = a) diff --git a/old_tests/tests/lean/elab12.lean.expected.out b/old_tests/tests/lean/elab12.lean.expected.out deleted file mode 100644 index b5eb25bd58..0000000000 --- a/old_tests/tests/lean/elab12.lean.expected.out +++ /dev/null @@ -1,41 +0,0 @@ -elab12.lean:1:33: error: type expected at - 0 -term has type - ℕ -elab12.lean:1:41: error: function expected at - rfl -term has type - ?m_2 = ?m_2 -Additional information: -elab12.lean:1:41: context: switched to simple application elaboration procedure because failed to use expected type to elaborate it, error message - too many arguments -λ (a : ℕ), have H : ⁇, from ⁇, ⁇ : ∀ (a : ℕ), a = a -elab12.lean:4:45: error: function expected at - rfl -term has type - ?m_2 = ?m_2 -Additional information: -elab12.lean:4:45: context: switched to simple application elaboration procedure because failed to use expected type to elaborate it, error message - too many arguments -elab12.lean:5:2: error: function expected at - H -term has type - a = a -λ (a : ℕ), have H : a = a, from ⁇, ⁇ : ∀ (a : ℕ), a = a -elab12.lean:7:47: error: invalid have-expression, term - a + 0 -has type - ℕ : Type -but is expected to have type - a = a : Prop -elab12.lean:8:2: error: function expected at - H -term has type - a = a -λ (a : ℕ), have H : a = a, from ⁇, ⁇ : ∀ (a : ℕ), a = a -elab12.lean:11:2: error: function expected at - H -term has type - a = a -λ (a : ℕ), have H : a = a, from rfl, ⁇ : ∀ (a : ℕ), a = a -λ (a : ℕ), have H : a = a, from rfl, H : ∀ (a : ℕ), a = a diff --git a/old_tests/tests/lean/elab13.lean b/old_tests/tests/lean/elab13.lean deleted file mode 100644 index 810d83813a..0000000000 --- a/old_tests/tests/lean/elab13.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic list - -#check -assume c : name, -( -do { - env ← get_env, - decl ← returnex (environment.get env c), - num ← return (length (declaration.univ_params decl)), - ls ← mk_num_meta_univs 2, - return (expr.const c ls) - -} : tactic expr) diff --git a/old_tests/tests/lean/elab13.lean.expected.out b/old_tests/tests/lean/elab13.lean.expected.out deleted file mode 100644 index af9ce94831..0000000000 --- a/old_tests/tests/lean/elab13.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -λ (c : name), - get_env >>= - λ (env : environment), - returnex (environment.get env c) >>= - λ (decl : declaration), - return (length (declaration.univ_params decl)) >>= - λ (num : ℕ), mk_num_meta_univs 2 >>= λ (ls : list level), return (expr.const c ls) : - name → tactic expr diff --git a/old_tests/tests/lean/elab14.lean b/old_tests/tests/lean/elab14.lean deleted file mode 100644 index de1d006614..0000000000 --- a/old_tests/tests/lean/elab14.lean +++ /dev/null @@ -1,3 +0,0 @@ -set_option pp.all true -universe variables u -#check λ (A B : Type u) (a : A) (b : B), a diff --git a/old_tests/tests/lean/elab14.lean.expected.out b/old_tests/tests/lean/elab14.lean.expected.out deleted file mode 100644 index 200985f454..0000000000 --- a/old_tests/tests/lean/elab14.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -λ (A B : Type u) (a : A) (b : B), a : Π (A B : Type u), A → B → A diff --git a/old_tests/tests/lean/elab15.lean b/old_tests/tests/lean/elab15.lean deleted file mode 100644 index e1cc828aa6..0000000000 --- a/old_tests/tests/lean/elab15.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic -set_option pp.notation false -universe variables u -#check -λ (A : Type u) (a b c d : A) (H₁ : a = b) (H₂ : c = b) (H₃ : d = c), -have a = c, by do { transitivity, assumption, symmetry, assumption }, -show a = d, by do { transitivity, this ← get_local "this", exact this, symmetry, assumption } diff --git a/old_tests/tests/lean/elab15.lean.expected.out b/old_tests/tests/lean/elab15.lean.expected.out deleted file mode 100644 index 0996fbcfbd..0000000000 --- a/old_tests/tests/lean/elab15.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -λ (A : Type u) (a b c d : A) (H₁ : eq a b) (H₂ : eq c b) (H₃ : eq d c), - have this : eq a c, from eq.trans H₁ (eq.symm H₂), - show eq a d, from eq.trans this (eq.symm H₃) : - ∀ (A : Type u) (a b c d : A), eq a b → eq c b → eq d c → eq a d diff --git a/old_tests/tests/lean/elab2.lean b/old_tests/tests/lean/elab2.lean deleted file mode 100644 index ec19ea0550..0000000000 --- a/old_tests/tests/lean/elab2.lean +++ /dev/null @@ -1,15 +0,0 @@ -definition foo {A B : Type*} [has_add A] (a : A) (b : B) : A := -a - --- set_option trace.elaborator true --- set_option trace.elaborator_detail true - -set_option pp.all true -#check foo 0 1 - -definition bla {A B : Type*} (a₁ a₂ : A) (b : B) : A := -a₁ - -#check bla nat.zero tt 1 - -#check bla 0 0 tt diff --git a/old_tests/tests/lean/elab2.lean.expected.out b/old_tests/tests/lean/elab2.lean.expected.out deleted file mode 100644 index 22431f4f8d..0000000000 --- a/old_tests/tests/lean/elab2.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -@foo.{0 0} nat nat nat.has_add (@has_zero.zero.{0} nat nat.has_zero) (@has_one.one.{0} nat nat.has_one) : nat -elab2.lean:13:7: error: type mismatch at application - @bla.{0 ?l_1} nat ?m_2 nat.zero bool.tt -term - bool.tt -has type - bool -but is expected to have type - nat -@bla.{0 0} nat bool (@has_zero.zero.{0} nat nat.has_zero) (@has_zero.zero.{0} nat nat.has_zero) bool.tt : nat diff --git a/old_tests/tests/lean/elab3.lean b/old_tests/tests/lean/elab3.lean deleted file mode 100644 index 636603f4f4..0000000000 --- a/old_tests/tests/lean/elab3.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic - -set_option pp.all true - - -#check trace_state >> trace_state diff --git a/old_tests/tests/lean/elab3.lean.expected.out b/old_tests/tests/lean/elab3.lean.expected.out deleted file mode 100644 index 677f39791a..0000000000 --- a/old_tests/tests/lean/elab3.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -@has_bind.and_then.{0 0} unit unit tactic.{0} - (@monad.to_has_bind.{0 0} tactic.{0} (@interaction_monad.monad.{0} tactic_state)) - tactic.trace_state - tactic.trace_state : - tactic.{0} unit diff --git a/old_tests/tests/lean/elab4.lean b/old_tests/tests/lean/elab4.lean deleted file mode 100644 index 29300b21f8..0000000000 --- a/old_tests/tests/lean/elab4.lean +++ /dev/null @@ -1,23 +0,0 @@ -definition foo.f {A : Type*} {B : Type*} (a : A) (b : B) : A := a - -definition boo.f (a : nat) (b : nat) (c : nat) := a + b + c - -definition bla.f (a b c d : bool) := a - -open boo foo bla - -set_option pp.full_names true - -#check f 0 1 2 - -#check f 0 1 2 3 - -#check f 0 1 - -#check f tt 2 - -#check f tt ff tt - -#check f tt ff - -#check @foo.f _ _ 0 1 diff --git a/old_tests/tests/lean/elab4.lean.expected.out b/old_tests/tests/lean/elab4.lean.expected.out deleted file mode 100644 index 0543484cd8..0000000000 --- a/old_tests/tests/lean/elab4.lean.expected.out +++ /dev/null @@ -1,32 +0,0 @@ -boo.f 0 1 2 : ℕ -elab4.lean:13:7: error: none of the overloads are applicable -error for bla.f -failed to synthesize type class instance for -⊢ has_add bool - -error for foo.f -function expected at - foo.f 0 1 -term has type - ?m_1 - -error for boo.f -function expected at - boo.f 0 1 2 -term has type - ℕ -Additional information: -elab4.lean:13:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -elab4.lean:15:7: error: ambiguous overload, possible interpretations - foo.f 0 1 - boo.f 0 1 -Additional information: -elab4.lean:15:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -foo.f bool.tt 2 : bool -bla.f bool.tt bool.ff bool.tt : bool → bool -elab4.lean:21:7: error: ambiguous overload, possible interpretations - bla.f bool.tt bool.ff - foo.f bool.tt bool.ff -Additional information: -elab4.lean:21:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -foo.f 0 1 : ℕ diff --git a/old_tests/tests/lean/elab4b.lean b/old_tests/tests/lean/elab4b.lean deleted file mode 100644 index 86135581c1..0000000000 --- a/old_tests/tests/lean/elab4b.lean +++ /dev/null @@ -1,13 +0,0 @@ -definition foo.f {A : Type*} {B : Type*} (a : A) (b : B) : A := a - -definition boo.f (a : nat) (b : nat) (c : nat) := a + b + c - -definition bla.f (a b c d : bool) := a - -open boo foo bla - -#check f 0 1 2 3 - -#check f 0 1 - -#check f tt ff diff --git a/old_tests/tests/lean/elab4b.lean.expected.out b/old_tests/tests/lean/elab4b.lean.expected.out deleted file mode 100644 index aab1247a6e..0000000000 --- a/old_tests/tests/lean/elab4b.lean.expected.out +++ /dev/null @@ -1,28 +0,0 @@ -elab4b.lean:9:7: error: none of the overloads are applicable -error for bla.f -failed to synthesize type class instance for -⊢ has_add bool - -error for foo.f -function expected at - f 0 1 -term has type - ?m_1 - -error for boo.f -function expected at - f 0 1 2 -term has type - ℕ -Additional information: -elab4b.lean:9:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -elab4b.lean:11:7: error: ambiguous overload, possible interpretations - foo.f 0 1 - boo.f 0 1 -Additional information: -elab4b.lean:11:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -elab4b.lean:13:7: error: ambiguous overload, possible interpretations - bla.f bool.tt bool.ff - foo.f bool.tt bool.ff -Additional information: -elab4b.lean:13:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available diff --git a/old_tests/tests/lean/elab5.lean b/old_tests/tests/lean/elab5.lean deleted file mode 100644 index 6781c764fb..0000000000 --- a/old_tests/tests/lean/elab5.lean +++ /dev/null @@ -1,3 +0,0 @@ -constant s : sum nat bool - -#check @eq.refl (sum nat bool) s diff --git a/old_tests/tests/lean/elab5.lean.expected.out b/old_tests/tests/lean/elab5.lean.expected.out deleted file mode 100644 index afaccd8457..0000000000 --- a/old_tests/tests/lean/elab5.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -eq.refl s : s = s diff --git a/old_tests/tests/lean/elab6.lean b/old_tests/tests/lean/elab6.lean deleted file mode 100644 index 74e361575b..0000000000 --- a/old_tests/tests/lean/elab6.lean +++ /dev/null @@ -1,17 +0,0 @@ -constant R : nat → nat → Prop -constant H : transitive R -set_option pp.all true - -constant F : ∀ {A : Type*} ⦃a : A⦄ {b : A} (c : A) ⦃e : A⦄, A → A → A - -#check H -#check F -#check F tt -#check F tt tt -#check F tt tt tt - -#check H -#check F -#check F tt -#check F tt tt -#check F tt tt tt diff --git a/old_tests/tests/lean/elab6.lean.expected.out b/old_tests/tests/lean/elab6.lean.expected.out deleted file mode 100644 index ff4b1ada64..0000000000 --- a/old_tests/tests/lean/elab6.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -H : @transitive.{1} nat R -@F.{u_1} ?M_1 : Π ⦃a : ?M_1⦄ {b : ?M_1}, ?M_1 → Π ⦃e : ?M_1⦄, ?M_1 → ?M_1 → ?M_1 -@F.{0} bool ?M_1 ?M_2 bool.tt : Π ⦃e : bool⦄, bool → bool → bool -@F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt : bool → bool -@F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt bool.tt : bool -H : @transitive.{1} nat R -@F.{u_1} ?M_1 : Π ⦃a : ?M_1⦄ {b : ?M_1}, ?M_1 → Π ⦃e : ?M_1⦄, ?M_1 → ?M_1 → ?M_1 -@F.{0} bool ?M_1 ?M_2 bool.tt : Π ⦃e : bool⦄, bool → bool → bool -@F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt : bool → bool -@F.{0} bool ?M_1 ?M_2 bool.tt ?M_3 bool.tt bool.tt : bool diff --git a/old_tests/tests/lean/elab7.lean b/old_tests/tests/lean/elab7.lean deleted file mode 100644 index 1f537ada87..0000000000 --- a/old_tests/tests/lean/elab7.lean +++ /dev/null @@ -1,10 +0,0 @@ -set_option pp.all true -set_option pp.purify_metavars false - -#check λ x : nat, x + 1 - -#check λ x y : nat, x + y - -#check λ x y, x + y + 1 - -#check λ x, (x + 1) :: [] diff --git a/old_tests/tests/lean/elab7.lean.expected.out b/old_tests/tests/lean/elab7.lean.expected.out deleted file mode 100644 index 3d6bca78e1..0000000000 --- a/old_tests/tests/lean/elab7.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -λ (x : nat), @has_add.add.{0} nat nat.has_add x (@has_one.one.{0} nat nat.has_one) : nat → nat -λ (x y : nat), @has_add.add.{0} nat nat.has_add x y : nat → nat → nat -λ (x y : nat), - @has_add.add.{0} nat nat.has_add (@has_add.add.{0} nat nat.has_add x y) (@has_one.one.{0} nat nat.has_one) : - nat → nat → nat -λ (x : nat), - @list.cons.{0} nat (@has_add.add.{0} nat nat.has_add x (@has_one.one.{0} nat nat.has_one)) (@list.nil.{0} nat) : - nat → list.{0} nat diff --git a/old_tests/tests/lean/elab8.lean b/old_tests/tests/lean/elab8.lean deleted file mode 100644 index bd447c76a5..0000000000 --- a/old_tests/tests/lean/elab8.lean +++ /dev/null @@ -1,10 +0,0 @@ -set_option pp.notation false -set_option pp.implicit true -set_option pp.numerals false -set_option pp.binder_types true - -#check λ (A : Type*) [has_add A] [has_one A] [has_lt A] (a : A), a + 1 - -#check λ (A : Type*) [has_add A] [has_one A] [has_lt A] (a : A) (H : a > 1), a + 1 - -#check λ (A : Type*) [has_add A] [has_one A] [has_lt A] (a : A) (H₁ : a > 1) (H₂ : a < 5), a + 1 diff --git a/old_tests/tests/lean/elab8.lean.expected.out b/old_tests/tests/lean/elab8.lean.expected.out deleted file mode 100644 index f1c713835d..0000000000 --- a/old_tests/tests/lean/elab8.lean.expected.out +++ /dev/null @@ -1,14 +0,0 @@ -λ (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_one A] [_inst_3 : has_lt A] (a : A), - @has_add.add A _inst_1 a (@has_one.one A _inst_2) : - Π (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_one A] [_inst_3 : has_lt A], A → A -λ (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_one A] [_inst_3 : has_lt A] (a : A) -(H : @gt A _inst_3 a (@has_one.one A _inst_2)), @has_add.add A _inst_1 a (@has_one.one A _inst_2) : - Π (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_one A] [_inst_3 : has_lt A] (a : A), - @gt A _inst_3 a (@has_one.one A _inst_2) → A -λ (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_one A] [_inst_3 : has_lt A] (a : A) -(H₁ : @gt A _inst_3 a (@has_one.one A _inst_2)) -(H₂ : @has_lt.lt A _inst_3 a (@bit1 A _inst_2 _inst_1 (@bit0 A _inst_1 (@has_one.one A _inst_2)))), - @has_add.add A _inst_1 a (@has_one.one A _inst_2) : - Π (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_one A] [_inst_3 : has_lt A] (a : A), - @gt A _inst_3 a (@has_one.one A _inst_2) → - @has_lt.lt A _inst_3 a (@bit1 A _inst_2 _inst_1 (@bit0 A _inst_1 (@has_one.one A _inst_2))) → A diff --git a/old_tests/tests/lean/elab9.lean b/old_tests/tests/lean/elab9.lean deleted file mode 100644 index 194f02e1e4..0000000000 --- a/old_tests/tests/lean/elab9.lean +++ /dev/null @@ -1,8 +0,0 @@ -set_option pp.notation false -set_option pp.implicit true -set_option pp.numerals false -set_option pp.binder_types true - -#check λ (A : Type*) [has_add A] [has_zero A] (a : A) (H : a + 0 = a) [has_add A] (H : a = 0 + 0), a + a - -#check λ (a b : nat) (H : a > b) [has_lt nat], a < b diff --git a/old_tests/tests/lean/elab9.lean.expected.out b/old_tests/tests/lean/elab9.lean.expected.out deleted file mode 100644 index 5a4b0acd8a..0000000000 --- a/old_tests/tests/lean/elab9.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -λ (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_zero A] (a : A) -(H : @eq A (@has_add.add A _inst_1 a (@has_zero.zero A _inst_2)) a) [_inst_3 : has_add A] -(H : @eq A a (@has_add.add A _inst_3 (@has_zero.zero A _inst_2) (@has_zero.zero A _inst_2))), - @has_add.add A _inst_3 a a : - Π (A : Type u_1) [_inst_1 : has_add A] [_inst_2 : has_zero A] (a : A), - @eq A (@has_add.add A _inst_1 a (@has_zero.zero A _inst_2)) a → - Π [_inst_3 : has_add A], - @eq A a (@has_add.add A _inst_3 (@has_zero.zero A _inst_2) (@has_zero.zero A _inst_2)) → A -λ (a b : nat) (H : @gt nat nat.has_lt a b) [_inst_1 : has_lt nat], @has_lt.lt nat _inst_1 a b : - Π (a b : nat), @gt nat nat.has_lt a b → Π [_inst_1 : has_lt nat], Prop diff --git a/old_tests/tests/lean/elab_error_msgs.lean b/old_tests/tests/lean/elab_error_msgs.lean deleted file mode 100644 index 70355e8a61..0000000000 --- a/old_tests/tests/lean/elab_error_msgs.lean +++ /dev/null @@ -1,18 +0,0 @@ -lemma ex1 (a b : Prop) : a ∧ b ∧ b → b ∧ a := -and.rec (λ ha hb hb, ha) - -@[elab_as_eliminator] -def bogus_elim {A : Type} {C : A → A → Prop} {a b : A} (h : C a a) : C a b := -sorry - -lemma ex2 (a b : Prop) : a ∧ b := -bogus_elim trivial - -/- -The following one produces a nasty error message since has_add expects a type in universe > 0. - -lemma ex1 (a b : Prop) : a ∧ b ∧ b → b ∧ a := -λ h, and.rec - (λ ha hb, ha + hb) - h --/ diff --git a/old_tests/tests/lean/elab_error_msgs.lean.expected.out b/old_tests/tests/lean/elab_error_msgs.lean.expected.out deleted file mode 100644 index ca9d05ce3c..0000000000 --- a/old_tests/tests/lean/elab_error_msgs.lean.expected.out +++ /dev/null @@ -1,21 +0,0 @@ -elab_error_msgs.lean:2:0: error: type mismatch at application - and.rec (λ (ha : ?m_1) (hb : ?m_2) (hb : ?m_4[ha, hb]), ha) -term - λ (ha : ?m_1) (hb : ?m_2) (hb : ?m_3[ha, hb]), ha -has type - Π (ha : ?m_1) (hb : ?m_2), ?m_3[ha, hb] → ?m_1 -but is expected to have type - ?m_1 → ?m_2 → ?m_3 -Additional information: -elab_error_msgs.lean:2:0: context: 'eliminator' elaboration was not used for 'and.rec' because it is not fully applied, #2 explicit arguments expected -elab_error_msgs.lean:5:0: warning: declaration 'bogus_elim' uses sorry -elab_error_msgs.lean:9:0: error: type mismatch at application - bogus_elim trivial -term - trivial -has type - true -but is expected to have type - ?m_1 ?m_2 ?m_2 -Additional information: -elab_error_msgs.lean:9:0: context: 'eliminator' elaboration is not used for 'bogus_elim' because a (reliable) way to synthesize 'a', which occurs in the resulting type, was not found diff --git a/old_tests/tests/lean/elab_error_recovery.lean b/old_tests/tests/lean/elab_error_recovery.lean deleted file mode 100644 index 6bfb9d213c..0000000000 --- a/old_tests/tests/lean/elab_error_recovery.lean +++ /dev/null @@ -1,22 +0,0 @@ -def half_baked : ℕ → ℕ -| 3 := 2 --- type mismatches -| 0 := 1 + "" --- placeholders -| 5 := _ + 4 --- missing typeclass instances -| 42 := if 2 ∈ 3 then 3 else _ --- exceptions during tactic evaluation -| 7 := by do undefined --- nested elaboration errors -| 10 := begin exact [] end --- missing cases - -#print half_baked._main - -#reduce half_baked 3 -#reduce half_baked 5 -#eval half_baked 3 - --- type errors in binders -#check ∀ x : nat.zero, x = x diff --git a/old_tests/tests/lean/elab_error_recovery.lean.expected.out b/old_tests/tests/lean/elab_error_recovery.lean.expected.out deleted file mode 100644 index 633110a9b7..0000000000 --- a/old_tests/tests/lean/elab_error_recovery.lean.expected.out +++ /dev/null @@ -1,47 +0,0 @@ -elab_error_recovery.lean:4:10: error: type mismatch at application - 1 + "" -term - "" -has type - string -but is expected to have type - ℕ -elab_error_recovery.lean:8:13: error: failed to synthesize type class instance for -half_baked : ℕ → ℕ -⊢ has_mem ℕ ℕ -elab_error_recovery.lean:10:11: error: don't know how to synthesize placeholder -context: -half_baked : ℕ → ℕ -⊢ Type ? -elab_error_recovery.lean:12:20: error: invalid type ascription, term has type - list ?m_1 : Type ? -but is expected to have type - ℕ : Type -state: -half_baked : ℕ → ℕ -⊢ ℕ -elab_error_recovery.lean:6:8: error: don't know how to synthesize placeholder -context: -half_baked : ℕ → ℕ -⊢ ℕ -elab_error_recovery.lean:8:29: error: don't know how to synthesize placeholder -context: -half_baked : ℕ → ℕ -⊢ ℕ -elab_error_recovery.lean:1:4: error: non-exhaustive match, the following cases are missing: -half_baked _ -def half_baked._main : ℕ → ℕ := -λ (a : ℕ), - ite (a = 3) (id_rhs ℕ 2) - (ite (a = 0) (id_rhs ℕ (1 + ⁇)) - (ite (a = 5) (id_rhs ℕ (⁇ + 4)) - (ite (a = 42) (id_rhs ℕ (ite (2 ∈ 3) 3 ⁇)) - (ite (a = 7) (id_rhs ℕ ⁇) (ite (a = 10) (id_rhs ℕ ⁇) ⁇))))) -2 -nat.succ (nat.succ (nat.succ (nat.succ ⁇))) -2 -elab_error_recovery.lean:22:13: error: type expected at - 0 -term has type - ℕ -∀ (x : ⁇), x = x : Prop diff --git a/old_tests/tests/lean/elab_meta2.lean b/old_tests/tests/lean/elab_meta2.lean deleted file mode 100644 index 889dbbe142..0000000000 --- a/old_tests/tests/lean/elab_meta2.lean +++ /dev/null @@ -1,29 +0,0 @@ -#print "parametric meta definition" -meta definition f {A : Type} : nat → A → A → A -| n a b := if n / 2 = 0 then a else f (n / 2) b a -#eval - if f 10 1 2 = 2 then "OK" else "FAILED" - -namespace foo -#print "parametric meta definition inside namespace" -meta definition bla {A : Type} : nat → A → A → A -| n a b := if n / 2 = 0 then a else bla (n / 2) b a -#eval - if foo.bla 10 1 2 = 2 then "OK" else "FAILED" -end foo - -namespace foo -section -#print "meta definition inside parametric scope" -parameter {A : Type} -meta definition bah : nat → A → A → A -| n a b := if n / 2 = 0 then a else bah (n / 2) b a -end -#eval if foo.bah 10 1 2 = 2 then "OK" else "FAILED" -end foo - -#print "private meta definition" -private meta definition hprv {A : Type} : nat → A → A → A -| n a b := if n / 2 = 0 then a else hprv (n / 2) b a -#eval - if hprv 10 1 2 = 2 then "OK" else "FAILED" diff --git a/old_tests/tests/lean/elab_meta2.lean.expected.out b/old_tests/tests/lean/elab_meta2.lean.expected.out deleted file mode 100644 index 6446a99724..0000000000 --- a/old_tests/tests/lean/elab_meta2.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -parametric meta definition -"OK" -parametric meta definition inside namespace -"OK" -meta definition inside parametric scope -"OK" -private meta definition -"OK" diff --git a/old_tests/tests/lean/empty.lean b/old_tests/tests/lean/empty.lean deleted file mode 100644 index 5613cd3518..0000000000 --- a/old_tests/tests/lean/empty.lean +++ /dev/null @@ -1,6 +0,0 @@ --- -open inhabited nonempty classical - -lemma v1 : Prop := epsilon (λ x : Prop, true) -inductive Empty : Type -noncomputable definition v2 : Empty := epsilon (λ x, true) diff --git a/old_tests/tests/lean/empty.lean.expected.out b/old_tests/tests/lean/empty.lean.expected.out deleted file mode 100644 index c0d6a6c209..0000000000 --- a/old_tests/tests/lean/empty.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -empty.lean:6:39: error: failed to synthesize type class instance for -⊢ nonempty Empty diff --git a/old_tests/tests/lean/empty_french_quote.lean b/old_tests/tests/lean/empty_french_quote.lean deleted file mode 100644 index 35201c4e90..0000000000 --- a/old_tests/tests/lean/empty_french_quote.lean +++ /dev/null @@ -1,4 +0,0 @@ -def «» := not -theorem thm : «» false := id -#print «» -#print thm \ No newline at end of file diff --git a/old_tests/tests/lean/empty_french_quote.lean.expected.out b/old_tests/tests/lean/empty_french_quote.lean.expected.out deleted file mode 100644 index 35fff6084a..0000000000 --- a/old_tests/tests/lean/empty_french_quote.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -def «» : Prop → Prop := -not -theorem thm : «» false := -id diff --git a/old_tests/tests/lean/emptyc_errors.lean b/old_tests/tests/lean/emptyc_errors.lean deleted file mode 100644 index f667e4d2fc..0000000000 --- a/old_tests/tests/lean/emptyc_errors.lean +++ /dev/null @@ -1,19 +0,0 @@ -theorem {u} not_mem_empty1 {A : Type u} (x : A) : x ∉ (∅ : set A) := -assume h, h - -theorem {u} not_mem_empty2 {A : Type u} (x : A) : x ∉ ∅ := -- ERROR here -assume h, h - -theorem {u} not_mem_empty3 {A : Type u} (x : A) : x ∉ (∅ : set A) := -assume h : x ∈ ∅, h - -theorem {u} not_mem_empty4 {A : Type u} (x : A) : x ∉ (∅ : set A) := -assume h : x ∈ (∅ : set A), h - -theorem {u} not_mem_empty5 {A : Type u} (x : A) : x ∉ (∅ : set A) := -begin intro h, exact h end - -open tactic - -theorem {u} not_mem_empty6 {A : Type u} (x : A) : x ∉ (∅ : set A) := -by do h ← intro `h, exact h diff --git a/old_tests/tests/lean/emptyc_errors.lean.expected.out b/old_tests/tests/lean/emptyc_errors.lean.expected.out deleted file mode 100644 index 076410d6c4..0000000000 --- a/old_tests/tests/lean/emptyc_errors.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -emptyc_errors.lean:4:52: error: don't know how to synthesize placeholder -context: -A : Type u, -x : A -⊢ has_mem A ?m_1 -emptyc_errors.lean:4:54: error: don't know how to synthesize placeholder -context: -A : Type u, -x : A -⊢ Type ? diff --git a/old_tests/tests/lean/eqn_compiler_ctor.lean b/old_tests/tests/lean/eqn_compiler_ctor.lean deleted file mode 100644 index 91125dd06b..0000000000 --- a/old_tests/tests/lean/eqn_compiler_ctor.lean +++ /dev/null @@ -1,9 +0,0 @@ -inductive term -| var : ℕ → term -| app : term → term → term -| abs : term → term - -open term - -def subst : ∀ σ : ℕ → term, term → term -| var := sorry diff --git a/old_tests/tests/lean/eqn_compiler_ctor.lean.expected.out b/old_tests/tests/lean/eqn_compiler_ctor.lean.expected.out deleted file mode 100644 index a69e398ec1..0000000000 --- a/old_tests/tests/lean/eqn_compiler_ctor.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -eqn_compiler_ctor.lean:8:4: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) diff --git a/old_tests/tests/lean/eqn_compiler_error_msg.lean b/old_tests/tests/lean/eqn_compiler_error_msg.lean deleted file mode 100644 index fb8c3758eb..0000000000 --- a/old_tests/tests/lean/eqn_compiler_error_msg.lean +++ /dev/null @@ -1,5 +0,0 @@ -inductive R : ℕ → Prop -| pos : ∀p n, R (p + n) - -lemma R_id : ∀n, R n → R n -| (.(p) + .(n)) (R.pos p n) := R.pos p n diff --git a/old_tests/tests/lean/eqn_compiler_error_msg.lean.expected.out b/old_tests/tests/lean/eqn_compiler_error_msg.lean.expected.out deleted file mode 100644 index 30f739b496..0000000000 --- a/old_tests/tests/lean/eqn_compiler_error_msg.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -eqn_compiler_error_msg.lean:5:28: error: invalid function application in pattern, it cannot be reduced to a constructor (possible solution, mark term as inaccessible using '.( )') - .p + .n -eqn_compiler_error_msg.lean:4:6: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) diff --git a/old_tests/tests/lean/eqn_compiler_loop.lean b/old_tests/tests/lean/eqn_compiler_loop.lean deleted file mode 100644 index 823ab3f7d9..0000000000 --- a/old_tests/tests/lean/eqn_compiler_loop.lean +++ /dev/null @@ -1,4 +0,0 @@ -open nat - -theorem succ_ne_self : ∀ (n : ℕ), succ n ≠ n -| 0 h := absurd h (nat.succ_ne_zero 0) diff --git a/old_tests/tests/lean/eqn_compiler_loop.lean.expected.out b/old_tests/tests/lean/eqn_compiler_loop.lean.expected.out deleted file mode 100644 index 11a3016fa1..0000000000 --- a/old_tests/tests/lean/eqn_compiler_loop.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -eqn_compiler_loop.lean:3:8: error: non-exhaustive match, the following cases are missing: -succ_ne_self (succ _) _ diff --git a/old_tests/tests/lean/eqn_hole.lean b/old_tests/tests/lean/eqn_hole.lean deleted file mode 100644 index 843772e021..0000000000 --- a/old_tests/tests/lean/eqn_hole.lean +++ /dev/null @@ -1,8 +0,0 @@ - -definition f : nat → nat -| 0 := _ - - -definition g : nat → nat -| 0 := 0 -| (n+1) := g _ + 1 diff --git a/old_tests/tests/lean/eqn_hole.lean.expected.out b/old_tests/tests/lean/eqn_hole.lean.expected.out deleted file mode 100644 index e0ffc31be7..0000000000 --- a/old_tests/tests/lean/eqn_hole.lean.expected.out +++ /dev/null @@ -1,23 +0,0 @@ -eqn_hole.lean:3:7: error: don't know how to synthesize placeholder -context: -f : ℕ → ℕ -⊢ ℕ -eqn_hole.lean:2:11: error: non-exhaustive match, the following cases are missing: -f _ -eqn_hole.lean:8:13: error: don't know how to synthesize placeholder -context: -g : ℕ → ℕ, -n : ℕ -⊢ ℕ -eqn_hole.lean:8:11: error: failed to prove recursive application is decreasing, well founded relation - @has_well_founded.r ℕ (@has_well_founded_of_has_sizeof ℕ nat.has_sizeof) -Possible solutions: - - Use 'using_well_founded' keyword in the end of your definition to specify tactics for synthesizing well founded relations and decreasing proofs. - - The default decreasing tactic uses the 'assumption' tactic, thus hints (aka local proofs) can be provided using 'have'-expressions. -The nested exception contains the failure state for the decreasing tactic. -nested exception message: -failed -state: -g : ℕ → ℕ, -n : ℕ -⊢ ⁇ < n + 1 diff --git a/old_tests/tests/lean/eqn_proof.lean b/old_tests/tests/lean/eqn_proof.lean deleted file mode 100644 index 4665ce83fe..0000000000 --- a/old_tests/tests/lean/eqn_proof.lean +++ /dev/null @@ -1,18 +0,0 @@ -universes u - -inductive node (α : Type u) -| leaf : node -| red_node : node → α → node → node -| black_node : node → α → node → node - -namespace node -variable {α : Type u} - -def balance : node α → α → node α → node α -| (red_node (red_node a x b) y c) k d := red_node (black_node a x b) y (black_node c k d) -| (red_node a x (red_node b y c)) k d := red_node (black_node a x b) y (black_node c k d) -| l k r := black_node l k r - -#print balance._main.equations._eqn_1 - -end node diff --git a/old_tests/tests/lean/eqn_proof.lean.expected.out b/old_tests/tests/lean/eqn_proof.lean.expected.out deleted file mode 100644 index 0630c2a3d0..0000000000 --- a/old_tests/tests/lean/eqn_proof.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -@[_refl_lemma] -theorem node.balance._main.equations._eqn_1 : ∀ {α : Type u} (k : α) (r : node α), balance._main (leaf α) k r = black_node (leaf α) k r := -λ {α : Type u} (k : α) (r : node α), eq.refl (id_delta (balance._main (leaf α) k r)) diff --git a/old_tests/tests/lean/error_full_names.lean b/old_tests/tests/lean/error_full_names.lean deleted file mode 100644 index 8ea3f51965..0000000000 --- a/old_tests/tests/lean/error_full_names.lean +++ /dev/null @@ -1,9 +0,0 @@ -namespace foo -open nat -inductive nat : Type | zero, foosucc : nat → nat -#check 0 + nat.zero --error -end foo - -namespace foo -#check nat.succ nat.zero --error -end foo diff --git a/old_tests/tests/lean/error_full_names.lean.expected.out b/old_tests/tests/lean/error_full_names.lean.expected.out deleted file mode 100644 index 2e86593dc0..0000000000 --- a/old_tests/tests/lean/error_full_names.lean.expected.out +++ /dev/null @@ -1,13 +0,0 @@ -error_full_names.lean:4:7: error: failed to synthesize type class instance for -⊢ has_zero nat -error_full_names.lean:4:9: error: failed to synthesize type class instance for -⊢ has_add nat -0 + nat.zero : nat -error_full_names.lean:8:7: error: type mismatch at application - nat.succ nat.zero -term - nat.zero -has type - nat -but is expected to have type - ℕ diff --git a/old_tests/tests/lean/error_pos.lean b/old_tests/tests/lean/error_pos.lean deleted file mode 100644 index ef4706d2e3..0000000000 --- a/old_tests/tests/lean/error_pos.lean +++ /dev/null @@ -1,16 +0,0 @@ -example (A : Type) (B : A → Type) (b : B) : true := -trivial - -example : ∀ (A : Type) (B : A → Type) (b : B), true := -begin - intros, trivial -end - -#check λ (A : Type) (B : A → Type) (b : B), true - -#check λ (A : Type) (B : A → Type), B → true - -#check λ (A : Type) (B : A → Type) b, (b : B) - -example {A : Type} {B : Type} {a₁ a₂ : B} {b₁ b₂ : A → B} : a₁ = a₂ → (∀ x, b₁ x = b₂ x) → (let x : A := a₁ in b₁ x) = (let x : A := a₂ in b₂ x) := -sorry diff --git a/old_tests/tests/lean/error_pos.lean.expected.out b/old_tests/tests/lean/error_pos.lean.expected.out deleted file mode 100644 index 088d76770c..0000000000 --- a/old_tests/tests/lean/error_pos.lean.expected.out +++ /dev/null @@ -1,36 +0,0 @@ -error_pos.lean:1:39: error: type expected at - B -term has type - A → Type -error_pos.lean:1:0: warning: declaration '[anonymous]' uses sorry -error_pos.lean:4:43: error: type expected at - B -term has type - A → Type -error_pos.lean:9:40: error: type expected at - B -term has type - A → Type -λ (A : Type) (B : A → Type) (b : ⁇), true : Π (A : Type), (A → Type) → ⁇ → Prop -error_pos.lean:11:36: error: type expected at - B -term has type - A → Type -λ (A : Type) (B : A → Type), ⁇ → true : Π (A : Type), (A → Type) → Prop -error_pos.lean:13:43: error: type expected at - B -term has type - A → Type -λ (A : Type) (B : A → Type) (b : ⁇), b : Π (A : Type), (A → Type) → ⁇ → ⁇ -error_pos.lean:15:105: error: invalid let-expression, term - a₁ -has type - B -but is expected to have type - A -error_pos.lean:15:133: error: invalid let-expression, term - a₂ -has type - B -but is expected to have type - A diff --git a/old_tests/tests/lean/errors2.lean b/old_tests/tests/lean/errors2.lean deleted file mode 100644 index a4f45d1d3c..0000000000 --- a/old_tests/tests/lean/errors2.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -namespace foo - -definition tst1 (a b : nat) : nat := -match a with -| 0 := 1 -| (n+1) := foo -end - - -end foo diff --git a/old_tests/tests/lean/errors2.lean.expected.out b/old_tests/tests/lean/errors2.lean.expected.out deleted file mode 100644 index 6aaddc7c5c..0000000000 --- a/old_tests/tests/lean/errors2.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -errors2.lean:8:11: error: unknown identifier 'foo' -errors2.lean:5:0: warning: declaration 'foo.tst1' uses sorry diff --git a/old_tests/tests/lean/escape_id.lean b/old_tests/tests/lean/escape_id.lean deleted file mode 100644 index cd2ac09072..0000000000 --- a/old_tests/tests/lean/escape_id.lean +++ /dev/null @@ -1,18 +0,0 @@ -def «def» := 1 -#check «def» -#check def.equations._eqn_1 - -def «[ ]» := 1 -#check «[ ]» -#check «[» - -def a.«b.c» := 1 -#check a.«b.c» -#check a.b.c -#check «a.b.c» - -#check [1].«length» - -#check ««» -#check « -» diff --git a/old_tests/tests/lean/escape_id.lean.expected.out b/old_tests/tests/lean/escape_id.lean.expected.out deleted file mode 100644 index 06e11c1325..0000000000 --- a/old_tests/tests/lean/escape_id.lean.expected.out +++ /dev/null @@ -1,13 +0,0 @@ -«def» : ℕ -def.equations._eqn_1 : «def» = 1 -«[ ]» : ℕ -escape_id.lean:7:7: error: unknown identifier '«[»' -a.«b.c» : ℕ -escape_id.lean:11:7: error: unknown identifier 'a.b.c' -escape_id.lean:12:7: error: unknown identifier '«a.b.c»' -list.length [1] : ℕ -escape_id.lean:16:8: error: illegal character in escaped identifier -escape_id.lean:17:0: error: invalid expression, unexpected token -escape_id.lean:17:8: error: illegal character in escaped identifier -escape_id.lean:18:0: error: unexpected token -escape_id.lean:18:1: error: invalid expression, unexpected token diff --git a/old_tests/tests/lean/eta_bug.lean b/old_tests/tests/lean/eta_bug.lean deleted file mode 100644 index 33a1e6124e..0000000000 --- a/old_tests/tests/lean/eta_bug.lean +++ /dev/null @@ -1,4 +0,0 @@ --- -#reduce λ (A : Type*) (x y : A) (H₁ : x = y) (H₂ : y = x), eq.trans H₁ H₂ --- Should not reduce to --- λ (A : Type*) (x y : A), eq.trans diff --git a/old_tests/tests/lean/eta_bug.lean.expected.out b/old_tests/tests/lean/eta_bug.lean.expected.out deleted file mode 100644 index 971634a46d..0000000000 --- a/old_tests/tests/lean/eta_bug.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -λ (A : Type u_1) (x y : A) (H₁ : x = y) (H₂ : y = x), eq.rec H₁ H₂ diff --git a/old_tests/tests/lean/eta_tac.lean b/old_tests/tests/lean/eta_tac.lean deleted file mode 100644 index da49a5f8f3..0000000000 --- a/old_tests/tests/lean/eta_tac.lean +++ /dev/null @@ -1,15 +0,0 @@ -open tactic - -set_option pp.binder_types true -set_option pp.implicit true -set_option pp.notation false - -example (a : nat) : true := -by do - mk_const `has_add.add >>= head_eta_expand >>= trace, - mk_const `nat.succ >>= head_eta_expand >>= trace, - to_expr ```(has_add.add a) >>= head_eta_expand >>= trace, - to_expr ``(λ x : nat, has_add.add x) >>= head_eta_expand >>= trace, - to_expr ``(λ x : nat, has_add.add x) >>= head_eta >>= trace, - to_expr ```(has_add.add a) >>= head_eta_expand >>= head_eta >>= trace, - constructor diff --git a/old_tests/tests/lean/eta_tac.lean.expected.out b/old_tests/tests/lean/eta_tac.lean.expected.out deleted file mode 100644 index a1aaf365d6..0000000000 --- a/old_tests/tests/lean/eta_tac.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -λ {α : Type ?} [c : has_add α] (a a_1 : α), @has_add.add α c a a_1 -λ (n : nat), nat.succ n -λ (a_1 : nat), @has_add.add nat nat.has_add a a_1 -λ (x a : nat), @has_add.add nat nat.has_add x a -@has_add.add nat nat.has_add -@has_add.add nat nat.has_add a diff --git a/old_tests/tests/lean/eval_expr_error.lean b/old_tests/tests/lean/eval_expr_error.lean deleted file mode 100644 index a77150fe21..0000000000 --- a/old_tests/tests/lean/eval_expr_error.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -meta def tst1 (A : Type) : tactic unit := -do a ← to_expr ``(0), - v ← eval_expr A a, - return () - -run_cmd do - a ← to_expr ``(nat.add), - v ← eval_expr nat a, - trace v, - return () - -run_cmd do - a ← to_expr ``(λ x : nat, x + 1), - v ← (eval_expr nat a <|> trace "tactic failed" >> return 1), - trace v, - return () diff --git a/old_tests/tests/lean/eval_expr_error.lean.expected.out b/old_tests/tests/lean/eval_expr_error.lean.expected.out deleted file mode 100644 index bf5463ec6b..0000000000 --- a/old_tests/tests/lean/eval_expr_error.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -eval_expr_error.lean:5:8: error: failed to synthesize type class instance for -A : Type, -tst1 : tactic unit, -a : expr -⊢ reflected A -eval_expr_error.lean:8:0: error: invalid eval_expr, type mismatch -state: -⊢ true -tactic failed -1 diff --git a/old_tests/tests/lean/eval_tactic.lean b/old_tests/tests/lean/eval_tactic.lean deleted file mode 100644 index 34c81e1e10..0000000000 --- a/old_tests/tests/lean/eval_tactic.lean +++ /dev/null @@ -1,2 +0,0 @@ -#eval tactic.trace 42 -#eval (tactic.fail "nope" : tactic nat) diff --git a/old_tests/tests/lean/eval_tactic.lean.expected.out b/old_tests/tests/lean/eval_tactic.lean.expected.out deleted file mode 100644 index f7fe767e96..0000000000 --- a/old_tests/tests/lean/eval_tactic.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -42 -eval_tactic.lean:2:0: error: nope diff --git a/old_tests/tests/lean/exact_error_pos.lean b/old_tests/tests/lean/exact_error_pos.lean deleted file mode 100644 index d25d321c69..0000000000 --- a/old_tests/tests/lean/exact_error_pos.lean +++ /dev/null @@ -1,16 +0,0 @@ -constant f : nat → nat → nat - - -def ex1 : nat := -begin - exact 10 + - (f 1 (f 0 tt)) - -end - - -def ex₂ : nat := -begin - apply 10 + - (f 1 (f 0 tt)) -end diff --git a/old_tests/tests/lean/exact_error_pos.lean.expected.out b/old_tests/tests/lean/exact_error_pos.lean.expected.out deleted file mode 100644 index 2a635f4bb4..0000000000 --- a/old_tests/tests/lean/exact_error_pos.lean.expected.out +++ /dev/null @@ -1,20 +0,0 @@ -exact_error_pos.lean:7:14: error: type mismatch at application - f 0 tt -term - tt -has type - bool -but is expected to have type - ℕ -state: -⊢ ℕ -exact_error_pos.lean:15:14: error: type mismatch at application - f 0 tt -term - tt -has type - bool -but is expected to have type - ℕ -state: -⊢ ℕ diff --git a/old_tests/tests/lean/example_false.lean b/old_tests/tests/lean/example_false.lean deleted file mode 100644 index 9014183936..0000000000 --- a/old_tests/tests/lean/example_false.lean +++ /dev/null @@ -1,5 +0,0 @@ -open expr tactic - -example : false := by do -n ← mk_fresh_name, -apply (local_const n n binder_info.default (const ``false [])) diff --git a/old_tests/tests/lean/example_false.lean.expected.out b/old_tests/tests/lean/example_false.lean.expected.out deleted file mode 100644 index 81617e3fcd..0000000000 --- a/old_tests/tests/lean/example_false.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -example_false.lean:3:0: error: failed to add declaration to environment, it contains local constants diff --git a/old_tests/tests/lean/explicit_delimiters.lean b/old_tests/tests/lean/explicit_delimiters.lean deleted file mode 100644 index a46af934aa..0000000000 --- a/old_tests/tests/lean/explicit_delimiters.lean +++ /dev/null @@ -1,9 +0,0 @@ -example p : false := trivial -- Error - -def main proof : false := trivial -- Error - -example (p : false) := trivial - -def main' (proof : false) := trivial - -example := trivial diff --git a/old_tests/tests/lean/explicit_delimiters.lean.expected.out b/old_tests/tests/lean/explicit_delimiters.lean.expected.out deleted file mode 100644 index 9e62851b86..0000000000 --- a/old_tests/tests/lean/explicit_delimiters.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -explicit_delimiters.lean:1:8: error: invalid binder declaration, delimiter/bracket expected (i.e., '(', '{', '[', '{{') -explicit_delimiters.lean:3:9: error: invalid binder declaration, delimiter/bracket expected (i.e., '(', '{', '[', '{{') diff --git a/old_tests/tests/lean/expr_quote.lean b/old_tests/tests/lean/expr_quote.lean deleted file mode 100644 index 50657d2276..0000000000 --- a/old_tests/tests/lean/expr_quote.lean +++ /dev/null @@ -1,6 +0,0 @@ -meta def f (α a : expr) := `(@id %%α %%a) - -meta def g (α a : expr) := `(@id (%%α : Type 2) %%a) - -set_option pp.universes true -#print g diff --git a/old_tests/tests/lean/expr_quote.lean.expected.out b/old_tests/tests/lean/expr_quote.lean.expected.out deleted file mode 100644 index 69451ed858..0000000000 --- a/old_tests/tests/lean/expr_quote.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -expr_quote.lean:1:30: error: invalid quotation, contains universe metavariable -expr_quote.lean:1:9: error: type of sorry macro is not a sort -expr_quote.lean:1:9: error: don't know how to synthesize placeholder -context: -α a : expr -⊢ Sort ? -meta def g : expr → expr → expr := -λ (α a : expr), id_rhs.{1} expr (expr.subst (expr.subst ↑`(λ (_x_1 : Type 2) (_x_2 : _x_1), id.{3} _x_2) α) a) diff --git a/old_tests/tests/lean/extra/597a.hlean b/old_tests/tests/lean/extra/597a.hlean deleted file mode 100644 index 66769a3b6a..0000000000 --- a/old_tests/tests/lean/extra/597a.hlean +++ /dev/null @@ -1,3 +0,0 @@ -open equiv -constants (A B : Type₀) (f : A ≃ B) -definition foo : A → B := f diff --git a/old_tests/tests/lean/extra/597b.hlean b/old_tests/tests/lean/extra/597b.hlean deleted file mode 100644 index 41c23257cb..0000000000 --- a/old_tests/tests/lean/extra/597b.hlean +++ /dev/null @@ -1,3 +0,0 @@ --- open equiv -constants (A B : Type₀) (f : A ≃ B) -definition foo : A → B := f -- should fail diff --git a/old_tests/tests/lean/extra/616a.hlean b/old_tests/tests/lean/extra/616a.hlean deleted file mode 100644 index 0f6869261b..0000000000 --- a/old_tests/tests/lean/extra/616a.hlean +++ /dev/null @@ -1 +0,0 @@ -attribute quotient.rec [recursor] diff --git a/old_tests/tests/lean/extra/616b.hlean b/old_tests/tests/lean/extra/616b.hlean deleted file mode 100644 index 15cb89434b..0000000000 --- a/old_tests/tests/lean/extra/616b.hlean +++ /dev/null @@ -1,9 +0,0 @@ -import .f616a -open eq -definition my_elim {A P : Type*} {R : A → A → Type*} (Pc : A → P) - (Pp : Π⦃a a' : A⦄ (H : R a a'), Pc a = Pc a') (x : quotient R) : P := -begin - induction x, - exact (Pc a), - refine (pathover_of_eq (Pp H)) -end diff --git a/old_tests/tests/lean/extra/616c.hlean b/old_tests/tests/lean/extra/616c.hlean deleted file mode 100644 index cbb536dbfb..0000000000 --- a/old_tests/tests/lean/extra/616c.hlean +++ /dev/null @@ -1,8 +0,0 @@ -open eq -definition my_elim {A P : Type} {R : A → A → Type} (Pc : A → P) - (Pp : Π⦃a a' : A⦄ (H : R a a'), Pc a = Pc a') (x : quotient R) : P := -begin - induction x, - exact (Pc a), - refine (pathover_of_eq (Pp H)) -end diff --git a/old_tests/tests/lean/extra/755.expected.out b/old_tests/tests/lean/extra/755.expected.out deleted file mode 100644 index 253f7dea6e..0000000000 --- a/old_tests/tests/lean/extra/755.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -LEAN_INFORMATION -position 55:52 -A : Type, -B : Type, -f : one_step_tr A → B -⊢ Π (x y : A), - f (tr x) = f (tr y) -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/755.hlean b/old_tests/tests/lean/extra/755.hlean deleted file mode 100644 index c045817a60..0000000000 --- a/old_tests/tests/lean/extra/755.hlean +++ /dev/null @@ -1,59 +0,0 @@ -import types.eq types.pi hit.colimit - -open eq is_trunc unit quotient seq_colim equiv -axiom mysorry : ∀ {A : Type*}, A -namespace one_step_tr -section - parameters {A : Type*} - variables (a a' : A) - - protected definition R (a a' : A) : Type₀ := unit - parameter (A) - definition one_step_tr : Type* := quotient R - parameter {A} - definition tr : one_step_tr := - class_of R a - - definition tr_eq : tr a = tr a' := - eq_of_rel _ star - - protected definition rec {P : one_step_tr → Type*} (Pt : Π(a : A), P (tr a)) - (Pe : Π(a a' : A), Pt a =[tr_eq a a'] Pt a') (x : one_step_tr) : P x := - begin - fapply (quotient.rec_on x), - { intro a, apply Pt}, - { intro a a' H, cases H, apply Pe} - end - - protected definition elim {P : Type*} (Pt : A → P) - (Pe : Π(a a' : A), Pt a = Pt a') (x : one_step_tr) : P := - rec Pt (λa a', pathover_of_eq (Pe a a')) x - - theorem rec_tr_eq {P : one_step_tr → Type*} (Pt : Π(a : A), P (tr a)) - (Pe : Π(a a' : A), Pt a =[tr_eq a a'] Pt a') (a a' : A) - : apdo (rec Pt Pe) (tr_eq a a') = Pe a a' := - !rec_eq_of_rel - - theorem elim_tr_eq {P : Type*} (Pt : A → P) - (Pe : Π(a a' : A), Pt a = Pt a') (a a' : A) - : ap (elim Pt Pe) (tr_eq a a') = Pe a a' := - begin - apply eq_of_fn_eq_fn_inv !(pathover_constant (tr_eq a a')), - rewrite [▸*,-apdo_eq_pathover_of_eq_ap,↑elim,rec_tr_eq], - end - -end - -end one_step_tr -attribute one_step_tr.rec one_step_tr.elim [recursor 5] -open one_step_tr - -definition one_step_tr_up (A B : Type*) - : (one_step_tr A → B) ≃ Σ(f : A → B), Π(x y : A), f x = f y := -begin - fapply equiv.MK, - { intro f, fconstructor, intro a, exact f (tr a), intros, exact ap f !tr_eq}, - { exact mysorry}, - { exact mysorry}, - { exact mysorry}, -end diff --git a/old_tests/tests/lean/extra/denote_rec.lean b/old_tests/tests/lean/extra/denote_rec.lean deleted file mode 100644 index 0bdece8de4..0000000000 --- a/old_tests/tests/lean/extra/denote_rec.lean +++ /dev/null @@ -1,27 +0,0 @@ -inductive formula := -eqf : nat → nat → formula, -andf : formula → formula → formula, -impf : formula → formula → formula, -allf : (nat → formula) → formula - -check @formula.rec_on - -namespace formula - - definition denote : formula → Prop, - denote (eqf n1 n2) := n1 = n2, - denote (andf f1 f2) := denote f1 ∧ denote f2, - denote (impf f1 f2) := denote f1 → denote f2, - denote (allf f) := ∀ n : nat, denote (f n) - -end formula - -definition denote (f : formula) : Prop := -formula.rec_on f - (λ n₁ n₂, n₁ = n₂) - (λ f₁ f₂ r₁ r₂, r₁ ∧ r₂) - (λ f₁ f₂ r₁ r₂, r₁ → r₂) - (λ f r, ∀ n : nat, r n) - -open formula -eval denote (allf (λ n₁, allf (λ n₂, impf (eqf n₁ n₂) (eqf n₂ n₁)))) diff --git a/old_tests/tests/lean/extra/dir_option.lean b/old_tests/tests/lean/extra/dir_option.lean deleted file mode 100644 index 36b26da3df..0000000000 --- a/old_tests/tests/lean/extra/dir_option.lean +++ /dev/null @@ -1,5 +0,0 @@ --- Test for --dir option, to be able to execute this file, we must provide --dir= in the command line -import .div -open nat - -check nat.div diff --git a/old_tests/tests/lean/extra/eqn_macro1.lean b/old_tests/tests/lean/extra/eqn_macro1.lean deleted file mode 100644 index 1fdc7c97c1..0000000000 --- a/old_tests/tests/lean/extra/eqn_macro1.lean +++ /dev/null @@ -1,10 +0,0 @@ -open nat - -notation `foo` a := - match a with - (c, d) := c + (d:nat) - end - -eval foo (2, 3) - -notation `bla` a `with` H := a ↓ H diff --git a/old_tests/tests/lean/extra/eqn_macro2.lean b/old_tests/tests/lean/extra/eqn_macro2.lean deleted file mode 100644 index 3c8ceb7164..0000000000 --- a/old_tests/tests/lean/extra/eqn_macro2.lean +++ /dev/null @@ -1,4 +0,0 @@ -import eqn_macro1 -open nat - -eval foo (2, 3) diff --git a/old_tests/tests/lean/extra/goal_hole.lean b/old_tests/tests/lean/extra/goal_hole.lean deleted file mode 100644 index d8a8a2b342..0000000000 --- a/old_tests/tests/lean/extra/goal_hole.lean +++ /dev/null @@ -1,5 +0,0 @@ -example (a b c : nat) : a = b → b = c → a = c := -begin - intro h₁ h₂, - exact eq.trans _ h₂ -end diff --git a/old_tests/tests/lean/extra/issue_597.sh b/old_tests/tests/lean/extra/issue_597.sh deleted file mode 100755 index e0085b2e66..0000000000 --- a/old_tests/tests/lean/extra/issue_597.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -e -if [ $# -ne 1 ]; then - echo "Usage: bug_597.sh [lean-executable-path]" - exit 1 -fi -LEAN=$1 -export HLEAN_PATH=../../../hott -"$LEAN" -c 597.clean 597a.hlean -if "$LEAN" -c 597.clean 597b.hlean; then - echo "ERROR: using incorrect cached value..." - exit 1 -fi diff --git a/old_tests/tests/lean/extra/issue_616.sh b/old_tests/tests/lean/extra/issue_616.sh deleted file mode 100755 index 5c7437c917..0000000000 --- a/old_tests/tests/lean/extra/issue_616.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e -if [ $# -ne 1 ]; then - echo "Usage: issue_616.sh [lean-executable-path]" - exit 1 -fi -LEAN=$1 -export HLEAN_PATH=../../../hott -"$LEAN" -o f616a.olean 616a.hlean -"$LEAN" -c 616.clean 616b.hlean -if "$LEAN" -c 616.clean 616c.hlean; then - echo "ERROR: using incorrect cached value..." - exit 1 -fi diff --git a/old_tests/tests/lean/extra/issue_755.sh b/old_tests/tests/lean/extra/issue_755.sh deleted file mode 100755 index 615548ba07..0000000000 --- a/old_tests/tests/lean/extra/issue_755.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e -if [ $# -ne 1 ]; then - echo "Usage: issue_755.sh [lean-executable-path]" - exit 1 -fi -LEAN=$1 -export HLEAN_PATH=../../../hott -produced="755.produced.out" -expected="755.expected.out" -$LEAN --line=55 --col=50 --goal 755.hlean &> $produced -if test -f $expected; then - if diff --ignore-all-space -I "executing external script" "$produced" "$expected"; then - echo "-- checked" - else - echo "ERROR: file $produced does not match $expected" - exit 1 - fi -else - echo "ERROR: file $expected does not exist" - exit 1 -fi -echo "done" diff --git a/old_tests/tests/lean/extra/lt_rec.lean b/old_tests/tests/lean/extra/lt_rec.lean deleted file mode 100644 index 36393c402d..0000000000 --- a/old_tests/tests/lean/extra/lt_rec.lean +++ /dev/null @@ -1,16 +0,0 @@ -open nat - -set_option pp.implicit true -set_option pp.notation false - -definition lt_trans : ∀ {a b c : nat}, a < b → b < c → a < c, -lt_trans h (lt.base _) := lt.step h, -lt_trans h₁ (lt.step h₂) := lt.step (lt_trans h₁ h₂) - -definition lt_succ : ∀ {a b : nat}, a < b → succ a < succ b, -lt_succ (lt.base a) := lt.base (succ a), -lt_succ (lt.step h) := lt.step (lt_succ h) - -definition lt_of_succ : ∀ {a b : nat}, succ a < b → a < b, -lt_of_succ (lt.base (succ a)) := lt.trans (lt.base a) (lt.base (succ a)), -lt_of_succ (lt.step h₂) := lt.step (lt_of_succ h₂) diff --git a/old_tests/tests/lean/extra/print_info.12.19.expected.out b/old_tests/tests/lean/extra/print_info.12.19.expected.out deleted file mode 100644 index 2187569493..0000000000 --- a/old_tests/tests/lean/extra/print_info.12.19.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -definition mul : Π {A : Type} [s : has_mul A], A → A → A -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.12.20.expected.out b/old_tests/tests/lean/extra/print_info.12.20.expected.out deleted file mode 100644 index 2187569493..0000000000 --- a/old_tests/tests/lean/extra/print_info.12.20.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -definition mul : Π {A : Type} [s : has_mul A], A → A → A -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.12.30.expected.out b/old_tests/tests/lean/extra/print_info.12.30.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/extra/print_info.17.0.expected.out b/old_tests/tests/lean/extra/print_info.17.0.expected.out deleted file mode 100644 index aec1f64ce2..0000000000 --- a/old_tests/tests/lean/extra/print_info.17.0.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -definition rfl : ∀ {A : Type} {a : A}, a = a -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.17.2.expected.out b/old_tests/tests/lean/extra/print_info.17.2.expected.out deleted file mode 100644 index aec1f64ce2..0000000000 --- a/old_tests/tests/lean/extra/print_info.17.2.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -definition rfl : ∀ {A : Type} {a : A}, a = a -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.21.0.expected.out b/old_tests/tests/lean/extra/print_info.21.0.expected.out deleted file mode 100644 index 298e8de4c7..0000000000 --- a/old_tests/tests/lean/extra/print_info.21.0.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -parameter a₁ : ℕ -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.21.1.expected.out b/old_tests/tests/lean/extra/print_info.21.1.expected.out deleted file mode 100644 index 298e8de4c7..0000000000 --- a/old_tests/tests/lean/extra/print_info.21.1.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -parameter a₁ : ℕ -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.21.3.expected.out b/old_tests/tests/lean/extra/print_info.21.3.expected.out deleted file mode 100644 index 750b3916ba..0000000000 --- a/old_tests/tests/lean/extra/print_info.21.3.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -_ `+`:65 _:65 := add #1 #0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.4.16.expected.out b/old_tests/tests/lean/extra/print_info.4.16.expected.out deleted file mode 100644 index 5769fa0f78..0000000000 --- a/old_tests/tests/lean/extra/print_info.4.16.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -LEAN_INFORMATION -inductive nat : Type₁ -constructors: -nat.zero : ℕ -nat.succ : ℕ → ℕ -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.7.18.expected.out b/old_tests/tests/lean/extra/print_info.7.18.expected.out deleted file mode 100644 index e5417a85a7..0000000000 --- a/old_tests/tests/lean/extra/print_info.7.18.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -definition add : Π {A : Type} [s : has_add A], A → A → A -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.8.19.expected.out b/old_tests/tests/lean/extra/print_info.8.19.expected.out deleted file mode 100644 index 750b3916ba..0000000000 --- a/old_tests/tests/lean/extra/print_info.8.19.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -LEAN_INFORMATION -_ `+`:65 _:65 := add #1 #0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/print_info.lean b/old_tests/tests/lean/extra/print_info.lean deleted file mode 100644 index 310791c78f..0000000000 --- a/old_tests/tests/lean/extra/print_info.lean +++ /dev/null @@ -1,23 +0,0 @@ -import data.int -open nat int - -variables a b : nat -variables i j : int -axiom mysorry : ∀ {A : Type}, A -definition foo := add a i -definition f₁ := a + i - -example (n : nat) : n + n = 2 * n := -begin - unfold [nat.add,mul], - apply mysorry -end - -example (n : nat) : n + n = n + n := -rfl - -example (a₁ a₂ a₃ : nat) : a₁ = 0 → a₂ = 0 → a₃ = 0 → a₁ + a₂ + a₃ = 0 := -assume h₁ h₂ h₃, calc -a₁ + a₂ + a₃ = 0 + a₂ + a₃ : h₁ - ... = 0 + 0 + a₃ : h₂ - ... = 0 + 0 + 0 : h₃ diff --git a/old_tests/tests/lean/extra/print_info.sh b/old_tests/tests/lean/extra/print_info.sh deleted file mode 100755 index 24af9dafd1..0000000000 --- a/old_tests/tests/lean/extra/print_info.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e -if [ $# -ne 1 ]; then - echo "Usage: print_info.sh [lean-executable-path]" - exit 1 -fi -LEAN=$1 -export LEAN_PATH=../../../library:. - -lines=('4' '7' '8' '12' '12' '12' '17' '17' '21' '21' '21'); -cols=('16' '18' '19' '19' '20' '30' '0' '2' '0' '1' '3'); -size=${#lines[@]} - -i=0 -while [ $i -lt $size ]; do - line=${lines[$i]} - col=${cols[$i]} - let i=i+1 - produced=print_info.$line.$col.produced.out - expected=print_info.$line.$col.expected.out - $LEAN --line=$line --col=$col --info print_info.lean &> $produced - if test -f $expected; then - if diff --ignore-all-space -I "executing external script" "$produced" "$expected"; then - echo "-- checked" - else - echo "ERROR: file $produced does not match $expected" - exit 1 - fi - else - echo "ERROR: file $expected does not exist" - exit 1 - fi -done -echo "done" diff --git a/old_tests/tests/lean/extra/print_tests.lean b/old_tests/tests/lean/extra/print_tests.lean deleted file mode 100644 index 6af65c8c25..0000000000 --- a/old_tests/tests/lean/extra/print_tests.lean +++ /dev/null @@ -1,7 +0,0 @@ -#print notation - -#print notation ∧ ∨ - -#print notation if - -#print notation % diff --git a/old_tests/tests/lean/extra/rec.lean b/old_tests/tests/lean/extra/rec.lean deleted file mode 100644 index e9b3aaa014..0000000000 --- a/old_tests/tests/lean/extra/rec.lean +++ /dev/null @@ -1,57 +0,0 @@ -import data.examples.vector -open nat vector - -definition fib : nat → nat, -fib 0 := 1, -fib 1 := 1, -fib (a+2) := (fib a ↓ lt.step (lt.base a)) + (fib (a+1) ↓ lt.base (a+1)) -[wf] lt.wf - -definition gcd : nat → nat → nat, -gcd 0 x := x, -gcd x 0 := x, -gcd (succ x) (succ y) := if y ≤ x - then gcd (x - y) (succ y) ↓ !sigma.lex.left (lt_succ_of_le (sub_le x y)) - else gcd (succ x) (y - x) ↓ !sigma.lex.right (lt_succ_of_le (sub_le y x)) -[wf] sigma.lex.wf lt.wf (λ x, lt.wf) - -definition add : nat → nat → nat, -add zero b := b, -add (succ a) b := succ (add a b) - -definition map {A B C : Type*} (f : A → B → C) : Π {n}, vector A n → vector B n → vector C n, -map nil nil := nil, -map (a :: va) (b :: vb) := f a b :: map va vb - -definition half : nat → nat, -half 0 := 0, -half 1 := 0, -half (x+2) := half x + 1 - -variables {A B : Type} -inductive image_of (f : A → B) : B → Type := -mk : Π a, image_of f (f a) - -definition inv {f : A → B} : Π b, image_of f b → A, -inv ⌞f a⌟ (image_of.mk f a) := a - -namespace tst - -definition fib : nat → nat, -fib 0 := 1, -fib 1 := 1, -fib (a+2) := fib a + fib (a+1) - -end tst - -definition simple : nat → nat → nat, -simple x y := x + y - -definition simple2 : nat → nat → nat, -simple2 (x+1) y := x + y, -simple2 ⌞y+1⌟ y := y - - - -check @vector.brec_on -check @vector.cases_on diff --git a/old_tests/tests/lean/extra/rec2.lean b/old_tests/tests/lean/extra/rec2.lean deleted file mode 100644 index ff1f20c5e9..0000000000 --- a/old_tests/tests/lean/extra/rec2.lean +++ /dev/null @@ -1,4 +0,0 @@ -set_option pp.implicit true -set_option pp.notation false -definition ideq : Π {A : Type} {a b : A}, a = b → a = b, -ideq H := H diff --git a/old_tests/tests/lean/extra/rec3.lean b/old_tests/tests/lean/extra/rec3.lean deleted file mode 100644 index e52ba103e2..0000000000 --- a/old_tests/tests/lean/extra/rec3.lean +++ /dev/null @@ -1,8 +0,0 @@ -set_option pp.implicit true -set_option pp.notation false - -definition symm {A : Type} : Π {a b : A}, a = b → b = a, -symm rfl := rfl - -definition trans {A : Type} : Π {a b c : A}, a = b → b = c → a = c, -trans rfl rfl := rfl diff --git a/old_tests/tests/lean/extra/rec4.lean b/old_tests/tests/lean/extra/rec4.lean deleted file mode 100644 index c490ea648b..0000000000 --- a/old_tests/tests/lean/extra/rec4.lean +++ /dev/null @@ -1,9 +0,0 @@ -import data.examples.vector -open nat vector - -set_option pp.implicit true -set_option pp.notation false - -definition diag {A : Type*} : Π {n}, vector (vector A n) n → vector A n, -diag nil := nil, -diag ((a :: va) :: vs) := a :: diag (map tail vs) diff --git a/old_tests/tests/lean/extra/rec5.lean b/old_tests/tests/lean/extra/rec5.lean deleted file mode 100644 index e4d90b8aaa..0000000000 --- a/old_tests/tests/lean/extra/rec5.lean +++ /dev/null @@ -1,26 +0,0 @@ -import data.list -open nat list - -set_option pp.implicit true -set_option pp.notation false - -definition filter {A : Type*} (p : A → Prop) [H : decidable_pred p] : list A → list A, -filter nil := nil, -filter (h :: t) := if p h then h :: filter t else filter t - -open decidable - -definition decidable_eq_nat : Π (a b : nat), decidable (a = b), -decidable_eq_nat 0 0 := inl rfl, -decidable_eq_nat 0 (x+1) := inr (ne.symm (succ_ne_zero x)), -decidable_eq_nat (x+1) 0 := inr (succ_ne_zero x), -decidable_eq_nat (x+1) (y+1) := - decidable.cases_on (decidable_eq_nat x y) - (λ Hp, inl (congr_arg succ Hp)) - (λ Hn, inr (λ H : x+1 = y+1, absurd (succ.inj H) Hn)) - -/- -match (decidable_eq_nat x y) with - (inl Hp) := inl (congr_arg succ Hp), - (inr Hn) := inr (λ Hs, absurd (succ.inj Hs) Hn) --/ diff --git a/old_tests/tests/lean/extra/show_goal.14.6.expected.out b/old_tests/tests/lean/extra/show_goal.14.6.expected.out deleted file mode 100644 index 979e49ee65..0000000000 --- a/old_tests/tests/lean/extra/show_goal.14.6.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -LEAN_INFORMATION -position 14:6 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : c + 1 + a = 1, -h₄ : d = c - 1 -⊢ c = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.15.6.expected.out b/old_tests/tests/lean/extra/show_goal.15.6.expected.out deleted file mode 100644 index 7821313f31..0000000000 --- a/old_tests/tests/lean/extra/show_goal.15.6.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -LEAN_INFORMATION -position 15:6 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : c + 1 + 0 = 1, -h₄ : d = c - 1 -⊢ c = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.18.20.expected.out b/old_tests/tests/lean/extra/show_goal.18.20.expected.out deleted file mode 100644 index cfafefe974..0000000000 --- a/old_tests/tests/lean/extra/show_goal.18.20.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -LEAN_INFORMATION -position 18:20 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : succ c = 1, -h₄ : d = c - 1, -a_1 : c = 0 -⊢ c = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.18.21.expected.out b/old_tests/tests/lean/extra/show_goal.18.21.expected.out deleted file mode 100644 index a2dc7a3b75..0000000000 --- a/old_tests/tests/lean/extra/show_goal.18.21.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -LEAN_INFORMATION -position 19:4 -no goals -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.18.6.expected.out b/old_tests/tests/lean/extra/show_goal.18.6.expected.out deleted file mode 100644 index 7b70ee257f..0000000000 --- a/old_tests/tests/lean/extra/show_goal.18.6.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -LEAN_INFORMATION -position 18:6 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : succ c = 1, -h₄ : d = c - 1 -⊢ c = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.20.4.expected.out b/old_tests/tests/lean/extra/show_goal.20.4.expected.out deleted file mode 100644 index b6b95ab00c..0000000000 --- a/old_tests/tests/lean/extra/show_goal.20.4.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -LEAN_INFORMATION -position 20:4 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : c + 1 + a = 1, -h₄ : d = c - 1, -ceq : c = 0 -⊢ d = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.23.6.expected.out b/old_tests/tests/lean/extra/show_goal.23.6.expected.out deleted file mode 100644 index 76efcb17a9..0000000000 --- a/old_tests/tests/lean/extra/show_goal.23.6.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -LEAN_INFORMATION -position 24:2 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : c + 1 + a = 1, -h₄ : d = c - 1, -deq0 : d = 0 -⊢ d = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.24.2.expected.out b/old_tests/tests/lean/extra/show_goal.24.2.expected.out deleted file mode 100644 index 76efcb17a9..0000000000 --- a/old_tests/tests/lean/extra/show_goal.24.2.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -LEAN_INFORMATION -position 24:2 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0, -aeq0 : a = 0, -h₃ : c + 1 + a = 1, -h₄ : d = c - 1, -deq0 : d = 0 -⊢ d = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.24.3.expected.out b/old_tests/tests/lean/extra/show_goal.24.3.expected.out deleted file mode 100644 index 14a98d6c1b..0000000000 --- a/old_tests/tests/lean/extra/show_goal.24.3.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -LEAN_INFORMATION -position 25:0 -no goals -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.6.0.expected.out b/old_tests/tests/lean/extra/show_goal.6.0.expected.out deleted file mode 100644 index 9882452704..0000000000 --- a/old_tests/tests/lean/extra/show_goal.6.0.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -show_goal.lean:2:0: warning: imported file uses 'sorry' -show_goal.lean:5:0: error: begin-end-exprs have been disabled diff --git a/old_tests/tests/lean/extra/show_goal.6.14.expected.out b/old_tests/tests/lean/extra/show_goal.6.14.expected.out deleted file mode 100644 index 2855910e58..0000000000 --- a/old_tests/tests/lean/extra/show_goal.6.14.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -LEAN_INFORMATION -position 7:2 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0 -⊢ c + 1 + a = 1 → d = c - 1 → d = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.8.4.expected.out b/old_tests/tests/lean/extra/show_goal.8.4.expected.out deleted file mode 100644 index 7c7bcf5852..0000000000 --- a/old_tests/tests/lean/extra/show_goal.8.4.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -LEAN_INFORMATION -position 8:4 -a b c d : ℕ, -h₁ : a + b = 0, -h₂ : b = 0 -⊢ a = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.8.5.expected.out b/old_tests/tests/lean/extra/show_goal.8.5.expected.out deleted file mode 100644 index 5ea548fb47..0000000000 --- a/old_tests/tests/lean/extra/show_goal.8.5.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -LEAN_INFORMATION -position 9:4 -a b c d : ℕ, -h₁ : a + 0 = 0, -h₂ : b = 0 -⊢ a = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.9.12.expected.out b/old_tests/tests/lean/extra/show_goal.9.12.expected.out deleted file mode 100644 index baef915c10..0000000000 --- a/old_tests/tests/lean/extra/show_goal.9.12.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -LEAN_INFORMATION -position 10:2 -no goals -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.9.4.expected.out b/old_tests/tests/lean/extra/show_goal.9.4.expected.out deleted file mode 100644 index 5ea548fb47..0000000000 --- a/old_tests/tests/lean/extra/show_goal.9.4.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -LEAN_INFORMATION -position 9:4 -a b c d : ℕ, -h₁ : a + 0 = 0, -h₂ : b = 0 -⊢ a = 0 -END_LEAN_INFORMATION diff --git a/old_tests/tests/lean/extra/show_goal.lean b/old_tests/tests/lean/extra/show_goal.lean deleted file mode 100644 index a5489e1a32..0000000000 --- a/old_tests/tests/lean/extra/show_goal.lean +++ /dev/null @@ -1,25 +0,0 @@ -import data.nat -open nat algebra - -example (a b c d : nat) : a + b = 0 → b = 0 → c + 1 + a = 1 → d = c - 1 → d = 0 := -begin - intro h₁ h₂, - have aeq0 : a = 0, begin - rewrite h₂ at h₁, - exact h₁ - end, - intro h₃ h₄, - have deq0 : d = 0, begin - have ceq : c = 0, begin - rewrite aeq0 at h₃, - rewrite add_zero at h₃, - krewrite add_succ at h₃, - krewrite add_zero at h₃, - injection h₃, exact a_1 - end, - rewrite ceq at h₄, - repeat (esimp [sub, pred] at h₄), - exact h₄ - end, - exact deq0 -end diff --git a/old_tests/tests/lean/extra/show_goal.sh b/old_tests/tests/lean/extra/show_goal.sh deleted file mode 100755 index 6457480edf..0000000000 --- a/old_tests/tests/lean/extra/show_goal.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e -if [ $# -ne 1 ]; then - echo "Usage: show_goal.sh [lean-executable-path]" - exit 1 -fi -LEAN=$1 -export LEAN_PATH=../../../library:. - -lines=('6' '6' '8' '8' '9' '9' '14' '15' '18' '18' '18' '20' '23' '24' '24'); -cols=('0' '14' '4' '5' '4' '12' '6' '6' '20' '21' '6' '4' '6' '2' '3'); -size=${#lines[@]} - -i=0 -while [ $i -lt $size ]; do - line=${lines[$i]} - col=${cols[$i]} - let i=i+1 - produced=show_goal.$line.$col.produced.out - expected=show_goal.$line.$col.expected.out - $LEAN --line=$line --col=$col --goal show_goal.lean &> $produced - if test -f $expected; then - if diff --ignore-all-space -I "executing external script" "$produced" "$expected"; then - echo "-- checked" - else - echo "ERROR: file $produced does not match $expected" - exit 1 - fi - else - echo "ERROR: file $expected does not exist" - exit 1 - fi -done -echo "done" diff --git a/old_tests/tests/lean/extra/slow1.lean b/old_tests/tests/lean/extra/slow1.lean deleted file mode 100644 index 6f84d090a9..0000000000 --- a/old_tests/tests/lean/extra/slow1.lean +++ /dev/null @@ -1,11 +0,0 @@ -open nat - -definition f (a : nat) : nat := a -definition g (a : nat) : nat := 0 - -example (a b : nat) : -@eq nat -(g (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f a)))))))))))))))))))))) -(g (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f b)))))))))))))))))))))) -:= -@eq.refl nat (g (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f a)))))))))))))))))))))) diff --git a/old_tests/tests/lean/extra/test_eqn_macro.sh b/old_tests/tests/lean/extra/test_eqn_macro.sh deleted file mode 100755 index 80ac7efe32..0000000000 --- a/old_tests/tests/lean/extra/test_eqn_macro.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -if [ $# -ne 1 ]; then - echo "Usage: test_eq_macro.sh [lean-executable-path]" - exit 1 -fi -LEAN=$1 -export LEAN_PATH=../../../library:. -"$LEAN" -o eqn_macro1.olean eqn_macro1.lean -"$LEAN" eqn_macro2.lean diff --git a/old_tests/tests/lean/extra/test_single.sh b/old_tests/tests/lean/extra/test_single.sh deleted file mode 100755 index 0cce45ba64..0000000000 --- a/old_tests/tests/lean/extra/test_single.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -f=$2 -echo "-- testing $f" -if "$LEAN" "$f"; then - echo "-- checked" -else - echo "failed $f" - exit 1 -fi diff --git a/old_tests/tests/lean/extra/timeout.sh b/old_tests/tests/lean/extra/timeout.sh deleted file mode 100755 index 8e1d006ee5..0000000000 --- a/old_tests/tests/lean/extra/timeout.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Execute lean with timeout -set -e -if [ $# -ne 3 ]; then - echo "Usage: timeout.sh [lean-executable-path] [timeout] [benchmark]" - exit 1 -fi -LEAN=$1 -TIMEOUT=$2 -BENCH=$3 -export LEAN_PATH=../../../library:. -ulimit -t $2 -if ! $LEAN $BENCH; then - echo "Failed to execute $BENCH in $TIMEOUT second(s)" - exit 1 -fi diff --git a/old_tests/tests/lean/extra/tree_list_rec.lean b/old_tests/tests/lean/extra/tree_list_rec.lean deleted file mode 100644 index 46c053f4aa..0000000000 --- a/old_tests/tests/lean/extra/tree_list_rec.lean +++ /dev/null @@ -1,29 +0,0 @@ -open nat - -inductive tree (A : Type*) := -leaf : A → tree A, -node : tree_list A → tree A -with tree_list := -nil : tree_list A, -cons : tree A → tree_list A → tree_list A - -namespace tree -open tree_list - -definition size {A : Type*} : tree A → nat -with size_l : tree_list A → nat, -size (leaf a) := 1, -size (node l) := size_l l, -size_l !nil := 0, -size_l (cons t l) := size t + size_l l - -definition eq_tree {A : Type*} : tree A → tree A → Prop -with eq_tree_list : tree_list A → tree_list A → Prop, -eq_tree (leaf a₁) (leaf a₂) := a₁ = a₂, -eq_tree (node l₁) (node l₂) := eq_tree_list l₁ l₂, -eq_tree _ _ := false, -eq_tree_list !nil !nil := true, -eq_tree_list (cons t₁ l₁) (cons t₂ l₂) := eq_tree t₁ t₂ ∧ eq_tree_list l₁ l₂, -eq_tree_list _ _ := false - -end tree diff --git a/old_tests/tests/lean/extract.lean b/old_tests/tests/lean/extract.lean deleted file mode 100644 index bbcbaf2b70..0000000000 --- a/old_tests/tests/lean/extract.lean +++ /dev/null @@ -1,79 +0,0 @@ -#eval "abc" - -/- some "a" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := it₁.next in - it₁.extract it₂ - -/- some "" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - it₁.extract it₁ - -/- none -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := it₁.next in - it₂.extract it₁ - -/- some "abc" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := it₁.next.next.next.prev.next in - it₁.extract it₂ - -/- some "bcde" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator.next in - let it₂ := it₁.next.next.next.next in - it₁.extract it₂ - -/- some "abcde" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := it₁.next.next.next.next.next in - it₁.extract it₂ - -/- some "ab" -/ -#eval - let s₁ := "abcde" in - let s₂ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := s₂.mk_iterator.next.next in - it₁.extract it₂ - -/- none -/ -#eval - let s₁ := "abcde" in - let s₂ := "abhde" in - let it₁ := s₁.mk_iterator in - let it₂ := s₂.mk_iterator.next.next in - it₁.extract it₂ - -/- none -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := it₁.next.set_curr 'a' in - it₁.extract it₂ - -/- some "a" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := it₁.next.set_curr 'b' in - it₁.extract it₂ - -/- some "a" -/ -#eval - let s₁ := "abcde" in - let it₁ := s₁.mk_iterator in - let it₂ := (it₁.next.set_curr 'a').set_curr 'b' in - it₁.extract it₂ diff --git a/old_tests/tests/lean/extract.lean.expected.out b/old_tests/tests/lean/extract.lean.expected.out deleted file mode 100644 index b845b8d55d..0000000000 --- a/old_tests/tests/lean/extract.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -"abc" -(some "a") -(some "") -none -(some "abc") -(some "bcde") -(some "abcde") -(some "ab") -none -none -(some "a") -(some "a") diff --git a/old_tests/tests/lean/fail/example.lean b/old_tests/tests/lean/fail/example.lean deleted file mode 100644 index 8ea5fa9d15..0000000000 --- a/old_tests/tests/lean/fail/example.lean +++ /dev/null @@ -1,2 +0,0 @@ -open tactic expr -example : false := by do exact $ const `does_not_exist [] diff --git a/old_tests/tests/lean/fail/failed_lemma.lean b/old_tests/tests/lean/fail/failed_lemma.lean deleted file mode 100644 index d4135a6e4b..0000000000 --- a/old_tests/tests/lean/fail/failed_lemma.lean +++ /dev/null @@ -1 +0,0 @@ -lemma wrong : false := by tactic.failed diff --git a/old_tests/tests/lean/fail/parser_error.lean b/old_tests/tests/lean/fail/parser_error.lean deleted file mode 100644 index d1f45b399c..0000000000 --- a/old_tests/tests/lean/fail/parser_error.lean +++ /dev/null @@ -1 +0,0 @@ -lemma diff --git a/old_tests/tests/lean/fail/run_command.lean b/old_tests/tests/lean/fail/run_command.lean deleted file mode 100644 index 1a0b01c768..0000000000 --- a/old_tests/tests/lean/fail/run_command.lean +++ /dev/null @@ -1 +0,0 @@ -run_cmd tactic.fail "Error" diff --git a/old_tests/tests/lean/fail/test_all.sh b/old_tests/tests/lean/fail/test_all.sh deleted file mode 100755 index 04cc7c8eb2..0000000000 --- a/old_tests/tests/lean/fail/test_all.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 1 ]; then - echo "Usage: test_all.sh [lean-executable-path]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -fs=() -for f in *.lean -do - ff=$(../readlinkf.sh "$f") - if [[ "$OSTYPE" == "msys" ]]; then - # Windows running MSYS2 - # Replace /c/ with c:, and / with \\ - ff=$(echo $ff | sed 's|^/\([a-z]\)/|\1:/|' | sed 's|/|\\\\|g') - fi - fs+=("$ff") -done -"$LEAN" --test-suite "${fs[@]}" || (rm *.test_suite.out *.status; false) diff --git a/old_tests/tests/lean/fail/test_single.sh b/old_tests/tests/lean/fail/test_single.sh deleted file mode 100644 index 6f69077c11..0000000000 --- a/old_tests/tests/lean/fail/test_single.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -f=$2 -echo "-- testing $f" -if [[ -f $f.status ]]; then - echo "-- using result from test_all.sh" - cat $f.test_suite.out - status=$(cat $f.status) - rm $f.test_suite.out $f.status -else - "$LEAN" -j 0 "$f" - status=$? -fi -if [ "$status" -eq 1 ]; then - echo "-- checked" -else - echo "failed $f" - exit 1 -fi diff --git a/old_tests/tests/lean/ff_byte.lean b/old_tests/tests/lean/ff_byte.lean deleted file mode 100644 index e1c720b294..0000000000 --- a/old_tests/tests/lean/ff_byte.lean +++ /dev/null @@ -1,6 +0,0 @@ - --<-- should report invalid utf-8 here - -def -- TODO(gabriel): let the parser recover - -example : false := trivial - -- ^^ and complain about the wrong proof diff --git a/old_tests/tests/lean/ff_byte.lean.expected.out b/old_tests/tests/lean/ff_byte.lean.expected.out deleted file mode 100644 index 6ae2d4e60f..0000000000 --- a/old_tests/tests/lean/ff_byte.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -ff_byte.lean:1:0: error: unexpected token -ff_byte.lean:5:19: error: type mismatch, term - trivial -has type - true -but is expected to have type - false diff --git a/old_tests/tests/lean/field_access.lean b/old_tests/tests/lean/field_access.lean deleted file mode 100644 index a573df2c5e..0000000000 --- a/old_tests/tests/lean/field_access.lean +++ /dev/null @@ -1,28 +0,0 @@ -#check list.map - -variable l : list nat - -#check l.1 -- Error l is not a structure - -#check (1, 2).5 -- Error insufficient fields - -example (l : list nat) : list nat := -l.mapp (λ x, x + 1) -- Error there is no list.mapp - -example (A : Type) (a : A) : A := -a.symm -- Error type of 'a' is not a constant application - -example (A : Type) (a : A) : A := -eq.sym -- Error unknown identifier - -example (l : list nat) : list nat := -l.map (λ x, x + 1) - -example (l : list nat) : list nat := -l.map (λ x, x + 1) - -example (a b : nat) (h : a = b) : b = a := -h.symm - -example (a b : nat) (h : a = b) : b = a := -h.symm diff --git a/old_tests/tests/lean/field_access.lean.expected.out b/old_tests/tests/lean/field_access.lean.expected.out deleted file mode 100644 index 71683fb893..0000000000 --- a/old_tests/tests/lean/field_access.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -list.map : (?M_1 → ?M_2) → list ?M_1 → list ?M_2 -field_access.lean:5:8: error: invalid projection, structure expected - l -has type - list ℕ -field_access.lean:7:13: error: invalid projection, structure has only 2 field(s) - (1, 2) -which has type - ?m_1 × ?m_2 -field_access.lean:10:1: error: invalid field notation, 'mapp' is not a valid "field" because environment does not contain 'list.mapp' - l -which has type - list ℕ -field_access.lean:13:1: error: invalid field notation, type is not of the form (C ...) where C is a constant - a -has type - A -field_access.lean:16:0: error: unknown identifier 'eq.sym' diff --git a/old_tests/tests/lean/field_proj_pos.lean b/old_tests/tests/lean/field_proj_pos.lean deleted file mode 100644 index ef6386ba83..0000000000 --- a/old_tests/tests/lean/field_proj_pos.lean +++ /dev/null @@ -1,2 +0,0 @@ -example (h : true ∨ true) : true := -by exact (h).elim _ _ diff --git a/old_tests/tests/lean/field_proj_pos.lean.expected.out b/old_tests/tests/lean/field_proj_pos.lean.expected.out deleted file mode 100644 index 30485bd47f..0000000000 --- a/old_tests/tests/lean/field_proj_pos.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -field_proj_pos.lean:2:18: error: don't know how to synthesize placeholder -context: -h : true ∨ true -⊢ true → true -state: -h : true ∨ true -⊢ true diff --git a/old_tests/tests/lean/field_type_mismatch.lean b/old_tests/tests/lean/field_type_mismatch.lean deleted file mode 100644 index 505fe2579f..0000000000 --- a/old_tests/tests/lean/field_type_mismatch.lean +++ /dev/null @@ -1,10 +0,0 @@ -namespace test - -instance : has_add nat := -{add := nat.succ} - -instance : semigroup nat := -{mul := nat.add, - mul_assoc := trivial } - -end test diff --git a/old_tests/tests/lean/field_type_mismatch.lean.expected.out b/old_tests/tests/lean/field_type_mismatch.lean.expected.out deleted file mode 100644 index 8c8b6b0fba..0000000000 --- a/old_tests/tests/lean/field_type_mismatch.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -field_type_mismatch.lean:4:8: error: type mismatch at field 'add' - nat.succ -has type - ℕ → ℕ -but is expected to have type - ℕ → ℕ → ℕ -field_type_mismatch.lean:8:14: error: type mismatch at field 'mul_assoc' - trivial -has type - true -but is expected to have type - ∀ (a b c : ℕ), a * b * c = a * (b * c) diff --git a/old_tests/tests/lean/focus_tac.lean b/old_tests/tests/lean/focus_tac.lean deleted file mode 100644 index 4126af8a16..0000000000 --- a/old_tests/tests/lean/focus_tac.lean +++ /dev/null @@ -1,26 +0,0 @@ -open tactic - -example (a : nat) : a = a := -by do - define `x (expr.const `nat []), - trace "---- after assert ----", - trace_state, - solve1 (do trace "--- inside focus tac ---", trace_state), -- SHOULD FAIL HERE - trace "---- after focus tac ----", - trace_state, - x ← get_local `x, - mk_app `eq.refl [x] >>= exact, - return () - - -definition tst2 (a : nat) : a = a := -by do - define `x (expr.const `nat []), - trace "---- after assert ----", - trace_state, - solve1 (do trace "--- inside focus tac ---", trace_state, assumption), - trace "---- after focus tac ----", - trace_state, - x ← get_local `x, - mk_app `eq.refl [x] >>= exact, - return () diff --git a/old_tests/tests/lean/focus_tac.lean.expected.out b/old_tests/tests/lean/focus_tac.lean.expected.out deleted file mode 100644 index 61283fb7ac..0000000000 --- a/old_tests/tests/lean/focus_tac.lean.expected.out +++ /dev/null @@ -1,30 +0,0 @@ ----- after assert ---- -2 goals -a : ℕ -⊢ ℕ - -a : ℕ, -x : ℕ := ?m_1 -⊢ a = a ---- inside focus tac --- -a : ℕ -⊢ ℕ -focus_tac.lean:4:3: error: solve1 tactic failed, focused goal has not been solved -state: -a : ℕ -⊢ ℕ ----- after assert ---- -2 goals -a : ℕ -⊢ ℕ - -a : ℕ, -x : ℕ := ?m_1 -⊢ a = a ---- inside focus tac --- -a : ℕ -⊢ ℕ ----- after focus tac ---- -a : ℕ, -x : ℕ := a -⊢ a = a diff --git a/old_tests/tests/lean/fold.lean b/old_tests/tests/lean/fold.lean deleted file mode 100644 index 027a70c721..0000000000 --- a/old_tests/tests/lean/fold.lean +++ /dev/null @@ -1,35 +0,0 @@ -prelude -definition Prop := Type.{0} inductive true : Prop | intro : true inductive false : Prop constant num : Type -inductive prod (A B : Type*) | mk : A → B → prod infixl ` × `:30 := prod -variables a b c : num - -section - local notation `(` t:(foldr `, ` (e r, prod.mk e r)) `)` := t - #check (a, false, b, true, c) - set_option pp.notation false - #check (a, false, b, true, c) -end - -section - local notation `(` t:(foldr `, ` (e r, prod.mk r e)) `)` := t - set_option pp.notation true - #check (a, false, b, true, c) - set_option pp.notation false - #check (a, false, b, true, c) -end - -section - local notation `(` t:(foldl `, ` (e r, prod.mk r e)) `)` := t - set_option pp.notation true - #check (a, false, b, true, c) - set_option pp.notation false - #check (a, false, b, true, c) -end - -section - local notation `(` t:(foldl `, ` (e r, prod.mk e r)) `)` := t - set_option pp.notation true - #check (a, false, b, true, c) - set_option pp.notation false - #check (a, false, b, true, c) -end diff --git a/old_tests/tests/lean/fold.lean.expected.out b/old_tests/tests/lean/fold.lean.expected.out deleted file mode 100644 index 02bd2af809..0000000000 --- a/old_tests/tests/lean/fold.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -(a, false, b, true, c) : num × (Prop × (num × (Prop × num))) -prod.mk a (prod.mk false (prod.mk b (prod.mk true c))) : prod num (prod Prop (prod num (prod Prop num))) -(a, false, b, true, c) : num × Prop × num × Prop × num -prod.mk (prod.mk (prod.mk (prod.mk c true) b) false) a : prod (prod (prod (prod num Prop) num) Prop) num -(a, false, b, true, c) : num × Prop × num × Prop × num -prod.mk (prod.mk (prod.mk (prod.mk a false) b) true) c : prod (prod (prod (prod num Prop) num) Prop) num -(a, false, b, true, c) : num × (Prop × (num × (Prop × num))) -prod.mk c (prod.mk true (prod.mk b (prod.mk false a))) : prod num (prod Prop (prod num (prod Prop num))) diff --git a/old_tests/tests/lean/format_macro.lean b/old_tests/tests/lean/format_macro.lean deleted file mode 100644 index 37d72e2f92..0000000000 --- a/old_tests/tests/lean/format_macro.lean +++ /dev/null @@ -1,17 +0,0 @@ -#eval to_string $ format!"hi" -#eval to_string $ format! "hi" -#eval to_string $ format!"hi\nhi" -#eval to_string $ format!"{1}+{1}" -#eval to_string $ format!"{1+1}" -#eval to_string $ format!"{{{1+1}}" -#eval to_string $ format!"a{1}" -#eval to_string $ format!"{1}a" -#eval to_string $ format!"}" - -#check λ α, format!"{α}" - -#eval format!"{" -#eval format!"{}" -#eval format!"{1+}" - -#eval sformat!"a{'b'}c" diff --git a/old_tests/tests/lean/format_macro.lean.expected.out b/old_tests/tests/lean/format_macro.lean.expected.out deleted file mode 100644 index 65f9ba5fa5..0000000000 --- a/old_tests/tests/lean/format_macro.lean.expected.out +++ /dev/null @@ -1,14 +0,0 @@ -"hi" -"hi" -"hi\nhi" -"1+1" -"2" -"{2}" -"a1" -"1a" -"}" -λ (α : ?M_1), to_fmt "" ++ to_fmt α ++ to_fmt "" : ?M_1 → format -format_macro.lean:13:6: error: invalid expression, unexpected token -format_macro.lean:14:6: error: expression expected -format_macro.lean:15:6: error: invalid expression -"abc" diff --git a/old_tests/tests/lean/format_thunk1.lean b/old_tests/tests/lean/format_thunk1.lean deleted file mode 100644 index a3d083f3e5..0000000000 --- a/old_tests/tests/lean/format_thunk1.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic - -example : true := -by do - str ← to_expr ``(string), - one ← to_expr ``(1), - definev `H str one, - constructor diff --git a/old_tests/tests/lean/format_thunk1.lean.expected.out b/old_tests/tests/lean/format_thunk1.lean.expected.out deleted file mode 100644 index 0c4bc5af1f..0000000000 --- a/old_tests/tests/lean/format_thunk1.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -format_thunk1.lean:4:3: error: invalid definev tactic, value has type - ℕ -but is expected to have type - string -state: -⊢ true diff --git a/old_tests/tests/lean/format_to_buffer.lean b/old_tests/tests/lean/format_to_buffer.lean deleted file mode 100644 index 7d7e7f9261..0000000000 --- a/old_tests/tests/lean/format_to_buffer.lean +++ /dev/null @@ -1,9 +0,0 @@ -import system.io -import data.buffer - -meta def main : tactic unit := do -opts ← tactic.get_options, -let buf := format.to_buffer (format.of_string "foobar") opts, -tactic.trace (repr buf) - -run_cmd main diff --git a/old_tests/tests/lean/format_to_buffer.lean.expected.out b/old_tests/tests/lean/format_to_buffer.lean.expected.out deleted file mode 100644 index 20dc559156..0000000000 --- a/old_tests/tests/lean/format_to_buffer.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -['f', 'o', 'o', 'b', 'a', 'r'] diff --git a/old_tests/tests/lean/frozen_local_instances.lean b/old_tests/tests/lean/frozen_local_instances.lean deleted file mode 100644 index ce6817f1c7..0000000000 --- a/old_tests/tests/lean/frozen_local_instances.lean +++ /dev/null @@ -1,7 +0,0 @@ -example (α : Type) [has_add α] [has_mul α] [decidable_eq α] : true := -begin - (tactic.frozen_local_instances >>= tactic.trace), - tactic.unfreeze_local_instances, - (tactic.frozen_local_instances >>= tactic.trace), - trivial -end diff --git a/old_tests/tests/lean/frozen_local_instances.lean.expected.out b/old_tests/tests/lean/frozen_local_instances.lean.expected.out deleted file mode 100644 index 58692ab572..0000000000 --- a/old_tests/tests/lean/frozen_local_instances.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -(some [_inst_3, _inst_2, _inst_1]) -none diff --git a/old_tests/tests/lean/ftree.lean b/old_tests/tests/lean/ftree.lean deleted file mode 100644 index ea6ab3158c..0000000000 --- a/old_tests/tests/lean/ftree.lean +++ /dev/null @@ -1,31 +0,0 @@ -inductive List (T : Sort*) : Sort* | nil {} : List | cons : T → List → List - -namespace explicit - -inductive {u₁ u₂} ftree (A : Type u₁) (B : Type u₂) : Type (max 1 u₁ u₂) -| leafa : A → ftree -| leafb : B → ftree -| node : (A → ftree) → (B → ftree) → ftree - -end explicit - -namespace implicit - -inductive ftree (A : Type) (B : Type) : Type -| leafa : ftree -| node : (A → B → ftree) → (B → ftree) → ftree - -set_option pp.universes true -#check ftree -end implicit - - -namespace implicit2 - -inductive ftree (A : Type) (B : Type) : Type -| leafa : A → ftree -| leafb : B → ftree -| node : (List A → ftree) → (B → ftree) → ftree -set_option pp.universes true -#check ftree -end implicit2 diff --git a/old_tests/tests/lean/ftree.lean.expected.out b/old_tests/tests/lean/ftree.lean.expected.out deleted file mode 100644 index 6f46e44467..0000000000 --- a/old_tests/tests/lean/ftree.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -ftree : Type → Type → Type -ftree : Type → Type → Type diff --git a/old_tests/tests/lean/generalize1.lean b/old_tests/tests/lean/generalize1.lean deleted file mode 100644 index 98b189ca50..0000000000 --- a/old_tests/tests/lean/generalize1.lean +++ /dev/null @@ -1,15 +0,0 @@ -open tactic - -add_key_equivalence has_add.add nat.succ - -set_option pp.binder_types true - -example (a b c : nat) : a + 1 = b + 1 → b + 1 = a + 1 := -by do - a ← get_local `a, b ← get_local `b, - e₁ ← mk_app `nat.succ [a], - e₂ ← mk_app `nat.succ [b], - generalize e₁ `x, - generalize e₂ `y, - trace_state, - intros, symmetry, assumption diff --git a/old_tests/tests/lean/generalize1.lean.expected.out b/old_tests/tests/lean/generalize1.lean.expected.out deleted file mode 100644 index f3a2a5562a..0000000000 --- a/old_tests/tests/lean/generalize1.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -a b c : ℕ -⊢ ∀ (y x : ℕ), x = y → y = x diff --git a/old_tests/tests/lean/get_unused_name.lean b/old_tests/tests/lean/get_unused_name.lean deleted file mode 100644 index 5be4eb45f9..0000000000 --- a/old_tests/tests/lean/get_unused_name.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic - -example (a b c : nat) : a = c → a + b = b + c := -by do - n1 ← get_unused_name `a, - n2 ← get_unused_name `b, - n3 ← get_unused_name `c, - n4 ← get_unused_name `d, - intro n1, - n5 ← get_unused_name `a, - trace n1 >> trace n2 >> trace n3 >> trace n4 >> trace n5, - get_local `a >>= subst, - `[apply add_comm] diff --git a/old_tests/tests/lean/get_unused_name.lean.expected.out b/old_tests/tests/lean/get_unused_name.lean.expected.out deleted file mode 100644 index d800a233e1..0000000000 --- a/old_tests/tests/lean/get_unused_name.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -a_1 -b_1 -c_1 -d -a_2 diff --git a/old_tests/tests/lean/guard_names.lean b/old_tests/tests/lean/guard_names.lean deleted file mode 100644 index de82b840bb..0000000000 --- a/old_tests/tests/lean/guard_names.lean +++ /dev/null @@ -1,12 +0,0 @@ -inductive tree (α : Type) -| leaf : tree -| node (left : tree) (val : α) (right : tree) : tree - -constant foo {α : Type} : tree α → tree α - -example {α : Type} (a b : tree α) : foo a = a := -begin - with_cases { induction a }, - { admit }, - case : l v r ih_l ih_r { trace_state, admit }, -end diff --git a/old_tests/tests/lean/guard_names.lean.expected.out b/old_tests/tests/lean/guard_names.lean.expected.out deleted file mode 100644 index d2e0a39754..0000000000 --- a/old_tests/tests/lean/guard_names.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -α : Type, -b l : tree α, -v : α, -r : tree α, -ih_l : foo l = l, -ih_r : foo r = r -⊢ foo (tree.node l v r) = tree.node l v r -guard_names.lean:7:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/hex_char.lean b/old_tests/tests/lean/hex_char.lean deleted file mode 100644 index bc2f732dae..0000000000 --- a/old_tests/tests/lean/hex_char.lean +++ /dev/null @@ -1,3 +0,0 @@ -#eval '\x41' -#eval '\x42' -#eval '\x43' diff --git a/old_tests/tests/lean/hex_char.lean.expected.out b/old_tests/tests/lean/hex_char.lean.expected.out deleted file mode 100644 index a252a09df7..0000000000 --- a/old_tests/tests/lean/hex_char.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -'A' -'B' -'C' diff --git a/old_tests/tests/lean/hex_numeral.lean b/old_tests/tests/lean/hex_numeral.lean deleted file mode 100644 index 8a07c476b5..0000000000 --- a/old_tests/tests/lean/hex_numeral.lean +++ /dev/null @@ -1,5 +0,0 @@ -#eval (0xff : nat) -#eval (0xffff : nat) -#eval (0xaa : nat) -#eval (0x10 : nat) -#eval (0x10000 : nat) diff --git a/old_tests/tests/lean/hex_numeral.lean.expected.out b/old_tests/tests/lean/hex_numeral.lean.expected.out deleted file mode 100644 index 29c2842dd1..0000000000 --- a/old_tests/tests/lean/hex_numeral.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -255 -65535 -170 -16 -65536 diff --git a/old_tests/tests/lean/hide_cmd1.lean b/old_tests/tests/lean/hide_cmd1.lean deleted file mode 100644 index 2a9f912d9d..0000000000 --- a/old_tests/tests/lean/hide_cmd1.lean +++ /dev/null @@ -1,56 +0,0 @@ -section tst1 -open nat -#check succ -hide succ -#check succ -- Error -end tst1 - -section tst2 -open nat -hide succ -def succ := tt -#check succ -- Should not fail, it is not ambiguous since the alias nat.succ has been hidden -end tst2 - -section tst3 -open nat -section nested -hide zero -#check zero -- Error -end nested -#check zero -- Should work, the scope of the previous `hide` is the section nested -end tst3 - -namespace tst4 -open nat -namespace nested -hide zero -#check zero -- Error -end nested -#check zero -- Should work, the scope of the previous `hide` is the namespace nested -end tst4 - -section tst5 -hide nat.succ -- Error, we can only hide aliases for now -end tst5 - -section tst6 -#check @is_true -- is_true is an alias for decidable.is_true -hide is_true -#check @is_true -- Error -end tst6 -#check @is_true - -def is_true := tt -#check is_true -- Error, is_true is now ambiguous -hide is_true -#check is_true -- should work, is_true : bool - -section tst7 -open list -#check map -#check foldl -hide map foldl -#check map -- Error -#check foldl -- Error -end tst7 diff --git a/old_tests/tests/lean/hide_cmd1.lean.expected.out b/old_tests/tests/lean/hide_cmd1.lean.expected.out deleted file mode 100644 index 3a5f14ca70..0000000000 --- a/old_tests/tests/lean/hide_cmd1.lean.expected.out +++ /dev/null @@ -1,21 +0,0 @@ -succ : ℕ → ℕ -hide_cmd1.lean:5:7: error: unknown identifier 'succ' -succ : bool -hide_cmd1.lean:19:7: error: unknown identifier 'zero' -0 : ℕ -hide_cmd1.lean:28:7: error: unknown identifier 'zero' -0 : ℕ -hide_cmd1.lean:34:0: error: invalid 'hide' command, 'nat.succ' is not an alias -is_true : Π {p : Prop}, p → decidable p -hide_cmd1.lean:40:8: error: unknown identifier 'is_true' -is_true : Π {p : Prop}, p → decidable p -hide_cmd1.lean:45:7: error: ambiguous overload, possible interpretations - is_true - decidable.is_true -Additional information: -hide_cmd1.lean:45:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -is_true : bool -map : (?M_1 → ?M_2) → list ?M_1 → list ?M_2 -foldl : (?M_1 → ?M_2 → ?M_1) → ?M_1 → list ?M_2 → ?M_1 -hide_cmd1.lean:54:7: error: unknown identifier 'map' -hide_cmd1.lean:55:7: error: unknown identifier 'foldl' diff --git a/old_tests/tests/lean/hinst_lemmas1.lean b/old_tests/tests/lean/hinst_lemmas1.lean deleted file mode 100644 index 5752516707..0000000000 --- a/old_tests/tests/lean/hinst_lemmas1.lean +++ /dev/null @@ -1,13 +0,0 @@ -axiom foo1 : ∀ (a b c : nat), b > a → b < c → a < c -axiom foo2 : ∀ (a b c : nat), b > a → b < c → a < c -axiom foo3 : ∀ (a b c : nat), b > a → b < c + c → a < c + c - - -run_cmd -do - hs ← return $ hinst_lemmas.mk, - h₁ ← hinst_lemma.mk_from_decl `foo1, - h₂ ← hinst_lemma.mk_from_decl_core tactic.transparency.none `foo2 ff, - h₃ ← hinst_lemma.mk_from_decl `foo3, - hs ← return $ ((hs^.add h₁)^.add h₂)^.add h₃, - hs^.pp >>= tactic.trace diff --git a/old_tests/tests/lean/hinst_lemmas1.lean.expected.out b/old_tests/tests/lean/hinst_lemmas1.lean.expected.out deleted file mode 100644 index fa42c3b051..0000000000 --- a/old_tests/tests/lean/hinst_lemmas1.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -{[foo2, patterns: {{?x_1 > ?x_0, ?x_1 < ?x_2}}], [foo3, patterns: {{?x_1 > ?x_0, ?x_1 < ?x_2 + ?x_2}}]} diff --git a/old_tests/tests/lean/hinst_lemmas2.lean b/old_tests/tests/lean/hinst_lemmas2.lean deleted file mode 100644 index 4a081fdf32..0000000000 --- a/old_tests/tests/lean/hinst_lemmas2.lean +++ /dev/null @@ -1,23 +0,0 @@ -run_cmd mk_hinst_lemma_attr_set `attr_main [`attr1, `attr2] [`sattr1, `sattr2] - -constant f : nat → nat -constant g : nat → nat → nat -constant p : nat → Prop - -constant fax1 : ∀ x, f x = g x x -constant gax1 : ∀ x y, p x → p y → g x y = x -constant gax2 : ∀ x y, g x y = 0 → g x (f y) = g x y -constant gax3 : ∀ x, g x x = f x -constant gax4 : ∀ x y, (: g x (f y) :) = 0 → g y x = 1 -constant gax5 : ∀ x y z, p y → g x z = 0 → g y x = 1 -constant gax6 : ∀ x y, g x y = g y x - -attribute [attr_main] fax1 -attribute [attr1] gax1 -attribute [sattr2] gax2 -attribute [attr2] gax3 -attribute [attr2] gax4 -attribute [attr_main] gax5 -attribute [sattr1] gax6 - -run_cmd get_hinst_lemmas_for_attr `attr_main >>= hinst_lemmas.pp >>= tactic.trace diff --git a/old_tests/tests/lean/hinst_lemmas2.lean.expected.out b/old_tests/tests/lean/hinst_lemmas2.lean.expected.out deleted file mode 100644 index ec8b8df970..0000000000 --- a/old_tests/tests/lean/hinst_lemmas2.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -{[fax1, patterns: {{f ?x_0}, {g ?x_0 ?x_0}}], - [gax3, patterns: {{f ?x_0}, {g ?x_0 ?x_0}}], - [gax6, patterns: {{g ?x_0 ?x_1}}], - [gax1, patterns: {{g ?x_0 ?x_1}}], - [gax2, patterns: {{g ?x_0 (f ?x_1)}}], - [gax4, patterns: {{g ?x_0 (f ?x_1)}}], - [gax5, patterns: {{p ?x_1, g ?x_0 ?x_2}}]} diff --git a/old_tests/tests/lean/hole_in_fn.lean b/old_tests/tests/lean/hole_in_fn.lean deleted file mode 100644 index 866aad72b9..0000000000 --- a/old_tests/tests/lean/hole_in_fn.lean +++ /dev/null @@ -1,6 +0,0 @@ - -inductive foo -| mk : (nat → nat) → foo - -definition f : foo := -foo.mk (λ n, _) diff --git a/old_tests/tests/lean/hole_in_fn.lean.expected.out b/old_tests/tests/lean/hole_in_fn.lean.expected.out deleted file mode 100644 index bf2284477d..0000000000 --- a/old_tests/tests/lean/hole_in_fn.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -hole_in_fn.lean:6:13: error: don't know how to synthesize placeholder -context: -n : ℕ -⊢ ℕ diff --git a/old_tests/tests/lean/hole_issue2.lean b/old_tests/tests/lean/hole_issue2.lean deleted file mode 100644 index bf52257960..0000000000 --- a/old_tests/tests/lean/hole_issue2.lean +++ /dev/null @@ -1,37 +0,0 @@ -constant bag_setoid : ∀ A, setoid (list A) -attribute [instance] bag_setoid - - -definition bag (A : Type) : Type := -quotient (bag_setoid A) - -constant subcount : ∀ {A}, list A → list A → bool -constant list.count : ∀ {A}, A → list A → nat -constant all_of_subcount_eq_tt : ∀ {A} {l₁ l₂ : list A}, subcount l₁ l₂ = tt → ∀ a, list.count a l₁ ≤ list.count a l₂ -constant ex_of_subcount_eq_ff : ∀ {A} {l₁ l₂ : list A}, subcount l₁ l₂ = ff → ∃ a, ¬ list.count a l₁ ≤ list.count a l₂ -noncomputable definition count {A} (a : A) (b : bag A) : nat := -quotient.lift_on b (λ l, list.count a l) - (λ l₁ l₂ h, sorry) -definition subbag {A} (b₁ b₂ : bag A) := ∀ a, count a b₁ ≤ count a b₂ -infix ⊆ := subbag - -noncomputable definition decidable_subbag_1 {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match subcount l₁ l₂, rfl : ∀ (b : _), subcount l₁ l₂ = b → _ with - | tt, H := is_true (all_of_subcount_eq_tt H) - | ff, H := is_false (λ h, exists.elim (ex_of_subcount_eq_ff H) (λ w hw, _)) - end) - -noncomputable definition decidable_subbag_2 {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match subcount l₁ l₂, rfl : ∀ (b : _), subcount l₁ l₂ = b → _ with - | tt, H := is_true (all_of_subcount_eq_tt H) - | ff, H := is_false (λ h, exists.elim (ex_of_subcount_eq_ff H) _) - end) - -noncomputable definition decidable_subbag_3 {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match subcount l₁ l₂, rfl : ∀ (b : _), subcount l₁ l₂ = b → _ with - | tt, H := is_true (all_of_subcount_eq_tt H) - | ff, H := is_false (λ h, _) - end) diff --git a/old_tests/tests/lean/hole_issue2.lean.expected.out b/old_tests/tests/lean/hole_issue2.lean.expected.out deleted file mode 100644 index e188053ff4..0000000000 --- a/old_tests/tests/lean/hole_issue2.lean.expected.out +++ /dev/null @@ -1,30 +0,0 @@ -hole_issue2.lean:12:14: warning: declaration 'count' uses sorry -hole_issue2.lean:22:74: error: don't know how to synthesize placeholder -context: -A : Type, -b₁ b₂ : bag A, -l₁ l₂ : list A, -_match : Π (b : bool), subcount l₁ l₂ = b → decidable (⟦l₁⟧ ⊆ ⟦l₂⟧), -H : subcount l₁ l₂ = ff, -h : ⟦l₁⟧ ⊆ ⟦l₂⟧, -w : A, -hw : ¬list.count w l₁ ≤ list.count w l₂ -⊢ false -hole_issue2.lean:29:65: error: don't know how to synthesize placeholder -context: -A : Type, -b₁ b₂ : bag A, -l₁ l₂ : list A, -_match : Π (b : bool), subcount l₁ l₂ = b → decidable (⟦l₁⟧ ⊆ ⟦l₂⟧), -H : subcount l₁ l₂ = ff, -h : ⟦l₁⟧ ⊆ ⟦l₂⟧ -⊢ ∀ (a : A), ¬list.count a l₁ ≤ list.count a l₂ → false -hole_issue2.lean:36:28: error: don't know how to synthesize placeholder -context: -A : Type, -b₁ b₂ : bag A, -l₁ l₂ : list A, -_match : Π (b : bool), subcount l₁ l₂ = b → decidable (⟦l₁⟧ ⊆ ⟦l₂⟧), -H : subcount l₁ l₂ = ff, -h : ⟦l₁⟧ ⊆ ⟦l₂⟧ -⊢ false diff --git a/old_tests/tests/lean/implicit_after_auto_param_bug.lean b/old_tests/tests/lean/implicit_after_auto_param_bug.lean deleted file mode 100644 index 58462b60a4..0000000000 --- a/old_tests/tests/lean/implicit_after_auto_param_bug.lean +++ /dev/null @@ -1,33 +0,0 @@ -meta def default_f_lt := `[apply has_lt.lt] - -def f (α : Type) (lt : α → α → Prop . default_f_lt) [decidable_rel lt] : Type := -α - -example : id (f nat) = nat := -rfl - -example : f nat = nat := -rfl - -def mk {α : Type} (a : α) (lt : α → α → Prop . default_f_lt) [decidable_rel lt] : f α lt := -a - -def f.to_val {α : Type} {lt : α → α → Prop} {h : decidable_rel lt} (v : @f α lt h) : α := -v - -instance repr_f (α : Type) (lt : α → α → Prop) (d : decidable_rel lt) [has_repr α] : has_repr (@f α lt d) := -⟨λ a : α, repr a⟩ - -#check f nat - -#check id (f nat) - -#check mk 1 - -#check (mk 1).to_val - -#eval f.to_val (mk 1) - -#eval mk 1 - -#eval id (mk 1) diff --git a/old_tests/tests/lean/implicit_after_auto_param_bug.lean.expected.out b/old_tests/tests/lean/implicit_after_auto_param_bug.lean.expected.out deleted file mode 100644 index a2d77f3a56..0000000000 --- a/old_tests/tests/lean/implicit_after_auto_param_bug.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -f ℕ has_lt.lt : Type -id (f ℕ has_lt.lt) : Type -mk 1 has_lt.lt : f ℕ has_lt.lt -f.to_val (mk 1 has_lt.lt) : ℕ -1 -1 -1 diff --git a/old_tests/tests/lean/import_invalid_tk.lean b/old_tests/tests/lean/import_invalid_tk.lean deleted file mode 100644 index d9b2730ab1..0000000000 --- a/old_tests/tests/lean/import_invalid_tk.lean +++ /dev/null @@ -1,3 +0,0 @@ -import data.buffer 0b311 - -#print buffer diff --git a/old_tests/tests/lean/import_invalid_tk.lean.expected.out b/old_tests/tests/lean/import_invalid_tk.lean.expected.out deleted file mode 100644 index 313d7e8074..0000000000 --- a/old_tests/tests/lean/import_invalid_tk.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -import_invalid_tk.lean:1:21: error: invalid binary digit -def buffer : Type u → Type u := -λ (α : Type u), Σ (n : ℕ), array n α diff --git a/old_tests/tests/lean/import_middle.lean b/old_tests/tests/lean/import_middle.lean deleted file mode 100644 index 123c4c9a29..0000000000 --- a/old_tests/tests/lean/import_middle.lean +++ /dev/null @@ -1,5 +0,0 @@ -import data.buffer - -#print "hello" - -import data.dlist diff --git a/old_tests/tests/lean/import_middle.lean.expected.out b/old_tests/tests/lean/import_middle.lean.expected.out deleted file mode 100644 index fadb9d0d16..0000000000 --- a/old_tests/tests/lean/import_middle.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -hello -import_middle.lean:5:0: error: invalid 'import' command, it must be used in the beginning of the file diff --git a/old_tests/tests/lean/inaccessible.lean b/old_tests/tests/lean/inaccessible.lean deleted file mode 100644 index d06ce29d74..0000000000 --- a/old_tests/tests/lean/inaccessible.lean +++ /dev/null @@ -1,83 +0,0 @@ -universe variables u v -inductive imf {A : Type u} {B : Type v} (f : A → B) : B → Type (max 1 u v) -| mk : ∀ (a : A), imf (f a) - -definition inv_1 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| .(f a) (imf.mk .(f) a) := a - -definition inv_2 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| ._ (imf.mk ._ a) := a - -definition mk {A : Type u} {B : Type v} {f : A → B} (a : A) := imf.mk f a - -definition inv_3 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| .(f a) (mk a) := a -- Error, mk is not a constructor - -definition inv_4 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| .(f a) (.(mk) a) := a -- Error, we cannot use inaccessible annotation around functions in applications - -attribute [pattern] mk - -definition inv_5 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| .(f a) (mk a) := a - -definition inv_6 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| (f a) (mk a) := a -- Error, 'a' is being "declared" twice in the pattern - -definition inv_7 {A : Type u} {B : Type v} (f : A → B) : ∀ (b : B), imf f b → A -| (f a) (mk b) := a -- Typing error, it would also fail when compiling the pattern - -definition g_1 : nat → nat → nat -| a a := a -- Error, 'a' is being "declared" twice - -definition g_2 (a : nat) : nat → nat → nat -| a b := a - -example (a b c : nat) : g_2 a b c = b := -rfl - -inductive vec1 (A : Type u) : nat → Type (max 1 u) -| nil : vec1 0 -| cons : ∀ n, A → vec1 n → vec1 (n+1) - -section -open vec1 - -definition map_1 {A : Type u} (f : A → A → A) : Π {n}, vec1 A n → vec1 A n → vec1 A n -| 0 (nil .(A)) (nil .(A)) := nil A -| (n+1) (cons .(n) h₁ v₁) (cons .(n) h₂ v₂) := cons n (f h₁ h₂) (map_1 v₁ v₂) - -definition map_2 {A : Type u} (f : A → A → A) : Π {n}, vec1 A n → vec1 A n → vec1 A n -| 0 (nil ._) (nil ._) := nil A -| (n+1) (cons ._ h₁ v₁) (cons ._ h₂ v₂) := cons n (f h₁ h₂) (map_2 v₁ v₂) - -/- In map_3, we use the inaccessible terms to avoid pattern/matching on the first argument -/ -definition map_3 {A : Type u} (f : A → A → A) : Π {n}, vec1 A n → vec1 A n → vec1 A n -| ._ (nil ._) (nil ._) := nil A -| ._ (cons n h₁ v₁) (cons .(n) h₂ v₂) := cons n (f h₁ h₂) (map_3 v₁ v₂) -end - -inductive vec2 (A : Type u) : nat → Type (max 1 u) -| nil {} : vec2 0 -| cons : ∀ {n}, A → vec2 n → vec2 (n+1) - -section -open vec2 - -definition map_4 {A : Type u} (f : A → A → A) : Π {n}, vec2 A n → vec2 A n → vec2 A n -| 0 nil nil := nil -| (n+1) (cons h₁ v₁) (cons h₂ v₂) := cons (f h₁ h₂) (map_4 v₁ v₂) - -definition map_5 {A : Type u} (f : A → A → A) : Π {n}, vec2 A n → vec2 A n → vec2 A n -| ._ nil nil := nil -| ._ (@cons ._ n h₁ v₁) (cons h₂ v₂) := cons (f h₁ h₂) (map_5 v₁ v₂) - -/- -The following variant will be rejected by the new equation compiler. -In Lean2, the second equation is accepted because unassigned metavariables -occurring in patterns become new variables. This feature is too hackish. --/ -definition map_6 {A : Type u} (f : A → A → A) : Π {n}, vec2 A n → vec2 A n → vec2 A n -| ._ nil nil := nil -| ._ (cons h₁ v₁) (cons h₂ v₂) := cons (f h₁ h₂) (map_6 v₁ v₂) -end diff --git a/old_tests/tests/lean/inaccessible.lean.expected.out b/old_tests/tests/lean/inaccessible.lean.expected.out deleted file mode 100644 index d3b9902182..0000000000 --- a/old_tests/tests/lean/inaccessible.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -inaccessible.lean:14:10: error: invalid application, function expected -inaccessible.lean:14:13: error: don't know how to synthesize placeholder -context: -A : Type u, -B : Type v, -f : A → B, -inv_3 : Π (b : B), imf f b → A -⊢ A -inaccessible.lean:13:11: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) -inaccessible.lean:17:12: error: invalid inaccessible annotation, it cannot be used around functions in applications -inaccessible.lean:17:16: error: don't know how to synthesize placeholder -context: -A : Type u, -B : Type v, -f : A → B, -inv_4 : Π (b : B), imf f b → A -⊢ A -inaccessible.lean:16:11: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) -inaccessible.lean:25:12: error: invalid pattern, 'a' already appeared in this pattern -inaccessible.lean:25:3: error: invalid application, function expected -inaccessible.lean:25:16: error: ill-formed match/equation expression -inaccessible.lean:28:3: error: invalid application, function expected -inaccessible.lean:28:16: error: ill-formed match/equation expression -inaccessible.lean:31:4: error: invalid pattern, 'a' already appeared in this pattern diff --git a/old_tests/tests/lean/inaccessible2.lean b/old_tests/tests/lean/inaccessible2.lean deleted file mode 100644 index 1dcb8c4dec..0000000000 --- a/old_tests/tests/lean/inaccessible2.lean +++ /dev/null @@ -1,17 +0,0 @@ -inductive imf {A B : Sort*} (f : A → B) : B → Sort* -| mk : ∀ (a : A), imf (f a) - -definition inv_1 {A B : Sort*} (f : A → B) : ∀ (b : B), imf f b → A -| .(f .(a)) (imf.mk .(f) a) := a -- Error inaccessible annotation inside inaccessible annotation - -definition inv_2 {A B : Sort*} (f : A → B) : ∀ (b : B), imf f b → A -| .(f a) (let x := (imf.mk .(f) a) in x) := a -- Error invalid occurrence of 'let' expression - -definition inv_3 {A B : Sort*} (f : A → B) : ∀ (b : B), imf f b → A -| .(f a) ((λ (x : imf f b), x) (imf.mk .(f) a)) := a -- Error invalid occurrence of 'lambda' expression - -definition sym {A : Sort*} : ∀ a b : A, a = b → b = a -| .(a) .(a) (eq.refl a) := rfl -- Error `a` in eq.refl must be marked as inaccessible since it is an inductive datatype parameter - -definition symm2 {A : Sort*} : ∀ a b : A, a = b → b = a -| _ _ rfl := rfl -- correct version diff --git a/old_tests/tests/lean/inaccessible2.lean.expected.out b/old_tests/tests/lean/inaccessible2.lean.expected.out deleted file mode 100644 index c30f422cb5..0000000000 --- a/old_tests/tests/lean/inaccessible2.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -inaccessible2.lean:5:8: error: invalid occurrence of 'inaccessible' annotation, it must only occur in patterns -inaccessible2.lean:8:10: error: invalid pattern, must be an application, constant, variable, type ascription, aliasing pattern or inaccessible term -inaccessible2.lean:8:45: error: unknown identifier 'a' -inaccessible2.lean:7:11: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) -inaccessible2.lean:11:39: error: inaccesible pattern notation `.(t)` can only be used in patterns -inaccessible2.lean:11:46: error: invalid expression -inaccessible2.lean:11:4: error: invalid application, function expected -inaccessible2.lean:11:46: error: ill-formed match/equation expression -inaccessible2.lean:11:46: error: command expected -inaccessible2.lean:14:21: error: don't know how to synthesize placeholder -context: -A : Sort ?, -sym : ∀ (a b : A), a = b → b = a -⊢ A -inaccessible2.lean:13:11: error: equation compiler failed to create auxiliary declaration 'sym._main' -nested exception message: -type mismatch at application - eq.rec (λ (a_1 : a = a) (H_2 : a_1 == eq.refl a), id_rhs (⁇ = ⁇) rfl) -term - λ (a_1 : a = a) (H_2 : a_1 == eq.refl a), id_rhs (⁇ = ⁇) rfl -has type - ∀ (a_1 : a = a), a_1 == _ → ⁇ = ⁇ -but is expected to have type - (λ (b : A), ∀ (a_1 : a = b), a_1 == _ → b = a) a diff --git a/old_tests/tests/lean/induction_generalize_premise_args.lean b/old_tests/tests/lean/induction_generalize_premise_args.lean deleted file mode 100644 index 20c6a0f6f0..0000000000 --- a/old_tests/tests/lean/induction_generalize_premise_args.lean +++ /dev/null @@ -1,13 +0,0 @@ -namespace semantics - inductive com - | seq (c₁ c₂ : com) - constant state : Type - inductive smallstep : com × state → com × state → Prop - | seq1 (c₁ c₂ σ c₁' σ') : smallstep ⟨c₁, σ⟩ ⟨c₂, σ'⟩ → smallstep ⟨com.seq c₁ c₂, σ⟩ ⟨com.seq c₁' c₂, σ'⟩ - - lemma deterministic_aux (c σ c'₁ c'₂ σ'₁ σ'₂) (h₁ : smallstep ⟨c, σ⟩ ⟨c'₁, σ'₁⟩) - (h₂ : smallstep ⟨c, σ⟩ ⟨c'₂, σ'₂⟩) : (c'₁, σ'₁) = (c'₂, σ'₂) := - begin - induction h₁ generalizing c'₂ σ'₂, - end -end semantics diff --git a/old_tests/tests/lean/induction_generalize_premise_args.lean.expected.out b/old_tests/tests/lean/induction_generalize_premise_args.lean.expected.out deleted file mode 100644 index 2e740032b6..0000000000 --- a/old_tests/tests/lean/induction_generalize_premise_args.lean.expected.out +++ /dev/null @@ -1,14 +0,0 @@ -induction_generalize_premise_args.lean:12:2: error: tactic failed, there are unsolved goals -state: -h₁_c₁ h₁_c₂ : com, -h₁_σ : state, -h₁_c₁' : com, -h₁_σ' : state, -h₁_a : smallstep (h₁_c₁, h₁_σ) (h₁_c₂, h₁_σ'), -h₁_ih : - ∀ (c'₂ : com) (σ'₂ : state), - smallstep (h₁_c₁, h₁_σ) (c'₂, σ'₂) → (h₁_c₂, h₁_σ') = (c'₂, σ'₂), -c'₂ : com, -σ'₂ : state, -h₂ : smallstep (com.seq h₁_c₁ h₁_c₂, h₁_σ) (c'₂, σ'₂) -⊢ (com.seq h₁_c₁' h₁_c₂, h₁_σ') = (c'₂, σ'₂) diff --git a/old_tests/tests/lean/induction_naming.lean b/old_tests/tests/lean/induction_naming.lean deleted file mode 100644 index 653a72f74e..0000000000 --- a/old_tests/tests/lean/induction_naming.lean +++ /dev/null @@ -1,22 +0,0 @@ -example (a b : nat) : a + b = b + a := -begin - cases a, - trace_state, /- `a` was used to name constructor field -/ - repeat { admit } -end - -example (a b : nat) : a + b = b + a := -begin - induction a, - trace_state, /- `a_n` and `a_ih` were used to name constructor fields -/ - repeat { admit } -end - -set_option tactic.induction.concat_names false - -example (a b : nat) : a + b = b + a := -begin - induction a, - trace_state, /- `n` and `ih` were used to name constructor fields -/ - repeat { admit } -end diff --git a/old_tests/tests/lean/induction_naming.lean.expected.out b/old_tests/tests/lean/induction_naming.lean.expected.out deleted file mode 100644 index ec62bd524b..0000000000 --- a/old_tests/tests/lean/induction_naming.lean.expected.out +++ /dev/null @@ -1,29 +0,0 @@ -2 goals -case nat.zero -b : ℕ -⊢ 0 + b = b + 0 - -case nat.succ -b a : ℕ -⊢ nat.succ a + b = b + nat.succ a -induction_naming.lean:1:0: warning: declaration '[anonymous]' uses sorry -2 goals -case nat.zero -b : ℕ -⊢ 0 + b = b + 0 - -case nat.succ -b a_n : ℕ, -a_ih : a_n + b = b + a_n -⊢ nat.succ a_n + b = b + nat.succ a_n -induction_naming.lean:8:0: warning: declaration '[anonymous]' uses sorry -2 goals -case nat.zero -b : ℕ -⊢ 0 + b = b + 0 - -case nat.succ -b n : ℕ, -ih : n + b = b + n -⊢ nat.succ n + b = b + nat.succ n -induction_naming.lean:17:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/induction_naming2.lean b/old_tests/tests/lean/induction_naming2.lean deleted file mode 100644 index b8268a2a20..0000000000 --- a/old_tests/tests/lean/induction_naming2.lean +++ /dev/null @@ -1,12 +0,0 @@ -inductive tree -| leaf : tree -| node (left : tree) (val : nat) (right : tree) : tree - -constant foo : tree → tree - -example (a : tree) : foo a = a := -begin - induction a, - trace_state, - repeat { admit } -end diff --git a/old_tests/tests/lean/induction_naming2.lean.expected.out b/old_tests/tests/lean/induction_naming2.lean.expected.out deleted file mode 100644 index 3c758f5950..0000000000 --- a/old_tests/tests/lean/induction_naming2.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -2 goals -case tree.leaf -⊢ foo tree.leaf = tree.leaf - -case tree.node -a_left : tree, -a_val : ℕ, -a_right : tree, -a_ih_left : foo a_left = a_left, -a_ih_right : foo a_right = a_right -⊢ foo (tree.node a_left a_val a_right) = tree.node a_left a_val a_right -induction_naming2.lean:7:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/induction_tac1.lean b/old_tests/tests/lean/induction_tac1.lean deleted file mode 100644 index f4f5a5ff2c..0000000000 --- a/old_tests/tests/lean/induction_tac1.lean +++ /dev/null @@ -1,31 +0,0 @@ -open tactic - -example (p q : Prop) : p ∨ q → q ∨ p := -by do - H ← intro `H, - induction H [`Hp, `Hq], - trace_state, - constructor_idx 2, assumption, - constructor_idx 1, assumption - -#print "-----" - -open nat -example (n : ℕ) : n = 0 ∨ n = succ (pred n) := -by do - n ← get_local `n, - induction n [`n', `Hind], - trace_state, - constructor_idx 1, reflexivity, - constructor_idx 2, reflexivity, - return () - -#print "-----" - -example (n : ℕ) (H : n ≠ 0) : n > 0 → n = succ (pred n) := -by do - n ← get_local `n, - induction n [], - trace_state, - intro `H1, contradiction, - intros, reflexivity diff --git a/old_tests/tests/lean/induction_tac1.lean.expected.out b/old_tests/tests/lean/induction_tac1.lean.expected.out deleted file mode 100644 index 1046b88594..0000000000 --- a/old_tests/tests/lean/induction_tac1.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -2 goals -p q : Prop, -Hp : p -⊢ q ∨ p - -p q : Prop, -Hq : q -⊢ q ∨ p ------ -2 goals -⊢ 0 = 0 ∨ 0 = succ (pred 0) - -n' : ℕ, -Hind : n' = 0 ∨ n' = succ (pred n') -⊢ succ n' = 0 ∨ succ n' = succ (pred (succ n')) ------ -2 goals -H : 0 ≠ 0 -⊢ 0 > 0 → 0 = succ (pred 0) - -n_n : ℕ, -n_ih : n_n ≠ 0 → n_n > 0 → n_n = succ (pred n_n), -H : succ n_n ≠ 0 -⊢ succ n_n > 0 → succ n_n = succ (pred (succ n_n)) diff --git a/old_tests/tests/lean/inductive_cmd_leftover_placeholder_universe.lean b/old_tests/tests/lean/inductive_cmd_leftover_placeholder_universe.lean deleted file mode 100644 index f30a3d2d74..0000000000 --- a/old_tests/tests/lean/inductive_cmd_leftover_placeholder_universe.lean +++ /dev/null @@ -1,3 +0,0 @@ -inductive ValueEffect (V : Type) (R : Type → Type) : Type -| Value : V → ValueEffect -| Effect : R (ValueEffect) → ValueEffect diff --git a/old_tests/tests/lean/inductive_cmd_leftover_placeholder_universe.lean.expected.out b/old_tests/tests/lean/inductive_cmd_leftover_placeholder_universe.lean.expected.out deleted file mode 100644 index 5f06c58f0c..0000000000 --- a/old_tests/tests/lean/inductive_cmd_leftover_placeholder_universe.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -inductive_cmd_leftover_placeholder_universe.lean:1:0: error: inductive type being declared can only be nested inside the parameters of other inductive types diff --git a/old_tests/tests/lean/inductive_resultant_level_inference.lean b/old_tests/tests/lean/inductive_resultant_level_inference.lean deleted file mode 100644 index 23d8639079..0000000000 --- a/old_tests/tests/lean/inductive_resultant_level_inference.lean +++ /dev/null @@ -1,177 +0,0 @@ -set_option pp.all true -universe variables u v w - -namespace X1 - -#print "\n1. ?U does not unify with anything" - -inductive foo (A : Type u) (B : Type (v+1)) -| mk : A → B → foo - -#check @foo.{u v} -- : Type (max u (v+1)) - -end X1 - -namespace X2 - -#print "\n2. ?U unifies with a constant, no others above: done" - -inductive bar (A : Sort 2) : Sort 2 -| mk : A → bar - -inductive foo -| mk : Type → bar foo → foo - -#check @foo -- : Type 1 - -end X2 - -namespace X3 -#print "\n3. ?U unifies with a constant, and one above: error" - -inductive bar (A : Sort 2) : Sort 2 -| mk : A → bar - -inductive foo (A : Sort u) -| mk : A → bar foo → foo - -end X3 - -namespace X4 -#print "\n4. ?U unifies with a meta, but nesting recursor goes to Prop: error" - -inductive bar (A : Sort u) : Sort u -| mk : A → bar - -inductive foo -| mk : bar foo → foo - -end X4 - -namespace X5 -#print "\n5. ?U unifies with a meta: old approach, set level-param" - -inductive bar (A : Sort u) : Sort (max u 1) -| mk : A → bar - -inductive foo (A : Sort u) -| mk : A → bar foo → foo - -#check @foo.{u} -- Sort u → Sort (max u 1) - -end X5 - -namespace X6 -#print "\n6. ?U unifies with a shifted meta, no others above: set level-param to be inverse of meta" - -inductive bar (A : Sort (u + 3)) : Sort (u + 3) -| mk : A → bar - -inductive foo (A : Sort u) -| mk : A → bar foo → foo - -#check @foo.{u} -- Sort u → Sort (u+3) - -end X6 - -namespace X7 -#print "\n7. ?U unifies with a max: error" -inductive bar (A : Sort (max u v)) : Sort (max u v 7) -| mk : A → bar - -inductive foo (A : Sort v) -| mk : A → bar foo → foo - -end X7 - -namespace X8 -#print "\n8. wrapping inductive returns element in different universe: error" -inductive bar (A : Sort u) : Sort (u + 1) -| mk : A → bar - -inductive foo (A : Sort v) -| mk : A → bar foo → foo - -end X8 - -namespace X9 - -#print "\n9. nesting with no other level params" - -inductive bar (A : Sort u) : Sort (max u 1) -| mk : A → bar - -inductive foo -| mk : bar foo → foo - -#check @foo - -end X9 - -namespace X10 -#print "\n10. original 1343" - -inductive foo (α : Sort (u+1)) : Sort (u+1) -| mk : α → foo - -inductive bug -| mk : foo bug → bug - -#check @bug - -end X10 - -namespace X11 -#print "\n11. unifies with constant, result sort different: error" - -inductive foo (α : Sort 2) : Sort 1 -| mk : foo - -inductive bug -| mk : foo bug → bug - -end X11 - -namespace X12 -#print "\n12. multiple nestings" - -inductive foo₁ (α : Sort u) : Sort (max u 1) -| mk : foo₁ - -inductive foo₂ (α : Type u) : Type u -| mk : foo₂ - -inductive foo₃ (α : Type (u+1)) : Type (u+1) -| mk : foo₃ - -inductive bug -| mk₁ : foo₁ bug → foo₂ bug → foo₃ bug → foo₃ (foo₂ (foo₁ bug)) → foo₁ (foo₂ (foo₃ bug)) → bug -| mk₂ : foo₁ bug → foo₂ bug → foo₃ bug → foo₃ (foo₂ (foo₁ bug)) → foo₁ (foo₂ (foo₃ bug)) → bug - -#check @bug - -end X12 - -namespace X13 -#print "\n13. ?U indirectly assigned to a constant" - -inductive foo (α β : Sort u) : Sort (max u 1) -| mk : foo - -inductive bug -| mk₁ : foo bug (Type 3) → bug - -#check @bug - -end X13 - -namespace X14 -#print "\n14. No resultant level and lps are used in intro rule: error" - -inductive foo (α : Type u) : Type u -| mk : foo - -inductive bug -| mk : foo.{u} bug → bug - -end X14 diff --git a/old_tests/tests/lean/inductive_resultant_level_inference.lean.expected.out b/old_tests/tests/lean/inductive_resultant_level_inference.lean.expected.out deleted file mode 100644 index da529e94c5..0000000000 --- a/old_tests/tests/lean/inductive_resultant_level_inference.lean.expected.out +++ /dev/null @@ -1,42 +0,0 @@ - -1. ?U does not unify with anything -X1.foo.{u v} : Type u → Type (v+1) → Type (max u (v+1)) - -2. ?U unifies with a constant, no others above: done -X2.foo : Type 1 - -3. ?U unifies with a constant, and one above: error -inductive_resultant_level_inference.lean:35:0: error: universe level of type_of(arg #1) of 'X3.foo.mk' is too big for the corresponding inductive datatype - -4. ?U unifies with a meta, but nesting recursor goes to Prop: error -inductive_resultant_level_inference.lean:46:0: error: invalid nested occurrence 'X4.bar.{1} X4.foo', either both must eliminate to Type or both must eliminate only to Prop - -5. ?U unifies with a meta: old approach, set level-param -X5.foo.{u} : Sort u → Sort (max 1 u) - -6. ?U unifies with a shifted meta, no others above: set level-param to be inverse of meta -X6.foo.{u} : Sort u → Type (u+2) - -7. ?U unifies with a max: error -inductive_resultant_level_inference.lean:82:0: error: resultant level unifies with complex level 'max u_1 u_2', provide the universe levels explicitly - -8. wrapping inductive returns element in different universe: error -inductive_resultant_level_inference.lean:92:0: error: nested occurrence 'X8.bar.{(max 1 v)} foo' lives in universe 'succ (max 1 v)' but must live in resultant universe 'max 1 v' - -9. nesting with no other level params -X9.foo : Type - -10. original 1343 -X10.bug : Type - -11. unifies with constant, result sort different: error -inductive_resultant_level_inference.lean:130:0: error: nested occurrence 'X11.foo bug' lives in universe '1' but must live in resultant universe '2' - -12. multiple nestings -X12.bug : Type 1 - -13. ?U indirectly assigned to a constant -X13.bug : Type 4 - -14. No resultant level and lps are used in intro rule: error -inductive_resultant_level_inference.lean:175:2: error: resultant universe must be provided, when using explicit universe levels diff --git a/old_tests/tests/lean/infix_paren_improved.lean b/old_tests/tests/lean/infix_paren_improved.lean deleted file mode 100644 index 9ec6945901..0000000000 --- a/old_tests/tests/lean/infix_paren_improved.lean +++ /dev/null @@ -1,5 +0,0 @@ -constant f : Π {α : Type}, α → α → α - -infix `**`:60 := f - -#check (**) diff --git a/old_tests/tests/lean/infix_paren_improved.lean.expected.out b/old_tests/tests/lean/infix_paren_improved.lean.expected.out deleted file mode 100644 index 8b75e320e1..0000000000 --- a/old_tests/tests/lean/infix_paren_improved.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -f : ?M_1 → ?M_1 → ?M_1 diff --git a/old_tests/tests/lean/inject.lean b/old_tests/tests/lean/inject.lean deleted file mode 100644 index 7c3a9fddfa..0000000000 --- a/old_tests/tests/lean/inject.lean +++ /dev/null @@ -1,78 +0,0 @@ -open nat - -inductive fi : nat → Type -| f0 : ∀ {n}, fi (succ n) -| fs : ∀ {n} (j : fi n), fi (succ n) - -namespace fi - -def lift {m k : nat} (f : fi m → fi k) : ∀ {n} (i : fi (m + n)), fi (k + n) -| 0 v := f v -| (succ n) f0 := f0 -| (succ n) (fs i) := fs (lift i) - -set_option pp.implicit true - -#check @lift.equations._eqn_1 -#check @lift.equations._eqn_2 -#check @lift.equations._eqn_3 - -def to_nat : ∀ {n}, fi n → nat -| (succ n) f0 := 0 -| (succ n) (fs i) := succ (to_nat i) - -#check @to_nat.equations._eqn_1 -#check @to_nat.equations._eqn_2 - -def to_nat' : ∀ {n}, fi n → nat -| ._ (@f0 n) := 0 -| ._ (@fs n i) := succ (to_nat' i) - -def fi' {n} (i : fi n) : Type := -fi (to_nat i) - -/- We need the unification hint to be able to get sane equations when using fi' -/ -@[unify] def to_nat_hint (n m k : nat) (i : fi (succ n)) (j : fi n) : unification_hint := -{ pattern := @to_nat (succ n) (@fs n j) ≟ succ m, - constraints := [m ≟ to_nat j] } - -def inject : ∀ {n} {i : fi n}, fi' i → fi n -| (succ n) (fs i) f0 := f0 -| (succ n) (fs i) (fs j) := fs (inject j) - -def inject' : ∀ {n} {i : fi n}, fi' i → fi n -| ._ (@fs n i) f0 := f0 -| ._ (@fs n i) (fs j) := fs (inject' j) - -#check @inject.equations._eqn_1 -#check @inject.equations._eqn_2 - -#check @inject'.equations._eqn_1 -#check @inject'.equations._eqn_2 - -def raise {m} : Π n, fi m → fi (m + n) -| 0 i := i -| (succ n) i := fs (raise n i) - -#check @raise.equations._eqn_1 -#check @raise.equations._eqn_2 - -def deg : Π {n}, fi (n + 1) → fi n → fi (n + 1) -| (succ n) f0 j := fs j -| (succ n) (fs i) f0 := f0 -| (succ n) (fs i) (fs j) := fs (deg i j) - -def deg' : Π {n}, fi (n + 1) → fi n → fi (n + 1) -| ._ (@f0 (succ n)) j := fs j -| ._ (@fs (succ n) i) f0 := f0 -| ._ (@fs (succ n) i) (fs j) := fs (deg' i j) - -#check @deg.equations._eqn_1 -#check @deg.equations._eqn_2 -#check @deg.equations._eqn_3 - -#check @deg'.equations._eqn_1 -#check @deg'.equations._eqn_2 -#check @deg'.equations._eqn_3 - -end fi diff --git a/old_tests/tests/lean/inject.lean.expected.out b/old_tests/tests/lean/inject.lean.expected.out deleted file mode 100644 index 0972e3501c..0000000000 --- a/old_tests/tests/lean/inject.lean.expected.out +++ /dev/null @@ -1,25 +0,0 @@ -lift.equations._eqn_1 : ∀ {m k : ℕ} (f : fi m → fi k) (v : fi (m + 0)), @lift m k f 0 v = f v -lift.equations._eqn_2 : ∀ {m k : ℕ} (f : fi m → fi k) (n : ℕ), @lift m k f (succ n) (@f0 (m + n)) = @f0 (k + n) -lift.equations._eqn_3 : - ∀ {m k : ℕ} (f : fi m → fi k) (n : ℕ) (i : fi (m + n)), - @lift m k f (succ n) (@fs (m + n) i) = @fs (k + n) (@lift m k f n i) -to_nat.equations._eqn_1 : ∀ (n : ℕ), @to_nat (succ n) (@f0 n) = 0 -to_nat.equations._eqn_2 : ∀ (n : ℕ) (i : fi n), @to_nat (succ n) (@fs n i) = succ (@to_nat n i) -inject.equations._eqn_1 : ∀ (n : ℕ) (i : fi n), @inject (succ n) (@fs n i) (@f0 (@to_nat n i)) = @f0 n -inject.equations._eqn_2 : - ∀ (n : ℕ) (i : fi n) (j : fi (@to_nat n i)), - @inject (succ n) (@fs n i) (@fs (@to_nat n i) j) = @fs n (@inject n i j) -inject'.equations._eqn_1 : ∀ (n : ℕ) (i : fi n), @inject' (succ n) (@fs n i) (@f0 (@to_nat n i)) = @f0 n -inject'.equations._eqn_2 : - ∀ (n : ℕ) (i : fi n) (j : fi (@to_nat n i)), - @inject' (succ n) (@fs n i) (@fs (@to_nat n i) j) = @fs n (@inject' n i j) -raise.equations._eqn_1 : ∀ {m : ℕ} (i : fi m), @raise m 0 i = i -raise.equations._eqn_2 : ∀ {m : ℕ} (n : ℕ) (i : fi m), @raise m (succ n) i = @fs (m + n) (@raise m n i) -deg.equations._eqn_1 : ∀ (n : ℕ) (j : fi (succ n)), @deg (succ n) (@f0 (succ n)) j = @fs (succ n) j -deg.equations._eqn_2 : ∀ (n : ℕ) (i : fi (succ n)), @deg (succ n) (@fs (succ n) i) (@f0 n) = @f0 (succ n) -deg.equations._eqn_3 : - ∀ (n : ℕ) (i : fi (succ n)) (j : fi n), @deg (succ n) (@fs (succ n) i) (@fs n j) = @fs (succ n) (@deg n i j) -deg'.equations._eqn_1 : ∀ (n : ℕ) (j : fi (succ n)), @deg' (succ n) (@f0 (succ n)) j = @fs (succ n) j -deg'.equations._eqn_2 : ∀ (n : ℕ) (i : fi (succ n)), @deg' (succ n) (@fs (succ n) i) (@f0 n) = @f0 (succ n) -deg'.equations._eqn_3 : - ∀ (n : ℕ) (i : fi (succ n)) (j : fi n), @deg' (succ n) (@fs (succ n) i) (@fs n j) = @fs (succ n) (@deg' n i j) diff --git a/old_tests/tests/lean/inline_bug.lean b/old_tests/tests/lean/inline_bug.lean deleted file mode 100644 index 1670150746..0000000000 --- a/old_tests/tests/lean/inline_bug.lean +++ /dev/null @@ -1,3 +0,0 @@ -@[inline] def o (n : ℕ) := prod.mk n n -set_option trace.compiler.inline true -def f := (o 1).fst diff --git a/old_tests/tests/lean/inline_bug.lean.expected.out b/old_tests/tests/lean/inline_bug.lean.expected.out deleted file mode 100644 index fc934e1885..0000000000 --- a/old_tests/tests/lean/inline_bug.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -[compiler.inline] -1 diff --git a/old_tests/tests/lean/inline_issue.lean b/old_tests/tests/lean/inline_issue.lean deleted file mode 100644 index c7df4bff47..0000000000 --- a/old_tests/tests/lean/inline_issue.lean +++ /dev/null @@ -1,22 +0,0 @@ -open tactic - -meta def f (n : nat) : tactic unit := -trace "hello" >> -trace "------------" >> -trace_call_stack - -meta def g (n : nat) : tactic unit := -trace "world" >> f n - -run_cmd (do - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - x ← return 5, - g 1) diff --git a/old_tests/tests/lean/inline_issue.lean.expected.out b/old_tests/tests/lean/inline_issue.lean.expected.out deleted file mode 100644 index 9ac1101429..0000000000 --- a/old_tests/tests/lean/inline_issue.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -world -hello ------------- -_interaction -g -f diff --git a/old_tests/tests/lean/inst.lean b/old_tests/tests/lean/inst.lean deleted file mode 100644 index a249771a54..0000000000 --- a/old_tests/tests/lean/inst.lean +++ /dev/null @@ -1,26 +0,0 @@ -set_option pp.notation false - -class inductive C (A : Type*) -| mk : A → C - -definition val {A : Type*} (c : C A) : A := -C.rec (λa, a) c - -constant magic (A : Type*) : A -attribute [instance, priority std.priority.max] -noncomputable definition C_magic (A : Type*) : C A := -C.mk (magic A) - -attribute [instance] -definition C_prop : C Prop := -C.mk true - -attribute [instance] -definition C_prod {A B : Type*} (Ha : C A) (Hb : C B) : C (prod A B) := -C.mk (prod.mk (val Ha) (val Hb)) - --- C_magic will be used because it has max priority -noncomputable definition test : C (prod Prop Prop) := -by tactic.apply_instance - -#reduce test diff --git a/old_tests/tests/lean/inst.lean.expected.out b/old_tests/tests/lean/inst.lean.expected.out deleted file mode 100644 index 4c24c7b80a..0000000000 --- a/old_tests/tests/lean/inst.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -C.mk (magic (prod Prop Prop)) diff --git a/old_tests/tests/lean/inst_error.lean b/old_tests/tests/lean/inst_error.lean deleted file mode 100644 index 5cdbb7209f..0000000000 --- a/old_tests/tests/lean/inst_error.lean +++ /dev/null @@ -1 +0,0 @@ -#check λ (A : Type) (a : A) (b c : _), if a = b ∧ a = c then tt else ff diff --git a/old_tests/tests/lean/inst_error.lean.expected.out b/old_tests/tests/lean/inst_error.lean.expected.out deleted file mode 100644 index 580577defb..0000000000 --- a/old_tests/tests/lean/inst_error.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -inst_error.lean:1:39: error: failed to synthesize type class instance for -A : Type, -a b c : A -⊢ decidable (a = b ∧ a = c) -λ (A : Type) (a b c : A), ite (a = b ∧ a = c) tt ff : Π (A : Type), A → A → A → bool diff --git a/old_tests/tests/lean/instance_cache1.lean b/old_tests/tests/lean/instance_cache1.lean deleted file mode 100644 index 7b8a046aad..0000000000 --- a/old_tests/tests/lean/instance_cache1.lean +++ /dev/null @@ -1,15 +0,0 @@ -definition f1 (A : Type*) (a : A) := -have has_add A, from has_add.mk (λ (a b : A), a), -a + a - -definition f2 (A : Type*) (a : A) : has_add A → A := -λ s, a + a - -definition f3 (A : Type*) (a : A) := -λ s : has_add A, a + a - -definition f4 (A : Type*) [has_add A] (a : A) := -a + a - -definition g (A : Type*) (s : has_add A) (a : A) := -a + a diff --git a/old_tests/tests/lean/instance_cache1.lean.expected.out b/old_tests/tests/lean/instance_cache1.lean.expected.out deleted file mode 100644 index 461a6c7a1e..0000000000 --- a/old_tests/tests/lean/instance_cache1.lean.expected.out +++ /dev/null @@ -1,15 +0,0 @@ -instance_cache1.lean:3:2: error: failed to synthesize type class instance for -A : Type ?, -a : A, -this : has_add A -⊢ has_add A -instance_cache1.lean:6:7: error: failed to synthesize type class instance for -A : Type ?, -a : A, -s : has_add A -⊢ has_add A -instance_cache1.lean:9:19: error: failed to synthesize type class instance for -A : Type ?, -a : A, -s : has_add A -⊢ has_add A diff --git a/old_tests/tests/lean/instance_cache_bug1.lean b/old_tests/tests/lean/instance_cache_bug1.lean deleted file mode 100644 index bb7990da16..0000000000 --- a/old_tests/tests/lean/instance_cache_bug1.lean +++ /dev/null @@ -1,9 +0,0 @@ -constant A : Type -constant a : A -constant A_has_add : has_add A - -#check a + a -- ERROR - -attribute [instance] A_has_add - -#check a + a diff --git a/old_tests/tests/lean/instance_cache_bug1.lean.expected.out b/old_tests/tests/lean/instance_cache_bug1.lean.expected.out deleted file mode 100644 index 4ee1207edc..0000000000 --- a/old_tests/tests/lean/instance_cache_bug1.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -instance_cache_bug1.lean:5:9: error: failed to synthesize type class instance for -⊢ has_add A -a + a : A -a + a : A diff --git a/old_tests/tests/lean/int_eval.lean b/old_tests/tests/lean/int_eval.lean deleted file mode 100644 index 971ac6cbab..0000000000 --- a/old_tests/tests/lean/int_eval.lean +++ /dev/null @@ -1,24 +0,0 @@ -#eval (1073741823:int) -#eval (1073741824:int) -#eval ((1073741824:int) + (1:int) - (3:int)) -#eval - (2:int) -#eval - (1000:int) -#eval 10 - (1000:int) -#eval (1073741824:int) * 10 -#eval (100000:int) * (-3:int) -#eval -(1073741823:int) -#eval ((1073741824:int) + (1:int) - (1:int)) -#eval int.of_nat 1000 -#eval int.of_nat 1073741823 - -def Abs : int → nat -| (int.of_nat n) := n -| (int.neg_succ_of_nat n) := n + 1 - -#eval 10000 -#eval Abs (- 10000) -#eval Abs (-1073741823) -#eval Abs (-1073741824) -#eval Abs (-1073741825) - -#eval -(1073741823:int) * 1000000000 diff --git a/old_tests/tests/lean/int_eval.lean.expected.out b/old_tests/tests/lean/int_eval.lean.expected.out deleted file mode 100644 index 762755df5a..0000000000 --- a/old_tests/tests/lean/int_eval.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -1073741823 -1073741824 -1073741822 --2 --1000 --990 -10737418240 --300000 --1073741823 -1073741824 -1000 -1073741823 -10000 -10000 -1073741823 -1073741824 -1073741825 --1073741823000000000 diff --git a/old_tests/tests/lean/interactive/1313.lean b/old_tests/tests/lean/interactive/1313.lean deleted file mode 100644 index 6f729d946a..0000000000 --- a/old_tests/tests/lean/interactive/1313.lean +++ /dev/null @@ -1,34 +0,0 @@ -example (p q : Prop) (a : p) (b : q) : p ∧ q ∧ p := -begin - ---^ "command": "info" -end - - -example (p q : Prop) (a : p) (b : q) : p ∧ q ∧ p := -begin -apply and.intro, - --^ "command": "info" -end - -example (p q : Prop) (a : p) (b : q) : p ∧ q ∧ p := -begin -apply and.intro, - --^ "command": "info" -end - -example (p q : Prop) (a : p) (b : q) : p ∧ q ∧ p := -begin -apply and.intro, - ---^ "command": "info" -end - - -example (p q : Prop) (a : p) (b : q) : p ∧ q ∧ p := -begin -apply and.intro, - ---^ "command": "info" -{exact a}, -end diff --git a/old_tests/tests/lean/interactive/1313.lean.expected.out b/old_tests/tests/lean/interactive/1313.lean.expected.out deleted file mode 100644 index 09d9ddddca..0000000000 --- a/old_tests/tests/lean/interactive/1313.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -{"msgs":[{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":5,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\np q : Prop,\na : p,\nb : q\n⊢ p ∧ q ∧ p"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":5,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\np q : Prop,\na : p,\nb : q\n⊢ p ∧ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":12,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":5,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\np q : Prop,\na : p,\nb : q\n⊢ p ∧ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":12,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":18,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":5,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\np q : Prop,\na : p,\nb : q\n⊢ p ∧ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":12,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":18,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":25,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":5,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\np q : Prop,\na : p,\nb : q\n⊢ p ∧ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":12,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":18,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":25,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},{"caption":"","file_name":"1313.lean","pos_col":0,"pos_line":34,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"state":"p q : Prop,\na : p,\nb : q\n⊢ p ∧ q ∧ p"},"response":"ok","seq_num":4} -{"record":{"state":"2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},"response":"ok","seq_num":11} -{"record":{"state":"2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},"response":"ok","seq_num":17} -{"record":{"state":"2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},"response":"ok","seq_num":24} -{"record":{"state":"2 goals\np q : Prop,\na : p,\nb : q\n⊢ p\n\np q : Prop,\na : p,\nb : q\n⊢ q ∧ p"},"response":"ok","seq_num":32} diff --git a/old_tests/tests/lean/interactive/complete.lean b/old_tests/tests/lean/interactive/complete.lean deleted file mode 100644 index a45eedff19..0000000000 --- a/old_tests/tests/lean/interactive/complete.lean +++ /dev/null @@ -1,24 +0,0 @@ -prelude - -inductive foo - -example := foo - --^ "command": "complete" - --- should not complete empty declaration completion -example := foo - --^ "command": "complete" - -@[reducible] ---^ "command": "complete", "skip_completions": true -example := foo - -set_option trace.simplify true - --^ "command": "complete", "skip_completions": true - -#print foo - --^ "command": "complete", "skip_completions": true - -section foo -end foo - --^ "command": "complete", "skip_completions": true diff --git a/old_tests/tests/lean/interactive/complete.lean.expected.out b/old_tests/tests/lean/interactive/complete.lean.expected.out deleted file mode 100644 index 3aaa8c117f..0000000000 --- a/old_tests/tests/lean/interactive/complete.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -{"msgs":[{"caption":"print result","end_pos_col":0,"end_pos_line":22,"file_name":"complete.lean","pos_col":0,"pos_line":19,"severity":"information","text":"inductive foo : Type\nconstructors:"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"completions":[{"source":,"text":"foo","type":"Type"},{"source":{"column":10,"line":3},"text":"foo.rec","type":"Π (C : foo → Sort l) (n : foo), C n"},{"source":{"column":10,"line":3},"text":"foo.rec_on","type":"Π (C : foo → Sort l) (n : foo), C n"}],"prefix":"fo","response":"ok","seq_num":6} -{"response":"ok","seq_num":10} -{"prefix":"","response":"ok","seq_num":13} -{"prefix":"","response":"ok","seq_num":17} -{"prefix":"f","response":"ok","seq_num":20} -{"prefix":"","response":"ok","seq_num":24} diff --git a/old_tests/tests/lean/interactive/complete_import.lean b/old_tests/tests/lean/interactive/complete_import.lean deleted file mode 100644 index 186a8e0123..0000000000 --- a/old_tests/tests/lean/interactive/complete_import.lean +++ /dev/null @@ -1,18 +0,0 @@ -import -- should not trigger - --^ "command": "complete", "skip_completions": true -import - --^ "command": "complete", "skip_completions": true -import . - --^ "command": "complete", "skip_completions": true -import .. - --^ "command": "complete", "skip_completions": true -import foo - --^ "command": "complete", "skip_completions": true -import foo. - --^ "command": "complete", "skip_completions": true -import .foo - --^ "command": "complete", "skip_completions": true -import foo - --^ "command": "complete", "skip_completions": true -import foo bar - --^ "command": "complete", "skip_completions": true diff --git a/old_tests/tests/lean/interactive/complete_import.lean.expected.out b/old_tests/tests/lean/interactive/complete_import.lean.expected.out deleted file mode 100644 index 1e2376b0ed..0000000000 --- a/old_tests/tests/lean/interactive/complete_import.lean.expected.out +++ /dev/null @@ -1,22 +0,0 @@ -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'foo' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":1,"severity":"error","text":"file 'bar' not found in the LEAN_PATH"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: foo\ncould not resolve import: foo"},{"caption":"","file_name":"complete_import.lean","pos_col":0,"pos_line":17,"severity":"error","text":"invalid import: bar\ncould not resolve import: bar"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"response":"ok","seq_num":2} -{"prefix":"","response":"ok","seq_num":4} -{"prefix":".","response":"ok","seq_num":6} -{"prefix":"..","response":"ok","seq_num":8} -{"prefix":"foo","response":"ok","seq_num":10} -{"prefix":"foo.","response":"ok","seq_num":12} -{"prefix":".foo","response":"ok","seq_num":14} -{"prefix":"","response":"ok","seq_num":16} -{"prefix":"bar","response":"ok","seq_num":18} diff --git a/old_tests/tests/lean/interactive/complete_namespace.lean b/old_tests/tests/lean/interactive/complete_namespace.lean deleted file mode 100644 index a6f296ed5d..0000000000 --- a/old_tests/tests/lean/interactive/complete_namespace.lean +++ /dev/null @@ -1,11 +0,0 @@ -prelude - -inductive foo.bar - -open foo - --^ "command": "complete" - -namespace foo - open bar - --^ "command": "complete" -end foo diff --git a/old_tests/tests/lean/interactive/complete_namespace.lean.expected.out b/old_tests/tests/lean/interactive/complete_namespace.lean.expected.out deleted file mode 100644 index 3fc2bfc040..0000000000 --- a/old_tests/tests/lean/interactive/complete_namespace.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"completions":[{"text":"foo"},{"text":"foo.bar"}],"prefix":"","response":"ok","seq_num":6} -{"completions":[{"text":"bar"},{"text":"foo"},{"text":"foo.bar"}],"prefix":"","response":"ok","seq_num":10} diff --git a/old_tests/tests/lean/interactive/complete_scanner_error.lean b/old_tests/tests/lean/interactive/complete_scanner_error.lean deleted file mode 100644 index 62938aadbf..0000000000 --- a/old_tests/tests/lean/interactive/complete_scanner_error.lean +++ /dev/null @@ -1,4 +0,0 @@ -import - --^ "command": "complete", "skip_completions": true - -def f := ₜ diff --git a/old_tests/tests/lean/interactive/complete_scanner_error.lean.expected.out b/old_tests/tests/lean/interactive/complete_scanner_error.lean.expected.out deleted file mode 100644 index 46b8db5576..0000000000 --- a/old_tests/tests/lean/interactive/complete_scanner_error.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"","file_name":"complete_scanner_error.lean","pos_col":9,"pos_line":4,"severity":"error","text":"unexpected token"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"prefix":"","response":"ok","seq_num":2} diff --git a/old_tests/tests/lean/interactive/complete_tactic.lean b/old_tests/tests/lean/interactive/complete_tactic.lean deleted file mode 100644 index c71884676b..0000000000 --- a/old_tests/tests/lean/interactive/complete_tactic.lean +++ /dev/null @@ -1,5 +0,0 @@ -example := by assumption - --^ "command": "complete", "skip_completions": true - -example := begin - --^ "command": "complete", "skip_completions": true diff --git a/old_tests/tests/lean/interactive/complete_tactic.lean.expected.out b/old_tests/tests/lean/interactive/complete_tactic.lean.expected.out deleted file mode 100644 index 54ee5529d2..0000000000 --- a/old_tests/tests/lean/interactive/complete_tactic.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -{"msgs":[{"caption":"","file_name":"complete_tactic.lean","pos_col":14,"pos_line":1,"severity":"error","text":"assumption tactic failed\nstate:\n⊢ ?m_1"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_tactic.lean","pos_col":14,"pos_line":1,"severity":"error","text":"assumption tactic failed\nstate:\n⊢ ?m_1"},{"caption":"","file_name":"complete_tactic.lean","pos_col":8,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_tactic.lean","pos_col":14,"pos_line":1,"severity":"error","text":"assumption tactic failed\nstate:\n⊢ ?m_1"},{"caption":"","file_name":"complete_tactic.lean","pos_col":8,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"},{"caption":"","file_name":"complete_tactic.lean","pos_col":66,"pos_line":5,"severity":"error","text":"invalid expression, unexpected token"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_tactic.lean","pos_col":14,"pos_line":1,"severity":"error","text":"assumption tactic failed\nstate:\n⊢ ?m_1"},{"caption":"","file_name":"complete_tactic.lean","pos_col":8,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"},{"caption":"","file_name":"complete_tactic.lean","pos_col":66,"pos_line":5,"severity":"error","text":"invalid expression, unexpected token"},{"caption":"","file_name":"complete_tactic.lean","pos_col":66,"pos_line":5,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Type ?"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"complete_tactic.lean","pos_col":14,"pos_line":1,"severity":"error","text":"assumption tactic failed\nstate:\n⊢ ?m_1"},{"caption":"","file_name":"complete_tactic.lean","pos_col":8,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"},{"caption":"","file_name":"complete_tactic.lean","pos_col":66,"pos_line":5,"severity":"error","text":"invalid expression, unexpected token"},{"caption":"","file_name":"complete_tactic.lean","pos_col":66,"pos_line":5,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Type ?"},{"caption":"","file_name":"complete_tactic.lean","pos_col":8,"pos_line":4,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"prefix":"","response":"ok","seq_num":2} -{"prefix":"","response":"ok","seq_num":5} diff --git a/old_tests/tests/lean/interactive/complete_trailing_period.lean b/old_tests/tests/lean/interactive/complete_trailing_period.lean deleted file mode 100644 index 3e07de5ebe..0000000000 --- a/old_tests/tests/lean/interactive/complete_trailing_period.lean +++ /dev/null @@ -1,6 +0,0 @@ -prelude - -inductive foo - -def f := foo. - --^ "command": "complete" diff --git a/old_tests/tests/lean/interactive/complete_trailing_period.lean.expected.out b/old_tests/tests/lean/interactive/complete_trailing_period.lean.expected.out deleted file mode 100644 index 7483384401..0000000000 --- a/old_tests/tests/lean/interactive/complete_trailing_period.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"completions":[{"source":,"text":"foo.rec","type":"Π (C : foo → Sort l) (n : foo), C n"},{"source":{"column":10,"line":3},"text":"foo.rec_on","type":"Π (C : foo → Sort l) (n : foo), C n"},{"source":{"column":10,"line":3},"text":"foo","type":"Type"}],"prefix":"foo.","response":"ok","seq_num":6} diff --git a/old_tests/tests/lean/interactive/correct_snapshot_invalidation.input b/old_tests/tests/lean/interactive/correct_snapshot_invalidation.input deleted file mode 100644 index 19628acae7..0000000000 --- a/old_tests/tests/lean/interactive/correct_snapshot_invalidation.input +++ /dev/null @@ -1,10 +0,0 @@ -{"seq_num": 0, "command": "sync", "file_name": "f", "content": "inductive foo : Type"} -{"seq_num": 1, "command": "sync", "file_name": "f", "content": "inductive foo : Type\n| bar : foo"} -{"seq_num": 2, "command": "sync", "file_name": "f", "content": "inductive foo : Type\n| bar : foo\nd"} -{"seq_num": 3, "command": "sync", "file_name": "f", "content": "inductive foo : Type\n| bar : foo\ndef"} -{"seq_num": 4, "command": "sync", "file_name": "f", "content": "inductive foo : nat → nat → Prop"} -{"seq_num": 5, "command": "sync", "file_name": "f", "content": "inductive foo : nat → nat → Prop\n"} -{"seq_num": 6, "command": "sync", "file_name": "f", "content": "inductive foo : nat → nat → Prop\n\n"} -{"seq_num": 7, "command": "sync", "file_name": "f", "content": "inductive foo : nat → nat → Prop\n\n\n"} -{"seq_num": 8, "command": "sync", "file_name": "f", "content": ""} -{"seq_num": 9, "command": "sync", "file_name": "f", "content": "import system.io\n"} diff --git a/old_tests/tests/lean/interactive/correct_snapshot_invalidation.input.expected.out b/old_tests/tests/lean/interactive/correct_snapshot_invalidation.input.expected.out deleted file mode 100644 index b510676290..0000000000 --- a/old_tests/tests/lean/interactive/correct_snapshot_invalidation.input.expected.out +++ /dev/null @@ -1,21 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"message":"file invalidated","response":"ok","seq_num":1} -{"msgs":[{"caption":"","file_name":"f","pos_col":0,"pos_line":3,"severity":"error","text":"unknown identifier 'd'"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"f","pos_col":0,"pos_line":3,"severity":"error","text":"unknown identifier 'd'"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"function expected at\n foo\nterm has type\n Type"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"f","pos_col":0,"pos_line":3,"severity":"error","text":"unknown identifier 'd'"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"function expected at\n foo\nterm has type\n Type"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"f","pos_col":0,"pos_line":3,"severity":"error","text":"unknown identifier 'd'"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"function expected at\n foo\nterm has type\n Type"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"},{"caption":"","file_name":"f","pos_col":0,"pos_line":1,"severity":"error","text":"invalid return type for 'foo.bar'"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":2} -{"msgs":[{"caption":"","file_name":"f","pos_col":0,"pos_line":3,"severity":"error","text":"unknown identifier 'd'"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"function expected at\n foo\nterm has type\n Type"},{"caption":"","file_name":"f","pos_col":8,"pos_line":2,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"},{"caption":"","file_name":"f","pos_col":0,"pos_line":1,"severity":"error","text":"invalid return type for 'foo.bar'"}],"response":"all_messages"} -{"msgs":[],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"f","pos_col":3,"pos_line":3,"severity":"error","text":"invalid declaration, identifier expected"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"f","pos_col":3,"pos_line":3,"severity":"error","text":"invalid declaration, identifier expected"},{"caption":"","file_name":"f","pos_col":3,"pos_line":3,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":3} -{"msgs":[{"caption":"","file_name":"f","pos_col":3,"pos_line":3,"severity":"error","text":"invalid declaration, identifier expected"},{"caption":"","file_name":"f","pos_col":3,"pos_line":3,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"f","pos_col":3,"pos_line":3,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Sort ?"}],"response":"all_messages"} -{"msgs":[],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":4} -{"message":"file invalidated","response":"ok","seq_num":5} -{"message":"file invalidated","response":"ok","seq_num":6} -{"message":"file invalidated","response":"ok","seq_num":7} -{"message":"file invalidated","response":"ok","seq_num":8} -{"message":"file invalidated","response":"ok","seq_num":9} diff --git a/old_tests/tests/lean/interactive/do_info.lean b/old_tests/tests/lean/interactive/do_info.lean deleted file mode 100644 index 668710cd7a..0000000000 --- a/old_tests/tests/lean/interactive/do_info.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -example (a b c : nat) : a = b → c = b → a = c := -by do - h ← intro `h, - --^ "command": "info" - intros, - transitivity, ---^ "command": "info" - trace_state, - assumption, ---^ "command": "info" - symmetry, ---^ "command": "info" - assumption ---^ "command": "info" diff --git a/old_tests/tests/lean/interactive/do_info.lean.expected.out b/old_tests/tests/lean/interactive/do_info.lean.expected.out deleted file mode 100644 index 4e594998e3..0000000000 --- a/old_tests/tests/lean/interactive/do_info.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -{"msgs":[{"caption":"trace output","file_name":"do_info.lean","pos_col":3,"pos_line":4,"severity":"information","text":"2 goals\na b c : ℕ,\nh : a = b,\na_1 : c = b\n⊢ a = ?m_1\n\na b c : ℕ,\nh : a = b,\na_1 : c = b\n⊢ ?m_1 = c\n"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"full-id":"tactic.intro","source":,"state":"a b c : ℕ\n⊢ a = b → c = b → a = c","type":"name → tactic expr"},"response":"ok","seq_num":6} -{"record":{"full-id":"tactic.transitivity","source":,"state":"a b c : ℕ\n⊢ a = b → c = b → a = c","type":"opt_param transparency transparency.semireducible → tactic unit"},"response":"ok","seq_num":9} -{"record":{"full-id":"tactic.assumption","source":,"state":"a b c : ℕ\n⊢ a = b → c = b → a = c","type":"tactic unit"},"response":"ok","seq_num":12} -{"record":{"full-id":"tactic.symmetry","source":,"state":"a b c : ℕ\n⊢ a = b → c = b → a = c","type":"opt_param transparency transparency.semireducible → tactic unit"},"response":"ok","seq_num":14} -{"record":{"full-id":"tactic.assumption","source":,"state":"a b c : ℕ\n⊢ a = b → c = b → a = c","type":"tactic unit"},"response":"ok","seq_num":16} diff --git a/old_tests/tests/lean/interactive/field_info.lean b/old_tests/tests/lean/interactive/field_info.lean deleted file mode 100644 index f4f9a7b1e0..0000000000 --- a/old_tests/tests/lean/interactive/field_info.lean +++ /dev/null @@ -1,13 +0,0 @@ -def f (n : ℕ) := n.to_string - --^ "command": "info" -def g (l : list ℕ) := l.all - --^ "command": "info" - --- elaborated, not locally inferable -def h : list ℕ → (ℕ → bool) → bool := -λ l, (l ++ l).all - --^ "command": "info" - --- not elaborated, locally inferable -def j := (list.nil^.all - --^ "command": "info" diff --git a/old_tests/tests/lean/interactive/field_info.lean.expected.out b/old_tests/tests/lean/interactive/field_info.lean.expected.out deleted file mode 100644 index c90bad9b3f..0000000000 --- a/old_tests/tests/lean/interactive/field_info.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -{"msgs":[{"caption":"","file_name":"field_info.lean","pos_col":18,"pos_line":1,"severity":"error","text":"invalid field notation, 'to_string' is not a valid \"field\" because environment does not contain 'nat.to_string'\n n\nwhich has type\n ℕ"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"field_info.lean","pos_col":18,"pos_line":1,"severity":"error","text":"invalid field notation, 'to_string' is not a valid \"field\" because environment does not contain 'nat.to_string'\n n\nwhich has type\n ℕ"},{"caption":"","file_name":"field_info.lean","pos_col":4,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\nn : ℕ\n⊢ Sort ?"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"field_info.lean","pos_col":18,"pos_line":1,"severity":"error","text":"invalid field notation, 'to_string' is not a valid \"field\" because environment does not contain 'nat.to_string'\n n\nwhich has type\n ℕ"},{"caption":"","file_name":"field_info.lean","pos_col":4,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\nn : ℕ\n⊢ Sort ?"},{"caption":"","file_name":"field_info.lean","pos_col":40,"pos_line":13,"severity":"error","text":"invalid expression, `)` expected"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"field_info.lean","pos_col":18,"pos_line":1,"severity":"error","text":"invalid field notation, 'to_string' is not a valid \"field\" because environment does not contain 'nat.to_string'\n n\nwhich has type\n ℕ"},{"caption":"","file_name":"field_info.lean","pos_col":4,"pos_line":1,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\nn : ℕ\n⊢ Sort ?"},{"caption":"","file_name":"field_info.lean","pos_col":40,"pos_line":13,"severity":"error","text":"invalid expression, `)` expected"},{"caption":"","file_name":"field_info.lean","pos_col":0,"pos_line":12,"severity":"error","text":"don't know how to synthesize placeholder\ncontext:\n⊢ Type ?"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"full-id":"n","type":"ℕ"},"response":"ok","seq_num":2} -{"record":{"full-id":"list.all","source":,"type":"Π {α : Type}, list α → (α → bool) → bool"},"response":"ok","seq_num":4} -{"record":{"full-id":"list.all","source":,"type":"Π {α : Type}, list α → (α → bool) → bool"},"response":"ok","seq_num":9} -{"record":{"full-id":"list.all","source":,"type":"Π {α : Type u_1}, list α → (α → bool) → bool"},"response":"ok","seq_num":13} diff --git a/old_tests/tests/lean/interactive/focus.lean b/old_tests/tests/lean/interactive/focus.lean deleted file mode 100644 index d3af85432d..0000000000 --- a/old_tests/tests/lean/interactive/focus.lean +++ /dev/null @@ -1,11 +0,0 @@ -example (a b c : nat) : a = b → b = 0 → a = 0 ∧ b = a := -begin - intros, constructor, - focus { subst a - --^ "command":"info" - }, - --^ "command":"info" - assumption, - --^ "command":"info" - subst a -end diff --git a/old_tests/tests/lean/interactive/focus.lean.expected.out b/old_tests/tests/lean/interactive/focus.lean.expected.out deleted file mode 100644 index 084172b44d..0000000000 --- a/old_tests/tests/lean/interactive/focus.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"doc":"`focus { t }` temporarily hides all goals other than the first, applies `t`, and then restores the other goals. It fails if there are no goals.","source":,"state":"a b c : ℕ,\na_1 : a = b,\na_2 : b = 0\n⊢ a = 0","tactic_param_idx":0,"tactic_params":["{ tactic }"],"text":"focus","type":"tactic.interactive.itactic → tactic unit"},"response":"ok","seq_num":5} -{"record":{"doc":"`focus { t }` temporarily hides all goals other than the first, applies `t`, and then restores the other goals. It fails if there are no goals.","source":,"state":"b c : ℕ,\na_2 : b = 0\n⊢ b = 0","tactic_param_idx":0,"tactic_params":["{ tactic }"],"text":"focus","type":"tactic.interactive.itactic → tactic unit"},"response":"ok","seq_num":7} -{"record":{"state":"2 goals\nb c : ℕ,\na_2 : b = 0\n⊢ b = 0\n\na b c : ℕ,\na_1 : a = b,\na_2 : b = 0\n⊢ b = a"},"response":"ok","seq_num":9} diff --git a/old_tests/tests/lean/interactive/goal_info.lean b/old_tests/tests/lean/interactive/goal_info.lean deleted file mode 100644 index d0dc0a32b9..0000000000 --- a/old_tests/tests/lean/interactive/goal_info.lean +++ /dev/null @@ -1,40 +0,0 @@ -constant addc {a b : nat} : a + b = b + a -constant addassoc {a b c : nat} : (a + b) + c = a + (b + c) -constant zadd (a : nat) : 0 + a = a - -open nat - -example : ∀ n m : ℕ, n + m = m + n := -begin - intros n m, - induction m with m' ih, - --^ "command": "info" - { change n + 0 = 0 + n, simp [zadd] }, ---^ "command": "info" - { change succ (n + m') = succ m' + n, - rw [succ_add, ih] ---^ "command":"info" - } -end - -example : ∀ n m : ℕ, n + m = m + n := -begin - intros n m, - induction m with m' ih, - { change n + 0 = 0 + n, simp [zadd] }, - --^ "command": "info" - { change succ (n + m') = succ m' + n, - rw [succ_add, ih] - } -end - -example : ∀ n m : ℕ, n + m = m + n := -begin - intros n m, - induction m with m' ih, - { change n + 0 = 0 + n, simp [zadd] }, - --^ "command": "info" - { change succ (n + m') = succ m' + n, - rw [succ_add, ih] - } -end diff --git a/old_tests/tests/lean/interactive/goal_info.lean.expected.out b/old_tests/tests/lean/interactive/goal_info.lean.expected.out deleted file mode 100644 index 3bb406d891..0000000000 --- a/old_tests/tests/lean/interactive/goal_info.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"state":"2 goals\ncase nat.zero\nn : ℕ\n⊢ n + 0 = 0 + n\n\ncase nat.succ\nn m' : ℕ,\nih : n + m' = m' + n\n⊢ n + succ m' = succ m' + n"},"response":"ok","seq_num":11} -{"record":{"state":"2 goals\ncase nat.zero\nn : ℕ\n⊢ n + 0 = 0 + n\n\ncase nat.succ\nn m' : ℕ,\nih : n + m' = m' + n\n⊢ n + succ m' = succ m' + n"},"response":"ok","seq_num":13} -{"record":{"state":"n m' : ℕ,\nih : n + m' = m' + n\n⊢ succ (n + m') = succ m' + n"},"response":"ok","seq_num":16} -{"record":{"state":"case nat.zero\nn : ℕ\n⊢ n + 0 = 0 + n"},"response":"ok","seq_num":25} -{"record":{"state":"no goals"},"response":"ok","seq_num":36} diff --git a/old_tests/tests/lean/interactive/goal_info_rw.lean b/old_tests/tests/lean/interactive/goal_info_rw.lean deleted file mode 100644 index f6b0afc9ef..0000000000 --- a/old_tests/tests/lean/interactive/goal_info_rw.lean +++ /dev/null @@ -1,10 +0,0 @@ -example (p q r : Prop) (h₁ : p = q) (h₂ : q = r) : p = r := -by rw [h₁, - --^ "command": "info" - ←h₂, - --^ "command": "info" - ←h₁ - --^ "command": "info" - --^ "command": "info" - ] - --^ "command": "info" diff --git a/old_tests/tests/lean/interactive/goal_info_rw.lean.expected.out b/old_tests/tests/lean/interactive/goal_info_rw.lean.expected.out deleted file mode 100644 index 1eff8b4cae..0000000000 --- a/old_tests/tests/lean/interactive/goal_info_rw.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"doc":"An abbreviation for `rewrite`.","source":,"state":"p q r : Prop,\nh₁ : p = q,\nh₂ : q = r\n⊢ q = r","tactic_param_idx":0,"tactic_params":["([ (←? expr), ... ] | ←? expr)","(at (* | (⊢ | id)*))?","tactic.rewrite_cfg?"],"text":"rw","type":"interactive.parse tactic.interactive.rw_rules → interactive.parse interactive.types.location → opt_param tactic.rewrite_cfg {to_apply_cfg := {md := reducible, approx := tt, new_goals := tactic.new_goals.non_dep_first, instances := tt, auto_param := tt, opt_param := tt, unify := tt}, symm := ff, occs := occurrences.all} → tactic unit"},"response":"ok","seq_num":3} -{"record":{"doc":"An abbreviation for `rewrite`.","source":,"state":"p q r : Prop,\nh₁ : p = q,\nh₂ : q = r\n⊢ q = r","tactic_param_idx":0,"tactic_params":["([ (←? expr), ... ] | ←? expr)","(at (* | (⊢ | id)*))?","tactic.rewrite_cfg?"],"text":"rw","type":"interactive.parse tactic.interactive.rw_rules → interactive.parse interactive.types.location → opt_param tactic.rewrite_cfg {to_apply_cfg := {md := reducible, approx := tt, new_goals := tactic.new_goals.non_dep_first, instances := tt, auto_param := tt, opt_param := tt, unify := tt}, symm := ff, occs := occurrences.all} → tactic unit"},"response":"ok","seq_num":5} -{"record":{"full-id":"h₁","state":"p q r : Prop,\nh₁ : p = q,\nh₂ : q = r\n⊢ q = q","type":"p = q"},"response":"ok","seq_num":7} -{"record":{"doc":"An abbreviation for `rewrite`.","source":,"state":"no goals","tactic_param_idx":0,"tactic_params":["([ (←? expr), ... ] | ←? expr)","(at (* | (⊢ | id)*))?","tactic.rewrite_cfg?"],"text":"rw","type":"interactive.parse tactic.interactive.rw_rules → interactive.parse interactive.types.location → opt_param tactic.rewrite_cfg {to_apply_cfg := {md := reducible, approx := tt, new_goals := tactic.new_goals.non_dep_first, instances := tt, auto_param := tt, opt_param := tt, unify := tt}, symm := ff, occs := occurrences.all} → tactic unit"},"response":"ok","seq_num":8} -{"record":{"doc":"An abbreviation for `rewrite`.","source":,"state":"no goals","tactic_param_idx":0,"tactic_params":["([ (←? expr), ... ] | ←? expr)","(at (* | (⊢ | id)*))?","tactic.rewrite_cfg?"],"text":"rw","type":"interactive.parse tactic.interactive.rw_rules → interactive.parse interactive.types.location → opt_param tactic.rewrite_cfg {to_apply_cfg := {md := reducible, approx := tt, new_goals := tactic.new_goals.non_dep_first, instances := tt, auto_param := tt, opt_param := tt, unify := tt}, symm := ff, occs := occurrences.all} → tactic unit"},"response":"ok","seq_num":10} diff --git a/old_tests/tests/lean/interactive/hole1.lean b/old_tests/tests/lean/interactive/hole1.lean deleted file mode 100644 index 81a18fb02a..0000000000 --- a/old_tests/tests/lean/interactive/hole1.lean +++ /dev/null @@ -1,3 +0,0 @@ -def x : nat → nat := -λ a, {! a + a !} - --^ "command": "hole", "action": "Use" diff --git a/old_tests/tests/lean/interactive/hole1.lean.expected.out b/old_tests/tests/lean/interactive/hole1.lean.expected.out deleted file mode 100644 index 7db6a44cac..0000000000 --- a/old_tests/tests/lean/interactive/hole1.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"","file_name":"hole1.lean","pos_col":0,"pos_line":1,"severity":"warning","text":"declaration 'x' uses sorry"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"replacements":{"alternatives":[{"code":"a + a","description":""}],"end":{"column":16,"line":2},"file":"hole1.lean","start":{"column":5,"line":2}},"response":"ok","seq_num":3} diff --git a/old_tests/tests/lean/interactive/hole2.lean b/old_tests/tests/lean/interactive/hole2.lean deleted file mode 100644 index 10e26363b4..0000000000 --- a/old_tests/tests/lean/interactive/hole2.lean +++ /dev/null @@ -1,3 +0,0 @@ -def x : nat → nat := -λ a, {! a + a !} - --^ "command": "hole_commands" diff --git a/old_tests/tests/lean/interactive/hole2.lean.expected.out b/old_tests/tests/lean/interactive/hole2.lean.expected.out deleted file mode 100644 index 59e6aa17de..0000000000 --- a/old_tests/tests/lean/interactive/hole2.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"","file_name":"hole2.lean","pos_col":0,"pos_line":1,"severity":"warning","text":"declaration 'x' uses sorry"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"end":{"column":16,"line":2},"file":"hole2.lean","response":"ok","results":[{"description":"Infer type of the expression in the hole","name":"Infer"},{"description":"Show the current goal","name":"Show"},{"description":"Try to fill the hole using the given argument","name":"Use"}],"seq_num":3,"start":{"column":5,"line":2}} diff --git a/old_tests/tests/lean/interactive/hole3.lean b/old_tests/tests/lean/interactive/hole3.lean deleted file mode 100644 index c7f6faca58..0000000000 --- a/old_tests/tests/lean/interactive/hole3.lean +++ /dev/null @@ -1,8 +0,0 @@ -def x : nat → nat := -λ a, {! - - 0 = a - --^ "command": "hole", "action": "Infer" - - !} - --^ "command": "hole", "action": "Infer" diff --git a/old_tests/tests/lean/interactive/hole3.lean.expected.out b/old_tests/tests/lean/interactive/hole3.lean.expected.out deleted file mode 100644 index 1aba9015f1..0000000000 --- a/old_tests/tests/lean/interactive/hole3.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -{"msgs":[{"caption":"","file_name":"hole3.lean","pos_col":0,"pos_line":1,"severity":"warning","text":"declaration 'x' uses sorry"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"message":"Prop\n","response":"ok","seq_num":5} -{"message":"Prop\n","response":"ok","seq_num":8} diff --git a/old_tests/tests/lean/interactive/hole4.lean b/old_tests/tests/lean/interactive/hole4.lean deleted file mode 100644 index 23b32790f6..0000000000 --- a/old_tests/tests/lean/interactive/hole4.lean +++ /dev/null @@ -1,3 +0,0 @@ -def x : nat → nat := -{! λ a, _ !} - --^ "command": "hole", "action": "Use" diff --git a/old_tests/tests/lean/interactive/hole4.lean.expected.out b/old_tests/tests/lean/interactive/hole4.lean.expected.out deleted file mode 100644 index cdea832cee..0000000000 --- a/old_tests/tests/lean/interactive/hole4.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"","file_name":"hole4.lean","pos_col":0,"pos_line":1,"severity":"warning","text":"declaration 'x' uses sorry"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"replacements":{"alternatives":[{"code":"λ (a : ℕ), {! !}","description":""}],"end":{"column":12,"line":2},"file":"hole4.lean","start":{"column":0,"line":2}},"response":"ok","seq_num":3} diff --git a/old_tests/tests/lean/interactive/info.lean b/old_tests/tests/lean/interactive/info.lean deleted file mode 100644 index 552c429372..0000000000 --- a/old_tests/tests/lean/interactive/info.lean +++ /dev/null @@ -1,19 +0,0 @@ -import init.meta.attribute - --^ "command": "info" - -@[reducible] - --^ "command": "info" -def f := tt - --^ "command": "info" - -set_option trace.simplify true - --^ "command": "info" - -example := [tt] - --^ "command": "info" - -example := [tt]++[] - --^ "command": "info" - -#print id - --^ "command": "info" diff --git a/old_tests/tests/lean/interactive/info.lean.expected.out b/old_tests/tests/lean/interactive/info.lean.expected.out deleted file mode 100644 index 3f9908bedc..0000000000 --- a/old_tests/tests/lean/interactive/info.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -{"msgs":[{"caption":"print result","end_pos_col":26,"end_pos_line":19,"file_name":"info.lean","pos_col":0,"pos_line":18,"severity":"information","text":"@[inline]\ndef id : Π {α : Sort u}, α → α :=\nλ {α : Sort u} (a : α), a"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"source":},"response":"ok","seq_num":2} -{"record":{"doc":"reducible"},"response":"ok","seq_num":5} -{"record":{"full-id":"bool.tt","source":,"type":"bool"},"response":"ok","seq_num":7} -{"record":{"doc":"(trace) enable/disable tracing for the given module and submodules"},"response":"ok","seq_num":10} -{"record":{"full-id":"list.cons","source":,"type":"Π {T : Type}, T → list T → list T"},"response":"ok","seq_num":13} -{"record":{"full-id":"has_append.append","source":,"type":"Π {α : Type} [c : has_append α], α → α → α"},"response":"ok","seq_num":16} -{"record":{"full-id":"id","source":,"type":"Π {α : Sort u}, α → α"},"response":"ok","seq_num":19} diff --git a/old_tests/tests/lean/interactive/info1.lean b/old_tests/tests/lean/interactive/info1.lean deleted file mode 100644 index 6d6510ad3d..0000000000 --- a/old_tests/tests/lean/interactive/info1.lean +++ /dev/null @@ -1,5 +0,0 @@ -def foo.f : nat → nat := λ x, x -def bla.f : string → string := λ x, x -open foo bla -example : nat := f 0 - --^ "command": "info" diff --git a/old_tests/tests/lean/interactive/info1.lean.expected.out b/old_tests/tests/lean/interactive/info1.lean.expected.out deleted file mode 100644 index 1735e163d9..0000000000 --- a/old_tests/tests/lean/interactive/info1.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"full-id":"foo.f","source":,"type":"ℕ → ℕ"},"response":"ok","seq_num":5} diff --git a/old_tests/tests/lean/interactive/info_goal.lean b/old_tests/tests/lean/interactive/info_goal.lean deleted file mode 100644 index 49caf9f332..0000000000 --- a/old_tests/tests/lean/interactive/info_goal.lean +++ /dev/null @@ -1,11 +0,0 @@ -example : ℕ → ℕ := -begin - exact id ---^ "command": "info" - , - --^ "command": "info" -end ---^ "command": "info" - -example : ℕ → ℕ := by exact id - --^ "command": "info" diff --git a/old_tests/tests/lean/interactive/info_goal.lean.expected.out b/old_tests/tests/lean/interactive/info_goal.lean.expected.out deleted file mode 100644 index a92d775a04..0000000000 --- a/old_tests/tests/lean/interactive/info_goal.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"doc":"This tactic provides an exact proof term to solve the main goal. If `t` is the goal and `p` is a term of type `u` then `exact p` succeeds if and only if `t` and `u` can be unified.","source":,"state":"⊢ ℕ → ℕ","tactic_params":["expr"],"text":"exact","type":"interactive.parse interactive.types.texpr → tactic unit"},"response":"ok","seq_num":4} -{"record":{"state":"no goals"},"response":"ok","seq_num":6} -{"record":{"state":"no goals"},"response":"ok","seq_num":8} -{"record":{"doc":"This tactic provides an exact proof term to solve the main goal. If `t` is the goal and `p` is a term of type `u` then `exact p` succeeds if and only if `t` and `u` can be unified.","source":,"state":"⊢ ℕ → ℕ","tactic_param_idx":0,"tactic_params":["expr"],"text":"exact","type":"interactive.parse interactive.types.texpr → tactic unit"},"response":"ok","seq_num":11} diff --git a/old_tests/tests/lean/interactive/info_id_pre_elab.lean b/old_tests/tests/lean/interactive/info_id_pre_elab.lean deleted file mode 100644 index bc061b6faa..0000000000 --- a/old_tests/tests/lean/interactive/info_id_pre_elab.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic - -#check (trace - --^ "command": "info" - -#check (abstract - --^ "command": "info" diff --git a/old_tests/tests/lean/interactive/info_id_pre_elab.lean.expected.out b/old_tests/tests/lean/interactive/info_id_pre_elab.lean.expected.out deleted file mode 100644 index a7c326b3ad..0000000000 --- a/old_tests/tests/lean/interactive/info_id_pre_elab.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -{"msgs":[{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":0,"pos_line":6,"severity":"error","text":"invalid expression, `)` expected"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":0,"pos_line":6,"severity":"error","text":"invalid expression, `)` expected"},{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":8,"pos_line":3,"severity":"error","text":"ambiguous overload, possible interpretations\n trace\n tactic.trace\nAdditional information:\ninfo_id_pre_elab.lean:3:8: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":0,"pos_line":6,"severity":"error","text":"invalid expression, `)` expected"},{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":8,"pos_line":3,"severity":"error","text":"ambiguous overload, possible interpretations\n trace\n tactic.trace\nAdditional information:\ninfo_id_pre_elab.lean:3:8: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available"},{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":27,"pos_line":7,"severity":"error","text":"invalid expression, `)` expected"}],"response":"all_messages"} -{"msgs":[{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":0,"pos_line":6,"severity":"error","text":"invalid expression, `)` expected"},{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":8,"pos_line":3,"severity":"error","text":"ambiguous overload, possible interpretations\n trace\n tactic.trace\nAdditional information:\ninfo_id_pre_elab.lean:3:8: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available"},{"caption":"","file_name":"info_id_pre_elab.lean","pos_col":27,"pos_line":7,"severity":"error","text":"invalid expression, `)` expected"},{"caption":"check result","end_pos_col":27,"end_pos_line":7,"file_name":"info_id_pre_elab.lean","pos_col":0,"pos_line":6,"severity":"information","text":"λ (tac : tactic unit), (abstract tac none) : tactic unit → tactic unit"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"response":"ok","seq_num":4} -{"record":{"full-id":"tactic.abstract","source":,"type":"tactic unit → opt_param (option name) none → opt_param bool tt → tactic unit"},"response":"ok","seq_num":7} diff --git a/old_tests/tests/lean/interactive/info_tactic.lean b/old_tests/tests/lean/interactive/info_tactic.lean deleted file mode 100644 index 9cee3aa86a..0000000000 --- a/old_tests/tests/lean/interactive/info_tactic.lean +++ /dev/null @@ -1,22 +0,0 @@ -open tactic - -open lean.parser -open interactive -open interactive.types - -meta def fooo (p : parse $ optional $ pexpr_list_or_texpr) : tactic unit := skip -run_cmd add_interactive [`fooo] - -example : false := -begin - fooo, - --^ "command": "info" - fooo , - --^ "command": "info" - fooo [ ], - --^ "command": "info" - fooo [d] , - --^ "command": "info" - _root_.fooo none ---^ "command": "info" -end diff --git a/old_tests/tests/lean/interactive/info_tactic.lean.expected.out b/old_tests/tests/lean/interactive/info_tactic.lean.expected.out deleted file mode 100644 index dbd78fff47..0000000000 --- a/old_tests/tests/lean/interactive/info_tactic.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -{"msgs":[{"caption":"","file_name":"info_tactic.lean","pos_col":0,"pos_line":22,"severity":"error","text":"tactic failed, there are unsolved goals\nstate:\n⊢ false"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"source":,"state":"⊢ false","tactic_params":["([expr, ...] | expr)?"],"text":"fooo","type":"parse (optional pexpr_list_or_texpr) → tactic unit"},"response":"ok","seq_num":13} -{"record":{"source":,"state":"⊢ false","tactic_param_idx":0,"tactic_params":["([expr, ...] | expr)?"],"text":"fooo","type":"parse (optional pexpr_list_or_texpr) → tactic unit"},"response":"ok","seq_num":15} -{"record":{"source":,"state":"⊢ false","tactic_param_idx":0,"tactic_params":["([expr, ...] | expr)?"],"text":"fooo","type":"parse (optional pexpr_list_or_texpr) → tactic unit"},"response":"ok","seq_num":17} -{"record":{"source":,"state":"⊢ false","tactic_param_idx":1,"tactic_params":["([expr, ...] | expr)?"],"text":"fooo","type":"parse (optional pexpr_list_or_texpr) → tactic unit"},"response":"ok","seq_num":19} -{"record":{"full-id":"fooo","source":,"state":"⊢ false","tactic_params":["([expr, ...] | expr)?"],"type":"parse (optional pexpr_list_or_texpr) → tactic unit"},"response":"ok","seq_num":21} diff --git a/old_tests/tests/lean/interactive/mk_input.sh b/old_tests/tests/lean/interactive/mk_input.sh deleted file mode 100755 index 321df5a2bd..0000000000 --- a/old_tests/tests/lean/interactive/mk_input.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -# generate server input from "--^" markers -echo "{\"seq_num\": 0, \"command\": \"sync\", \"file_name\": \"$1\"}" -awk '{ - i = match($0, /--\^/); - if (i > 0) { - printf("{\"seq_num\": %s, %s, \"file_name\": \"'"$1"'\", \"line\": %s, \"column\": %s}\n", NR, substr($0, i + 4), NR - 1, i + 1); - } -}' < "$1" diff --git a/old_tests/tests/lean/interactive/my_tac_class.lean b/old_tests/tests/lean/interactive/my_tac_class.lean deleted file mode 100644 index dd0dcf145a..0000000000 --- a/old_tests/tests/lean/interactive/my_tac_class.lean +++ /dev/null @@ -1,68 +0,0 @@ -meta def mytac := -state_t nat tactic - -section -local attribute [reducible] mytac -meta instance : monad mytac := by apply_instance -meta instance : monad_state nat mytac := by apply_instance -meta instance : has_monad_lift tactic mytac := by apply_instance -end - -meta instance (α : Type) : has_coe (tactic α) (mytac α) := -⟨monad_lift⟩ - -namespace mytac - -meta def step {α : Type} (t : mytac α) : mytac unit := -t >> return () - -meta def istep {α : Type} (line0 col0 line col : nat) (t : mytac α) : mytac unit := -⟨λ v s, result.cases_on (@scope_trace _ line col (λ_, t.run v s)) - (λ ⟨a, v⟩ new_s, result.success ((), v) new_s) - (λ opt_msg_thunk e new_s, match opt_msg_thunk with - | some msg_thunk := - let msg := λ _ : unit, msg_thunk () ++ format.line ++ to_fmt "value: " ++ to_fmt v ++ format.line ++ to_fmt "state:" ++ format.line ++ new_s^.to_format in - interaction_monad.result.exception (some msg) (some ⟨line, col⟩) new_s - | none := interaction_monad.silent_fail new_s - end)⟩ - -meta def execute (tac : mytac unit) : tactic unit := -tac.run 0 >> return () - -meta def save_info (p : pos) : mytac unit := -do v ← get, - s ← tactic.read, - tactic.save_info_thunk p - (λ _, to_fmt "Custom state: " ++ to_fmt v ++ format.line ++ - tactic_state.to_format s) - -namespace interactive -meta def intros : mytac unit := -tactic.intros >> return () - -meta def constructor : mytac unit := -tactic.constructor >> return () - -meta def trace (s : string) : mytac unit := -tactic.trace s - -meta def assumption : mytac unit := -tactic.assumption - -meta def inc : mytac punit := -modify (+1) - -end interactive -end mytac - -example (p q : Prop) : p → q → p ∧ q := -begin [mytac] - intros, - inc, - trace "test", - constructor, - inc, - assumption, ---^ "command": "info" - assumption -end diff --git a/old_tests/tests/lean/interactive/my_tac_class.lean.expected.out b/old_tests/tests/lean/interactive/my_tac_class.lean.expected.out deleted file mode 100644 index beb6b3c9a3..0000000000 --- a/old_tests/tests/lean/interactive/my_tac_class.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"trace output","file_name":"my_tac_class.lean","pos_col":2,"pos_line":62,"severity":"information","text":"test\n"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"source":,"state":"Custom state: 2\n2 goals\np q : Prop,\na : p,\na_1 : q\n⊢ p\n\np q : Prop,\na : p,\na_1 : q\n⊢ q","tactic_params":[],"text":"assumption","type":"mytac unit"},"response":"ok","seq_num":66} diff --git a/old_tests/tests/lean/interactive/nested_traces.lean b/old_tests/tests/lean/interactive/nested_traces.lean deleted file mode 100644 index 4e0c7f241a..0000000000 --- a/old_tests/tests/lean/interactive/nested_traces.lean +++ /dev/null @@ -1,7 +0,0 @@ -example (a b c : nat) : a = b → c = b → a = c ∧ b = c := -begin - intros, - split, - try { transitivity, trace "hello", assumption, symmetry, assumption }, - abstract { symmetry, trace "test", assumption } -end diff --git a/old_tests/tests/lean/interactive/nested_traces.lean.expected.out b/old_tests/tests/lean/interactive/nested_traces.lean.expected.out deleted file mode 100644 index 000a1c2578..0000000000 --- a/old_tests/tests/lean/interactive/nested_traces.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"trace output","file_name":"nested_traces.lean","pos_col":22,"pos_line":5,"severity":"information","text":"hello\n"}],"response":"all_messages"} -{"msgs":[{"caption":"trace output","file_name":"nested_traces.lean","pos_col":22,"pos_line":5,"severity":"information","text":"hello\n"},{"caption":"trace output","file_name":"nested_traces.lean","pos_col":23,"pos_line":6,"severity":"information","text":"test\n"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} diff --git a/old_tests/tests/lean/interactive/rb_map_ts.lean b/old_tests/tests/lean/interactive/rb_map_ts.lean deleted file mode 100644 index c0456596bd..0000000000 --- a/old_tests/tests/lean/interactive/rb_map_ts.lean +++ /dev/null @@ -1,90 +0,0 @@ -meta def mytac := -state_t (name_map nat) tactic - -section -local attribute [reducible] mytac -meta instance : monad mytac := by apply_instance -meta instance : monad_state (name_map nat) mytac := by apply_instance -meta instance : has_monad_lift tactic mytac := by apply_instance -end - -meta instance (α : Type) : has_coe (tactic α) (mytac α) := -⟨monad_lift⟩ - -namespace mytac - -meta def step {α : Type} (t : mytac α) : mytac unit := -t >> return () - -meta def istep {α : Type} (line0 col0 line col : nat) (t : mytac α) : mytac unit := -⟨λ v s, result.cases_on (@scope_trace _ line col (λ_, t.run v s)) - (λ ⟨a, v⟩ new_s, result.success ((), v) new_s) - (λ opt_msg_thunk e new_s, - match opt_msg_thunk with - | some msg_thunk := - let msg := λ _ : unit, msg_thunk () ++ format.line ++ to_fmt "value: " ++ to_fmt v ++ format.line ++ to_fmt "state:" ++ format.line ++ new_s^.to_format in - interaction_monad.result.exception (some msg) (some ⟨line, col⟩) new_s - | none := interaction_monad.silent_fail new_s - end)⟩ - -meta def execute (tac : mytac unit) : tactic unit := -tac.run (name_map.mk nat) >> return () - -meta def save_info (p : pos) : mytac unit := -do v ← get, - s ← tactic.read, - tactic.save_info_thunk p - (λ _, to_fmt "Custom state: " ++ to_fmt v ++ format.line ++ - tactic_state.to_format s) - -namespace interactive -meta def intros : mytac unit := -tactic.intros >> return () - -meta def constructor : mytac unit := -tactic.constructor >> return () - -meta def trace (s : string) : mytac unit := -tactic.trace s - -meta def assumption : mytac unit := -tactic.assumption - -open lean.parser -open interactive -open interactive.types - -meta def add (n : parse ident) (v : nat) : mytac punit := -modify (λ m, m.insert n v) - -end interactive -end mytac - -lemma ex₁ (p q : Prop) : p → q → p ∧ q := -begin [mytac] - intros, - add x 10, - trace "test", ---^ "command": "info" - constructor, - add y 20, - assumption, ---^ "command": "info" - assumption -end - -#print ex₁ - -lemma ex₂ (p q : Prop) : p → q → p ∧ q := -begin [mytac] - intros, - add x 10, - trace "test", - constructor, - add y 20, - assumption, ---^ "command": "info" - assumption -end - -#print ex₂ diff --git a/old_tests/tests/lean/interactive/rb_map_ts.lean.expected.out b/old_tests/tests/lean/interactive/rb_map_ts.lean.expected.out deleted file mode 100644 index 3ff682a1fc..0000000000 --- a/old_tests/tests/lean/interactive/rb_map_ts.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -{"msgs":[{"caption":"trace output","file_name":"rb_map_ts.lean","pos_col":2,"pos_line":67,"severity":"information","text":"test\n"}],"response":"all_messages"} -{"msgs":[{"caption":"trace output","file_name":"rb_map_ts.lean","pos_col":2,"pos_line":67,"severity":"information","text":"test\n"},{"caption":"print result","end_pos_col":0,"end_pos_line":78,"file_name":"rb_map_ts.lean","pos_col":0,"pos_line":76,"severity":"information","text":"theorem ex₁ : ∀ (p q : Prop), p → q → p ∧ q :=\nλ (p q : Prop) (a : p) (a_1 : q), ⟨a, a_1⟩"}],"response":"all_messages"} -{"msgs":[{"caption":"trace output","file_name":"rb_map_ts.lean","pos_col":2,"pos_line":67,"severity":"information","text":"test\n"},{"caption":"print result","end_pos_col":0,"end_pos_line":78,"file_name":"rb_map_ts.lean","pos_col":0,"pos_line":76,"severity":"information","text":"theorem ex₁ : ∀ (p q : Prop), p → q → p ∧ q :=\nλ (p q : Prop) (a : p) (a_1 : q), ⟨a, a_1⟩"},{"caption":"trace output","file_name":"rb_map_ts.lean","pos_col":2,"pos_line":82,"severity":"information","text":"test\n"}],"response":"all_messages"} -{"msgs":[{"caption":"trace output","file_name":"rb_map_ts.lean","pos_col":2,"pos_line":67,"severity":"information","text":"test\n"},{"caption":"print result","end_pos_col":0,"end_pos_line":78,"file_name":"rb_map_ts.lean","pos_col":0,"pos_line":76,"severity":"information","text":"theorem ex₁ : ∀ (p q : Prop), p → q → p ∧ q :=\nλ (p q : Prop) (a : p) (a_1 : q), ⟨a, a_1⟩"},{"caption":"trace output","file_name":"rb_map_ts.lean","pos_col":2,"pos_line":82,"severity":"information","text":"test\n"},{"caption":"print result","end_pos_col":10,"end_pos_line":90,"file_name":"rb_map_ts.lean","pos_col":0,"pos_line":90,"severity":"information","text":"theorem ex₂ : ∀ (p q : Prop), p → q → p ∧ q :=\nλ (p q : Prop) (a : p) (a_1 : q), ⟨a, a_1⟩"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} -{"record":{"source":,"state":"Custom state: ⟨x ← 10⟩\np q : Prop,\na : p,\na_1 : q\n⊢ p ∧ q","tactic_params":["(string)"],"text":"trace","type":"string → mytac unit"},"response":"ok","seq_num":68} -{"record":{"source":,"state":"Custom state: ⟨y ← 20, x ← 10⟩\n2 goals\np q : Prop,\na : p,\na_1 : q\n⊢ p\n\np q : Prop,\na : p,\na_1 : q\n⊢ q","tactic_params":[],"text":"assumption","type":"mytac unit"},"response":"ok","seq_num":72} -{"record":{"source":,"state":"Custom state: ⟨y ← 20, x ← 10⟩\n2 goals\np q : Prop,\na : p,\na_1 : q\n⊢ p\n\np q : Prop,\na : p,\na_1 : q\n⊢ q","tactic_params":[],"text":"assumption","type":"mytac unit"},"response":"ok","seq_num":86} diff --git a/old_tests/tests/lean/interactive/run_single.sh b/old_tests/tests/lean/interactive/run_single.sh deleted file mode 100755 index a7a259d76f..0000000000 --- a/old_tests/tests/lean/interactive/run_single.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 2 ]; then - echo "Usage: run_single.sh [lean-executable-path] [file]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -if command -v greadlink >/dev/null 2>&1; then - # macOS readlink doesn't support -f option - READLINK=greadlink -else - READLINK=readlink -fi -ROOT_PATH=$($READLINK -f ../../..) - -if [[ "$OSTYPE" == "msys" ]]; then - # Windows running MSYS2 - # Replace /c/ with c:, and / with \\ - ROOT_PATH_NORMALIZED=$(echo $ROOT_PATH | sed 's|^/\([a-z]\)/|\U\1:/|' | sed 's|/|\\\\\\\\|g') -else - ROOT_PATH_NORMALIZED=$ROOT_PATH -fi -export LEAN_PATH=$ROOT_PATH/library:. -f=$2 -if [[ "$f" == *.lean ]]; then - INPUT="$(./mk_input.sh "$f")" -else - INPUT="$(cat "$f")" -fi -OUTPUT="$(echo "$INPUT" | "$LEAN" -j0 -D pp.unicode=true --server 2>&1)" -# make paths system-independent -echo "$OUTPUT" | grep -v '"response":"current_tasks"' | sed "s|$ROOT_PATH_NORMALIZED||g" | sed 's|\\\\|/|g' | sed 's/\("source":\){[^}]*}/\1/' diff --git a/old_tests/tests/lean/interactive/sync.input b/old_tests/tests/lean/interactive/sync.input deleted file mode 100644 index cdf1210730..0000000000 --- a/old_tests/tests/lean/interactive/sync.input +++ /dev/null @@ -1,2 +0,0 @@ -{"seq_num":0,"command":"sync","file_name":"param.lean","content":"section s1\nparameters {\u03b1 \u03b2 : Type}\n\nparameter [decidable_eq \u03b1]\n\nparameter [decidable_eq \u03b2]\nparameter [decidable_eq nat]\nparameter [decidable_eq nat]\n\nend s1\n"} -{"seq_num":2,"command":"sync","file_name":"param.lean","content":"section s1\nparameters {\u03b1 \u03b2 : Type}\n\nparameter [decidable_eq \u03b1]\n\nparameter [decidable_eq \u03b2]\nparameter [decidable_eq nat]\n\nparameter [decidable_eq nat]\n\nend s1\n"} diff --git a/old_tests/tests/lean/interactive/sync.input.expected.out b/old_tests/tests/lean/interactive/sync.input.expected.out deleted file mode 100644 index 28a0a4365f..0000000000 --- a/old_tests/tests/lean/interactive/sync.input.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -{"message":"file invalidated","response":"ok","seq_num":0} -{"message":"file invalidated","response":"ok","seq_num":2} diff --git a/old_tests/tests/lean/interactive/test_single.sh b/old_tests/tests/lean/interactive/test_single.sh deleted file mode 100755 index 2b59b918d4..0000000000 --- a/old_tests/tests/lean/interactive/test_single.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 3 -a $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file] [yes/no]?" - exit 1 -fi -f=$2 -if [ $# -ne 3 ]; then - INTERACTIVE=no -else - INTERACTIVE=$3 -fi - -DIFF=diff -if diff --color --help >/dev/null 2>&1; then - DIFF="diff --color"; -fi - -./run_single.sh $1 $f > "$f.produced.out" - -if test -f "$f.expected.out"; then - if $DIFF -u --ignore-all-space "$f.expected.out" "$f.produced.out"; then - echo "-- checked" - exit 0 - else - echo "ERROR: file $f.produced.out does not match $f.expected.out" - if [ $INTERACTIVE == "yes" ]; then - meld "$f.produced.out" "$f.expected.out" - if $DIFF --ignore-all-space "$f.expected.out" "$f.produced.out"; then - echo "-- mismatch was fixed" - fi - fi - exit 1 - fi -else - echo "ERROR: file $f.expected.out does not exist" - if [ $INTERACTIVE == "yes" ]; then - read -p "copy $f.produced.out (y/n)? " - if [ $REPLY == "y" ]; then - cp -- "$f.produced.out" "$f.expected.out" - echo "-- copied $f.produced.out --> $f.expected.out" - fi - fi - exit 1 -fi diff --git a/old_tests/tests/lean/interactive/trace.lean b/old_tests/tests/lean/interactive/trace.lean deleted file mode 100644 index 6acbe058da..0000000000 --- a/old_tests/tests/lean/interactive/trace.lean +++ /dev/null @@ -1,7 +0,0 @@ -example (p q : Prop) : p → q → p := -begin - trace "foo", - intros, - trace "hello world", - assumption -end diff --git a/old_tests/tests/lean/interactive/trace.lean.expected.out b/old_tests/tests/lean/interactive/trace.lean.expected.out deleted file mode 100644 index e84fb329ab..0000000000 --- a/old_tests/tests/lean/interactive/trace.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -{"msgs":[{"caption":"trace output","file_name":"trace.lean","pos_col":2,"pos_line":3,"severity":"information","text":"foo\n"}],"response":"all_messages"} -{"msgs":[{"caption":"trace output","file_name":"trace.lean","pos_col":2,"pos_line":3,"severity":"information","text":"foo\n"},{"caption":"trace output","file_name":"trace.lean","pos_col":2,"pos_line":5,"severity":"information","text":"hello world\n"}],"response":"all_messages"} -{"message":"file invalidated","response":"ok","seq_num":0} diff --git a/old_tests/tests/lean/internal_names.lean b/old_tests/tests/lean/internal_names.lean deleted file mode 100644 index 40e6eb8b58..0000000000 --- a/old_tests/tests/lean/internal_names.lean +++ /dev/null @@ -1,7 +0,0 @@ -definition _foo : nat := 0 -- error - -structure _bla := (a b : nat) - -inductive _empty : Type. - -namespace _no diff --git a/old_tests/tests/lean/internal_names.lean.expected.out b/old_tests/tests/lean/internal_names.lean.expected.out deleted file mode 100644 index e7bb2af0f3..0000000000 --- a/old_tests/tests/lean/internal_names.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -internal_names.lean:1:11: error: invalid declaration name '_foo', identifiers starting with '_' are reserved to the system -internal_names.lean:3:10: error: invalid declaration name '_bla', identifiers starting with '_' are reserved to the system -internal_names.lean:5:10: error: invalid declaration name '_empty', identifiers starting with '_' are reserved to the system -internal_names.lean:7:10: error: invalid declaration name '_no', identifiers starting with '_' are reserved to the system -internal_names.lean:7:13: error: invalid end of module, expecting 'end' diff --git a/old_tests/tests/lean/invalid_ematch_attr.lean b/old_tests/tests/lean/invalid_ematch_attr.lean deleted file mode 100644 index bfcd33ceed..0000000000 --- a/old_tests/tests/lean/invalid_ematch_attr.lean +++ /dev/null @@ -1,6 +0,0 @@ -constant f : ℕ → ℕ -axiom foo {m n : ℕ} : f m = m - -attribute [ematch] foo - -example : true := begin[smt] eblast end diff --git a/old_tests/tests/lean/invalid_ematch_attr.lean.expected.out b/old_tests/tests/lean/invalid_ematch_attr.lean.expected.out deleted file mode 100644 index bdb28d0df9..0000000000 --- a/old_tests/tests/lean/invalid_ematch_attr.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -invalid_ematch_attr.lean:4:0: error: invalid ematch lemma 'foo' diff --git a/old_tests/tests/lean/io_bug1.lean b/old_tests/tests/lean/io_bug1.lean deleted file mode 100644 index e418a61a51..0000000000 --- a/old_tests/tests/lean/io_bug1.lean +++ /dev/null @@ -1,23 +0,0 @@ -import system.io -open io - -def bar : io unit := -do put_str "one", put_str "two", put_str "three" - -#eval bar - -#print "---------" - -def foo : ℕ → io unit -| 0 := put_str "at zero\n" -| (n+1) := do put_str "in\n", foo n, put_str "out\n" - -#eval foo 3 - -#print "---------" - -def foo2 : ℕ → io unit -| 0 := put_str "at zero\n" -| (n+1) := do put_str "in\n", foo2 n, put_str "out\n", put_str "out2\n" - -#eval foo2 3 diff --git a/old_tests/tests/lean/io_bug1.lean.expected.out b/old_tests/tests/lean/io_bug1.lean.expected.out deleted file mode 100644 index 9ae65df1c5..0000000000 --- a/old_tests/tests/lean/io_bug1.lean.expected.out +++ /dev/null @@ -1,20 +0,0 @@ -onetwothree ---------- -in -in -in -at zero -out -out -out ---------- -in -in -in -at zero -out -out2 -out -out2 -out -out2 diff --git a/old_tests/tests/lean/io_bug2.lean b/old_tests/tests/lean/io_bug2.lean deleted file mode 100644 index ac7a499fca..0000000000 --- a/old_tests/tests/lean/io_bug2.lean +++ /dev/null @@ -1,9 +0,0 @@ -import system.io -open io - -def main : io unit := do - println "t1", - (x, y) ← return ((1 : nat), (2 : ℕ)), - println "t2" - -#eval main diff --git a/old_tests/tests/lean/io_bug2.lean.expected.out b/old_tests/tests/lean/io_bug2.lean.expected.out deleted file mode 100644 index ba21892843..0000000000 --- a/old_tests/tests/lean/io_bug2.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -t1 -t2 diff --git a/old_tests/tests/lean/io_fs_error.lean b/old_tests/tests/lean/io_fs_error.lean deleted file mode 100644 index 21de27e2ad..0000000000 --- a/old_tests/tests/lean/io_fs_error.lean +++ /dev/null @@ -1,30 +0,0 @@ -import system.io -open io - - -def tst1 : io unit := -do o ← stdout, - -- fs.put_str_ln out "hello", - fs.close o - -#eval tst1 -#eval tst1 - -def tst2 : io unit := -do o ← stderr, - -- fs.put_str_ln out "world", - fs.close o - -#eval tst2 - -def tst3 : io unit := -do h ← mk_file_handle "io_fs_error.lean" io.mode.read, - fs.close h, - fs.close h - -#eval tst3 - -def tst4 : io handle := -mk_file_handle "bad_file_name.txt" io.mode.read - -#eval tst4 diff --git a/old_tests/tests/lean/io_fs_error.lean.expected.out b/old_tests/tests/lean/io_fs_error.lean.expected.out deleted file mode 100644 index c9e5c26146..0000000000 --- a/old_tests/tests/lean/io_fs_error.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -io_fs_error.lean:10:0: error: close failed, stdout cannot be closed -io_fs_error.lean:11:0: error: close failed, stdout cannot be closed -io_fs_error.lean:18:0: error: close failed, stderr cannot be closed -io_fs_error.lean:25:0: error: invalid io action, handle has been closed -io_fs_error.lean:30:0: error: failed to open file 'bad_file_name.txt' diff --git a/old_tests/tests/lean/io_process_echo.lean b/old_tests/tests/lean/io_process_echo.lean deleted file mode 100644 index 7168d00fa4..0000000000 --- a/old_tests/tests/lean/io_process_echo.lean +++ /dev/null @@ -1,10 +0,0 @@ -import system.io - - - -def main : io unit := do - handle ← io.cmd {cmd := "echo", args := ["Hello World!"]}, - io.put_str handle, - return () - -#eval main diff --git a/old_tests/tests/lean/io_process_echo.lean.expected.out b/old_tests/tests/lean/io_process_echo.lean.expected.out deleted file mode 100644 index 980a0d5f19..0000000000 --- a/old_tests/tests/lean/io_process_echo.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -Hello World! diff --git a/old_tests/tests/lean/kernel_ex.lean b/old_tests/tests/lean/kernel_ex.lean deleted file mode 100644 index 6d29052eac..0000000000 --- a/old_tests/tests/lean/kernel_ex.lean +++ /dev/null @@ -1,9 +0,0 @@ -def I : nat → nat := λ x, x - -meta def buggy : tactic unit := -do let t : expr := expr.app (expr.const `I []) (expr.const `bool.tt []), - tactic.exact t - -def t (y : nat) : nat := -let x := 1 + y in -by buggy diff --git a/old_tests/tests/lean/kernel_ex.lean.expected.out b/old_tests/tests/lean/kernel_ex.lean.expected.out deleted file mode 100644 index 473deffaba..0000000000 --- a/old_tests/tests/lean/kernel_ex.lean.expected.out +++ /dev/null @@ -1,14 +0,0 @@ -kernel_ex.lean:7:4: error: kernel failed to type check declaration 't' this is usually due to a buggy tactic or a bug in the builtin elaborator -elaborated type: - ℕ → ℕ -elaborated value: - λ (y : ℕ), let x : ℕ := 1 + y in I tt -nested exception message: -type mismatch at application - I tt -term - tt -has type - bool -but is expected to have type - ℕ diff --git a/old_tests/tests/lean/key_eqv1.lean b/old_tests/tests/lean/key_eqv1.lean deleted file mode 100644 index 8c60664b69..0000000000 --- a/old_tests/tests/lean/key_eqv1.lean +++ /dev/null @@ -1,4 +0,0 @@ -add_key_equivalence has_add.add nat.add -add_key_equivalence nat.add nat.succ -add_key_equivalence has_mul.mul nat.mul -#print key_equivalences diff --git a/old_tests/tests/lean/key_eqv1.lean.expected.out b/old_tests/tests/lean/key_eqv1.lean.expected.out deleted file mode 100644 index 38622d442a..0000000000 --- a/old_tests/tests/lean/key_eqv1.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -[has_mul.mul, nat.mul] -[has_add.add, nat.succ, nat.add] diff --git a/old_tests/tests/lean/keyword_tactics.lean b/old_tests/tests/lean/keyword_tactics.lean deleted file mode 100644 index 8f657ebf6f..0000000000 --- a/old_tests/tests/lean/keyword_tactics.lean +++ /dev/null @@ -1,57 +0,0 @@ -example : ℕ → ℕ → ℕ := -begin - assume n m, - apply n -end - -example : ℕ → ℕ → ℕ := -begin - assume (n m : ℕ), - apply n -end - -example : ℕ → ℕ → ℕ := -begin - assume n : ℕ × ℕ <|> assume n m : ℕ, - apply n -end - -example : ¬false := -begin - assume contr, - apply contr -end - -example : Π α : Type, α → α := -begin - assume α, - assume a : α, - apply a -end - -example : ℕ → ℕ → ℕ := -begin - assume n m : bool, - apply n -end - -example : ℕ → ℕ → ℕ := -begin - have : _ → ℕ, - { assume m : ℕ, - have: ℕ := m, - have: ℕ, from m, - have: ℕ, by apply m, - apply this }, - { assume n, apply this }, -end - -example (f : ℕ → ℕ) : bool := -begin - have : ℕ, by skip; apply f 0, -end - -example (f : ℕ → ℕ) : bool := -begin - suffices: ℕ → bool, from this 0, -end diff --git a/old_tests/tests/lean/keyword_tactics.lean.expected.out b/old_tests/tests/lean/keyword_tactics.lean.expected.out deleted file mode 100644 index fb82c8b8e3..0000000000 --- a/old_tests/tests/lean/keyword_tactics.lean.expected.out +++ /dev/null @@ -1,15 +0,0 @@ -keyword_tactics.lean:34:2: error: unify tactic failed, failed to unify - bool : Type -and - ℕ : Type -state: -⊢ ℕ → ℕ → ℕ -keyword_tactics.lean:52:0: error: tactic failed, there are unsolved goals -state: -f : ℕ → ℕ, -this : ℕ -⊢ bool -keyword_tactics.lean:57:0: error: tactic failed, there are unsolved goals -state: -f : ℕ → ℕ -⊢ ℕ → bool diff --git a/old_tests/tests/lean/lambda_lift_after_erase_trivial.lean b/old_tests/tests/lean/lambda_lift_after_erase_trivial.lean deleted file mode 100644 index 03e25eeb40..0000000000 --- a/old_tests/tests/lean/lambda_lift_after_erase_trivial.lean +++ /dev/null @@ -1,7 +0,0 @@ -structure box (α : Type) := -(val : α) - -set_option trace.compiler.lambda_lifting true - -def f1 : box (ℕ → ℕ) := -box.mk id diff --git a/old_tests/tests/lean/lambda_lift_after_erase_trivial.lean.expected.out b/old_tests/tests/lean/lambda_lift_after_erase_trivial.lean.expected.out deleted file mode 100644 index 7b8c4d43d1..0000000000 --- a/old_tests/tests/lean/lambda_lift_after_erase_trivial.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -[compiler.lambda_lifting] ->> f1 -λ (a : ℕ), a diff --git a/old_tests/tests/lean/leanpkg/build_error.sh b/old_tests/tests/lean/leanpkg/build_error.sh deleted file mode 100644 index 71711d6e3e..0000000000 --- a/old_tests/tests/lean/leanpkg/build_error.sh +++ /dev/null @@ -1,2 +0,0 @@ -cd build_error -leanpkg build diff --git a/old_tests/tests/lean/leanpkg/build_error.sh.expected.out b/old_tests/tests/lean/leanpkg/build_error.sh.expected.out deleted file mode 100644 index aec6c8f220..0000000000 --- a/old_tests/tests/lean/leanpkg/build_error.sh.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -configuring build_error 0.1 -> lean --make src -err.lean:1:0: error: command expected -external command exited with status 1 -1 diff --git a/old_tests/tests/lean/leanpkg/build_error/leanpkg.path b/old_tests/tests/lean/leanpkg/build_error/leanpkg.path deleted file mode 100644 index a45b2955f6..0000000000 --- a/old_tests/tests/lean/leanpkg/build_error/leanpkg.path +++ /dev/null @@ -1,2 +0,0 @@ -builtin_path -path ./src diff --git a/old_tests/tests/lean/leanpkg/build_error/leanpkg.toml b/old_tests/tests/lean/leanpkg/build_error/leanpkg.toml deleted file mode 100644 index 9219ca42ac..0000000000 --- a/old_tests/tests/lean/leanpkg/build_error/leanpkg.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "build_error" -path = "src" -version = "0.1" -lean_version = "master" - -[dependencies] diff --git a/old_tests/tests/lean/leanpkg/build_error/src/err.lean b/old_tests/tests/lean/leanpkg/build_error/src/err.lean deleted file mode 100644 index 3546645658..0000000000 --- a/old_tests/tests/lean/leanpkg/build_error/src/err.lean +++ /dev/null @@ -1 +0,0 @@ -unknown diff --git a/old_tests/tests/lean/leanpkg/new.sh b/old_tests/tests/lean/leanpkg/new.sh deleted file mode 100644 index c95713daae..0000000000 --- a/old_tests/tests/lean/leanpkg/new.sh +++ /dev/null @@ -1,4 +0,0 @@ -rm -rf new -leanpkg new new -ls -a new -rm -rf new diff --git a/old_tests/tests/lean/leanpkg/new.sh.expected.out b/old_tests/tests/lean/leanpkg/new.sh.expected.out deleted file mode 100644 index 9a7f8fee7e..0000000000 --- a/old_tests/tests/lean/leanpkg/new.sh.expected.out +++ /dev/null @@ -1,13 +0,0 @@ -> mkdir -p new -> cd new -> mkdir src -> git init -q -configuring new 0.1 -. -.. -.git -.gitignore -leanpkg.path -leanpkg.toml -src -0 diff --git a/old_tests/tests/lean/leanpkg/test_single.sh b/old_tests/tests/lean/leanpkg/test_single.sh deleted file mode 100755 index 76504039da..0000000000 --- a/old_tests/tests/lean/leanpkg/test_single.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 3 -a $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file] [yes/no]?" - exit 1 -fi -ulimit -s 8192 -export PATH=$(dirname $(../readlinkf.sh "$1")):$PATH -export LEAN_PATH=../../library:. -if [ $# -ne 3 ]; then - INTERACTIVE=no -else - INTERACTIVE=$3 -fi -f=$2 -ff=$(../readlinkf.sh "$f") - -if [[ "$OSTYPE" == "msys" ]]; then - # Windows running MSYS2 - # Replace /c/ with c:, and / with \\ - ff=$(echo $ff | sed 's|^/\([a-z]\)/|\1:/|' | sed 's|/|\\\\|g') -fi - -DIFF=diff -if diff --color --help >/dev/null 2>&1; then - DIFF="diff --color"; -fi - -echo "-- testing $f" -bash "$ff" >& "$f.tmp" -echo $? >> "$f.tmp" - -sed -E "s|^[^ ]*[/\\\\]||" "$f.tmp" | sed "/WARNING: Lean version mismatch/d" | sed "/^$/d" > "$f.produced.out" -rm "$f.tmp" -if test -f "$f.expected.out"; then - if $DIFF -u --ignore-all-space -I "executing external script" "$f.expected.out" "$f.produced.out"; then - echo "-- checked" - exit 0 - else - echo "ERROR: file $f.produced.out does not match $f.expected.out" - if [ $INTERACTIVE == "yes" ]; then - meld "$f.produced.out" "$f.expected.out" - if diff -I "executing external script" "$f.expected.out" "$f.produced.out"; then - echo "-- mismatch was fixed" - fi - fi - exit 1 - fi -else - echo "ERROR: file $f.expected.out does not exist" - if [ $INTERACTIVE == "yes" ]; then - read -p "copy $f.produced.out (y/n)? " - if [ $REPLY == "y" ]; then - cp -- "$f.produced.out" "$f.expected.out" - echo "-- copied $f.produced.out --> $f.expected.out" - fi - fi - exit 1 -fi diff --git a/old_tests/tests/lean/let1.lean b/old_tests/tests/lean/let1.lean deleted file mode 100644 index cccbb7b45d..0000000000 --- a/old_tests/tests/lean/let1.lean +++ /dev/null @@ -1,24 +0,0 @@ -prelude -- Correct version -#check let bool := Sort 0, - and (p q : bool) := ∀ c : bool, (p → q → c) → c, - infixl `∧`:25 := and, - and_intro (p q : bool) (H1 : p) (H2 : q) : p ∧ q - := λ (c : bool) (H : p → q → c), H H1 H2, - and_elim_left (p q : bool) (H : p ∧ q) : p - := H p (λ (H1 : p) (H2 : q), H1), - and_elim_right (p q : bool) (H : p ∧ q) : q - := H q (λ (H1 : p) (H2 : q), H2) - in and_intro - --- TODO(Leo): fix expected output as soon as elaborator starts #checking let-expression type again - -#check let bool := Sort 0, - and (p q : bool) := ∀ c : bool, (p → q → c) → c, - infixl `∧`:25 := and, - and_intro (p q : bool) (H1 : p) (H2 : q) : q ∧ p - := λ (c : bool) (H : p → q → c), H H1 H2, - and_elim_left (p q : bool) (H : p ∧ q) : p - := H p (λ (H1 : p) (H2 : q), H1), - and_elim_right (p q : bool) (H : p ∧ q) : q - := H q (λ (H1 : p) (H2 : q), H2) - in and_intro diff --git a/old_tests/tests/lean/let1.lean.expected.out b/old_tests/tests/lean/let1.lean.expected.out deleted file mode 100644 index 5de34178bb..0000000000 --- a/old_tests/tests/lean/let1.lean.expected.out +++ /dev/null @@ -1,21 +0,0 @@ -let bool : Type := Prop, - and : bool → bool → Prop := λ (p q : bool), Π (c : bool), (p → q → c) → c, - and_intro : Π (p q : bool), p → q → and p q := - λ (p q : bool) (H1 : p) (H2 : q) (c : bool) (H : p → q → c), H H1 H2, - and_elim_left : Π (p q : bool), and p q → p := λ (p q : bool) (H : and p q), H p (λ (H1 : p) (H2 : q), H1), - and_elim_right : Π (p q : bool), and p q → q := λ (p q : bool) (H : and p q), H q (λ (H1 : p) (H2 : q), H2) -in and_intro : - ∀ (p q : Prop), p → q → ∀ (c : Prop), (p → q → c) → c -let1.lean:19:17: error: invalid let-expression, term - λ (p q : bool) (H1 : p) (H2 : q) (c : bool) (H : p → q → c), H H1 H2 -has type - Π (p q : bool), p → q → Π (c : bool), (p → q → c) → c -but is expected to have type - Π (p q : bool), p → q → and q p -let bool : Type := Prop, - and : bool → bool → Prop := λ (p q : bool), Π (c : bool), (p → q → c) → c, - and_intro : Π (p q : bool), p → q → and q p := ⁇, - and_elim_left : Π (p q : bool), and p q → p := λ (p q : bool) (H : and p q), H p (λ (H1 : p) (H2 : q), H1), - and_elim_right : Π (p q : bool), and p q → q := λ (p q : bool) (H : and p q), H q (λ (H1 : p) (H2 : q), H2) -in and_intro : - ∀ (p q : Prop), p → q → (λ (p q : Prop), ∀ (c : Prop), (p → q → c) → c) q p diff --git a/old_tests/tests/lean/let3.lean b/old_tests/tests/lean/let3.lean deleted file mode 100644 index d313dd3784..0000000000 --- a/old_tests/tests/lean/let3.lean +++ /dev/null @@ -1,14 +0,0 @@ --- - -constant f : nat → nat → nat → nat - -#check - let a : nat := 10 - in f a 10 - -/- -#check - let a := 10, - b := 10 - in f a b 10 --/ diff --git a/old_tests/tests/lean/let3.lean.expected.out b/old_tests/tests/lean/let3.lean.expected.out deleted file mode 100644 index 0b6dd8942c..0000000000 --- a/old_tests/tests/lean/let3.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -let a : ℕ := 10 in f a 10 : ℕ → ℕ diff --git a/old_tests/tests/lean/let4.lean b/old_tests/tests/lean/let4.lean deleted file mode 100644 index d44ba795b1..0000000000 --- a/old_tests/tests/lean/let4.lean +++ /dev/null @@ -1,16 +0,0 @@ --- - -constant f : nat → nat → nat → nat - -#check - let a : nat := 10, - b : nat := 10, - c : nat := 10 - in f a b (f a 10 c) - -#check - let a : nat := 10, - b : nat := let c : nat := 10 in f a c (f a a (f 10 a c)), - d : nat := 10, - e : nat := f (f 10 10 d) (f d 10 10) a - in f a b (f e d 10) diff --git a/old_tests/tests/lean/let4.lean.expected.out b/old_tests/tests/lean/let4.lean.expected.out deleted file mode 100644 index 656761ca71..0000000000 --- a/old_tests/tests/lean/let4.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -let a : ℕ := 10, b : ℕ := 10, c : ℕ := 10 in f a b (f a 10 c) : ℕ -let a : ℕ := 10, - b : ℕ := let c : ℕ := 10 in f a c (f a a (f 10 a c)), - d : ℕ := 10, - e : ℕ := f (f 10 10 d) (f d 10 10) a -in f a b (f e d 10) : - ℕ diff --git a/old_tests/tests/lean/let_elim_issue.lean b/old_tests/tests/lean/let_elim_issue.lean deleted file mode 100644 index dcf6e53c37..0000000000 --- a/old_tests/tests/lean/let_elim_issue.lean +++ /dev/null @@ -1,9 +0,0 @@ -import system.io - -open io -def tst : io unit := - put_str "hello\n" ->> put_str "world\n" ->> put_str "from Lean\n" - -#eval tst diff --git a/old_tests/tests/lean/let_elim_issue.lean.expected.out b/old_tests/tests/lean/let_elim_issue.lean.expected.out deleted file mode 100644 index 8cd25748ff..0000000000 --- a/old_tests/tests/lean/let_elim_issue.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -hello -world -from Lean diff --git a/old_tests/tests/lean/lift_coe_off.lean b/old_tests/tests/lean/lift_coe_off.lean deleted file mode 100644 index 234d308c48..0000000000 --- a/old_tests/tests/lean/lift_coe_off.lean +++ /dev/null @@ -1,15 +0,0 @@ -open nat - -inductive tree (A : Type) -| leaf : A → tree -| node : tree → tree → tree - --- set_option elaborator.lift_coercions false - -definition size {A : Type} (t : tree A) :nat:= -tree.rec (λ a, 1) (λ t₁ t₂ n₁ n₂, n₁ + n₂) t - ---set_option elaborator.lift_coercions true - -definition size2 {A : Type} (t : tree A) :nat:= -tree.rec (λ a, 1) (λ t₁ t₂ n₁ n₂, n₁ + n₂) t diff --git a/old_tests/tests/lean/lift_coe_off.lean.expected.out b/old_tests/tests/lean/lift_coe_off.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/list_monad1.lean b/old_tests/tests/lean/list_monad1.lean deleted file mode 100644 index 96d961dccb..0000000000 --- a/old_tests/tests/lean/list_monad1.lean +++ /dev/null @@ -1,7 +0,0 @@ -#eval -(do { - a : nat ← [1, 2, 3, 4], - b : nat ← [4, 5, 6], - (guard $ 2 * a ≥ b : list unit), - (guard $ b < 6 : list unit), - return (a, b) } : list (nat × nat) ) diff --git a/old_tests/tests/lean/list_monad1.lean.expected.out b/old_tests/tests/lean/list_monad1.lean.expected.out deleted file mode 100644 index 627b028035..0000000000 --- a/old_tests/tests/lean/list_monad1.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -[(2, 4), (3, 4), (3, 5), (4, 4), (4, 5)] diff --git a/old_tests/tests/lean/local_notation_bug2.lean b/old_tests/tests/lean/local_notation_bug2.lean deleted file mode 100644 index e356619108..0000000000 --- a/old_tests/tests/lean/local_notation_bug2.lean +++ /dev/null @@ -1,7 +0,0 @@ -open nat -section -parameters (b : ℕ) -definition add_b (n : ℕ) := n + b -local postfix `%%`:max := add_b -end -#reduce 5%% -- Error, unexpected token diff --git a/old_tests/tests/lean/local_notation_bug2.lean.expected.out b/old_tests/tests/lean/local_notation_bug2.lean.expected.out deleted file mode 100644 index c655074d23..0000000000 --- a/old_tests/tests/lean/local_notation_bug2.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -local_notation_bug2.lean:7:9: error: invalid antiquotation, occurs outside of quoted expressions -local_notation_bug2.lean:7:8: error: function expected at - 5 -term has type - ?m_1 -⁇ diff --git a/old_tests/tests/lean/local_ref_bugs.lean b/old_tests/tests/lean/local_ref_bugs.lean deleted file mode 100644 index 613504d744..0000000000 --- a/old_tests/tests/lean/local_ref_bugs.lean +++ /dev/null @@ -1,47 +0,0 @@ -set_option pp.all true - -section -parameter α : Type -inductive foo : Type | a : α → foo | b -#check (foo.b : foo) -open foo -#check (foo.b : foo) -#check (b : foo) - -open tactic -include α -example : true := -by do - e ← to_expr ```(b), - t ← infer_type e, - trace "-------", - trace e, - trace t, - trace "-------", - triv - -def ex : foo := begin trace_state, exact b end - -end - -namespace bla -section -parameter α : Type -inductive foo : Type | a : α → foo | b -#check (foo.b : foo) -open foo -#check (foo.b : foo) -#check (b : foo) -end -end bla - -namespace boo -section -parameter α : Type -inductive foo : Type | a : α → foo | b -#check (foo.b : foo) -open foo (b) -#check (foo.b : foo) -#check (b : foo) -end -end boo diff --git a/old_tests/tests/lean/local_ref_bugs.lean.expected.out b/old_tests/tests/lean/local_ref_bugs.lean.expected.out deleted file mode 100644 index c8338fd143..0000000000 --- a/old_tests/tests/lean/local_ref_bugs.lean.expected.out +++ /dev/null @@ -1,15 +0,0 @@ -foo.b : foo -foo.b : foo -foo.b : foo -------- -foo.b -foo -------- -α : Type -⊢ foo -bla.foo.b : bla.foo -bla.foo.b : bla.foo -bla.foo.b : bla.foo -boo.foo.b : boo.foo -boo.foo.b : boo.foo -boo.foo.b : boo.foo diff --git a/old_tests/tests/lean/long_term.lean b/old_tests/tests/lean/long_term.lean deleted file mode 100644 index ba8e2844de..0000000000 --- a/old_tests/tests/lean/long_term.lean +++ /dev/null @@ -1,18 +0,0 @@ -def long_term := -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1) = -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1)+ -(1+1+1+1+1+1+1+1+1) - -#print long_term diff --git a/old_tests/tests/lean/long_term.lean.expected.out b/old_tests/tests/lean/long_term.lean.expected.out deleted file mode 100644 index b7dbb7b806..0000000000 --- a/old_tests/tests/lean/long_term.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -def long_term : Prop := -1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) = - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) + - (1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1) diff --git a/old_tests/tests/lean/macro_args.lean b/old_tests/tests/lean/macro_args.lean deleted file mode 100644 index ca575552ee..0000000000 --- a/old_tests/tests/lean/macro_args.lean +++ /dev/null @@ -1 +0,0 @@ -#eval to_string $ ``({pos . line := has_zero.zero, col := 1}).to_raw_fmt diff --git a/old_tests/tests/lean/macro_args.lean.expected.out b/old_tests/tests/lean/macro_args.lean.expected.out deleted file mode 100644 index 60bb57c228..0000000000 --- a/old_tests/tests/lean/macro_args.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -"[macro structure instance (const has_zero.zero []) [macro prenum]]" diff --git a/old_tests/tests/lean/match_at_type.lean b/old_tests/tests/lean/match_at_type.lean deleted file mode 100644 index 4d147e63cc..0000000000 --- a/old_tests/tests/lean/match_at_type.lean +++ /dev/null @@ -1,14 +0,0 @@ -constant Foo : ((Σu:nat, nat) → nat) → Prop -constant Foo2 : ((Σu:nat, nat) → nat) → Prop - -noncomputable instance : decidable (Foo (λ ⟨a, b⟩, a)) := -- ERROR -sorry - -instance I1 : decidable (Foo (λ ⟨a, b⟩, a)) := -sorry - -instance I2 : decidable (Foo2 (λ ⟨a, b⟩, a)) := -sorry - -def test (f : ((Σu:nat, nat) → nat) → nat) : f (λ ⟨a, b⟩, a) = f (λ⟨a, b⟩, a) := -eq.refl (f ((λ ⟨a, b⟩, a : (Σu:nat, nat) → nat))) diff --git a/old_tests/tests/lean/match_at_type.lean.expected.out b/old_tests/tests/lean/match_at_type.lean.expected.out deleted file mode 100644 index 2f6f4e5a63..0000000000 --- a/old_tests/tests/lean/match_at_type.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -match_at_type.lean:4:23: error: invalid instance, pattern matching cannot be used in the type of anonymous instance declarations -match_at_type.lean:7:0: warning: declaration 'I1' uses sorry -match_at_type.lean:10:0: warning: declaration 'I2' uses sorry diff --git a/old_tests/tests/lean/match_bug.lean b/old_tests/tests/lean/match_bug.lean deleted file mode 100644 index 4d9b73be18..0000000000 --- a/old_tests/tests/lean/match_bug.lean +++ /dev/null @@ -1,3 +0,0 @@ -definition foo : nat -> nat := fun x, -match x with -| bar -> bar diff --git a/old_tests/tests/lean/match_bug.lean.expected.out b/old_tests/tests/lean/match_bug.lean.expected.out deleted file mode 100644 index 0f874c1a77..0000000000 --- a/old_tests/tests/lean/match_bug.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -match_bug.lean:3:6: error: invalid pattern, must be an application, constant, variable, type ascription, aliasing pattern or inaccessible term -match_bug.lean:3:12: error: invalid 'match' expression, ':=' expected -match_bug.lean:2:0: error: equation compiler failed (use 'set_option trace.eqn_compiler.elim_match true' for additional details) diff --git a/old_tests/tests/lean/match_convoy_infer_type_failure.lean b/old_tests/tests/lean/match_convoy_infer_type_failure.lean deleted file mode 100644 index ffc6cb848a..0000000000 --- a/old_tests/tests/lean/match_convoy_infer_type_failure.lean +++ /dev/null @@ -1,7 +0,0 @@ -constant p : nat → Type -constant q : p 1 → Prop - -lemma ex : ∀ a : p 1, q a := -match q, p with -| q, p := sorry -end diff --git a/old_tests/tests/lean/match_convoy_infer_type_failure.lean.expected.out b/old_tests/tests/lean/match_convoy_infer_type_failure.lean.expected.out deleted file mode 100644 index b61cc7bc93..0000000000 --- a/old_tests/tests/lean/match_convoy_infer_type_failure.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -match_convoy_infer_type_failure.lean:5:0: error: invalid match/convoy expression, user did not provide type for the expression, lean tried to infer one using expected type information, but result is not type correct -nested exception message: -check failed, application type mismatch (use 'set_option trace.check true' for additional details) diff --git a/old_tests/tests/lean/meta_equation_pos.lean b/old_tests/tests/lean/meta_equation_pos.lean deleted file mode 100644 index 97c4937e19..0000000000 --- a/old_tests/tests/lean/meta_equation_pos.lean +++ /dev/null @@ -1,4 +0,0 @@ -meta def f (x : nat) : nat := -tt -- type error should be reported here - -#check nat diff --git a/old_tests/tests/lean/meta_equation_pos.lean.expected.out b/old_tests/tests/lean/meta_equation_pos.lean.expected.out deleted file mode 100644 index f8893f93ae..0000000000 --- a/old_tests/tests/lean/meta_equation_pos.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -meta_equation_pos.lean:2:0: error: equation type mismatch, term - tt -has type - bool -but is expected to have type - ℕ -ℕ : Type diff --git a/old_tests/tests/lean/meta_wf_error.lean b/old_tests/tests/lean/meta_wf_error.lean deleted file mode 100644 index 944c4b8c14..0000000000 --- a/old_tests/tests/lean/meta_wf_error.lean +++ /dev/null @@ -1,8 +0,0 @@ -meta def Div : nat → nat → nat -| x y := - if h : 0 < y ∧ y ≤ x - then - have x - y < x, from nat.sub_lt (nat.lt_of_lt_of_le h.left h.right) h.left, - Div (x - y) y + 1 - else 0 -using_well_founded {} diff --git a/old_tests/tests/lean/meta_wf_error.lean.expected.out b/old_tests/tests/lean/meta_wf_error.lean.expected.out deleted file mode 100644 index b6a769cd22..0000000000 --- a/old_tests/tests/lean/meta_wf_error.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -meta_wf_error.lean:1:9: error: invalid use of 'using_well_founded', we do not need to use well founded recursion for meta definitions, since they can use unbounded recursion diff --git a/old_tests/tests/lean/minimize_errors.lean b/old_tests/tests/lean/minimize_errors.lean deleted file mode 100644 index 9d8674e514..0000000000 --- a/old_tests/tests/lean/minimize_errors.lean +++ /dev/null @@ -1,16 +0,0 @@ -def f : nat → nat → nat := -λ a, a - -#check f - -def g : nat → nat → nat := -f - -#check g - -#print g - -def h : nat → nat → nat -| x y := g x y + f y x - -#print h diff --git a/old_tests/tests/lean/minimize_errors.lean.expected.out b/old_tests/tests/lean/minimize_errors.lean.expected.out deleted file mode 100644 index 719a24ad20..0000000000 --- a/old_tests/tests/lean/minimize_errors.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -minimize_errors.lean:2:0: error: type mismatch, term - λ (a : ℕ), a -has type - ℕ → ℕ -but is expected to have type - ℕ → ℕ → ℕ -f : ℕ → ℕ → ℕ -g : ℕ → ℕ → ℕ -def g : ℕ → ℕ → ℕ := -f -def h : ℕ → ℕ → ℕ := -h._main diff --git a/old_tests/tests/lean/missing_import.lean b/old_tests/tests/lean/missing_import.lean deleted file mode 100644 index 41d0e8b909..0000000000 --- a/old_tests/tests/lean/missing_import.lean +++ /dev/null @@ -1,3 +0,0 @@ -import does.not.exist data.buffer - -#print buffer diff --git a/old_tests/tests/lean/missing_import.lean.expected.out b/old_tests/tests/lean/missing_import.lean.expected.out deleted file mode 100644 index 88a9e0fd4e..0000000000 --- a/old_tests/tests/lean/missing_import.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -missing_import.lean:1:0: error: file 'does/not/exist' not found in the LEAN_PATH -missing_import.lean:1:0: error: invalid import: does.not.exist -could not resolve import: does.not.exist -def buffer : Type u → Type u := -λ (α : Type u), Σ (n : ℕ), array n α diff --git a/old_tests/tests/lean/mk_constructor_fresh_names.lean b/old_tests/tests/lean/mk_constructor_fresh_names.lean deleted file mode 100644 index dc0f50c5e8..0000000000 --- a/old_tests/tests/lean/mk_constructor_fresh_names.lean +++ /dev/null @@ -1,24 +0,0 @@ -open tactic - -example (fst fst_1 : nat) : fst = fst := -by do - ns ← mk_constructors_fresh_names `prod, - trace ns, -- [[fst_2, snd]] - constructor - -example (h : nat) : h = h := -by do - ns ← mk_constructors_fresh_names `acc, - trace ns, -- [[x, a_1] - constructor - -inductive Foo -| mk₁ (a b c : nat) : Foo -| mk₂ (d e : bool) : Foo -| mk₃ (f g : Foo) : Foo - -example (a d d_1 e : bool) : a = a := -by do - ns ← mk_constructors_fresh_names `Foo, - trace ns, -- [[a_1, b, c], [d_2, e_1], [f, g]] - constructor diff --git a/old_tests/tests/lean/mk_constructor_fresh_names.lean.expected.out b/old_tests/tests/lean/mk_constructor_fresh_names.lean.expected.out deleted file mode 100644 index 9dbaef0165..0000000000 --- a/old_tests/tests/lean/mk_constructor_fresh_names.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -[[fst_2, snd]] -[[x, h_1]] -[[a_1, b, c], [d_2, e_1], [f, g]] diff --git a/old_tests/tests/lean/namespace_bug.lean b/old_tests/tests/lean/namespace_bug.lean deleted file mode 100644 index 2209c4f480..0000000000 --- a/old_tests/tests/lean/namespace_bug.lean +++ /dev/null @@ -1,5 +0,0 @@ -namespace playground -namespace nat -#check 2+3 -end nat -end playground diff --git a/old_tests/tests/lean/namespace_bug.lean.expected.out b/old_tests/tests/lean/namespace_bug.lean.expected.out deleted file mode 100644 index 981de9ea5a..0000000000 --- a/old_tests/tests/lean/namespace_bug.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -2 + 3 : ℕ diff --git a/old_tests/tests/lean/nary_overload.lean b/old_tests/tests/lean/nary_overload.lean deleted file mode 100644 index 01e0f0766f..0000000000 --- a/old_tests/tests/lean/nary_overload.lean +++ /dev/null @@ -1,21 +0,0 @@ -prelude - -constant {l} vec : Type l → Type l -constant {l} lst : Type l → Type l -constant vec.nil {A : Type} : vec A -constant lst.nil {A : Type} : lst A -constant vec.cons {A : Type} : A → vec A → vec A -constant lst.cons {A : Type} : A → lst A → lst A - -notation `[` l:(foldr `, ` (h t, vec.cons h t) vec.nil `]`) := l -notation `[` l:(foldr `, ` (h t, lst.cons h t) lst.nil `]`) := l - -constant A : Type -variables a b c : A - -#check [a, b, c] -#check ([a, b, c] : vec A) -#check ([a, b, c] : lst A) -set_option pp.all true -#check ([a, b, c] : vec A) -#check ([a, b, c] : lst A) diff --git a/old_tests/tests/lean/nary_overload.lean.expected.out b/old_tests/tests/lean/nary_overload.lean.expected.out deleted file mode 100644 index 4b93f917fa..0000000000 --- a/old_tests/tests/lean/nary_overload.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -nary_overload.lean:16:7: error: ambiguous overload, possible interpretations - [a, b, c] - [a, b, c] -Additional information: -nary_overload.lean:16:7: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -[a, b, c] : vec A -[a, b, c] : lst A -@vec.cons A a (@vec.cons A b (@vec.cons A c (@vec.nil A))) : vec.{0} A -@lst.cons A a (@lst.cons A b (@lst.cons A c (@lst.nil A))) : lst.{0} A diff --git a/old_tests/tests/lean/nat_add_assoc_no_axioms.lean b/old_tests/tests/lean/nat_add_assoc_no_axioms.lean deleted file mode 100644 index 1ea67e4f1b..0000000000 --- a/old_tests/tests/lean/nat_add_assoc_no_axioms.lean +++ /dev/null @@ -1 +0,0 @@ -#print axioms nat.add_assoc diff --git a/old_tests/tests/lean/nat_add_assoc_no_axioms.lean.expected.out b/old_tests/tests/lean/nat_add_assoc_no_axioms.lean.expected.out deleted file mode 100644 index e62ea10480..0000000000 --- a/old_tests/tests/lean/nat_add_assoc_no_axioms.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -no axioms diff --git a/old_tests/tests/lean/nat_pp.lean b/old_tests/tests/lean/nat_pp.lean deleted file mode 100644 index 010698c334..0000000000 --- a/old_tests/tests/lean/nat_pp.lean +++ /dev/null @@ -1,4 +0,0 @@ -#reduce nat.add 3 6 -open nat -#reduce nat.add 3 6 -#reduce (3:nat) + 6 diff --git a/old_tests/tests/lean/nat_pp.lean.expected.out b/old_tests/tests/lean/nat_pp.lean.expected.out deleted file mode 100644 index 07d39ab342..0000000000 --- a/old_tests/tests/lean/nat_pp.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -9 -9 -9 diff --git a/old_tests/tests/lean/native_run/.gitignore b/old_tests/tests/lean/native_run/.gitignore deleted file mode 100644 index 3800da35d8..0000000000 --- a/old_tests/tests/lean/native_run/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.dSYM -*.cpp diff --git a/old_tests/tests/lean/native_run/config.lean b/old_tests/tests/lean/native_run/config.lean deleted file mode 100644 index e900c86a6d..0000000000 --- a/old_tests/tests/lean/native_run/config.lean +++ /dev/null @@ -1,4 +0,0 @@ --- set_option default configuration for tests -prelude -set_option pp.colors false -set_option pp.unicode true diff --git a/old_tests/tests/lean/native_run/hello_world.lean b/old_tests/tests/lean/native_run/hello_world.lean deleted file mode 100644 index 6986a54ceb..0000000000 --- a/old_tests/tests/lean/native_run/hello_world.lean +++ /dev/null @@ -1,4 +0,0 @@ -import system.IO - -definition main : IO unit := - put_str "Hello Lean!\n" diff --git a/old_tests/tests/lean/native_run/hello_world.lean.expected.out b/old_tests/tests/lean/native_run/hello_world.lean.expected.out deleted file mode 100644 index 203765ffc5..0000000000 --- a/old_tests/tests/lean/native_run/hello_world.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -Hello Lean! diff --git a/old_tests/tests/lean/native_run/test_single.sh b/old_tests/tests/lean/native_run/test_single.sh deleted file mode 100755 index f1e46bd3f9..0000000000 --- a/old_tests/tests/lean/native_run/test_single.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 3 -a $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file] [yes/no]?" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 - -export LEAN_PATH=../../../library:. -export HLEAN_PATH=../../../hott:. -export LIBRARY=../../../build/debug -export INCLUDE=../../../src - -if [ $# -ne 3 ]; then - INTERACTIVE=no -else - INTERACTIVE=$3 -fi -f=$2 - -if [ ${f: -6} == ".hlean" ]; then - CONFIG="config.hlean" -else - CONFIG="config.lean" -fi - -echo "-- testing $f" -"$LEAN" --compile $CONFIG "$f" -D native.library_path="$LIBRARY" -D native.include_path="$INCLUDE" &> "$f.compile.out" -# Currently we always produce a file named a.out, it looks like the first command isn't running -# and then it crashes when it can't find a.out -./a.out &> "$f.produced.out.1" -sed "/warning: imported file uses 'sorry'/d" "$f.produced.out.1" | sed "/warning: using 'sorry'/d" > "$f.produced.out" -rm -f "$f.produced.out.1" -rm -f "$f.compile.out" -rm -f a.out - -if test -f "$f.expected.out"; then - if diff --ignore-all-space -I "executing external script" "$f.produced.out" "$f.expected.out"; then - echo "-- checked" - exit 0 - else - echo "ERROR: file $f.produced.out does not match $f.expected.out" - if [ $INTERACTIVE == "yes" ]; then - meld "$f.produced.out" "$f.expected.out" - if diff -I "executing external script" "$f.produced.out" "$f.expected.out"; then - echo "-- mismath was fixed" - fi - else - diff --ignore-all-space -I "executing external script" "$f.produced.out" "$f.expected.out" - fi - exit 1 - fi -else - echo "ERROR: file $f.expected.out does not exist" - if [ $INTERACTIVE == "yes" ]; then - read -p "copy $f.produced.out (y/n)? " - if [ $REPLY == "y" ]; then - cp -- "$f.produced.out" "$f.expected.out" - echo "-- copied $f.produced.out --> $f.expected.out" - fi - fi - exit 1 -fi diff --git a/old_tests/tests/lean/nested_errors.lean b/old_tests/tests/lean/nested_errors.lean deleted file mode 100644 index 6b5046ad65..0000000000 --- a/old_tests/tests/lean/nested_errors.lean +++ /dev/null @@ -1,8 +0,0 @@ -example (a b c : nat) : a = b → c = b → a = c ∧ b = c := -begin - intros, - split, - try {intro}, -- Should not report the error here - repeat {intro}, -- Should not report the error here - abstract { intro, } -- Should report the error in intro tactic -end diff --git a/old_tests/tests/lean/nested_errors.lean.expected.out b/old_tests/tests/lean/nested_errors.lean.expected.out deleted file mode 100644 index 7ee5fa38c1..0000000000 --- a/old_tests/tests/lean/nested_errors.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -nested_errors.lean:7:13: error: intro tactic failed, Pi/let expression expected -state: -a b c : ℕ, -a_1 : a = b, -a_2 : c = b -⊢ a = c diff --git a/old_tests/tests/lean/nested_match.lean b/old_tests/tests/lean/nested_match.lean deleted file mode 100644 index fe951a969d..0000000000 --- a/old_tests/tests/lean/nested_match.lean +++ /dev/null @@ -1,30 +0,0 @@ -namespace ex1 - -def f : ℕ → ℕ -| n := - (match n with - | 0 := 0 - | (m+1) := f m - end) + 1 - -def g : ℕ → ℕ -| n := - (match n, rfl : ∀ m, m = n → ℕ with - | 0, h := 0 - | (m+1), h := - have m < n, begin rw [←h], apply nat.lt_succ_self end, - g m - end) + 1 - -end ex1 - -namespace ex2 - -mutual def f, g -with f : ℕ → ℕ -| n := g n + 1 -with g : ℕ → ℕ -| 0 := 0 -| (n+1) := f n - -end ex2 diff --git a/old_tests/tests/lean/nested_match.lean.expected.out b/old_tests/tests/lean/nested_match.lean.expected.out deleted file mode 100644 index 85a6827e0c..0000000000 --- a/old_tests/tests/lean/nested_match.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -nested_match.lean:7:13: error: failed to prove recursive application is decreasing, well founded relation - @has_well_founded.r ℕ (@has_well_founded_of_has_sizeof ℕ nat.has_sizeof) -Possible solutions: - - Use 'using_well_founded' keyword in the end of your definition to specify tactics for synthesizing well founded relations and decreasing proofs. - - The default decreasing tactic uses the 'assumption' tactic, thus hints (aka local proofs) can be provided using 'have'-expressions. -The nested exception contains the failure state for the decreasing tactic. -nested exception message: -failed -state: -f : ℕ → ℕ, -n m : ℕ -⊢ m < n -nested_match.lean:25:7: error: failed to prove recursive application is decreasing, well founded relation - @has_well_founded.r (psum ℕ ℕ) - (@has_well_founded_of_has_sizeof (psum ℕ ℕ) (@psum.has_sizeof ℕ ℕ nat.has_sizeof nat.has_sizeof)) -Possible solutions: - - Use 'using_well_founded' keyword in the end of your definition to specify tactics for synthesizing well founded relations and decreasing proofs. - - The default decreasing tactic uses the 'assumption' tactic, thus hints (aka local proofs) can be provided using 'have'-expressions. -The nested exception contains the failure state for the decreasing tactic. -nested exception message: -failed -state: -n : ℕ -⊢ 1 < 1 diff --git a/old_tests/tests/lean/no_coe.lean b/old_tests/tests/lean/no_coe.lean deleted file mode 100644 index cca344d3e6..0000000000 --- a/old_tests/tests/lean/no_coe.lean +++ /dev/null @@ -1,5 +0,0 @@ -#check if tt then 1 else 0 - -set_option elaborator.coercions false - -#check if tt then 1 else 0 -- Error coercions are disabled diff --git a/old_tests/tests/lean/no_coe.lean.expected.out b/old_tests/tests/lean/no_coe.lean.expected.out deleted file mode 100644 index d6cc003bd8..0000000000 --- a/old_tests/tests/lean/no_coe.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -ite ↥tt 1 0 : ℕ -no_coe.lean:5:7: error: type mismatch at application - ite tt -term - tt -has type - bool -but is expected to have type - Prop diff --git a/old_tests/tests/lean/no_confusion_type.lean b/old_tests/tests/lean/no_confusion_type.lean deleted file mode 100644 index cbcfeae1b9..0000000000 --- a/old_tests/tests/lean/no_confusion_type.lean +++ /dev/null @@ -1,13 +0,0 @@ -namespace Ex -open nat - -inductive vector (A : Type) : nat → Type -| vnil : vector nat.zero -| vcons : Π {n : nat}, A → vector n → vector (succ n) - -#check vector.no_confusion_type -constants a1 a2 : nat -constants v1 v2 : vector nat 2 -constant P : Type -#reduce vector.no_confusion_type P (vector.vcons a1 v1) (vector.vcons a2 v2) -end Ex diff --git a/old_tests/tests/lean/no_confusion_type.lean.expected.out b/old_tests/tests/lean/no_confusion_type.lean.expected.out deleted file mode 100644 index 089ba2260f..0000000000 --- a/old_tests/tests/lean/no_confusion_type.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -vector.no_confusion_type : Sort u_1 → vector ?M_1 ?M_2 → vector ?M_1 ?M_2 → Sort u_1 -(2 = 2 → a1 = a2 → v1 == v2 → P) → P diff --git a/old_tests/tests/lean/no_eqn_lemma_for_meta_default.lean b/old_tests/tests/lean/no_eqn_lemma_for_meta_default.lean deleted file mode 100644 index 54e0ac2d74..0000000000 --- a/old_tests/tests/lean/no_eqn_lemma_for_meta_default.lean +++ /dev/null @@ -1,4 +0,0 @@ -meta structure foo := -(x := 10) - -#print prefix foo.x._default diff --git a/old_tests/tests/lean/no_eqn_lemma_for_meta_default.lean.expected.out b/old_tests/tests/lean/no_eqn_lemma_for_meta_default.lean.expected.out deleted file mode 100644 index 24e732cf72..0000000000 --- a/old_tests/tests/lean/no_eqn_lemma_for_meta_default.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -foo.x._default : ℕ diff --git a/old_tests/tests/lean/no_meta_rec_inst.lean b/old_tests/tests/lean/no_meta_rec_inst.lean deleted file mode 100644 index 83a57b73e0..0000000000 --- a/old_tests/tests/lean/no_meta_rec_inst.lean +++ /dev/null @@ -1,5 +0,0 @@ -class has_false (α : Type) := -(f : false) - -meta def n_has_false : has_false ℕ := -by apply_instance -- Error, the "recursive" instance (n_has_false : has_false ℕ) should not be used in type class resolution diff --git a/old_tests/tests/lean/no_meta_rec_inst.lean.expected.out b/old_tests/tests/lean/no_meta_rec_inst.lean.expected.out deleted file mode 100644 index befcbb3fb6..0000000000 --- a/old_tests/tests/lean/no_meta_rec_inst.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -no_meta_rec_inst.lean:5:3: error: tactic.mk_instance failed to generate instance for - has_false ℕ -state: -n_has_false : has_false ℕ -⊢ has_false ℕ diff --git a/old_tests/tests/lean/non_exhaustive_error.lean b/old_tests/tests/lean/non_exhaustive_error.lean deleted file mode 100644 index 6a0622b786..0000000000 --- a/old_tests/tests/lean/non_exhaustive_error.lean +++ /dev/null @@ -1,42 +0,0 @@ --- -def g : ℕ × ℕ → ℕ -| (0, n) := n -| (m+2, 0) := m - -definition f : string → nat → bool -| "hello world" 1 := tt -| "bye" _ := tt - -def foo (y : ℕ) : ℕ → ℕ → ℕ -| 0 a := a -| (x+1) 0 := 3 + foo x 10 -| (x+1) (n+2) := 42 - -namespace other - -mutual def f, g -with f : nat → nat → nat -| 0 0 := 1 -with g : nat → nat → nat -| 0 0 := 1 - -end other - -inductive term | mk : ℕ → list term → term - -def const_name : term → ℕ -| (term.mk n []) := n - -namespace other2 -def f : nat → nat -| 1000 := 1 - -def g : string → nat -| "hello" := 0 - -meta def h : name → nat -| `eq := 0 - -def r : int → nat -| -1000 := 0 -end other2 diff --git a/old_tests/tests/lean/non_exhaustive_error.lean.expected.out b/old_tests/tests/lean/non_exhaustive_error.lean.expected.out deleted file mode 100644 index e7784b91f3..0000000000 --- a/old_tests/tests/lean/non_exhaustive_error.lean.expected.out +++ /dev/null @@ -1,31 +0,0 @@ -non_exhaustive_error.lean:2:4: error: non-exhaustive match, the following cases are missing: -g (1, _) -g (nat.succ (nat.succ _), _) -non_exhaustive_error.lean:2:0: warning: declaration 'g' uses sorry -non_exhaustive_error.lean:6:11: error: non-exhaustive match, the following cases are missing: -f "hello world" _ -f _ _ -non_exhaustive_error.lean:6:0: warning: declaration 'f' uses sorry -non_exhaustive_error.lean:10:4: error: non-exhaustive match, the following cases are missing: -foo (nat.succ _) 1 -non_exhaustive_error.lean:10:0: warning: declaration 'foo' uses sorry -non_exhaustive_error.lean:17:11: error: non-exhaustive match, the following cases are missing: -f 0 (nat.succ _) -f (nat.succ _) _ -g 0 (nat.succ _) -g (nat.succ _) _ -non_exhaustive_error.lean:17:0: warning: declaration 'f.g' uses sorry -non_exhaustive_error.lean:27:4: error: non-exhaustive match, the following cases are missing: -const_name (_nest_1_1._nest_1_1.term._mut_.mk_0 _ (term.pack_0_1 (_nest_1_1._nest_1_1.term._mut_.mk_0 _ _ :: _))) -non_exhaustive_error.lean:27:0: warning: declaration 'const_name' uses sorry -non_exhaustive_error.lean:31:4: error: non-exhaustive match, the following cases are missing: -f _ -non_exhaustive_error.lean:31:0: warning: declaration 'other2.f' uses sorry -non_exhaustive_error.lean:34:4: error: non-exhaustive match, the following cases are missing: -g _ -non_exhaustive_error.lean:34:0: warning: declaration 'other2.g' uses sorry -non_exhaustive_error.lean:37:9: error: non-exhaustive match, the following cases are missing: -h _ -non_exhaustive_error.lean:40:4: error: non-exhaustive match, the following cases are missing: -r _ -non_exhaustive_error.lean:40:0: warning: declaration 'other2.r' uses sorry diff --git a/old_tests/tests/lean/non_meta_rec_fn.lean b/old_tests/tests/lean/non_meta_rec_fn.lean deleted file mode 100644 index dcdbf0ff24..0000000000 --- a/old_tests/tests/lean/non_meta_rec_fn.lean +++ /dev/null @@ -1,5 +0,0 @@ -lemma main : false := -begin -have helper : true → false := λ ⟨⟩, _fun_match _x, -exact helper ⟨⟩ -end \ No newline at end of file diff --git a/old_tests/tests/lean/non_meta_rec_fn.lean.expected.out b/old_tests/tests/lean/non_meta_rec_fn.lean.expected.out deleted file mode 100644 index 4b7f4fd4a8..0000000000 --- a/old_tests/tests/lean/non_meta_rec_fn.lean.expected.out +++ /dev/null @@ -1,16 +0,0 @@ -non_meta_rec_fn.lean:3:36: error: failed to prove recursive application is decreasing, well founded relation - @has_well_founded.r true (@has_well_founded_of_has_sizeof true (default_has_sizeof true)) -Possible solutions: - - Use 'using_well_founded' keyword in the end of your definition to specify tactics for synthesizing well founded relations and decreasing proofs. - - The default decreasing tactic uses the 'assumption' tactic, thus hints (aka local proofs) can be provided using 'have'-expressions. -The nested exception contains the failure state for the decreasing tactic. -nested exception message: -invalid apply tactic, failed to unify - 0 < 0 -with - ?m_1 < ?m_1 + ?m_2 -state: -_x : true -⊢ 0 < 0 -state: -⊢ false diff --git a/old_tests/tests/lean/noncomp.lean b/old_tests/tests/lean/noncomp.lean deleted file mode 100644 index 162d670aa1..0000000000 --- a/old_tests/tests/lean/noncomp.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat - -axiom n : nat - -definition f (x : nat) := -- Error this is not computable -x + n - -noncomputable definition g (x : nat) := x + n diff --git a/old_tests/tests/lean/noncomp.lean.expected.out b/old_tests/tests/lean/noncomp.lean.expected.out deleted file mode 100644 index f1551d5720..0000000000 --- a/old_tests/tests/lean/noncomp.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -noncomp.lean:5:11: error: definition 'f' is noncomputable, it depends on 'n' diff --git a/old_tests/tests/lean/noncomp_error.lean b/old_tests/tests/lean/noncomp_error.lean deleted file mode 100644 index c80134c9b8..0000000000 --- a/old_tests/tests/lean/noncomp_error.lean +++ /dev/null @@ -1 +0,0 @@ -noncomputable definition a :nat := 2 diff --git a/old_tests/tests/lean/noncomp_error.lean.expected.out b/old_tests/tests/lean/noncomp_error.lean.expected.out deleted file mode 100644 index e5d9d19aaf..0000000000 --- a/old_tests/tests/lean/noncomp_error.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -noncomp_error.lean:1:25: warning: definition 'a' was incorrectly marked as noncomputable diff --git a/old_tests/tests/lean/noncomp_thm.lean b/old_tests/tests/lean/noncomp_thm.lean deleted file mode 100644 index d31bf82c75..0000000000 --- a/old_tests/tests/lean/noncomp_thm.lean +++ /dev/null @@ -1 +0,0 @@ -noncomputable theorem foo : true := trivial diff --git a/old_tests/tests/lean/noncomp_thm.lean.expected.out b/old_tests/tests/lean/noncomp_thm.lean.expected.out deleted file mode 100644 index 0cfbc17ccd..0000000000 --- a/old_tests/tests/lean/noncomp_thm.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -noncomp_thm.lean:1:22: warning: definition 'foo' was incorrectly marked as noncomputable diff --git a/old_tests/tests/lean/noncomputable_bytecode_issue.lean b/old_tests/tests/lean/noncomputable_bytecode_issue.lean deleted file mode 100644 index 163e996fb7..0000000000 --- a/old_tests/tests/lean/noncomputable_bytecode_issue.lean +++ /dev/null @@ -1,8 +0,0 @@ -constant a : nat - -meta def ex : tactic expr := -return `(a) - -open tactic - -run_cmd ex >> return () diff --git a/old_tests/tests/lean/noncomputable_bytecode_issue.lean.expected.out b/old_tests/tests/lean/noncomputable_bytecode_issue.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/notation.lean b/old_tests/tests/lean/notation.lean deleted file mode 100644 index 31f082e1d6..0000000000 --- a/old_tests/tests/lean/notation.lean +++ /dev/null @@ -1,17 +0,0 @@ --- -constant b : nat -#check b + b + b -#check true ∧ false ∧ true -#check (true ∧ false) ∧ true -#check (2:nat) + (2 + 2) -#check (2 + 2) + (2:nat) -#check (1:nat) = (2 + 3)*2 -#check (2:nat) + 3 * 2 = 3 * 2 + 2 -#check (true ∨ false) = (true ∨ false) ∧ true -#check true ∧ (false ∨ true) -constant A : Type -constant a : A -notation 1 := a -#check a -open nat -#check ℕ → ℕ diff --git a/old_tests/tests/lean/notation.lean.expected.out b/old_tests/tests/lean/notation.lean.expected.out deleted file mode 100644 index 2bcb28e890..0000000000 --- a/old_tests/tests/lean/notation.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -b + b + b : ℕ -true ∧ false ∧ true : Prop -(true ∧ false) ∧ true : Prop -2 + (2 + 2) : ℕ -2 + 2 + 2 : ℕ -1 = (2 + 3) * 2 : Prop -2 + 3 * 2 = 3 * 2 + 2 : Prop -(true ∨ false) = (true ∨ false) ∧ true : Prop -true ∧ (false ∨ true) : Prop -1 : A -ℕ → ℕ : Type diff --git a/old_tests/tests/lean/notation2.lean b/old_tests/tests/lean/notation2.lean deleted file mode 100644 index f645a9923c..0000000000 --- a/old_tests/tests/lean/notation2.lean +++ /dev/null @@ -1,6 +0,0 @@ --- -inductive List (T : Type) : Type | nil {} : List | cons : T → List → List open List notation h :: t := cons h t notation `[` l:(foldr `,` (h t, cons h t) nil) `]` := l -infixr `::` := cons -#check (1:nat) :: 2 :: nil -#check (1:nat) :: 2 :: 3 :: 4 :: 5 :: nil -#print ] diff --git a/old_tests/tests/lean/notation2.lean.expected.out b/old_tests/tests/lean/notation2.lean.expected.out deleted file mode 100644 index 9cabf6cc1d..0000000000 --- a/old_tests/tests/lean/notation2.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -1::2::nil : List ℕ -1::2::3::4::5::nil : List ℕ -`[`:1024 (foldr 0 `,`) `]`:0 := #0 -`-[1+`:1024 _:1 `]`:0 := int.neg_succ_of_nat #0 -_ `^[`:1 _:1 `]`:0 := nat.iterate #1 #0 -_ `≈[`:50 _:1 `]`:0 _:50 := @strict_weak_order.equiv _ #1 #2 #0 diff --git a/old_tests/tests/lean/notation3.lean b/old_tests/tests/lean/notation3.lean deleted file mode 100644 index 5f1e6e5c37..0000000000 --- a/old_tests/tests/lean/notation3.lean +++ /dev/null @@ -1,7 +0,0 @@ --- -inductive List (T : Type) : Type | nil {} : List | cons : T → List → List open List notation h :: t := cons h t notation `[` l:(foldr `, ` (h t, cons h t) nil) `]` := l -constants a b : nat -#check [a, b, b] -#check (a, true, a = b, b) -#check (a, b) -#check [(1:nat), 2+2, 3] diff --git a/old_tests/tests/lean/notation3.lean.expected.out b/old_tests/tests/lean/notation3.lean.expected.out deleted file mode 100644 index 547b3c4c13..0000000000 --- a/old_tests/tests/lean/notation3.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -[a, b, b] : List ℕ -(a, true, a = b, b) : ℕ × Prop × Prop × ℕ -(a, b) : ℕ × ℕ -[1, 2 + 2, 3] : List ℕ diff --git a/old_tests/tests/lean/notation4.lean b/old_tests/tests/lean/notation4.lean deleted file mode 100644 index 6db2246229..0000000000 --- a/old_tests/tests/lean/notation4.lean +++ /dev/null @@ -1,7 +0,0 @@ --- -open sigma -inductive List (T : Type) : Type | nil {} : List | cons : T → List → List open List notation h :: t := cons h t notation `[` l:(foldr `,` (h t, cons h t) nil) `]` := l -#check ∃ (A : Type) (x y : A), x = y -#check ∃ (x : nat), x = 0 -#check Σ' (x : nat), x = 10 -#check Σ (A : Type), List A diff --git a/old_tests/tests/lean/notation4.lean.expected.out b/old_tests/tests/lean/notation4.lean.expected.out deleted file mode 100644 index fdfb182417..0000000000 --- a/old_tests/tests/lean/notation4.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -∃ (A : Type) (x y : A), x = y : Prop -∃ (x : ℕ), x = 0 : Prop -Σ' (x : ℕ), x = 10 : Type -Σ (A : Type), List A : Type 1 diff --git a/old_tests/tests/lean/notation5.lean b/old_tests/tests/lean/notation5.lean deleted file mode 100644 index 1e49eafb61..0000000000 --- a/old_tests/tests/lean/notation5.lean +++ /dev/null @@ -1,11 +0,0 @@ --- - -notation `((` := 1 - -precedence `(` : 30 - -notation `))` := 1 - -notation `,,` := 1 - -precedence `,` : 10 diff --git a/old_tests/tests/lean/notation5.lean.expected.out b/old_tests/tests/lean/notation5.lean.expected.out deleted file mode 100644 index b695d7e755..0000000000 --- a/old_tests/tests/lean/notation5.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -notation5.lean:3:0: error: invalid token `((`, it starts with '(' -notation5.lean:5:0: error: invalid token `(`, it starts with '(' -notation5.lean:7:0: error: invalid token `))`, it ends with ')' -notation5.lean:9:0: error: invalid token `,,`, it contains reserved character `,` -notation5.lean:11:0: error: invalid token `,`, it contains reserved character `,` diff --git a/old_tests/tests/lean/notation6.lean b/old_tests/tests/lean/notation6.lean deleted file mode 100644 index cdc8cd02d3..0000000000 --- a/old_tests/tests/lean/notation6.lean +++ /dev/null @@ -1,8 +0,0 @@ --- -notation `o` := (10:nat) -#check 11 -constant f : nat → nat -#check o + 1 -#check f o + o + o -#reduce 9 + (1:nat) -#reduce o+4 diff --git a/old_tests/tests/lean/notation6.lean.expected.out b/old_tests/tests/lean/notation6.lean.expected.out deleted file mode 100644 index 19bedec05c..0000000000 --- a/old_tests/tests/lean/notation6.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -11 : ℕ -10 + 1 : ℕ -f 10 + 10 + 10 : ℕ -10 -14 diff --git a/old_tests/tests/lean/notation7.lean b/old_tests/tests/lean/notation7.lean deleted file mode 100644 index bae7132e52..0000000000 --- a/old_tests/tests/lean/notation7.lean +++ /dev/null @@ -1,13 +0,0 @@ --- -open nat - -constant f : nat → nat -constant g : nat → nat → nat - -notation A `:+1`:100000 := f A - -#check g 0:+1:+1 (1:+1 + 2:+1):+1 - -set_option pp.notation false - -#check g 0:+1:+1 (1:+1 + 2:+1):+1 diff --git a/old_tests/tests/lean/notation7.lean.expected.out b/old_tests/tests/lean/notation7.lean.expected.out deleted file mode 100644 index 6a854d28cb..0000000000 --- a/old_tests/tests/lean/notation7.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -g 0:+1:+1 (1:+1 + 2:+1):+1 : ℕ -g (f (f 0)) (f (has_add.add (f 1) (f 2))) : nat diff --git a/old_tests/tests/lean/notation8.lean b/old_tests/tests/lean/notation8.lean deleted file mode 100644 index 35fece8715..0000000000 --- a/old_tests/tests/lean/notation8.lean +++ /dev/null @@ -1,5 +0,0 @@ -constant f : nat → nat → nat -constant g : nat → nat - -#check f (1 + g 1) $ g 2 + 2 -#check f (g 1) $ f (1 + 1) $ g 2 diff --git a/old_tests/tests/lean/notation8.lean.expected.out b/old_tests/tests/lean/notation8.lean.expected.out deleted file mode 100644 index 1d53c321e0..0000000000 --- a/old_tests/tests/lean/notation8.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -f (1 + g 1) (g 2 + 2) : ℕ -f (g 1) (f (1 + 1) (g 2)) : ℕ diff --git a/old_tests/tests/lean/notation_error_pos.lean b/old_tests/tests/lean/notation_error_pos.lean deleted file mode 100644 index 9a1394b746..0000000000 --- a/old_tests/tests/lean/notation_error_pos.lean +++ /dev/null @@ -1,12 +0,0 @@ -notation `foo` := "a" + 1 -notation `bla` a := a + 1 -notation `boo` a := 1 + a -notation `cmd` a := λ x, x + a - -#check foo - -#check bla "a" - -#check boo "a" - -#check cmd "b" diff --git a/old_tests/tests/lean/notation_error_pos.lean.expected.out b/old_tests/tests/lean/notation_error_pos.lean.expected.out deleted file mode 100644 index 899a1e590f..0000000000 --- a/old_tests/tests/lean/notation_error_pos.lean.expected.out +++ /dev/null @@ -1,19 +0,0 @@ -notation_error_pos.lean:6:7: error: failed to synthesize type class instance for -⊢ has_one string -notation_error_pos.lean:6:7: error: failed to synthesize type class instance for -⊢ has_add string -"a" + 1 : string -notation_error_pos.lean:8:7: error: failed to synthesize type class instance for -⊢ has_one string -notation_error_pos.lean:8:7: error: failed to synthesize type class instance for -⊢ has_add string -"a" + 1 : string -notation_error_pos.lean:10:7: error: failed to synthesize type class instance for -⊢ has_one string -notation_error_pos.lean:10:7: error: failed to synthesize type class instance for -⊢ has_add string -1 + "a" : string -notation_error_pos.lean:12:7: error: failed to synthesize type class instance for -x : string -⊢ has_add string -λ (x : string), x + "b" : string → string diff --git a/old_tests/tests/lean/offset_is_def_eq_trick.lean b/old_tests/tests/lean/offset_is_def_eq_trick.lean deleted file mode 100644 index 2be963cf29..0000000000 --- a/old_tests/tests/lean/offset_is_def_eq_trick.lean +++ /dev/null @@ -1,11 +0,0 @@ -universe variables u - -inductive Vec (α : Type u) : nat → Type u -| nil {} : Vec 0 -| cons : Π {n}, α → Vec n → Vec (nat.succ n) - - -def head {α} : Π {n}, Vec α (n+1) → α -| n (Vec.cons h t) := h - -#check @head.equations._eqn_1 diff --git a/old_tests/tests/lean/offset_is_def_eq_trick.lean.expected.out b/old_tests/tests/lean/offset_is_def_eq_trick.lean.expected.out deleted file mode 100644 index dda1efbaa4..0000000000 --- a/old_tests/tests/lean/offset_is_def_eq_trick.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -head.equations._eqn_1 : ∀ {α : Type u_1} (n : ℕ) (h : α) (t : Vec α n), head (Vec.cons h t) = h diff --git a/old_tests/tests/lean/omit.lean b/old_tests/tests/lean/omit.lean deleted file mode 100644 index 3e2e25393c..0000000000 --- a/old_tests/tests/lean/omit.lean +++ /dev/null @@ -1,22 +0,0 @@ -prelude section - variable A : Type - variable a : A - variable c : A - omit A - include A - include A - omit A - variable B : Type - variable b : B - variable d : B - include A - include a - include c - definition foo := b - - inductive tst (C : Type) - | mk : tst -end - -#check foo -#check tst diff --git a/old_tests/tests/lean/omit.lean.expected.out b/old_tests/tests/lean/omit.lean.expected.out deleted file mode 100644 index 892cd5e9e0..0000000000 --- a/old_tests/tests/lean/omit.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -omit.lean:5:7: error: invalid omit command, 'A' has not been included -omit.lean:7:10: error: invalid include command, 'A' has already been included -foo : Π (A : Type), A → A → Π (B : Type), B → B -tst : Π (A : Type), A → A → Type → Type diff --git a/old_tests/tests/lean/open_namespaces.lean b/old_tests/tests/lean/open_namespaces.lean deleted file mode 100644 index b62b2f6fb4..0000000000 --- a/old_tests/tests/lean/open_namespaces.lean +++ /dev/null @@ -1,5 +0,0 @@ -open nat -namespace foo -open int -run_cmd tactic.open_namespaces >>= tactic.trace -end foo diff --git a/old_tests/tests/lean/open_namespaces.lean.expected.out b/old_tests/tests/lean/open_namespaces.lean.expected.out deleted file mode 100644 index c7c578da96..0000000000 --- a/old_tests/tests/lean/open_namespaces.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -[foo, nat, int] diff --git a/old_tests/tests/lean/out_param_proj.lean b/old_tests/tests/lean/out_param_proj.lean deleted file mode 100644 index a970a314f1..0000000000 --- a/old_tests/tests/lean/out_param_proj.lean +++ /dev/null @@ -1,6 +0,0 @@ -universes u v -class module (α : out_param $ Type u) (β : Type v) [out_param $ ring α] extends add_comm_group β := -(foo : β → nat) - --- both α and `ring α` should be implicit (_not_ instance implicit) -#print module.to_add_comm_group diff --git a/old_tests/tests/lean/out_param_proj.lean.expected.out b/old_tests/tests/lean/out_param_proj.lean.expected.out deleted file mode 100644 index bafbf4763f..0000000000 --- a/old_tests/tests/lean/out_param_proj.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -@[instance, reducible] -def module.to_add_comm_group : Π {α : Type u} (β : Type v) {_inst_1 : ring α} [c : module α β], add_comm_group β := -λ {α : Type u} (β : Type v) {_inst_1 : ring α} [c : module α β], [module.to_add_comm_group c] diff --git a/old_tests/tests/lean/over_notation.lean b/old_tests/tests/lean/over_notation.lean deleted file mode 100644 index 1294e2b569..0000000000 --- a/old_tests/tests/lean/over_notation.lean +++ /dev/null @@ -1,17 +0,0 @@ -constant f : nat → nat → nat -constant g : string → string → string - -infix ` & `:60 := f -infix ` & `:60 := g - -set_option pp.notation false - -#check 0 & 1 -#check "a" & "b" -#check tt & ff - -notation `[[`:max l:(foldr `, ` (h t, f h t) 0 `]]`:0) := l -notation `[[`:max l:(foldr `, ` (h t, g h t) "" `]]`:0) := l - -#check [[ (1:nat), 2, 3 ]] -#check [[ "a", "b", "c" ]] diff --git a/old_tests/tests/lean/over_notation.lean.expected.out b/old_tests/tests/lean/over_notation.lean.expected.out deleted file mode 100644 index 3838b1e0fc..0000000000 --- a/old_tests/tests/lean/over_notation.lean.expected.out +++ /dev/null @@ -1,26 +0,0 @@ -f 0 1 : nat -g "a" "b" : string -over_notation.lean:11:10: error: none of the overloads are applicable -error for g -type mismatch at application - g tt -term - tt -has type - bool -but is expected to have type - string - -error for f -type mismatch at application - f tt -term - tt -has type - bool -but is expected to have type - nat -Additional information: -over_notation.lean:11:10: context: switched to basic overload resolution where arguments are elaborated without any information about the expected type because expected type was not available -f 1 (f 2 (f 3 0)) : nat -g "a" (g "b" (g "c" "")) : string diff --git a/old_tests/tests/lean/param.lean b/old_tests/tests/lean/param.lean deleted file mode 100644 index 0bc0e0aaeb..0000000000 --- a/old_tests/tests/lean/param.lean +++ /dev/null @@ -1,20 +0,0 @@ --- -definition foo1 (a b c) := a + b + (c:nat) - -definition foo2 (a : nat) (b c) := a + b + c - -definition foo3 (a b) (c : nat) := a + b + c - -definition foo4 (a b c : nat) := a + b + c - -definition foo5 (a b c) : nat := a + b + c - -definition foo6 {a b c} : nat := a + b + c - --- definition foo7 a b c : nat := a + b + c -- Error - -definition foo8 (a b c : nat) : nat := a + b + c - -definition foo9 (a : nat) (b : nat) (c : nat) : nat := a + b + c - -definition foo10 (a : nat) (b) (c : nat) : nat := a + b + c diff --git a/old_tests/tests/lean/param.lean.expected.out b/old_tests/tests/lean/param.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/param_binder_update.lean b/old_tests/tests/lean/param_binder_update.lean deleted file mode 100644 index 7f7ebec4ab..0000000000 --- a/old_tests/tests/lean/param_binder_update.lean +++ /dev/null @@ -1,83 +0,0 @@ -section - parameter {A : Type*} - - parameter A - - -- definition id (a : A) := a - - parameter {A} - - definition id₂ (a : A) := a -end - -#check @id -#check @id₂ - -section - parameters {A : Type*} {B : Type*} - - definition foo1 (a : A) (b : B) := a - - parameters {A} (B) - - definition foo2 (a : A) (b : B) := a - - parameters (A) {B} - - definition foo3 (a : A) (b : B) := a - - parameters (A) (B) - - definition foo4 (a : A) (b : B) := a - - #check @foo1 - #check @foo2 - #check @foo3 - #check @foo4 -end - -#check @foo1 -#check @foo2 -#check @foo3 -#check @foo4 - -section - variables {A : Type*} {B : Type*} - - definition boo1 (a : A) (b : B) := a - - variables {A} (B) - - definition boo2 (a : A) (b : B) := a - - variables (A) {B} - - definition boo3 (a : A) (b : B) := a - - variables (A) (B) - - definition boo4 (a : A) (b : B) := a - - #check @boo1 - #check @boo2 - #check @boo3 - #check @boo4 -end - -section - variables {A : Type*} {B : Type*} - - parameter (A) -- ERROR - variable (C) -- ERROR - variables (C) (D) -- ERROR - variables C -- ERROR - - definition id3 (a : A) := a - - parameter id3 -- ERROR - - parameter (C : Type) - - variables {C} -- ERROR - -end diff --git a/old_tests/tests/lean/param_binder_update.lean.expected.out b/old_tests/tests/lean/param_binder_update.lean.expected.out deleted file mode 100644 index a81f3bdc3d..0000000000 --- a/old_tests/tests/lean/param_binder_update.lean.expected.out +++ /dev/null @@ -1,20 +0,0 @@ -id : Π {α : Sort u_1}, α → α -id₂ : Π {A : Type u_1}, A → A -foo1 : A → B → A -foo2 : A → B → A -foo3 : A → B → A -foo4 : A → B → A -foo1 : Π {A : Type u_1} {B : Type u_2}, A → B → A -foo2 : Π {A : Type u_1} (B : Type u_2), A → B → A -foo3 : Π (A : Type u_1) {B : Type u_2}, A → B → A -foo4 : Π (A : Type u_1) (B : Type u_2), A → B → A -boo1 : Π {A : Type u_3} {B : Type u_4}, A → B → A -boo2 : Π {A : Type u_3} (B : Type u_4), A → B → A -boo3 : Π (A : Type u_3) {B : Type u_4}, A → B → A -boo4 : Π (A : Type u_3) (B : Type u_4), A → B → A -param_binder_update.lean:70:12: error: invalid parameter binder type update, 'A' is a variable -param_binder_update.lean:71:11: error: invalid variable binder type update, 'C' is not a variable -param_binder_update.lean:72:12: error: invalid variable binder type update, 'C' is not a variable -param_binder_update.lean:73:12: error: invalid variable binder type update, 'C' is not a variable -param_binder_update.lean:77:12: error: invalid parameter binder type update, 'id3' is not a parameter -param_binder_update.lean:81:12: error: invalid variable binder type update, 'C' is not a variable diff --git a/old_tests/tests/lean/param_binder_update2.lean b/old_tests/tests/lean/param_binder_update2.lean deleted file mode 100644 index cb415a5623..0000000000 --- a/old_tests/tests/lean/param_binder_update2.lean +++ /dev/null @@ -1,23 +0,0 @@ -section - parameters {A : Type*} {B : Type*} - - definition foo1 (a : A) (b : B) := a - - parameters (B) {A} -- Should not change the order of the parameters - - definition foo2 (a : A) (b : B) := a - - parameters {B} (A) - - definition foo3 (a : A) (b : B) := a - - parameters (A) (B) - - definition foo4 (a : A) (b : B) := a - -end - -#check @foo1 -#check @foo2 -#check @foo3 -#check @foo4 diff --git a/old_tests/tests/lean/param_binder_update2.lean.expected.out b/old_tests/tests/lean/param_binder_update2.lean.expected.out deleted file mode 100644 index d7c93c24be..0000000000 --- a/old_tests/tests/lean/param_binder_update2.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -foo1 : Π {A : Type u_1} {B : Type u_2}, A → B → A -foo2 : Π {A : Type u_1} (B : Type u_2), A → B → A -foo3 : Π (A : Type u_1) {B : Type u_2}, A → B → A -foo4 : Π (A : Type u_1) (B : Type u_2), A → B → A diff --git a/old_tests/tests/lean/parser_error_recovery.lean b/old_tests/tests/lean/parser_error_recovery.lean deleted file mode 100644 index 7b09ae2700..0000000000 --- a/old_tests/tests/lean/parser_error_recovery.lean +++ /dev/null @@ -1,37 +0,0 @@ -/- unknown identifiers -/ - -def f1 : ℕ → ℕ -| 42 := 9000 -| arg := ag - -#eval f1 42 -- OK (prints 9000) - -/- incomplete structure instances -/ - -def f2 : ℕ × ℕ := { fst := 9000, sn} - -#reduce f2.fst -- OK (prints 9000) - -/- incomplete if-then-else -/ - -def f3 (x : ℕ) : ℕ := -(if x ≥ 42 then 9000) - -- ^ missing else reported here - -#eval f3 42 -- OK (prints 9000) - -/- η-expanded syntax errors -/ - -def f4 : list ℕ := -list.map nat.suc [] - -#eval f4 -- OK (prints []) - -/- tactic scripts with syntax errors -/ - -lemma f5 (x : ℕ) : x+1 = 1+x := -by { - simp, - trace_state, -- OK (no goals) - simmp,***, - simp a,,, \ No newline at end of file diff --git a/old_tests/tests/lean/parser_error_recovery.lean.expected.out b/old_tests/tests/lean/parser_error_recovery.lean.expected.out deleted file mode 100644 index 28cf256f29..0000000000 --- a/old_tests/tests/lean/parser_error_recovery.lean.expected.out +++ /dev/null @@ -1,44 +0,0 @@ -parser_error_recovery.lean:5:9: error: unknown identifier 'ag' -parser_error_recovery.lean:3:0: warning: declaration 'f1' uses sorry -9000 -parser_error_recovery.lean:11:35: error: invalid structure instance, ':=' expected -parser_error_recovery.lean:11:18: error: invalid structure value { ... }, field 'snd' was not provided -parser_error_recovery.lean:11:18: error: invalid structure value { ... }, 'sn' is not a field of structure 'prod' -9000 -parser_error_recovery.lean:18:20: error: invalid 'if-then-else' expression, 'else' expected -parser_error_recovery.lean:17:0: warning: declaration 'f3' uses sorry -9000 -parser_error_recovery.lean:26:9: error: unknown identifier 'nat.suc' -parser_error_recovery.lean:26:17: error: don't know how to synthesize placeholder -context: -⊢ Type ? -[] -parser_error_recovery.lean:36:4: error: unknown identifier 'simmp' -parser_error_recovery.lean:36:10: error: invalid expression -parser_error_recovery.lean:36:11: error: invalid expression -parser_error_recovery.lean:36:12: error: invalid expression -parser_error_recovery.lean:36:13: error: invalid expression -parser_error_recovery.lean:37:9: error: unknown identifier 'a' -parser_error_recovery.lean:37:11: error: invalid expression -parser_error_recovery.lean:37:12: error: invalid expression -parser_error_recovery.lean:37:13: error: invalid expression, unexpected token -parser_error_recovery.lean:36:4: error: don't know how to synthesize placeholder -context: -x : ℕ -⊢ Type ? -parser_error_recovery.lean:36:10: error: don't know how to synthesize placeholder -context: -x : ℕ -⊢ Type ? -parser_error_recovery.lean:37:11: error: don't know how to synthesize placeholder -context: -x : ℕ -⊢ Type ? -parser_error_recovery.lean:37:12: error: don't know how to synthesize placeholder -context: -x : ℕ -⊢ Type ? -parser_error_recovery.lean:37:13: error: don't know how to synthesize placeholder -context: -x : ℕ -⊢ Type ? diff --git a/old_tests/tests/lean/parsing_only.lean b/old_tests/tests/lean/parsing_only.lean deleted file mode 100644 index 8af35f38ad..0000000000 --- a/old_tests/tests/lean/parsing_only.lean +++ /dev/null @@ -1,9 +0,0 @@ --- - -constant f : nat → nat -constant g : nat → nat -notation a `+++` := f a -notation [parsing_only] a `***` := g a -#check 10 +++ -#check 10 *** -#check Type.{8} -- Type₊ should not be used diff --git a/old_tests/tests/lean/parsing_only.lean.expected.out b/old_tests/tests/lean/parsing_only.lean.expected.out deleted file mode 100644 index 915e7db124..0000000000 --- a/old_tests/tests/lean/parsing_only.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -10+++ : ℕ -g 10 : ℕ -Type 8 : Type 9 diff --git a/old_tests/tests/lean/perf/perm_ac_100.lean b/old_tests/tests/lean/perf/perm_ac_100.lean deleted file mode 100644 index 4900925e76..0000000000 --- a/old_tests/tests/lean/perf/perm_ac_100.lean +++ /dev/null @@ -1,49 +0,0 @@ -import data.list.perm -open list perm option nat -attribute [reducible] -definition denote {X : Type} (default : X) [add_comm_semigroup X] (xs : list X) : list nat -> X -| nil := default -| (cons i is) := match nth xs i with - | none := default - | (some x) := match is with - | nil := x - | _ := x + denote is - end - end -axiom perm_ac {X : Type} (default : X) [add_comm_semigroup X] (xs : list X) (is js : list nat) : - perm is js -> denote default xs is = denote default xs js -constants (X : Type.{1}) (X_acsg : add_comm_semigroup X) (X_deceq : decidable_eq X) -attribute X_acsg [instance] -attribute X_deceq [instance] - -open tactic expr decidable - -meta_definition is_poly_bin_app : expr -> option name -| (app (app (app (app (const op ls) A) s) lhs) rhs) := some op -| _ := none - -meta_definition is_add (e : expr) : bool := -match is_poly_bin_app e with -| some op := to_bool (op = "add") -| none := ff -end - -meta_definition perm_add (e1 e2 : expr) : tactic expr := -do when (is_add e1 = ff) (fail "given expression is not an addition"), - add_fn : expr <- return $ app_fn (app_fn e1), - A : expr <- return $ app_arg (app_fn add_fn), - s1 : expr <- mk_app "add_semigroup" [A] >>= mk_instance, - assoc : expr <- mk_mapp ("add" <.> "assoc") [some A, some s1], - s2 : expr <- mk_app "add_comm_semigroup" [A] >>= mk_instance, - comm : expr <- mk_mapp ("add" <.> "comm") [some A, some s2], - perm_ac add_fn assoc comm e1 e2 - -meta_definition perm_add_eq : tactic unit := -do - (lhs, rhs) <- target >>= match_eq, - perm_add lhs rhs >>= exact - - -constants (x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 x65 x66 x67 x68 x69 x70 x71 x72 x73 x74 x75 x76 x77 x78 x79 x80 x81 x82 x83 x84 x85 x86 x87 x88 x89 x90 x91 x92 x93 x94 x95 x96 x97 x98 x99 : X) ---------- -example : x40 + (x67 + (x85 + (x35 + (x89 + (x82 + (x56 + (x14 + (x4 + (x6 + (x5 + (x11 + (x19 + (x78 + (x81 + (x63 + (x37 + (x25 + (x43 + (x45 + (x94 + (x16 + (x84 + (x54 + (x90 + (x68 + (x86 + (x9 + (x10 + (x24 + (x99 + (x64 + (x13 + (x0 + (x95 + (x80 + (x46 + (x55 + (x1 + (x97 + (x17 + (x20 + (x18 + (x87 + (x50 + (x38 + (x79 + (x7 + (x57 + (x88 + (x8 + (x75 + (x44 + (x66 + (x23 + (x98 + (x28 + (x31 + (x61 + (x51 + (x59 + (x39 + (x36 + (x41 + (x93 + (x58 + (x29 + (x91 + (x26 + (x47 + (x65 + (x22 + (x27 + (x42 + (x77 + (x62 + (x33 + (x32 + (x48 + (x34 + (x49 + (x60 + (x12 + (x73 + (x83 + (x92 + (x74 + (x15 + (x52 + (x69 + (x21 + (x30 + (x96 + (x76 + (x70 + (x3 + (x71 + (x2 + (x72 + (x53))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) = x59 + (x15 + (x66 + (x88 + (x8 + (x78 + (x29 + (x18 + (x21 + (x39 + (x86 + (x81 + (x46 + (x95 + (x23 + (x84 + (x36 + (x54 + (x69 + (x0 + (x55 + (x4 + (x93 + (x31 + (x13 + (x34 + (x76 + (x11 + (x32 + (x26 + (x75 + (x37 + (x89 + (x7 + (x41 + (x28 + (x91 + (x27 + (x62 + (x42 + (x50 + (x85 + (x92 + (x72 + (x77 + (x49 + (x10 + (x38 + (x52 + (x30 + (x57 + (x96 + (x98 + (x80 + (x67 + (x44 + (x61 + (x70 + (x45 + (x65 + (x94 + (x19 + (x1 + (x99 + (x82 + (x14 + (x79 + (x22 + (x24 + (x63 + (x58 + (x68 + (x48 + (x6 + (x64 + (x25 + (x83 + (x5 + (x43 + (x73 + (x12 + (x60 + (x71 + (x17 + (x9 + (x2 + (x20 + (x51 + (x3 + (x56 + (x35 + (x40 + (x74 + (x53 + (x16 + (x47 + (x33 + (x87 + (x97 + (x90))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) := by perm_add_eq diff --git a/old_tests/tests/lean/perf/perm_ac_200.lean b/old_tests/tests/lean/perf/perm_ac_200.lean deleted file mode 100644 index 621f5f4bff..0000000000 --- a/old_tests/tests/lean/perf/perm_ac_200.lean +++ /dev/null @@ -1,49 +0,0 @@ -import data.list.perm -open list perm option nat -attribute [reducible] -definition denote {X : Type} (default : X) [add_comm_semigroup X] (xs : list X) : list nat -> X -| nil := default -| (cons i is) := match nth xs i with - | none := default - | (some x) := match is with - | nil := x - | _ := x + denote is - end - end -axiom perm_ac {X : Type} (default : X) [add_comm_semigroup X] (xs : list X) (is js : list nat) : - perm is js -> denote default xs is = denote default xs js -constants (X : Type.{1}) (X_acsg : add_comm_semigroup X) (X_deceq : decidable_eq X) -attribute X_acsg [instance] -attribute X_deceq [instance] - -open tactic expr decidable - -meta_definition is_poly_bin_app : expr -> option name -| (app (app (app (app (const op ls) A) s) lhs) rhs) := some op -| _ := none - -meta_definition is_add (e : expr) : bool := -match is_poly_bin_app e with -| some op := to_bool (op = "add") -| none := ff -end - -meta_definition perm_add (e1 e2 : expr) : tactic expr := -do when (is_add e1 = ff) (fail "given expression is not an addition"), - add_fn : expr <- return $ app_fn (app_fn e1), - A : expr <- return $ app_arg (app_fn add_fn), - s1 : expr <- mk_app "add_semigroup" [A] >>= mk_instance, - assoc : expr <- mk_mapp ("add" <.> "assoc") [some A, some s1], - s2 : expr <- mk_app "add_comm_semigroup" [A] >>= mk_instance, - comm : expr <- mk_mapp ("add" <.> "comm") [some A, some s2], - perm_ac add_fn assoc comm e1 e2 - -meta_definition perm_add_eq : tactic unit := -do - (lhs, rhs) <- target >>= match_eq, - perm_add lhs rhs >>= exact - - -constants (x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 x65 x66 x67 x68 x69 x70 x71 x72 x73 x74 x75 x76 x77 x78 x79 x80 x81 x82 x83 x84 x85 x86 x87 x88 x89 x90 x91 x92 x93 x94 x95 x96 x97 x98 x99 x100 x101 x102 x103 x104 x105 x106 x107 x108 x109 x110 x111 x112 x113 x114 x115 x116 x117 x118 x119 x120 x121 x122 x123 x124 x125 x126 x127 x128 x129 x130 x131 x132 x133 x134 x135 x136 x137 x138 x139 x140 x141 x142 x143 x144 x145 x146 x147 x148 x149 x150 x151 x152 x153 x154 x155 x156 x157 x158 x159 x160 x161 x162 x163 x164 x165 x166 x167 x168 x169 x170 x171 x172 x173 x174 x175 x176 x177 x178 x179 x180 x181 x182 x183 x184 x185 x186 x187 x188 x189 x190 x191 x192 x193 x194 x195 x196 x197 x198 x199 : X) ---------- -example : x153 + (x27 + (x137 + (x31 + (x155 + (x110 + (x54 + (x145 + (x198 + (x0 + (x102 + (x188 + (x126 + (x35 + (x196 + (x164 + (x9 + (x123 + (x121 + (x171 + (x103 + (x117 + (x129 + (x144 + (x61 + (x84 + (x37 + (x184 + (x94 + (x60 + (x41 + (x70 + (x29 + (x74 + (x148 + (x62 + (x113 + (x157 + (x38 + (x55 + (x2 + (x146 + (x106 + (x182 + (x192 + (x57 + (x174 + (x30 + (x17 + (x91 + (x53 + (x75 + (x36 + (x183 + (x95 + (x79 + (x142 + (x3 + (x52 + (x125 + (x185 + (x47 + (x65 + (x112 + (x50 + (x21 + (x108 + (x7 + (x147 + (x24 + (x140 + (x63 + (x76 + (x150 + (x119 + (x81 + (x152 + (x118 + (x96 + (x4 + (x107 + (x101 + (x172 + (x58 + (x92 + (x135 + (x173 + (x25 + (x158 + (x104 + (x78 + (x12 + (x130 + (x105 + (x44 + (x88 + (x5 + (x131 + (x83 + (x176 + (x49 + (x111 + (x97 + (x132 + (x141 + (x190 + (x51 + (x100 + (x115 + (x189 + (x114 + (x181 + (x15 + (x133 + (x10 + (x149 + (x34 + (x22 + (x72 + (x45 + (x20 + (x32 + (x87 + (x166 + (x163 + (x168 + (x23 + (x90 + (x156 + (x85 + (x116 + (x8 + (x139 + (x71 + (x1 + (x162 + (x77 + (x186 + (x180 + (x109 + (x19 + (x42 + (x80 + (x120 + (x199 + (x56 + (x16 + (x66 + (x48 + (x161 + (x177 + (x195 + (x167 + (x13 + (x33 + (x151 + (x178 + (x39 + (x128 + (x138 + (x127 + (x46 + (x82 + (x134 + (x159 + (x154 + (x194 + (x18 + (x43 + (x136 + (x98 + (x69 + (x73 + (x26 + (x191 + (x124 + (x86 + (x89 + (x165 + (x68 + (x160 + (x67 + (x14 + (x169 + (x170 + (x197 + (x40 + (x193 + (x93 + (x64 + (x122 + (x6 + (x143 + (x179 + (x11 + (x175 + (x99 + (x187 + (x28 + (x59))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) = x23 + (x12 + (x190 + (x178 + (x194 + (x186 + (x69 + (x179 + (x157 + (x14 + (x41 + (x90 + (x74 + (x135 + (x79 + (x122 + (x63 + (x108 + (x60 + (x140 + (x168 + (x66 + (x184 + (x34 + (x164 + (x40 + (x136 + (x51 + (x85 + (x130 + (x81 + (x117 + (x160 + (x27 + (x150 + (x84 + (x86 + (x199 + (x189 + (x59 + (x105 + (x50 + (x80 + (x153 + (x58 + (x156 + (x167 + (x137 + (x102 + (x24 + (x196 + (x169 + (x88 + (x13 + (x113 + (x72 + (x176 + (x163 + (x134 + (x44 + (x54 + (x76 + (x53 + (x155 + (x107 + (x177 + (x192 + (x7 + (x110 + (x87 + (x16 + (x171 + (x67 + (x161 + (x4 + (x151 + (x15 + (x187 + (x48 + (x38 + (x6 + (x39 + (x98 + (x33 + (x61 + (x32 + (x188 + (x118 + (x18 + (x62 + (x10 + (x170 + (x174 + (x142 + (x71 + (x22 + (x132 + (x5 + (x183 + (x99 + (x112 + (x180 + (x197 + (x89 + (x49 + (x64 + (x166 + (x172 + (x47 + (x159 + (x154 + (x11 + (x91 + (x20 + (x43 + (x141 + (x26 + (x173 + (x56 + (x82 + (x129 + (x35 + (x119 + (x114 + (x165 + (x36 + (x162 + (x109 + (x121 + (x42 + (x181 + (x9 + (x182 + (x128 + (x147 + (x124 + (x52 + (x73 + (x123 + (x126 + (x116 + (x93 + (x125 + (x149 + (x145 + (x29 + (x193 + (x143 + (x0 + (x30 + (x45 + (x191 + (x127 + (x1 + (x3 + (x101 + (x77 + (x94 + (x46 + (x131 + (x146 + (x195 + (x104 + (x2 + (x8 + (x25 + (x103 + (x175 + (x198 + (x92 + (x55 + (x68 + (x17 + (x185 + (x111 + (x57 + (x37 + (x120 + (x138 + (x28 + (x96 + (x97 + (x158 + (x139 + (x75 + (x115 + (x148 + (x65 + (x31 + (x19 + (x152 + (x100 + (x78 + (x106 + (x133 + (x70 + (x83 + (x21 + (x95 + (x144))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) := by perm_add_eq diff --git a/old_tests/tests/lean/perf/perm_ac_commring_50.lean b/old_tests/tests/lean/perf/perm_ac_commring_50.lean deleted file mode 100644 index ad1fed1402..0000000000 --- a/old_tests/tests/lean/perf/perm_ac_commring_50.lean +++ /dev/null @@ -1,7 +0,0 @@ -import algebra.ring -open tactic simplifier.ac -constants (A : Type.{1}) (A_inst : comm_ring A) -attribute A_inst [instance] -set_option simplify.max_steps 1000000 -constants (x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 : A) -example : x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x30 + x31 + x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x40 + x41 + x42 + x43 + x44 + x45 + x46 + x47 + x48 + x49 + x50 + 0 = x50 + x49 + x48 + x47 + x46 + x45 + x44 + x43 + x42 + x41 + x40 + x39 + x38 + x37 + x36 + x35 + x34 + x33 + x32 + x31 + x30 + x29 + x28 + x27 + x26 + x25 + x24 + x23 + x22 + x21 + x20 + x19 + x18 + x17 + x16 + x15 + x14 + x13 + x12 + x11 + x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x1 + x0 + 0 := by simp diff --git a/old_tests/tests/lean/perf/perm_ac_dlof_50.lean b/old_tests/tests/lean/perf/perm_ac_dlof_50.lean deleted file mode 100644 index 253c59634b..0000000000 --- a/old_tests/tests/lean/perf/perm_ac_dlof_50.lean +++ /dev/null @@ -1,7 +0,0 @@ -import algebra.ordered_field -open tactic simplifier.ac -constants (A : Type.{1}) (A_inst : discrete_linear_ordered_field A) -attribute A_inst [instance] -set_option simplify.max_steps 1000000 -constants (x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 : A) -example : x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x30 + x31 + x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x40 + x41 + x42 + x43 + x44 + x45 + x46 + x47 + x48 + x49 + x50 + 0 = x50 + x49 + x48 + x47 + x46 + x45 + x44 + x43 + x42 + x41 + x40 + x39 + x38 + x37 + x36 + x35 + x34 + x33 + x32 + x31 + x30 + x29 + x28 + x27 + x26 + x25 + x24 + x23 + x22 + x21 + x20 + x19 + x18 + x17 + x16 + x15 + x14 + x13 + x12 + x11 + x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x1 + x0 + 0 := by simp diff --git a/old_tests/tests/lean/perf/perm_ac_op_50.lean b/old_tests/tests/lean/perf/perm_ac_op_50.lean deleted file mode 100644 index 0297513d49..0000000000 --- a/old_tests/tests/lean/perf/perm_ac_op_50.lean +++ /dev/null @@ -1,9 +0,0 @@ -open tactic -constants (A : Type.{1}) -constants (op : A → A → A) (op.comm : ∀ x y, op x y = op y x) (op.assoc : ∀ x y z, op (op x y) z = op x (op y z)) (op.left_comm : ∀ x y z, op x (op y z) = op y (op x z)) -attribute op.comm [simp] -attribute op.assoc [simp] -attribute op.left_comm [simp] -set_option simplify.max_steps 1000000 -constants (x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 : A) -example : (op x1 (op x2 (op x3 (op x4 (op x5 (op x6 (op x7 (op x8 (op x9 (op x10 (op x11 (op x12 (op x13 (op x14 (op x15 (op x16 (op x17 (op x18 (op x19 (op x20 (op x21 (op x22 (op x23 (op x24 (op x25 (op x26 (op x27 (op x28 (op x29 (op x30 (op x31 (op x32 (op x33 (op x34 (op x35 (op x36 (op x37 (op x38 (op x39 (op x40 (op x41 (op x42 (op x43 (op x44 (op x45 (op x46 (op x47 (op x48 (op x49 (op x50 x0)))))))))))))))))))))))))))))))))))))))))))))))))) = (op x50 (op x49 (op x48 (op x47 (op x46 (op x45 (op x44 (op x43 (op x42 (op x41 (op x40 (op x39 (op x38 (op x37 (op x36 (op x35 (op x34 (op x33 (op x32 (op x31 (op x30 (op x29 (op x28 (op x27 (op x26 (op x25 (op x24 (op x23 (op x22 (op x21 (op x20 (op x19 (op x18 (op x17 (op x16 (op x15 (op x14 (op x13 (op x12 (op x11 (op x10 (op x9 (op x8 (op x7 (op x6 (op x5 (op x4 (op x3 (op x2 (op x1 x0)))))))))))))))))))))))))))))))))))))))))))))))))) := by simp diff --git a/old_tests/tests/lean/pp.lean b/old_tests/tests/lean/pp.lean deleted file mode 100644 index 6090f21b6f..0000000000 --- a/old_tests/tests/lean/pp.lean +++ /dev/null @@ -1,7 +0,0 @@ -prelude set_option pp.beta false #check λ {A : Type} (B : Type) (a : A) (b : B), a -#check λ {A : Type} {B : Type} (a : A) (b : B), a -#check λ (A : Type) {B : Type} (a : A) (b : B), a -#check λ (A : Type) (B : Type) (a : A) (b : B), a -#check λ [A : Type] (B : Type) (a : A) (b : B), a -#check λ {{A : Type}} {B : Type} (a : A) (b : B), a -#check λ {{A : Type}} {{B : Type}} (a : A) (b : B), a diff --git a/old_tests/tests/lean/pp.lean.expected.out b/old_tests/tests/lean/pp.lean.expected.out deleted file mode 100644 index be3384c8e0..0000000000 --- a/old_tests/tests/lean/pp.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -λ {A : Type} (B : Type) (a : A) (b : B), a : Π {A : Type} (B : Type), A → B → A -λ {A B : Type} (a : A) (b : B), a : Π {A B : Type}, A → B → A -λ (A : Type) {B : Type} (a : A) (b : B), a : Π (A : Type) {B : Type}, A → B → A -λ (A B : Type) (a : A) (b : B), a : Π (A B : Type), A → B → A -λ [A : Type] (B : Type) (a : A) (b : B), a : Π [A : Type] (B : Type), A → B → A -λ ⦃A : Type⦄ {B : Type} (a : A) (b : B), a : Π ⦃A : Type⦄ {B : Type}, A → B → A -λ ⦃A B : Type⦄ (a : A) (b : B), a : Π ⦃A B : Type⦄, A → B → A diff --git a/old_tests/tests/lean/pp_all.lean b/old_tests/tests/lean/pp_all.lean deleted file mode 100644 index d4ed191e2c..0000000000 --- a/old_tests/tests/lean/pp_all.lean +++ /dev/null @@ -1,10 +0,0 @@ --- -open nat - -variables {a : nat} - -definition b : nat := 2 - -#check (λ x, x) a + b = 10 -set_option pp.all true -#check (λ x, x) a + b = 10 diff --git a/old_tests/tests/lean/pp_all.lean.expected.out b/old_tests/tests/lean/pp_all.lean.expected.out deleted file mode 100644 index 5cb8e4ce82..0000000000 --- a/old_tests/tests/lean/pp_all.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -(λ (x : ℕ), x) a + b = 10 : Prop -@eq.{1} nat (@has_add.add.{0} nat nat.has_add ((λ (x : nat), x) a) b) - (@bit0.{0} nat nat.has_add - (@bit1.{0} nat nat.has_one nat.has_add (@bit0.{0} nat nat.has_add (@has_one.one.{0} nat nat.has_one)))) : - Prop diff --git a/old_tests/tests/lean/pp_all2.lean b/old_tests/tests/lean/pp_all2.lean deleted file mode 100644 index ecf0ae3f5a..0000000000 --- a/old_tests/tests/lean/pp_all2.lean +++ /dev/null @@ -1,7 +0,0 @@ --- - -set_option pp.all true -set_option pp.numerals true -set_option pp.universes false - -#check (10 : nat) + (3 : nat) diff --git a/old_tests/tests/lean/pp_all2.lean.expected.out b/old_tests/tests/lean/pp_all2.lean.expected.out deleted file mode 100644 index faf01ba0e8..0000000000 --- a/old_tests/tests/lean/pp_all2.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -@has_add.add nat nat.has_add 10 3 : nat diff --git a/old_tests/tests/lean/pp_beta.lean b/old_tests/tests/lean/pp_beta.lean deleted file mode 100644 index 5103fdaae9..0000000000 --- a/old_tests/tests/lean/pp_beta.lean +++ /dev/null @@ -1,7 +0,0 @@ -open nat - -#check (λ x : nat, x) 1 - -set_option pp.beta true - -#check (λ x : nat, x) 1 diff --git a/old_tests/tests/lean/pp_beta.lean.expected.out b/old_tests/tests/lean/pp_beta.lean.expected.out deleted file mode 100644 index 4104aed04c..0000000000 --- a/old_tests/tests/lean/pp_beta.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -(λ (x : ℕ), x) 1 : ℕ -1 : ℕ diff --git a/old_tests/tests/lean/pp_binder_types.lean b/old_tests/tests/lean/pp_binder_types.lean deleted file mode 100644 index de30333318..0000000000 --- a/old_tests/tests/lean/pp_binder_types.lean +++ /dev/null @@ -1,7 +0,0 @@ -open nat - -definition f (n : nat) (H : n = n) := λm, id (n + m) -#print f - -set_option pp.binder_types true -#print f diff --git a/old_tests/tests/lean/pp_binder_types.lean.expected.out b/old_tests/tests/lean/pp_binder_types.lean.expected.out deleted file mode 100644 index 78247037c3..0000000000 --- a/old_tests/tests/lean/pp_binder_types.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -def f : Π (n : ℕ), n = n → ℕ → ℕ := -λ (n : ℕ) (H : n = n) (m : ℕ), id (n + m) -def f : Π (n : ℕ), n = n → ℕ → ℕ := -λ (n : ℕ) (H : n = n) (m : ℕ), id (n + m) diff --git a/old_tests/tests/lean/pp_bug.lean b/old_tests/tests/lean/pp_bug.lean deleted file mode 100644 index 552d59e174..0000000000 --- a/old_tests/tests/lean/pp_bug.lean +++ /dev/null @@ -1,11 +0,0 @@ -variables p q : Prop -#check ¬(p → q) -#check ¬p → q -#check (¬p) → q -#check ¬(p → q) -#check p ↔ q -#check ¬(p ↔ q) -#check ¬p ↔ q -#check (¬p) ↔ q -#check (p → q) ↔ q -#check p → (q ↔ q) diff --git a/old_tests/tests/lean/pp_bug.lean.expected.out b/old_tests/tests/lean/pp_bug.lean.expected.out deleted file mode 100644 index d927da6231..0000000000 --- a/old_tests/tests/lean/pp_bug.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -¬(p → q) : Prop -¬p → q : Prop -¬p → q : Prop -¬(p → q) : Prop -p ↔ q : Prop -¬(p ↔ q) : Prop -¬p ↔ q : Prop -¬p ↔ q : Prop -p → q ↔ q : Prop -p → (q ↔ q) : Prop diff --git a/old_tests/tests/lean/pp_char_bug.lean b/old_tests/tests/lean/pp_char_bug.lean deleted file mode 100644 index 11742746f1..0000000000 --- a/old_tests/tests/lean/pp_char_bug.lean +++ /dev/null @@ -1,22 +0,0 @@ -#check (fin.mk 2 dec_trivial : fin 5) -#check (fin.mk 1 dec_trivial : fin 3) -#check 'a' -#check to_string 'a' -#eval to_string 'a' -#eval 'a' - -#eval char.of_nat 1 -#eval char.of_nat 1 -#eval char.of_nat 20 - -#check char.of_nat 1 -#check char.of_nat 20 -#check char.of_nat 15 -#check char.of_nat 16 -#eval char.of_nat 15 -#eval char.of_nat 16 - -example : char.of_nat 1 = '\x01' := -rfl -example : char.of_nat 20 = '\x14' := -rfl diff --git a/old_tests/tests/lean/pp_char_bug.lean.expected.out b/old_tests/tests/lean/pp_char_bug.lean.expected.out deleted file mode 100644 index ec28ef3587..0000000000 --- a/old_tests/tests/lean/pp_char_bug.lean.expected.out +++ /dev/null @@ -1,15 +0,0 @@ -⟨2, _⟩ : fin 5 -⟨1, _⟩ : fin 3 -'a' : char -to_string 'a' : string -"a" -'a' -'\x01' -'\x01' -'\x14' -'\x01' : char -'\x14' : char -'\x0f' : char -'\x10' : char -'\x0f' -'\x10' diff --git a/old_tests/tests/lean/pp_goal_issue.lean b/old_tests/tests/lean/pp_goal_issue.lean deleted file mode 100644 index 08f33be1d5..0000000000 --- a/old_tests/tests/lean/pp_goal_issue.lean +++ /dev/null @@ -1,15 +0,0 @@ -constant f : (nat → nat → Prop) → Prop - -example (h1 : false) : ∀ (a b c : nat), a = 0 → b = 0 → f (λ x y, a + x = b + c + y) := -begin - intros x x y h h, -- Force name clash - trace_state, - contradiction -end - -example (h1 : false) : ∀ (a b c : nat), a = 0 → b = 0 → f (λ x y, a + x = b + c + y) := -begin - intros, - trace_state, - contradiction -end diff --git a/old_tests/tests/lean/pp_goal_issue.lean.expected.out b/old_tests/tests/lean/pp_goal_issue.lean.expected.out deleted file mode 100644 index f75cbef544..0000000000 --- a/old_tests/tests/lean/pp_goal_issue.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -h1 : false, -x x y : ℕ, -h : x = 0, -h : x = 0 -⊢ f (λ (x_1 y_1 : ℕ), x + x_1 = x + y + y_1) -h1 : false, -a b c : ℕ, -a_1 : a = 0, -a_2 : b = 0 -⊢ f (λ (x y : ℕ), a + x = b + c + y) diff --git a/old_tests/tests/lean/pp_no_proofs.lean b/old_tests/tests/lean/pp_no_proofs.lean deleted file mode 100644 index 8899794a56..0000000000 --- a/old_tests/tests/lean/pp_no_proofs.lean +++ /dev/null @@ -1,16 +0,0 @@ --- -open nat - -constants (P : ∀ {t:true}, ℕ → Prop) (P0 : @P trivial 0) - (Ps : ∀ {n}, @P trivial n → @P trivial (succ n)) - (f : Π {n}, @P trivial n → ℕ) - -noncomputable definition messy := f (Ps (Ps (Ps (Ps (Ps (Ps P0)))))) - -#reduce messy -set_option pp.proofs false -#reduce messy -set_option pp.implicit true -#reduce messy -set_option pp.proofs true -#reduce messy diff --git a/old_tests/tests/lean/pp_no_proofs.lean.expected.out b/old_tests/tests/lean/pp_no_proofs.lean.expected.out deleted file mode 100644 index 3860e17fe1..0000000000 --- a/old_tests/tests/lean/pp_no_proofs.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -f _ -f _ -@f 6 _ -@f 6 (@Ps 5 (@Ps 4 (@Ps 3 (@Ps 2 (@Ps 1 (@Ps 0 P0)))))) diff --git a/old_tests/tests/lean/pp_notation_rbp_bug.lean b/old_tests/tests/lean/pp_notation_rbp_bug.lean deleted file mode 100644 index e27796a4a6..0000000000 --- a/old_tests/tests/lean/pp_notation_rbp_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -def foo := (λ a : ℕ, a) = (λ a, a) ↔ true -#print foo diff --git a/old_tests/tests/lean/pp_notation_rbp_bug.lean.expected.out b/old_tests/tests/lean/pp_notation_rbp_bug.lean.expected.out deleted file mode 100644 index 4941f168cc..0000000000 --- a/old_tests/tests/lean/pp_notation_rbp_bug.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -def foo : Prop := -((λ (a : ℕ), a) = λ (a : ℕ), a) ↔ true diff --git a/old_tests/tests/lean/pp_opt_param.lean b/old_tests/tests/lean/pp_opt_param.lean deleted file mode 100644 index cb22ed0a1a..0000000000 --- a/old_tests/tests/lean/pp_opt_param.lean +++ /dev/null @@ -1,6 +0,0 @@ -#check expr -#check expr ff -def f (x := 3) (y : nat) := y -#check f 3 4 -set_option pp.implicit true -#check expr diff --git a/old_tests/tests/lean/pp_opt_param.lean.expected.out b/old_tests/tests/lean/pp_opt_param.lean.expected.out deleted file mode 100644 index 1e2f149f33..0000000000 --- a/old_tests/tests/lean/pp_opt_param.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -expr : Type -expr ff : Type -f 3 4 : ℕ -expr tt : Type diff --git a/old_tests/tests/lean/pp_param_bug.lean b/old_tests/tests/lean/pp_param_bug.lean deleted file mode 100644 index 4e93e9bfad..0000000000 --- a/old_tests/tests/lean/pp_param_bug.lean +++ /dev/null @@ -1,7 +0,0 @@ -section - parameters (A : Type) {B : Type} - - definition foo3 (a : A) (b : B) := a - - #check foo3 -end diff --git a/old_tests/tests/lean/pp_param_bug.lean.expected.out b/old_tests/tests/lean/pp_param_bug.lean.expected.out deleted file mode 100644 index 78704a0a98..0000000000 --- a/old_tests/tests/lean/pp_param_bug.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -foo3 : A → B → A diff --git a/old_tests/tests/lean/pp_shadowed_const.lean b/old_tests/tests/lean/pp_shadowed_const.lean deleted file mode 100644 index c15b5a9b61..0000000000 --- a/old_tests/tests/lean/pp_shadowed_const.lean +++ /dev/null @@ -1,9 +0,0 @@ -def f : Π (x : nat) (b : bool), bool = bool := λ bool, _ - -def g (heq : 1 == 1) := heq.symm -#print g - -open nat -def h1 : Π n : nat, pred n = n := λ n, _ -def h2 : Π n : nat, pred n = n := λ pred, _ -def h3 : Π n m : nat, pred n = m := λ pred nat, _ diff --git a/old_tests/tests/lean/pp_shadowed_const.lean.expected.out b/old_tests/tests/lean/pp_shadowed_const.lean.expected.out deleted file mode 100644 index 20014117bd..0000000000 --- a/old_tests/tests/lean/pp_shadowed_const.lean.expected.out +++ /dev/null @@ -1,18 +0,0 @@ -pp_shadowed_const.lean:1:55: error: don't know how to synthesize placeholder -context: -bool : ℕ -⊢ _root_.bool → _root_.bool = _root_.bool -def g : 1 == 1 → 1 == 1 := -λ (heq_1 : 1 == 1), heq.symm heq_1 -pp_shadowed_const.lean:7:39: error: don't know how to synthesize placeholder -context: -n : ℕ -⊢ pred n = n -pp_shadowed_const.lean:8:42: error: don't know how to synthesize placeholder -context: -pred : ℕ -⊢ nat.pred pred = pred -pp_shadowed_const.lean:9:48: error: don't know how to synthesize placeholder -context: -pred nat : ℕ -⊢ _root_.nat.pred pred = nat diff --git a/old_tests/tests/lean/pp_struct.lean b/old_tests/tests/lean/pp_struct.lean deleted file mode 100644 index 14ea0caae3..0000000000 --- a/old_tests/tests/lean/pp_struct.lean +++ /dev/null @@ -1,36 +0,0 @@ -structure foo := -(x : nat) (y : nat) (z : bool) - -#check let s := {foo . x := let v1 := 10 + 10 + 20 + 30 + 40 + 10 + 20 + 30 + 40 + 50 + 10 + 10, v2 := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, v3 := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, v4 := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20 in v1 + v2 + v3 + v4, y := 20, z := tt} in s^.x + s^.y - -set_option pp.structure_instances_qualifier true - -#check let s := {foo . x := let v1 := 10 + 10 + 20 + 30 + 40 + 10 + 20 + 30 + 40 + 50 + 10 + 10, v2 := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, v3 := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, v4 := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20 in v1 + v2 + v3 + v4, y := 20, z := tt} in s^.x + s^.y - -set_option pp.structure_instances false - -#check {foo . x := 10, y := 20, z := ff} - -set_option pp.structure_instances true - -#check {foo . x := 10, y := 20, z := ff} - -set_option pp.structure_instances_qualifier false - -#check {foo . x := 10, y := 20, z := ff} - -#check {foo . x := 10, y := 20, z := ff}^.x - -#check (1, 2).1 - -constant boo : nat → nat → nat × nat - -#check (boo 1 1)^.fst - -structure F := -(fn : nat → nat → nat) -(v : nat) - -constant h : nat → F - -#check (h 0)^.fn 10 20 diff --git a/old_tests/tests/lean/pp_struct.lean.expected.out b/old_tests/tests/lean/pp_struct.lean.expected.out deleted file mode 100644 index beb16fd88d..0000000000 --- a/old_tests/tests/lean/pp_struct.lean.expected.out +++ /dev/null @@ -1,28 +0,0 @@ -let s : foo := - {x := let v1 : ℕ := 10 + 10 + 20 + 30 + 40 + 10 + 20 + 30 + 40 + 50 + 10 + 10, - v2 : ℕ := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, - v3 : ℕ := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, - v4 : ℕ := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20 - in v1 + v2 + v3 + v4, - y := 20, - z := tt} -in s.x + s.y : - ℕ -let s : foo := - {foo . - x := let v1 : ℕ := 10 + 10 + 20 + 30 + 40 + 10 + 20 + 30 + 40 + 50 + 10 + 10, - v2 : ℕ := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, - v3 : ℕ := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20, - v4 : ℕ := 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 10 + 20 - in v1 + v2 + v3 + v4, - y := 20, - z := tt} -in s.x + s.y : - ℕ -foo.mk 10 20 ff : foo -{foo . x := 10, y := 20, z := ff} : foo -{x := 10, y := 20, z := ff} : foo -{x := 10, y := 20, z := ff}.x : ℕ -(1, 2).fst : ℕ -(boo 1 1).fst : ℕ -(h 0).fn 10 20 : ℕ diff --git a/old_tests/tests/lean/pp_zero_bug.lean b/old_tests/tests/lean/pp_zero_bug.lean deleted file mode 100644 index 11803d963a..0000000000 --- a/old_tests/tests/lean/pp_zero_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -#check @has_zero.zero -#check @has_zero.zero nat diff --git a/old_tests/tests/lean/pp_zero_bug.lean.expected.out b/old_tests/tests/lean/pp_zero_bug.lean.expected.out deleted file mode 100644 index 276583b1b2..0000000000 --- a/old_tests/tests/lean/pp_zero_bug.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -has_zero.zero : Π (α : Type u_1) [c : has_zero α], α -has_zero.zero ℕ : Π [c : has_zero ℕ], ℕ diff --git a/old_tests/tests/lean/ppbug.lean b/old_tests/tests/lean/ppbug.lean deleted file mode 100644 index 2d05286aff..0000000000 --- a/old_tests/tests/lean/ppbug.lean +++ /dev/null @@ -1 +0,0 @@ -#check list.rec_on diff --git a/old_tests/tests/lean/ppbug.lean.expected.out b/old_tests/tests/lean/ppbug.lean.expected.out deleted file mode 100644 index 799bd21b11..0000000000 --- a/old_tests/tests/lean/ppbug.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -list.rec_on : - Π (n : list ?M_1), ?M_2 list.nil → (Π (hd : ?M_1) (tl : list ?M_1), ?M_2 tl → ?M_2 (hd :: tl)) → ?M_2 n diff --git a/old_tests/tests/lean/print_ax1.lean b/old_tests/tests/lean/print_ax1.lean deleted file mode 100644 index afcff2fe6a..0000000000 --- a/old_tests/tests/lean/print_ax1.lean +++ /dev/null @@ -1,2 +0,0 @@ -open subtype -#print axioms diff --git a/old_tests/tests/lean/print_ax1.lean.expected.out b/old_tests/tests/lean/print_ax1.lean.expected.out deleted file mode 100644 index aa283b6d5d..0000000000 --- a/old_tests/tests/lean/print_ax1.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -quot.sound : ∀ {α : Sort u} {r : α → α → Prop} {a b : α}, r a b → quot.mk r a = quot.mk r b -classical.choice : Π {α : Sort u}, nonempty α → α -propext : ∀ {a b : Prop}, (a ↔ b) → a = b diff --git a/old_tests/tests/lean/print_ax3.lean b/old_tests/tests/lean/print_ax3.lean deleted file mode 100644 index 532517b8d6..0000000000 --- a/old_tests/tests/lean/print_ax3.lean +++ /dev/null @@ -1,22 +0,0 @@ -theorem foo1 : 0 = (0:nat) := -rfl - -theorem foo2 : 0 = (0:nat) := -rfl - -theorem foo3 : 0 = (0:nat) := -foo2 - -definition foo4 : 0 = (0:nat) := -eq.trans foo2 foo1 - -lemma foo5 : true = false := -propext sorry - -#print axioms foo4 -#print "------" -#print axioms -#print "------" -#print foo3 -#print "------" -#print axioms foo5 diff --git a/old_tests/tests/lean/print_ax3.lean.expected.out b/old_tests/tests/lean/print_ax3.lean.expected.out deleted file mode 100644 index 633d9a4ca5..0000000000 --- a/old_tests/tests/lean/print_ax3.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -print_ax3.lean:13:0: warning: declaration 'foo5' uses sorry -no axioms ------- -quot.sound : ∀ {α : Sort u} {r : α → α → Prop} {a b : α}, r a b → quot.mk r a = quot.mk r b -classical.choice : Π {α : Sort u}, nonempty α → α -propext : ∀ {a b : Prop}, (a ↔ b) → a = b ------- -theorem foo3 : 0 = 0 := -foo2 ------- -propext -[sorry] diff --git a/old_tests/tests/lean/print_meta.lean b/old_tests/tests/lean/print_meta.lean deleted file mode 100644 index 9fda7678f5..0000000000 --- a/old_tests/tests/lean/print_meta.lean +++ /dev/null @@ -1 +0,0 @@ -#print tactic.intro diff --git a/old_tests/tests/lean/print_meta.lean.expected.out b/old_tests/tests/lean/print_meta.lean.expected.out deleted file mode 100644 index 38a160dc63..0000000000 --- a/old_tests/tests/lean/print_meta.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -meta def tactic.intro : name → tactic expr := -λ (n : name), - id_rhs (tactic expr) - (tactic.target >>= - λ (t : expr), - ite (↥(expr.is_pi t) ∨ ↥(expr.is_let t)) (tactic.intro_core n) - (tactic.whnf_target >> tactic.intro_core n)) diff --git a/old_tests/tests/lean/print_reducible.lean b/old_tests/tests/lean/print_reducible.lean deleted file mode 100644 index f8fcad7c99..0000000000 --- a/old_tests/tests/lean/print_reducible.lean +++ /dev/null @@ -1,19 +0,0 @@ -prelude - -attribute [reducible] -definition id₁ {A : Type} (a : A) := a -attribute [reducible] -definition id₂ {A : Type} (a : A) := a - -attribute [irreducible] -definition id₅ {A : Type} (a : A) := a -attribute [irreducible] -definition id₆ {A : Type} (a : A) := a - -attribute [reducible] -definition pr {A B : Type} (a : A) (b : B) := a -definition pr2 {A B : Type} (a : A) (b : B) := a - -#print [reducible] -#print "-----------" -#print [irreducible] diff --git a/old_tests/tests/lean/print_reducible.lean.expected.out b/old_tests/tests/lean/print_reducible.lean.expected.out deleted file mode 100644 index 427a86d49f..0000000000 --- a/old_tests/tests/lean/print_reducible.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -id₁ -id₂ -pr ------------ -id₅ -id₆ diff --git a/old_tests/tests/lean/private_structure.lean b/old_tests/tests/lean/private_structure.lean deleted file mode 100644 index 91adb48d1a..0000000000 --- a/old_tests/tests/lean/private_structure.lean +++ /dev/null @@ -1,38 +0,0 @@ -namespace foo -private structure point := -(x : nat) (y : nat) - -definition bla := point -definition mk : bla := point.mk 10 10 -#check bla -#check point -#check point.mk -#check point.rec -#check point.rec_on -#check point.cases_on -#check point.x -#check point.y -#check (⟨1, 2⟩ : bla) -#check ({x := 1, y := 2} : bla) -end foo - -open foo - --- point is not visible anymore - -#check bla -#check point -#check point.mk -#check point.rec -#check point.rec_on -#check point.cases_on -#check point.no_confusion -#check point.x -#check point.y - -set_option pp.all true -#print bla - -#check (⟨1, 2⟩ : bla) -#check ({x := 1, y := 2} : bla) -#check mk diff --git a/old_tests/tests/lean/private_structure.lean.expected.out b/old_tests/tests/lean/private_structure.lean.expected.out deleted file mode 100644 index ed1a7d073e..0000000000 --- a/old_tests/tests/lean/private_structure.lean.expected.out +++ /dev/null @@ -1,26 +0,0 @@ -bla : Type -point : Type -point.mk : ℕ → ℕ → point -point.rec : (Π (x y : ℕ), ?M_1 {x := x, y := y}) → Π (n : point), ?M_1 n -point.rec_on : Π (n : point), (Π (x y : ℕ), ?M_1 {x := x, y := y}) → ?M_1 n -point.cases_on : Π (n : point), (Π (x y : ℕ), ?M_1 {x := x, y := y}) → ?M_1 n -point.x : point → ℕ -point.y : point → ℕ -{x := 1, y := 2} : point -{x := 1, y := 2} : point -bla : Type -private_structure.lean:24:7: error: unknown identifier 'point' -private_structure.lean:25:7: error: unknown identifier 'point.mk' -private_structure.lean:26:7: error: unknown identifier 'point.rec' -private_structure.lean:27:7: error: unknown identifier 'point.rec_on' -private_structure.lean:28:7: error: unknown identifier 'point.cases_on' -private_structure.lean:29:7: error: unknown identifier 'point.no_confusion' -private_structure.lean:30:7: error: unknown identifier 'point.x' -private_structure.lean:31:7: error: unknown identifier 'point.y' -def foo.bla : Type := -point -private_structure.lean:36:8: error: invalid constructor ⟨...⟩, type is a private inductive datatype -⁇ : foo.bla -private_structure.lean:37:8: error: invalid structure instance, type is a private structure -⁇ : foo.bla -foo.mk : foo.bla diff --git a/old_tests/tests/lean/prodtst.lean b/old_tests/tests/lean/prodtst.lean deleted file mode 100644 index 77ea839595..0000000000 --- a/old_tests/tests/lean/prodtst.lean +++ /dev/null @@ -1,7 +0,0 @@ --- - -inductive prod2 (A B : Type.{_+1}) -| mk : A → B → prod2 - -set_option pp.universes true -#check @prod2 diff --git a/old_tests/tests/lean/prodtst.lean.expected.out b/old_tests/tests/lean/prodtst.lean.expected.out deleted file mode 100644 index d36fd8acc8..0000000000 --- a/old_tests/tests/lean/prodtst.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -prod2.{u_1 u_2} : Type (u_1+1) → Type (u_2+1) → Type (max (u_1+1) (u_2+1)) diff --git a/old_tests/tests/lean/proj_notation.lean b/old_tests/tests/lean/proj_notation.lean deleted file mode 100644 index 4d5b324e2d..0000000000 --- a/old_tests/tests/lean/proj_notation.lean +++ /dev/null @@ -1,45 +0,0 @@ -structure myprod (A B : Type) := -(fst : A) (snd : B) - -variable p : myprod nat nat -variable f : nat → nat - -#check p^.fst -#check p^.1 -#check p^.2 -#check p^.snd - -#check f p^.1 -#check p^.1 + p^.2 - -example (A B : Type) : A × B → B × A := -λ h, ⟨h^.2, h^.1⟩ - -example (A B : Type) : A × B → B × A := -λ h, ⟨h^.snd, h^.fst⟩ - -structure position (A B : Type) := -(x : A) (y : B) - -structure car := -(pos : position nat nat) (cheap : bool) - -#check λ c : car, c^.pos^.x - -#check λ c : car, c^.fst - -#check λ c : car, c^.0 - -#check λ c : car, c^.3 - -#check λ n : nat, n^.1 - -#check p.1 -#check p.2 -#check λ c : car, c.1.2 - -namespace nat - def myadd : nat → nat → nat - | 0 m := m - | (n+1) m := n.myadd m + 1 -end nat diff --git a/old_tests/tests/lean/proj_notation.lean.expected.out b/old_tests/tests/lean/proj_notation.lean.expected.out deleted file mode 100644 index 0b3700e958..0000000000 --- a/old_tests/tests/lean/proj_notation.lean.expected.out +++ /dev/null @@ -1,27 +0,0 @@ -p.fst : ℕ -p.fst : ℕ -p.snd : ℕ -p.snd : ℕ -f (p.fst) : ℕ -p.fst + p.snd : ℕ -λ (c : car), (c.pos).x : car → ℕ -proj_notation.lean:29:19: error: invalid field notation, 'fst' is not a valid "field" because environment does not contain 'car.fst' - c -which has type - car -λ (c : car), ⁇ : car → ?M_1 -proj_notation.lean:31:19: error: invalid projection, index must be greater than 0 -λ (c : car), ⁇ : car → ?M_1 -proj_notation.lean:33:19: error: invalid projection, structure has only 2 field(s) - c -which has type - car -λ (c : car), ⁇ : car → ?M_1 -proj_notation.lean:35:19: error: invalid projection, structure expected - n -has type - ℕ -λ (n : ℕ), ⁇ : ℕ → ?M_1 -p.fst : ℕ -p.snd : ℕ -λ (c : car), (c.pos).y : car → ℕ diff --git a/old_tests/tests/lean/protected.lean b/old_tests/tests/lean/protected.lean deleted file mode 100644 index 21ecc13edd..0000000000 --- a/old_tests/tests/lean/protected.lean +++ /dev/null @@ -1,10 +0,0 @@ --- - -namespace foo - protected definition C := true - definition D := true -end foo - -open foo -#check C -#check D diff --git a/old_tests/tests/lean/protected.lean.expected.out b/old_tests/tests/lean/protected.lean.expected.out deleted file mode 100644 index 628b2f6ece..0000000000 --- a/old_tests/tests/lean/protected.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -protected.lean:9:7: error: unknown identifier 'C' -D : Prop diff --git a/old_tests/tests/lean/protected_consts.lean b/old_tests/tests/lean/protected_consts.lean deleted file mode 100644 index 7735c8692e..0000000000 --- a/old_tests/tests/lean/protected_consts.lean +++ /dev/null @@ -1,36 +0,0 @@ -namespace foo - protected axiom A : Prop - axiom B : Prop - protected constant a : foo.A - constant b : B - protected axioms (A₁ A₂ : Prop) - protected constants (a₁ a₂ : foo.A) - axioms (B₁ B₂ : Prop) - constants (b₁ b₂ : B) -end foo - -open foo -#check foo.A -#check A -- error -#check foo.a -#check a -- error -#check foo.A₁ -#check foo.A₂ -#check A₁ -- error -#check A₂ -- error -#check foo.a₁ -#check foo.a₂ -#check a₁ -- error -#check a₂ -- error -#check foo.B -#check B -#check foo.b -#check b -#check foo.b₁ -#check foo.b₂ -#check b₁ -#check b₂ -#check foo.B₁ -#check foo.B₂ -#check B₁ -#check B₂ diff --git a/old_tests/tests/lean/protected_consts.lean.expected.out b/old_tests/tests/lean/protected_consts.lean.expected.out deleted file mode 100644 index 08287b0600..0000000000 --- a/old_tests/tests/lean/protected_consts.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -foo.A : Prop -protected_consts.lean:14:7: error: unknown identifier 'A' -foo.a : foo.A -protected_consts.lean:16:7: error: unknown identifier 'a' -foo.A₁ : Prop -foo.A₂ : Prop -protected_consts.lean:19:7: error: unknown identifier 'A₁' -protected_consts.lean:20:7: error: unknown identifier 'A₂' -foo.a₁ : foo.A -foo.a₂ : foo.A -protected_consts.lean:23:7: error: unknown identifier 'a₁' -protected_consts.lean:24:7: error: unknown identifier 'a₂' -B : Prop -B : Prop -b : B -b : B -b₁ : B -b₂ : B -b₁ : B -b₂ : B -B₁ : Prop -B₂ : Prop -B₁ : Prop -B₂ : Prop diff --git a/old_tests/tests/lean/protected_test.lean b/old_tests/tests/lean/protected_test.lean deleted file mode 100644 index 1288abb6c4..0000000000 --- a/old_tests/tests/lean/protected_test.lean +++ /dev/null @@ -1,10 +0,0 @@ -namespace nat - #check induction_on -- ERROR - #check rec_on -- ERROR - #check less_than_or_equal.rec_on -- OK - #check nat.less_than_or_equal.rec_on - namespace le - #check rec_on -- ERROR - #check less_than_or_equal.rec_on - end le -end nat diff --git a/old_tests/tests/lean/protected_test.lean.expected.out b/old_tests/tests/lean/protected_test.lean.expected.out deleted file mode 100644 index d7159a0cfd..0000000000 --- a/old_tests/tests/lean/protected_test.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -protected_test.lean:2:9: error: unknown identifier 'induction_on' -protected_test.lean:3:9: error: unknown identifier 'rec_on' -less_than_or_equal.rec_on : - less_than_or_equal ?M_1 ?M_3 → - ?M_2 ?M_1 → (∀ {b : ℕ}, less_than_or_equal ?M_1 b → ?M_2 b → ?M_2 (succ b)) → ?M_2 ?M_3 -less_than_or_equal.rec_on : - less_than_or_equal ?M_1 ?M_3 → - ?M_2 ?M_1 → (∀ {b : ℕ}, less_than_or_equal ?M_1 b → ?M_2 b → ?M_2 (succ b)) → ?M_2 ?M_3 -protected_test.lean:7:11: error: unknown identifier 'rec_on' -less_than_or_equal.rec_on : - less_than_or_equal ?M_1 ?M_3 → - ?M_2 ?M_1 → (∀ {b : ℕ}, less_than_or_equal ?M_1 b → ?M_2 b → ?M_2 (succ b)) → ?M_2 ?M_3 diff --git a/old_tests/tests/lean/qexpr1.lean b/old_tests/tests/lean/qexpr1.lean deleted file mode 100644 index 8f6e3c6bee..0000000000 --- a/old_tests/tests/lean/qexpr1.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -set_option pp.all true - -example (a b c : nat) : true := -by do - x ← to_expr ```(a + b), - trace x, infer_type x >>= trace, - constructor - -example (a b c : nat) : true := -by do - x ← get_local `a, - x ← mk_app `nat.succ [x], - r ← to_expr ```(%%x + b), - trace r, infer_type r >>= trace, - constructor diff --git a/old_tests/tests/lean/qexpr1.lean.expected.out b/old_tests/tests/lean/qexpr1.lean.expected.out deleted file mode 100644 index b2ff64940c..0000000000 --- a/old_tests/tests/lean/qexpr1.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -@has_add.add.{0} nat nat.has_add a b -nat -@has_add.add.{0} nat nat.has_add (nat.succ a) b -nat diff --git a/old_tests/tests/lean/qexpr2.lean b/old_tests/tests/lean/qexpr2.lean deleted file mode 100644 index 2be8db4c9a..0000000000 --- a/old_tests/tests/lean/qexpr2.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic - -set_option pp.all true - -example (a b c : nat) : true := -by do - x ← to_expr ```(_ + b) tt, - trace x, infer_type x >>= trace, - constructor, - -- fill hole with 'c' - get_local `c >>= exact, - trace "------ after instantiate_mvars", - instantiate_mvars x >>= trace diff --git a/old_tests/tests/lean/qexpr2.lean.expected.out b/old_tests/tests/lean/qexpr2.lean.expected.out deleted file mode 100644 index f2e3070268..0000000000 --- a/old_tests/tests/lean/qexpr2.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -@has_add.add.{0} nat nat.has_add ?m_1 b -nat ------- after instantiate_mvars -@has_add.add.{0} nat nat.has_add c b diff --git a/old_tests/tests/lean/qexpr3.lean b/old_tests/tests/lean/qexpr3.lean deleted file mode 100644 index 5bdee8dcf0..0000000000 --- a/old_tests/tests/lean/qexpr3.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic - -example (a b c : nat) (H1 : a = b) (H2 : b = c) : a = c := -by do - refine ```(eq.trans H1 _), - trace_state, - assumption diff --git a/old_tests/tests/lean/qexpr3.lean.expected.out b/old_tests/tests/lean/qexpr3.lean.expected.out deleted file mode 100644 index 3b231f2bdb..0000000000 --- a/old_tests/tests/lean/qexpr3.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -a b c : ℕ, -H1 : a = b, -H2 : b = c -⊢ b = c diff --git a/old_tests/tests/lean/quot_abuse1.lean b/old_tests/tests/lean/quot_abuse1.lean deleted file mode 100644 index 3bdfd8314f..0000000000 --- a/old_tests/tests/lean/quot_abuse1.lean +++ /dev/null @@ -1,8 +0,0 @@ -prelude - -init_quotient - -/- definit eq as the empty type -/ -inductive {u} eq {α : Sort u} (a : α) : α → Sort 0 - -init_quotient diff --git a/old_tests/tests/lean/quot_abuse1.lean.expected.out b/old_tests/tests/lean/quot_abuse1.lean.expected.out deleted file mode 100644 index 112c1523f8..0000000000 --- a/old_tests/tests/lean/quot_abuse1.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -quot_abuse1.lean:3:0: error: failed to initialize quot module, environment does not have 'eq' type -quot_abuse1.lean:8:0: error: failed to initialize quot module, unexpected number of constructors for 'eq' type diff --git a/old_tests/tests/lean/quot_abuse2.lean b/old_tests/tests/lean/quot_abuse2.lean deleted file mode 100644 index 0bc93c3f09..0000000000 --- a/old_tests/tests/lean/quot_abuse2.lean +++ /dev/null @@ -1,9 +0,0 @@ -prelude - -init_quotient - -/- definit eq as the empty type -/ -inductive {u} eq {α : Sort u} (a : α) : α → Sort 0 -| refl : ∀ (b : α), eq b - -init_quotient diff --git a/old_tests/tests/lean/quot_abuse2.lean.expected.out b/old_tests/tests/lean/quot_abuse2.lean.expected.out deleted file mode 100644 index 52e6378b92..0000000000 --- a/old_tests/tests/lean/quot_abuse2.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -quot_abuse2.lean:3:0: error: failed to initialize quot module, environment does not have 'eq' type -quot_abuse2.lean:9:0: error: failed to initialize quot module, unexpected type for 'eq' type constructor diff --git a/old_tests/tests/lean/quot_bug.lean b/old_tests/tests/lean/quot_bug.lean deleted file mode 100644 index 814c14dc45..0000000000 --- a/old_tests/tests/lean/quot_bug.lean +++ /dev/null @@ -1,9 +0,0 @@ -open quot -variables {A : Type} {B : A → Type} - -variable f : Π a : A, B a - -#reduce λ x, quot.lift_on ⟦f⟧ (λf : (Πx : A, B x), f) _ x - -example (x : A) : quot.lift_on ⟦f⟧ (λf : (Πx : A, B x), f) sorry x = f x := -rfl diff --git a/old_tests/tests/lean/quot_bug.lean.expected.out b/old_tests/tests/lean/quot_bug.lean.expected.out deleted file mode 100644 index 25310cb708..0000000000 --- a/old_tests/tests/lean/quot_bug.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -λ (x : A), f x -quot_bug.lean:8:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/quot_ind_bug.lean b/old_tests/tests/lean/quot_ind_bug.lean deleted file mode 100644 index 1f16f37522..0000000000 --- a/old_tests/tests/lean/quot_ind_bug.lean +++ /dev/null @@ -1,6 +0,0 @@ -open quotient - -variables {A : Type} [s : setoid A] {B : quotient s → Prop} (c : ∀ (a : A), B (quotient.mk a)) (a : A) -#check (quotient.ind c ⟦a⟧ : B ⟦a⟧) -#check c a -#reduce (quotient.ind c ⟦a⟧ : B ⟦a⟧) diff --git a/old_tests/tests/lean/quot_ind_bug.lean.expected.out b/old_tests/tests/lean/quot_ind_bug.lean.expected.out deleted file mode 100644 index 7ce7412b6d..0000000000 --- a/old_tests/tests/lean/quot_ind_bug.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -quotient.ind c ⟦a⟧ : (λ (_x : quotient s), B _x) ⟦a⟧ -c a : B ⟦a⟧ -c a diff --git a/old_tests/tests/lean/quote_error_pos.lean b/old_tests/tests/lean/quote_error_pos.lean deleted file mode 100644 index 138d9ed4af..0000000000 --- a/old_tests/tests/lean/quote_error_pos.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -meta def apply_zero_add (a : pexpr) : tactic unit := -to_expr ``(zero_add %%a) >>= exact - -example (a : nat) : 0 + a = a := -begin - apply_zero_add ``(tt), -- Error should be here -end - -meta def apply_zero_add2 (a : pexpr) : tactic unit := -`[apply zero_add %%a] - -example (a : nat) : 0 + a = a := -begin - apply_zero_add2 ``(tt), -- Error should be here -end diff --git a/old_tests/tests/lean/quote_error_pos.lean.expected.out b/old_tests/tests/lean/quote_error_pos.lean.expected.out deleted file mode 100644 index 5ee037f139..0000000000 --- a/old_tests/tests/lean/quote_error_pos.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -quote_error_pos.lean:8:2: error: failed to synthesize type class instance for -a : ℕ -⊢ add_monoid bool -state: -a : ℕ -⊢ 0 + a = a -quote_error_pos.lean:16:2: error: failed to synthesize type class instance for -a : ℕ -⊢ add_monoid bool -state: -a : ℕ -⊢ 0 + a = a diff --git a/old_tests/tests/lean/readlinkf.sh b/old_tests/tests/lean/readlinkf.sh deleted file mode 100755 index c6ae5baa00..0000000000 --- a/old_tests/tests/lean/readlinkf.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -TARGET_FILE=$1 - -cd `dirname $TARGET_FILE` -TARGET_FILE=`basename $TARGET_FILE` - -# Iterate down a (possible) chain of symlinks -while [ -L "$TARGET_FILE" ] -do - TARGET_FILE=`readlink $TARGET_FILE` - cd `dirname $TARGET_FILE` - TARGET_FILE=`basename $TARGET_FILE` -done - -# Compute the canonicalized name by finding the physical path -# for the directory we're in and appending the target file. -PHYS_DIR=`pwd -P` -RESULT=$PHYS_DIR/$TARGET_FILE -echo $RESULT diff --git a/old_tests/tests/lean/record_rec_protected.lean b/old_tests/tests/lean/record_rec_protected.lean deleted file mode 100644 index c741f3ae71..0000000000 --- a/old_tests/tests/lean/record_rec_protected.lean +++ /dev/null @@ -1,8 +0,0 @@ --- - -structure point (A : Type) (B : Type) := -mk :: (x : A) (y : B) - -open point - -#check rec -- error, rec is protected diff --git a/old_tests/tests/lean/record_rec_protected.lean.expected.out b/old_tests/tests/lean/record_rec_protected.lean.expected.out deleted file mode 100644 index 5ad63e0c1d..0000000000 --- a/old_tests/tests/lean/record_rec_protected.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -record_rec_protected.lean:8:7: error: unknown identifier 'rec' diff --git a/old_tests/tests/lean/red.lean b/old_tests/tests/lean/red.lean deleted file mode 100644 index db62a23c88..0000000000 --- a/old_tests/tests/lean/red.lean +++ /dev/null @@ -1,26 +0,0 @@ -constant g : nat → nat - -noncomputable definition f := g - -example : f = g := rfl - -attribute [irreducible] f - -example : f = g := rfl -- Error - -example (a : nat) (H : a = g a) : f a = a := -eq.subst H rfl -- Error - -attribute [semireducible] f - -example (a : nat) (H : a = g a) : f a = a := -eq.subst H rfl -- Error - -example : f = g := rfl - -attribute [reducible] f - -example : f = g := rfl - -example (a : nat) (H : a = g a) : f a = a := -@@eq.subst (λ x, f a = x) (eq.symm H) (eq.refl (f a)) diff --git a/old_tests/tests/lean/red.lean.expected.out b/old_tests/tests/lean/red.lean.expected.out deleted file mode 100644 index 62a94625d8..0000000000 --- a/old_tests/tests/lean/red.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -red.lean:9:19: error: type mismatch, term - rfl -has type - ?m_2 = ?m_2 -but is expected to have type - f = g -red.lean:12:0: error: "eliminator" elaborator type mismatch, term - rfl -has type - ?m_2 = ?m_2 -but is expected to have type - f a = a -Additional information: -red.lean:12:0: context: the inferred motive for the eliminator-like application is - λ (_x : ℕ), f a = a -red.lean:17:0: error: "eliminator" elaborator type mismatch, term - rfl -has type - ?m_2 = ?m_2 -but is expected to have type - f a = a -Additional information: -red.lean:17:0: context: the inferred motive for the eliminator-like application is - λ (_x : ℕ), f a = a diff --git a/old_tests/tests/lean/refine_error.lean b/old_tests/tests/lean/refine_error.lean deleted file mode 100644 index 98bc3dfd2c..0000000000 --- a/old_tests/tests/lean/refine_error.lean +++ /dev/null @@ -1,5 +0,0 @@ -constant p {α : Type} [has_zero α] : α → Prop -constant pax {α : Type} [has_zero α] : p (0:α) - -lemma ex : p (0:nat) := -@pax int _ diff --git a/old_tests/tests/lean/refine_error.lean.expected.out b/old_tests/tests/lean/refine_error.lean.expected.out deleted file mode 100644 index 014d7acb71..0000000000 --- a/old_tests/tests/lean/refine_error.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -refine_error.lean:5:1: error: type mismatch, term - pax -has type - @p ℤ int.has_zero 0 -but is expected to have type - @p ℕ nat.has_zero 0 diff --git a/old_tests/tests/lean/reflect.lean b/old_tests/tests/lean/reflect.lean deleted file mode 100644 index 924f2d4df3..0000000000 --- a/old_tests/tests/lean/reflect.lean +++ /dev/null @@ -1 +0,0 @@ -#eval to_string $ (reflect 0).to_expr diff --git a/old_tests/tests/lean/reflect.lean.expected.out b/old_tests/tests/lean/reflect.lean.expected.out deleted file mode 100644 index 465b738582..0000000000 --- a/old_tests/tests/lean/reflect.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -"has_zero.zero.{0} nat nat.has_zero" diff --git a/old_tests/tests/lean/reflect_type_defeq.lean b/old_tests/tests/lean/reflect_type_defeq.lean deleted file mode 100644 index d54c97ce1a..0000000000 --- a/old_tests/tests/lean/reflect_type_defeq.lean +++ /dev/null @@ -1,2 +0,0 @@ -meta def foo (x : reflected (3 : ℕ)) : reflected ([10] : list ℕ) := -x -- ERROR \ No newline at end of file diff --git a/old_tests/tests/lean/reflect_type_defeq.lean.expected.out b/old_tests/tests/lean/reflect_type_defeq.lean.expected.out deleted file mode 100644 index 0cb5ccb973..0000000000 --- a/old_tests/tests/lean/reflect_type_defeq.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -reflect_type_defeq.lean:2:0: error: equation type mismatch, term - x -has type - reflected 3 -but is expected to have type - reflected [10] diff --git a/old_tests/tests/lean/reserve_bugs.lean b/old_tests/tests/lean/reserve_bugs.lean deleted file mode 100644 index 922c2e0223..0000000000 --- a/old_tests/tests/lean/reserve_bugs.lean +++ /dev/null @@ -1,29 +0,0 @@ --- - -constant f : nat → nat -constant g : nat → nat → nat -constant h : nat → nat → nat - -reserve infixl `+`:65 -reserve infixr `&`:70 -reserve infixl `-`:65 -reserve prefix `-`:100 - - -local infixl `+` := g -local infixl `-` := h -local prefix `-` := f -local infixr `&` := h - -set_option pp.notation false - -#check -(1:nat) + 2 -#check 1 & 2 & 3 & 4 -#check (1:nat) - 2 - 3 - 4 - -infixr `~~`:60 := h -infixl `!!`:60 := h - -#check 1 ~~ 2 ~~ 3 ~~ 4 -#check 1 !! 2 !! 3 !! 4 -#check 1 ~~ 2 + 3 ~~ 4 diff --git a/old_tests/tests/lean/reserve_bugs.lean.expected.out b/old_tests/tests/lean/reserve_bugs.lean.expected.out deleted file mode 100644 index 434690626b..0000000000 --- a/old_tests/tests/lean/reserve_bugs.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -g (f 1) 2 : nat -h 1 (h 2 (h 3 4)) : nat -h (h (h 1 2) 3) 4 : nat -h 1 (h 2 (h 3 4)) : nat -h (h (h 1 2) 3) 4 : nat -h 1 (h (g 2 3) 4) : nat diff --git a/old_tests/tests/lean/restrict_bug.lean b/old_tests/tests/lean/restrict_bug.lean deleted file mode 100644 index 691a6af0c5..0000000000 --- a/old_tests/tests/lean/restrict_bug.lean +++ /dev/null @@ -1,5 +0,0 @@ -axiom all {A : Type}: list A → (A → Prop) → Prop -variable {A : Type} -variable {R : A → A → Prop} -set_option pp.all true -#check ∀ a l, all l (R a) diff --git a/old_tests/tests/lean/restrict_bug.lean.expected.out b/old_tests/tests/lean/restrict_bug.lean.expected.out deleted file mode 100644 index b3e7256302..0000000000 --- a/old_tests/tests/lean/restrict_bug.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -∀ (a : A) (l : list.{0} A), @all A l (R a) : Prop diff --git a/old_tests/tests/lean/rev_tac1.lean b/old_tests/tests/lean/rev_tac1.lean deleted file mode 100644 index 0327ca37c3..0000000000 --- a/old_tests/tests/lean/rev_tac1.lean +++ /dev/null @@ -1,10 +0,0 @@ -open tactic - -example (a b : nat) (H : a > 0) (H : a > b) (H : b > 0) : a = b → true := -by do - a ← get_local `a, - n ← revert a, - trace n, - trace_state, - intros, - constructor diff --git a/old_tests/tests/lean/rev_tac1.lean.expected.out b/old_tests/tests/lean/rev_tac1.lean.expected.out deleted file mode 100644 index ea2efe2555..0000000000 --- a/old_tests/tests/lean/rev_tac1.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -3 -b : ℕ, -H : b > 0 -⊢ ∀ (a : ℕ), a > 0 → a > b → a = b → true diff --git a/old_tests/tests/lean/revert_frozen_dep.lean b/old_tests/tests/lean/revert_frozen_dep.lean deleted file mode 100644 index 28fe85e04c..0000000000 --- a/old_tests/tests/lean/revert_frozen_dep.lean +++ /dev/null @@ -1,4 +0,0 @@ -lemma ex {α : id Type} [has_add α] : true := -begin - dsimp at α -- should fail because the frozen instance `[has_add α]` depends on `α` -end diff --git a/old_tests/tests/lean/revert_frozen_dep.lean.expected.out b/old_tests/tests/lean/revert_frozen_dep.lean.expected.out deleted file mode 100644 index 0dbac90636..0000000000 --- a/old_tests/tests/lean/revert_frozen_dep.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -revert_frozen_dep.lean:3:2: error: failed to revert '_inst_1', it is a frozen local instance (possible solution: use tactic `tactic.unfreeze_local_instances` to reset the set of local instances) -state: -α : id Type, -_inst_1 : has_add α -⊢ true diff --git a/old_tests/tests/lean/right_assoc_dollar.lean b/old_tests/tests/lean/right_assoc_dollar.lean deleted file mode 100644 index 24d0ee547c..0000000000 --- a/old_tests/tests/lean/right_assoc_dollar.lean +++ /dev/null @@ -1,5 +0,0 @@ -constant f : nat → nat → nat - -open nat - -#check f $ succ $ 10 + 20 diff --git a/old_tests/tests/lean/right_assoc_dollar.lean.expected.out b/old_tests/tests/lean/right_assoc_dollar.lean.expected.out deleted file mode 100644 index b941527614..0000000000 --- a/old_tests/tests/lean/right_assoc_dollar.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -f (succ (10 + 20)) : ℕ → ℕ diff --git a/old_tests/tests/lean/rquote.lean b/old_tests/tests/lean/rquote.lean deleted file mode 100644 index c419edc653..0000000000 --- a/old_tests/tests/lean/rquote.lean +++ /dev/null @@ -1,34 +0,0 @@ --- -namespace foo - constant f : nat → nat - constant g : nat → nat -end foo - -namespace boo - constant f : nat → nat -end boo - -open foo boo - -#check ``f - -#check ``g - -open nat - -#check ``has_add.add - -#check ``gcd - -#check `f -#check `foo.f - -namespace bla -section - parameter A : Type - definition ID : A → A := λ x, x - - #check ``ID - -end -end bla diff --git a/old_tests/tests/lean/rquote.lean.expected.out b/old_tests/tests/lean/rquote.lean.expected.out deleted file mode 100644 index a6c428db7a..0000000000 --- a/old_tests/tests/lean/rquote.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -rquote.lean:13:7: error: invalid resolved quoted symbol, it is ambiguous, possible interpretations: boo.f foo.f (solution: use fully qualified names) -name.mk_string "g" (name.mk_string "foo" name.anonymous) : name -name.mk_string "add" (name.mk_string "has_add" name.anonymous) : name -name.mk_string "gcd" (name.mk_string "nat" name.anonymous) : name -name.mk_string "f" name.anonymous : name -name.mk_string "f" (name.mk_string "foo" name.anonymous) : name -rquote.lean:31:9: error: invalid quoted symbol, failed to resolve it (solution: use ` to bypass name resolution) diff --git a/old_tests/tests/lean/run/1089.lean b/old_tests/tests/lean/run/1089.lean deleted file mode 100644 index d48b1d4249..0000000000 --- a/old_tests/tests/lean/run/1089.lean +++ /dev/null @@ -1,19 +0,0 @@ -import system.io - -inductive token -| eof : token -| plus : token -| var : string -> token - -open token -open option - -def to_token : list char → option token -| [] := none -| (c :: cs) := - let t : option token := match c with - | 'x' := some (var "x") - | 'y' := some (var "y") - | '+' := some plus - | _ := none - end in t diff --git a/old_tests/tests/lean/run/1093.lean b/old_tests/tests/lean/run/1093.lean deleted file mode 100644 index 79c844e286..0000000000 --- a/old_tests/tests/lean/run/1093.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic nat - -constant zadd (a : nat) : 0 + a = a -constant le.refl (a : nat) : a ≤ a -attribute [simp] zadd - -example (a : nat) : 0 + a ≤ a := -by simp diff --git a/old_tests/tests/lean/run/1163.lean b/old_tests/tests/lean/run/1163.lean deleted file mode 100644 index 52837a2cdb..0000000000 --- a/old_tests/tests/lean/run/1163.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive {u} Foo : Type → Type (u+1) -| mk : Π (X : Type), Foo X -| wrap : Π (X : Type), Foo X → Foo X - -def rig : Π {X : Type}, Foo X → Foo X -| X (Foo.wrap .(X) foo) := foo -| X foo := foo diff --git a/old_tests/tests/lean/run/1171.lean b/old_tests/tests/lean/run/1171.lean deleted file mode 100644 index e986e94e08..0000000000 --- a/old_tests/tests/lean/run/1171.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive foo : nat → Type -| f1 : foo 1 -| fn : Pi (n : nat), foo n - -def rig : Pi (n : nat), foo n → bool -| 1 foo.f1 := tt -| _ _ := ff diff --git a/old_tests/tests/lean/run/1208.lean b/old_tests/tests/lean/run/1208.lean deleted file mode 100644 index 26a5d489af..0000000000 --- a/old_tests/tests/lean/run/1208.lean +++ /dev/null @@ -1,2 +0,0 @@ -lemma foo {α : Type*} {f : α → α} (a : α) : f a = f a := rfl -example {X : Type} (h : X → X) (x₀ : X) : h x₀ = h x₀ := by apply (foo x₀) diff --git a/old_tests/tests/lean/run/1216.lean b/old_tests/tests/lean/run/1216.lean deleted file mode 100644 index 1ff1260266..0000000000 --- a/old_tests/tests/lean/run/1216.lean +++ /dev/null @@ -1,23 +0,0 @@ -open nat - -inductive {u} Vec (X : Type u) : ℕ → Type u -| nil {} : Vec 0 -| cons : X → Pi {n : nat}, Vec n → Vec (n + 1) - -namespace Vec -def get₂ {A : Type} : Π {n : ℕ}, Vec A (succ $ succ n) → A -| n (cons x₁ (cons x₂ xs)) := x₂ - -def get₂a {A : Type} : Π {n : ℕ}, Vec A (n+2) → A -| 0 (cons x₁ (cons x₂ xs)) := x₂ -| (n+1) (cons x₁ (cons x₂ xs)) := x₂ - -def get₂b {A : Type} : Π {n : ℕ}, Vec A (n+2) → A -| n (cons x₁ (cons x₂ xs)) := x₂ - -def get₂c {A : Type} : Π {n : ℕ}, Vec A (n+2) → A -| .(n) (@cons .(A) x₁ .(n+1) (@cons .(A) x₂ n xs)) := x₂ - -def get₂d {A : Type} : Π {n : ℕ}, Vec A (n+2) → A -| .(n) (@cons .(A) x₁ (n+1) (@cons .(A) x₂ .(n) xs)) := x₂ -end Vec diff --git a/old_tests/tests/lean/run/1218.lean b/old_tests/tests/lean/run/1218.lean deleted file mode 100644 index 67a132460d..0000000000 --- a/old_tests/tests/lean/run/1218.lean +++ /dev/null @@ -1,2 +0,0 @@ -example (h : false) : "hello" = "goodbye" := -begin try {reflexivity}, contradiction end diff --git a/old_tests/tests/lean/run/1226.lean b/old_tests/tests/lean/run/1226.lean deleted file mode 100644 index cfa6b2d8ce..0000000000 --- a/old_tests/tests/lean/run/1226.lean +++ /dev/null @@ -1,63 +0,0 @@ -open nat - -inductive {u} vec (α : Type u) : ℕ → Type u -| nil {} : vec 0 -| cons : α → Π {n : nat}, vec n → vec (n+1) - -namespace vec -def head {α : Type*} : Π {n : ℕ}, vec α (n+1) → α -| n (cons x xs) := x -end vec - -constants (dret : Π {n : ℕ}, vec nat n → (vec nat n → nat) → nat) -axiom dret_spec : Π {n : ℕ} (xs : vec nat n) (f : vec nat n → nat), dret xs f = f xs - -example (v : vec nat 1) : dret v vec.head = vec.head v := -by rw dret_spec - -example (v : vec nat 2) : dret v vec.head = vec.head v := -by rw dret_spec - -example (v : vec nat 3) : dret v vec.head = vec.head v := -by rw dret_spec - -example (v : vec nat 6) : dret v vec.head = vec.head v := -by rw dret_spec - -example (v : vec nat 32) : dret v vec.head = vec.head v := -by rw dret_spec - -example (v : vec nat 63) : dret v vec.head = vec.head v := -by rw dret_spec - -example (v : vec nat 64) : dret v vec.head = vec.head v := -by rw dret_spec - -example {n : nat} (v : vec nat (n+1)) : dret v vec.head = vec.head v := -by rw dret_spec - -example {n : nat} (v : vec nat (n+2)) : dret v vec.head = vec.head v := -by rw dret_spec - -example {n : nat} (v : vec nat (n+3)) : dret v vec.head = vec.head v := -by rw dret_spec - -attribute [simp] dret_spec - -example (v : vec nat 1) : dret v vec.head = vec.head v := -by simp - -example (v : vec nat 2) : dret v vec.head = vec.head v := -by simp - -example (v : vec nat 3) : dret v vec.head = vec.head v := -by simp - -example {n : nat} (v : vec nat (n+1)) : dret v vec.head = vec.head v := -by simp - -example {n : nat} (v : vec nat (n+2)) : dret v vec.head = vec.head v := -by simp - -example {n : nat} (v : vec nat (n+3)) : dret v vec.head = vec.head v := -by simp diff --git a/old_tests/tests/lean/run/1253.lean b/old_tests/tests/lean/run/1253.lean deleted file mode 100644 index b3f1543b7a..0000000000 --- a/old_tests/tests/lean/run/1253.lean +++ /dev/null @@ -1,8 +0,0 @@ -open list -lemma induction₂ {α₁ α₂ : Type*} (p : list α₁ → list α₂ → Prop) - (h_base : p [] []) - (h_step : ∀ {xs₁ xs₂}, p xs₁ xs₂ → (∀ x₁ x₂, p (x₁::xs₁) (x₂::xs₂))) : - Π (xs₁ : list α₁) (xs₂ : list α₂) (H_same_len : length xs₁ = length xs₂), p xs₁ xs₂ - -| [] [] h := h_base -| (x₁::xs₁) (x₂::xs₂) h := h_step (induction₂ xs₁ xs₂ sorry) x₁ x₂ diff --git a/old_tests/tests/lean/run/1258.lean b/old_tests/tests/lean/run/1258.lean deleted file mode 100644 index add8dceff4..0000000000 --- a/old_tests/tests/lean/run/1258.lean +++ /dev/null @@ -1,4 +0,0 @@ -constant P : list ℕ → list ℕ → Prop -lemma foo (xs : list ℕ) : Π (ns : list ℕ), P xs ns -| [] := sorry -| (n::ns) := begin clear foo, cases xs, exact sorry, exact sorry end diff --git a/old_tests/tests/lean/run/1260.lean b/old_tests/tests/lean/run/1260.lean deleted file mode 100644 index b5d4be6508..0000000000 --- a/old_tests/tests/lean/run/1260.lean +++ /dev/null @@ -1,32 +0,0 @@ -inductive dvec {X : Type} (Y : X → Type) : list X → Type -| dnil {} : dvec [] -| dcons : Π {x : X}, Y x → Π {xs : list X}, dvec xs → dvec (x::xs) - -namespace dvec - -notation `⟦` l:(foldr `, ` (h t, dvec.dcons h t) dvec.dnil `⟧`) := l - -def get {X : Type} [decidable_eq X] {Y : X → Type} (x₀ : X) [inhabited (Y x₀)] - : Π {xs : list X}, dvec Y xs → ℕ → Y x₀ -| [] _ _ := default (Y x₀) -| (x::xs) (dvec.dcons y ys) 0 := if H : x = x₀ then eq.rec_on H y else default (Y x₀) -| (x::xs) (dvec.dcons y ys) (n+1) := get ys n - -end dvec - -constant tensor : list ℕ → Type -noncomputable instance inhabited_tensor (shape : list ℕ) : inhabited (tensor shape) := sorry -constant f {shape : list ℕ} : tensor shape → tensor shape → tensor shape - -noncomputable def bar {shape : list ℕ} (μσ : dvec tensor [shape, shape]) : tensor shape := - let μ := dvec.get shape μσ 0, σ := dvec.get shape μσ 1 in f μ σ - -lemma foo {shape : list ℕ} (μ σ : tensor shape) : - bar ⟦μ, σ⟧ = bar ⟦μ, σ⟧ := -suffices H_suffices : true, from -begin -dunfold bar, dsimp, -dunfold dvec.get, -reflexivity -end, -trivial diff --git a/old_tests/tests/lean/run/1295.lean b/old_tests/tests/lean/run/1295.lean deleted file mode 100644 index acd00168d7..0000000000 --- a/old_tests/tests/lean/run/1295.lean +++ /dev/null @@ -1,12 +0,0 @@ -set_option pp.all true -open tactic - -example : true := by do -a ← to_expr ``((0 : ℕ)), b ← to_expr ``(nat.zero), -fail_if_success (unify a b transparency.none), -triv - -example (x : ℕ) : true := by do -a ← to_expr ```((x + 0 : ℕ)), b ← to_expr ```(x + nat.zero), -fail_if_success (unify a b transparency.none), -triv diff --git a/old_tests/tests/lean/run/1302.lean b/old_tests/tests/lean/run/1302.lean deleted file mode 100644 index a235a88bd8..0000000000 --- a/old_tests/tests/lean/run/1302.lean +++ /dev/null @@ -1,5 +0,0 @@ -open list fin - -#eval map (λ i, true) [1] -#eval map (λ i, true) [1, 2, 3] -#eval map (λ (i : fin 2), true) [fin.mk 0 dec_trivial, fin.mk 1 dec_trivial] diff --git a/old_tests/tests/lean/run/1315a.lean b/old_tests/tests/lean/run/1315a.lean deleted file mode 100644 index 2b691bf5ff..0000000000 --- a/old_tests/tests/lean/run/1315a.lean +++ /dev/null @@ -1,35 +0,0 @@ -def k : ℕ := 0 - -def works : Π (n : ℕ) (m : ℕ), ℕ -| 0 m := 0 -| (n+1) m := - let val := m+1 in - match works n val with - | 0 := 0 - | (l+1) := 0 - end - -def works2 : Π (n : ℕ) (m : ℕ), ℕ -| 0 m := 0 -| (n+1) m := - match k with - | 0 := 0 - | (i+1) := - match works2 n (m+1) with - | 0 := 0 - | (l+1) := 0 - end - end - -def fails : Π (n : ℕ) (m : ℕ), ℕ -| 0 m := 0 -| (n+1) m := - match k with - | 0 := 0 - | (i+1) := - let val := m+1 in - match fails n val with - | 0 := 0 - | (l+1) := 0 - end - end diff --git a/old_tests/tests/lean/run/1315b.lean b/old_tests/tests/lean/run/1315b.lean deleted file mode 100644 index 6bf710ce35..0000000000 --- a/old_tests/tests/lean/run/1315b.lean +++ /dev/null @@ -1,61 +0,0 @@ -open nat - -def k : ℕ := 0 - -def fails : Π (n : ℕ) (m : ℕ), ℕ -| 0 m := 0 -| (succ n) m := - match k with - | 0 := 0 - | (succ i) := - let val := m+1 in - match fails n val with - | 0 := 0 - | (succ l) := 0 - end - end - - -def test (k : ℕ) : Π (n : ℕ) (m : ℕ), ℕ -| 0 m := 0 -| (succ n) m := - match k with - | 0 := 1 - | (succ i) := - let val := m+1 in - match test n val with - | 0 := 2 - | (succ l) := 3 - end - end - -example (k m : ℕ) : test k 0 m = 0 := -rfl - -example (m n : ℕ) : test 0 (succ n) m = 1 := -rfl - -example (k m : ℕ) : test (succ k) 1 m = 2 := -rfl - -example (k m : ℕ) : test (succ k) 2 m = 3 := -rfl - -example (k m : ℕ) : test (succ k) 3 m = 3 := -rfl - -open tactic - -run_cmd do - t ← infer_type `(test._match_2), - trace t, - tactic.interactive.guard_expr_eq t ```(nat → nat) - -example (k m n : ℕ) : test (succ k) (succ (succ n)) m = 3 := -begin - revert m, - induction n with n', - { intro, reflexivity}, - { intro, - simp [test, n_ih] } -end diff --git a/old_tests/tests/lean/run/1318.lean b/old_tests/tests/lean/run/1318.lean deleted file mode 100644 index 86d2a6c7fa..0000000000 --- a/old_tests/tests/lean/run/1318.lean +++ /dev/null @@ -1,4 +0,0 @@ -def tester : Π (n : ℕ) (e : fin n), true -- fails : "infer type failed, unknown variable m" -| 0 e := trivial -| (m+1) (fin.mk 0 lt) := trivial -| (m+1) (fin.mk (k+1) lt) := trivial diff --git a/old_tests/tests/lean/run/1331.lean b/old_tests/tests/lean/run/1331.lean deleted file mode 100644 index 98bccad9ee..0000000000 --- a/old_tests/tests/lean/run/1331.lean +++ /dev/null @@ -1,21 +0,0 @@ -def is_space : char → Prop -| ' ' := true -| '\x09' := true -- \t -| '\n' := true -| '\x0d' := true -- \r -| _ := false - -instance is_space.decidable_pred : decidable_pred is_space := -begin delta is_space, apply_instance end - -def f (a : nat) : nat := -a + 2 - -open tactic - -lemma flemma : f 0 = 2 := -begin - delta f, - guard_target 0 + 2 = 2, - reflexivity -end diff --git a/old_tests/tests/lean/run/1335.lean b/old_tests/tests/lean/run/1335.lean deleted file mode 100644 index 37f5bb581b..0000000000 --- a/old_tests/tests/lean/run/1335.lean +++ /dev/null @@ -1,17 +0,0 @@ -namespace int - -private lemma sub_nat_nat_elim (m n : ℕ) (P : ℕ → ℕ → ℤ → Prop) - (hp : ∀i n, P (n + i) n (of_nat i)) - (hn : ∀i m, P m (m + i + 1) (-[1+ i])) : - P m n (sub_nat_nat m n) := -sorry - -inductive rel_int_nat_nat__ : ℤ → ℕ × ℕ → Prop -| pos : ∀m p, rel_int_nat_nat__ (of_nat p) (m + p, m) -| neg : ∀m n, rel_int_nat_nat__ (neg_succ_of_nat n) (m, m + n) - -lemma rel_sub_nat_nat__ {a b : ℕ} : rel_int_nat_nat__ (sub_nat_nat a b) (a, b) := -/- The next statement kills lean -/ -sub_nat_nat_elim a b (λ(a b : ℕ) (i : ℤ), rel_int_nat_nat__ i (a, b)) sorry sorry - -end int diff --git a/old_tests/tests/lean/run/1343.lean b/old_tests/tests/lean/run/1343.lean deleted file mode 100644 index ba16866aaf..0000000000 --- a/old_tests/tests/lean/run/1343.lean +++ /dev/null @@ -1,19 +0,0 @@ -universe variable u - -namespace ex1 -inductive foo (α : Type (u+1)) : Type (u+1) -| mk : α → foo - -inductive bug -| leaf : bug -| mk : foo bug → bug -end ex1 - -namespace ex2 -inductive foo (α : Type u) : Type u -| mk : α → foo - -inductive bug -| leaf : bug -| mk : foo bug → bug -end ex2 diff --git a/old_tests/tests/lean/run/1414.lean b/old_tests/tests/lean/run/1414.lean deleted file mode 100644 index ec5ecd4c76..0000000000 --- a/old_tests/tests/lean/run/1414.lean +++ /dev/null @@ -1,5 +0,0 @@ -def Union {α : Prop} {β : Type} (s : α → set β) (x : β) : Prop := -∃ i, x ∈ s i - -example (y : ℕ) (t : set ℕ) : Union (λH : (∃x, x ∈ t), t) y → true -| ⟨⟨z, z_ex⟩, y_in⟩ := ⟨⟩ diff --git a/old_tests/tests/lean/run/1430.lean b/old_tests/tests/lean/run/1430.lean deleted file mode 100644 index 67ad2b95c8..0000000000 --- a/old_tests/tests/lean/run/1430.lean +++ /dev/null @@ -1,22 +0,0 @@ -universe variables u - -inductive foo_basic (A : Type u) : psum unit ℕ → Type u -| mk : Π n, foo_basic (psum.inr n) → foo_basic (psum.inl ()) -| nil : foo_basic (psum.inr 0) -| cons : Π {n}, A → foo_basic (psum.inr n) → foo_basic (psum.inr (n+1)) - -def foo (A : Type u) : Type u := foo_basic A (psum.inl ()) -def foo.vec (A : Type u) (n : ℕ) : Type u := foo_basic A (psum.inr n) - -def foo.mk (A : Type u) : Π n, foo.vec A n → foo A := foo_basic.mk - -lemma layer3.foo.mk.inj (A : Type u) : - ∀ (n₁ n₂ : ℕ) (xs₁ : foo.vec A n₁) (xs₂ : foo.vec A n₂), - @foo.mk A n₁ xs₁ = @foo.mk A n₂ xs₂ - → xs₁ == xs₂ := -begin -dunfold foo.mk, -begin [smt] -intros n₁ n₂ xs₁ xs₂ H, -end -end diff --git a/old_tests/tests/lean/run/1433.lean b/old_tests/tests/lean/run/1433.lean deleted file mode 100644 index 2d49585860..0000000000 --- a/old_tests/tests/lean/run/1433.lean +++ /dev/null @@ -1,7 +0,0 @@ -protected def num_denum := ℤ × {d:ℤ // d > 0} - -protected def rel : num_denum → num_denum → Prop -| ⟨n₁, ⟨d₁, _⟩⟩ ⟨n₂, ⟨d₂, _⟩⟩ := n₁ = n₂ - -example : ∀(a : num_denum), rel a a := -λ⟨n₁, ⟨d₁, h₁⟩⟩, show n₁ = n₁, begin [smt] end diff --git a/old_tests/tests/lean/run/1442.lean b/old_tests/tests/lean/run/1442.lean deleted file mode 100644 index d22c036f19..0000000000 --- a/old_tests/tests/lean/run/1442.lean +++ /dev/null @@ -1,11 +0,0 @@ -protected def rel : ℤ × ℤ → ℤ × ℤ → Prop -| ⟨n₁, d₁⟩ ⟨n₂, d₂⟩ := n₁ * d₂ = n₂ * d₁ - -private def mul' : ℤ × ℤ → ℤ × ℤ → ℤ × ℤ -| ⟨n₁, d₁⟩ ⟨n₂, d₂⟩ := ⟨n₁ * n₂, d₁ * d₂⟩ - -example : ∀(a b c d : ℤ × ℤ), rel a c → rel b d → rel (mul' a b) (mul' c d) := -λ⟨n₁, d₁⟩ ⟨n₂, d₂⟩ ⟨n₃, d₃⟩ ⟨n₄, d₄⟩, - assume (h₁ : n₁ * d₃ = n₃ * d₁) (h₂ : n₂ * d₄ = n₄ * d₂), - show (n₁ * n₂) * (d₃ * d₄) = (n₃ * n₄) * (d₁ * d₂), - by cc diff --git a/old_tests/tests/lean/run/1458.lean b/old_tests/tests/lean/run/1458.lean deleted file mode 100644 index 744b017719..0000000000 --- a/old_tests/tests/lean/run/1458.lean +++ /dev/null @@ -1,15 +0,0 @@ -namespace repro1 - structure s := - (obj : Type) - (fn : ∀ {o : obj}, true) - - #check λ t, s.fn t -end repro1 - -namespace repro2 - constant s : Type - constant f : s → Type - constant mfn : Π (t : s) (o : f t), true - set_option pp.all true - #check λ t, mfn t _ -end repro2 diff --git a/old_tests/tests/lean/run/1493.lean b/old_tests/tests/lean/run/1493.lean deleted file mode 100644 index d9c8809ced..0000000000 --- a/old_tests/tests/lean/run/1493.lean +++ /dev/null @@ -1,5 +0,0 @@ -open tactic.interactive - -meta def bug : tactic unit := do -_ ← solve1 refl, -return () diff --git a/old_tests/tests/lean/run/1495.lean b/old_tests/tests/lean/run/1495.lean deleted file mode 100644 index 7903769634..0000000000 --- a/old_tests/tests/lean/run/1495.lean +++ /dev/null @@ -1,10 +0,0 @@ -section -variables (r : ℕ → ℕ → Prop) -local infix `≼` : 50 := r - -example {a b : ℕ} : a ≼ b → true := -begin - show a ≼ b → true, - {intro x, tactic.triv} -end -end diff --git a/old_tests/tests/lean/run/1525.lean b/old_tests/tests/lean/run/1525.lean deleted file mode 100644 index ca3ea2dbe1..0000000000 --- a/old_tests/tests/lean/run/1525.lean +++ /dev/null @@ -1,12 +0,0 @@ -section t - -parameter t : Type - -inductive eqt : t -> t -> Prop -| refl : forall x : t, eqt x x - -#check eqt - -end t - -#check eqt diff --git a/old_tests/tests/lean/run/1557.lean b/old_tests/tests/lean/run/1557.lean deleted file mode 100644 index c99ad85a17..0000000000 --- a/old_tests/tests/lean/run/1557.lean +++ /dev/null @@ -1,10 +0,0 @@ -class A (α : Type) := -(op : α → α → α) - -class B (α : Type) extends A α := -(op := λ a b, a) -(op_prop : ∀ a b, op a b = a) - -class B' (α : Type) extends A α := -(op_prop : ∀ a b, op a b = a) -(op := λ a b, a) diff --git a/old_tests/tests/lean/run/1562.lean b/old_tests/tests/lean/run/1562.lean deleted file mode 100644 index 3a0f450bc0..0000000000 --- a/old_tests/tests/lean/run/1562.lean +++ /dev/null @@ -1,14 +0,0 @@ -meta constant term : Type -meta constant smt2.builder.int_const : int -> term - -meta constant smt2_state : Type - -@[reducible] meta def smt2_m (α : Type) := -state_t smt2_state tactic α - -meta instance tactic_to_smt2_m (α : Type) : has_coe (tactic α) (smt2_m α) := -⟨ fun tc, ⟨fun s, do res ← tc, return (res, s)⟩ ⟩ - -meta def reflect_arith_formula : expr → smt2_m term -| `(has_zero.zero) := smt2.builder.int_const <$> tactic.eval_expr int `(has_zero.zero int) -| a := tactic.fail "foo" diff --git a/old_tests/tests/lean/run/1577.lean b/old_tests/tests/lean/run/1577.lean deleted file mode 100644 index 5f1738b4f3..0000000000 --- a/old_tests/tests/lean/run/1577.lean +++ /dev/null @@ -1,17 +0,0 @@ -section - -parameter T : Type - -def eqT : T -> T -> Prop -| t1 t2 := t1 = t2 - -lemma sm : forall t1 t2, -eqT t1 t2 -> -t1 = t2 := -begin -intros, -simp [eqT] at a, -assumption -end - -end diff --git a/old_tests/tests/lean/run/1585.lean b/old_tests/tests/lean/run/1585.lean deleted file mode 100644 index 4911c4a3c4..0000000000 --- a/old_tests/tests/lean/run/1585.lean +++ /dev/null @@ -1,2 +0,0 @@ -structure foo (α : Type) extends has_le α -structure bar (α : Type) extends foo α diff --git a/old_tests/tests/lean/run/1587.lean b/old_tests/tests/lean/run/1587.lean deleted file mode 100644 index 4c0a78b797..0000000000 --- a/old_tests/tests/lean/run/1587.lean +++ /dev/null @@ -1,26 +0,0 @@ -def f (x : ℕ) := x - -theorem foo : ∀ (x : ℕ), f x = x := by simp [f] - -set_option pp.instantiate_mvars false - -example (x : ℕ) : f x = x := -begin - transitivity, { refl, }, - rw [foo], -end - -example (x : ℕ) : f x = x := -begin - transitivity, { refl, }, - simp [foo], -end - -example : 8 + 4 ≤ 12 := -begin - transitivity, - apply nat.add_le_add_right, - { apply le_refl, }, - - rw [norm_num.bit0_add_bit0], -end diff --git a/old_tests/tests/lean/run/1590.lean b/old_tests/tests/lean/run/1590.lean deleted file mode 100644 index 70edc8a5a3..0000000000 --- a/old_tests/tests/lean/run/1590.lean +++ /dev/null @@ -1,3 +0,0 @@ -#check `(true.intro) -#check (`(true.intro) : expr) -#check λ (h : true) [reflected h], `(id h) diff --git a/old_tests/tests/lean/run/1594_comment_issue.lean b/old_tests/tests/lean/run/1594_comment_issue.lean deleted file mode 100644 index 87d9b9c9b8..0000000000 --- a/old_tests/tests/lean/run/1594_comment_issue.lean +++ /dev/null @@ -1,9 +0,0 @@ -variables (A : Type) (f : A → ℕ → A) [has_mul A] -open nat - -theorem thm' (a : A) : ∀ m n, f a m * f a n = f a n * f a m -| 0 n := sorry -| m 0 := sorry -| (succ m) (succ n) := - have h : f a m * f a n = f a n * f a m, from thm' _ _, - sorry diff --git a/old_tests/tests/lean/run/1608.lean b/old_tests/tests/lean/run/1608.lean deleted file mode 100644 index 8416246b60..0000000000 --- a/old_tests/tests/lean/run/1608.lean +++ /dev/null @@ -1,8 +0,0 @@ -example {α : Type} {a b : α} (h : ¬ (a = b)) : b ≠ a := -by cc - -example {α : Type} {a b : α} (h : ¬ (a = b)) : ¬ (b = a) := -by cc - -example {α : Type} {a b : α} (h : ¬ (a = b)) : b ≠ a := -begin [smt] end diff --git a/old_tests/tests/lean/run/1609.lean b/old_tests/tests/lean/run/1609.lean deleted file mode 100644 index c80d9ef656..0000000000 --- a/old_tests/tests/lean/run/1609.lean +++ /dev/null @@ -1,4 +0,0 @@ -universe variable u - -inductive pred : ∀ (X : Type u), list X → Type (u+1) -| foo X (l1 : list X) (l2 : list (option X)) : pred (option X) l2 → pred X l1 diff --git a/old_tests/tests/lean/run/1623.lean b/old_tests/tests/lean/run/1623.lean deleted file mode 100644 index c5590950ae..0000000000 --- a/old_tests/tests/lean/run/1623.lean +++ /dev/null @@ -1,6 +0,0 @@ -section -parameters {A : Type} (R : list A → Prop) -structure foo (x : list A) : Prop := (bar : R x) -structure bar (x : Type) -structure baz extends bar A -end diff --git a/old_tests/tests/lean/run/1631.lean b/old_tests/tests/lean/run/1631.lean deleted file mode 100644 index e9e7da2367..0000000000 --- a/old_tests/tests/lean/run/1631.lean +++ /dev/null @@ -1,2 +0,0 @@ -constant c : ℕ -meta def t : expr := `(c) diff --git a/old_tests/tests/lean/run/1649a.lean b/old_tests/tests/lean/run/1649a.lean deleted file mode 100644 index 555d30b114..0000000000 --- a/old_tests/tests/lean/run/1649a.lean +++ /dev/null @@ -1,9 +0,0 @@ -section -def {u} typer (α : Type u) := α -parameter n : ℕ - -meta def blah (n : typer ℕ) : ℕ := n - -#check blah -end -#check blah diff --git a/old_tests/tests/lean/run/1649b.lean b/old_tests/tests/lean/run/1649b.lean deleted file mode 100644 index 3736595e14..0000000000 --- a/old_tests/tests/lean/run/1649b.lean +++ /dev/null @@ -1,13 +0,0 @@ -section - -parameter n : false -def blah (n : false) : false := n -#check @blah -- blah : false - -end - -#check @blah -- blah : false - -theorem fs : false → false := blah -- failed to add declaration to environment, it contains local constants - -#print blah -- error: invalid #print command (reported at a line below) diff --git a/old_tests/tests/lean/run/1650.lean b/old_tests/tests/lean/run/1650.lean deleted file mode 100644 index d43fe30175..0000000000 --- a/old_tests/tests/lean/run/1650.lean +++ /dev/null @@ -1,24 +0,0 @@ -def A : inhabited true → Type | ⟨t⟩ := inhabited (t = t) -def B (T : Type) (t : T) : Prop := t = t -def C {T x} : B T x := rfl - -structure X := - ( x : inhabited true ) - ( y : A x ) - ( z : B _ y ) - -def test : X := { - x := ⟨let t := trivial in t⟩, - y := sorry, - z := C -} - -constant T : nat → Type -open tactic - -example : true := -by do - let t1 : expr := `(sorry : T (1+1)), - let t2 : expr := `(sorry : T 2), - is_def_eq t1 t2, - constructor diff --git a/old_tests/tests/lean/run/1655.lean b/old_tests/tests/lean/run/1655.lean deleted file mode 100644 index 0d9355a8ba..0000000000 --- a/old_tests/tests/lean/run/1655.lean +++ /dev/null @@ -1,5 +0,0 @@ -inductive test0 : Type → Type -| intro : (λ t, t → test0 t) nat - -inductive test1 : Type → Type -| intro : let t := nat in t → test1 t diff --git a/old_tests/tests/lean/run/1657.lean b/old_tests/tests/lean/run/1657.lean deleted file mode 100644 index 7da8dddd02..0000000000 --- a/old_tests/tests/lean/run/1657.lean +++ /dev/null @@ -1,29 +0,0 @@ -namespace X1 - -inductive wrap (A : Type) : Type -| mk : A → wrap - -inductive type : Type -| mk : list type → type -| refinement : type → (bool → type) → type - -end X1 - -namespace X2 - -inductive type : Type -| mk : (bool → type) → list type → ℕ → type -| refinement : list type → type → ℕ → (∀ (b : bool), b = tt → type) → (bool → type) → type - -end X2 - -namespace X3 - -mutual inductive type, term -with type : Type -| fn : list type → type -| refinement : type → (string → type) → type -with term : Type -| apply : term - -end X3 diff --git a/old_tests/tests/lean/run/1658.lean b/old_tests/tests/lean/run/1658.lean deleted file mode 100644 index 7ef87ee1e8..0000000000 --- a/old_tests/tests/lean/run/1658.lean +++ /dev/null @@ -1,14 +0,0 @@ -constant p : bool → bool -constant P : bool → Prop - -noncomputable def lp : bool → bool -| ff := p ff -| tt := p tt - -def foo (b : bool) : Prop := -P (lp b) - -constant T : bool → Type - -def boo (b : bool) : Type := -T (lp b) diff --git a/old_tests/tests/lean/run/1663.lean b/old_tests/tests/lean/run/1663.lean deleted file mode 100644 index 09576d833b..0000000000 --- a/old_tests/tests/lean/run/1663.lean +++ /dev/null @@ -1,16 +0,0 @@ -inductive statement : Type -| Sswitch : list (option ℤ × statement) → statement -open statement - -mutual def find_label, find_label_ls -with find_label : statement → nat → option (statement × nat) -| (Sswitch sl) := λ k, find_label_ls sl k -with find_label_ls : list (option ℤ × statement) → nat → option (statement × nat) -| [] := λk, none -| ((_, s) :: sl') := λk, find_label s k <|> find_label_ls sl' k - -example : find_label_ls [] = λ k, none := -by simp [find_label_ls] - -example (n s sl) : find_label_ls ((n, s)::sl) = λ k, find_label s k <|> find_label_ls sl k := -by simp [find_label_ls] diff --git a/old_tests/tests/lean/run/1675.lean b/old_tests/tests/lean/run/1675.lean deleted file mode 100644 index 6b07612312..0000000000 --- a/old_tests/tests/lean/run/1675.lean +++ /dev/null @@ -1,48 +0,0 @@ -def foo (a b : nat) : Prop := -a = 0 ∧ b = 0 - -attribute [simp] foo - -example (p : nat → Prop) (a b : nat) : foo a b → p (a + b) → p 0 := -begin - intros h₁ h₂, - simp * at *, -end - -example (a b : nat) (p : nat → Prop) (h₁ : a = b + 0) (h₂ : b = 0) (h₃ : p a) : p 0 ∧ a = 0 := -by simp * at * - -constant q : Prop -axiom q_lemma : q - -open tactic -example (a b : nat) (p : nat → Prop) (h₁ : a = b + 0) (h₂ : b = 0) (h₃ : p a) : p 0 ∧ a = 0 ∧ q := -begin - simp * at *, - guard_target q, - do {e₁ ← get_local `h₁ >>= infer_type, e₂ ← to_expr ```(a = 0), guard (e₁ = e₂)}, - do {e₁ ← get_local `h₃ >>= infer_type, e₂ ← to_expr ```(p 0), guard (e₁ = e₂)}, - apply q_lemma -end - -example (p : nat → Prop) (a b : nat) : a = 0 ∧ b = 0 → p (a + b) → p 0 := -begin - intros h₁ h₂, - simp [h₁] at *, - assumption -end - -example (p : Prop) : p := -begin - fail_if_success {simp * at *}, -- should fail if nothing was simplified - simp * at * {fail_if_unchanged := ff}, -- should work - admit -end - -example (p : Prop) : let h : 0 = 0 := rfl in p := -begin - intro h, - simp * at *, - do {e₁ ← get_local `h >>= infer_type, e₂ ← to_expr ```(true), guard (e₁ = e₂)}, - admit -end diff --git a/old_tests/tests/lean/run/1681.lean b/old_tests/tests/lean/run/1681.lean deleted file mode 100644 index 70db944cf0..0000000000 --- a/old_tests/tests/lean/run/1681.lean +++ /dev/null @@ -1,19 +0,0 @@ -def prod.foo (s : bool × bool) (fst : bool) : bool × bool := -match s with -(a, b) := (fst, b) -end - -variable s : bool × bool - -#check prod.foo s -#check prod.foo s tt -#check s.foo -#check s.foo tt - -def prod.foo2 {α β} (s : α × β) (fst : α) : α × β := -match s with -(a, b) := (fst, b) -end - -#check s.foo2 -#check s.foo2 tt diff --git a/old_tests/tests/lean/run/1682.lean b/old_tests/tests/lean/run/1682.lean deleted file mode 100644 index fd3e7b9e63..0000000000 --- a/old_tests/tests/lean/run/1682.lean +++ /dev/null @@ -1,16 +0,0 @@ -#check - let t := to_fmt "foo" in - format.to_string t options.mk - -#check - let t := to_fmt "foo" in - t.to_string - -#check - let t := to_fmt "foo" in - t.to_string options.mk - -variable t : format - -set_option pp.all true -#check t.to_string options.mk diff --git a/old_tests/tests/lean/run/1685.lean b/old_tests/tests/lean/run/1685.lean deleted file mode 100644 index 02fe0f4072..0000000000 --- a/old_tests/tests/lean/run/1685.lean +++ /dev/null @@ -1,47 +0,0 @@ -/- This test assumes the total order on terms used by simp compares local constants - using the order they appear in the local context. -/ -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption -example (m : ℕ) : ∀ n k, m + n = k → n + m = k := by intros; simp; assumption - - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end - -example (m : ℕ) : ∀ n k, n + m = k → n + m = k := -begin intros, simp, fail_if_success {assumption}, admit end diff --git a/old_tests/tests/lean/run/1686.lean b/old_tests/tests/lean/run/1686.lean deleted file mode 100644 index 3f83c58aec..0000000000 --- a/old_tests/tests/lean/run/1686.lean +++ /dev/null @@ -1,26 +0,0 @@ -def f (n : ℕ) := n + n -def g (n : ℕ) := 2*n - -example (n : ℕ) : g (n+1) = f n + 2 := -begin - change 2 * (n + 1) = f n + 2, - unfold f, - guard_target 2 * (n + 1) = n + n + 2, - admit -end - -example (n : ℕ) : g (n+1) = f n + 2 := -begin - change g (n + 1) with 2 * (n+1), - unfold f, - guard_target 2 * (n + 1) = n + n + 2, - admit -end - -example (n : ℕ) : g (n+1) = f n + 2 := -begin - change 2 * (n + 1) = _, - unfold f, - guard_target 2 * (n + 1) = n + n + 2, - admit -end diff --git a/old_tests/tests/lean/run/1688.lean b/old_tests/tests/lean/run/1688.lean deleted file mode 100644 index 5c229c5781..0000000000 --- a/old_tests/tests/lean/run/1688.lean +++ /dev/null @@ -1,5 +0,0 @@ -example : (1 + 1 : ℤ) = 2 := -begin - change (1 + 1 : ℤ) with 2, -- goal : 2 = 2 - refl -end diff --git a/old_tests/tests/lean/run/1703.lean b/old_tests/tests/lean/run/1703.lean deleted file mode 100644 index 68c56b7d4c..0000000000 --- a/old_tests/tests/lean/run/1703.lean +++ /dev/null @@ -1,14 +0,0 @@ -namespace ns - -structure struct := -(index : ℕ) - -end ns - -open ns - -def foo : struct := -{ ns.struct . index := 1 } - -def foo2 : struct := -{ struct . index := 1 } diff --git a/old_tests/tests/lean/run/1705.lean b/old_tests/tests/lean/run/1705.lean deleted file mode 100644 index 35aef26a32..0000000000 --- a/old_tests/tests/lean/run/1705.lean +++ /dev/null @@ -1,20 +0,0 @@ -def {u} stream (α : Type u) := nat → α -constant stream.cons {α} (a : α) (s : stream α) : stream α -notation h :: t := stream.cons h t - -inductive T : Type -| mk : nat → T - -notation `&-` := T.mk - -example : T → T -| (&- x) := &- x --works - -notation `&-` := list.head - -example : T → T -| (&- x) := &- x - -def f {α} : list α → nat -| [] := 0 -| (a::as) := f as + 1 diff --git a/old_tests/tests/lean/run/1718.lean b/old_tests/tests/lean/run/1718.lean deleted file mode 100644 index 075edba5ce..0000000000 --- a/old_tests/tests/lean/run/1718.lean +++ /dev/null @@ -1,11 +0,0 @@ -theorem my_theorem : ∀ (a b c d : ℕ), - d = c → a = b * c → a = b * d := -assume a b c d, -assume h₀ : d = c, -assume h₁ : a = b * c, -eq.substr h₀ h₁ - -example : ∀ (a b c d : ℕ), - d = c → a = b * c → a = b * d := -assume a b c d, assume h₀ : d = c, assume h₁ : a = b * c, -h₀.substr h₁ diff --git a/old_tests/tests/lean/run/1724.lean b/old_tests/tests/lean/run/1724.lean deleted file mode 100644 index 19f5777a8a..0000000000 --- a/old_tests/tests/lean/run/1724.lean +++ /dev/null @@ -1,8 +0,0 @@ -example (h : ¬ true) : false := -by simp * at * - -example (h : true) (h' : true → false) : false := -by simp * at * - -example (p : Prop) (h : p) (h' : p → false) : false := -by simp * at * diff --git a/old_tests/tests/lean/run/1728.lean b/old_tests/tests/lean/run/1728.lean deleted file mode 100644 index 775d468851..0000000000 --- a/old_tests/tests/lean/run/1728.lean +++ /dev/null @@ -1,25 +0,0 @@ -structure Bijection ( U V : Type ) := - ( morphism : U → V ) - ( inverse : V → U ) - ( witness_1 : ∀ u : U, inverse (morphism u) = u ) - ( witness_2 : ∀ v : V, morphism (inverse v) = v ) - -class Finite ( α : Type ) := - ( cardinality : nat ) - ( bijection : Bijection α (fin cardinality) ) - -lemma empty_exfalso (x : false) : empty := begin exfalso, trivial end - -instance empty_is_Finite : Finite empty := { - cardinality := 0, - bijection := begin - split, - intros, - induction u, - intros, - induction v, - trace_state, - cases v_is_lt, - repeat {admit} - end -} diff --git a/old_tests/tests/lean/run/1733.lean b/old_tests/tests/lean/run/1733.lean deleted file mode 100644 index 8b893e29f3..0000000000 --- a/old_tests/tests/lean/run/1733.lean +++ /dev/null @@ -1,25 +0,0 @@ -def f (a : nat) := (a, a) - -example (a : nat) (h : (f a).1 ≠ a) : false := -begin - unfold_projs at h {md := semireducible}, - contradiction -end - -example (a b : nat) (h₁ : a = b) (h₂ : (a, a).1 ≠ b) : false := -begin - unfold_projs at h₁ h₂, - contradiction -end - -example (a b : nat) (h₁ : a = b) (h₂ : a ≠ b) : (false, true).1 := -begin - unfold_projs at *, - contradiction -end - -example (a b : nat) (h₁ : a = b) (h₂ : a ≠ b) : false := -begin - fail_if_success {unfold_projs at *}, - contradiction -end diff --git a/old_tests/tests/lean/run/1739.lean b/old_tests/tests/lean/run/1739.lean deleted file mode 100644 index 4d0869a966..0000000000 --- a/old_tests/tests/lean/run/1739.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive type -| bool : type -| fn : list type → type → type - -def f : type → nat -| (type.bool) := 0 -| (type.fn args rt) := 1 diff --git a/old_tests/tests/lean/run/1771.lean b/old_tests/tests/lean/run/1771.lean deleted file mode 100644 index 3feb7c98c2..0000000000 --- a/old_tests/tests/lean/run/1771.lean +++ /dev/null @@ -1,23 +0,0 @@ -inductive is_some {A : Type} (mx : option A) : Prop - | mk : ∀ x : A, mx = some x → is_some - -lemma foo {A : Type} (x : A) (mx : option A) - (H : mx = some x) - : is_some mx -:= begin -existsi x, assumption -end - -set_option pp.all true -set_option pp.beta false -set_option pp.instantiate_mvars false - --- same lemma as above -lemma foo' {A : Type} (x : A) (mx : option A) - (H : mx = some x) - : is_some mx -:= begin -apply (if true then _ else _), -- in this case, we branch first -{ existsi x, assumption }, -{ existsi x, assumption } -end diff --git a/old_tests/tests/lean/run/1772.lean b/old_tests/tests/lean/run/1772.lean deleted file mode 100644 index 26bdb99efc..0000000000 --- a/old_tests/tests/lean/run/1772.lean +++ /dev/null @@ -1,8 +0,0 @@ -example (p : Prop) (f : ∀ q : Prop, q → q) : p = p := -by apply f _ _; refl - -example (p : Prop) (f : ∀ q : Prop, q → q) : p = p := -by apply f _ _; transitivity; refl - -example (p r : Prop) (f : ∀ q : Prop, (r = q → q) → q) (h2 : r): p := -by apply f _ (λ h, _); subst h; assumption diff --git a/old_tests/tests/lean/run/1782.lean b/old_tests/tests/lean/run/1782.lean deleted file mode 100644 index b633a00d12..0000000000 --- a/old_tests/tests/lean/run/1782.lean +++ /dev/null @@ -1,37 +0,0 @@ -mutual inductive a, b, c -with a : Type -| foo : a -with b : Type -| bar : b -with c : Type -| baz : c - -mutual def f, g, h -with f : a → nat -| a.foo := 0 -with g : b → nat -| b.bar := 1 -with h : c → nat -| c.baz := 2 - -example : f a.foo = 0 := rfl -example : g b.bar = 1 := rfl -example : h c.baz = 2 := rfl - - -mutual def f_1, f_2, f_3, f_4 -with f_1 : a → nat -| a.foo := 0 -with f_2 : b → nat -| b.bar := 1 -with f_3 : c → nat -| c.baz := 2 -with f_4 : nat → nat -| 0 := 3 -| _ := 4 - -example : f_1 a.foo = 0 := rfl -example : f_2 b.bar = 1 := rfl -example : f_3 c.baz = 2 := rfl -example : f_4 0 = 3 := rfl -example : f_4 1 = 4 := rfl diff --git a/old_tests/tests/lean/run/1790.lean b/old_tests/tests/lean/run/1790.lean deleted file mode 100644 index c27e48df95..0000000000 --- a/old_tests/tests/lean/run/1790.lean +++ /dev/null @@ -1,7 +0,0 @@ -universes u - -def foo (α : Type u) : unit → unit -| unit.star := unit.star - -def foo2 (α : Type u) : unit → unit -| s := s diff --git a/old_tests/tests/lean/run/1797.lean b/old_tests/tests/lean/run/1797.lean deleted file mode 100644 index cdd45d979d..0000000000 --- a/old_tests/tests/lean/run/1797.lean +++ /dev/null @@ -1,6 +0,0 @@ -example (n : nat) : true := -begin - cases h : n with m, - { guard_hyp h := n = nat.zero, admit }, - { guard_hyp h := n = nat.succ m, admit} -end diff --git a/old_tests/tests/lean/run/1804a.lean b/old_tests/tests/lean/run/1804a.lean deleted file mode 100644 index 3c7cf69337..0000000000 --- a/old_tests/tests/lean/run/1804a.lean +++ /dev/null @@ -1,62 +0,0 @@ -section -parameter P : match unit.star with -| unit.star := true -end - -include P - -example : false := -begin - dsimp [_match_1] at P, - guard_hyp P := true, - admit -end -end - -section -parameter P : match unit.star with -| unit.star := true -end - -include P - -example : false := -begin - dsimp [_match_1] at P, - guard_hyp P := true, - admit -end -end - - -section -parameter P : match unit.star with -| unit.star := true -end - -parameter Q : match unit.star with -| unit.star := true -end - -section -include P - -example : false := -begin - dsimp [_match_1] at P, - guard_hyp P := true, - admit -end -end - -section -include Q -example : false := -begin - dsimp [_match_2] at Q, - guard_hyp Q := true, - admit -end -end - -end diff --git a/old_tests/tests/lean/run/1804b.lean b/old_tests/tests/lean/run/1804b.lean deleted file mode 100644 index 532d2fc442..0000000000 --- a/old_tests/tests/lean/run/1804b.lean +++ /dev/null @@ -1,41 +0,0 @@ -namespace bla - -private def foo (x : nat) : nat := -match x with -| 0 := 1 -| _ := 2 -end - -example (a : nat) (h : a = foo 0) : a = 1 := -begin - simp [foo] at h, - guard_hyp h := a = 1, - exact h -end - -example (a b : nat) (p : b = 0) (h : a = foo b) : a = 1 := -begin - simp [foo] at h, - simp [p] at h, - simp [foo._match_1] at h, - guard_hyp h := a = 1, - exact h -end - -example (a b : nat) (p : b = 0) (h : a = foo b) : a = 1 := -begin - simp [foo] at h, - simp [p] at h, - simp [foo] at h, - guard_hyp h := a = 1, - exact h -end - -example (a b : nat) (p : b = 0) (h : a = foo b) : a = 1 := -begin - simp [foo, p] at h, - guard_hyp h := a = 1, - exact h -end - -end bla diff --git a/old_tests/tests/lean/run/1805.lean b/old_tests/tests/lean/run/1805.lean deleted file mode 100644 index 24be7a5ab8..0000000000 --- a/old_tests/tests/lean/run/1805.lean +++ /dev/null @@ -1,20 +0,0 @@ -example (x y z x' y' z': ℕ) (h : (x, y, z) = (x', y', z')) : false := -begin - injection h, - guard_hyp h_1 := x = x', - guard_hyp h_2 := (y, z) = (y', z'), - injection h_2, - guard_hyp h_3 := y = y', - guard_hyp h_4 := z = z', - admit -end - -example (x y z x' y' z': ℕ) (h : (x, y, z) = (x', y', z')) : false := -begin - injections, - guard_hyp h_1 := x = x', - guard_hyp h_2 := (y, z) = (y', z'), - guard_hyp h_3 := y = y', - guard_hyp h_4 := z = z', - admit -end diff --git a/old_tests/tests/lean/run/1812.lean b/old_tests/tests/lean/run/1812.lean deleted file mode 100644 index 8319abccc0..0000000000 --- a/old_tests/tests/lean/run/1812.lean +++ /dev/null @@ -1,9 +0,0 @@ -def bndng (α : Type) : Type := string - -inductive pterm : Type -| star : pterm -> pterm -| letrec : bndng pterm -> pterm - -def weaken : pterm → pterm -| (pterm.star p) := pterm.star (weaken p) -| (pterm.letrec _) := pterm.letrec "" \ No newline at end of file diff --git a/old_tests/tests/lean/run/1813.lean b/old_tests/tests/lean/run/1813.lean deleted file mode 100644 index b75fb28dda..0000000000 --- a/old_tests/tests/lean/run/1813.lean +++ /dev/null @@ -1,25 +0,0 @@ -open tactic - -example {A B : Type} (f : A -> B) (a b c) (h1 : f a = b) (h2 : f a = c) : false := -begin - rw h1 at *, - guard_hyp h1 := f a = b, - guard_hyp h2 := b = c, - admit -end - -example {A B : Type} (f : A -> B) (a b c) (h1 : f a = b) (h2 : f a = c) : false := -begin - rw [id h1] at *, - guard_hyp h1 := f a = b, - guard_hyp h2 := b = c, - admit -end - -example {A B : Type} (f : A -> B) (a b c) (h1 : f a = b) (h2 : f a = c) : false := -begin - rw [id id h1] at *, - guard_hyp h1 := f a = b, - guard_hyp h2 := b = c, - admit -end diff --git a/old_tests/tests/lean/run/1820.lean b/old_tests/tests/lean/run/1820.lean deleted file mode 100644 index d4860d6701..0000000000 --- a/old_tests/tests/lean/run/1820.lean +++ /dev/null @@ -1,12 +0,0 @@ -def f (p : nat × nat) : nat × nat := {p with} - -structure P (A : Type) extends prod A A := -(third : A) - -def g (s : P nat) : nat × nat := {s with} - -example : g (P.mk (1, 2) 3) = (1, 2) := -rfl - -example : g ⟨⟨1, 2⟩, 3⟩ = (1, 2) := -rfl diff --git a/old_tests/tests/lean/run/1827_comment.lean b/old_tests/tests/lean/run/1827_comment.lean deleted file mode 100644 index 54815a9340..0000000000 --- a/old_tests/tests/lean/run/1827_comment.lean +++ /dev/null @@ -1,17 +0,0 @@ -lemma subst_weirdness1 {α β : Type} {x : α} {P : Π t : Type, t → Prop} - (H : β = α) - (H' : P α x) -: P β (cast (by cc) x) := -by { subst β, exact H' } - -lemma subst_weirdness2 {α β : Type} {x : α} {P : Π t : Type, t → Prop} - (H : β = α) - (H' : P α x) -: P β (cast (by cc) x) := -by { cases H, exact H' } - -lemma subst_weirdness {α β : Type} {x : α} {P : Π t : Type, t → Prop} - (H : β = α) - (H' : P α x) -: P β (cast (by cc) x) := -by { subst α, exact H' } diff --git a/old_tests/tests/lean/run/1841.lean b/old_tests/tests/lean/run/1841.lean deleted file mode 100644 index 7e30ab8179..0000000000 --- a/old_tests/tests/lean/run/1841.lean +++ /dev/null @@ -1,10 +0,0 @@ -namespace n1 -def f : {n : ℕ // n = 0} → {n : ℕ // n = 0} -| ⟨ v, h ⟩ := ⟨ v, h.symm.symm ⟩ - -def g : {n : ℕ // n = 0} → {n : ℕ // n = 0} := -λ x, subtype.cases_on x (λ v h, ⟨v, h.symm.symm⟩) -end n1 - -#check @n1.f._main._proof_1 -#check @n1.g._proof_1 diff --git a/old_tests/tests/lean/run/1863.lean b/old_tests/tests/lean/run/1863.lean deleted file mode 100644 index 73e4afff82..0000000000 --- a/old_tests/tests/lean/run/1863.lean +++ /dev/null @@ -1,16 +0,0 @@ -constant T : Type → Type -variables {α : Type} -def f : α → α := sorry -variables [decidable_eq α] {x y : T α} -axiom foo : true → f x = x -example : f x = x := by simp only [foo true.intro] -example : f x = x := by simp only [foo _] -example : f x = x := by simp [foo true.intro] -example : f x = x := by simp [foo _] - -def g : α → α → α := sorry -variables [decidable_eq (T α)] -axiom bar : true → g x y = x -example : g x y = x := by simp [bar _] -example : g x y = x := by simp [bar true.intro] -example : g x y = x := by simp [bar] diff --git a/old_tests/tests/lean/run/1888.lean b/old_tests/tests/lean/run/1888.lean deleted file mode 100644 index 9e2644a753..0000000000 --- a/old_tests/tests/lean/run/1888.lean +++ /dev/null @@ -1,11 +0,0 @@ -universes u -variables {α : Sort u} {r p q : α → Prop} {P Q : ∀ x, p x → Prop} {a b c d : Prop} - -@[simp] theorem exists_prop {p q : Prop} : (∃ h : p, q) ↔ p ∧ q := sorry -@[simp] theorem exists_and_distrib_right {q : Prop} {p : α → Prop} : (∃x, p x ∧ q) ↔ (∃x, p x) ∧ q := sorry -@[simp] theorem and_imp : (a ∧ b → c) ↔ (a → b → c) := sorry -@[simp] theorem exists_imp_distrib : ((∃ x, p x) → b) ↔ ∀ x, p x → b := sorry - -set_option trace.simplify.rewrite true -@[simp] theorem bex_imp_distrib : ((∃ x h, P x h) → b) ↔ (∀ x h, P x h → b) := -by simp diff --git a/old_tests/tests/lean/run/1889.lean b/old_tests/tests/lean/run/1889.lean deleted file mode 100644 index 61d873f98f..0000000000 --- a/old_tests/tests/lean/run/1889.lean +++ /dev/null @@ -1,16 +0,0 @@ -def f (x : ℕ) := x - -example : f 1 = 1 := -let y := 2 in -begin - dsimp [f] at *, - guard_target 1 = 1, - refl -end - -example (α : Type) [has_add α] : f 1 = 1 := -begin - dsimp [f] at *, - guard_target 1 = 1, - refl -end diff --git a/old_tests/tests/lean/run/1893.lean b/old_tests/tests/lean/run/1893.lean deleted file mode 100644 index 3ebffdaaa1..0000000000 --- a/old_tests/tests/lean/run/1893.lean +++ /dev/null @@ -1,25 +0,0 @@ -open tactic -set_option pp.all true - -example (F : nat → Π (n : nat), (λ (u : nat), nat → nat) n) : true := -by do - ⟨t, p, _⟩ ← i_to_expr ```(F 0 0) >>= mk_specialized_congr_lemma, - trace t, - trace p, - type_check p, - constructor - - -example (F : nat → Π (n : nat), (nat.cases_on n nat (λ _, nat) : Type)) : true := -by do - ⟨t, p, _⟩ ← i_to_expr ```(F 0 0) >>= mk_specialized_congr_lemma, - trace t, - trace p, - type_check p, - constructor - -inductive unit' | star - -lemma T (x : unit') (e : x = unit'.star) (F : nat → unit') : - @unit'.rec (λ (u : unit'), nat → unit') F x = F := -by simp only [e] diff --git a/old_tests/tests/lean/run/1942.lean b/old_tests/tests/lean/run/1942.lean deleted file mode 100644 index f4ae5893a6..0000000000 --- a/old_tests/tests/lean/run/1942.lean +++ /dev/null @@ -1,9 +0,0 @@ -open tactic - -meta def c : tactic unit := -do l ← local_context, - try_lst (l.map (λ h, cases h >> skip)) - -structure X (U : Type) := - (f : U → U) - (w : ∀ u : U, f u = u . c) diff --git a/old_tests/tests/lean/run/1943.lean b/old_tests/tests/lean/run/1943.lean deleted file mode 100644 index 7ad8c3dcb3..0000000000 --- a/old_tests/tests/lean/run/1943.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic -meta def c := abstract `[assumption] - -structure B (U : Type) := - (f : U → U) - (w : ∀ u : U, f u = u . c) diff --git a/old_tests/tests/lean/run/1951.lean b/old_tests/tests/lean/run/1951.lean deleted file mode 100644 index 6a40a5f301..0000000000 --- a/old_tests/tests/lean/run/1951.lean +++ /dev/null @@ -1,5 +0,0 @@ -#eval 2 ^ (3 ^ 2) -#eval 2 ^ 3 ^ 2 - -example (a b c : nat) : a ^ (b ^ c) = a ^ b ^ c := -rfl diff --git a/old_tests/tests/lean/run/252.lean b/old_tests/tests/lean/run/252.lean deleted file mode 100644 index 128dffe890..0000000000 --- a/old_tests/tests/lean/run/252.lean +++ /dev/null @@ -1,15 +0,0 @@ -open nat - -inductive tree (A : Type) -| leaf : A → tree -| node : tree → tree → tree - -#check tree.node - -definition size {A : Type} (t : tree A) : nat := -tree.rec (λ a, 1) (λ t₁ t₂ n₁ n₂, n₁ + n₂) t - -#check _root_.size - -#reduce size (tree.node (tree.node (tree.leaf 0) (tree.leaf 1)) - (tree.leaf 0)) diff --git a/old_tests/tests/lean/run/331.lean b/old_tests/tests/lean/run/331.lean deleted file mode 100644 index 32004add7e..0000000000 --- a/old_tests/tests/lean/run/331.lean +++ /dev/null @@ -1,21 +0,0 @@ -namespace nat - inductive less (a : nat) : nat → Prop - | base : less (succ a) - | step : Π {b}, less b → less (succ b) - -end nat - -open nat -#check less.rec_on - -namespace foo1 -protected definition foo2.bar : nat := 10 -end foo1 - -example : foo1.foo2.bar = 10 := -rfl - -open foo1 - -example : foo2.bar = 10 := -rfl diff --git a/old_tests/tests/lean/run/444.lean b/old_tests/tests/lean/run/444.lean deleted file mode 100644 index e869075c28..0000000000 --- a/old_tests/tests/lean/run/444.lean +++ /dev/null @@ -1,4 +0,0 @@ -open nat -#check succ 1 -notation 1 := unit -#check succ 1 diff --git a/old_tests/tests/lean/run/445.lean b/old_tests/tests/lean/run/445.lean deleted file mode 100644 index db4293a5a7..0000000000 --- a/old_tests/tests/lean/run/445.lean +++ /dev/null @@ -1,6 +0,0 @@ -constants (A : Type) (a : A) -constants (B : Type) (b₁ b₂ : B) (H : b₁ = b₂) - -#check a -#check b₁ -#check H diff --git a/old_tests/tests/lean/run/490.lean b/old_tests/tests/lean/run/490.lean deleted file mode 100644 index f09bf7c634..0000000000 --- a/old_tests/tests/lean/run/490.lean +++ /dev/null @@ -1,6 +0,0 @@ -structure {u} foo : Type (u+2) := -(elim : Type u → Type u) - -set_option pp.universes true -#check foo.elim -#check foo diff --git a/old_tests/tests/lean/run/600a.lean b/old_tests/tests/lean/run/600a.lean deleted file mode 100644 index 4b144ebec4..0000000000 --- a/old_tests/tests/lean/run/600a.lean +++ /dev/null @@ -1,3 +0,0 @@ -/- - -/ - -#print "ok" diff --git a/old_tests/tests/lean/run/600b.lean b/old_tests/tests/lean/run/600b.lean deleted file mode 100644 index 9900ec4596..0000000000 --- a/old_tests/tests/lean/run/600b.lean +++ /dev/null @@ -1,3 +0,0 @@ -/- --/ - -#print "ok" diff --git a/old_tests/tests/lean/run/600c.lean b/old_tests/tests/lean/run/600c.lean deleted file mode 100644 index 8c92f202b9..0000000000 --- a/old_tests/tests/lean/run/600c.lean +++ /dev/null @@ -1,12 +0,0 @@ -/- /- -/ -/ -/- - /--/-/ -/-/-/--/-/-/ -/- -/ -/- -----------/ -/- --/ -/- ---/ -/- --/ - -----/ -#print "ok" diff --git a/old_tests/tests/lean/run/662.lean b/old_tests/tests/lean/run/662.lean deleted file mode 100644 index 37bdadb614..0000000000 --- a/old_tests/tests/lean/run/662.lean +++ /dev/null @@ -1,38 +0,0 @@ -open nat - -inductive type : Type -| Nat : type -| Func : type → type → type - -open type - -section var -variable {var : type → Type} - -inductive term : type → Type -| Var : ∀ {t}, var t → term t -| Const : nat → term Nat -| Plus : term Nat → term Nat → term Nat -| Abs : ∀ {dom ran}, (var dom → term ran) → term (Func dom ran) -| App : ∀ {dom ran}, term (Func dom ran) → term dom → term ran -| Let : ∀ {t1 t2}, term t1 → (var t1 → term t2) → term t2 -end var - -open term - -definition Term (t) := Π (var : type → Type), @term var t -open unit - -definition count_vars : Π {t : type}, @term (λ x, unit) t -> nat -| A (Var x) := 1 -| Nat (Const x) := 0 -| Nat (Plus e1 e2) := count_vars e1 + count_vars e2 -| (Func A B) (Abs e1) := count_vars (e1 star) -| B (@App ._ A .(B) e1 e2) := count_vars e1 + count_vars e2 -| B (@Let ._ A .(B) e1 e2) := count_vars e1 + count_vars (e2 star) - -definition var (t : type) : @term (λ x, unit) t := -Var star - -example : count_vars (App (App (var (Func Nat (Func Nat Nat))) (var Nat)) (var Nat)) = 3 := -rfl diff --git a/old_tests/tests/lean/run/751.lean b/old_tests/tests/lean/run/751.lean deleted file mode 100644 index bc01a67e39..0000000000 --- a/old_tests/tests/lean/run/751.lean +++ /dev/null @@ -1,5 +0,0 @@ -#exit -inductive foo (A : Type) := -| intro : foo A → foo A -with bar : Type := -| intro : bar A diff --git a/old_tests/tests/lean/run/774.lean b/old_tests/tests/lean/run/774.lean deleted file mode 100644 index 92518303c2..0000000000 --- a/old_tests/tests/lean/run/774.lean +++ /dev/null @@ -1,6 +0,0 @@ -open nat -example : ℕ → ℕ → Prop -| 0 0 := true -| (succ n) 0 := false -| 0 (succ m) := false -| (succ n) (succ m) := _example n m diff --git a/old_tests/tests/lean/run/791.lean b/old_tests/tests/lean/run/791.lean deleted file mode 100644 index 7607e49208..0000000000 --- a/old_tests/tests/lean/run/791.lean +++ /dev/null @@ -1,16 +0,0 @@ -open nat -definition foo.bar : nat := 10 -definition boo.bla.foo : nat := 20 - -open foo -open boo.bla - -#reduce bar -#reduce foo - -constant x.y.z : nat - -open x -#check y.z -open x.y -#check z diff --git a/old_tests/tests/lean/run/808.lean b/old_tests/tests/lean/run/808.lean deleted file mode 100644 index 0faaab7952..0000000000 --- a/old_tests/tests/lean/run/808.lean +++ /dev/null @@ -1,10 +0,0 @@ -notation 1 := eq - -postfix `x`:(max+1) := eq - -postfix [priority 1] `y`:max := eq - -attribute [instance, priority 1] -definition foo : inhabited nat := inhabited.mk nat.zero - -definition bar := @eq diff --git a/old_tests/tests/lean/run/817.lean b/old_tests/tests/lean/run/817.lean deleted file mode 100644 index f43cd65732..0000000000 --- a/old_tests/tests/lean/run/817.lean +++ /dev/null @@ -1,10 +0,0 @@ -variables A B : Prop -variables(H₁ : A) (H₂ : A → B) - -example : B := -suffices A ∧ (A → B), from and.right this (and.left this), -and.intro H₁ H₂ - -example : B := -suffices H : A ∧ (A → B), from and.right H (and.left H), -and.intro H₁ H₂ diff --git a/old_tests/tests/lean/run/967.lean b/old_tests/tests/lean/run/967.lean deleted file mode 100644 index a225f0aff3..0000000000 --- a/old_tests/tests/lean/run/967.lean +++ /dev/null @@ -1,9 +0,0 @@ -variables (A : Type) - -definition f (A : Type) (a : A) := a - -inductive bla (A : Type) -| mk : A → bla - -structure foo (A : Type) (f : A → A) := -(a : A) diff --git a/old_tests/tests/lean/run/968.lean b/old_tests/tests/lean/run/968.lean deleted file mode 100644 index 904daac779..0000000000 --- a/old_tests/tests/lean/run/968.lean +++ /dev/null @@ -1,15 +0,0 @@ -variables (A : Type) [inhabited A] - -definition f (a : A) : A := a - -#check @f nat nat.inhabited - -structure foo := -(a : A) - -#check @foo nat nat.inhabited - -inductive bla -| mk : A → bla - -#check @bla nat nat.inhabited diff --git a/old_tests/tests/lean/run/IO1.lean b/old_tests/tests/lean/run/IO1.lean deleted file mode 100644 index b464ea4288..0000000000 --- a/old_tests/tests/lean/run/IO1.lean +++ /dev/null @@ -1,52 +0,0 @@ -import system.io -open list -open io - --- set_option pp.all true - -definition main : io unit := - do l₁ ← get_line, - l₂ ← get_line, - put_str (l₂ ++ l₁) - --- vm_eval main --- set_option trace.compiler.code_gen true - -#eval put_str "hello\n" - -#print "************************" - -definition aux (n : nat) : io unit := - do put_str "========\nvalue: ", - print n, - put_str "\n========\n" - -#eval aux 20 - -#print "************************" - -definition repeat : nat → (nat → io unit) → io unit -| 0 a := return () -| (n+1) a := do a n, repeat n a - -#eval repeat 10 aux - -#print "************************" - -definition execute : list (io unit) → io unit -| [] := return () -| (x::xs) := do x, execute xs - -#eval repeat 10 (λ i, execute [aux i, put_str "hello\n"]) - -#print "************************" - -#eval - do n ← return 10, - put_str "value: ", - print n, - put_str "\n", - print (n+2), - put_str "\n----------\n" - -#print "************************" diff --git a/old_tests/tests/lean/run/IO2.lean b/old_tests/tests/lean/run/IO2.lean deleted file mode 100644 index 8235b82200..0000000000 --- a/old_tests/tests/lean/run/IO2.lean +++ /dev/null @@ -1,13 +0,0 @@ -import system.io -open list io - -/- B and unit must be in the same universe - So, we must put B at Type₁ or use poly_unit - since unit is at Type₁ --/ - -definition foreach {A : Type} {B : Type} : list A → (A → io B) → io punit -| [] f := return punit.star -| (x::xs) f := do f x, foreach xs f - -#eval foreach [1,2,3,4,5] (λ i, do put_str "value: ", print i, put_str "\n") diff --git a/old_tests/tests/lean/run/IO3.lean b/old_tests/tests/lean/run/IO3.lean deleted file mode 100644 index 5b279d218e..0000000000 --- a/old_tests/tests/lean/run/IO3.lean +++ /dev/null @@ -1,9 +0,0 @@ -import system.io -open io - -def main : io unit := -do { l ← get_line, - if l = "hello" then - put_str "you have typed hello\n" - else - do {put_str "you did not type hello\n", put_str "-----------\n"} } diff --git a/old_tests/tests/lean/run/IO4.lean b/old_tests/tests/lean/run/IO4.lean deleted file mode 100644 index 0ef34fc1c4..0000000000 --- a/old_tests/tests/lean/run/IO4.lean +++ /dev/null @@ -1,13 +0,0 @@ -import system.io -open io - -set_option trace.compiler.code_gen true - -definition main : io unit := -do { n ← return (10:nat), - if n = (11:nat) then - print 1 - else - print 2 } - -#eval main diff --git a/old_tests/tests/lean/run/K_new_elab.lean b/old_tests/tests/lean/run/K_new_elab.lean deleted file mode 100644 index a923b35daf..0000000000 --- a/old_tests/tests/lean/run/K_new_elab.lean +++ /dev/null @@ -1,3 +0,0 @@ - -theorem ex2 {A : Type} (H : A = A) (a : A) : cast H a = a := -rfl diff --git a/old_tests/tests/lean/run/abstract_ns.lean b/old_tests/tests/lean/run/abstract_ns.lean deleted file mode 100644 index 6889a9be1e..0000000000 --- a/old_tests/tests/lean/run/abstract_ns.lean +++ /dev/null @@ -1,3 +0,0 @@ --- Each abstract_ns[i] module contains a definition ns[i].foo with an abstracted nested proof. --- This test makes sure that the abstracted proofs get different names. -import .abstract_ns1 .abstract_ns2 diff --git a/old_tests/tests/lean/run/abstract_ns1.lean b/old_tests/tests/lean/run/abstract_ns1.lean deleted file mode 100644 index a4bee8c588..0000000000 --- a/old_tests/tests/lean/run/abstract_ns1.lean +++ /dev/null @@ -1,8 +0,0 @@ --- Companion file for the abstract_ns test. - -namespace ns1 - -def foo : fin 7 := ⟨3, dec_trivial⟩ -def foo' : fin 7 := ⟨3, by abstract {exact dec_trivial}⟩ - -end ns1 diff --git a/old_tests/tests/lean/run/abstract_ns2.lean b/old_tests/tests/lean/run/abstract_ns2.lean deleted file mode 100644 index 912f590e90..0000000000 --- a/old_tests/tests/lean/run/abstract_ns2.lean +++ /dev/null @@ -1,8 +0,0 @@ --- Companion file for the abstract_ns test. - -namespace ns2 - -def foo : fin 7 := ⟨3, dec_trivial⟩ -def foo' : fin 7 := ⟨3, by abstract {exact dec_trivial}⟩ - -end ns2 diff --git a/old_tests/tests/lean/run/abstract_tac.lean b/old_tests/tests/lean/run/abstract_tac.lean deleted file mode 100644 index e27e704364..0000000000 --- a/old_tests/tests/lean/run/abstract_tac.lean +++ /dev/null @@ -1,9 +0,0 @@ -def ex (a b c : nat) : a = b → c = b → a = c ∧ b = c := -begin - intros, - split, - abstract { transitivity, trace "hello", trace_state, assumption, symmetry, assumption }, - abstract { symmetry, assumption } -end - -#print ex diff --git a/old_tests/tests/lean/run/abstract_zeta.lean b/old_tests/tests/lean/run/abstract_zeta.lean deleted file mode 100644 index c164bc63cf..0000000000 --- a/old_tests/tests/lean/run/abstract_zeta.lean +++ /dev/null @@ -1,14 +0,0 @@ --- The type of h depends on the zeta-expansion of n. When we abstract the --- subterm proving `n < 5`, we need to zeta-expand n not just in the subterm, --- but also in the local context. - -lemma bug₁ : fin 5 := -let n : ℕ := 3 in -have h : n < 5, from dec_trivial, -⟨n, by abstract { exact h }⟩ - -def bug₂ : fin 5 := -let n : ℕ := 3 in -have h : n < 5, from dec_trivial, -⟨n, show n < 5, from h⟩ - -- ^^^^ the show is only used to trigger automatic abstraction diff --git a/old_tests/tests/lean/run/ac_refl1.lean b/old_tests/tests/lean/run/ac_refl1.lean deleted file mode 100644 index 835cb0256f..0000000000 --- a/old_tests/tests/lean/run/ac_refl1.lean +++ /dev/null @@ -1,14 +0,0 @@ -example (a b c : nat) (f : nat → nat) : f (a + b + c) = f (b + c + a) := -by ac_refl - -example (a b c : nat) (f : nat → nat) : f (a + b + (c * b * a)) = f (b + (a * c * b) + a) := -by ac_refl - -example (a b c : nat) (f : nat → nat → nat) : f (b * c) (c * b * a) = f (c * b) (a * c * b) := -by ac_refl - -example (a b c : nat) (f : nat → nat) : f (a + (b * c) + (c * b * a)) = f ((c * b) + (a * c * b) + a) := -by ac_refl - -example (a b c : nat) (f : nat → nat) (g : nat → nat → nat) : g (f (a + (b * c) + (c * b * a))) (a + c + b + a) = g (f ((c * b) + (a * c * b) + a)) (c + b + a + a) := -by ac_refl diff --git a/old_tests/tests/lean/run/ack.lean b/old_tests/tests/lean/run/ack.lean deleted file mode 100644 index 851f45af2c..0000000000 --- a/old_tests/tests/lean/run/ack.lean +++ /dev/null @@ -1,32 +0,0 @@ -open nat - -definition iter (f : nat → nat) (n : nat) : nat := -nat.rec_on n - (f 1) - (λ (n₁ : nat) (r : nat), f r) - -definition ack (m : nat) : nat → nat := -nat.rec_on m - nat.succ - (λ (m₁ : nat) (r : nat → nat), iter r) - -theorem ack_0_n (n : nat) : ack 0 n = n + 1 := -rfl - -theorem ack_m_0 (m : nat) : ack (m + 1) 0 = ack m 1 := -rfl - -theorem ack_m_n (m n : nat) : ack (m + 1) (n + 1) = ack m (ack (m + 1) n) := -rfl - -example : ack 3 2 = 29 := -rfl - -example : ack 3 3 = 61 := -rfl - -/- Defining Ack using well founded recursion -/ -def Ack : nat → nat → nat -| 0 y := y+1 -| (x+1) 0 := Ack x 1 -| (x+1) (y+1) := Ack x (Ack (x+1) y) diff --git a/old_tests/tests/lean/run/add_interactive.lean b/old_tests/tests/lean/run/add_interactive.lean deleted file mode 100644 index 7d211ef674..0000000000 --- a/old_tests/tests/lean/run/add_interactive.lean +++ /dev/null @@ -1,16 +0,0 @@ -namespace foo -namespace bla -open lean.parser interactive interactive.types - -meta def my_exact (q : parse texpr) := -tactic.interactive.exact q - -/- Copy tactic my_exact to tactic.interactive. -/ -run_cmd add_interactive [`my_exact] -end bla - -example : true := -begin - my_exact trivial -end -end foo diff --git a/old_tests/tests/lean/run/add_semi.lean b/old_tests/tests/lean/run/add_semi.lean deleted file mode 100644 index e2ffeb2660..0000000000 --- a/old_tests/tests/lean/run/add_semi.lean +++ /dev/null @@ -1,14 +0,0 @@ -section - universe variables u - variable {A : Type u} - - example [add_semigroup A] (a : A) : a + a = a + a := rfl - example [add_comm_semigroup A] (a : A) : a + a = a + a := rfl -end - -section - variable {A : Type} - - example [add_semigroup A] (a : A) : a + a = a + a := rfl - example [add_comm_semigroup A] (a : A) : a + a = a + a := rfl -end diff --git a/old_tests/tests/lean/run/aexp.lean b/old_tests/tests/lean/run/aexp.lean deleted file mode 100644 index ffd23647a5..0000000000 --- a/old_tests/tests/lean/run/aexp.lean +++ /dev/null @@ -1,70 +0,0 @@ -namespace imp -open tactic - -@[reducible] -def uname := string - -inductive aexp -| val : nat → aexp -| var : uname → aexp -| plus : aexp → aexp → aexp -| times : aexp → aexp → aexp - -instance : decidable_eq aexp := -by mk_dec_eq_instance - -@[reducible] -def value := nat - -def state := uname → value - -open aexp - -def aval : aexp → state → value -| (val n) s := n -| (var x) s := s x -| (plus a₁ a₂) s := aval a₁ s + aval a₂ s -| (times a₁ a₂) s := aval a₁ s * aval a₂ s - -example : aval (plus (val 3) (var "x")) (λ x, 0) = 3 := -rfl - -def updt (s : state) (x : uname) (v : value) : state := -λ y, if x = y then v else s y - -def asimp_const : aexp → aexp -| (val n) := val n -| (var x) := var x -| (plus a₁ a₂) := - match asimp_const a₁, asimp_const a₂ with - | val n₁, val n₂ := val (n₁ + n₂) - | b₁, b₂ := plus b₁ b₂ - end -| (times a₁ a₂) := - match asimp_const a₁, asimp_const a₂ with - | val n₁, val n₂ := val (n₁ * n₂) - | b₁, b₂ := times b₁ b₂ - end - -example : asimp_const (plus (plus (val 2) (val 3)) (var "x")) = plus (val 5) (var "x") := -rfl - -attribute [ematch] asimp_const aval - --- set_option trace.smt.ematch true - -meta def not_done : tactic unit := fail_if_success done - -lemma aval_asimp_const (a : aexp) (s : state) : aval (asimp_const a) s = aval a s := -begin [smt] - induction a, - all_goals {destruct (asimp_const a_a_1), all_goals {destruct (asimp_const a_a), eblast}} -end - -lemma ex2 (a : aexp) (s : state) : aval (asimp_const a) s = aval a s := -begin [smt] - induction a, - all_goals {destruct (asimp_const a_a_1), all_goals {destruct (asimp_const a_a), eblast_using [asimp_const, aval]}} -end - -end imp diff --git a/old_tests/tests/lean/run/alg_info1.lean b/old_tests/tests/lean/run/alg_info1.lean deleted file mode 100644 index 9122885bd7..0000000000 --- a/old_tests/tests/lean/run/alg_info1.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic - -example : true := -by do - let op : expr := `((+) : nat → nat → nat), - trace op, - trace_algebra_info op, - constructor diff --git a/old_tests/tests/lean/run/algebra_attr.lean b/old_tests/tests/lean/run/algebra_attr.lean deleted file mode 100644 index a6c7cd01c6..0000000000 --- a/old_tests/tests/lean/run/algebra_attr.lean +++ /dev/null @@ -1,15 +0,0 @@ -def f (a b : nat) := 0 -def g (a b : nat) := 1 - -instance : is_commutative nat f := -⟨λ a b, rfl⟩ - -instance : is_commutative nat g := -⟨λ a b, rfl⟩ - -open tactic - -run_cmd do - env ← get_env, - s ← return $ env.get_class_attribute_symbols `algebra, - trace s diff --git a/old_tests/tests/lean/run/all_goals1.lean b/old_tests/tests/lean/run/all_goals1.lean deleted file mode 100644 index e4b20498fd..0000000000 --- a/old_tests/tests/lean/run/all_goals1.lean +++ /dev/null @@ -1,14 +0,0 @@ -open tactic - -example (a b c : Prop) : a → a := -by do intro `H, - a ← get_local `a, - assert `H1 a, - assert `H2 a, - assert `H3 a, - assert `H4 a, - assert `H5 a, - trace_state, - all_goals assumption, - trace "--- after all_goals assumption ---", - trace_result diff --git a/old_tests/tests/lean/run/and_rec_code_gen_issue.lean b/old_tests/tests/lean/run/and_rec_code_gen_issue.lean deleted file mode 100644 index 8159b25458..0000000000 --- a/old_tests/tests/lean/run/and_rec_code_gen_issue.lean +++ /dev/null @@ -1,93 +0,0 @@ -import data.buffer - -structure hoare_state (σ : Type) (α : Type) := -(pre : σ → Prop) -(post : σ → α → σ → Prop) -(action : ∀ s : {s // pre s}, {as' : α × σ // post s.val as'.1 as'.2}) - -namespace hoare_state - -protected def return (σ : Type) {α : Type} (a : α) : hoare_state σ α := -{pre := λ s, true, - post := λ s a' s', s' = s ∧ a' = a, - action := λ ⟨s, h⟩, ⟨(a, s), by simp⟩} - -protected def bind {σ α β : Type} (m₁ : hoare_state σ α) (m₂ : α → hoare_state σ β) : hoare_state σ β := -{pre := λ s₁, m₁.pre s₁ ∧ ∀ a s₂, m₁.post s₁ a s₂ → (m₂ a).pre s₂, - post := λ s₁ b s₃, ∃ a s₂, m₁.post s₁ a s₂ ∧ (m₂ a).post s₂ b s₃, - action := λ ⟨s₁, h₁, h₂⟩, - match m₁.action ⟨s₁, h₁⟩ with - | ⟨(a, s₂), h₃⟩ := - match (m₂ a).action ⟨s₂, h₂ a s₂ h₃⟩ with - | ⟨(b, s₃), s₄⟩ := ⟨(b, s₃), ⟨a, s₂, h₃, s₄⟩⟩ - end - end -} - -protected def assert {σ : Type} (p : σ → Prop) : hoare_state σ unit := -{pre := λ s, p s, - post := λ s _ s', s' = s ∧ p s', - action := λ ⟨s, h⟩, ⟨((), s), ⟨rfl, h⟩⟩} - -protected def write {σ : Type} (new_s : σ) : hoare_state σ unit := -{pre := λ s, true, - post := λ s _ s', s' = new_s, - action := λ ⟨s, h⟩, ⟨((), new_s), rfl⟩} - -protected def read {σ : Type} : hoare_state σ σ := -{pre := λ s, true, - post := λ s a s', s' = s ∧ a = s, - action := λ ⟨s, h⟩, ⟨(s, s), by simp⟩} - -protected def assign {α : Type} (p : nat) (v : α) : hoare_state (buffer α) unit := -{pre := λ s, p < s.size, - post := λ s _ s', ∀ h : p < s.size, s' = s.write ⟨p, h⟩ v, - action := λ ⟨s, h⟩, ⟨((), s.write ⟨p, h⟩ v), by intros; simp⟩} - -local infix ` ::= `:60 := hoare_state.assign - -instance (σ : Type) : has_bind (hoare_state σ) := -⟨@hoare_state.bind σ⟩ - -protected def run {σ α : Type} (a : hoare_state σ α) (s : σ) (h : a.pre s) : {as' : α × σ // a.post s as'.1 as'.2} := -a.action ⟨s, h⟩ - -def test : hoare_state (buffer nat) unit := -do 0 ::= 1, - 10 ::= 2, - 2 ::= 4 - -lemma size_write (b : buffer nat) (i : nat) (h : i < b.size) (v : nat) : (b.write ⟨i, h⟩ v).size = b.size := -begin - cases b, - unfold buffer.write buffer.size -end - -open nat - -def init_mem : nat → hoare_state (buffer nat) unit -| 0 := 0 ::= 0 -| (succ p) := succ p ::= 0 >> init_mem p - -lemma init_mem_inv : ∀ n (b : buffer nat), n < b.size → (init_mem n).pre b -| 0 b h := h -| (nat.succ n) b h := - have n < b.size, from nat.lt_of_succ_lt h, - begin - unfold init_mem has_bind.and_then bind has_bind.bind hoare_state.bind, simp, - split, - {unfold hoare_state.assign, simp, exact h}, - {intros _ _, - unfold hoare_state.assign, simp, - intro h₁, rewrite h₁ h, - apply init_mem_inv n, - rewrite size_write, - assumption} - end - -def run_init_mem (n : nat) (b : buffer nat) (h : n < b.size) : buffer nat := -(hoare_state.run (init_mem n) b (init_mem_inv n b h)).1.2 - -#eval run_init_mem 10 [0,1,2,3,4,5,6,7,8,9,10,11,12,13].to_buffer dec_trivial - -end hoare_state diff --git a/old_tests/tests/lean/run/anonymous_param.lean b/old_tests/tests/lean/run/anonymous_param.lean deleted file mode 100644 index 1873ab3a1d..0000000000 --- a/old_tests/tests/lean/run/anonymous_param.lean +++ /dev/null @@ -1,7 +0,0 @@ -#check λ _, nat -#check λ (_ _ : nat), nat -#check λ _ _ : nat, nat -#check (λ _, 0 : nat → nat) - -def f (_ : nat) : nat := -0 diff --git a/old_tests/tests/lean/run/any_goals.lean b/old_tests/tests/lean/run/any_goals.lean deleted file mode 100644 index 3e91b76911..0000000000 --- a/old_tests/tests/lean/run/any_goals.lean +++ /dev/null @@ -1,10 +0,0 @@ -constant f : nat → nat -axiom fax : ∀ x, f x = x - -example (a b c : nat) : b = c → f a = a ∧ c = b := -begin - intros, - constructor, - any_goals {rw fax}, - {symmetry, assumption} -end diff --git a/old_tests/tests/lean/run/app_builder_tac1.lean b/old_tests/tests/lean/run/app_builder_tac1.lean deleted file mode 100644 index 9e54fbc0d1..0000000000 --- a/old_tests/tests/lean/run/app_builder_tac1.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic list nat name - -set_option trace.app_builder true -set_option pp.all true - -meta definition mk_ite (c a b : expr) : tactic expr := -mk_mapp `ite [some c, none, none, some a, some b] - -example (a b : nat) : nat := -by do a ← get_local `a, - b ← get_local `b, - mk_app `has_add.add [a, b] >>= trace, - mk_app `has_mul.mul [a, b] >>= trace, - mk_app `has_sub.sub [a, b] >>= trace, - c ← mk_app `eq [a, b], - trace c, - mk_ite c a b >>= trace, - mk_ite c b a >>= trace, - assumption, - return () diff --git a/old_tests/tests/lean/run/apply1.lean b/old_tests/tests/lean/run/apply1.lean deleted file mode 100644 index 89835cda14..0000000000 --- a/old_tests/tests/lean/run/apply1.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic - -example (p q : Prop) : p → q → p ∧ q := -by do - intros, - apply (expr.const `and.intro []), - trace_state, - all_goals assumption diff --git a/old_tests/tests/lean/run/apply2.lean b/old_tests/tests/lean/run/apply2.lean deleted file mode 100644 index 13c891827a..0000000000 --- a/old_tests/tests/lean/run/apply2.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic - -example (p q : Prop) : p → q → p ∧ q ∧ p := -by do - intros, - c₁ ← return (expr.const `and.intro []), - iterate_at_most 10 (apply c₁ >> skip <|> assumption) diff --git a/old_tests/tests/lean/run/apply3.lean b/old_tests/tests/lean/run/apply3.lean deleted file mode 100644 index fc0a4a019b..0000000000 --- a/old_tests/tests/lean/run/apply3.lean +++ /dev/null @@ -1,23 +0,0 @@ -open tactic - -#print "------- fapply version ----------" - -example (a : nat) : ∃ x : nat, x = a := -by do - c₁ ← return (expr.const `Exists.intro [level.of_nat 1]), - fapply c₁, /- fapply adds all unassigned variables -/ - trace_state, - swap, /- swap witness and ?M = a -/ - a ← get_local `a, - mk_app `eq.refl [a] >>= exact - -#print "------- apply version ----------" - -example (a : nat) : ∃ x : nat, x = a := -by do - c₁ ← return (expr.const `Exists.intro [level.of_nat 1]), - /- apply does not add the goal |- nat -/ - apply c₁, - trace_state, - a ← get_local `a, - mk_app `eq.refl [a] >>= exact diff --git a/old_tests/tests/lean/run/apply4.lean b/old_tests/tests/lean/run/apply4.lean deleted file mode 100644 index 7bf8a0202c..0000000000 --- a/old_tests/tests/lean/run/apply4.lean +++ /dev/null @@ -1,50 +0,0 @@ -open tactic bool -universe variables u -constant foo {A : Type u} [inhabited A] (a b : A) : a = default A → a = b - -example (a b : nat) : a = 0 → a = b := -by do - intro `H, - apply (expr.const `foo [level.of_nat 0]), - trace_state, - assumption - -definition ex : inhabited (nat × nat × bool) := -by apply_instance - -set_option pp.all true -#print ex - -set_option pp.all false - -example (a b : nat) : a = 0 → a = b := -by do - intro `H, - apply_core (expr.const `foo [level.of_nat 0]) {approx := ff, new_goals := new_goals.all, instances := ff }, - trace_state, - a ← get_local `a, - trace_state, - mk_app `inhabited.mk [a] >>= exact, - trace "--------", - trace_state, - reflexivity - -#print "----------------" -set_option pp.all true - -example (a b : nat) : a = 0 → a = b := -by do - intro `H, - foo ← mk_const `foo, - trace foo, - apply foo, - trace_state, - assumption - - -example (a b : nat) : a = 0 → a = b := -by do - `[intro], - apply_core (expr.const `foo [level.of_nat 0]) {approx := ff, new_goals := new_goals.all, instances := ff}, - `[exact inhabited.mk a], - reflexivity diff --git a/old_tests/tests/lean/run/apply_auto_opt.lean b/old_tests/tests/lean/run/apply_auto_opt.lean deleted file mode 100644 index 0827d2300b..0000000000 --- a/old_tests/tests/lean/run/apply_auto_opt.lean +++ /dev/null @@ -1,26 +0,0 @@ -def p (a : nat) (b := tt) : nat := -a + cond b 1 2 - -def q (a b : nat) (h : a ≠ b . tactic.contradiction) : nat := -a + b - -def val1 : nat := -begin - refine @p _ _, - exact 2, - apply_opt_param -end - -example : val1 = 3 := -rfl - -def val2 : nat := -begin - fapply @q, - exact 1, - exact 0, - apply_auto_param -end - -example : val2 = 1 := -rfl diff --git a/old_tests/tests/lean/run/arity1.lean b/old_tests/tests/lean/run/arity1.lean deleted file mode 100644 index f55586b9b4..0000000000 --- a/old_tests/tests/lean/run/arity1.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic decidable - -definition foo (A B : Type) := A → B - -definition boo (c : bool) := -cond c nat bool - -definition bla (a : nat) : boo (to_bool (a > 0)) → foo nat nat := -λ v x, a + x - -example : true := -by do - bla ← mk_const `bla, - infer_type bla >>= trace, - n ← get_arity bla, - trace ("n arity: " ++ to_string n), - when (n ≠ 3) (fail "bla is expected to have arity 3"), - constructor diff --git a/old_tests/tests/lean/run/array1.lean b/old_tests/tests/lean/run/array1.lean deleted file mode 100644 index 5bec9970ee..0000000000 --- a/old_tests/tests/lean/run/array1.lean +++ /dev/null @@ -1,28 +0,0 @@ -#check @d_array.mk - -#eval mk_array 4 1 - -def v : array 10 nat := -@d_array.mk 10 (λ _, nat) (λ ⟨i, _⟩, i) - -#eval array.map (+10) v - -def w : array 10 nat := -(mk_array 9 1)^.push_back 3 - -def f : fin 10 → nat := -d_array.cases_on w (λ f, f) - -#eval f ⟨9, dec_trivial⟩ -#eval f ⟨2, dec_trivial⟩ - -#eval (((mk_array 1 1)^.push_back 2)^.push_back 3)^.foldl 0 (+) - -def array_sum {n} (a : array n nat) : nat := -a^.foldl 0 (+) - -#eval array_sum (mk_array 10 1) - -#eval (mk_array 10 1)^.data ⟨1, dec_trivial⟩ + 20 -#eval (mk_array 10 1)^.data 2 -#eval (mk_array 10 3)^.data 2 diff --git a/old_tests/tests/lean/run/array2.lean b/old_tests/tests/lean/run/array2.lean deleted file mode 100644 index 6faf2b879d..0000000000 --- a/old_tests/tests/lean/run/array2.lean +++ /dev/null @@ -1,18 +0,0 @@ -#check @d_array.mk - -local infix ` << `:20 := array.push_back - -def test1 := - let v1 := mk_array 3 2, - v2 := v1 << 3 << 4, - v3 := (v2 << 5)^.write' 0 0 in -(v1, v2, v3) - -#eval test1 - -def tst1 (n : nat) := -let v1 := (mk_array n 1), - v2 := array.map (λ v, v + 1) v1 in -v2^.read' 1 - -#eval tst1 10 diff --git a/old_tests/tests/lean/run/as.lean b/old_tests/tests/lean/run/as.lean deleted file mode 100644 index 5191a132db..0000000000 --- a/old_tests/tests/lean/run/as.lean +++ /dev/null @@ -1,26 +0,0 @@ -namespace foo - definition id {A : Type} (a : A) := a - definition pr1 {A : Type} (a b : A) := a -end foo - -open foo as bla (hiding pr1) -#check bla.id - -open foo as bla (renaming pr1→pr) -#check bla.pr -#print raw bla.id - -open foo as boo (pr1) -#check boo.pr1 - -open foo as boooo (renaming pr1→pr) (hiding id) -#check boooo.pr - -namespace foo -namespace bla - definition pr2 {A : Type} (a b : A) := b -end bla -end foo - -open foo.bla as bb -#check bb.pr2 diff --git a/old_tests/tests/lean/run/as_is_elab.lean b/old_tests/tests/lean/run/as_is_elab.lean deleted file mode 100644 index 34b8de8451..0000000000 --- a/old_tests/tests/lean/run/as_is_elab.lean +++ /dev/null @@ -1,25 +0,0 @@ -open function - -variable x : list nat - -#check x^.map (+1) - -#check x^.foldl (+) 0 - -def f (l : list (nat × nat)) : list nat := -l^.map (λ ⟨a, b⟩, a + b) - -example : [(1,2), (3,4)]^.map (uncurry (+)) = [3, 7] := -rfl - -example : [(1,2), (3,4)]^.map (λ ⟨a, b⟩, a + b) = [3, 7] := -rfl - -instance decidable_uncurry_pred{α} (p : α → α → Prop) [decidable_rel p] : decidable_pred (uncurry p) := -λ a, by { cases a; dsimp [uncurry]; apply_instance } - -example : [(1,2), (4,3), (3, 2), (0, 2), (5, 4)]^.filter (uncurry (>)) = [(4,3), (3,2), (5, 4)] := -rfl - -example : [(1,2), (4,3)]^.foldl (λ v ⟨a, b⟩, v + a) 0 = 5 := -rfl diff --git a/old_tests/tests/lean/run/assert_tac1.lean b/old_tests/tests/lean/run/assert_tac1.lean deleted file mode 100644 index b49179aad1..0000000000 --- a/old_tests/tests/lean/run/assert_tac1.lean +++ /dev/null @@ -1,36 +0,0 @@ -open tactic - -definition tst1 (a : nat) : a = a := -by do - define `x (expr.const `nat []), - trace_state, - a ← get_local `a, - exact a, - x ← get_local `x, - mk_app `eq.refl [x] >>= exact - -#print tst1 - -definition tst2 (a : nat) : a = a := -by do - define `x (expr.const `nat []), - a ← get_local `a, - exact a, - trace "------------", - trace_state, - get_local `x >>= revert, - intro `y, - trace_state, - y ← get_local `y, - mk_app `eq.refl [y] >>= exact - -#print tst2 - -definition tst3 (a : nat) : a = a := -begin - let x : nat, - exact a, - revert x, - intro y, - apply eq.refl y -end diff --git a/old_tests/tests/lean/run/assert_tac3.lean b/old_tests/tests/lean/run/assert_tac3.lean deleted file mode 100644 index 46caddb67b..0000000000 --- a/old_tests/tests/lean/run/assert_tac3.lean +++ /dev/null @@ -1,47 +0,0 @@ -open tactic - -definition tst2 (a : nat) : a = a := -by do - assert `x (expr.const `nat []), - rotate 1, - trace_state, - a ← get_local `a, - mk_app `eq.refl [a] >>= exact, - a ← get_local `a, - exact a, - return () - -#print tst2 - -definition tst3 (a b : nat) : a = a := -by do - define `x (expr.const `nat []), - rotate 1, - trace_state, - x ← get_local `x, - mk_app `eq.refl [x] >>= exact, - trace "-- second goal was indirectly solved by the previous tactic", - trace_state, - return () - -definition tst4 (a : nat) : a = a := -begin - have x : nat, - rotate 1, - exact eq.refl a, - exact a -end - -definition tst5 (a : nat) : a = a := -begin - let x : nat := a, - trace_state, - exact eq.refl x -end - -definition tst6 (a : nat) : a = a := -begin - let x := a, - trace_state, - exact eq.refl x -end diff --git a/old_tests/tests/lean/run/assoc_flat.lean b/old_tests/tests/lean/run/assoc_flat.lean deleted file mode 100644 index 7ec04dcdfa..0000000000 --- a/old_tests/tests/lean/run/assoc_flat.lean +++ /dev/null @@ -1,63 +0,0 @@ -open tactic expr - -meta definition is_op_app (op : expr) (e : expr) : option (expr × expr) := -match e with -| (app (app fn a1) a2) := if op = fn then some (a1, a2) else none -| e := none -end - -meta definition flat_with : expr → expr → expr → expr → tactic (expr × expr) -| op assoc e rhs := - match (is_op_app op e) with - | (some (a1, a2)) := do - -- H₁ is a proof for a2 + rhs = rhs₁ - (rhs₁, H₁) ← flat_with op assoc a2 rhs, - -- H₂ is a proof for a1 + rhs₁ = rhs₂ - (new_app, H₂) ← flat_with op assoc a1 rhs₁, - -- We need to generate a proof that (a1 + a2) + rhs = a1 + (a2 + rhs) - -- H₃ is a proof for (a1 + a2) + rhs = a1 + (a2 + rhs) - H₃ ← return $ assoc a1 a2 rhs, - -- H₃ is a proof for a1 + (a2 + rhs) = a1 + rhs1 - H₄ ← to_expr ``(congr_arg %%(app op a1) %%H₁), - H₅ ← to_expr ``(eq.trans %%H₃ %%H₄), - H ← to_expr ``(eq.trans %%H₅ %%H₂), - return (new_app, H) - | none := do - new_app ← return $ op e rhs, - H ← to_expr ``(eq.refl %%new_app), - return (new_app, H) - end - -meta definition flat : expr → expr → expr → tactic (expr × expr) -| op assoc e := - match (is_op_app op e) with - | (some (a1, a2)) := do - -- H₁ is a proof that a2 = new_a2 - (new_a2, H₁) ← flat op assoc a2, - -- H₂ is a proof that a1 + new_a2 = new_app - (new_app, H₂) ← flat_with op assoc a1 new_a2, - -- We need a proof that (a1 + a2) = new_app - -- H₃ is a proof for a1 + a2 = a1 + new_a2 - H₃ : expr ← to_expr ``(congr_arg %%(app op a1) %%H₁), - H ← to_expr ``(eq.trans %%H₃ %%H₂), - return (new_app, H) - | none := - do pr ← to_expr ``(eq.refl %%e), - return (e, pr) - end - -local infix `+` := nat.add -set_option trace.app_builder true -set_option pp.all true - -example (a b c d e f g : nat) : ((a + b) + c) + ((d + e) + (f + g)) = a + (b + (c + (d + (e + (f + g))))) := -by do - assoc : expr ← mk_const `nat.add_assoc, - op : expr ← mk_const `nat.add, - tgt ← target, - match is_eq tgt with - | (some (lhs, rhs)) := do - r ← flat op assoc lhs, - exact r.2 - | none := failed - end diff --git a/old_tests/tests/lean/run/at_at_bug.lean b/old_tests/tests/lean/run/at_at_bug.lean deleted file mode 100644 index 4ef55d5bc6..0000000000 --- a/old_tests/tests/lean/run/at_at_bug.lean +++ /dev/null @@ -1,12 +0,0 @@ -example (a b : nat) (p : nat → nat → Prop) (h₁ : p a b) (h₂ : a = b) : p b b := -@@eq.subst (λ x, p x b) h₂ h₁ - -set_option pp.all true - -variable my_has_add : has_add nat -#check @@has_add.add my_has_add 0 1 - -local notation h1 `▸[` m `]` h2 := @@eq.subst m h1 h2 - -example (a b : nat) (p : nat → nat → Prop) (h₁ : p a b) (h₂ : a = b) : p b b := -h₂ ▸[λ x, p x b] h₁ diff --git a/old_tests/tests/lean/run/atomic2.lean b/old_tests/tests/lean/run/atomic2.lean deleted file mode 100644 index dd0a96c4b0..0000000000 --- a/old_tests/tests/lean/run/atomic2.lean +++ /dev/null @@ -1,3 +0,0 @@ -notation `foo` := Type.{1} -constant f : Type* → Type* -#check foo → f foo → foo diff --git a/old_tests/tests/lean/run/atomic_notation.lean b/old_tests/tests/lean/run/atomic_notation.lean deleted file mode 100644 index 8466707549..0000000000 --- a/old_tests/tests/lean/run/atomic_notation.lean +++ /dev/null @@ -1,5 +0,0 @@ -open nat -constant f : nat → nat -notation `o`:1 := (10:nat) -#check o + 1 -#check f o + o + o diff --git a/old_tests/tests/lean/run/auto_eq_congr_extra_args.lean b/old_tests/tests/lean/run/auto_eq_congr_extra_args.lean deleted file mode 100644 index ccfd031c29..0000000000 --- a/old_tests/tests/lean/run/auto_eq_congr_extra_args.lean +++ /dev/null @@ -1,23 +0,0 @@ -open tactic - -constant my_ite (c : Prop) {A : Type*} (t : A) : A -@[simp] lemma my_ite_true {A : Type*} (t : A) : @my_ite true A t = t := sorry - -def my_true_def : Prop := true -@[simp] lemma m_true_def_true : my_true_def = true := rfl - -constant my_true : Prop -@[simp] lemma m_true_true : my_true = true := sorry - -example (n : ℕ) (f : ℕ → ℕ) : my_ite true f n = f n := by simp -example (n : ℕ) (f g : ℕ → ℕ) : my_ite my_true f n = f n := by simp -example (n : ℕ) (f g : ℕ → ℕ) : my_ite my_true_def f n = f n := by simp -example (A : Type) (a : A) (f : Π (A : Type), A → A) : my_ite true f A a = f A a := by simp - -@[congr] lemma my_ite_congr {A : Type*} (c₁ c₂ : Prop) (t₁ t₂ : A) : - (c₁ ↔ c₂) → (t₁ = t₂) → my_ite c₁ t₁ = my_ite c₂ t₂ := sorry - -example (n : ℕ) (f : ℕ → ℕ) : my_ite true f n = f n := by simp -example (n : ℕ) (f g : ℕ → ℕ) : my_ite my_true f n = f n := by simp -example (n : ℕ) (f g : ℕ → ℕ) : my_ite my_true_def f n = f n := by simp -example (A : Type) (a : A) (f : Π (A : Type), A → A) : my_ite my_true f A a = f A a := by simp diff --git a/old_tests/tests/lean/run/auto_param.lean b/old_tests/tests/lean/run/auto_param.lean deleted file mode 100644 index 4c6f214dff..0000000000 --- a/old_tests/tests/lean/run/auto_param.lean +++ /dev/null @@ -1,29 +0,0 @@ -open tactic - -meta def my_tac : tactic unit := -assumption <|> abstract (comp_val >> skip) <|> fail "my_tac failed to synthesize auto_param" - -def f (x : nat) (h : auto_param (x > 0) `my_tac) : nat := -nat.pred x - -#check f 12 -#check f 13 - -lemma f_inj {x₁ x₂ : nat} {h₁ : x₁ > 0} {h₂ : x₂ > 0} : f x₁ = f x₂ → x₁ = x₂ := -begin - unfold f, intro h, - cases x₁, - exact absurd h₁ (lt_irrefl _), - cases x₂, - exact absurd h₂ (lt_irrefl _), - apply congr_arg nat.succ, - assumption -end - -#check @f_inj - -lemma f_def {x : nat} (h : x > 0) : f x = nat.pred x := -rfl - --- The following is an error --- #check λ x, f x diff --git a/old_tests/tests/lean/run/auto_param2.lean b/old_tests/tests/lean/run/auto_param2.lean deleted file mode 100644 index 18ae7393a1..0000000000 --- a/old_tests/tests/lean/run/auto_param2.lean +++ /dev/null @@ -1,29 +0,0 @@ -open tactic - -meta def my_tac : tactic unit := -assumption <|> abstract (comp_val >> skip) <|> fail "my_tac failed to synthesize auto_param" - -def f (x : nat) (h : x > 0 . my_tac) : nat := -nat.pred x - -#check f 12 -#check f 13 - -lemma f_inj {x₁ x₂ : nat} {h₁ : x₁ > 0} {h₂ : x₂ > 0} : f x₁ = f x₂ → x₁ = x₂ := -begin - unfold f, intro h, - cases x₁, - exact absurd h₁ (lt_irrefl _), - cases x₂, - exact absurd h₂ (lt_irrefl _), - apply congr_arg nat.succ, - assumption -end - -#check @f_inj - -lemma f_def {x : nat} (h : x > 0) : f x = nat.pred x := -rfl - --- The following is an error --- #check λ x, f x diff --git a/old_tests/tests/lean/run/auto_param_in_structures.lean b/old_tests/tests/lean/run/auto_param_in_structures.lean deleted file mode 100644 index d069655f4c..0000000000 --- a/old_tests/tests/lean/run/auto_param_in_structures.lean +++ /dev/null @@ -1,29 +0,0 @@ -namespace test -open tactic -meta def my_tac : tactic unit := abstract (intros >> `[simp]) - -local attribute [simp] add_assoc mul_assoc - -structure monoid (α : Type) := -(op : α → α → α) -(assoc : ∀ a b c, op (op a b) c = op a (op b c) . my_tac) - -def m1 : monoid nat := -monoid.mk (+) - -def m2 : monoid nat := -monoid.mk (*) - -#print m1 -#print m2 - -def m3 : monoid nat := -{op := (+)} - -def m4 : monoid nat := -{op := (*)} - -#print m3 -#print m4 - -end test diff --git a/old_tests/tests/lean/run/auto_propext.lean b/old_tests/tests/lean/run/auto_propext.lean deleted file mode 100644 index 168cc82d4b..0000000000 --- a/old_tests/tests/lean/run/auto_propext.lean +++ /dev/null @@ -1,5 +0,0 @@ -example (p q : Prop) (h : p) : q ∨ p := -by simp [h] - -example (p q : Prop) : p → q ∨ p := -by simp {contextual := tt} diff --git a/old_tests/tests/lean/run/auto_quote1.lean b/old_tests/tests/lean/run/auto_quote1.lean deleted file mode 100644 index 1600871c3e..0000000000 --- a/old_tests/tests/lean/run/auto_quote1.lean +++ /dev/null @@ -1,80 +0,0 @@ -example (a b c : nat) : a = b → b = c → c = a := -by { - intros, - apply eq.symm, - apply eq.trans, - assumption, - assumption -} - -example (a b c : nat) : a = b → b = c → c = a := -by intros; apply eq.symm; apply eq.trans; repeat {assumption} - -example (p q r : Prop) : p → q → r → p ∧ q ∧ r ∧ p ∧ q := -by intros; repeat {assumption <|> constructor} - -example (a b c : nat) : a = b → b = c → c = a := -begin - intros h1 h2, -- we can optionally provide the names - refine eq.symm (eq.trans h1 _), - exact h2 -end - -example (a b c : nat) : a = b → b = c → c = a := -begin - intro h1, - intro, -- optional argument - refine eq.symm (eq.trans h1 _), - assumption -end - -constant addc {a b : nat} : a + b = b + a -constant addassoc {a b c : nat} : (a + b) + c = a + (b + c) -constant zadd (a : nat) : 0 + a = a - -example (a b c : nat) : b = 0 → 0 + a + b + c = c + a := -begin - intro h, - rewrite h, -- single rewrite - rewrite [zadd, @addc a 0, zadd, addc] -- sequence of rewrites -end - -example (a b c : nat) : 0 = b → 0 + a + b + c = c + a := -begin - intro h, - rewrite [<- h], -- single rewrite using symmetry - rw [zadd, @addc a 0, zadd, addc] -- rw is shorthand for rewrite -end - -open nat - -example : ∀ n m : ℕ, n + m = m + n := -begin - intros n m, - induction m with m' ih, - { -- Remark: Used change here to make sure nat.zero is replaced with polymorphic zero. - -- dsimp tactic should fix that in the future. - change n + 0 = 0 + n, simp [zadd] }, - { change succ (n + m') = succ m' + n, - rw [succ_add, ih] } -end - -example (a b c : nat) : 0 = b → 0 + a + b + c = c + a := -by do - tactic.intro `h, - `[rewrite ←h, rw zadd, rw @addc a 0, rw zadd, rw addc] - -example : ∀ n m : ℕ, n + m = m + n := -begin - intros n m, - induction m with m' ih, - show n + 0 = 0 + n, - begin - change n + 0 = 0 + n, simp [zadd] - end, - show n + succ m' = succ m' + n, { - change succ (n + m') = succ m' + n, - calc succ (n + m') = succ (m' + n) : by rw ih - ... = succ m' + n : by rw succ_add - } -end diff --git a/old_tests/tests/lean/run/auto_quote2.lean b/old_tests/tests/lean/run/auto_quote2.lean deleted file mode 100644 index a4f40ab093..0000000000 --- a/old_tests/tests/lean/run/auto_quote2.lean +++ /dev/null @@ -1,14 +0,0 @@ -example (a b c : nat) : a = b → b = c → c = a := -by { - intros, - apply eq.symm, - apply eq.trans, - assumption, - assumption -} - -example (a b c : nat) : a = b → b = c → c = a := -by intros; apply eq.symm; apply eq.trans; repeat {assumption} - -example (p q r : Prop) : p → q → r → p ∧ q ∧ r ∧ p ∧ q := -by intros; repeat {assumption <|> constructor} diff --git a/old_tests/tests/lean/run/axiom_code.lean b/old_tests/tests/lean/run/axiom_code.lean deleted file mode 100644 index 740d961837..0000000000 --- a/old_tests/tests/lean/run/axiom_code.lean +++ /dev/null @@ -1,4 +0,0 @@ -constant ax : nat -noncomputable def test : nat → nat -| 0 := ax -| (n+1) := test n diff --git a/old_tests/tests/lean/run/back1.lean b/old_tests/tests/lean/run/back1.lean deleted file mode 100644 index 73722b941c..0000000000 --- a/old_tests/tests/lean/run/back1.lean +++ /dev/null @@ -1,110 +0,0 @@ -/- In this example, we show how to write a simple tactic for performing - backward chaining. - The tactic builds list membership proofs for goals such as - a ∈ [b, c] ++ [b, a, b] --/ -open list expr tactic - -universe variable u - -/- The tactic uses the following 4 theorems from the standard library. - Here, we just give them shorter names, and state their types. -/ -lemma in_tail {α : Type u} {a b : α} {l : list α} : a ∈ l → a ∈ b::l := -mem_cons_of_mem _ - -lemma in_head {α : Type u} {a : α} {l : list α} : a ∈ a::l := -mem_cons_self _ _ - -lemma in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r := -mem_append_left _ - -lemma in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r := -mem_append_right _ - -/- Now, we define two helper tactics for matching cons/append-applications. - For example, (match_cons e) succeeds and return a pair (h, t) iff - it is of the form (h::t). --/ -meta def match_cons (e : expr) : tactic (expr × expr) := -/- The tactic (match_app_of e `list.cons) succeeds if e is a list-cons application, - and returns a list of arguments. - The notation `list.cons is a "name quotation". - It is a shorthand for - (name.mk_string "cons" (name.mk_string "list" name.anonymous)) - We can pattern match in the do-notation. This definition is equivalent to - do args ← match_app_of e `list.cons, - match args with - | [_, h, t] := return (h, t) - | _ := failed - end - It is quite convenient when we have many nested patterns. --/ -do [_, h, t] ← match_app_of e `list.cons | failed, return (h, t) - -meta def match_append (e : expr) : tactic (expr × expr) := -do [_, _, l, r] ← match_app_of e `has_append.append | failed, return (l, r) - -/- The tactic (search_mem_list a e) tries to build a proof-term for (a ∈ e). -/ -meta def search_mem_list : expr → expr → tactic expr -| a e := -/- First, we check if there is an assumption with type (a ∈ e). - We use the helper tactic mk_app. It infers implicit arguments using type inference and - type class resolution. Note that the type of mem is: - Π {α : Type u₁} {γ : Type u₁ → Type u₂} [s : has_mem α γ], α → γ α → Prop - It has 2 universe variables and 3 implicit arguments, where one of them is a type class instance. - So, it is quite inconvenient to create mem-applications by hand. The tactic mk_app - hides this complexity. - The tactic (find_assumption m) succeeds if there is a hypothesis (h : m) in - the local context of the main goal. It is implemented in Lean, and we can - jump to its definition by using `M-.` (on Emacs) and `F12` (on VS Code). - On VS Code, we can also "peek" on its definition by typing (Alt-F12). - -/ -(do m ← mk_app `has_mem.mem [a, e], find_assumption m) -<|> -/- If e is of the form l++r, then we try to build a proof for (a ∈ l), - if we succeed, we built a proof for (a ∈ l++r) using the lemma in_left. -/ -(do (l, r) ← match_append e, h ← search_mem_list a l, mk_app `in_left [l, r, h]) -<|> -(do (l, r) ← match_append e, h ← search_mem_list a r, mk_app `in_right [l, r, h]) -<|> -(do (b, t) ← match_cons e, is_def_eq a b, mk_app `in_head [b, t]) -<|> -(do (b, t) ← match_cons e, h ← search_mem_list a t, mk_app `in_tail [a, b, t, h]) - -/- The tactic mk_mem_list tries to close the current goal using search_mem_list - if it is of the form (a ∈ e). - We can view mk_mem_list as an "overloaded lemma" as described by Gonthier et al. - in the paper "How to make ad hoc proof automation less ad hoc" --/ -meta def mk_mem_list : tactic unit := -do t ← target, - [_, _, _, a, e] ← match_app_of t `has_mem.mem | failed, - search_mem_list a e >>= exact - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -by tactic.intros >> mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ b::b::c::l ++ [c, c, b] := -by tactic.intros >> mk_mem_list - -/- We can use mk_mem_list nested in our proofs -/ -example (a b c : nat) (l₁ l₂ : list nat) : (a ∈ l₁ ∨ a ∈ l₂) → a ∈ b::l₂ ∨ a ∈ b::c::l₁ ++ [b, c] -| (or.inl h) := or.inr (by mk_mem_list) -| (or.inr r) := or.inl (by mk_mem_list) - -/- We can prove the same theorem using just tactics. -/ -example (a b c : nat) (l₁ l₂ : list nat) : (a ∈ l₁ ∨ a ∈ l₂) → a ∈ b::l₂ ∨ a ∈ b::c::l₁ ++ [b, c] := -begin - intro h, cases h, - {apply or.inr, mk_mem_list}, - {apply or.inl, mk_mem_list} -end diff --git a/old_tests/tests/lean/run/back1b.lean b/old_tests/tests/lean/run/back1b.lean deleted file mode 100644 index 630eb56062..0000000000 --- a/old_tests/tests/lean/run/back1b.lean +++ /dev/null @@ -1,103 +0,0 @@ -/- In this example, we demonstrate how to add tracing to - the tactic implemented in the file back.lean. - We also use quotations to build terms. -/ -open list expr tactic - -universe variable u - -/- We change the implicit arguments of in_tail and in_head. - The goal is to allow us to create in_tail and in_head application using - quotation without having information about the expected type. -/ -lemma in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l := -mem_cons_of_mem _ - -lemma in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l := -mem_cons_self _ _ - -lemma in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r := -mem_append_left _ - -lemma in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r := -mem_append_right _ - -meta def match_cons (e : expr) : tactic (expr × expr) := -do [_, h, t] ← match_app_of e `list.cons | failed, return (h, t) - -meta def match_append (e : expr) : tactic (expr × expr) := -do [_, _, l, r] ← match_app_of e `has_append.append | failed, return (l, r) - -/- The command `declare_trace` add a new trace.search_mem_list to Lean -/ -declare_trace search_mem_list - -/- The tactic (search_mem_list a e) tries to build a proof-term for (a ∈ e). -/ -meta def search_mem_list : expr → expr → tactic expr -| a e := -/- The tactic (when_tracing id tac) executes the tactic `tac` if - the option trace.id is set to true. -/ -when_tracing `search_mem_list (do - /- The tactic (pp e) pretty-prints the given expression. - It returns the formatting object for `e`. It will - format it with respect to the local context and environment associated - with the main goal. -/ - a_fmt ← pp a, - e_fmt ← pp e, - trace (to_fmt "search " ++ a_fmt ++ to_fmt " in " ++ e_fmt)) ->> -(do m ← mk_app `has_mem.mem [a, e], find_assumption m) -<|> -/- - A quoted term `(t) is a pre-term. The tactic to_expr elaborates a pre-term - with respect to the current main goal. The notation %%t is an anti-quotation. --/ -(do (l, r) ← match_append e, h ← search_mem_list a l, to_expr ``(in_left %%r %%h)) -<|> -(do (l, r) ← match_append e, h ← search_mem_list a r, to_expr ``(in_right %%l %%h)) -<|> -(do (b, t) ← match_cons e, is_def_eq a b, to_expr ``(in_head %%b %%t)) -<|> -(do (b, t) ← match_cons e, h ← search_mem_list a t, to_expr ``(in_tail %%b %%h)) - -/- The tactic mk_mem_list tries to close the current goal using search_mem_list - if it is of the form (a ∈ e). - We can view mk_mem_list as an "overloaded lemma" as described by Gonthier et al. - in the paper "How to make ad hoc proof automation less ad hoc" --/ -meta def mk_mem_list : tactic unit := -do t ← target, - [_, _, _, a, e] ← match_app_of t `has_mem.mem | failed, - search_mem_list a e >>= exact - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, a+0, b] := -by mk_mem_list - -/- We can enable/disable the tracing messages - using the set_option command. - Later, we demonstrate how to use the Lean debugger and VM monitor. -/ -set_option trace.search_mem_list true - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a+0, b] := -by mk_mem_list - -set_option trace.search_mem_list false - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -by tactic.intros >> mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ b::b::c::l ++ [c, c, b] := -by tactic.intros >> mk_mem_list - -/- We can use mk_mem_list nested in our proofs -/ -example (a b c : nat) (l₁ l₂ : list nat) : (a ∈ l₁ ∨ a ∈ l₂) → a ∈ b::l₂ ∨ a ∈ b::c::l₁ ++ [b, c] -| (or.inl h) := or.inr (by mk_mem_list) -| (or.inr r) := or.inl (by mk_mem_list) - -/- We can prove the same theorem using just tactics. -/ -example (a b c : nat) (l₁ l₂ : list nat) : (a ∈ l₁ ∨ a ∈ l₂) → a ∈ b::l₂ ∨ a ∈ b::c::l₁ ++ [b, c] := -begin - intro h, cases h, - {apply or.inr, mk_mem_list}, - {apply or.inl, mk_mem_list} -end diff --git a/old_tests/tests/lean/run/back2.lean b/old_tests/tests/lean/run/back2.lean deleted file mode 100644 index 9acd3ba6ce..0000000000 --- a/old_tests/tests/lean/run/back2.lean +++ /dev/null @@ -1,77 +0,0 @@ -/- The tactic search_mem_list defined at back.lean does - not update the tactic_state. More importantly, it does not change - the set of goals that need to be solved. - It is also possible to write a very compact search_mem_list on top of the - apply tactic. This version will create subgoals while searching for - a proof of (a ∈ e). -/ -open list expr tactic - -universe variable u - -/- We change the implicit arguments of in_tail and in_head. - The goal is to allow us to create in_tail and in_head application using - quotation without having information about the expected type. -/ -lemma in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l := -mem_cons_of_mem _ - -lemma in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l := -mem_cons_self _ _ - -lemma in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r := -mem_append_left _ - -lemma in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r := -mem_append_right _ - -/- The command `declare_trace` add a new trace.search_mem_list to Lean -/ -declare_trace search_mem_list - -/- In Lean, we can only reference a function 'f' while defining 'f' when we use - recursive equation compiler. This is true also for meta definitions. - Thus, we cannot write a tactic such as - meta def f : tactic unit := - ... f ... - that invokes itself but it is not defined using the equational compiler. - We workaround this issue by defining it as - meta def f : unit → tactic unit - | () := ... f () ... --/ - -meta def mk_mem_list_rec : unit → tactic unit -| () := -when_tracing `search_mem_list (do t ← target, f ← pp t, trace (to_fmt "search " ++ f)) ->> (assumption - <|> - /- The notation `[t] allows us to use the Lean "tactic interactive mode" inside regular tactic. - In the following example `[apply in_left] is syntax sugar for - tactic.interactive.apply `(in_left) - -/ - (`[apply in_left] >> mk_mem_list_rec ()) - <|> - (`[apply in_right] >> mk_mem_list_rec ()) - <|> - (`[apply in_head]) - <|> - (`[apply in_tail] >> mk_mem_list_rec ())) -/- The tactic `now` fails if we still have goals to be solved -/ ->> done - -meta def mk_mem_list : tactic unit := -solve1 (mk_mem_list_rec ()) - -set_option trace.search_mem_list true - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -begin intros, mk_mem_list end - -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin intros, mk_mem_list end diff --git a/old_tests/tests/lean/run/back3.lean b/old_tests/tests/lean/run/back3.lean deleted file mode 100644 index 25f7a44daf..0000000000 --- a/old_tests/tests/lean/run/back3.lean +++ /dev/null @@ -1,32 +0,0 @@ -/- Lean has a backward chaining tactic that can be configured using - attributes. -/ -open list tactic - -universe variable u -lemma in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l := mem_cons_of_mem _ -lemma in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l := mem_cons_self _ _ -lemma in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r := mem_append_left _ -lemma in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r := mem_append_right _ - -/- It is trivial to define mk_mem_list using backward chaining -/ -attribute [intro] in_tail in_head in_left in_right - -meta def mk_mem_list : tactic unit := -solve1 (back_chaining) - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -set_option trace.tactic.back_chaining true - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -begin intros, mk_mem_list end - -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin intros, mk_mem_list end diff --git a/old_tests/tests/lean/run/back4.lean b/old_tests/tests/lean/run/back4.lean deleted file mode 100644 index 3f75eaeb23..0000000000 --- a/old_tests/tests/lean/run/back4.lean +++ /dev/null @@ -1,39 +0,0 @@ -/- Lean also support E-matching: a heuristic lemma instantiation procedure - that is available in many SMT solvers. - Goals such as mk_mem_list can also be discharged using heuristic instantiation. -/ -open list tactic - -universe variable u -lemma in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l := mem_cons_of_mem _ -lemma in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l := mem_cons_self _ _ -lemma in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r := mem_append_left _ -lemma in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r := mem_append_right _ - -/- Using ematching -/ -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin [smt] - intros, - iterate { ematch_using [in_left, in_right, in_head, in_tail], try {close} } -end - -/- We mark lemmas for ematching. -/ -attribute [ematch] in_left in_right in_head in_tail - -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin [smt] - intros, - iterate {ematch, try {close}} -end - -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin [smt] - intros, eblast -end - -/- The following example is not provable -/ -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin [smt] - intros, - iterate {ematch, try {close}}, - admit /- finish the proof admiting the goal -/ -end diff --git a/old_tests/tests/lean/run/back_chaining1.lean b/old_tests/tests/lean/run/back_chaining1.lean deleted file mode 100644 index 95b8cf5da4..0000000000 --- a/old_tests/tests/lean/run/back_chaining1.lean +++ /dev/null @@ -1,12 +0,0 @@ --- Backward chaining with tagged rules -constants {P Q R S T U : Prop} (Hpq : P → Q) (Hqr : Q → R) (Hrs : R → S) (Hst : S → T) -constants (Huq : U → Q) (Hur : U → R) (Hus : U → S) (Hut : U → T) -attribute [intro] Hpq Hqr Hrs Hst -attribute [intro] Huq Hur Hus Hut - -open tactic - -definition lemma1 (p : P) : Q := by back_chaining -definition lemma2 (p : P) : R := by back_chaining -definition lemma3 (p : P) : S := by back_chaining -definition lemma4 (p : P) : T := by back_chaining diff --git a/old_tests/tests/lean/run/back_chaining2.lean b/old_tests/tests/lean/run/back_chaining2.lean deleted file mode 100644 index 4184948e14..0000000000 --- a/old_tests/tests/lean/run/back_chaining2.lean +++ /dev/null @@ -1,11 +0,0 @@ --- Backward chaining with hypotheses -constants {P Q R S T U : Prop} -constants (Huq : U → Q) (Hur : U → R) (Hus : U → S) (Hut : U → T) -attribute [intro] Huq Hur Hus Hut - -open tactic - -definition lemma1 : (P → Q) → P → Q := by (intros >> back_chaining_using_hs) -definition lemma2 : (P → Q) → (Q → R) → P → R := by (intros >> back_chaining_using_hs) -definition lemma3 : (P → Q) → (Q → R) → (R → S) → P → S := by (intros >> back_chaining_using_hs) -definition lemma4 : (P → Q) → (Q → R) → (R → S) → (S → T) → P → T := by (intros >> back_chaining_using_hs) diff --git a/old_tests/tests/lean/run/back_chaining3.lean b/old_tests/tests/lean/run/back_chaining3.lean deleted file mode 100644 index 91e2ae0e10..0000000000 --- a/old_tests/tests/lean/run/back_chaining3.lean +++ /dev/null @@ -1,29 +0,0 @@ -namespace ex -open tactic - -constant typ : Type - -constant subtype : typ → typ → Prop - -constant subtype_refl : ∀ T, subtype T T - -constant subtype_trans : ∀ S T U, subtype S T → subtype T U → subtype S U - -attribute [intro] subtype_refl subtype_trans - -lemma L1 : ∀ T1 T2 T3 T4, subtype T1 T2 → subtype T2 T3 → subtype T3 T4 → subtype T1 T4 := -by (intros >> back_chaining_using_hs) - -lemma L2 : ∀ T1 T2 T3 T4, subtype T1 T2 → subtype T2 T3 → subtype T3 T4 → subtype T1 T4 := -by do - intros, - ctx ← local_context, - -- using pre tactic to trace execution - back_chaining_core (trace "pre tac:" >> trace_state >> trace "-------") failed ctx - -set_option back_chaining.max_depth 10 - -lemma L3 : ∀ T1 T2 T3 T4 T5 T6 (H1 :subtype T1 T2) (H2 : subtype T2 T3) (H3 : subtype T3 T4) (H3 : subtype T4 T5) (H4 : subtype T5 T6), subtype T1 T6 := -by (intros >> back_chaining_using_hs) - -end ex diff --git a/old_tests/tests/lean/run/back_chaining4.lean b/old_tests/tests/lean/run/back_chaining4.lean deleted file mode 100644 index 0cd02cec1b..0000000000 --- a/old_tests/tests/lean/run/back_chaining4.lean +++ /dev/null @@ -1,29 +0,0 @@ --- Backward chaining with hypotheses -constants {P Q R S T U : Prop} -constants (Huq : U → Q) (Hur : U → R) (Hus : U → S) (Hut : U → T) -attribute [intro] Huq Hur Hus Hut - -open tactic - -definition lemma4 : (P → Q) → (Q → R) → (R → S) → (S → T) → P → T := -by do - H1 ← intro `H1, - H2 ← intro `H2, - H3 ← intro `H3, - H4 ← intro `H4, - H5 ← intro `H5, - /- Construct lemma set manually -/ - lemmas ← mk_back_lemmas, - trace "lemmas for target: ", - target >>= back_lemmas_find lemmas >>= trace >> trace "-----", - trace "lemmas for H3 body: ", - infer_type H3 >>= (λ t, back_lemmas_find lemmas (expr.binding_body t)) >>= trace >> trace "-----", - lemmas ← back_lemmas_insert lemmas H1, - lemmas ← back_lemmas_insert lemmas H2, - lemmas ← back_lemmas_insert lemmas H3, - lemmas ← back_lemmas_insert lemmas H4, - lemmas ← back_lemmas_insert lemmas H5, - trace "lemmas for H3 body (after update): ", - infer_type H3 >>= (λ t, back_lemmas_find lemmas (expr.binding_body t)) >>= trace >> trace "-----", - /- Execute backward_chaining_core using hand-crafted lemma set -/ - backward_chaining_core reducible tt 10 skip failed lemmas diff --git a/old_tests/tests/lean/run/basic.lean b/old_tests/tests/lean/run/basic.lean deleted file mode 100644 index 3bb228e2e5..0000000000 --- a/old_tests/tests/lean/run/basic.lean +++ /dev/null @@ -1,79 +0,0 @@ -prelude - -constant {l1 l2} A : Type l1 → Type l2 -#check A -definition {l} tst (A : Type*) (B : Type*) (C : Type l) : Type* := A → B → C -#check tst -constant {l} group : Type (l+1) -constant {l} carrier : group.{l} → Type l -noncomputable definition to_carrier (g : group) := carrier g - -#check to_carrier.{1} - -section - variable A : Type* - #check A - definition B := A → A -end -constant N : Type 1 -#check B N -constant f : B N -#check f -constant a : N -#check f a - -section - variable T1 : Type* - variable T2 : Type* - variable f : T1 → T2 → T2 - definition double (a : T1) (b : T2) := f a (f a b) -end - -#check double -#check double.{1 2} - -definition Prop := Type 0 -constant Eq : Π {A : Type*}, A → A → Prop -infix `=`:50 := Eq - -#check Eq.{1} - -section - universe variable l - universe variable u - variable {T1 : Type l} - variable {T2 : Type l} - variable {T3 : Type u} - variable f : T1 → T2 → T2 - noncomputable definition is_proj2 := ∀ x y, f x y = y - noncomputable definition is_proj3 (f : T1 → T2 → T3 → T3) := ∀ x y z, f x y z = z -end - -#check @is_proj2.{1} -#check @is_proj3.{1 2} - -namespace foo -section - universe variables u v - variables {T1 T2 : Type u} - variable {T3 : Type v} - variable f : T1 → T2 → T2 - noncomputable definition is_proj2 := ∀ x y, f x y = y - noncomputable definition is_proj3 (f : T1 → T2 → T3 → T3) := ∀ x y z, f x y z = z -end -#check @foo.is_proj2.{1} -#check @foo.is_proj3.{1 2} -end foo - -namespace bla -section - variable {T1 : Type*} - variable {T2 : Type*} - variable {T3 : Type*} - variable f : T1 → T2 → T2 - noncomputable definition is_proj2 := ∀ x y, f x y = y - noncomputable definition is_proj3 (f : T1 → T2 → T3 → T3) := ∀ x y z, f x y z = z -end -#check @bla.is_proj2.{1 2} -#check @bla.is_proj3.{1 2 3} -end bla diff --git a/old_tests/tests/lean/run/basic_monitor.lean b/old_tests/tests/lean/run/basic_monitor.lean deleted file mode 100644 index 83660ec71d..0000000000 --- a/old_tests/tests/lean/run/basic_monitor.lean +++ /dev/null @@ -1,13 +0,0 @@ -@[vm_monitor] -meta def basic_monitor : vm_monitor nat := -{ init := 0, step := λ s, return (trace ("step " ++ to_string s) (s+1)) } - -set_option debugger true - -example (a b : Prop) : a → b → a ∧ b := -begin - intros, - constructor, - assumption, - assumption -end diff --git a/old_tests/tests/lean/run/basic_monitor1.lean b/old_tests/tests/lean/run/basic_monitor1.lean deleted file mode 100644 index 3cc16ee2cf..0000000000 --- a/old_tests/tests/lean/run/basic_monitor1.lean +++ /dev/null @@ -1,11 +0,0 @@ -@[vm_monitor] -meta def basic_monitor : vm_monitor nat := -{ init := 0, step := λ s, return (trace ("step " ++ to_string s) (s+1)) >> failure } - -set_option debugger true - -def f : nat → nat -| 0 := 0 -| (a+1) := f a - -#eval trace "a" (f 4) diff --git a/old_tests/tests/lean/run/basic_monitor2.lean b/old_tests/tests/lean/run/basic_monitor2.lean deleted file mode 100644 index 9040b4878b..0000000000 --- a/old_tests/tests/lean/run/basic_monitor2.lean +++ /dev/null @@ -1,38 +0,0 @@ -meta def get_file (fn : name) : vm format := -do { - d ← vm.get_decl fn, - some n ← return (vm_decl.olean d) | failure, - return (to_fmt n) -} -<|> -return (to_fmt "") - -meta def pos_info (fn : name) : vm format := -do { - d ← vm.get_decl fn, - some pos ← return (vm_decl.pos d) | failure, - file ← get_file fn, - return (file ++ ":" ++ pos.1 ++ ":" ++ pos.2) -} -<|> -return (to_fmt "") - -@[vm_monitor] -meta def basic_monitor : vm_monitor nat := -{ init := 1000, - step := λ sz, do - csz ← vm.call_stack_size, - if sz = csz then return sz - else do - fn ← vm.curr_fn, - pos ← pos_info fn, - vm.trace (to_fmt "[" ++ csz ++ "]: " ++ to_fmt fn ++ " @ " ++ pos), - return csz } - -set_option debugger true - -def f : nat → nat -| 0 := 0 -| (a+1) := f a - -#eval trace "a" (f 4) diff --git a/old_tests/tests/lean/run/basic_monitor3.lean b/old_tests/tests/lean/run/basic_monitor3.lean deleted file mode 100644 index 88fbb4d04b..0000000000 --- a/old_tests/tests/lean/run/basic_monitor3.lean +++ /dev/null @@ -1,65 +0,0 @@ -meta def get_file (fn : name) : vm format := -do { - d ← vm.get_decl fn, - some n ← return (vm_decl.olean d) | failure, - return (to_fmt n) -} -<|> -return (to_fmt "") - -meta def pos_info (fn : name) : vm format := -do { - d ← vm.get_decl fn, - some pos ← return (vm_decl.pos d) | failure, - file ← get_file fn, - return (file ++ ":" ++ pos.1 ++ ":" ++ pos.2) -} -<|> -return (to_fmt "") - -meta def obj_fmt (o : vm_obj) : vm format := -match o^.kind with -| vm_obj_kind.tactic_state := - return (to_fmt "state:" ++ format.nest 8 (format.line ++ o^.to_tactic_state^.to_format)) -| _ := do s ← vm.obj_to_string o, return $ to_fmt s -end - -meta def display_args_aux : nat → vm unit -| i := do - sz ← vm.stack_size, - if i = sz then return () - else do - o ← vm.stack_obj i, - (n, t) ← vm.stack_obj_info i, - fmt ← obj_fmt o, - vm.trace (to_fmt " " ++ to_fmt n ++ " := " ++ fmt), - display_args_aux (i+1) - -meta def display_args : vm unit := -do bp ← vm.bp, - display_args_aux bp - -@[vm_monitor] -meta def basic_monitor : vm_monitor nat := -{ init := 1000, - step := λ sz, do - csz ← vm.call_stack_size, - if sz = csz then return sz - else - do { - fn ← vm.curr_fn, - pos ← pos_info fn, - vm.trace (to_fmt "[" ++ csz ++ "]: " ++ to_fmt fn ++ " @ " ++ pos), - display_args, - return csz - } - <|> - return csz -- curr_fn failed -} - - -set_option debugger true -open tactic - -example (a b : Prop) : a → b → a ∧ b := -by (intros >> constructor >> repeat assumption) diff --git a/old_tests/tests/lean/run/begin_end1.lean b/old_tests/tests/lean/run/begin_end1.lean deleted file mode 100644 index dd634c58e9..0000000000 --- a/old_tests/tests/lean/run/begin_end1.lean +++ /dev/null @@ -1,10 +0,0 @@ -open tactic - -example (p q : Prop) : p → q → q ∧ p := -begin - intros, - constructor, - trace_state, - assumption, - assumption -end diff --git a/old_tests/tests/lean/run/begin_end_do.lean b/old_tests/tests/lean/run/begin_end_do.lean deleted file mode 100644 index 89c371b376..0000000000 --- a/old_tests/tests/lean/run/begin_end_do.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic - -example (a b c : nat) (p : nat → Prop) (f : nat → nat → nat) : p (f (f a a) (f b c)) := -begin - do { [x, y, z] ← match_target_subexpr ```(λ x y z, f x (f y z)) | failed, - trace x, trace y, trace z, trace "------------"}, - exact sorry -end diff --git a/old_tests/tests/lean/run/beta_zeta.lean b/old_tests/tests/lean/run/beta_zeta.lean deleted file mode 100644 index da59b98b7f..0000000000 --- a/old_tests/tests/lean/run/beta_zeta.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic - -meta def check_expr (p : pexpr) (t : expr) : tactic unit := -do e ← to_expr p, guard (t = e) - -example : true := -let x := 10 in -by do h ← get_local `x, - head_zeta h >>= check_expr ``(10), - triv - -example : let x := 10 in true := -by do x ← intro1, - head_zeta x >>= check_expr ``(10), - triv - -example : true := -by do h ← to_expr ``((λ x : nat, x + 1) 1), - head_beta h >>= check_expr ``(1 + 1), - triv diff --git a/old_tests/tests/lean/run/bin_oct_hex.lean b/old_tests/tests/lean/run/bin_oct_hex.lean deleted file mode 100644 index 413f15261d..0000000000 --- a/old_tests/tests/lean/run/bin_oct_hex.lean +++ /dev/null @@ -1,11 +0,0 @@ -example : 0xf = 15 := -rfl - -example : 3 = 0b11 := -rfl - -example : 5 = 0b101 := -rfl - -example : 8 = 0o10 := -rfl diff --git a/old_tests/tests/lean/run/bin_tree.lean b/old_tests/tests/lean/run/bin_tree.lean deleted file mode 100644 index ee21d90810..0000000000 --- a/old_tests/tests/lean/run/bin_tree.lean +++ /dev/null @@ -1,28 +0,0 @@ -namespace Ex -def pairs_with_sum' : Π (m n) {d}, m + n = d → list {p : ℕ × ℕ // p.1 + p.2 = d} -| 0 n d h := [⟨(0, n), h⟩] -| (m+1) n d h := ⟨(m+1, n), h⟩ :: pairs_with_sum' m (n+1) (by simp at h; simp [h]) - -def pairs_with_sum (n) : list {p : ℕ × ℕ // p.1 + p.2 = n} := -pairs_with_sum' n 0 rfl - -inductive bin_tree -| leaf : bin_tree -| branch : bin_tree → bin_tree → bin_tree - -open Ex.bin_tree - -def size : bin_tree → ℕ -| leaf := 0 -| (branch l r) := size l + size r + 1 - -def trees_of_size : Π s, list {bt : bin_tree // size bt = s} -| 0 := [⟨leaf, rfl⟩] -| (n+1) := - do ⟨(s1, s2), h⟩ ← pairs_with_sum n, - ⟨t1, sz1⟩ ← have s1 < n+1, by apply nat.lt_succ_of_le; rw ←h; apply nat.le_add_right, - trees_of_size s1, - ⟨t2, sz2⟩ ← have s2 < n+1, by apply nat.lt_succ_of_le; rw ←h; apply nat.le_add_left, - trees_of_size s2, - return ⟨branch t1 t2, by rw [←h, ←sz1, ←sz2]; refl⟩ -end Ex diff --git a/old_tests/tests/lean/run/blast_unit.lean b/old_tests/tests/lean/run/blast_unit.lean deleted file mode 100644 index d2599d3281..0000000000 --- a/old_tests/tests/lean/run/blast_unit.lean +++ /dev/null @@ -1,52 +0,0 @@ -variables {A₁ A₂ A₃ A₄ B₁ B₂ B₃ B₄ : Prop} - -meta def blast : tactic unit := -using_smt $ return () - -example (b1 : B₁) (b2 : B₂) (H : ¬ A₁ → ¬ B₁ ∨ ¬ B₂) : A₁ := by blast -example (b1 : B₁) (H : ¬ A₁ → ¬ B₁) : A₁ := by blast -example (b1 : B₁) (n1 : ¬ A₂) (H : ¬ A₂ → ¬ A₁ → ¬ B₁) : A₁ := by blast - --- H first, all pos -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a1 : A₁) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) : B₄ := by blast -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a1 : A₁) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₄) : B₃ := by blast -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a1 : A₁) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n3 : ¬ B₃) (n3 : ¬ B₄) : B₂ := by blast -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a1 : A₁) (a2 : A₂) (a3 : A₃) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) : B₁ := by blast - -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a1 : A₁) (a2 : A₂) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) : ¬ A₃ := by blast -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a1 : A₁) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) : ¬ A₂ := by blast -example (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) : ¬ A₁ := by blast - --- H last, all pos -example (a1 : A₁) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : B₄ := by blast -example (a1 : A₁) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₄) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : B₃ := by blast -example (a1 : A₁) (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n3 : ¬ B₃) (n3 : ¬ B₄) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : B₂ := by blast -example (a1 : A₁) (a2 : A₂) (a3 : A₃) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : B₁ := by blast - -example (a1 : A₁) (a2 : A₂) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : ¬ A₃ := by blast -example (a1 : A₁) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : ¬ A₂ := by blast -example (a2 : A₂) (a3 : A₃) (n1 : ¬ B₁) (n2 : ¬ B₂) (n3 : ¬ B₃) (n3 : ¬ B₄) (H : A₁ → A₂ → A₃ → B₁ ∨ B₂ ∨ B₃ ∨ B₄) : ¬ A₁ := by blast - --- H first, all neg -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) : ¬ B₄ := by blast -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b4 : B₄) : ¬ B₃ := by blast -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b3 : B₃) (b4 : B₄) : ¬ B₂ := by blast -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b2 : B₂) (b3 : B₃) (b4 : B₄) : ¬ B₁ := by blast - -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n1 : ¬ A₁) (n2 : ¬ A₂) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) : ¬ ¬ A₃ := by blast -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n1 : ¬ A₁) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) : ¬ ¬ A₂ := by blast -example (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) : ¬ ¬ A₁ := by blast - --- H last, all neg -example (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ B₄ := by blast -example (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ B₃ := by blast -example (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ B₂ := by blast -example (n1 : ¬ A₁) (n2 : ¬ A₂) (n3 : ¬ A₃) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ B₁ := by blast - -example (n1 : ¬ A₁) (n2 : ¬ A₂) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ ¬ A₃ := by blast -example (n1 : ¬ A₁) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ ¬ A₂ := by blast -example (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : ¬ ¬ A₁ := by blast - -example (n1 : ¬ A₁) (n2 : ¬ A₂) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : A₃ := by blast -example (n1 : ¬ A₁) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : A₂ := by blast -example (n2 : ¬ A₂) (n3 : ¬ A₃) (b1 : B₁) (b2 : B₂) (b3 : B₃) (b4 : B₄) (H : ¬ A₁ → ¬ A₂ → ¬ A₃ → ¬ B₁ ∨ ¬ B₂ ∨ ¬ B₃ ∨ ¬ B₄) : A₁ := by blast diff --git a/old_tests/tests/lean/run/blast_unit2.lean b/old_tests/tests/lean/run/blast_unit2.lean deleted file mode 100644 index 779cb333f7..0000000000 --- a/old_tests/tests/lean/run/blast_unit2.lean +++ /dev/null @@ -1,19 +0,0 @@ -variables {A₁ A₂ A₃ A₄ B₁ B₂ B₃ B₄ : Prop} - -meta def blast : tactic unit := -using_smt $ smt_tactic.intros >> return () - -constants (a b c d e : nat) -constants (p : nat → Prop) -constants (q : nat → nat → Prop) -constants (f : nat → nat) - -lemma lemma1 : a = d → b = e → p b → (p a → (¬ p e) ∧ p c) → ¬ p d := by blast -lemma lemma2a : ¬ p b → (p d → p b ∧ p c) → d = e → e = a → ¬ p a := by blast -lemma lemma2b : ¬ p (f b) → (p (f a) → p (f d) ∧ p (f c)) → b = d → ¬ p (f a) := by blast -lemma lemma3 : p (f (f b)) → (p (f a) → p (f c) ∧ (¬ p (f (f (f (f b)))))) → b = f b → ¬ p (f a) := by blast -lemma lemma4a : b = f b → ¬ p (f (f b)) → (p a → q c c ∧ p (f (f (f (f (f b)))))) → ¬ p a := by blast -lemma lemma4b : b = f b → ¬ p (f (f b)) → (p a → q c c ∧ q e c ∧ q d e ∧ p (f (f (f (f (f b))))) ∧ q e d) → ¬ p a := -by blast -lemma lemma5 : p b → (p (f a) → (¬ p b) ∧ p e ∧ p c) → ¬ p (f a) := by blast -lemma lemma6 : ¬ (q b a) → d = a → (p a → p e ∧ (q b d) ∧ p c) → ¬ p a := by blast diff --git a/old_tests/tests/lean/run/booltst.lean b/old_tests/tests/lean/run/booltst.lean deleted file mode 100644 index 6086ef83a0..0000000000 --- a/old_tests/tests/lean/run/booltst.lean +++ /dev/null @@ -1,3 +0,0 @@ -open bool - -#check ff diff --git a/old_tests/tests/lean/run/bor_lazy.lean b/old_tests/tests/lean/run/bor_lazy.lean deleted file mode 100644 index 160a332b28..0000000000 --- a/old_tests/tests/lean/run/bor_lazy.lean +++ /dev/null @@ -1,3 +0,0 @@ -open bool - -#eval (timeit "branch1:" tt) || (timeit "branch2:" tt) diff --git a/old_tests/tests/lean/run/bug5.lean b/old_tests/tests/lean/run/bug5.lean deleted file mode 100644 index 805caa815e..0000000000 --- a/old_tests/tests/lean/run/bug5.lean +++ /dev/null @@ -1,2 +0,0 @@ -theorem symm2 {A : Type} {a b : A} (H : a = b) : b = a -:= eq.subst H (eq.refl a) diff --git a/old_tests/tests/lean/run/bug6.lean b/old_tests/tests/lean/run/bug6.lean deleted file mode 100644 index 479b942bd3..0000000000 --- a/old_tests/tests/lean/run/bug6.lean +++ /dev/null @@ -1,19 +0,0 @@ -section - variable {A : Type} - theorem T {a b : A} (H : a = b) : b = a - := symm H - variables x y : A - variable H : x = y - #check T H - #check T -end - -section - variable {A : Type} - theorem T2 ⦃a b : A⦄ (H : a = b) : b = a - := symm H - variables x y : A - variable H : x = y - #check T2 H - #check T2 -end diff --git a/old_tests/tests/lean/run/bug_proving_eqn_lemmas.lean b/old_tests/tests/lean/run/bug_proving_eqn_lemmas.lean deleted file mode 100644 index 0bd728ff1b..0000000000 --- a/old_tests/tests/lean/run/bug_proving_eqn_lemmas.lean +++ /dev/null @@ -1,13 +0,0 @@ -universe variables u - -inductive bintree (α : Type u) -| leaf : α → bintree -| node : bintree → bintree → bintree - -open bintree - -def to_list {α : Type u} : bintree α → list α → list α -| (leaf α) l := α :: l -| (node t₁ t₂) l := to_list t₁ (to_list t₂ l) - -#eval to_list (node (node (leaf 1) (leaf 2)) (node (leaf 3) (leaf 4))) [] diff --git a/old_tests/tests/lean/run/bug_refl_lemma.lean b/old_tests/tests/lean/run/bug_refl_lemma.lean deleted file mode 100644 index 1a70a515ea..0000000000 --- a/old_tests/tests/lean/run/bug_refl_lemma.lean +++ /dev/null @@ -1,4 +0,0 @@ -def f := @id -@[simp] lemma foo {α : Type} [inhabited α] : f = @id α := rfl - -example : f = @id ℕ := by simp diff --git a/old_tests/tests/lean/run/calc.lean b/old_tests/tests/lean/run/calc.lean deleted file mode 100644 index 337d1e0b62..0000000000 --- a/old_tests/tests/lean/run/calc.lean +++ /dev/null @@ -1,14 +0,0 @@ -namespace foo - constant le : nat → nat → Prop - axiom le_trans {a b c : nat} : le a b → le b c → le a c - attribute [trans] le_trans - infix `<<`:50 := le -end foo - -namespace foo - theorem T {a b c d : nat} : a << b → b << c → c << d → a << d - := assume H1 H2 H3, - calc a << b : H1 - ... << c : H2 - ... << d : H3 -end foo diff --git a/old_tests/tests/lean/run/calc_auto_trans_eq.lean b/old_tests/tests/lean/run/calc_auto_trans_eq.lean deleted file mode 100644 index bc39e13752..0000000000 --- a/old_tests/tests/lean/run/calc_auto_trans_eq.lean +++ /dev/null @@ -1,17 +0,0 @@ -constant R : Π {A : Type}, A → A → Prop -infix `~` := R - -example {A : Type} {a b c d : list nat} (H₁ : a ~ b) (H₂ : b = c) (H₃ : c = d) : a ~ d := -calc a ~ b : H₁ - ... = c : H₂ - ... = d : H₃ - -example {A : Type} {a b c d : list nat} (H₁ : a = b) (H₂ : b = c) (H₃ : c ~ d) : a ~ d := -calc a = b : H₁ - ... = c : H₂ - ... ~ d : H₃ - -example {A : Type} {a b c d : list nat} (H₁ : a = b) (H₂ : b ~ c) (H₃ : c = d) : a ~ d := -calc a = b : H₁ - ... ~ c : H₂ - ... = d : H₃ diff --git a/old_tests/tests/lean/run/calc_bug.lean b/old_tests/tests/lean/run/calc_bug.lean deleted file mode 100644 index c582963e46..0000000000 --- a/old_tests/tests/lean/run/calc_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -definition foo (a : Type) := -calc a = a : rfl diff --git a/old_tests/tests/lean/run/calc_heq_symm.lean b/old_tests/tests/lean/run/calc_heq_symm.lean deleted file mode 100644 index a5a51c3375..0000000000 --- a/old_tests/tests/lean/run/calc_heq_symm.lean +++ /dev/null @@ -1,8 +0,0 @@ -theorem tst {A B C D : Type} {a₁ a₂ : A} {b : B} {c : C} {d : D} - (H₀ : a₁ = a₂) (H₁ : a₂ == b) (H₂ : b == c) (H₃ : c == d) : d == a₁ := -calc d == c : heq.symm H₃ - ... == b : heq.symm H₂ - ... == a₂ : heq.symm H₁ - ... = a₁ : eq.symm H₀ - -#print definition tst diff --git a/old_tests/tests/lean/run/calc_imp.lean b/old_tests/tests/lean/run/calc_imp.lean deleted file mode 100644 index 3b90350d48..0000000000 --- a/old_tests/tests/lean/run/calc_imp.lean +++ /dev/null @@ -1,4 +0,0 @@ -example (A B C D : Prop) (h1 : A → B) (h2 : B → C) (h3 : C → D) : A → D := -calc A → B : h1 - ... → C : h2 - ... → D : h3 diff --git a/old_tests/tests/lean/run/calc_tac.lean b/old_tests/tests/lean/run/calc_tac.lean deleted file mode 100644 index 9d7657367e..0000000000 --- a/old_tests/tests/lean/run/calc_tac.lean +++ /dev/null @@ -1,8 +0,0 @@ -axiom addz {A : Type} [has_add A] [has_zero A] : ∀ a : A, a + 0 = a -axiom addc {A : Type} [has_add A] : ∀ a b : A, a + b = b + a - -example {A : Type} [has_add A] [has_zero A] [has_one A] (a b c : A) : b = 0 → a + b + c = c + a := -assume h, -calc a + b + c = a + 0 + c : by rw h - ... = a + c : by rw addz - ... = c + a : by rw addc diff --git a/old_tests/tests/lean/run/cases_bug.lean b/old_tests/tests/lean/run/cases_bug.lean deleted file mode 100644 index a848ae9899..0000000000 --- a/old_tests/tests/lean/run/cases_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -theorem cast_heq₂ : ∀ {A B : Type} (H : A = B) (a : A), cast H a == a -| A .(A) (eq.refl .(A)) a := heq_of_eq $ cast_eq _ _ diff --git a/old_tests/tests/lean/run/cases_bug2.lean b/old_tests/tests/lean/run/cases_bug2.lean deleted file mode 100644 index 32d7012e54..0000000000 --- a/old_tests/tests/lean/run/cases_bug2.lean +++ /dev/null @@ -1,4 +0,0 @@ -open tactic - -example (a : nat) : 0 = nat.succ a → false -:= by do h ← intro1, cases h diff --git a/old_tests/tests/lean/run/cases_bug3.lean b/old_tests/tests/lean/run/cases_bug3.lean deleted file mode 100644 index c61fbe0a6a..0000000000 --- a/old_tests/tests/lean/run/cases_bug3.lean +++ /dev/null @@ -1,2 +0,0 @@ -theorem ex {A : Type} : ∀ {a a' : A}, a == a' → a = a' -| a .(a) (heq.refl .(a)) := eq.refl a diff --git a/old_tests/tests/lean/run/cases_crash1.lean b/old_tests/tests/lean/run/cases_crash1.lean deleted file mode 100644 index 544c864ffc..0000000000 --- a/old_tests/tests/lean/run/cases_crash1.lean +++ /dev/null @@ -1,12 +0,0 @@ -open tactic - -axiom Sorry : ∀ A : Type, A - -inductive Enum : Type | ea | eb | ec | ed -attribute [instance] -noncomputable definition Enum_dec_eq : decidable_eq Enum := -by do a ← intro `a, cases a, - b ← intro `b, cases b, - right >> reflexivity, - try (do left, h ← intro `H, cases h), - repeat $ intros >> mk_const `Sorry >>= apply >> skip diff --git a/old_tests/tests/lean/run/cases_nested.lean b/old_tests/tests/lean/run/cases_nested.lean deleted file mode 100644 index 5be973ce0d..0000000000 --- a/old_tests/tests/lean/run/cases_nested.lean +++ /dev/null @@ -1,24 +0,0 @@ -inductive term : Type -| var : string → term -| app : string → list term → term - -def cidx : term → nat -| (term.var _) := 1 -| (term.app _ _) := 2 - -def to_list : term → list term -| (term.app _ ts) := ts -| (term.var _) := [] - -def tid : term → string -| (term.var id) := id -| (term.app id _) := id - -lemma ex (t : term) (h : cidx t = 2) : term.app (tid t) (to_list t) = t := -begin - cases t, - {simp [cidx] at h, - have h : 1 ≠ 2, tactic.comp_val, - contradiction}, - {simp [tid, to_list]} -end diff --git a/old_tests/tests/lean/run/cases_renaming_issue.lean b/old_tests/tests/lean/run/cases_renaming_issue.lean deleted file mode 100644 index f7fab241f4..0000000000 --- a/old_tests/tests/lean/run/cases_renaming_issue.lean +++ /dev/null @@ -1,15 +0,0 @@ -inductive fi : ℕ → Type -| zero : Π {n}, fi (n + 1) -| suc : Π {n}, fi n → fi (n + 1) -open fi - -namespace fi - -def lift {n k} : Π m, (fi n → fi k) → fi (n + m) → fi (k + m) := -begin - intros m f i, induction m with m ih_m, exact f i, - cases i with n n i, exact fi.zero, - exact fi.suc (ih_m i) -end - -end fi diff --git a/old_tests/tests/lean/run/cases_tac1.lean b/old_tests/tests/lean/run/cases_tac1.lean deleted file mode 100644 index 1c5bc1c499..0000000000 --- a/old_tests/tests/lean/run/cases_tac1.lean +++ /dev/null @@ -1,46 +0,0 @@ -inductive {u} vec (A : Type u) : nat → Type u -| nil : vec 0 -| cons : ∀ {n}, A → vec n → vec (n+1) - -open tactic nat vec - -def head {A : Type*} : ∀ {n : nat}, vec A (n+1) → A -| n (cons h t) := h - -def tail {A : Type*} : ∀ {n : nat}, vec A (n+1) → vec A n -| n (cons h t) := t - -@[simp] lemma head_cons {A : Type*} {n : nat} (a : A) (v : vec A n) : head (cons a v) = a := -rfl - -@[simp] -lemma tail_cons {A : Type*} {n : nat} (a : A) (v : vec A n) : tail (cons a v) = v := -rfl - -example {A : Type*} {n : nat} (v w : vec A (n+1)) : head v = head w → tail v = tail w → v = w := -by do - v ← get_local `v, - cases v [`n', `hv, `tv], - trace_state, - w ← get_local `w, - cases w [`n', `hw, `tw], - trace_state, - dsimp_target, - trace_state, - Heq1 ← intro1, - Heq2 ← intro1, - subst Heq1, subst Heq2, - reflexivity - -#print "-------" - -example (n : nat) : n ≠ 0 → succ (pred n) = n := -by do - H ← intro `H, - n ← get_local `n, - cases n [`n'], - trace_state, - contradiction, - reflexivity - -#print "---------" diff --git a/old_tests/tests/lean/run/cases_term.lean b/old_tests/tests/lean/run/cases_term.lean deleted file mode 100644 index f8ff3d8dcb..0000000000 --- a/old_tests/tests/lean/run/cases_term.lean +++ /dev/null @@ -1,10 +0,0 @@ -example (f : nat → nat) (p : nat → Prop) - (h₁ : ∀ x, f (nat.succ x) = 1) - (h₂ : ¬ p 0) - (a : nat) - (h₃ : p (f a)) : f (f a) = 1 := -begin - cases f a, - contradiction, - apply h₁ -end diff --git a/old_tests/tests/lean/run/cast_sorry_bug.lean b/old_tests/tests/lean/run/cast_sorry_bug.lean deleted file mode 100644 index a03e9610cb..0000000000 --- a/old_tests/tests/lean/run/cast_sorry_bug.lean +++ /dev/null @@ -1,10 +0,0 @@ -open nat - -inductive Fin : ℕ → Type -| zero : Π {n : ℕ}, Fin (succ n) -| succ : Π {n : ℕ}, Fin n → Fin (succ n) - -theorem foo (n m : ℕ) (a : Fin n) (b : Fin m) (H : n = m) : cast (congr_arg Fin H) a = b := -have eq : Fin n = Fin m, from congr_arg Fin H, -have ceq : cast eq a = b, from sorry, -- sorry implicit argument must have access to eq -sorry diff --git a/old_tests/tests/lean/run/cc1.lean b/old_tests/tests/lean/run/cc1.lean deleted file mode 100644 index 2a393cd981..0000000000 --- a/old_tests/tests/lean/run/cc1.lean +++ /dev/null @@ -1,74 +0,0 @@ -open tactic - -set_option pp.implicit true - -example (a b c d : nat) (f : nat → nat → nat) : a = b → b = c → d + (if b > 0 then a else b) = 0 → f (b + b) b ≠ f (a + c) c → false := -by do intros, - s ← cc_state.mk_using_hs, - trace s, - t₁ ← to_expr ```(f (b + b) b), - t₂ ← to_expr ```(f (a + c) c), - b ← to_expr ```(b), - d ← to_expr ```(d), - guard (s^.inconsistent), - guard (s^.eqc_size b = 4), - guard (not (s^.in_singlenton_eqc b)), - guard (s^.in_singlenton_eqc d), - trace ">>> Equivalence roots", - trace s^.roots, - trace ">>> b's equivalence class", - trace (s^.eqc_of b), - pr ← s^.eqv_proof t₁ t₂, - note `h none pr, - contradiction - -example (a b : nat) (f : nat → nat) : a = b → f a = f b := -by cc - -example (a b : nat) (f : nat → nat) : a = b → f a ≠ f b → false := -by cc - -example (a b : nat) (f : nat → nat) : a = b → f (f a) ≠ f (f b) → false := -by cc - -example (a b c : nat) (f : nat → nat) : a = b → c = b → f (f a) ≠ f (f c) → false := -by cc - -example (a b c : nat) (f : nat → nat → nat) : a = b → c = b → f (f a b) a ≠ f (f c c) c → false := -by cc - -example (a b c : nat) (f : nat → nat → nat) : a = b → c = b → f (f a b) a = f (f c c) c := -by cc - -example (a b c d : nat) : a == b → b = c → c == d → a == d := -by cc - -example (a b c d : nat) : a = b → b = c → c == d → a == d := -by cc - -example (a b c d : nat) : a = b → b == c → c == d → a == d := -by cc - -example (a b c d : nat) : a == b → b == c → c = d → a == d := -by cc - -example (a b c d : nat) : a == b → b = c → c = d → a == d := -by cc - -example (a b c d : nat) : a = b → b = c → c = d → a == d := -by cc - -example (a b c d : nat) : a = b → b == c → c = d → a == d := -by cc - -constant f {α : Type} : α → α → α -constant g : nat → nat - -example (a b c : nat) : a = b → g a == g b := -by cc - -example (a b c : nat) : a = b → c = b → f (f a b) (g c) = f (f c a) (g b) := -by cc - -example (a b c d e x y : nat) : a = b → a = x → b = y → c = d → c = e → c = b → a = e := -by cc diff --git a/old_tests/tests/lean/run/cc2.lean b/old_tests/tests/lean/run/cc2.lean deleted file mode 100644 index f902662bfb..0000000000 --- a/old_tests/tests/lean/run/cc2.lean +++ /dev/null @@ -1,30 +0,0 @@ -constant f (a b : nat) : a > b → nat -constant g : nat → nat -open tactic - -example (a₁ a₂ b₁ b₂ c d : nat) - (H₁ : a₁ > b₁) - (H₂ : a₂ > b₂) : - a₁ = c → a₂ = c → - b₁ = d → d = b₂ → - g (g (f a₁ b₁ H₁)) = g (g (f a₂ b₂ H₂)) := -by cc - -example (a₁ a₂ b₁ b₂ c d : nat) : - a₁ = c → a₂ = c → - b₁ = d → d = b₂ → - a₁ + b₁ + a₁ = a₂ + b₂ + c := -by cc - -example (a b c : Prop) : (a ↔ b) → ((a ∧ (c ∨ b)) ↔ (b ∧ (c ∨ a))) := -by cc - -example (a b c d : Prop) - [d₁ : decidable a] [d₂ : decidable b] [d₃ : decidable c] [d₄ : decidable d] - : (a ↔ b) → (c ↔ d) → ((if (a ∧ c) then true else false) ↔ (if (b ∧ d) then true else false)) := -by cc - -example (a b c d : Prop) (x y z : nat) - [d₁ : decidable a] [d₂ : decidable b] [d₃ : decidable c] [d₄ : decidable d] - : (a ↔ b) → (c ↔ d) → x = y → ((if (a ∧ c ∧ a) then x else y) = (if (b ∧ d ∧ b) then y else x)) := -by cc diff --git a/old_tests/tests/lean/run/cc3.lean b/old_tests/tests/lean/run/cc3.lean deleted file mode 100644 index 1c61050258..0000000000 --- a/old_tests/tests/lean/run/cc3.lean +++ /dev/null @@ -1,70 +0,0 @@ -open tactic - -example (a b : nat) : (a = b ↔ a = b) := -by cc - -example (a b : nat) : (a = b) = (b = a) := -by cc - -example (a b : nat) : (a = b) == (b = a) := -by cc - -example (p : nat → nat → Prop) (f : nat → nat) (a b c d : nat) : - p (f a) (f b) → a = c → b = d → b = c → p (f c) (f c) := -by cc - -example (p : nat → nat → Prop) (a b c d : nat) : - p a b → a = c → b = d → p c d := -by cc - -example (p : nat → nat → Prop) (f : nat → nat) (a b c d : nat) : - p (f (f (f (f (f (f a)))))) - (f (f (f (f (f (f b)))))) → - a = c → b = d → b = c → - p (f (f (f (f (f (f c)))))) - (f (f (f (f (f (f c)))))) := -by cc - -constant R : nat → nat → Prop - -example (a b c : nat) : a = b → R a b → R a a := -by cc - -example (a b c : Prop) : a = b → b = c → (a ↔ c) := -by cc - -example (a b c : Prop) : a = b → b == c → (a ↔ c) := -by cc - -example (a b c : nat) : a == b → b = c → a == c := -by cc - -example (a b c : nat) : a == b → b = c → a = c := -by cc - -example (a b c d : nat) : a == b → b == c → c == d → a = d := -by cc - -example (a b c d : nat) : a == b → b = c → c == d → a = d := -by cc - -example (a b c : Prop) : a = b → b = c → (a ↔ c) := -by cc - -example (a b c : Prop) : a == b → b = c → (a ↔ c) := -by cc - -example (a b c d : Prop) : a == b → b == c → c == d → (a ↔ d) := -by cc - -definition foo (a b c d : Prop) : a == b → b = c → c == d → (a ↔ d) := -by cc - -example (a b c : nat) (f : nat → nat) : a == b → b = c → f a == f c := -by cc - -example (a b c : nat) (f : nat → nat) : a == b → b = c → f a = f c := -by cc - -example (a b c d : nat) (f : nat → nat) : a == b → b = c → c == f d → f a = f (f d) := -by cc diff --git a/old_tests/tests/lean/run/cc4.lean b/old_tests/tests/lean/run/cc4.lean deleted file mode 100644 index 7cc4b4156b..0000000000 --- a/old_tests/tests/lean/run/cc4.lean +++ /dev/null @@ -1,17 +0,0 @@ -import data.vector open tactic - -universe variables u - -axiom app : Π {α : Type u} {n m : nat}, vector α m → vector α n → vector α (m+n) - -example (n1 n2 n3 : nat) (v1 w1 : vector nat n1) (w1' : vector nat n3) (v2 w2 : vector nat n2) : - n1 = n3 → v1 = w1 → w1 == w1' → v2 = w2 → app v1 v2 == app w1' w2 := -by cc - -example (n1 n2 n3 : nat) (v1 w1 : vector nat n1) (w1' : vector nat n3) (v2 w2 : vector nat n2) : - n1 == n3 → v1 = w1 → w1 == w1' → v2 == w2 → app v1 v2 == app w1' w2 := -by cc - -example (n1 n2 n3 : nat) (v1 w1 v : vector nat n1) (w1' : vector nat n3) (v2 w2 w : vector nat n2) : - n1 == n3 → v1 = w1 → w1 == w1' → v2 == w2 → app w1' w2 == app v w → app v1 v2 = app v w := -by cc diff --git a/old_tests/tests/lean/run/cc5.lean b/old_tests/tests/lean/run/cc5.lean deleted file mode 100644 index 23093bc876..0000000000 --- a/old_tests/tests/lean/run/cc5.lean +++ /dev/null @@ -1,60 +0,0 @@ -constants (A : Type) (B : A → Type) (C : ∀ (a : A) (ba : B a), Type) - (D : ∀ (a : A) (ba : B a) (cba : C a ba), Type) - (E : ∀ (a : A) (ba : B a) (cba : C a ba) (dcba : D a ba cba), Type) - (F : ∀ (a : A) (ba : B a) (cba : C a ba) (dcba : D a ba cba) (edcba : E a ba cba dcba), Type) - (C_ss : ∀ a ba, subsingleton (C a ba)) - (a1 a2 a3 : A) - (mk_B1 mk_B2 : ∀ a, B a) - (mk_C1 mk_C2 : ∀ {a} ba, C a ba) - - (tr_B : ∀ {a}, B a → B a) - (x y z : A → A) - - (f f' : ∀ {a : A} {ba : B a} (cba : C a ba), D a ba cba) - (g : ∀ {a : A} {ba : B a} {cba : C a ba} (dcba : D a ba cba), E a ba cba dcba) - (h : ∀ {a : A} {ba : B a} {cba : C a ba} {dcba : D a ba cba} (edcba : E a ba cba dcba), F a ba cba dcba edcba) - - -attribute [instance] C_ss -open tactic - -example : ∀ (a a' : A), a == a' → mk_B1 a == mk_B1 a' := -by cc - -example : ∀ (a a' : A), a == a' → mk_B2 a == mk_B2 a' := -by cc - -example : a1 == y a2 → mk_B1 a1 == mk_B1 (y a2) := -by cc - -example : a1 == x a2 → a2 == y a1 → mk_B1 (x (y a1)) == mk_B1 (x (y (x a2))) := -by cc - -example : a1 == y a2 → mk_B1 a1 == mk_B2 (y a2) → f (mk_C1 (mk_B2 a1)) == f (mk_C2 (mk_B1 (y a2))) := -by cc - -example : a1 == y a2 → tr_B (mk_B1 a1) == mk_B2 (y a2) → f (mk_C1 (mk_B2 a1)) == f (mk_C2 (tr_B (mk_B1 (y a2)))) := -by cc - -example : a1 == y a2 → mk_B1 a1 == mk_B2 (y a2) → g (f (mk_C1 (mk_B2 a1))) == g (f (mk_C2 (mk_B1 (y a2)))) := -by cc - -example : a1 == y a2 → tr_B (mk_B1 a1) == mk_B2 (y a2) → g (f (mk_C1 (mk_B2 a1))) == g (f (mk_C2 (tr_B (mk_B1 (y a2))))) := -by cc - -example : a1 == y a2 → a2 == z a3 → a3 == x a1 → mk_B1 a1 == mk_B2 (y (z (x a1))) → - f (mk_C1 (mk_B2 (y (z (x a1))))) == f' (mk_C2 (mk_B1 a1)) → - g (f (mk_C1 (mk_B2 (y (z (x a1)))))) == g (f' (mk_C2 (mk_B1 a1))) := -by cc - -example : a1 == y a2 → a2 == z a3 → a3 == x a1 → mk_B1 a1 == mk_B2 (y (z (x a1))) → - f (mk_C1 (mk_B2 (y (z (x a1))))) == f' (mk_C2 (mk_B1 a1)) → - f' (mk_C1 (mk_B1 a1)) == f (mk_C2 (mk_B2 (y (z (x a1))))) → - g (f (mk_C1 (mk_B1 (y (z (x a1)))))) == g (f' (mk_C2 (mk_B2 a1))) := -by cc - -example : a1 == y a2 → a2 == z a3 → a3 == x a1 → tr_B (mk_B1 a1) == mk_B2 (y (z (x a1))) → - f (mk_C1 (mk_B2 (y (z (x a1))))) == f' (mk_C2 (tr_B (mk_B1 a1))) → - f' (mk_C1 (tr_B (mk_B1 a1))) == f (mk_C2 (mk_B2 (y (z (x a1))))) → - g (f (mk_C1 (tr_B (mk_B1 (y (z (x a1))))))) == g (f' (mk_C2 (mk_B2 a1))) := -by cc diff --git a/old_tests/tests/lean/run/cc6.lean b/old_tests/tests/lean/run/cc6.lean deleted file mode 100644 index 413e2157cd..0000000000 --- a/old_tests/tests/lean/run/cc6.lean +++ /dev/null @@ -1,19 +0,0 @@ -open tactic - -example (a b c a' b' c' : nat) : a = a' → b = b' → c = c' → a + b + c + a = a' + b' + c' + a' := -by cc - -example (a b : unit) : a = b := -by cc - -example (a b : nat) (h₁ : a = 0) (h₂ : b = 0) : a = b → h₁ == h₂ := -by cc - -constant inv' : ∀ (a : nat), a ≠ 0 → nat - -example (a b : nat) (h₁ : a ≠ 0) (h₂ : b ≠ 0) : a = b → inv' a h₁ = inv' b h₂ := -by cc - -example (C : nat → Type) (f : Π n, C n → C n) (n m : nat) (c : C n) (d : C m) : - f n == f m → c == d → n == m → f n c == f m d := -by cc diff --git a/old_tests/tests/lean/run/cc7.lean b/old_tests/tests/lean/run/cc7.lean deleted file mode 100644 index a71bb3d296..0000000000 --- a/old_tests/tests/lean/run/cc7.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -example (f g : Π {α : Type}, α → α → α) (h : nat → nat) (a b : nat) : - h = f a → h b = f a b := -by cc - -example (f g : Π {α : Type} (a b : α), {x : α // x ≠ b}) (h : Π (b : nat), {x : nat // x ≠ b}) (a b₁ b₂ : nat) : - h = f a → b₁ = b₂ → h b₁ == f a b₂ := -by cc - -example (f : nat → nat → nat) (a b c d : nat) : - c = d → f a = f b → f a c = f b d := -by cc - -example (f : nat → nat → nat) (a b c d : nat) : - c == d → f a == f b → f a c == f b d := -by cc diff --git a/old_tests/tests/lean/run/cc_ac1.lean b/old_tests/tests/lean/run/cc_ac1.lean deleted file mode 100644 index fcbef5aef0..0000000000 --- a/old_tests/tests/lean/run/cc_ac1.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic - -example (a b c : nat) (f : nat → nat) : f (a + b + c) = f (c + b + a) := -by cc - -example (a b c : nat) (f : nat → nat) : a + b = c → f (c + c) = f (a + b + c) := -by cc diff --git a/old_tests/tests/lean/run/cc_ac2.lean b/old_tests/tests/lean/run/cc_ac2.lean deleted file mode 100644 index 97f989f066..0000000000 --- a/old_tests/tests/lean/run/cc_ac2.lean +++ /dev/null @@ -1,4 +0,0 @@ -open tactic - -example (a b c d : nat) (f : nat → nat → nat) : b + a = d → f (a + b + c) a = f (c + d) a := -by cc diff --git a/old_tests/tests/lean/run/cc_ac3.lean b/old_tests/tests/lean/run/cc_ac3.lean deleted file mode 100644 index de3bd032fd..0000000000 --- a/old_tests/tests/lean/run/cc_ac3.lean +++ /dev/null @@ -1,36 +0,0 @@ -open tactic - -example (a b c d e : nat) (f : nat → nat → nat) : b + a = d → b + c = e → f (a + b + c) (a + b + c) = f (c + d) (a + e) := -by cc - -example (a b c d e : nat) (f : nat → nat → nat) : b + a = d + d → b + c = e + e → f (a + b + c) (a + b + c) = f (c + d + d) (e + a + e) := -by cc - -section - universe variable u - variables {α : Type u} - variable [comm_semiring α] - - example (a b c d e : α) (f : α → α → α) : b + a = d + d → b + c = e + e → f (a + b + c) (a + b + c) = f (c + d + d) (e + a + e) := - by cc -end - -section - universe variable u - variables {α : Type u} - variable [comm_ring α] - - example (a b c d e : α) (f : α → α → α) : b + a = d + d → b + c = e + e → f (a + b + c) (a + b + c) = f (c + d + d) (e + a + e) := - by cc -end - -section - universe variable u - variables {α : Type u} - variables op : α → α → α - variables [is_associative α op] - variables [is_commutative α op] - - lemma ex (a b c d e : α) (f : α → α → α) : op b a = op d d → op b c = op e e → f (op a (op b c)) (op (op a b) c) = f (op (op c d) d) (op e (op a e)) := - by cc -end diff --git a/old_tests/tests/lean/run/cc_ac4.lean b/old_tests/tests/lean/run/cc_ac4.lean deleted file mode 100644 index d90f380bf3..0000000000 --- a/old_tests/tests/lean/run/cc_ac4.lean +++ /dev/null @@ -1,14 +0,0 @@ ---import data.set.basic -open tactic - -constant union_is_assoc {α} : is_associative (set α) (∪) -constant union_is_comm {α} : is_commutative (set α) (∪) -attribute [instance] union_is_assoc union_is_comm - -section - universe variable u - variables {α : Type u} - - example (a b c d₁ d₂ e₁ e₂ : set α) (f : set α → set α → set α) : b ∪ a = d₁ ∪ d₂ → b ∪ c = e₂ ∪ e₁ → f (a ∪ b ∪ c) (a ∪ b ∪ c) = f (c ∪ d₂ ∪ d₁) (e₂ ∪ a ∪ e₁) := - by cc -end diff --git a/old_tests/tests/lean/run/cc_ac5.lean b/old_tests/tests/lean/run/cc_ac5.lean deleted file mode 100644 index 5f08a40d28..0000000000 --- a/old_tests/tests/lean/run/cc_ac5.lean +++ /dev/null @@ -1,14 +0,0 @@ -universe variables u -variables {α : Type u} -variables [comm_ring α] -open tactic - - -example (x1 x2 x3 x4 x5 x6 : α) : x1*x4 = x1 → x3*x6 = x5*x5 → x5 = x4 → x6 = x2 → x1 = x1*(x6*x3) := -by cc - -example (y1 y2 x2 x3 x4 x5 x6 : α) : (y1 + y2)*x4 = (y2 + y1) → x3*x6 = x5*x5 → x5 = x4 → x6 = x2 → (y2 + y1) = (y1 + y2)*(x6*x3) := -by cc - -example (y1 y2 y3 x2 x3 x4 x5 x6 : α) : (y1 + y2)*x4 = (y3 + y1) → x3*x6 = x5*x5 → x5 = x4 → x6 = x2 → y2 = y3 → (y2 + y1) = (y1 + y3)*(x6*x3) := -by cc diff --git a/old_tests/tests/lean/run/cc_ac_bug.lean b/old_tests/tests/lean/run/cc_ac_bug.lean deleted file mode 100644 index 386f8fb533..0000000000 --- a/old_tests/tests/lean/run/cc_ac_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -example (a b c : nat) (f : nat → nat → nat) : f (b * c) (c * b * a) = f (c * b) (a * c * b) := -by ac_refl diff --git a/old_tests/tests/lean/run/cc_beta.lean b/old_tests/tests/lean/run/cc_beta.lean deleted file mode 100644 index 555838e5a9..0000000000 --- a/old_tests/tests/lean/run/cc_beta.lean +++ /dev/null @@ -1,68 +0,0 @@ -example (f : nat → nat → nat) (a b c : nat) : - f a = (λ x, x) → f a b = b := -begin [smt] - intros, -end - -example (f g : nat → nat → nat) (a b c : nat) : - f a = g c → f a = (λ x, x) → g c b = b := -begin [smt] - intros, -end - -constant F : nat → nat → nat -constant G : nat → nat → nat - -example (a b c : nat) : - F a = (λ x, x) → F a b = b := -begin [smt] - intros, -end - -example (a b c : nat) : - F a = G c → F a = (λ x, x) → G c b = b := -begin [smt] - intros, -end - -example (f : nat → nat → nat) (a b c : nat) : - f a b ≠ b → f a = (λ x, x) → false := -begin [smt] - intros, -end - -example (f g : nat → nat → nat) (a b c : nat) : - g c b ≠ b → f a = g c → f a = (λ x, x) → false := -begin [smt] - intros, -end - -example (f g : nat → nat → nat) (a b c : nat) : - f a = g c → g c b ≠ b → f a = (λ x, x) → false := -begin [smt] - intros, -end - -example (a b c : nat) : - F a b ≠ b → F a = (λ x, x) → false := -begin [smt] - intros, -end - -example (a b c : nat) : - G c b ≠ b → F a = G c → F a = (λ x, x) → false := -begin [smt] - intros, -end - -example (f : nat → nat → nat) (g : nat → nat → nat → nat) (a b c d : nat) : - g c d b ≠ b → f a = g c a → f a = (λ x, x) → d = a → false := -begin [smt] - intros, -end - -example (f : nat → nat → nat) (g : nat → nat → nat → nat) (a b c d : nat) : - d = a → g c d b ≠ b → f a = g c a → f a = (λ x, x) → false := -begin [smt] - intros, -end diff --git a/old_tests/tests/lean/run/cc_constructors.lean b/old_tests/tests/lean/run/cc_constructors.lean deleted file mode 100644 index a1f370febc..0000000000 --- a/old_tests/tests/lean/run/cc_constructors.lean +++ /dev/null @@ -1,58 +0,0 @@ -open tactic - -example (a b : nat) (s t : list nat) : a::s = b::t → a ≠ b → false := -by cc - -example (a b : nat) (s t : list nat) : a::s = b::t → t ≠ s → false := -by cc - -example (a c b : nat) (s t : list nat) : a::s = b::t → a ≠ c → c = b → false := -by cc - -example (a c b : nat) (s t : list nat) : a::a::s = a::b::t → a ≠ c → c = b → false := -by cc - -example (a b : nat) (s t r : list nat) : a::s = r → r = b::t → a ≠ b → false := -by cc - -example (a b : nat) (s t r : list nat) : a::s = r → r = b::t → a = b := -by cc - -example (a b : nat) (s t r : list nat) : list.cons a = list.cons b → a = b := -begin - intro h1, - /- In the current implementation, cc does not "complete" partially applied - constructor applications. So, the following one should fail. -/ - try {cc}, - /- Complete it manually. TODO(Leo): we can automate it for inhabited types. -/ - have h := congr_fun h1 [], - cc -end - -inductive foo -| mk1 : nat → nat → foo -| mk2 : nat → nat → foo - -example (a b : nat) : foo.mk1 a = foo.mk2 b → false := -begin - intro h1, - /- In the current implementation, cc does not "complete" partially applied - constructor applications. So, the following one should fail. -/ - try {cc}, - have h := congr_fun h1 0, - cc -end - -universe variables u -inductive Vec (α : Type u) : nat → Type (max 1 u) -| nil : Vec 0 -| cons : ∀ {n}, α → Vec n → Vec (nat.succ n) - -example (α : Type u) (a b c d : α) (n : nat) (s t : Vec α n) : Vec.cons a s = Vec.cons b t → a ≠ b → false := -by cc - -example (α : Type u) (a b c d : α) (n : nat) (s t : Vec α n) : Vec.cons a s = Vec.cons b t → t ≠ s → false := -by cc - -example (α : Type u) (a b c d : α) (n : nat) (s t : Vec α n) : Vec.cons a (Vec.cons a s) = Vec.cons a (Vec.cons b t) → b ≠ c → c = a → false := -by cc diff --git a/old_tests/tests/lean/run/cc_proj.lean b/old_tests/tests/lean/run/cc_proj.lean deleted file mode 100644 index cf59ee3a4b..0000000000 --- a/old_tests/tests/lean/run/cc_proj.lean +++ /dev/null @@ -1,10 +0,0 @@ -open tactic - -example (a b c d : nat) (f : nat → nat × nat) : (f d).1 ≠ a → f d = (b, c) → b = a → false := -by cc - -def ex (a b c d : nat) (f : nat → nat × nat) : (f d).2 ≠ a → f d = (b, c) → c = a → false := -by cc - -example (a b c : nat) (f : nat → nat) : (f b, c).1 ≠ f a → f b = f c → a = c → false := -by cc diff --git a/old_tests/tests/lean/run/cc_value.lean b/old_tests/tests/lean/run/cc_value.lean deleted file mode 100644 index e053c0bd65..0000000000 --- a/old_tests/tests/lean/run/cc_value.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -example (a b : nat) : a = 1 → b = 2 → a = b → false := -by cc - -example (a b c : int) : a = 1 → c = -2 → a = b → c = b → false := -by cc - -example (a b : char) : a = 'h' → b = 'w' → a = b → false := -by cc - -example (a b : string) : a = "hello" → b = "world" → a = b → false := -by cc - -example (a b c : string) : a = c → a = "hello" → c = "world" → c = b → false := -by cc diff --git a/old_tests/tests/lean/run/cheap_try_refl.lean b/old_tests/tests/lean/run/cheap_try_refl.lean deleted file mode 100644 index 5b55480fb2..0000000000 --- a/old_tests/tests/lean/run/cheap_try_refl.lean +++ /dev/null @@ -1,23 +0,0 @@ -example (h : false) : 10000000 = 20000000 := -begin - try {simp}, - contradiction -end - -example (h : false) (x : nat) : x + 10000000 = x + 20000000 := -begin - try {simp}, - contradiction -end - -example (h : false) (x y : nat) : x + y + 10000000 = x + y + 20000000 := -begin - try {simp}, - contradiction -end - -example (h : false) : "hello" = "world" := -begin - try {simp}, - contradiction -end diff --git a/old_tests/tests/lean/run/check_constants.lean b/old_tests/tests/lean/run/check_constants.lean deleted file mode 100644 index 9d29b68f79..0000000000 --- a/old_tests/tests/lean/run/check_constants.lean +++ /dev/null @@ -1,362 +0,0 @@ --- DO NOT EDIT, automatically generated file, generator scripts/gen_constants_cpp.py -import smt system.io -open tactic -meta def script_check_id (n : name) : tactic unit := -do env ← get_env, (env^.get n >> return ()) <|> (guard $ env^.is_namespace n) <|> (attribute.get_instances n >> return ()) <|> fail ("identifier '" ++ to_string n ++ "' is not a constant, namespace nor attribute") -run_cmd script_check_id `absurd -run_cmd script_check_id `acc.cases_on -run_cmd script_check_id `acc.rec -run_cmd script_check_id `add_comm_group -run_cmd script_check_id `add_comm_semigroup -run_cmd script_check_id `add_group -run_cmd script_check_id `add_monoid -run_cmd script_check_id `and -run_cmd script_check_id `and.elim_left -run_cmd script_check_id `and.elim_right -run_cmd script_check_id `and.intro -run_cmd script_check_id `and.rec -run_cmd script_check_id `and.cases_on -run_cmd script_check_id `auto_param -run_cmd script_check_id `bit0 -run_cmd script_check_id `bit1 -run_cmd script_check_id `bin_tree.empty -run_cmd script_check_id `bin_tree.leaf -run_cmd script_check_id `bin_tree.node -run_cmd script_check_id `bool -run_cmd script_check_id `bool.ff -run_cmd script_check_id `bool.tt -run_cmd script_check_id `combinator.K -run_cmd script_check_id `cast -run_cmd script_check_id `cast_heq -run_cmd script_check_id `char -run_cmd script_check_id `char.mk -run_cmd script_check_id `char.ne_of_vne -run_cmd script_check_id `char.of_nat -run_cmd script_check_id `char.of_nat_ne_of_ne -run_cmd script_check_id `is_valid_char_range_1 -run_cmd script_check_id `is_valid_char_range_2 -run_cmd script_check_id `coe -run_cmd script_check_id `coe_fn -run_cmd script_check_id `coe_sort -run_cmd script_check_id `coe_to_lift -run_cmd script_check_id `congr -run_cmd script_check_id `congr_arg -run_cmd script_check_id `congr_fun -run_cmd script_check_id `decidable -run_cmd script_check_id `decidable.to_bool -run_cmd script_check_id `distrib -run_cmd script_check_id `dite -run_cmd script_check_id `empty -run_cmd script_check_id `Exists -run_cmd script_check_id `eq -run_cmd script_check_id `eq.cases_on -run_cmd script_check_id `eq.drec -run_cmd script_check_id `eq.mp -run_cmd script_check_id `eq.mpr -run_cmd script_check_id `eq.rec -run_cmd script_check_id `eq.refl -run_cmd script_check_id `eq.subst -run_cmd script_check_id `eq.symm -run_cmd script_check_id `eq.trans -run_cmd script_check_id `eq_of_heq -run_cmd script_check_id `eq_rec_heq -run_cmd script_check_id `eq_true_intro -run_cmd script_check_id `eq_false_intro -run_cmd script_check_id `eq_self_iff_true -run_cmd script_check_id `expr -run_cmd script_check_id `expr.subst -run_cmd script_check_id `format -run_cmd script_check_id `false -run_cmd script_check_id `false_of_true_iff_false -run_cmd script_check_id `false_of_true_eq_false -run_cmd script_check_id `true_eq_false_of_false -run_cmd script_check_id `false.rec -run_cmd script_check_id `field -run_cmd script_check_id `fin.mk -run_cmd script_check_id `fin.ne_of_vne -run_cmd script_check_id `forall_congr -run_cmd script_check_id `forall_congr_eq -run_cmd script_check_id `forall_not_of_not_exists -run_cmd script_check_id `funext -run_cmd script_check_id `has_add -run_cmd script_check_id `has_add.add -run_cmd script_check_id `has_andthen.andthen -run_cmd script_check_id `has_bind.and_then -run_cmd script_check_id `has_bind.seq -run_cmd script_check_id `has_div -run_cmd script_check_id `has_div.div -run_cmd script_check_id `has_emptyc.emptyc -run_cmd script_check_id `has_mul -run_cmd script_check_id `has_mul.mul -run_cmd script_check_id `has_insert.insert -run_cmd script_check_id `has_inv -run_cmd script_check_id `has_inv.inv -run_cmd script_check_id `has_le -run_cmd script_check_id `has_le.le -run_cmd script_check_id `has_lt -run_cmd script_check_id `has_lt.lt -run_cmd script_check_id `has_neg -run_cmd script_check_id `has_neg.neg -run_cmd script_check_id `has_one -run_cmd script_check_id `has_one.one -run_cmd script_check_id `has_orelse.orelse -run_cmd script_check_id `has_sep.sep -run_cmd script_check_id `has_sizeof -run_cmd script_check_id `has_sizeof.mk -run_cmd script_check_id `has_sub -run_cmd script_check_id `has_sub.sub -run_cmd script_check_id `has_to_format -run_cmd script_check_id `has_repr -run_cmd script_check_id `has_well_founded -run_cmd script_check_id `has_well_founded.r -run_cmd script_check_id `has_well_founded.wf -run_cmd script_check_id `has_zero -run_cmd script_check_id `has_zero.zero -run_cmd script_check_id `has_coe_t -run_cmd script_check_id `heq -run_cmd script_check_id `heq.refl -run_cmd script_check_id `heq.symm -run_cmd script_check_id `heq.trans -run_cmd script_check_id `heq_of_eq -run_cmd script_check_id `hole_command -run_cmd script_check_id `id -run_cmd script_check_id `id_rhs -run_cmd script_check_id `id_delta -run_cmd script_check_id `if_neg -run_cmd script_check_id `if_pos -run_cmd script_check_id `iff -run_cmd script_check_id `iff_false_intro -run_cmd script_check_id `iff.intro -run_cmd script_check_id `iff.mp -run_cmd script_check_id `iff.mpr -run_cmd script_check_id `iff.refl -run_cmd script_check_id `iff.symm -run_cmd script_check_id `iff.trans -run_cmd script_check_id `iff_true_intro -run_cmd script_check_id `imp_congr -run_cmd script_check_id `imp_congr_eq -run_cmd script_check_id `imp_congr_ctx -run_cmd script_check_id `imp_congr_ctx_eq -run_cmd script_check_id `implies -run_cmd script_check_id `implies_of_if_neg -run_cmd script_check_id `implies_of_if_pos -run_cmd script_check_id `int -run_cmd script_check_id `int.bit0_nonneg -run_cmd script_check_id `int.bit1_nonneg -run_cmd script_check_id `int.one_nonneg -run_cmd script_check_id `int.zero_nonneg -run_cmd script_check_id `int.bit0_pos -run_cmd script_check_id `int.bit1_pos -run_cmd script_check_id `int.one_pos -run_cmd script_check_id `int.nat_abs_zero -run_cmd script_check_id `int.nat_abs_one -run_cmd script_check_id `int.nat_abs_bit0_step -run_cmd script_check_id `int.nat_abs_bit1_nonneg_step -run_cmd script_check_id `int.ne_of_nat_ne_nonneg_case -run_cmd script_check_id `int.ne_neg_of_ne -run_cmd script_check_id `int.neg_ne_of_pos -run_cmd script_check_id `int.ne_neg_of_pos -run_cmd script_check_id `int.neg_ne_zero_of_ne -run_cmd script_check_id `int.zero_ne_neg_of_ne -run_cmd script_check_id `interactive.param_desc -run_cmd script_check_id `interactive.parse -run_cmd script_check_id `io_core -run_cmd script_check_id `monad_io_impl -run_cmd script_check_id `monad_io_terminal_impl -run_cmd script_check_id `monad_io_file_system_impl -run_cmd script_check_id `monad_io_environment_impl -run_cmd script_check_id `monad_io_process_impl -run_cmd script_check_id `monad_io_random_impl -run_cmd script_check_id `io_rand_nat -run_cmd script_check_id `io -run_cmd script_check_id `is_associative -run_cmd script_check_id `is_associative.assoc -run_cmd script_check_id `is_commutative -run_cmd script_check_id `is_commutative.comm -run_cmd script_check_id `ite -run_cmd script_check_id `lean.parser -run_cmd script_check_id `lean.parser.pexpr -run_cmd script_check_id `lean.parser.tk -run_cmd script_check_id `left_distrib -run_cmd script_check_id `left_comm -run_cmd script_check_id `le_refl -run_cmd script_check_id `linear_ordered_ring -run_cmd script_check_id `linear_ordered_semiring -run_cmd script_check_id `list -run_cmd script_check_id `list.nil -run_cmd script_check_id `list.cons -run_cmd script_check_id `match_failed -run_cmd script_check_id `monad -run_cmd script_check_id `monad_fail -run_cmd script_check_id `monoid -run_cmd script_check_id `mul_one -run_cmd script_check_id `mul_zero -run_cmd script_check_id `mul_zero_class -run_cmd script_check_id `name.anonymous -run_cmd script_check_id `name.mk_numeral -run_cmd script_check_id `name.mk_string -run_cmd script_check_id `nat -run_cmd script_check_id `nat.succ -run_cmd script_check_id `nat.zero -run_cmd script_check_id `nat.has_zero -run_cmd script_check_id `nat.has_one -run_cmd script_check_id `nat.has_add -run_cmd script_check_id `nat.add -run_cmd script_check_id `nat.cases_on -run_cmd script_check_id `nat.bit0_ne -run_cmd script_check_id `nat.bit0_ne_bit1 -run_cmd script_check_id `nat.bit0_ne_zero -run_cmd script_check_id `nat.bit0_ne_one -run_cmd script_check_id `nat.bit1_ne -run_cmd script_check_id `nat.bit1_ne_bit0 -run_cmd script_check_id `nat.bit1_ne_zero -run_cmd script_check_id `nat.bit1_ne_one -run_cmd script_check_id `nat.zero_ne_one -run_cmd script_check_id `nat.zero_ne_bit0 -run_cmd script_check_id `nat.zero_ne_bit1 -run_cmd script_check_id `nat.one_ne_zero -run_cmd script_check_id `nat.one_ne_bit0 -run_cmd script_check_id `nat.one_ne_bit1 -run_cmd script_check_id `nat.bit0_lt -run_cmd script_check_id `nat.bit1_lt -run_cmd script_check_id `nat.bit0_lt_bit1 -run_cmd script_check_id `nat.bit1_lt_bit0 -run_cmd script_check_id `nat.zero_lt_one -run_cmd script_check_id `nat.zero_lt_bit1 -run_cmd script_check_id `nat.zero_lt_bit0 -run_cmd script_check_id `nat.one_lt_bit0 -run_cmd script_check_id `nat.one_lt_bit1 -run_cmd script_check_id `nat.le_of_lt -run_cmd script_check_id `nat.le_refl -run_cmd script_check_id `ne -run_cmd script_check_id `neq_of_not_iff -run_cmd script_check_id `norm_num.add1 -run_cmd script_check_id `norm_num.add1_bit0 -run_cmd script_check_id `norm_num.add1_bit1_helper -run_cmd script_check_id `norm_num.add1_one -run_cmd script_check_id `norm_num.add1_zero -run_cmd script_check_id `norm_num.add_div_helper -run_cmd script_check_id `norm_num.bin_add_zero -run_cmd script_check_id `norm_num.bin_zero_add -run_cmd script_check_id `norm_num.bit0_add_bit0_helper -run_cmd script_check_id `norm_num.bit0_add_bit1_helper -run_cmd script_check_id `norm_num.bit0_add_one -run_cmd script_check_id `norm_num.bit1_add_bit0_helper -run_cmd script_check_id `norm_num.bit1_add_bit1_helper -run_cmd script_check_id `norm_num.bit1_add_one_helper -run_cmd script_check_id `norm_num.div_add_helper -run_cmd script_check_id `norm_num.div_eq_div_helper -run_cmd script_check_id `norm_num.div_helper -run_cmd script_check_id `norm_num.div_mul_helper -run_cmd script_check_id `norm_num.mk_cong -run_cmd script_check_id `norm_num.mul_bit0_helper -run_cmd script_check_id `norm_num.mul_bit1_helper -run_cmd script_check_id `norm_num.mul_div_helper -run_cmd script_check_id `norm_num.neg_add_neg_helper -run_cmd script_check_id `norm_num.neg_add_pos_helper1 -run_cmd script_check_id `norm_num.neg_add_pos_helper2 -run_cmd script_check_id `norm_num.neg_mul_neg_helper -run_cmd script_check_id `norm_num.neg_mul_pos_helper -run_cmd script_check_id `norm_num.neg_neg_helper -run_cmd script_check_id `norm_num.neg_zero_helper -run_cmd script_check_id `norm_num.nonneg_bit0_helper -run_cmd script_check_id `norm_num.nonneg_bit1_helper -run_cmd script_check_id `norm_num.nonzero_of_div_helper -run_cmd script_check_id `norm_num.nonzero_of_neg_helper -run_cmd script_check_id `norm_num.nonzero_of_pos_helper -run_cmd script_check_id `norm_num.one_add_bit0 -run_cmd script_check_id `norm_num.one_add_bit1_helper -run_cmd script_check_id `norm_num.one_add_one -run_cmd script_check_id `norm_num.pos_add_neg_helper -run_cmd script_check_id `norm_num.pos_bit0_helper -run_cmd script_check_id `norm_num.pos_bit1_helper -run_cmd script_check_id `norm_num.pos_mul_neg_helper -run_cmd script_check_id `norm_num.sub_nat_zero_helper -run_cmd script_check_id `norm_num.sub_nat_pos_helper -run_cmd script_check_id `norm_num.subst_into_div -run_cmd script_check_id `norm_num.subst_into_prod -run_cmd script_check_id `norm_num.subst_into_subtr -run_cmd script_check_id `norm_num.subst_into_sum -run_cmd script_check_id `not -run_cmd script_check_id `not_of_iff_false -run_cmd script_check_id `not_of_eq_false -run_cmd script_check_id `of_eq_true -run_cmd script_check_id `of_iff_true -run_cmd script_check_id `opt_param -run_cmd script_check_id `or -run_cmd script_check_id `out_param -run_cmd script_check_id `punit -run_cmd script_check_id `punit.cases_on -run_cmd script_check_id `punit.star -run_cmd script_check_id `prod.mk -run_cmd script_check_id `pprod -run_cmd script_check_id `pprod.mk -run_cmd script_check_id `pprod.fst -run_cmd script_check_id `pprod.snd -run_cmd script_check_id `propext -run_cmd script_check_id `to_pexpr -run_cmd script_check_id `quot.mk -run_cmd script_check_id `quot.lift -run_cmd script_check_id `reflected -run_cmd script_check_id `reflected.subst -run_cmd script_check_id `repr -run_cmd script_check_id `rfl -run_cmd script_check_id `right_distrib -run_cmd script_check_id `ring -run_cmd script_check_id `scope_trace -run_cmd script_check_id `set_of -run_cmd script_check_id `semiring -run_cmd script_check_id `psigma -run_cmd script_check_id `psigma.cases_on -run_cmd script_check_id `psigma.mk -run_cmd script_check_id `psigma.fst -run_cmd script_check_id `psigma.snd -run_cmd script_check_id `singleton -run_cmd script_check_id `sizeof -run_cmd script_check_id `string -run_cmd script_check_id `string.empty -run_cmd script_check_id `string.str -run_cmd script_check_id `string.empty_ne_str -run_cmd script_check_id `string.str_ne_empty -run_cmd script_check_id `string.str_ne_str_left -run_cmd script_check_id `string.str_ne_str_right -run_cmd script_check_id `subsingleton -run_cmd script_check_id `subsingleton.elim -run_cmd script_check_id `subsingleton.helim -run_cmd script_check_id `subtype -run_cmd script_check_id `subtype.mk -run_cmd script_check_id `subtype.val -run_cmd script_check_id `subtype.rec -run_cmd script_check_id `psum -run_cmd script_check_id `psum.cases_on -run_cmd script_check_id `psum.inl -run_cmd script_check_id `psum.inr -run_cmd script_check_id `tactic -run_cmd script_check_id `tactic.try -run_cmd script_check_id `tactic.triv -run_cmd script_check_id `tactic.mk_inj_eq -run_cmd script_check_id `thunk -run_cmd script_check_id `to_fmt -run_cmd script_check_id `trans_rel_left -run_cmd script_check_id `trans_rel_right -run_cmd script_check_id `true -run_cmd script_check_id `true.intro -run_cmd script_check_id `typed_expr -run_cmd script_check_id `unification_hint -run_cmd script_check_id `unification_hint.mk -run_cmd script_check_id `unit -run_cmd script_check_id `unit.star -run_cmd script_check_id `monad_from_pure_bind -run_cmd script_check_id `user_attribute -run_cmd script_check_id `user_attribute.parse_reflect -run_cmd script_check_id `vm_monitor -run_cmd script_check_id `partial_order -run_cmd script_check_id `well_founded.fix -run_cmd script_check_id `well_founded.fix_eq -run_cmd script_check_id `well_founded_tactics -run_cmd script_check_id `well_founded_tactics.default -run_cmd script_check_id `well_founded_tactics.rel_tac -run_cmd script_check_id `well_founded_tactics.dec_tac -run_cmd script_check_id `zero_le_one -run_cmd script_check_id `zero_lt_one -run_cmd script_check_id `zero_mul diff --git a/old_tests/tests/lean/run/check_monad_mk.lean b/old_tests/tests/lean/run/check_monad_mk.lean deleted file mode 100644 index e17c1aaaf8..0000000000 --- a/old_tests/tests/lean/run/check_monad_mk.lean +++ /dev/null @@ -1,3 +0,0 @@ -#check @monad.mk -#check @functor.mk -#check @applicative.mk diff --git a/old_tests/tests/lean/run/check_tac.lean b/old_tests/tests/lean/run/check_tac.lean deleted file mode 100644 index 94ad297445..0000000000 --- a/old_tests/tests/lean/run/check_tac.lean +++ /dev/null @@ -1,12 +0,0 @@ -open tactic - -example (a b : nat) : true := -begin - type_check a + 1, - (do let e : expr := expr.const `bor [], - let one : expr := `(1 : nat), - let t := e one one, - trace t, - fail_if_success (type_check t)), - constructor -end diff --git a/old_tests/tests/lean/run/choice_anon_ctor.lean b/old_tests/tests/lean/run/choice_anon_ctor.lean deleted file mode 100644 index 242a84f4ea..0000000000 --- a/old_tests/tests/lean/run/choice_anon_ctor.lean +++ /dev/null @@ -1,11 +0,0 @@ -import data.vector --- constant vector.nil {α} : vector α 0 --- constant vector.cons {α n} : α → vector α n → vector α (nat.succ n) - --- notation a :: b := vector.cons a b -notation `[` l:(foldr `, ` (h t, vector.cons h t) vector.nil `]`) := l - -structure author := -(name : string) - -def f : list author := [{name := "it's a me!"}] diff --git a/old_tests/tests/lean/run/choice_ctx.lean b/old_tests/tests/lean/run/choice_ctx.lean deleted file mode 100644 index 8d76f2bc4e..0000000000 --- a/old_tests/tests/lean/run/choice_ctx.lean +++ /dev/null @@ -1,18 +0,0 @@ -namespace test -open nat -set_option pp.coercions true -namespace foo -theorem trans {a b c : nat} (H1 : a = b) (H2 : b = c) : a = c := -eq.trans H1 H2 -end foo - -open foo - -theorem tst (a b : nat) (H0 : b = a) (H : b = 0) : a = 0 -:= have H1 : a = b, from eq.symm H0, - foo.trans H1 H - -definition f (a b : nat) := -let x := 3 in -a + x -end test diff --git a/old_tests/tests/lean/run/class1.lean b/old_tests/tests/lean/run/class1.lean deleted file mode 100644 index 3ee33977d1..0000000000 --- a/old_tests/tests/lean/run/class1.lean +++ /dev/null @@ -1,6 +0,0 @@ -open prod inhabited - -definition H : inhabited (Prop × nat × (nat → nat)) := -by tactic.apply_instance - -#print H diff --git a/old_tests/tests/lean/run/class11.lean b/old_tests/tests/lean/run/class11.lean deleted file mode 100644 index 62e77b14ab..0000000000 --- a/old_tests/tests/lean/run/class11.lean +++ /dev/null @@ -1,6 +0,0 @@ -class inductive C {A : Type} : A → Prop - -constant f {A : Type} (a : A) [H : C a] : Prop - -noncomputable definition g {A : Type} (a b : A) {H1 : C a} {H2 : C b} : Prop := -f a ∧ f b diff --git a/old_tests/tests/lean/run/class2.lean b/old_tests/tests/lean/run/class2.lean deleted file mode 100644 index d5d075008f..0000000000 --- a/old_tests/tests/lean/run/class2.lean +++ /dev/null @@ -1,5 +0,0 @@ -open tactic -theorem H {A B : Type} (H1 : inhabited A) : inhabited (Prop × A × (B → nat)) -:= by apply_instance - -#print H diff --git a/old_tests/tests/lean/run/class3.lean b/old_tests/tests/lean/run/class3.lean deleted file mode 100644 index 49612f93ae..0000000000 --- a/old_tests/tests/lean/run/class3.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic - -section - variable {A : Type} - variable {B : Type} - variable Ha : inhabited A - variable Hb : inhabited B - include Ha Hb - theorem tst : inhabited (Prop × A × B) := by apply_instance - -end - -#print tst diff --git a/old_tests/tests/lean/run/class6.lean b/old_tests/tests/lean/run/class6.lean deleted file mode 100644 index 1e1c9acd71..0000000000 --- a/old_tests/tests/lean/run/class6.lean +++ /dev/null @@ -1,19 +0,0 @@ -open tactic - -inductive t1 : Type -| mk1 : t1 - -inductive t2 : Type -| mk2 : t2 - -theorem inhabited_t1 : inhabited t1 -:= inhabited.mk t1.mk1 - -theorem inhabited_t2 : inhabited t2 -:= inhabited.mk t2.mk2 - -attribute [instance] inhabited_t1 -attribute [instance] inhabited_t2 - -theorem T : inhabited (t1 × t2) -:= by apply_instance diff --git a/old_tests/tests/lean/run/cody2.lean b/old_tests/tests/lean/run/cody2.lean deleted file mode 100644 index c4a984daf5..0000000000 --- a/old_tests/tests/lean/run/cody2.lean +++ /dev/null @@ -1,23 +0,0 @@ -definition subsets (P : Type) := P → Prop. - -section - -parameter A : Type. - -parameter r : A → subsets A. - -parameter i : subsets A → A. - -parameter retract {P : subsets A} {a : A} : r (i P) a = P a. - -definition delta (a:A) : Prop := ¬ (r a a). - -local notation `δ` := delta. - -theorem delta_aux : ¬ (δ (i delta)) - := assume H : δ (i delta), - H (eq.subst (symm (@retract delta (i delta))) H) - -#check delta_aux. - -end diff --git a/old_tests/tests/lean/run/coe_opt.lean b/old_tests/tests/lean/run/coe_opt.lean deleted file mode 100644 index d424563b62..0000000000 --- a/old_tests/tests/lean/run/coe_opt.lean +++ /dev/null @@ -1,12 +0,0 @@ -def f : nat → option nat → nat -| a none := a -| a (some b) := a + b - -example (a b : nat) : f a b = a + b := -rfl - -example (a b : nat) : f a b = f a (some b) := -rfl - -example : f 1 (1:nat) = 2 := -rfl diff --git a/old_tests/tests/lean/run/coe_to_fn.lean b/old_tests/tests/lean/run/coe_to_fn.lean deleted file mode 100644 index 2d5c02cd4e..0000000000 --- a/old_tests/tests/lean/run/coe_to_fn.lean +++ /dev/null @@ -1,26 +0,0 @@ -universes u v w - -structure equiv (α : Type u) (β : Type v) := -(f : α → β) (g : β → α) - -infix ` ≃ `:50 := equiv - -variables {α : Type u} {β : Type v} {γ : Type w} - -instance: has_coe_to_fun (α ≃ β) := { - F := λ _, α → β, - coe := equiv.f, -} - -@[symm] def equiv.inv : α ≃ β → β ≃ α -| ⟨f,g⟩ := ⟨g,f⟩ - -local postfix `⁻¹` := equiv.inv - --- coe_fn should be applied at function arguments -def equiv.trans (f : α ≃ β) (g : β ≃ γ) : α ≃ γ := -⟨g ∘ f, f⁻¹ ∘ g⁻¹⟩ - -example (f : α ≃ β) := function.bijective f -example (f : α ≃ β) (a : α) := f a -example (f : (α ≃ β) ≃ (β ≃ α)) (g : α ≃ β) (b : β) := f g b \ No newline at end of file diff --git a/old_tests/tests/lean/run/coe_to_sort.lean b/old_tests/tests/lean/run/coe_to_sort.lean deleted file mode 100644 index 7ba9f22749..0000000000 --- a/old_tests/tests/lean/run/coe_to_sort.lean +++ /dev/null @@ -1,10 +0,0 @@ -universes u - -structure pointed := -(carrier : Type u) (point : carrier) - -instance: has_coe_to_sort pointed := -⟨_, pointed.carrier⟩ - -example (p : pointed) := list p -- coercion works in argument position -example (p : pointed) : p := p.point \ No newline at end of file diff --git a/old_tests/tests/lean/run/coe_univ_bug.lean b/old_tests/tests/lean/run/coe_univ_bug.lean deleted file mode 100644 index a9aa825c5e..0000000000 --- a/old_tests/tests/lean/run/coe_univ_bug.lean +++ /dev/null @@ -1,20 +0,0 @@ -open nat - -def below (n : nat) : nat → Prop := -λ i, i < n - -def f {n : nat} (v : subtype (below n)) : nat := -v + 1 - -universe variable u - -instance pred2subtype {A : Type u} : has_coe_to_sort (A → Prop) := -⟨Type u, (λ p : A → Prop, subtype p)⟩ - -instance coesubtype {A : Type u} {p : A → Prop} : has_coe (@coe_sort _ pred2subtype p) A := -⟨λ s, subtype.val s⟩ - -def g {n : nat} (v : below n) : nat := -v + 1 - -#print g diff --git a/old_tests/tests/lean/run/coinductive.lean b/old_tests/tests/lean/run/coinductive.lean deleted file mode 100644 index cad10acad4..0000000000 --- a/old_tests/tests/lean/run/coinductive.lean +++ /dev/null @@ -1,106 +0,0 @@ -/- test cases for coinductive predicates -/ -universe u - -def stream (α : Type u) := nat → α -constant stream.cons {α} : α → stream α → stream α -constant stream.head {α} : stream α → α -constant stream.tail {α} : stream α → stream α -notation h :: t := stream.cons h t - -coinductive all_stream {α : Type u} (s : set α) : stream α → Prop -| step {} : ∀{a : α} {ω : stream α}, a ∈ s → all_stream ω → all_stream (a :: ω) - -#print prefix all_stream - -#check (@all_stream : Π {α : Type u}, set α → stream α → Prop) -#check (@all_stream.step : - ∀ {α : Type u} {s : set α} {a : α} {ω : stream α}, a ∈ s → all_stream s ω → all_stream s (a :: ω)) -#check (@all_stream.corec_functional : - ∀ {α : Type u} (s : set α) (C : stream α → Prop), - (∀ (a : stream α), C a → all_stream.functional s C a) → ∀ (a : stream α), C a → all_stream s a) - -coinductive all_stream' {α : Type u} (s : set α) : stream α → Prop -| step {} : ∀{ω : stream α}, stream.head ω ∈ s → all_stream' (stream.tail ω) → all_stream' ω - - -coinductive alt_stream : stream bool → Prop -| tt_step : ∀{ω : stream bool}, alt_stream (ff :: ω) → alt_stream (tt :: ff :: ω) -| ff_step : ∀{ω : stream bool}, alt_stream (tt :: ω) → alt_stream (ff :: tt :: ω) - -#print prefix alt_stream - -#check (@alt_stream : stream bool → Prop) -#check (@alt_stream.tt_step : ∀ {ω : stream bool}, alt_stream (ff :: ω) → alt_stream (tt :: ff :: ω)) -#check (@alt_stream.ff_step : ∀ {ω : stream bool}, alt_stream (tt :: ω) → alt_stream (ff :: tt :: ω)) -#check (@alt_stream.corec_functional : - ∀ (C : stream bool → Prop), - (∀ (a : stream bool), C a → alt_stream.functional C a) → ∀ (a : stream bool), C a → alt_stream a) - - - -mutual coinductive tt_stream, ff_stream -with tt_stream : stream bool → Prop -| step {} : ∀{ω : stream bool}, ff_stream ω → tt_stream (stream.cons tt ω) -with ff_stream : stream bool → Prop -| step {} : ∀{ω : stream bool}, tt_stream ω → ff_stream (stream.cons ff ω) - -#print prefix tt_stream -#print prefix ff_stream - -#check (@tt_stream : stream bool → Prop) -#check (@tt_stream.corec_functional : - ∀ (C_tt_stream C_ff_stream : stream bool → Prop), - (∀ (a : stream bool), C_tt_stream a → tt_stream.functional C_tt_stream C_ff_stream a) → - (∀ (a : stream bool), C_ff_stream a → ff_stream.functional C_tt_stream C_ff_stream a) → - ∀ (a : stream bool), C_tt_stream a → tt_stream a) -#check (@ff_stream : stream bool → Prop) -#check (@ff_stream.corec_functional : - ∀ (C_tt_stream C_ff_stream : stream bool → Prop), - (∀ (a : stream bool), C_tt_stream a → tt_stream.functional C_tt_stream C_ff_stream a) → - (∀ (a : stream bool), C_ff_stream a → ff_stream.functional C_tt_stream C_ff_stream a) → - ∀ (a : stream bool), C_ff_stream a → ff_stream a) - - -mutual coinductive tt_ff_stream, ff_tt_stream -with tt_ff_stream : stream bool → Prop -| step {} : ∀{ω : stream bool}, tt_ff_stream ω ∨ ff_tt_stream ω → tt_ff_stream (stream.cons tt ω) -with ff_tt_stream : stream bool → Prop -| step {} : ∀{ω : stream bool}, ff_tt_stream ω ∨ tt_ff_stream ω → ff_tt_stream (stream.cons ff ω) - -#print prefix tt_ff_stream - -inductive all_list {α : Type} (p : α → Prop) : list α → Prop -| nil : all_list [] -| cons : ∀a xs, p a → all_list xs → all_list (a :: xs) - -@[monotonicity] -lemma monotonicity.all_list {α : Type} {p q : α → Prop} (h : ∀a, implies (p a) (q a)) : - ∀xs, implies (all_list p xs) (all_list q xs) -| ._ (all_list.nil ._) := all_list.nil _ -| ._ (all_list.cons a xs ha hxs) := all_list.cons _ _ (h a ha) (monotonicity.all_list _ hxs) - -mutual coinductive walk_a, walk_b {α β : Type} (f : α → list β) (g : β → α) (p : α → Prop) (t : α → Prop) -with walk_a : α → Prop -| step : ∀a, all_list walk_b (f a) → p a → walk_a a -| term : ∀a, t a → walk_a a -with walk_b : β → Prop -| step : ∀b, walk_a (g b) → walk_b b - - -coinductive walk_list {α : Type} (f : α → list α) (p : α → Prop) : ℕ → α → Prop -| step : ∀n a, all_list (walk_list n) (f a) → p a → walk_list (n + 1) a - --- #check walk_a.corec_on - -example {f : ℕ → list ℕ} {a' : ℕ} {n : ℕ} {a : fin n}: - walk_list f (λ a'', a'' = a') (n + 1) a' := -begin - coinduction walk_list.corec_on generalizing a n, - show ∃ (n : ℕ), - all_list (λ (a : ℕ), ∃ {n_1 : ℕ} {a_1 : fin n_1}, n_1 + 1 = n ∧ a' = a) (f a') ∧ - a' = a' ∧ n + 1 = w + 1, - admit -end - -coinductive foo : list ℕ → Prop -| mk : ∀ xs, (∀ k l m, foo (k::l::m::xs)) → foo xs diff --git a/old_tests/tests/lean/run/comment.lean b/old_tests/tests/lean/run/comment.lean deleted file mode 100644 index 9af3eb82a0..0000000000 --- a/old_tests/tests/lean/run/comment.lean +++ /dev/null @@ -1 +0,0 @@ -/- tests -/ diff --git a/old_tests/tests/lean/run/comp_val1.lean b/old_tests/tests/lean/run/comp_val1.lean deleted file mode 100644 index 5770b48004..0000000000 --- a/old_tests/tests/lean/run/comp_val1.lean +++ /dev/null @@ -1,178 +0,0 @@ -open tactic - -example : 0 < 1 := by comp_val -example : 0 < 2 := by comp_val -example : 0 < 3 := by comp_val -example : 0 < 4 := by comp_val -example : 0 < 5 := by comp_val -example : 0 < 6 := by comp_val -example : 0 < 1293821 := by comp_val -example : 0 < 1293822 := by comp_val - -example : 1 < 2 := by comp_val -example : 1 < 3 := by comp_val -example : 1 < 4 := by comp_val -example : 1 < 5 := by comp_val -example : 1 < 6 := by comp_val -example : 1 < 1293821 := by comp_val -example : 1 < 1293822 := by comp_val - -example : 2 < 3 := by comp_val -example : 2 < 4 := by comp_val -example : 2 < 5 := by comp_val -example : 2 < 6 := by comp_val -example : 2 < 1293821 := by comp_val -example : 2 < 1293822 := by comp_val - -example : 3 < 4 := by comp_val -example : 3 < 5 := by comp_val -example : 3 < 6 := by comp_val -example : 3 < 1293821 := by comp_val -example : 3 < 1293822 := by comp_val - -example : 4 < 5 := by comp_val -example : 4 < 6 := by comp_val -example : 4 < 1293821 := by comp_val -example : 4 < 1293822 := by comp_val - -example : 103093 < 1293821 := by comp_val -example : 3121 < 1293822 := by comp_val -example : 312110028381818 < 1181171711293822 := by comp_val -example : 312110028381819 < 1181171711293822 := by comp_val -example : 312110028381819 < 1181171711293821 := by comp_val - -example (h : false) : 0 < 0 := by (try comp_val >> contradiction) -example (h : false) : 1 < 1 := by (try comp_val >> contradiction) -example (h : false) : 120201 < 1 := by (try comp_val >> contradiction) -example (h : false) : 120201 < 32019 := by (try comp_val >> contradiction) -example (h : false) : 120202 < 1 := by (try comp_val >> contradiction) -example (h : false) : 120202 < 32019 := by (try comp_val >> contradiction) -example (h : false) : 120202 < 2 := by (try comp_val >> contradiction) -example (h : false) : 120202 < 3192 := by (try comp_val >> contradiction) - - -example : 0 ≤ 0 := by comp_val -example : 0 ≤ 1 := by comp_val -example : 0 ≤ 2 := by comp_val -example : 0 ≤ 3 := by comp_val -example : 0 ≤ 4 := by comp_val -example : 0 ≤ 5 := by comp_val -example : 0 ≤ 6 := by comp_val -example : 0 ≤ 1293821 := by comp_val -example : 0 ≤ 1293822 := by comp_val - -example : 1 ≤ 1 := by comp_val -example : 1 ≤ 2 := by comp_val -example : 1 ≤ 3 := by comp_val -example : 1 ≤ 4 := by comp_val -example : 1 ≤ 5 := by comp_val -example : 1 ≤ 6 := by comp_val -example : 1 ≤ 1293821 := by comp_val -example : 1 ≤ 1293822 := by comp_val - -example : 2 ≤ 2 := by comp_val -example : 2 ≤ 3 := by comp_val -example : 2 ≤ 4 := by comp_val -example : 2 ≤ 5 := by comp_val -example : 2 ≤ 6 := by comp_val -example : 2 ≤ 1293821 := by comp_val -example : 2 ≤ 1293822 := by comp_val - -example : 3 ≤ 3 := by comp_val -example : 3 ≤ 4 := by comp_val -example : 3 ≤ 5 := by comp_val -example : 3 ≤ 6 := by comp_val -example : 3 ≤ 1293821 := by comp_val -example : 3 ≤ 1293822 := by comp_val - -example : 4 ≤ 4 := by comp_val -example : 4 ≤ 5 := by comp_val -example : 4 ≤ 6 := by comp_val -example : 4 ≤ 1293821 := by comp_val -example : 4 ≤ 1293822 := by comp_val - -example : 103093 ≤ 103093 := by comp_val -example : 103093 ≤ 1293821 := by comp_val -example : 3121 ≤ 1293822 := by comp_val -example : 312110028381818 ≤ 1181171711293822 := by comp_val -example : 312110028381819 ≤ 1181171711293822 := by comp_val -example : 312110028381819 ≤ 1181171711293821 := by comp_val - -example : 1 ≤ 5 := by comp_val -example : 3 ≤ 5 := by comp_val - -example (h : false) : 1 ≤ 0 := by (try comp_val >> contradiction) -example (h : false) : 2 ≤ 1 := by (try comp_val >> contradiction) -example (h : false) : 120201 ≤ 1 := by (try comp_val >> contradiction) -example (h : false) : 120201 ≤ 32019 := by (try comp_val >> contradiction) -example (h : false) : 120202 ≤ 1 := by (try comp_val >> contradiction) -example (h : false) : 120202 ≤ 32019 := by (try comp_val >> contradiction) -example (h : false) : 120202 ≤ 2 := by (try comp_val >> contradiction) -example (h : false) : 120202 ≤ 3192 := by (try comp_val >> contradiction) - -example : 0 ≠ 1 := by comp_val -example : 0 ≠ 2 := by comp_val -example : 0 ≠ 3 := by comp_val -example : 0 ≠ 4 := by comp_val -example : 0 ≠ 5 := by comp_val -example : 0 ≠ 6 := by comp_val -example : 0 ≠ 1293821 := by comp_val -example : 0 ≠ 1293822 := by comp_val - -example : 1 ≠ 0 := by comp_val -example : 1 ≠ 2 := by comp_val -example : 1 ≠ 3 := by comp_val -example : 1 ≠ 4 := by comp_val -example : 1 ≠ 5 := by comp_val -example : 1 ≠ 6 := by comp_val -example : 1 ≠ 1293821 := by comp_val -example : 1 ≠ 1293822 := by comp_val - -example : 2 ≠ 0 := by comp_val -example : 2 ≠ 1 := by comp_val -example : 2 ≠ 3 := by comp_val -example : 2 ≠ 4 := by comp_val -example : 2 ≠ 5 := by comp_val -example : 2 ≠ 6 := by comp_val -example : 2 ≠ 1293821 := by comp_val -example : 2 ≠ 1293822 := by comp_val - -example : 3 ≠ 0 := by comp_val -example : 3 ≠ 2 := by comp_val -example : 3 ≠ 1 := by comp_val -example : 3 ≠ 4 := by comp_val -example : 3 ≠ 5 := by comp_val -example : 3 ≠ 6 := by comp_val -example : 3 ≠ 1293821 := by comp_val -example : 3 ≠ 1293822 := by comp_val - -example : 4 ≠ 0 := by comp_val -example : 4 ≠ 2 := by comp_val -example : 4 ≠ 3 := by comp_val -example : 4 ≠ 1 := by comp_val -example : 4 ≠ 5 := by comp_val -example : 4 ≠ 6 := by comp_val -example : 4 ≠ 1293821 := by comp_val -example : 4 ≠ 1293822 := by comp_val - -example : 5 ≠ 0 := by comp_val -example : 5 ≠ 2 := by comp_val -example : 5 ≠ 3 := by comp_val -example : 5 ≠ 4 := by comp_val -example : 5 ≠ 1 := by comp_val -example : 5 ≠ 6 := by comp_val -example : 5 ≠ 1293821 := by comp_val -example : 5 ≠ 1293822 := by comp_val - -example : 103093 ≠ 103095 := by comp_val -example : 103093 ≠ 1293821 := by comp_val -example : 3121 ≠ 1293822 := by comp_val -example : 312110028381818 ≠ 1181171711293822 := by comp_val -example : 312110028381819 ≠ 1181171711293822 := by comp_val -example : 312110028381819 ≠ 1181171711293821 := by comp_val - -example (h : false) : 1 ≠ 1 := by (try comp_val >> contradiction) -example (h : false) : 2 ≠ 2 := by (try comp_val >> contradiction) -example (h : false) : 120201 ≠ 120201 := by (try comp_val >> contradiction) -example (h : false) : 32019 ≠ 32019 := by (try comp_val >> contradiction) -example (h : false) : 120202 ≠ 120202 := by (try comp_val >> contradiction) diff --git a/old_tests/tests/lean/run/comp_val2.lean b/old_tests/tests/lean/run/comp_val2.lean deleted file mode 100644 index 322f8efea1..0000000000 --- a/old_tests/tests/lean/run/comp_val2.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -example : 'a' ≠ 'b' := by comp_val -example : '0' ≠ 'a' := by comp_val - -example : "hello worlg" ≠ "hhello world" := by comp_val -example : "hello world" ≠ "hhello world" := by comp_val -example : "abc" ≠ "cde" := by comp_val -example : "abc" ≠ "" := by comp_val -example : "" ≠ "cde" := by comp_val - -example : @fin.mk 5 3 dec_trivial ≠ @fin.mk 5 4 dec_trivial := -by comp_val - -example : @fin.mk 5 4 dec_trivial ≠ @fin.mk 5 1 dec_trivial := -by comp_val diff --git a/old_tests/tests/lean/run/comp_val3.lean b/old_tests/tests/lean/run/comp_val3.lean deleted file mode 100644 index 857a32d7f2..0000000000 --- a/old_tests/tests/lean/run/comp_val3.lean +++ /dev/null @@ -1,52 +0,0 @@ -open tactic - -example : (1:int) ≠ 2 := -by comp_val - -example : (1:int) ≠ 0 := -by comp_val - -example : (0:int) ≠ 1 := -by comp_val - -example : (3:int) ≠ 0 := -by comp_val - -example : (2:int) ≠ 1 := -by comp_val - -example : (3:int) ≠ -4 := -by comp_val - -example : (3:int) ≠ 4 := -by comp_val - -example : (100:int) ≠ 42919 := -by comp_val - -example : 42919 ≠ (100:int) := -by comp_val - -example : -(3:int) ≠ 49391 := -by comp_val - -example : -(3:int) ≠ 3 := -by comp_val - -example : -(100:int) ≠ -42919 := -by comp_val - -example : 0 ≠ -(1:int) := -by comp_val - -example : 0 ≠ -(100:int) := -by comp_val - -example : 0 ≠ -(2:int) := -by comp_val - -example : -(23:int) ≠ 0 := -by comp_val - -example : -(1 : int) ≠ 0 := -by comp_val diff --git a/old_tests/tests/lean/run/comp_val4.lean b/old_tests/tests/lean/run/comp_val4.lean deleted file mode 100644 index bac77f739f..0000000000 --- a/old_tests/tests/lean/run/comp_val4.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -example : (1030912003002020:int) ≠ 1021992923928 := -by comp_val - -example : -(1030912003002020:int) ≠ 1021992923928 := -by comp_val - -example : (1030912003002020:int) ≠ -1021992923928 := -by comp_val - -example : -(1030912003002020:int) ≠ 0 := -by comp_val - -example : (0:int) ≠ 1021992923928 := -by comp_val diff --git a/old_tests/tests/lean/run/compiler_bug1.lean b/old_tests/tests/lean/run/compiler_bug1.lean deleted file mode 100644 index 98b36c979d..0000000000 --- a/old_tests/tests/lean/run/compiler_bug1.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive stmt : Type -| switch : list (nat × stmt) → stmt → stmt -| nop : stmt - -meta def compile_cases_on_to_ir_expr : option stmt := do -do cs' ← return ([] : list (nat × stmt)), - return (stmt.switch cs' stmt.nop) diff --git a/old_tests/tests/lean/run/compiler_bug2.lean b/old_tests/tests/lean/run/compiler_bug2.lean deleted file mode 100644 index a3e017e1b0..0000000000 --- a/old_tests/tests/lean/run/compiler_bug2.lean +++ /dev/null @@ -1,11 +0,0 @@ -open expr list - -meta def rwr_ctxs_lc (lc : expr) : expr → list expr -| (var _) := [] -| (app a b) := map (λc, app a c) (rwr_ctxs_lc b) ++ map (λc, app c b) (rwr_ctxs_lc a) -| e := [lc] - -meta def g (lc : expr) : expr → list expr -| (var _) := [] -| (app a b) := map (app a) (g b) ++ map (app b) (g a) -| e := [lc] diff --git a/old_tests/tests/lean/run/compiler_bug3.lean b/old_tests/tests/lean/run/compiler_bug3.lean deleted file mode 100644 index 9187b46c15..0000000000 --- a/old_tests/tests/lean/run/compiler_bug3.lean +++ /dev/null @@ -1,9 +0,0 @@ -inductive {u} tree (A : Type u) : Type u -| leaf : A -> tree -| node : list tree -> tree - -def foo {A : Type*} : nat → tree A → nat -| 0 _ := 0 -| (n+1) (tree.leaf a) := 0 -| (n+1) (tree.node []) := foo n (tree.node []) -| (n+1) (tree.node (x::xs)) := foo n x diff --git a/old_tests/tests/lean/run/complete_rec_var.lean b/old_tests/tests/lean/run/complete_rec_var.lean deleted file mode 100644 index 04eeb7cec2..0000000000 --- a/old_tests/tests/lean/run/complete_rec_var.lean +++ /dev/null @@ -1,17 +0,0 @@ -def f : nat → nat → nat -| (x+1) (y+1) := f (x+10) y -| _ _ := 1 - -#eval f 1 1000 - -example (x y) : f (x+1) (y+1) = f (x+10) y := -rfl - -example (y) : f 0 (y+1) = 1 := -rfl - -example (x) : f (x+1) 0 = 1 := -rfl - -example : f 0 0 = 1 := -rfl diff --git a/old_tests/tests/lean/run/confuse_ind.lean b/old_tests/tests/lean/run/confuse_ind.lean deleted file mode 100644 index 1061bf18dc..0000000000 --- a/old_tests/tests/lean/run/confuse_ind.lean +++ /dev/null @@ -1,9 +0,0 @@ -attribute [reducible] definition mk_arrow (A : Sort*) (B : Sort*) := -A → A → B - -inductive confuse (A : Type) -| leaf1 : confuse -| leaf2 : nat → confuse -| node : mk_arrow A confuse → confuse - -#check confuse.cases_on diff --git a/old_tests/tests/lean/run/congr_lemma1.lean b/old_tests/tests/lean/run/congr_lemma1.lean deleted file mode 100644 index 385e00ce40..0000000000 --- a/old_tests/tests/lean/run/congr_lemma1.lean +++ /dev/null @@ -1,12 +0,0 @@ -open tactic - -set_option pp.binder_types true - -example : true := -by do - ite ← mk_const `ite, - l ← mk_congr_lemma_simp ite, - trace (congr_lemma.type l), - l ← mk_hcongr_lemma ite, - trace (congr_lemma.type l), - constructor diff --git a/old_tests/tests/lean/run/congr_tactic.lean b/old_tests/tests/lean/run/congr_tactic.lean deleted file mode 100644 index 8ab1282d65..0000000000 --- a/old_tests/tests/lean/run/congr_tactic.lean +++ /dev/null @@ -1,85 +0,0 @@ -/- -Copyright (c) 2017 Daniel Selsam. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Author: Daniel Selsam --/ -open tactic - -namespace test1 --- Recursive with props and subsingletons - -constants (α β γ : Type) (P : α → Prop) (Q : β → Prop) (SS : α → Type) - (SS_ss : ∀ (x : α), subsingleton (SS x)) - (f : Π (x : α), P x → β → SS x → γ) (p₁ p₂ : ∀ (x : α), P x) (h : β → β) (k₁ k₂ : ∀ (x : α), SS x) - -attribute [instance] SS_ss - -example (x₁ x₂ x₁' x₂' x₃ x₃' : α) (y₁ y₁' : β) (H : y₁ = y₁') : -f x₁ (p₁ x₁) (h $ h $ h y₁) (k₁ x₁) = f x₁ (p₂ x₁) (h $ h $ h y₁') (k₂ x₁) := -begin -congr, -exact H, -end - -end test1 - -namespace test2 - --- Specializing to the prefix with props and subsingletons -constants (γ : Type) (f : Π (α : Type*) (β : Sort*), α → β → γ) - (X : Type) (X_ss : subsingleton X) - (Y : Prop) - -attribute [instance] X_ss - -example (x₁ x₂ : X) (y₁ y₂ : Y) : f X Y x₁ y₁ = f X Y x₂ y₂ := by congr - -end test2 - -namespace test3 --- Edge case: goal proved by apply, not refl -constants (f : ℕ → ℕ) - -example (n : ℕ) : f n = f n := by congr - -end test3 - -namespace test4 --- Heq result - -constants (α : Type) (β : α → Type) (γ : Type) (f : Π (x : α) (y : β x), γ) - -example (x x' : α) (y : β x) (y' : β x') (H_x : x = x') (H_y : y == y') : f x y = f x' y' := -begin -congr, -exact H_x, -exact H_y -end - -end test4 - -namespace test5 --- heq in the goal -constants (α : Type) (β : α → Type) (γ : Π (x : α), β x → Type) (f : Π (x : α) (y : β x), γ x y) - -example (x x' : α) (y : β x) (y' : β x') (H_x : x = x') (H_y : y == y') : f x y == f x' y' := -begin -congr, -exact H_x, -exact H_y -end - -end test5 - -namespace test6 - -variables (A : Type) (B : A → Type) (a a' : A) (b : B a) (b' : B a') - -example : (⟨a, b⟩ : Σ a : A, B a) = ⟨a', b'⟩ := -begin - congr, - show a = a', from sorry, - show b == b', from sorry, -end - -end test6 diff --git a/old_tests/tests/lean/run/const_choice.lean b/old_tests/tests/lean/run/const_choice.lean deleted file mode 100644 index bcf1f3373a..0000000000 --- a/old_tests/tests/lean/run/const_choice.lean +++ /dev/null @@ -1,9 +0,0 @@ -open nat - -definition mypred (a : nat) : nat := -nat.cases_on a - 0 - (fun a₁, a₁) - -example : mypred 1 = 0 := -rfl diff --git a/old_tests/tests/lean/run/constructor1.lean b/old_tests/tests/lean/run/constructor1.lean deleted file mode 100644 index a76ddbcb13..0000000000 --- a/old_tests/tests/lean/run/constructor1.lean +++ /dev/null @@ -1,29 +0,0 @@ -open tactic - -example (p q : Prop) : p → q → p ∧ q := -by do intros, constructor, assumption, assumption - -example (p q : Prop) : p → q → p ∧ q := -by do intros, split, assumption, assumption - -example (p q : Prop) : p → p ∨ q := -by do intros, left, assumption - -example (p q : Prop) : q → p ∨ q := -by do intros, right, assumption - -example (p q : Prop) : p → p ∨ q := -by do intros, constructor_idx 1, assumption - -example (p q : Prop) : q → p ∨ q := -by do intros, constructor_idx 2, assumption - -example (a : nat) : a = a := -by constructor - -example (a b : nat) : ∃ x, x = a := -by do - a ← get_local `a, - existsi a, - trace_state, - constructor diff --git a/old_tests/tests/lean/run/constructor_cases.lean b/old_tests/tests/lean/run/constructor_cases.lean deleted file mode 100644 index 590f151539..0000000000 --- a/old_tests/tests/lean/run/constructor_cases.lean +++ /dev/null @@ -1,36 +0,0 @@ -example (p q r : Prop) : p → q → r → r ∧ p ∧ q := -begin - intros hp hq hr, - with_cases { repeat { constructor } }, - case left { exact hr }, - case right left { exact hp }, - case right right { exact hq } -end - -example (p q r : Prop) : p → q → r → r ∧ p ∧ q := -begin - intros hp hq hr, - with_cases { repeat { constructor } }, - case right left { exact hp }, - case right right { exact hq }, - case left { exact hr } -end - -example (p q r : Prop) : p → q → r → r ∧ p ∧ q := -begin - intros hp hq hr, - with_cases { repeat { split } }, - case right left { exact hp }, - case right right { exact hq }, - case left { exact hr } -end - -open tactic - -example (n : nat) : nat := -begin - with_cases { right }, - /- The tactic `right` should not extend the tag since nat.succ has only one argument. -/ - (do t : list name ← get_main_tag, trace t, guard (t.tail = [])), - case { exact n } -end diff --git a/old_tests/tests/lean/run/consume.lean b/old_tests/tests/lean/run/consume.lean deleted file mode 100644 index e8d6b5d6ee..0000000000 --- a/old_tests/tests/lean/run/consume.lean +++ /dev/null @@ -1,9 +0,0 @@ -definition pr2 {A : Type} (a b : A) := a - -#check pr2 -#check pr2 -#check pr2 -#check @pr2 -#check @pr2 -#check @@pr2 -#check pr2 diff --git a/old_tests/tests/lean/run/cont.lean b/old_tests/tests/lean/run/cont.lean deleted file mode 100644 index 1707936b2b..0000000000 --- a/old_tests/tests/lean/run/cont.lean +++ /dev/null @@ -1,93 +0,0 @@ -/- -Copyright (c) 2018 Microsoft Corporation. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Sebastian Ullrich - -The continuation monad transformer. --/ - -import init.category.alternative init.category.combinators init.category.lift -import system.io -universes u v w - -/-- An implementation of [ContT](https://hackage.haskell.org/package/mtl-2.2.2/docs/Control-Monad-Cont.html#t:ContT) -/ -structure cont_t (ρ : Type u) (m : Type u → Type v) (α : Type u) : Type (max u v) := -(run : (α → m ρ) → m ρ) - -attribute [pp_using_anonymous_constructor] cont_t - -/-- An implementation of [MonadCont done right](https://wiki.haskell.org/MonadCont_done_right) -/ -class monad_cont (m : Type u → Type v) := -/- Call a function with the current continuation (cc) as its argument, which can be called to - exit the function from anywhere inside it. -/ -(call_cc {α : Type u} : ((∀ {β}, α → m β) → m α) → m α) - -export monad_cont (call_cc) - -@[reducible] def cont (ρ α : Type u) : Type u := cont_t ρ id α - -namespace cont_t -section - parameters {ρ : Type u} {m : Type u → Type v} - - protected def pure {α : Type u} (a : α) : cont_t ρ m α := - ⟨λ cc, cc a⟩ - - protected def bind {α β : Type u} (ma : cont_t ρ m α) (f : α → cont_t ρ m β) : cont_t ρ m β := - ⟨λ cc, ma.run (λ a, (f a).run cc)⟩ - - instance : monad (cont_t ρ m) := - { pure := @pure, bind := @bind } - - protected def call_cc {α : Type u} (f : (∀ {β}, α → cont_t ρ m β) → cont_t ρ m α) : cont_t ρ m α := - ⟨λ cc, (f (λ _ a, ⟨λ _, cc a⟩)).run cc⟩ - - instance : monad_cont (cont_t ρ m) := - ⟨@call_cc⟩ - - protected def lift [_root_.monad m] {α : Type u} (x : m α) : cont_t ρ m α := - ⟨λ cc, x >>= cc⟩ - - instance [_root_.monad m] : has_monad_lift m (cont_t ρ m) := - ⟨@cont_t.lift _⟩ - - -- there is NO instance of `monad_functor` for `cont_t` -end -end cont_t - - -namespace cont_t - variable {ρ : Type u} - variable {m : Type u → Type v} - variables {α β : Type u} - variables (x : cont_t ρ m α) - - lemma ext {x x' : cont_t ρ m α} (h : ∀ cc, x.run cc = x'.run cc) : x = x' := - by cases x; cases x'; simp [show x = x', from funext h] - - @[simp] lemma run_pure (a : α) (cc : α → m ρ) : (pure a : cont_t ρ m α).run cc = cc a := rfl - @[simp] lemma run_bind (f : α → cont_t ρ m β) (cc : β → m ρ) : - (x >>= f).run cc = x.run (λ a, (f a).run cc) := rfl - @[simp] lemma run_map (f : α → β) (cc : β → m ρ) : (f <$> x).run cc = x.run (cc ∘ f) := rfl -end cont_t - - -instance (ρ : Type u) (m : Type u → Type v) [monad m] [is_lawful_monad m] : is_lawful_monad (cont_t ρ m) := -{ id_map := by intros; apply cont_t.ext; simp, - pure_bind := by intros; apply cont_t.ext; simp, - bind_assoc := by intros; apply cont_t.ext; simp } --- count the even numbers from 0 to 7 in a horrible, imperative way -def cont_example : cont_t unit (state_t ℕ io) ℕ := -do call_cc $ λ break, - (list.range 10).mmap' $ λ i, - call_cc $ λ continue, do { - when (i % 2 = 0) $ - continue (), - when (i > 7) $ - break (), - modify (+1) >> pure () - }, - get - -#eval do ((), 4) ← (cont_example.run (λ _, pure ())).run 0, - pure () diff --git a/old_tests/tests/lean/run/contra1.lean b/old_tests/tests/lean/run/contra1.lean deleted file mode 100644 index 48900f6647..0000000000 --- a/old_tests/tests/lean/run/contra1.lean +++ /dev/null @@ -1,10 +0,0 @@ -open nat tactic - -example (a b : nat) (h : false) : a = b := -by contradiction - -example : ∀ (a b : nat), false → a = b := -by do intros, contradiction - -example : ∀ (a b : nat), (0:nat) = 1 → a = b := -by do intros, contradiction diff --git a/old_tests/tests/lean/run/contra2.lean b/old_tests/tests/lean/run/contra2.lean deleted file mode 100644 index f591521703..0000000000 --- a/old_tests/tests/lean/run/contra2.lean +++ /dev/null @@ -1,16 +0,0 @@ -open nat tactic - -example (q p : Prop) (h₁ : p) (h₂ : ¬ p) : q := -by contradiction - -example (q p : Prop) (h₁ : p) (h₂ : p → false) : q := -by do intros, contradiction - -example (q : Prop) (a b : nat) (h₁ : a + b = 0) (h₂ : ¬ a + b = 0) : q := -by do intros, contradiction - -example (q : Prop) (a b : nat) (h₁ : a + b = 0) (h₂ : a + b ≠ 0) : q := -by do intros, contradiction - -example (q : Prop) (a b : nat) (h₁ : a + b = 0) (h₂ : a + b = 0 → false) : q := -by contradiction diff --git a/old_tests/tests/lean/run/contra3.lean b/old_tests/tests/lean/run/contra3.lean deleted file mode 100644 index 393817e791..0000000000 --- a/old_tests/tests/lean/run/contra3.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic nat - -example (a b c : Prop) : a → b → ¬ a → c := -by do intros, contradiction - -example (a b c : Prop) : a → false → b → c := -by do intros, contradiction - -example (a b : nat) : succ a = 0 → b = 0 := -by do intro `H, contradiction - -example (a b : nat) : succ a = succ b → succ a = 0 → b = 0 := -by do intros, contradiction diff --git a/old_tests/tests/lean/run/contradiction_issue.lean b/old_tests/tests/lean/run/contradiction_issue.lean deleted file mode 100644 index 2fdb1bd81b..0000000000 --- a/old_tests/tests/lean/run/contradiction_issue.lean +++ /dev/null @@ -1,5 +0,0 @@ -open tactic - -def hd {α} : {l : list α // l ≠ []} → α -| ⟨[], h⟩ := by contradiction -| ⟨a::l, h⟩ := a diff --git a/old_tests/tests/lean/run/conv_tac1.lean b/old_tests/tests/lean/run/conv_tac1.lean deleted file mode 100644 index d25e2cc667..0000000000 --- a/old_tests/tests/lean/run/conv_tac1.lean +++ /dev/null @@ -1,133 +0,0 @@ -example (a b : nat) : (λ x, a + x) 0 = b + 1 + a := -begin - conv in (_ + 1) { change nat.succ b }, - guard_target (λ x, a + x) 0 = nat.succ b + a, - admit -end - -def Div : nat → nat → nat | x y := -if h : 0 < y ∧ y ≤ x -then - have x - y < x, from sorry, - Div (x - y) y + 1 -else 0 - -example (x y : nat) : 0 < y → y ≤ x → Div x y = Div (x - y) y + 1 := -begin - intros h1 h2, - -- Use conv to focus on the lhs - conv { to_lhs, simp [Div] {single_pass := tt}, simp [h1, h2] }, - guard_target 1 + Div (x - y) y = Div (x - y) y + 1, - simp -end - -example (x y : nat) (f : nat → nat) (h : f (0 + x + y) = 0 + y) : f (x + y) = 0 + y := -begin - -- use conv to rewrite subterm of a hypothesis - conv at h in (0 + _) { simp }, - assumption -end - -example (x y : nat) (f : nat → nat) (h : f (0 + x + y) = 0 + y) : f (x + y) = 0 + y := -begin - -- use conv to rewrite subterm of a hypothesis - conv at h in (0 + x) { simp }, - assumption -end - -example (x y : nat) (f : nat → nat) (h : f (0 + x + y) = 0 + y) : f (x + y) = 0 + y := -begin - -- use congr primitive to find term to be modified - conv at h { - guard_lhs f (0 + x + y) = 0 + y, - congr, - { guard_lhs f (0 + x + y), - congr, congr, simp }, - { guard_lhs 0 + y } - }, - assumption -end - -example (x y : nat) (f : nat → nat) (h : f (0 + x + y) = 0 + y) : f (x + y) = 0 + y := -begin - -- use congr primitive to find term to be modified - conv at h { - guard_lhs f (0 + x + y) = 0 + y, - to_lhs, - guard_lhs f (0 + x + y), - congr, - guard_lhs 0 + x + y, - congr, - simp, - }, - assumption -end - -example (x y : nat) (f : nat → nat) (h : f (0 + x + y) = 0 + y) : f (x + y) = 0 + y := -begin - -- use conv to rewrite subterm of a hypothesis - conv at h in (0 + _) { rw [zero_add] }, - assumption -end - -example (x y : nat) (f : nat → nat) (h : f (0 + x + y) = 0 + y) : f (0 + x + y) = y := -begin - -- use conv to rewrite rhs a hypothesis - conv at h { to_rhs, rw [zero_add] }, - assumption -end - -example (x : nat) (f : nat → nat) (h₁ : x = 0) (h₂ : ∀ x, f x = x + x) : f x = x := -begin - conv { to_rhs, rw [h₁, <- add_zero 0, <- h₁], }, - exact h₂ x -end - -lemma addz (x : nat) : x + 0 = x := -rfl - -example (x : nat) (g : nat → nat) (f : nat → (nat → nat) → nat) (h : f (x + 0) (λ x, g x) = x) : f x g = x := -begin - conv at h {dsimp [addz] {eta := ff}}, - conv at h {dsimp}, - exact h, -end - -example (x : nat) (g : nat → nat) (f : nat → (nat → nat) → nat) (h : f (x + 0) (λ x, g x) = x) : f x g = x := -begin - conv at h {dsimp [addz] {eta := ff}, - guard_lhs f x (λ x, g x) = x, - dsimp, - guard_lhs f x g = x}, - exact h, -end - -def f (x y : nat) : nat := -x + y + 1 - -example (x y : nat) : f x y + f x x + f y y = x + y + 1 + y + y + 1 + f x x := -begin - conv { - -- execute `rw [f]` for 1st and 3rd occurrences of f-applications - for (f _ _) [1, 3] { rw [f] }, - guard_lhs (x + y + 1) + f x x + (y + y + 1) = x + y + 1 + y + y + 1 + f x x, - simp - } -end - -example (x : nat) : f x x + f x x + f x x = f x x + x + x + x + x + 1 + 1 := -begin - conv { - -- execute `rw [f]` for 1st and 3rd occurrences of f-applications - for (f _ _) [1, 3] { rw [f] }, - guard_lhs (x + x + 1) + f x x + (x + x + 1) = f x x + x + x + x + x + 1 + 1, - simp - } -end - -example (x : nat) : f x x + f x x = f x x + x + x + 1 := -begin - conv in (f _ _) { rw [f] }, - guard_target (x + x + 1) + f x x = f x x + x + x + 1, - simp -end diff --git a/old_tests/tests/lean/run/cpdt.lean b/old_tests/tests/lean/run/cpdt.lean deleted file mode 100644 index bad54fd477..0000000000 --- a/old_tests/tests/lean/run/cpdt.lean +++ /dev/null @@ -1,43 +0,0 @@ -/- "Proving in the Large" chapter of CPDT -/ - -inductive exp : Type -| Const (n : nat) : exp -| Plus (e1 e2 : exp) : exp -| Mult (e1 e2 : exp) : exp - -open exp - -def eeval : exp → nat -| (Const n) := n -| (Plus e1 e2) := eeval e1 + eeval e2 -| (Mult e1 e2) := eeval e1 * eeval e2 - -def times (k : nat) : exp → exp -| (Const n) := Const (k * n) -| (Plus e1 e2) := Plus (times e1) (times e2) -| (Mult e1 e2) := Mult (times e1) e2 - -def reassoc : exp → exp -| (Const n) := (Const n) -| (Plus e1 e2) := - let e1' := reassoc e1 in - let e2' := reassoc e2 in - match e2' with - | (Plus e21 e22) := Plus (Plus e1' e21) e22 - | _ := Plus e1' e2' - end -| (Mult e1 e2) := - let e1' := reassoc e1 in - let e2' := reassoc e2 in - match e2' with - | (Mult e21 e22) := Mult (Mult e1' e21) e22 - | _ := Mult e1' e2' - end - -attribute [simp] mul_add times reassoc eeval mul_comm mul_assoc mul_left_comm - -theorem eeval_times (k e) : eeval (times k e) = k * eeval e := -by induction e; simp [*] - -theorem reassoc_correct (e) : eeval (reassoc e) = eeval e := -by induction e; simp [*]; cases (reassoc e_e2); rsimp diff --git a/old_tests/tests/lean/run/cse_perf_issue.lean b/old_tests/tests/lean/run/cse_perf_issue.lean deleted file mode 100644 index b2001985dd..0000000000 --- a/old_tests/tests/lean/run/cse_perf_issue.lean +++ /dev/null @@ -1,27 +0,0 @@ -def f : nat → bool -| 0 := ff -| _ := tt - -inductive tree -| leaf : nat → tree -| node : nat → tree → tree → tree - -def mk_tree : nat → nat → tree -| 0 v := tree.leaf v -| (n+1) v := - let t := mk_tree n v in - tree.node v t t - -def tst : tree → nat -| (tree.leaf v) := v -| (tree.node v l r) := - match f v with - | tt := tst l + tst l - tst l - | ff := tst r - end - -def tree.is_node : tree → bool -| (tree.leaf v) := ff -| _ := tt - -#eval timeit "tst" $ tst (mk_tree 100 10) diff --git a/old_tests/tests/lean/run/cute_binders.lean b/old_tests/tests/lean/run/cute_binders.lean deleted file mode 100644 index ab6dad17ca..0000000000 --- a/old_tests/tests/lean/run/cute_binders.lean +++ /dev/null @@ -1,17 +0,0 @@ -definition range (lower : nat) (upper : nat) : set nat := -λ a, lower ≤ a ∧ a ≤ upper - -local notation `[` L `, ` U `]` := range L U - -variables s : set nat -variables p : nat → nat → Prop - - --- #check a ∈ s -set_option pp.binder_types true -#check ∀ b c a ∈ s, a + b + c > 0 --- ∀ (b c a : ℕ), b ∈ s → c ∈ s → a ∈ s → a + b + c > 0 : Prop -#check ∀ a < 5, p a (a+1) --- ∀ (a : ℕ), a < 5 → p a (a + 1) : Prop -#check ∀ a b ∈ [2, 3], p a b --- ∀ (a b : ℕ), a ∈ [2, 3] → b ∈ [2, 3] → p a b diff --git a/old_tests/tests/lean/run/dec_trivial_problem.lean b/old_tests/tests/lean/run/dec_trivial_problem.lean deleted file mode 100644 index c8a40ffff3..0000000000 --- a/old_tests/tests/lean/run/dec_trivial_problem.lean +++ /dev/null @@ -1,20 +0,0 @@ -definition n : nat := 3 - -open tactic -meta definition dec_triv : tactic unit := -do tgt ← target, - inst ← to_expr ``(decidable %%tgt) >>= mk_instance, - to_expr ``(@of_as_true %%tgt %%inst trivial) >>= exact - -example : 0 < n := -by dec_triv - -notation `dec_trivial2` := by dec_triv - -example : 0 < n := -dec_trivial2 - -notation `dec_trivial3` := of_as_true (by triv) - -example : 0 < n := -dec_trivial3 diff --git a/old_tests/tests/lean/run/decidable.lean b/old_tests/tests/lean/run/decidable.lean deleted file mode 100644 index 1d31701f8f..0000000000 --- a/old_tests/tests/lean/run/decidable.lean +++ /dev/null @@ -1,6 +0,0 @@ -open bool unit decidable - -constants a b c : bool -constants u v : unit -set_option pp.implicit true -#check if ((a = b) ∧ (b = c) → ¬ (u = v) ∨ (a = c) → (a = c) ↔ a = tt ↔ true) then a else b diff --git a/old_tests/tests/lean/run/decl_olean.lean b/old_tests/tests/lean/run/decl_olean.lean deleted file mode 100644 index a9de718650..0000000000 --- a/old_tests/tests/lean/run/decl_olean.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -def g : nat → nat := -λ n, 0 - -meta def show_pos (n : name) : command := -do env ← get_env, - pos ← returnopt (env^.decl_pos n), - olean ← returnopt (env^.decl_olean n) <|> return "current file", - trace $ to_string n ++ " was defined at " ++ olean ++ " : " ++ to_string pos.1 ++ ":" ++ to_string pos.2 - -run_cmd show_pos `nat.succ -run_cmd show_pos `subsingleton.intro -run_cmd show_pos `subsingleton.rec -run_cmd show_pos `nat.add -run_cmd show_pos `quotient -run_cmd show_pos `g diff --git a/old_tests/tests/lean/run/declare_axiom.lean b/old_tests/tests/lean/run/declare_axiom.lean deleted file mode 100644 index f34574e6cb..0000000000 --- a/old_tests/tests/lean/run/declare_axiom.lean +++ /dev/null @@ -1,5 +0,0 @@ -open tactic - -run_cmd (do - e ← to_expr ``(false), - add_decl $ declaration.ax `useful_assumption [] e) diff --git a/old_tests/tests/lean/run/def1.lean b/old_tests/tests/lean/run/def1.lean deleted file mode 100644 index 4ad2261b4d..0000000000 --- a/old_tests/tests/lean/run/def1.lean +++ /dev/null @@ -1,19 +0,0 @@ - -namespace tst -variable {A : Type} - -attribute [reducible] -definition foo₁ (a b c : A) (H₁ : a = b) (H₂ : c = b) : a = c := -eq.trans H₁ (eq.symm H₂) - -lemma foo₂ (f : A → A → A) (a b c : A) (H₁ : a = b) (H₂ : c = b) : f a = f c := -eq.symm H₂ ▸ H₁ ▸ rfl - -#check foo₁ -#check foo₂ - -end tst - -#check tst.foo₁ -#check tst.foo₂ -#print tst.foo₁ diff --git a/old_tests/tests/lean/run/def10.lean b/old_tests/tests/lean/run/def10.lean deleted file mode 100644 index ea254c6f0b..0000000000 --- a/old_tests/tests/lean/run/def10.lean +++ /dev/null @@ -1,17 +0,0 @@ -open nat - -inductive bv : nat → Type -| nil : bv 0 -| cons : ∀ (n) (hd : bool) (tl : bv n), bv (succ n) - -open bv bool - -definition h : ∀ {n}, bv (succ (succ n)) → bool -| .(succ m) (cons (succ (succ m)) b v) := b -| .(0) (cons (succ nat.zero) b v) := bnot b - -example (m : nat) (b : bool) (v : bv (succ (succ m))) : @h (succ m) (cons (succ (succ m)) b v) = b := -rfl - -example (m : nat) (b : bool) (v : bv 1) : @h 0 (cons 1 b v) = bnot b := -rfl diff --git a/old_tests/tests/lean/run/def11.lean b/old_tests/tests/lean/run/def11.lean deleted file mode 100644 index b03d8c7047..0000000000 --- a/old_tests/tests/lean/run/def11.lean +++ /dev/null @@ -1,3 +0,0 @@ - -definition ex1 (a : nat) : nat.succ a = 0 → false -. diff --git a/old_tests/tests/lean/run/def12.lean b/old_tests/tests/lean/run/def12.lean deleted file mode 100644 index 4e94faab53..0000000000 --- a/old_tests/tests/lean/run/def12.lean +++ /dev/null @@ -1,44 +0,0 @@ -open nat - -theorem bit0_succ_eq (n : ℕ) : bit0 (succ n) = succ (succ (bit0 n)) := -show succ (succ n + n) = succ (succ (n + n)), from -succ_add n n ▸ rfl - -theorem bit1_eq_succ_bit0 (n : ℕ) : bit1 n = succ (bit0 n) := -rfl - -theorem bit1_succ_eq (n : ℕ) : bit1 (succ n) = succ (succ (bit1 n)) := -eq.trans (nat.bit1_eq_succ_bit0 (succ n)) (congr_arg succ (nat.bit0_succ_eq n)) - -theorem succ_ne_zero (n : ℕ) : succ n ≠ 0 := -assume h, nat.no_confusion h - -theorem succ_ne_self : ∀ (n : ℕ), succ n ≠ n -| 0 h := absurd h (nat.succ_ne_zero 0) -| (n+1) h := succ_ne_self n (nat.no_confusion h (λ h, h)) - -theorem bit0_ne_zero : ∀ (n : ℕ), n ≠ 0 → bit0 n ≠ 0 -| 0 h := absurd rfl h -| (n+1) h := nat.succ_ne_zero _ - -theorem bit1_ne_one : ∀ (n : ℕ), n ≠ 0 → bit1 n ≠ 1 -| 0 h h1 := absurd rfl h -| (n+1) h h1 := nat.no_confusion h1 (λ h2, absurd h2 (nat.succ_ne_zero _)) - -theorem add_self_ne_one : ∀ (n : ℕ), n + n ≠ 1 -| 0 h := nat.no_confusion h -| (n+1) h := - have h1 : succ (succ (n + n)) = 1, from succ_add n n ▸ h, - nat.no_confusion h1 (λ h2, absurd h2 (nat.succ_ne_zero (n + n))) - -theorem bit1_ne_bit0 : ∀ (n m : ℕ), bit1 n ≠ bit0 m -| 0 m h := absurd h (ne.symm (nat.add_self_ne_one m)) -| (n+1) 0 h := - have h1 : succ (bit0 (succ n)) = 0, from h, - absurd h1 (nat.succ_ne_zero _) -| (n+1) (m+1) h := - have h1 : succ (succ (bit1 n)) = succ (succ (bit0 m)), from - nat.bit0_succ_eq m ▸ nat.bit1_succ_eq n ▸ h, - have h2 : bit1 n = bit0 m, from - nat.no_confusion h1 (λ h2', nat.no_confusion h2' (λ h2'', h2'')), - absurd h2 (bit1_ne_bit0 n m) diff --git a/old_tests/tests/lean/run/def13.lean b/old_tests/tests/lean/run/def13.lean deleted file mode 100644 index 2358a60889..0000000000 --- a/old_tests/tests/lean/run/def13.lean +++ /dev/null @@ -1,18 +0,0 @@ -inductive vec (A : Type) : nat → Type -| nil {} : vec 0 -| cons : Π {n}, A → vec n → vec (n+1) - -open vec - -variables {A : Type} -variables f : A → A → A - -definition map_head_1 : ∀ {n}, vec A n → vec A n → vec A n -| .(0) nil nil := nil -| .(n+1) (@cons .(A) n a va) (cons b vb) := cons (f a b) va - -example : map_head_1 f nil nil = nil := -rfl - -example (a b : A) (n : nat) (va vb : vec A n) : map_head_1 f (cons a va) (cons b vb) = cons (f a b) va := -rfl diff --git a/old_tests/tests/lean/run/def2.lean b/old_tests/tests/lean/run/def2.lean deleted file mode 100644 index 0ec294d7b8..0000000000 --- a/old_tests/tests/lean/run/def2.lean +++ /dev/null @@ -1,5 +0,0 @@ - -definition plus (a b : nat) : nat := -nat.rec_on a b (λ a' ih, nat.succ ih) - -#eval plus 3 5 diff --git a/old_tests/tests/lean/run/def3.lean b/old_tests/tests/lean/run/def3.lean deleted file mode 100644 index 6683e66b02..0000000000 --- a/old_tests/tests/lean/run/def3.lean +++ /dev/null @@ -1,12 +0,0 @@ - -definition f (a b : nat) : nat := -nat.cases_on a - (a + b + a + a + b) - (λ a', a + a + b) - -definition g (a b : nat) := -f (f a b) a - -set_option trace.compiler true - -#eval g (g (f 2 3) 2) 3 diff --git a/old_tests/tests/lean/run/def4.lean b/old_tests/tests/lean/run/def4.lean deleted file mode 100644 index db875378b4..0000000000 --- a/old_tests/tests/lean/run/def4.lean +++ /dev/null @@ -1,10 +0,0 @@ - -section - variable (A : Type) - - definition f : A → A := - λ x, x - -end - -#check f diff --git a/old_tests/tests/lean/run/def5.lean b/old_tests/tests/lean/run/def5.lean deleted file mode 100644 index 954f13833b..0000000000 --- a/old_tests/tests/lean/run/def5.lean +++ /dev/null @@ -1,11 +0,0 @@ - -section - parameter (A : Type) - - definition f : A → A := - λ x, x - - #check f -end - -#check f diff --git a/old_tests/tests/lean/run/def6.lean b/old_tests/tests/lean/run/def6.lean deleted file mode 100644 index a5c0306891..0000000000 --- a/old_tests/tests/lean/run/def6.lean +++ /dev/null @@ -1,18 +0,0 @@ - -inductive vec (A : Type) : nat → Type -| nil {} : vec 0 -| cons : Π {n}, A → vec n → vec (n+1) - -open vec - -definition h {A : Type} : ∀ {n}, vec A (n+1) → A -| n (cons a v) := a - -definition t {A : Type} : ∀ {n}, vec A (n+1) → vec A n -| n (cons a v) := v - -example {A n} (a : A) (v : vec A n) : h (cons a v) = a := -rfl - -example {A n} (a : A) (v : vec A n) : t (cons a v) = v := -rfl diff --git a/old_tests/tests/lean/run/def7.lean b/old_tests/tests/lean/run/def7.lean deleted file mode 100644 index ac30643a6f..0000000000 --- a/old_tests/tests/lean/run/def7.lean +++ /dev/null @@ -1,17 +0,0 @@ - -definition f : bool → bool → nat -| _ _ := 10 - -example : f tt tt = 10 := -rfl - -definition g : bool → bool → bool → nat -| tt _ tt := 1 -| _ ff ff := 2 -| _ _ _ := 3 - -example : g tt tt tt = 1 := rfl -example : g tt ff tt = 1 := rfl -example : g tt ff ff = 2 := rfl -example : g ff ff ff = 2 := rfl -example : g ff tt tt = 3 := rfl diff --git a/old_tests/tests/lean/run/def8.lean b/old_tests/tests/lean/run/def8.lean deleted file mode 100644 index c9e59eac71..0000000000 --- a/old_tests/tests/lean/run/def8.lean +++ /dev/null @@ -1,29 +0,0 @@ -inductive imf {A B : Type} (f : A → B) : B → Type -| mk : ∀ (a : A), imf (f a) - -definition g {A B : Type} {f : A → B} : ∀ {b : B}, imf f b → A -| .(f a) (imf.mk .(f) a) := a - -example {A B : Type} (f : A → B) (a : A) : g (imf.mk f a) = a := -rfl - -definition v₁ : imf nat.succ 1 := -(imf.mk nat.succ 0) - -definition v₂ : imf (λ x, 1 + x) 1 := -(imf.mk (λ x, 1 + x) 0) - -example : g v₁ = 0 := -rfl - -example : g v₂ = 0 := -rfl - -lemma ex1 (A : Type) : ∀ (a b : A) (H : a = b), b = a -| a .(a) rfl := rfl - -lemma ex2 (A : Type) : ∀ a b : A, a = b → b = a -| a .(a) (eq.refl .(a)) := rfl - -lemma ex3 (A : Type) : ∀ a b : A, a = b → b = a -| a ._ (eq.refl ._) := rfl diff --git a/old_tests/tests/lean/run/def9.lean b/old_tests/tests/lean/run/def9.lean deleted file mode 100644 index 5a9652d832..0000000000 --- a/old_tests/tests/lean/run/def9.lean +++ /dev/null @@ -1,2 +0,0 @@ -lemma ex4 (A : Type) : ∀ (a b : A) (H : a = b), b = a -| .(z) z (eq.refl .(z)) := eq.refl z diff --git a/old_tests/tests/lean/run/def_alias.lean b/old_tests/tests/lean/run/def_alias.lean deleted file mode 100644 index 516e4ff10d..0000000000 --- a/old_tests/tests/lean/run/def_alias.lean +++ /dev/null @@ -1,10 +0,0 @@ - -attribute [reducible] -definition N := nat - -definition f : N → nat -| 0 := 1 -| (n+1) := n - -example : f 0 = 1 := -rfl diff --git a/old_tests/tests/lean/run/def_brec1.lean b/old_tests/tests/lean/run/def_brec1.lean deleted file mode 100644 index 578f3ad05b..0000000000 --- a/old_tests/tests/lean/run/def_brec1.lean +++ /dev/null @@ -1,23 +0,0 @@ -inductive foo : bool → Type -| Z : foo ff -| O : foo ff → foo tt -| E : foo tt → foo ff - -open foo - -definition to_nat : ∀ {b}, foo b → nat -| .(ff) Z := 0 -| .(tt) (O n) := to_nat n + 1 -| .(ff) (E n) := to_nat n + 1 - -example : to_nat (E (O Z)) = 2 := -rfl - -example : to_nat Z = 0 := -rfl - -example (a : foo ff) : to_nat (O a) = to_nat a + 1 := -rfl - -example (a : foo tt) : to_nat (E a) = to_nat a + 1 := -rfl diff --git a/old_tests/tests/lean/run/def_brec2.lean b/old_tests/tests/lean/run/def_brec2.lean deleted file mode 100644 index a2f67416e5..0000000000 --- a/old_tests/tests/lean/run/def_brec2.lean +++ /dev/null @@ -1,10 +0,0 @@ -set_option trace.eqn_compiler true - -definition fib : nat → nat -| 0 := 1 -| 1 := 1 -| (n+2) := fib n + fib (n+1) - -example : fib 0 = 1 := rfl -example : fib 1 = 1 := rfl -example (n : nat) : fib (n+2) = fib n + fib (n+1) := rfl diff --git a/old_tests/tests/lean/run/def_brec3.lean b/old_tests/tests/lean/run/def_brec3.lean deleted file mode 100644 index 30e8bba41c..0000000000 --- a/old_tests/tests/lean/run/def_brec3.lean +++ /dev/null @@ -1,20 +0,0 @@ -open nat - -inductive bv : nat → Type -| nil : bv 0 -| cons : ∀ (n) (hd : bool) (tl : bv n), bv (succ n) - -open bv - -variable (f : bool → bool → bool) - -definition map2 : ∀ {n}, bv n → bv n → bv n -| .(0) nil nil := nil -| .(n+1) (cons n b1 v1) (cons .(n) b2 v2) := cons n (f b1 b2) (map2 v1 v2) - -example : map2 f nil nil = nil := -rfl - -example (n : nat) (b1 b2 : bool) (v1 v2 : bv n) : map2 f (cons n b1 v1) (cons n b2 v2) = cons n (f b1 b2) (map2 f v1 v2) := -rfl -#print map2 diff --git a/old_tests/tests/lean/run/def_brec4.lean b/old_tests/tests/lean/run/def_brec4.lean deleted file mode 100644 index c5ad157abf..0000000000 --- a/old_tests/tests/lean/run/def_brec4.lean +++ /dev/null @@ -1,19 +0,0 @@ -open nat - -inductive bv : nat → Type -| nil : bv 0 -| cons : ∀ (n) (hd : bool) (tl : bv n), bv (succ n) - -open bv - -variable (f : bool → bool → bool) - -definition map2 : ∀ {n}, bv n → bv n → bv n -| 0 nil nil := nil -| (n+1) (cons .(n) b1 v1) (cons .(n) b2 v2) := cons n (f b1 b2) (map2 v1 v2) - -example : map2 f nil nil = nil := -rfl - -example (n : nat) (b1 b2 : bool) (v1 v2 : bv n) : map2 f (cons n b1 v1) (cons n b2 v2) = cons n (f b1 b2) (map2 f v1 v2) := -rfl diff --git a/old_tests/tests/lean/run/def_brec_reflexive.lean b/old_tests/tests/lean/run/def_brec_reflexive.lean deleted file mode 100644 index bd6baa6eb4..0000000000 --- a/old_tests/tests/lean/run/def_brec_reflexive.lean +++ /dev/null @@ -1,11 +0,0 @@ - -inductive inftree (A : Type*) -| leaf : A → inftree -| node : (nat → inftree) → inftree - -open inftree - -definition {u} szn {A : Type (u+1)} (n : nat) : inftree A → inftree A → nat -| (leaf a) t2 := 1 -| (node c) (leaf b) := 0 -| (node c) (node d) := szn (c n) (d n) diff --git a/old_tests/tests/lean/run/def_complete_bug.lean b/old_tests/tests/lean/run/def_complete_bug.lean deleted file mode 100644 index 1a1b7111e3..0000000000 --- a/old_tests/tests/lean/run/def_complete_bug.lean +++ /dev/null @@ -1,13 +0,0 @@ -definition g : list nat → list nat → nat -| [] (y::ys) := y -| [] ys := 0 -| (x1::x2::xs) ys := g xs ys -| (x::xs) (y::ys) := g xs ys + y -| (x::xs) [] := g xs [] - -#print g._main.equations._eqn_1 -#print g._main.equations._eqn_2 -#print g._main.equations._eqn_3 -#print g._main.equations._eqn_4 -#print g._main.equations._eqn_5 -#print g._main.equations._eqn_6 diff --git a/old_tests/tests/lean/run/def_ite1.lean b/old_tests/tests/lean/run/def_ite1.lean deleted file mode 100644 index e0f93c03bf..0000000000 --- a/old_tests/tests/lean/run/def_ite1.lean +++ /dev/null @@ -1,10 +0,0 @@ - -definition f : nat → nat → nat -| 100 2 := 0 -| _ 4 := 1 -| _ _ := 2 - -example : f 100 2 = 0 := rfl -example : f 9 4 = 1 := rfl -example : f 8 4 = 1 := rfl -example : f 6 3 = 2 := rfl diff --git a/old_tests/tests/lean/run/def_ite_value.lean b/old_tests/tests/lean/run/def_ite_value.lean deleted file mode 100644 index 7d99444a54..0000000000 --- a/old_tests/tests/lean/run/def_ite_value.lean +++ /dev/null @@ -1,19 +0,0 @@ -inductive bv : nat → Type -| nil : bv 0 -| cons : Π n, bool → bv n → bv (n+1) - -open bv - -definition f : ∀ n : nat, bv n → nat → nat -| (n+1) (cons .(n) b v) 1000000 := f n v 0 -| (n+1) (cons .(n) b v) x := f n v (x + 1) -| _ _ _ := 1 - -set_option pp.binder_types true - -#check @f._main.equations._eqn_1 -#check @f._main.equations._eqn_2 -#check @f._main.equations._eqn_3 - -example (n : nat) (b : bool) (v : bv n) (x : nat) : x ≠ 1000000 → f (n+1) (cons n b v) x = f n v (x + 1) := -assume H, f.equations._eqn_3 n b v x H diff --git a/old_tests/tests/lean/run/defaul_param3.lean b/old_tests/tests/lean/run/defaul_param3.lean deleted file mode 100644 index 96b974765a..0000000000 --- a/old_tests/tests/lean/run/defaul_param3.lean +++ /dev/null @@ -1,38 +0,0 @@ -meta constant f (a : nat) (b : nat := 10) : tactic unit - -meta example : tactic unit := -f 10 - -constant g (a : nat) (b : nat := 10) (c : nat) : nat - -example : g 0 = g 0 10 := -rfl - -noncomputable example : nat := -g 0 1 2 - -noncomputable example : nat → nat := -g 0 - -noncomputable def foo : nat → nat → nat := -g - -example : foo = (λ (a : nat), g a 10) := -rfl - -example : (λ (a : nat), g a 10) = g := -rfl - -example : g = (λ (a : nat), g a 10) := -rfl - -constant h (a : nat) (b := 10) (c : int) (d := 20) (v : bool) (w : char) : nat - -example : h = (λ x y, h x 10 y 20) := -rfl - -example : (λ x y, h x 10 y 20) = h := -rfl - -noncomputable example : nat → int → bool → char → nat := -h diff --git a/old_tests/tests/lean/run/default_field_pi.lean b/old_tests/tests/lean/run/default_field_pi.lean deleted file mode 100644 index cd48fa9a5b..0000000000 --- a/old_tests/tests/lean/run/default_field_pi.lean +++ /dev/null @@ -1,5 +0,0 @@ -structure foo := -(bar : Π n : ℕ, ℕ := id) -(baz : Π {n : ℕ}, ℕ := id) - -#check {foo.} diff --git a/old_tests/tests/lean/run/default_field_universe.lean b/old_tests/tests/lean/run/default_field_universe.lean deleted file mode 100644 index 09724e747e..0000000000 --- a/old_tests/tests/lean/run/default_field_universe.lean +++ /dev/null @@ -1,2 +0,0 @@ -structure {u} foo (α : Type u) : Type (u+1) := -(bar : Type u := α) diff --git a/old_tests/tests/lean/run/default_field_values1.lean b/old_tests/tests/lean/run/default_field_values1.lean deleted file mode 100644 index fd44d100c9..0000000000 --- a/old_tests/tests/lean/run/default_field_values1.lean +++ /dev/null @@ -1,41 +0,0 @@ -structure foo (α β : Type) := -(x : α) (f : α → α) (y : β) - -structure bla (α β : Type) extends foo α β := -(z : α := f x) - -structure boo (α : Type) extends bla α α := -(d := f (f x)) - -#print bla.z._default -#print boo.d._default - -lemma ex₁ : {boo . x := 10, f := nat.succ, y := 10}^.z = 11 := -rfl - -lemma ex₂ : {boo . x := 10, f := (λ x, 2*x), y := 10}^.d = 40 := -rfl - -structure cfg := -(x : nat := 10) -(y : bool := tt) - -#check {cfg .} - -lemma ex₃ : {cfg .} = {x := 10, y := tt} := -rfl - -lemma ex₄ : ({} : cfg) = {x := 10, y := tt} := -rfl - -def default_cfg1 : cfg := -{} -- Remark: this is overloaded, it can be the empty collection or the empty structure instance. - -def default_cfg2 : cfg := -{.} -- This is a non ambiguous way of writing the empty structure instance - -lemma ex₅ : default_cfg1 = default_cfg2 := -rfl - -lemma ex₆ : default_cfg1 = {x := 10, y := tt} := -rfl diff --git a/old_tests/tests/lean/run/default_param.lean b/old_tests/tests/lean/run/default_param.lean deleted file mode 100644 index 090e8c52d6..0000000000 --- a/old_tests/tests/lean/run/default_param.lean +++ /dev/null @@ -1,65 +0,0 @@ -universe variable u - -def f (a : nat) (o : opt_param nat 5) := -a + o - -example : f 1 = f 1 5 := -rfl - -#check f 1 - -structure config := -(v1 := 10) -(v2 := 20) -(flag := tt) -(ps := ["hello", "world"]) - -def g (a : nat) (c : opt_param config {}) : nat := -if c^.flag then a + c^.v1 else a + c^.v2 - -example : g 1 = 11 := -rfl - -example : g 1 {flag := ff} = 21 := -rfl - -example : g 1 {v1 := 100} = 101 := -rfl - -def h (a : nat) (c : opt_param config {v1 := a}) : nat := -g a c - -example : h 2 = 4 := -rfl - -example : h 3 = 6 := -rfl - -example : h 2 {flag := ff} = 22 := -rfl - -def boo (a : nat) (b : opt_param nat a) (c : opt_param bool ff) (d : opt_param config {v2 := b, flag := c}) := -g a d - -#check boo 2 - -example : boo 2 = 4 := -rfl - -example : boo 2 20 = 22 := -rfl - -example : boo 2 0 tt = 12 := -rfl - -open tactic -set_option pp.all true - -meta def check_expr (p : pexpr) (t : expr) : tactic unit := -do e ← to_expr p, guard (t = e) - -run_cmd do - e ← to_expr ``(boo 2), - check_expr ``(boo 2 (2:nat) ff {v1 := 10, v2 := 2, flag := ff, ps := ["hello", "world"]}) e, - e ← to_expr ```(f 1), - check_expr ```(f 1 (5:nat)) e diff --git a/old_tests/tests/lean/run/default_param2.lean b/old_tests/tests/lean/run/default_param2.lean deleted file mode 100644 index c5bb9b416b..0000000000 --- a/old_tests/tests/lean/run/default_param2.lean +++ /dev/null @@ -1,65 +0,0 @@ -universe variable u - -def f (a : nat) (o : nat := 5) := -a + o - -example : f 1 = f 1 5 := -rfl - -#check f 1 - -structure config := -(v1 := 10) -(v2 := 20) -(flag := tt) -(ps := ["hello", "world"]) - -def g (a : nat) (c : config := {}) : nat := -if c^.flag then a + c^.v1 else a + c^.v2 - -example : g 1 = 11 := -rfl - -example : g 1 {flag := ff} = 21 := -rfl - -example : g 1 {v1 := 100} = 101 := -rfl - -def h (a : nat) (c : config := {v1 := a}) : nat := -g a c - -example : h 2 = 4 := -rfl - -example : h 3 = 6 := -rfl - -example : h 2 {flag := ff} = 22 := -rfl - -def boo (a : nat) (b : nat := a) (c : bool := ff) (d : config := {v2 := b, flag := c}) := -g a d - -#check boo 2 - -example : boo 2 = 4 := -rfl - -example : boo 2 20 = 22 := -rfl - -example : boo 2 0 tt = 12 := -rfl - -open tactic -set_option pp.all true - -meta def check_expr (p : pexpr) (t : expr) : tactic unit := -do e ← to_expr p, guard (t = e) - -run_cmd do - e ← to_expr ``(boo 2), - check_expr ``(boo 2 (2:nat) ff {v1 := 10, v2 := 2, flag := ff, ps := ["hello", "world"]}) e, - e ← to_expr ```(f 1), - check_expr ```(f 1 (5:nat)) e diff --git a/old_tests/tests/lean/run/dep_coe_to_fn.lean b/old_tests/tests/lean/run/dep_coe_to_fn.lean deleted file mode 100644 index 95a69eaa36..0000000000 --- a/old_tests/tests/lean/run/dep_coe_to_fn.lean +++ /dev/null @@ -1,11 +0,0 @@ -universe variables u v - -structure Func := -(A : Type u) (B : Type v) (fn : A → B → A) - -instance F_to_fn : has_coe_to_fun Func := -{ F := λ f, f^.A → f^.B → f^.A, - coe := λ f, f^.fn } - -variables (f : Func) (a : f^.A) (b : f^.B) -#check (f a b) diff --git a/old_tests/tests/lean/run/dep_coe_to_fn2.lean b/old_tests/tests/lean/run/dep_coe_to_fn2.lean deleted file mode 100644 index 8de9de391b..0000000000 --- a/old_tests/tests/lean/run/dep_coe_to_fn2.lean +++ /dev/null @@ -1,11 +0,0 @@ -universe variables u v - -structure Func := -(A : Type u) (B : A → Type v) (fn : Π a, B a → B a) - -instance F_to_fn : has_coe_to_fun Func := -{ F := λ f, Π a, f^.B a → f^.B a, - coe := λ f, f^.fn } - -variables (f : Func) (a : f^.A) (b : f^.B a) -#check (f a b) diff --git a/old_tests/tests/lean/run/dep_coe_to_fn3.lean b/old_tests/tests/lean/run/dep_coe_to_fn3.lean deleted file mode 100644 index 46c39be0e3..0000000000 --- a/old_tests/tests/lean/run/dep_coe_to_fn3.lean +++ /dev/null @@ -1,36 +0,0 @@ -universe variables u v - -structure Func := -(A : Type u) (B : A → Type v) (fn : Π a, B a → B a) - -instance F_to_fn : has_coe_to_fun Func := -{ F := λ f, Π a, f^.B a → f^.B a, - coe := λ f a b, f^.fn a (f^.fn a b) } - -variables (f : Func) (a : f^.A) (b : f^.B a) -#check (f a b) - -def f1 : Func := -{ A := nat, - B := λ a, nat, - fn := (+) } - --- set_option trace.type_context.is_def_eq_detail true - -/- We need to mark 10 as a nat. - Reason: f1 is not reducible, then type class resolution - cannot find an instance for `has_one (Func.A f1)` -/ -example : f1 (10:nat) (30:nat) = (50:nat) := -rfl - -/- -#exit - -attribute [reducible] f1 - -example : f1 10 30 = 50 := -rfl - -example (n m : nat) : f1 n m = n + (n + m) := -rfl --/ diff --git a/old_tests/tests/lean/run/dep_parents.lean b/old_tests/tests/lean/run/dep_parents.lean deleted file mode 100644 index 185edbaef3..0000000000 --- a/old_tests/tests/lean/run/dep_parents.lean +++ /dev/null @@ -1,3 +0,0 @@ -class A := mk -class B [A] := mk -class C extends A, B := mk diff --git a/old_tests/tests/lean/run/dependent_seq.lean b/old_tests/tests/lean/run/dependent_seq.lean deleted file mode 100644 index 860c06d181..0000000000 --- a/old_tests/tests/lean/run/dependent_seq.lean +++ /dev/null @@ -1,8 +0,0 @@ - -theorem test (n : nat) (h : n = n) : true := trivial - -example (h : 3 = 3) : true := -by apply test; assumption - -example (h : 3 = 3) : true := -by apply test; [assumption] diff --git a/old_tests/tests/lean/run/destruct.lean b/old_tests/tests/lean/run/destruct.lean deleted file mode 100644 index 7360c9cadf..0000000000 --- a/old_tests/tests/lean/run/destruct.lean +++ /dev/null @@ -1,30 +0,0 @@ -universe variables u - -inductive Vec (α : Type u) : nat → Type (max 1 u) -| nil : Vec 0 -| cons : ∀ {n}, α → Vec n → Vec (nat.succ n) - -lemma split {α : Type u} {n : nat} (v : Vec α n) : (v == (Vec.nil α) ∧ n = 0) ∨ ∃ m h (t : Vec α m), v == Vec.cons h t ∧ n = nat.succ m := -Vec.cases_on v - (or.inl ⟨heq.refl _, rfl⟩) - (λ n h t, or.inr ⟨n, h, t, heq.refl _, rfl⟩) - -constant f {α : Type u} {n : nat} : Vec α n → nat -axiom fax1 (α : Type u) : f (Vec.nil α) = 0 -axiom fax2 {α : Type u} {n : nat} (v : Vec α (nat.succ n)) : f v = 1 - -example {α : Type u} {n : nat} (v : Vec α n) : f v ≠ 2 := -begin - destruct v, - {intros, intro, have h := fax1 α, cc}, - intros n1 h t, intros, intro, have h := fax2 (Vec.cons h t), cc -end - -open nat -example : ∀ n, 0 < n → succ (pred n) = n := -begin - intro n, - destruct n, - {dsimp, intros, have h := lt_irrefl 0, cc}, - {intros, subst n, dsimp, reflexivity} -end diff --git a/old_tests/tests/lean/run/div2.lean b/old_tests/tests/lean/run/div2.lean deleted file mode 100644 index 1bf45ab0de..0000000000 --- a/old_tests/tests/lean/run/div2.lean +++ /dev/null @@ -1,7 +0,0 @@ -def Div : nat → nat → nat -| x y := - if h : 0 < y ∧ y ≤ x then - have x - y < x, from nat.sub_lt (nat.lt_of_lt_of_le h.left h.right) h.left, - Div (x - y) y + 1 - else - 0 diff --git a/old_tests/tests/lean/run/div_wf.lean b/old_tests/tests/lean/run/div_wf.lean deleted file mode 100644 index 1fc1c89705..0000000000 --- a/old_tests/tests/lean/run/div_wf.lean +++ /dev/null @@ -1,56 +0,0 @@ -open nat well_founded decidable prod - -set_option pp.all true - --- Auxiliary lemma used to justify recursive call -private definition lt_aux {x y : nat} (H : 0 < y ∧ y ≤ x) : x - y < x := -and.rec_on H (λ ypos ylex, - sub_lt (nat.lt_of_lt_of_le ypos ylex) ypos) - -definition wdiv.F (x : nat) (f : Π x₁, x₁ < x → nat → nat) (y : nat) : nat := -if H : 0 < y ∧ y ≤ x then f (x - y) (lt_aux H) y + 1 else 0 - -definition wdiv (x y : nat) := -fix lt_wf wdiv.F x y - -theorem wdiv_def (x y : nat) : wdiv x y = if H : 0 < y ∧ y ≤ x then wdiv (x - y) y + 1 else 0 := -congr_fun (well_founded.fix_eq lt_wf wdiv.F x) y - -/- -See comment at fib_wrec. -example : wdiv 5 2 = 2 := -rfl - -example : wdiv 9 3 = 3 := -rfl --/ - --- There is a little bit of cheating in the definition above. --- I avoid the packing/unpacking into tuples. --- The actual definitional package would not do that. --- It will always pack things. - -definition pair_nat.lt := lex nat.lt nat.lt -- Could also be (lex lt empty_rel) -definition pair_nat.lt.wf : well_founded pair_nat.lt := -prod.lex_wf lt_wf lt_wf -infixl `≺`:50 := pair_nat.lt - --- Recursive lemma used to justify recursive call -definition plt_aux (x y : nat) (H : 0 < y ∧ y ≤ x) : (x - y, y) ≺ (x, y) := -lex.left _ _ _ (lt_aux H) - -definition pdiv.F (p₁ : nat × nat) : (Π p₂ : nat × nat, p₂ ≺ p₁ → nat) → nat := -prod.cases_on p₁ (λ x y f, - if H : 0 < y ∧ y ≤ x then f (x - y, y) (plt_aux x y H) + 1 else 0) - -definition pdiv (x y : nat) := -fix pair_nat.lt.wf pdiv.F (x, y) - -theorem pdiv_def (x y : nat) : pdiv x y = if H : 0 < y ∧ y ≤ x then pdiv (x - y) y + 1 else 0 := -well_founded.fix_eq pair_nat.lt.wf pdiv.F (x, y) - -/- -See comment at fib_wrec. -example : pdiv 17 2 = 8 := -rfl --/ diff --git a/old_tests/tests/lean/run/do_const_pat.lean b/old_tests/tests/lean/run/do_const_pat.lean deleted file mode 100644 index 6fcf9604a8..0000000000 --- a/old_tests/tests/lean/run/do_const_pat.lean +++ /dev/null @@ -1,3 +0,0 @@ -run_cmd do - tt ← pure ff | tactic.skip, - tactic.failed diff --git a/old_tests/tests/lean/run/do_let_notation.lean b/old_tests/tests/lean/run/do_let_notation.lean deleted file mode 100644 index 71e9843caa..0000000000 --- a/old_tests/tests/lean/run/do_let_notation.lean +++ /dev/null @@ -1,22 +0,0 @@ -open tactic - -example : true := -by do - let n := 10, - let b := 20, - trace $ n + b, - constructor - -example : true ∧ true := -by do - t ← target, - let f := t^.get_app_fn, - trace f, - constructor, - repeat triv - -example : true ∧ true := -by do - t ← target, - let f := t^.get_app_fn in - constructor >> skip; triv diff --git a/old_tests/tests/lean/run/do_match_else.lean b/old_tests/tests/lean/run/do_match_else.lean deleted file mode 100644 index be8e843a34..0000000000 --- a/old_tests/tests/lean/run/do_match_else.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -set_option pp.all true - -meta def app2 (f a b : expr) := -expr.app (expr.app f a) b - -example (a b c x y : nat) (H : nat.add (nat.add x y) y = 0) : true := -by do - a ← get_local `a, b ← get_local `b, c ← get_local `c, - H ← get_local `H >>= infer_type, - (lhs, rhs) ← match_eq H, - nat_add : expr ← mk_const `nat.add, - p : pattern ← mk_pattern [] [a, b] (app2 nat_add a b) [] [app2 nat_add b a, a, b], - trace (pattern.moutput p), - (_, [v₁, v₂, v₃]) ← match_pattern p lhs | failed, - trace v₁, trace v₂, trace v₃, - constructor diff --git a/old_tests/tests/lean/run/do_notation_tmp_var_issue.lean b/old_tests/tests/lean/run/do_notation_tmp_var_issue.lean deleted file mode 100644 index d59b470628..0000000000 --- a/old_tests/tests/lean/run/do_notation_tmp_var_issue.lean +++ /dev/null @@ -1,4 +0,0 @@ -meta def mk_local_pis : expr → tactic (list expr × expr) -| p := do - (ps, r) ← mk_local_pis p, - return ((p :: ps), r) diff --git a/old_tests/tests/lean/run/doc_string1.lean b/old_tests/tests/lean/run/doc_string1.lean deleted file mode 100644 index 24f8d1efa1..0000000000 --- a/old_tests/tests/lean/run/doc_string1.lean +++ /dev/null @@ -1,58 +0,0 @@ -/-- -Documentation for x - -``` -#reduce x + x -``` -Testing... --/ -def x := 10 + 20 - -def y := "alo" - -open tactic - -run_cmd do - d ← doc_string `x, - trace d - -run_cmd add_doc_string `y "testing simple doc" - -run_cmd do - d ← doc_string `y, - trace d - -namespace foo - namespace bla - /-- - Documentation for single - testing... - hello - world - -/ - inductive single - | unit - - end bla -end foo - -run_cmd do - trace "--------", - doc_string `foo.bla.single >>= trace - - -/-- Documentation for constant A - foo -/ -constant A : Type - -run_cmd doc_string `A >>= trace - -/--Documentation for point -test - - -/ -structure point := -(x : nat) (y : nat) - -run_cmd doc_string `point >>= trace -#print "----------" diff --git a/old_tests/tests/lean/run/doc_string2.lean b/old_tests/tests/lean/run/doc_string2.lean deleted file mode 100644 index d0d96a074c..0000000000 --- a/old_tests/tests/lean/run/doc_string2.lean +++ /dev/null @@ -1,16 +0,0 @@ -/-- Documentation for inductive foo -/ -inductive foo -| val1 | val2 - -namespace foo - /-- Documentation for x -/ - def x := 10 -end foo - -open tactic - -run_cmd do - trace "--------", - doc_string `foo >>= trace, - trace "--------", - doc_string `foo.x >>= trace diff --git a/old_tests/tests/lean/run/doc_string3.lean b/old_tests/tests/lean/run/doc_string3.lean deleted file mode 100644 index 0789671623..0000000000 --- a/old_tests/tests/lean/run/doc_string3.lean +++ /dev/null @@ -1,25 +0,0 @@ -/-! -Documentation header for test module --/ - -/-- Documentation for x -/ -def x := 10 - -namespace foo -/-! - Another block of documentation - for this example. --/ - -/-- Documentation for y -/ -def y := 20 - -end foo - -/-! - Documentation footer - testing --/ - -open tactic -run_cmd module_doc_strings >>= trace diff --git a/old_tests/tests/lean/run/doc_string4.lean b/old_tests/tests/lean/run/doc_string4.lean deleted file mode 100644 index 043598de06..0000000000 --- a/old_tests/tests/lean/run/doc_string4.lean +++ /dev/null @@ -1,133 +0,0 @@ -/-! -# Arithmetic expressions for a simple imperative language. --/ - -namespace imp -open tactic - -/-- Variable names -/ -@[reducible] def uname := string - -/-- -#brief Arithmetic expressions abstract syntax tree. - -We encode x + 1 as -``` -#check aexp.plus (aexp.var "x") (aexp.val 1) -``` --/ -inductive aexp -| val : nat → aexp -| var : uname → aexp -| plus : aexp → aexp → aexp - -/-- #brief Arithmetic expressions have decidable equality. -/ -instance : decidable_eq aexp := -by mk_dec_eq_instance - -/-- #brief Value assigned to variables. -/ -@[reducible] def value := nat - -/-- #brief The state is a mapping from variable names to their values. -/ -def state := uname → value - -open aexp - -/-- - #brief Given an arithmetic expression and a state, this function returns the - value for the expression. - - ``` - example : aval (plus (val 3) (var "x")) (λ x, 0) = 3 := - rfl - ``` - See [`aexp`](#imp.aexp) --/ -def aval : aexp → state → value -| (val n) s := n -| (var x) s := s x -| (plus a₁ a₂) s := aval a₁ s + aval a₂ s - -/-- - #brief Update the state with then entry `x -> v`. - We say we are assigning `v` to `x`. --/ -def updt (s : state) (x : uname) (v : value) : state := -λ y, if x = y then v else s y - -/-- - #brief Very basic constant folding simplification procedure. - For example, it reduces subexpressions such as (3 + 2) to 5. --/ -def asimp_const : aexp → aexp -| (val n) := val n -| (var x) := var x -| (plus a₁ a₂) := - match asimp_const a₁, asimp_const a₂ with - | val n₁, val n₂ := val (n₁ + n₂) - | b₁, b₂ := plus b₁ b₂ - end - -/-! - _Remark_: we can prove by reflexivity the fact that the constant folder simplifies `(2+3)+x` into `5+x`. - ``` - example : asimp_const (plus (plus (val 2) (val 3)) (var "x")) = plus (val 5) (var "x") := - rfl - ``` --/ - -/-- #brief Prove that constant folding preserves the value of an artihmetic expressions. -/ -lemma aval_asimp_const (a : aexp) (s : state) : aval (asimp_const a) s = aval a s := -begin - induction a with n x a₁ a₂ ih₁ ih₂, - repeat {reflexivity}, - {unfold asimp_const aval, - rewrite [←ih₁, ←ih₂], - cases (asimp_const a₁), - repeat {cases (asimp_const a₂), repeat {reflexivity}}} -end - -/-- - #brief Alternative proof without tactics that constant folding preserves - the value of an arithmetic expression. - - This alternative proof is more verbose because we are essentially writing - the proof term. --/ -lemma aval_asimp_const₂ : ∀ (a : aexp) (s : state), aval (asimp_const a) s = aval a s -| (val n) s := rfl -| (var x) s := rfl -| (plus a₁ a₂) s := - show aval (asimp_const (plus a₁ a₂)) s = aval a₁ s + aval a₂ s, from - suffices aval (asimp_const._match_1 (asimp_const a₁) (asimp_const a₂)) s = aval (asimp_const a₁) s + aval (asimp_const a₂) s, from - aval_asimp_const₂ a₁ s ▸ aval_asimp_const₂ a₂ s ▸ this, - match asimp_const a₁, asimp_const a₂ with - | val _, val _ := rfl - | val _, var _ := rfl - | val _, plus _ _ := rfl - | var _, val _ := rfl - | var _, var _ := rfl - | var _, plus _ _ := rfl - | plus _ _, val _ := rfl - | plus _ _, var _ := rfl - | plus _ _, plus _ _ := rfl - end - -/-- - #brief Alternative proof that mixes proof terms and tactics. - - See [`asimp_const`](#imp.asimp_const) --/ -lemma aval_asimp_const₃ : ∀ (a : aexp) (s : state), aval (asimp_const a) s = aval a s -| (val n) s := rfl -| (var x) s := rfl -| (plus a₁ a₂) s := - begin - have h₁ := aval_asimp_const₃ a₁ s, - have h₂ := aval_asimp_const₃ a₂ s, - unfold asimp_const aval, - rewrite [←h₁, ←h₂], - cases (asimp_const a₁); cases (asimp_const a₂); repeat {reflexivity} - end - -end imp diff --git a/old_tests/tests/lean/run/doc_string5.lean b/old_tests/tests/lean/run/doc_string5.lean deleted file mode 100644 index ff36e7cc76..0000000000 --- a/old_tests/tests/lean/run/doc_string5.lean +++ /dev/null @@ -1,19 +0,0 @@ -/-- -Doc string for constants --/ -constant a : nat - -/-- -Doc string for axiom --/ -axiom ax : a = 0 - -/-- -Doc string for meta constant --/ -meta constant v : tactic unit - -/-- -Doc string --/ -def x := 1 diff --git a/old_tests/tests/lean/run/docstring_after_variables.lean b/old_tests/tests/lean/run/docstring_after_variables.lean deleted file mode 100644 index 999c1da604..0000000000 --- a/old_tests/tests/lean/run/docstring_after_variables.lean +++ /dev/null @@ -1,4 +0,0 @@ -variables {a b : nat} - -/-- A docstring. -/ -def foo := a + b diff --git a/old_tests/tests/lean/run/dsimp_options.lean b/old_tests/tests/lean/run/dsimp_options.lean deleted file mode 100644 index d8e95dda44..0000000000 --- a/old_tests/tests/lean/run/dsimp_options.lean +++ /dev/null @@ -1,80 +0,0 @@ -example (b c : nat) : c = @bool.cases_on (λ _, nat) tt b c := -begin - fail_if_success {dsimp {iota := ff}}, - dsimp {iota := tt}, - guard_target c = c, - reflexivity -end - -example (b c : nat) : c = @bool.cases_on (λ _, nat) tt b c := -begin - dsimp, -- iota is tt by default - guard_target c = c, - reflexivity -end - -example (b c : nat) : c = (λ x : nat, x) c := -begin - fail_if_success {dsimp {beta := ff}}, - dsimp {beta := tt}, - guard_target c = c, - reflexivity -end - -example (b c : nat) : c = (λ x : nat, x) c := -begin - dsimp, -- beta is tt by default - guard_target c = c, - reflexivity -end - -example (b c : nat) : c = (b, c).2 := -begin - fail_if_success {dsimp {proj := ff}}, - dsimp {proj := tt}, - guard_target c = c, - reflexivity -end - -example (b c : nat) : c = (b, c).2 := -begin - dsimp, -- projection reduction is true by default IF argument is a constructor - guard_target c = c, - reflexivity -end - -example (f g : nat → nat) : f ∘ g = λ x, f (g x) := -begin - fail_if_success {dsimp}, -- reducible definition (e.g., function.comp) are not unfolded by default - dsimp [(∘)], - guard_target (λ x, f (g x)) = λ x, f (g x), - reflexivity -end - -example (f g : nat → nat) : f ∘ g = λ x, f (g x) := -begin - dsimp [function.comp], - guard_target (λ x, f (g x)) = λ x, f (g x), - reflexivity -end - -example (a : nat) : (let x := a in x) = a := -begin - fail_if_success{dsimp {zeta := ff}}, - dsimp {zeta := tt}, - guard_target a = a, - reflexivity -end - -example (a : nat) : (let x := a in x) = a := -begin - dsimp, -- zeta is tt by default - guard_target a = a, - reflexivity -end - -example (a b : nat) : a + b = b + a := -begin - fail_if_success{dsimp}, -- will not unfold has_add.add applications - apply add_comm -end diff --git a/old_tests/tests/lean/run/dsimp_partial_app.lean b/old_tests/tests/lean/run/dsimp_partial_app.lean deleted file mode 100644 index 467c4204c9..0000000000 --- a/old_tests/tests/lean/run/dsimp_partial_app.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -example (a : list nat) : a = [1, 2] → a.map nat.succ = [2, 3] := -begin - intros, - guard_target list.map nat.succ a = [2, 3], - subst a, - dsimp [list.map], - guard_target [nat.succ 1, nat.succ 2] = [2, 3], - reflexivity -end diff --git a/old_tests/tests/lean/run/dsimp_proj.lean b/old_tests/tests/lean/run/dsimp_proj.lean deleted file mode 100644 index 5e97c89ccf..0000000000 --- a/old_tests/tests/lean/run/dsimp_proj.lean +++ /dev/null @@ -1,14 +0,0 @@ -example (a b : nat) : a + b = b + a := -begin - dsimp [has_add.add], - guard_target nat.add a b = nat.add b a, - apply add_comm -end - -example (f g : nat → nat) : (f ∘ g) = (λ x, f (g x)) := -begin - fail_if_success {dsimp}, - dsimp {unfold_reducible := tt}, - guard_target (λ x, f (g x)) = (λ x, f (g x)), - refl -end diff --git a/old_tests/tests/lean/run/dsimp_test.lean b/old_tests/tests/lean/run/dsimp_test.lean deleted file mode 100644 index 220bd4b9fc..0000000000 --- a/old_tests/tests/lean/run/dsimp_test.lean +++ /dev/null @@ -1,78 +0,0 @@ -def f : nat → nat -| 0 := 10 -| (n+1) := 20 + n - -open list tactic - -local attribute [-simp] map head - -example (a b c : nat) : head (map f [1, 2, 3]) = 20 := -begin - dsimp [map], - guard_target head [f 1, f 2, f 3] = 20, - dsimp [f], - guard_target head [20 + 0, 20 + 1, 20 + 2] = 20, - dsimp [head], - guard_target 20 + 0 = 20, - reflexivity -end - -example (a b c : nat) : head (map f [1, 2, 3]) = 20 := -begin - dsimp [map, f, head], - guard_target 20 + 0 = 20, - reflexivity -end - -@[simp] lemma succ_zero_eq_one : nat.succ 0 = 1 := -rfl - -def g : nat × nat → nat -| (a, b) := a + b - -lemma gax (x y) : g (x, y) = x + y := -rfl - -attribute [simp] gax - -example (a b c : nat) : g (f 1, f 2) = 41 := -begin - dsimp, - guard_target f 1 + f 2 = 41, - dsimp [f], - reflexivity -end - -example (a b c : nat) : g (f 1, f 2) = 41 := -begin - dsimp [f], - guard_target 20 + 0 + (20 + 1) = 41, - reflexivity -end - -example (a b c : nat) : g (f 1, f 2) = 41 := -begin - dsimp [f, -gax], - guard_target g (20 + 0, 20 + 1) = 41, - dsimp [g], - guard_target 20 + 0 + (20 + 1) = 41, - reflexivity -end - -local attribute [-simp] gax - -example (a b c : nat) : g (f 1, f 2) = 41 := -begin - dsimp [f], - guard_target g (20 + 0, 20 + 1) = 41, - dsimp [gax], - guard_target 20 + 0 + (20 + 1) = 41, - reflexivity -end - -example (a b c : nat) : g (f 1, f 2) = 41 := -begin - dsimp [f, gax], - guard_target 20 + 0 + (20 + 1) = 41, - reflexivity -end diff --git a/old_tests/tests/lean/run/dsimp_unfold_reducible_bug.lean b/old_tests/tests/lean/run/dsimp_unfold_reducible_bug.lean deleted file mode 100644 index 4706077bd6..0000000000 --- a/old_tests/tests/lean/run/dsimp_unfold_reducible_bug.lean +++ /dev/null @@ -1,22 +0,0 @@ -open tactic - -example ( a b : nat → nat ) ( p : (a ∘ b) 0 = 0 ) : a ( b 0 ) = 0 := -begin - dsimp [function.comp] at p, - (do t ← get_local `p >>= infer_type, e ← to_expr ```(a (b 0) = 0), guard (t = e)), - assumption -end - -example ( a b : nat → nat ) ( p : (a ∘ b) 0 = 0 ) : a ( b 0 ) = 0 := -begin - dsimp at p {unfold_reducible := tt}, - (do t ← get_local `p >>= infer_type, e ← to_expr ```(a (b 0) = 0), guard (t = e)), - assumption -end - -example ( a b : nat → nat ) ( p : (a ∘ b) 0 = 0 ) : a (b 0) = 0 := -begin - dsimp at p {unfold_reducible := tt, single_pass := tt}, - (do t ← get_local `p >>= infer_type, e ← to_expr ```(a (b 0) = 0), guard (t = e)), - assumption -end diff --git a/old_tests/tests/lean/run/dsimplify1.lean b/old_tests/tests/lean/run/dsimplify1.lean deleted file mode 100644 index 754cfac5a4..0000000000 --- a/old_tests/tests/lean/run/dsimplify1.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -example (f : nat → nat → nat) (p : nat → Prop) (a b : nat) : f ((a + 1, b).1) b = f (a+1) (a, b).2 := -by do - t ← target, - new_t ← dsimplify (λ e, failed) (λ e, do new_e ← whnf e, return (new_e, tt)) t, - expected ← to_expr ```(f (nat.succ a) b = f (nat.succ a) b), - guard (new_t = expected), - reflexivity - -example (f : nat → nat → nat) (p : nat → Prop) (a b : nat) : f ((a + 1, b).1) b = f (a+1) (a, b).2 := -by do - t ← target, - new_t ← dsimplify (λ e, failed) (λ e, do new_e ← whnf_no_delta e, return (new_e, tt)) t, - expected ← to_expr ```(f (a + 1) b = f (a + 1) b), - guard (new_t = expected), - reflexivity diff --git a/old_tests/tests/lean/run/dsimplify2.lean b/old_tests/tests/lean/run/dsimplify2.lean deleted file mode 100644 index 26deea6ed7..0000000000 --- a/old_tests/tests/lean/run/dsimplify2.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -def f : nat → nat := λ x, x + 10 - -@[simp] lemma f_lemma (x : nat) : f x = x + 10 := -rfl - -example (p : nat → Prop) (a : nat) (h : p (a + 10)) : p (f a) := -by do - t ← target, - S ← simp_lemmas.mk_default, - new_t ← dsimplify (λ e, failed) (λ e, do new_e ← S^.drewrite e, return (new_e, tt)) t, - expected ← to_expr ```(p (a + 10)), - guard (new_t = expected), - change new_t, - assumption diff --git a/old_tests/tests/lean/run/dunfold3.lean b/old_tests/tests/lean/run/dunfold3.lean deleted file mode 100644 index 413858040b..0000000000 --- a/old_tests/tests/lean/run/dunfold3.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -def g : nat → nat := λ x, x + 5 - -set_option pp.all true - -example (a b : nat) (p : nat → Prop) (h : p (g (nat.succ (nat.succ a)))) : p (g (a + 2)) := -begin - unfold g at h, - do { h ← get_local `h >>= infer_type, t ← to_expr ```(p (nat.succ (nat.succ a) + 5)), guard (h = t) }, - unfold has_add.add bit0 has_one.one nat.add, - unfold g, - do { t ← target, h ← get_local `h >>= infer_type, guard (t = h) }, - assumption -end - -meta def check_expected (p : pexpr) : tactic unit := -do t ← target, ex ← to_expr p, guard (t = ex) diff --git a/old_tests/tests/lean/run/dunfold4.lean b/old_tests/tests/lean/run/dunfold4.lean deleted file mode 100644 index 71f8740e34..0000000000 --- a/old_tests/tests/lean/run/dunfold4.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic - -namespace list -example : length ([] : list unit) = 0 := -begin dunfold length, reflexivity end -end list diff --git a/old_tests/tests/lean/run/e1.lean b/old_tests/tests/lean/run/e1.lean deleted file mode 100644 index 5e0d251f9d..0000000000 --- a/old_tests/tests/lean/run/e1.lean +++ /dev/null @@ -1,16 +0,0 @@ -prelude -definition Prop : Sort.{1} := Sort.{0} -constant eq : forall {A : Type}, A → A → Prop -constant N : Type -constants a b c : N -infix `=`:50 := eq -#check a = b - -constant f : Prop → N → N -constant g : N → N → N -precedence `+`:50 -infixl + := f -infixl + := g -#check a + b + c -constant p : Prop -#check p + a + b + c diff --git a/old_tests/tests/lean/run/e15.lean b/old_tests/tests/lean/run/e15.lean deleted file mode 100644 index 4ce7da5f5d..0000000000 --- a/old_tests/tests/lean/run/e15.lean +++ /dev/null @@ -1,27 +0,0 @@ -prelude -inductive nat : Type -| zero : nat -| succ : nat → nat -namespace nat end nat open nat - -inductive list (A : Sort*) -| nil {} : list -| cons : A → list → list -namespace list end list open list -#check nil -#check nil.{1} -#check @nil.{1} nat -#check @nil nat - -#check cons zero nil - -inductive vector (A : Sort*) : nat → Sort* -| vnil {} : vector zero -| vcons : forall {n : nat}, A → vector n → vector (succ n) -namespace vector end vector open vector - -#check vcons zero vnil -constant n : nat -#check vcons n vnil - -#check vector.rec diff --git a/old_tests/tests/lean/run/e16.lean b/old_tests/tests/lean/run/e16.lean deleted file mode 100644 index cdc9134550..0000000000 --- a/old_tests/tests/lean/run/e16.lean +++ /dev/null @@ -1,28 +0,0 @@ -prelude -inductive nat : Type -| zero : nat -| succ : nat → nat -namespace nat end nat open nat - -inductive {u} list (A : Type u) : Type u -| nil {} : list -| cons : A → list → list -namespace list end list open list - -#check nil -#check nil.{0} -#check @nil.{0} nat -#check @nil nat - -#check cons zero nil - -inductive {u} vector (A : Type u) : nat → Type u -| vnil {} : vector zero -| vcons : forall {n : nat}, A → vector n → vector (succ n) -namespace vector end vector open vector - -#check vcons zero vnil -constant n : nat -#check vcons n vnil - -#check vector.rec diff --git a/old_tests/tests/lean/run/e2.lean b/old_tests/tests/lean/run/e2.lean deleted file mode 100644 index c2dc2e2e98..0000000000 --- a/old_tests/tests/lean/run/e2.lean +++ /dev/null @@ -1,3 +0,0 @@ -prelude -definition Prop := Type.{0} -#check Prop diff --git a/old_tests/tests/lean/run/e3.lean b/old_tests/tests/lean/run/e3.lean deleted file mode 100644 index dc574d4627..0000000000 --- a/old_tests/tests/lean/run/e3.lean +++ /dev/null @@ -1,21 +0,0 @@ -prelude -definition Prop := Type.{0} - -definition false := ∀x : Prop, x -#check false - -theorem false.elim (C : Prop) (H : false) : C -:= H C - -definition Eq {A : Type} (a b : A) -:= ∀ {P : A → Prop}, P a → P b - -#check Eq - -infix `=`:50 := Eq - -theorem refl {A : Type} (a : A) : a = a -:= λ P H, H - -theorem subst {A : Type} {P : A -> Prop} {a b : A} (H1 : a = b) (H2 : P a) : P b -:= @H1 P H2 diff --git a/old_tests/tests/lean/run/e4.lean b/old_tests/tests/lean/run/e4.lean deleted file mode 100644 index 0619e4b1dd..0000000000 --- a/old_tests/tests/lean/run/e4.lean +++ /dev/null @@ -1,34 +0,0 @@ -prelude -definition Prop := Sort.{0} - -definition false : Prop := ∀x : Prop, x -#check false - -theorem false.elim (C : Prop) (H : false) : C -:= H C - -definition Eq {A : Type} (a b : A) -:= ∀ P : A → Prop, P a → P b - -#check Eq - -infix `=`:50 := Eq - -theorem refl {A : Type} (a : A) : a = a -:= λ P H, H - -definition true : Prop -:= false = false - -theorem trivial : true -:= refl false - -attribute [elab_as_eliminator] -theorem subst {A : Type} {P : A -> Prop} {a b : A} (H1 : a = b) (H2 : P a) : P b -:= H1 _ H2 - -theorem symm {A : Type} {a b : A} (H : a = b) : b = a -:= subst H (refl a) - -theorem trans {A : Type} {a b c : A} (H1 : a = b) (H2 : b = c) : a = c -:= subst H2 H1 diff --git a/old_tests/tests/lean/run/e5.lean b/old_tests/tests/lean/run/e5.lean deleted file mode 100644 index 8f55540780..0000000000 --- a/old_tests/tests/lean/run/e5.lean +++ /dev/null @@ -1,71 +0,0 @@ -prelude -definition Prop := Sort.{0} - -definition false : Prop := ∀ x : Prop, x -#check false - -theorem false.elim (C : Prop) (H : false) : C -:= H C - -definition Eq {A : Type} (a b : A) -:= ∀ P : A → Prop, P a → P b - -#check Eq - -infix `=`:50 := Eq - -theorem refl {A : Type} (a : A) : a = a -:= λ P H, H - -definition true : Prop -:= false = false - -theorem trivial : true -:= refl false - -attribute [elab_as_eliminator] -theorem subst {A : Type} {P : A -> Prop} {a b : A} (H1 : a = b) (H2 : P a) : P b -:= H1 _ H2 - -theorem symm {A : Type} {a b : A} (H : a = b) : b = a -:= subst H (refl a) - -theorem trans {A : Type} {a b c : A} (H1 : a = b) (H2 : b = c) : a = c -:= subst H2 H1 - -inductive nat : Type -| zero : nat -| succ : nat → nat -namespace nat end nat open nat - -#print "using strict implicit arguments" -definition symmetric {A : Type} (R : A → A → Prop) := ∀ ⦃a b⦄, R a b → R b a - -#check symmetric -constant p : nat → nat → Prop -#check symmetric p -axiom H1 : symmetric p -axiom H2 : p zero (succ zero) -#check H1 -#check H1 H2 - -#print "------------" -#print "using implicit arguments" -definition symmetric2 {A : Type} (R : A → A → Prop) := ∀ {a b}, R a b → R b a -#check symmetric2 -#check symmetric2 p -axiom H3 : symmetric2 p -axiom H4 : p zero (succ zero) -#check H3 -#check H3 H4 - -#print "-----------------" -#print "using strict implicit arguments (ASCII notation)" -definition symmetric3 {A : Type} (R : A → A → Prop) := ∀ {{a b}}, R a b → R b a - -#check symmetric3 -#check symmetric3 p -axiom H5 : symmetric3 p -axiom H6 : p zero (succ zero) -#check H5 -#check H5 H6 diff --git a/old_tests/tests/lean/run/elab3.lean b/old_tests/tests/lean/run/elab3.lean deleted file mode 100644 index 7363cc0a57..0000000000 --- a/old_tests/tests/lean/run/elab3.lean +++ /dev/null @@ -1,3 +0,0 @@ -set_option pp.binder_types true -axiom Sorry {A : Sort*} : A -#check (Sorry : ∀ a, a > 0) diff --git a/old_tests/tests/lean/run/elab4.lean b/old_tests/tests/lean/run/elab4.lean deleted file mode 100644 index 941aba1c40..0000000000 --- a/old_tests/tests/lean/run/elab4.lean +++ /dev/null @@ -1,4 +0,0 @@ -#check λ (A : Type) (a b c d : A) (H1 : a = b) (H2 : c = b) (H3 : d = c), -calc a = b : H1 - ... = c : eq.symm H2 - ... = d : eq.symm H3 diff --git a/old_tests/tests/lean/run/elab5.lean b/old_tests/tests/lean/run/elab5.lean deleted file mode 100644 index dbc930e837..0000000000 --- a/old_tests/tests/lean/run/elab5.lean +++ /dev/null @@ -1,19 +0,0 @@ -set_option pp.implicit true - -#check (λ a b : nat, (nat.rec_on a (λ b, b) (λ a' ih b, ih b + 1) b : nat)) - -#check (λ a b : nat, (nat.rec_on a (λ b, b) (λ a' ih b, ih b + 1) b : nat)) - -constants a b c : nat -constant p : nat → nat → Prop -constant f : nat → nat -axiom H1 : p (f a) (f a) -axiom H2 : a = b -axiom H3 : a = c - -#check (eq.subst H2 H1 : p (f a) (f b)) -#check (eq.subst H2 (eq.subst H3 H1) : p (f c) (f b)) - -axiom H4 : a + 1 = b -axiom H5 : p (a + nat.succ nat.zero) a -#check (eq.subst H4 H5 : p b a) diff --git a/old_tests/tests/lean/run/elab6.lean b/old_tests/tests/lean/run/elab6.lean deleted file mode 100644 index 60a97a1263..0000000000 --- a/old_tests/tests/lean/run/elab6.lean +++ /dev/null @@ -1,5 +0,0 @@ -constants a b : nat -constant p : nat → Prop -constant H1 : p (a + a + a) -constant H2 : a = b -#check (eq.subst H2 H1 : p (a + b + a)) diff --git a/old_tests/tests/lean/run/elab_bool.lean b/old_tests/tests/lean/run/elab_bool.lean deleted file mode 100644 index 2267e9dc4a..0000000000 --- a/old_tests/tests/lean/run/elab_bool.lean +++ /dev/null @@ -1,7 +0,0 @@ -variable b : bool - -#check if b then tt else ff - -#check if b && b then tt else ff - -#check if b ∧ b then tt else ff diff --git a/old_tests/tests/lean/run/elab_crash1.lean b/old_tests/tests/lean/run/elab_crash1.lean deleted file mode 100644 index defeadab6c..0000000000 --- a/old_tests/tests/lean/run/elab_crash1.lean +++ /dev/null @@ -1,14 +0,0 @@ -open expr tactic - -meta definition to_expr_target (a : pexpr) : tactic expr := -do tgt ← target, - to_expr ```((%%a : %%tgt)) - -example (A : Type) (a : A) : A := -by do to_expr_target ``(sorry) >>= exact - -example (A : Type) (a : A) : A := -by do refine ``(sorry) - -example (a : nat) : nat := -by do to_expr ``(nat.zero) >>= exact diff --git a/old_tests/tests/lean/run/elab_failure.lean b/old_tests/tests/lean/run/elab_failure.lean deleted file mode 100644 index 01aa3f986d..0000000000 --- a/old_tests/tests/lean/run/elab_failure.lean +++ /dev/null @@ -1,14 +0,0 @@ -open bool nat -attribute [reducible] nat.rec_on -definition is_eq (a b : nat) : bool := -nat.rec_on a - (λ b, nat.cases_on b tt (λb₁, ff)) - (λ a₁ r₁ b, nat.cases_on b ff (λb₁, r₁ b₁)) - b - -example (a₁ : nat) (b : nat) : true := -@nat.cases_on (λ (n : nat), true) b - true.intro - (λ (b₁ : _), - have aux : is_eq a₁ b₁ = is_eq (succ a₁) (succ b₁), from rfl, - true.intro) diff --git a/old_tests/tests/lean/run/elab_meta1.lean b/old_tests/tests/lean/run/elab_meta1.lean deleted file mode 100644 index 451cf14647..0000000000 --- a/old_tests/tests/lean/run/elab_meta1.lean +++ /dev/null @@ -1,11 +0,0 @@ - -meta definition f : nat → nat -| n := if n / 2 = 0 then n + 1 else f (n / 2) + 1 - -meta definition g : nat × nat → nat -| (0, b) := b -| (a+1, b+1) := g (a/2 - 1, a + b) -| (a+1, 0) := 2*a - -#eval f 200 -#eval g (10, 20) diff --git a/old_tests/tests/lean/run/ematch1.lean b/old_tests/tests/lean/run/ematch1.lean deleted file mode 100644 index 8a5a823ea9..0000000000 --- a/old_tests/tests/lean/run/ematch1.lean +++ /dev/null @@ -1,33 +0,0 @@ -constant f : nat → nat -constant g : nat → nat -axiom Ax : ∀ x, (: f (g x) :) = x - -open tactic - -meta def add_insts : list (expr × expr) → tactic unit -| [] := skip -| ((inst, pr)::r) := do - assertv `_einst inst pr, - add_insts r - -meta def ematch_test (h : name) (e : expr) : tactic unit := -do cc ← cc_state.mk_using_hs, - ems ← return $ ematch_state.mk {}, - hlemma ← hinst_lemma.mk_from_decl h, - (r, cc, ems) ← ematch cc ems hlemma e, - add_insts r - -example (a b c : nat) : f a = b → a = g c → f a ≠ c → false := -by do - intros, - e ← to_expr ```(f a), - ematch_test `Ax e, - trace_state, - cc - -example (a b c : nat) : f a = b → a = g c → f a = c := -by do - intros, - e ← to_expr ```(f a), - ematch_test `Ax e, - cc diff --git a/old_tests/tests/lean/run/ematch2.lean b/old_tests/tests/lean/run/ematch2.lean deleted file mode 100644 index e967184913..0000000000 --- a/old_tests/tests/lean/run/ematch2.lean +++ /dev/null @@ -1,37 +0,0 @@ -namespace foo -universe variables u -variables {α : Type u} - -open tactic - -meta def add_insts : list (expr × expr) → tactic unit -| [] := skip -| ((inst, pr)::r) := do - assertv `_einst inst pr, - add_insts r - -meta def internalize_hs : list expr → ematch_state → tactic ematch_state -| [] s := return s -| (h::hs) s := do t ← infer_type h, s ← s^.internalize t, internalize_hs hs s - -meta def ematch_test (h : name) : tactic unit := -do cc ← cc_state.mk_using_hs, - ctx ← local_context, - ems ← internalize_hs ctx (ematch_state.mk {}), - tgt ← target, - ems ← ems^.internalize tgt, - hlemma ← hinst_lemma.mk_from_decl h, - (r, cc, ems) ← ematch_all cc ems hlemma tt, - add_insts r - -section -variables [add_comm_monoid α] - -theorem add_comm_three (a b c : α) : a + b + c = c + b + a := -begin ematch_test `add_comm, ematch_test `add_assoc, cc end - -theorem add.comm4 : ∀ (n m k l : α), n + m + (k + l) = n + k + (m + l) := -by cc - -end -end foo diff --git a/old_tests/tests/lean/run/ematch_attr_to_defs.lean b/old_tests/tests/lean/run/ematch_attr_to_defs.lean deleted file mode 100644 index 9129af179b..0000000000 --- a/old_tests/tests/lean/run/ematch_attr_to_defs.lean +++ /dev/null @@ -1,35 +0,0 @@ -universe variables u -variable {α : Type u} - -def app : list α → list α → list α -| [] l := l -| (h::t) l := h :: app t l - -/- Mark the app equational lemmas as ematching rules -/ -attribute [ematch] app - -@[ematch] lemma app_nil_right (l : list α) : app l [] = l := -begin [smt] - induction l, - ematch, -end - -@[ematch] lemma app_assoc (l₁ l₂ l₃ : list α) : app (app l₁ l₂) l₃ = app l₁ (app l₂ l₃) := -begin [smt] - induction l₁, - ematch, - ematch -end - -def len : list α → nat -| [] := 0 -| (a :: l) := len l + 1 - -attribute [ematch] len add_zero zero_add - -@[simp] lemma len_app (l₁ l₂ : list α) : len (app l₁ l₂) = len l₁ + len l₂ := -begin [smt] - induction l₁, - {ematch, ematch}, - {ematch, ematch} -end diff --git a/old_tests/tests/lean/run/ematch_loop.lean b/old_tests/tests/lean/run/ematch_loop.lean deleted file mode 100644 index d54b9ddd54..0000000000 --- a/old_tests/tests/lean/run/ematch_loop.lean +++ /dev/null @@ -1,49 +0,0 @@ -constant f : nat → nat -constant p : nat → Prop -/- The following axiom produces a matching loop -/ -axiom fax : ∀ x, f (: f x :) = nat.succ x -axiom px : ∀ x, p x - -attribute [ematch] fax - -set_option trace.smt.ematch true - -lemma ex1 (a b c : nat) : f a = b → p a := -begin [smt] - intros, iterate {ematch}, - ematch_using [px] -end - -constant r : nat → nat → Prop -axiom rtrans : ∀ a b c, r a b → r b c → r a c -attribute [ematch] rtrans - -example (a1 a2 a3 a4 a5 a6 a7 a8 : nat) : - r a1 a2 → r a2 a3 → r a3 a4 → r a4 a5 → r a5 a6 → r a6 a7 → r a7 a8 → r a1 a8 ∨ p 0 := -begin [smt] with {em_cfg := {max_generation := 2}}, - intros, - eblast, -- fails to prove because max_generation is too low - ematch_using [px] -end - -example (a1 a2 a3 a4 a5 a6 a7 a8 : nat) : - r a1 a2 → r a2 a3 → r a3 a4 → r a4 a5 → r a5 a6 → r a6 a7 → r a7 a8 → r a1 a8 := -begin [smt] with {em_cfg := {max_generation := 10}}, - intros, - eblast -- succeeds -end - -attribute [ematch] list.map - -example (f : nat → nat) (l : list nat) : l = [1, 2, 3, 4, 5, 6, 7, 8, 9] → list.map f l = [f 1, f 2, f 3, f 4, f 5, f 6, f 7, f 8, f 9] ∨ p 0 := -begin [smt] with {em_cfg := {max_generation := 5}}, - intros, - eblast, -- fails to prove because max_generation is too low - ematch_using [px] -end - -example (f : nat → nat) (l : list nat) : l = [1, 2, 3, 4, 5, 6, 7, 8, 9] → list.map f l = [f 1, f 2, f 3, f 4, f 5, f 6, f 7, f 8, f 9] := -begin [smt] with {em_cfg := {max_generation := 10}}, - intros, - eblast -- succeeds -end diff --git a/old_tests/tests/lean/run/ematch_partial_apps.lean b/old_tests/tests/lean/run/ematch_partial_apps.lean deleted file mode 100644 index 9c3b6bf7cd..0000000000 --- a/old_tests/tests/lean/run/ematch_partial_apps.lean +++ /dev/null @@ -1,34 +0,0 @@ -open tactic - -set_option trace.smt.ematch true - -example (a : list nat) (f : nat → nat) : a = [1, 2] → a^.map f = [f 1, f 2] := -begin [smt] - intros, - ematch_using [list.map], - ematch_using [list.map], - ematch_using [list.map] -end - -example (a : list nat) (f : nat → nat) : a = [1, 2] → a^.map f = [f 1, f 2] := -begin [smt] - intros, - iterate {ematch_using [list.map], try { close }}, -end - -attribute [ematch] list.map - -example (a : list nat) (f : nat → nat) : a = [1, 2] → a^.map f = [f 1, f 2] := -begin [smt] - intros, eblast -end - -constant f : nat → nat → nat -constant g : nat → nat → nat -axiom fgx : ∀ x y, (: f x :) = (λ y, y) ∧ (: g y :) = λ x, 0 -attribute [ematch] fgx - -example (a b c : nat) : f a b = b ∧ g b c = 0 := -begin [smt] - ematch -end diff --git a/old_tests/tests/lean/run/empty_eq.lean b/old_tests/tests/lean/run/empty_eq.lean deleted file mode 100644 index 68da9fbb3f..0000000000 --- a/old_tests/tests/lean/run/empty_eq.lean +++ /dev/null @@ -1,13 +0,0 @@ -open nat - -inductive Fin : nat → Type -| fz : Π n, Fin (succ n) -| fs : Π {n}, Fin n → Fin (succ n) - -open Fin - -definition case0 {C : Fin 0 → Type} : Π (f : Fin 0), C f -. - - -#print definition case0 diff --git a/old_tests/tests/lean/run/empty_match.lean b/old_tests/tests/lean/run/empty_match.lean deleted file mode 100644 index 51a5a9fe62..0000000000 --- a/old_tests/tests/lean/run/empty_match.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat - -definition not_lt_zero (a : nat) : ¬ a < 0 := -assume H : a < 0, -match H with -end - -#check _root_.not_lt_zero diff --git a/old_tests/tests/lean/run/empty_match_bug.lean b/old_tests/tests/lean/run/empty_match_bug.lean deleted file mode 100644 index 65f8d5d848..0000000000 --- a/old_tests/tests/lean/run/empty_match_bug.lean +++ /dev/null @@ -1,11 +0,0 @@ -open nat - -inductive Fin : nat → Type -| fz : Π n, Fin (succ n) -| fs : Π {n}, Fin n → Fin (succ n) - -open Fin - -definition case0 {C : Fin 0 → Type} (f : Fin 0) : C f := -match f with -end diff --git a/old_tests/tests/lean/run/empty_set_inside_quotations.lean b/old_tests/tests/lean/run/empty_set_inside_quotations.lean deleted file mode 100644 index 22c935037a..0000000000 --- a/old_tests/tests/lean/run/empty_set_inside_quotations.lean +++ /dev/null @@ -1,12 +0,0 @@ -constant union_is_assoc {α} : is_associative (set α) (∪) -attribute [instance] union_is_assoc - -#check ({} : set nat) - -open tactic expr - -meta def is_assoc_bin_app : expr → tactic (expr × expr) -| (app (app op a1) a2) := do h ← to_expr ``(is_associative.assoc %%op), return (op, h) -| _ := failed - -run_cmd to_expr ``(({} : set nat) ∪ {}) >>= is_assoc_bin_app >>= λ p, trace p.2 diff --git a/old_tests/tests/lean/run/emptyc_issue.lean b/old_tests/tests/lean/run/emptyc_issue.lean deleted file mode 100644 index 7c3979d4d2..0000000000 --- a/old_tests/tests/lean/run/emptyc_issue.lean +++ /dev/null @@ -1,4 +0,0 @@ -open tactic - -meta def issue (hs : hinst_lemmas) : tactic unit := -rsimp {} hs diff --git a/old_tests/tests/lean/run/enum.lean b/old_tests/tests/lean/run/enum.lean deleted file mode 100644 index 9e3d4aadef..0000000000 --- a/old_tests/tests/lean/run/enum.lean +++ /dev/null @@ -1,14 +0,0 @@ -inductive Three -| zero : Three -| one : Three -| two : Three - -namespace Three - - theorem disj (a : Three) : a = zero ∨ a = one ∨ a = two := - Three.rec (or.inl rfl) (or.inr (or.inl rfl)) (or.inr (or.inr rfl)) a - - example (a : Three) : a ≠ zero → a ≠ one → a = two := - Three.rec (λ h₁ h₂, absurd rfl h₁) (λ h₁ h₂, absurd rfl h₂) (λ h₁ h₂, rfl) a - -end Three diff --git a/old_tests/tests/lean/run/eq1.lean b/old_tests/tests/lean/run/eq1.lean deleted file mode 100644 index a238f7f10d..0000000000 --- a/old_tests/tests/lean/run/eq1.lean +++ /dev/null @@ -1,16 +0,0 @@ -inductive day -| monday | tuesday | wednesday | thursday | friday | saturday | sunday - -open day - -definition next_weekday : day → day -| monday := tuesday -| tuesday := wednesday -| wednesday := thursday -| thursday := friday -| friday := monday -| saturday := monday -| sunday := monday - -example : next_weekday (next_weekday monday) = wednesday := -rfl diff --git a/old_tests/tests/lean/run/eq10.lean b/old_tests/tests/lean/run/eq10.lean deleted file mode 100644 index a55137b9fd..0000000000 --- a/old_tests/tests/lean/run/eq10.lean +++ /dev/null @@ -1,43 +0,0 @@ - -inductive formula -| eqf : nat → nat → formula -| andf : formula → formula → formula -| impf : formula → formula → formula -| notf : formula → formula -| orf : formula → formula → formula -| allf : (nat → formula) → formula - -namespace formula - definition implies (a b : Prop) : Prop := a → b - - definition denote : formula → Prop - | (eqf n1 n2) := n1 = n2 - | (andf f1 f2) := denote f1 ∧ denote f2 - | (impf f1 f2) := implies (denote f1) (denote f2) - | (orf f1 f2) := denote f1 ∨ denote f2 - | (notf f) := ¬ denote f - | (allf f) := ∀ n : nat, denote (f n) - - theorem denote_eqf (n1 n2 : nat) : denote (eqf n1 n2) = (n1 = n2) := - rfl - - theorem denote_andf (f1 f2 : formula) : denote (andf f1 f2) = (denote f1 ∧ denote f2) := - rfl - - theorem denote_impf (f1 f2 : formula) : denote (impf f1 f2) = (denote f1 → denote f2) := - rfl - - theorem denote_orf (f1 f2 : formula) : denote (orf f1 f2) = (denote f1 ∨ denote f2) := - rfl - - theorem denote_notf (f : formula) : denote (notf f) = ¬ denote f := - rfl - - theorem denote_allf (f : nat → formula) : denote (allf f) = (∀ n, denote (f n)) := - rfl - - example : denote (allf (λ n₁, allf (λ n₂, impf (eqf n₁ n₂) (eqf n₂ n₁)))) = - (∀ n₁ n₂ : nat, n₁ = n₂ → n₂ = n₁) := - rfl - -end formula diff --git a/old_tests/tests/lean/run/eq11.lean b/old_tests/tests/lean/run/eq11.lean deleted file mode 100644 index 185db76bc9..0000000000 --- a/old_tests/tests/lean/run/eq11.lean +++ /dev/null @@ -1,22 +0,0 @@ -inductive day -| monday | tuesday | wednesday | thursday | friday | saturday | sunday - -open day - -definition next_weekday : day → day -| monday := tuesday -| tuesday := wednesday -| wednesday := thursday -| thursday := friday -| _ := monday - -theorem next_weekday_monday : next_weekday monday = tuesday := rfl -theorem next_weekday_tuesday : next_weekday tuesday = wednesday := rfl -theorem next_weekday_wednesday : next_weekday wednesday = thursday := rfl -theorem next_weekday_thursday : next_weekday thursday = friday := rfl -theorem next_weekday_friday : next_weekday friday = monday := rfl -theorem next_weekday_sat : next_weekday saturday = monday := rfl -theorem next_weekday_sunday : next_weekday sunday = monday := rfl - -example : next_weekday (next_weekday monday) = wednesday := -rfl diff --git a/old_tests/tests/lean/run/eq12.lean b/old_tests/tests/lean/run/eq12.lean deleted file mode 100644 index 1c134fec69..0000000000 --- a/old_tests/tests/lean/run/eq12.lean +++ /dev/null @@ -1,22 +0,0 @@ -open nat bool inhabited - -definition diag : bool → bool → bool → nat -| b tt ff := 1 -| ff b tt := 2 -| tt ff b := 3 -| b1 b2 b3 := arbitrary nat - -theorem diag1 (a : bool) : diag a tt ff = 1 := -bool.cases_on a rfl rfl - -theorem diag2 (a : bool) : diag ff a tt = 2 := -bool.cases_on a rfl rfl - -theorem diag3 (a : bool) : diag tt ff a = 3 := -bool.cases_on a rfl rfl - -theorem diag4_1 : diag ff ff ff = arbitrary nat := -rfl - -theorem diag4_2 : diag tt tt tt = arbitrary nat := -rfl diff --git a/old_tests/tests/lean/run/eq13.lean b/old_tests/tests/lean/run/eq13.lean deleted file mode 100644 index 5fdba119f9..0000000000 --- a/old_tests/tests/lean/run/eq13.lean +++ /dev/null @@ -1,16 +0,0 @@ -open nat - -definition f : nat → nat → nat -| n 0 := 0 -| 0 n := 1 -| n m := arbitrary nat - -theorem f_zero_right : ∀ a, f a 0 = 0 -| 0 := rfl -| (succ a) := rfl - -theorem f_zero_succ (a : nat) : f 0 (a+1) = 1 := -rfl - -theorem f_succ_succ (a b : nat) : f (a+1) (b+1) = arbitrary nat := -rfl diff --git a/old_tests/tests/lean/run/eq15.lean b/old_tests/tests/lean/run/eq15.lean deleted file mode 100644 index de98b67232..0000000000 --- a/old_tests/tests/lean/run/eq15.lean +++ /dev/null @@ -1,16 +0,0 @@ -open list - -set_option pp.implicit true - -definition app {A : Type} : list A → list A → list A -| nil l := l -| (h :: t) l := h :: (app t l) - -theorem app_nil {A : Type} (l : list A) : app nil l = l := -rfl - -theorem app_cons {A : Type} (h : A) (t l : list A) : app (h :: t) l = h :: (app t l) := -rfl - -example : app ((1:nat) :: 2 :: nil) (3 :: 4 :: 5 :: nil) = (1 :: 2 :: 3 :: 4 :: 5 :: nil) := -rfl diff --git a/old_tests/tests/lean/run/eq16.lean b/old_tests/tests/lean/run/eq16.lean deleted file mode 100644 index 3e95fa7840..0000000000 --- a/old_tests/tests/lean/run/eq16.lean +++ /dev/null @@ -1,17 +0,0 @@ -open list - -variable {A : Type} -set_option pp.implicit true - -definition app : list A → list A → list A -| nil l := l -| (h :: t) l := h :: (app t l) - -theorem app_nil (l : list A) : app nil l = l := -rfl - -theorem app_cons (h : A) (t l : list A) : app (h :: t) l = h :: (app t l) := -rfl - -example : app ((1:nat) :: 2 :: nil) (3 :: 4 :: 5 :: nil) = (1 :: 2 :: 3 :: 4 :: 5 :: nil) := -rfl diff --git a/old_tests/tests/lean/run/eq17.lean b/old_tests/tests/lean/run/eq17.lean deleted file mode 100644 index 82aada223e..0000000000 --- a/old_tests/tests/lean/run/eq17.lean +++ /dev/null @@ -1,7 +0,0 @@ -open nat -attribute [pattern] lt.base -attribute [pattern] lt.step - -definition lt_of_succ {a : nat} : ∀ {b : nat}, succ a < b → a < b -| .(succ (succ a)) (lt.base .(succ a)) := nat.lt_trans (lt.base a) (lt.base (succ a)) -| .(succ b) (@lt.step .(succ a) b h) := lt.step (lt_of_succ h) diff --git a/old_tests/tests/lean/run/eq2.lean b/old_tests/tests/lean/run/eq2.lean deleted file mode 100644 index 63b0dbf689..0000000000 --- a/old_tests/tests/lean/run/eq2.lean +++ /dev/null @@ -1,7 +0,0 @@ -namespace test -definition symm {A : Type} : Π {a b : A}, a = b → b = a -| a .(a) rfl := rfl - -definition trans {A : Type} : Π {a b c : A}, a = b → b = c → a = c -| a .(a) .(a) rfl rfl := rfl -end test diff --git a/old_tests/tests/lean/run/eq20.lean b/old_tests/tests/lean/run/eq20.lean deleted file mode 100644 index 952639ac54..0000000000 --- a/old_tests/tests/lean/run/eq20.lean +++ /dev/null @@ -1,28 +0,0 @@ -open nat list - -section - parameter {A : Type} - parameter (p : A → Prop) - parameter [H : decidable_pred p] - include H - - definition filter : list A → list A - | nil := nil - | (a :: l) := if p a then a :: filter l else filter l - - theorem filter_nil : filter nil = nil := - rfl - - theorem filter_cons (a : A) (l : list A) : filter (a :: l) = if p a then a :: filter l else filter l := - rfl - - theorem filter_cons_of_pos {a : A} (l : list A) (h : p a) : filter (a :: l) = a :: filter l := - (if_pos h : (if p a then a :: filter l else filter l) = a :: filter l) ▸ filter_cons a l - - theorem filter_cons_of_neg {a : A} (l : list A) (h : ¬ p a) : filter (a :: l) = filter l := - (if_neg h : (if p a then a :: filter l else filter l) = filter l) ▸ filter_cons a l -end - -#check @_root_.filter -#check @_root_.filter_cons_of_pos -#check @_root_.filter_cons_of_neg diff --git a/old_tests/tests/lean/run/eq21.lean b/old_tests/tests/lean/run/eq21.lean deleted file mode 100644 index 141a9c3571..0000000000 --- a/old_tests/tests/lean/run/eq21.lean +++ /dev/null @@ -1,16 +0,0 @@ - -inductive formula -| eqf : nat → nat → formula -| impf : formula → formula → formula - -namespace formula - definition denote : formula → Prop - | (eqf n1 n2) := n1 = n2 - | (impf f1 f2) := denote f1 → denote f2 - - theorem denote_eqf (n1 n2 : nat) : denote (eqf n1 n2) = (n1 = n2) := - rfl - - theorem denote_impf (f1 f2 : formula) : denote (impf f1 f2) = (denote f1 → denote f2) := - rfl -end formula diff --git a/old_tests/tests/lean/run/eq22.lean b/old_tests/tests/lean/run/eq22.lean deleted file mode 100644 index 1ea1a5daf3..0000000000 --- a/old_tests/tests/lean/run/eq22.lean +++ /dev/null @@ -1,8 +0,0 @@ -open list - -definition head {A : Type} : Π (l : list A), l ≠ nil → A -| nil h := absurd rfl h -| (a :: l) h := a - -theorem head_cons {A : Type} (a : A) (l : list A) (h : a :: l ≠ nil) : head (a :: l) h = a := -rfl diff --git a/old_tests/tests/lean/run/eq25.lean b/old_tests/tests/lean/run/eq25.lean deleted file mode 100644 index ca08ec8aa0..0000000000 --- a/old_tests/tests/lean/run/eq25.lean +++ /dev/null @@ -1,11 +0,0 @@ -inductive N -| O : N -| S : N → N - -definition Nat := N - -open N - -definition add1 : Nat → Nat → Nat -| O b := b -| (S a) b := S (add1 a b) diff --git a/old_tests/tests/lean/run/eq4.lean b/old_tests/tests/lean/run/eq4.lean deleted file mode 100644 index 1298764aaa..0000000000 --- a/old_tests/tests/lean/run/eq4.lean +++ /dev/null @@ -1,21 +0,0 @@ -open nat - -definition half : nat → nat -| 0 := 0 -| 1 := 0 -| (x+2) := half x + 1 - -theorem half0 : half 0 = 0 := -rfl - -theorem half1 : half 1 = 0 := -rfl - -theorem half_succ_succ (a : nat) : half (a + 2) = half a + 1 := -rfl - -example : half 5 = 2 := -rfl - -example : half 8 = 4 := -rfl diff --git a/old_tests/tests/lean/run/eq5.lean b/old_tests/tests/lean/run/eq5.lean deleted file mode 100644 index 77f9f9a7a8..0000000000 --- a/old_tests/tests/lean/run/eq5.lean +++ /dev/null @@ -1,18 +0,0 @@ -open nat - -definition fib : nat → nat -| 0 := 1 -| 1 := 1 -| (x+2) := fib x + fib (x+1) - -theorem fib0 : fib 0 = 1 := -rfl - -theorem fib1 : fib 1 = 1 := -rfl - -theorem fib_succ_succ (a : nat) : fib (a+2) = fib a + fib (a+1) := -rfl - -example : fib 8 = 34 := -rfl diff --git a/old_tests/tests/lean/run/eq6.lean b/old_tests/tests/lean/run/eq6.lean deleted file mode 100644 index 66ac3d0838..0000000000 --- a/old_tests/tests/lean/run/eq6.lean +++ /dev/null @@ -1,14 +0,0 @@ -open list - -definition appd {A : Type} : list A → list A → list A -| nil l := l -| (h :: t) l := h :: (appd t l) - -theorem appd_nil {A : Type} (l : list A) : appd nil l = l := -rfl - -theorem appd_cons {A : Type} (h : A) (t l : list A) : appd (h :: t) l = h :: (appd t l) := -rfl - -example : appd ((1:nat) :: 2 :: nil) (3 :: 4 :: 5 :: nil) = (1 :: 2 :: 3 :: 4 :: 5 :: nil) := -rfl diff --git a/old_tests/tests/lean/run/eq9.lean b/old_tests/tests/lean/run/eq9.lean deleted file mode 100644 index 40f62820b3..0000000000 --- a/old_tests/tests/lean/run/eq9.lean +++ /dev/null @@ -1,7 +0,0 @@ -open nat -attribute [pattern] lt.base -attribute [pattern] lt.step - -theorem lt_succ {a : nat} : ∀ {b : nat}, a < b → succ a < succ b -| .(succ a) (lt.base .(a)) := lt.base (succ a) -| .(succ b) (@lt.step .(a) b h) := lt.step (lt_succ h) diff --git a/old_tests/tests/lean/run/eq_cases_on.lean b/old_tests/tests/lean/run/eq_cases_on.lean deleted file mode 100644 index 1cfa9a4dc4..0000000000 --- a/old_tests/tests/lean/run/eq_cases_on.lean +++ /dev/null @@ -1,5 +0,0 @@ -def g {n m : nat} (v : array (n + m) nat) : array (m + n) nat := -eq.rec_on (add_comm n m) v -- Worked before - -def f {n m : nat} (v : array (n + m) nat) : array (m + n) nat := -eq.cases_on (add_comm n m) v -- eq.cases_on was not being erased diff --git a/old_tests/tests/lean/run/eq_mpr_def_issue.lean b/old_tests/tests/lean/run/eq_mpr_def_issue.lean deleted file mode 100644 index c9383d33d6..0000000000 --- a/old_tests/tests/lean/run/eq_mpr_def_issue.lean +++ /dev/null @@ -1,4 +0,0 @@ -open function - -instance decidable_uncurry_pred{α} (p : α → α → Prop) [decidable_rel p] : decidable_pred (uncurry p) := -λ a, by { cases a; simp [uncurry]; apply_instance } diff --git a/old_tests/tests/lean/run/eqn_compiler_perf_issue.lean b/old_tests/tests/lean/run/eqn_compiler_perf_issue.lean deleted file mode 100644 index 87c50af86a..0000000000 --- a/old_tests/tests/lean/run/eqn_compiler_perf_issue.lean +++ /dev/null @@ -1,15 +0,0 @@ -def mk (a : nat) : nat → list nat -| 0 := [] -| (nat.succ n) := a :: mk n - -def Sum : list nat → nat → nat -| [] r := r -| (n::ns) r := Sum ns (r + n) - -def loop1 : nat → nat → nat -| s 0 := s -| s (nat.succ n) := loop1 (s + (Sum (mk 1 1000000) 0)) n - -def loop2 : nat → nat → nat -| 0 s := s -| (nat.succ n) s := loop2 n (s + (Sum (mk 1 1000000) 0)) diff --git a/old_tests/tests/lean/run/eqn_compiler_perf_issue2.lean b/old_tests/tests/lean/run/eqn_compiler_perf_issue2.lean deleted file mode 100644 index c71bf7da10..0000000000 --- a/old_tests/tests/lean/run/eqn_compiler_perf_issue2.lean +++ /dev/null @@ -1,11 +0,0 @@ -def expensive (n : ℕ) : ℕ := 100000000000000 - 100000000000000 - -def foo : ℕ → ℕ | n := -expensive n - -#print foo -#print foo._main - -def bla : ℕ → ℕ -| 100 := expensive 0 -| _ := expensive 1 diff --git a/old_tests/tests/lean/run/eqn_compiler_variable_or_inaccessible.lean b/old_tests/tests/lean/run/eqn_compiler_variable_or_inaccessible.lean deleted file mode 100644 index 87fc7872e6..0000000000 --- a/old_tests/tests/lean/run/eqn_compiler_variable_or_inaccessible.lean +++ /dev/null @@ -1,4 +0,0 @@ -example {α : Type} {p q : α → Prop} {x : α} (h : ∀ y, p y → q y) (hx : q x) : - ∀ y, x = y ∨ p y → q y -| x (or.inr p) := h x p -| ._ (or.inl rfl) := hx diff --git a/old_tests/tests/lean/run/eqn_issue.lean b/old_tests/tests/lean/run/eqn_issue.lean deleted file mode 100644 index c1ba39156f..0000000000 --- a/old_tests/tests/lean/run/eqn_issue.lean +++ /dev/null @@ -1,7 +0,0 @@ -universe variable u -variable {α : Type u} - -def split : list α → list α × list α -| [] := ([], []) -| [a] := ([a], []) -| (a :: b :: l) := (a :: (split l).1, b :: (split l).2) diff --git a/old_tests/tests/lean/run/eqn_preprocessor1.lean b/old_tests/tests/lean/run/eqn_preprocessor1.lean deleted file mode 100644 index b91f7b20f7..0000000000 --- a/old_tests/tests/lean/run/eqn_preprocessor1.lean +++ /dev/null @@ -1,58 +0,0 @@ -open nat - -inductive Vec (A : Type) : nat → Type -| nil {} : Vec 0 -| cons : Π {n}, A → Vec n → Vec (succ n) - -open Vec - -def append1 {A : Type} : Π {m n : nat}, Vec A m -> Vec A n -> Vec A (n + m) -| _ m nil ys := ys -| _ m (cons x xs) ys := cons x (append1 xs ys) - -def append2 {A : Type} : Π {m n : nat}, Vec A m -> Vec A n -> Vec A (n + m) -| _ _ nil ys := ys -| _ _ (cons x xs) ys := cons x (append2 xs ys) - -def append3 {A : Type} : Π {m n : nat}, Vec A m -> Vec A n -> Vec A (n + m) -| ._ m nil ys := ys -| ._ m (cons x xs) ys := cons x (append1 xs ys) - - -inductive Fin : nat → Type -| fzero : Π {n}, Fin (nat.succ n) - -open Fin - -def fmin1 : Π {n : nat} (x y : Fin n), Fin n -| ._ fzero fzero := fzero - -def fmin2 : Π {n : nat} (x y : Fin n), Fin n -| _ fzero fzero := fzero - -def fmin3 : Π {n : nat} (x y : Fin n), Fin n -| n fzero fzero := fzero - -def fmin4 : Π {n : nat} (x y : Fin n), Fin n -| .(succ n) (@fzero n) (@fzero .(n)) := fzero - -def fmin5 : Π {n : nat} (x y : Fin n), Fin n -| .(succ n) (@fzero .(n)) (@fzero n) := fzero - -def fmin6 : Π {n : nat} (x y : Fin n), Fin n -| .(succ _) fzero fzero := fzero - -example (n : nat) (x y : Fin n) : fmin1 x y = fmin2 x y := -begin cases x, cases y, refl end - -example (n : nat) (x y : Fin n) : fmin1 x y = fmin3 x y := -begin cases x, cases y, refl end - -example (n : nat) (x y : Fin n) : fmin1 x y = fmin4 x y := -begin cases x, cases y, refl end - -example (n : nat) (x y : Fin n) : fmin1 x y = fmin5 x y := -begin cases x, cases y, refl end - -example (n : nat) (x y : Fin n) : fmin1 x y = fmin6 x y := -begin cases x, cases y, refl end diff --git a/old_tests/tests/lean/run/eqn_value_issue.lean b/old_tests/tests/lean/run/eqn_value_issue.lean deleted file mode 100644 index 9c4c49b506..0000000000 --- a/old_tests/tests/lean/run/eqn_value_issue.lean +++ /dev/null @@ -1,17 +0,0 @@ -def f : nat -> nat -| 1 := 1 -| 2000 := 2 -| _ := 3 - -#check f.equations._eqn_1 -#check f.equations._eqn_2 -#check f.equations._eqn_3 - -def g : nat -> nat -| 0 := 1 -| 2000 := 2 -| _ := 3 - -#check g.equations._eqn_1 -#check g.equations._eqn_2 -#check g.equations._eqn_3 diff --git a/old_tests/tests/lean/run/equation_with_values.lean b/old_tests/tests/lean/run/equation_with_values.lean deleted file mode 100644 index 1bb5e44235..0000000000 --- a/old_tests/tests/lean/run/equation_with_values.lean +++ /dev/null @@ -1,51 +0,0 @@ -def f : char → nat -| 'a' := 0 -| 'b' := 1 -| 'c' := 2 -| 'd' := 3 -| 'e' := 4 -| _ := 5 - -#check f.equations._eqn_1 -#check f.equations._eqn_2 -#check f.equations._eqn_3 -#check f.equations._eqn_4 -#check f.equations._eqn_5 -#check f.equations._eqn_6 - -def g : nat → nat -| 100000 := 0 -| 200000 := 1 -| 300000 := 2 -| 400000 := 3 -| _ := 5 - -#check g.equations._eqn_1 -#check g.equations._eqn_2 -#check g.equations._eqn_3 -#check g.equations._eqn_4 -#check g.equations._eqn_5 - -def h : string → nat -| "hello" := 0 -| "world" := 1 -| "bla" := 2 -| "boo" := 3 -| _ := 5 - -#check h.equations._eqn_1 -#check h.equations._eqn_2 -#check h.equations._eqn_3 -#check h.equations._eqn_4 -#check h.equations._eqn_5 - -def r : string × string → nat -| ("hello", "world") := 0 -| ("world", "hello") := 1 -| _ := 2 - -#check r.equations._eqn_1 -#check r.equations._eqn_2 -#check r.equations._eqn_3 -#check r.equations._eqn_4 -#check r.equations._eqn_5 diff --git a/old_tests/tests/lean/run/eval_attr_cache.lean b/old_tests/tests/lean/run/eval_attr_cache.lean deleted file mode 100644 index 0ecd8a5fd2..0000000000 --- a/old_tests/tests/lean/run/eval_attr_cache.lean +++ /dev/null @@ -1,24 +0,0 @@ -open tactic -@[user_attribute] -meta def my_attr : user_attribute (name → bool) := -{ name := "my_attr", - descr := "my attr", - cache_cfg := { - mk_cache := λ ls, do { - let c := `(λ n : name, (name.cases_on n ff (λ _ _, to_bool (n ∈ ls)) (λ _ _, ff) : bool)), - eval_expr (name → bool) c - }, - dependencies := []} -} - -meta def my_tac : tactic unit := -do f ← my_attr.get_cache, - trace (f `foo), - return () - -@[my_attr] def bla := 10 -run_cmd my_tac -@[my_attr] def foo := 10 -- Cache was invalided - -run_cmd my_tac -- Add closure to the cache containing auxiliary function created by eval_expr -run_cmd my_tac -- Cache should be flushed since the auxiliary function is gone diff --git a/old_tests/tests/lean/run/eval_constant.lean b/old_tests/tests/lean/run/eval_constant.lean deleted file mode 100644 index f5dd5f289e..0000000000 --- a/old_tests/tests/lean/run/eval_constant.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -run_cmd do - e ← to_expr ``(nat.add), - fn ← eval_expr (nat → nat → nat) e, - trace (fn 10 20) - -run_cmd do - e ← to_expr ``(λ x y : nat, x + x + y), - fn ← eval_expr (nat → nat → nat) e, - trace (fn 10 20) diff --git a/old_tests/tests/lean/run/eval_expr_bug.lean b/old_tests/tests/lean/run/eval_expr_bug.lean deleted file mode 100644 index 4002e3d6b0..0000000000 --- a/old_tests/tests/lean/run/eval_expr_bug.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic - -meta def a : nat := 10 - -run_cmd eval_expr nat (expr.const `a []) -run_cmd eval_expr nat (expr.const `a []) >>= trace diff --git a/old_tests/tests/lean/run/eval_expr_partial.lean b/old_tests/tests/lean/run/eval_expr_partial.lean deleted file mode 100644 index f02925ed45..0000000000 --- a/old_tests/tests/lean/run/eval_expr_partial.lean +++ /dev/null @@ -1,3 +0,0 @@ -open tactic - -run_cmd to_expr ``(bit0 1) >>= eval_expr nat >>= tactic.trace diff --git a/old_tests/tests/lean/run/even_odd.lean b/old_tests/tests/lean/run/even_odd.lean deleted file mode 100644 index fb70ceaa13..0000000000 --- a/old_tests/tests/lean/run/even_odd.lean +++ /dev/null @@ -1,20 +0,0 @@ -mutual def even, odd -with even : nat → bool -| 0 := tt -| (a+1) := odd a -with odd : nat → bool -| 0 := ff -| (a+1) := even a - -example (a : nat) : even (a + 1) = odd a := -by simp [even] - -example (a : nat) : odd (a + 1) = even a := -by simp [odd] - -lemma even_eq_not_odd : ∀ a, even a = bnot (odd a) := -begin - intro a, induction a, - simp [even, odd], - simp [*, even, odd] -end diff --git a/old_tests/tests/lean/run/even_odd2.lean b/old_tests/tests/lean/run/even_odd2.lean deleted file mode 100644 index de89ba850e..0000000000 --- a/old_tests/tests/lean/run/even_odd2.lean +++ /dev/null @@ -1,21 +0,0 @@ -mutual def even, odd -with even : nat → bool -| 0 := tt -| (a+1) := odd a -with odd : nat → bool -| 0 := ff -| (a+1) := even a -using_well_founded {rel_tac := λ f eqns, tactic.trace f >> tactic.trace eqns >> tactic.apply_instance} - -example (a : nat) : even (a + 1) = odd a := -by simp [even] - -example (a : nat) : odd (a + 1) = even a := -by simp [odd] - -lemma even_eq_not_odd : ∀ a, even a = bnot (odd a) := -begin - intro a, induction a, - simp [even, odd], - simp [*, even, odd] -end diff --git a/old_tests/tests/lean/run/even_perf.lean b/old_tests/tests/lean/run/even_perf.lean deleted file mode 100644 index 04a5f9a3d1..0000000000 --- a/old_tests/tests/lean/run/even_perf.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -def even : nat → bool -| 0 := tt -| (succ 0) := ff -| (succ (succ n)) := even n - -#eval even 0 -#eval even 1 -#eval even 2 -#eval even 10000 -#eval even 10001 diff --git a/old_tests/tests/lean/run/ex.lean b/old_tests/tests/lean/run/ex.lean deleted file mode 100644 index 4d1dabcafe..0000000000 --- a/old_tests/tests/lean/run/ex.lean +++ /dev/null @@ -1,3 +0,0 @@ -set_option pp.implicit true -#check ∃x, x = (0:nat) -#check ∃x:nat, x = 0 diff --git a/old_tests/tests/lean/run/exact_perf.lean b/old_tests/tests/lean/run/exact_perf.lean deleted file mode 100644 index c72ca926bf..0000000000 --- a/old_tests/tests/lean/run/exact_perf.lean +++ /dev/null @@ -1,13 +0,0 @@ -open nat - -def f (a : nat) : nat := a -def g (a : nat) : nat := a -constant p : nat → Prop - -example (a b : nat) (h1 : false) (h2 : p (g (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f a))))))))))))))))))))))))))))))) : -p (g (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f (f b))))))))))))))))))))))))))))))) -:= -begin - try {exact h2}, - contradiction -end diff --git a/old_tests/tests/lean/run/exact_tac1.lean b/old_tests/tests/lean/run/exact_tac1.lean deleted file mode 100644 index 5b061055ff..0000000000 --- a/old_tests/tests/lean/run/exact_tac1.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic list - -example (a b : nat) : a = a := -by do - a ← get_local `a, - r ← mk_app `eq.refl [a], - exact r - -set_option pp.all true - -example (a b : nat) (f : nat → nat) : a = b → f a = f b := -by do - intro `H, - H ← get_local `H, - f ← get_local `f, - r ← mk_app `congr_arg [f, H], - trace r, - exact r diff --git a/old_tests/tests/lean/run/example1.lean b/old_tests/tests/lean/run/example1.lean deleted file mode 100644 index 60837c5ba2..0000000000 --- a/old_tests/tests/lean/run/example1.lean +++ /dev/null @@ -1,12 +0,0 @@ -inductive day -| monday | tuesday | wednesday | thursday | friday | saturday | sunday - -namespace day - - definition next_weekday (d : day) : day := - day.rec_on d tuesday wednesday thursday friday monday monday monday - - example : next_weekday (next_weekday saturday) = tuesday := - rfl - -end day diff --git a/old_tests/tests/lean/run/exfalso1.lean b/old_tests/tests/lean/run/exfalso1.lean deleted file mode 100644 index e7637709c2..0000000000 --- a/old_tests/tests/lean/run/exfalso1.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic nat - -example (a b : nat) : a = 0 → b = 1 → a = b → a + b * b ≤ 10000 := -by do - intro_lst [`a0, `a1, `ab], - exfalso, - trace_state, - get_local `a >>= subst, - get_local `b >>= subst, - trace_state, - contradiction diff --git a/old_tests/tests/lean/run/exhaustive_vm_impl_test.lean b/old_tests/tests/lean/run/exhaustive_vm_impl_test.lean deleted file mode 100644 index 3eeca35c0b..0000000000 --- a/old_tests/tests/lean/run/exhaustive_vm_impl_test.lean +++ /dev/null @@ -1,127 +0,0 @@ -instance nat.decidable_ball (p : ℕ → Prop) [∀ i, decidable (p i)] : ∀ n, decidable (∀ x < n, p x) -| 0 := decidable.is_true begin intros n h, cases h end -| (n+1) := - match nat.decidable_ball n with - | (decidable.is_false h) := - decidable.is_false begin - intro h2, apply h, - intros x hx, apply h2, - apply nat.le_succ_of_le, - assumption, - end - | (decidable.is_true h) := - if h' : p n then - decidable.is_true begin - intros x hx, cases hx, - {assumption}, - {apply h, assumption}, - end - else - decidable.is_false begin - intro hpx, - apply h', apply hpx, - constructor, - end - end - -open expr tactic - -instance decidable_dec_eq (p) : decidable_eq (decidable p) := -by mk_dec_eq_instance - -@[irreducible] -def is_ok {α : Type} [decidable_eq α] (a : α) : Prop := a = a - -meta def get_const_def : expr → tactic expr -| (const c ls) := do - d ← get_decl c, - some v ← return $ d.instantiate_value_univ_params ls - | fail $ "unknown declaration " ++ to_string c, - return v -| _ := fail "get_const_def applied to non-constant" - -@[reducible] -def {u} is_ok_handler (msg : thunk string) {α : Sort u} [decidable_eq α] (a b : α) : Prop := -(if a = b then tt else trace (msg ()) ff : bool) - -meta def mk_msg : list expr → tactic expr -| [] := return `("") -| (e::es) := (do - let label := if e.is_local_constant then e.local_pp_name else `_, - let label := label.to_string ++ "=", - e' ← to_expr ``(to_string %%e), - es' ← mk_msg es, - return `(%%(reflect label) ++ %%e' ++ " " ++ %%es')) -<|> mk_msg es - -meta def mk_checker_core : list expr → expr → tactic expr -| hs `(@is_ok %%α %%h %%a) := do - v ← get_const_def (get_app_fn a), - let lhs := a, - let rhs := app_of_list v (get_app_args a), - msg ← mk_msg (hs ++ [lhs,rhs]), - to_expr ``(@is_ok_handler (λ _, %%msg) %%α %%h %%lhs %%rhs) -| hs (pi ppn bi dom b) := do - x ← mk_local' ppn bi dom, - b' ← mk_checker_core (hs ++ [x]) (b.instantiate_var x), - return (pis [x] b') -| hs e := do e' ← pp e, fail $ to_fmt "mk_checker: unknown expression" ++ e' - -meta def mk_checker := mk_checker_core [] - -meta def verify (p : Prop) [rp : reflected p] : tactic unit := do -prove_goal_async $ do -checker ← mk_checker rp, -program ← to_expr ``(%%checker : bool), -all_true ← eval_expr bool program, -triv, -when (¬ all_true) (do - p' ← pp rp, - fail $ to_fmt "verify failed on: " ++ p'), -trace "verified" - -run_cmd verify $ ∀ x < 50, ∀ y < 50, is_ok $ nat.add x y -run_cmd verify $ ∀ x < 10, ∀ y < 10, is_ok $ nat.mul x y -run_cmd verify $ ∀ x < 50, ∀ y < 50, is_ok $ nat.sub x y -run_cmd verify $ ∀ x < 50, ∀ y < 50, is_ok $ nat.div x y -run_cmd verify $ ∀ x < 100, ∀ y < 100, is_ok $ nat.mod x y -run_cmd verify $ ∀ x < 100, ∀ y < 100, is_ok $ nat.gcd x y -run_cmd verify $ ∀ x < 50, ∀ y < 50, is_ok $ nat.decidable_eq x y -run_cmd verify $ ∀ x < 50, ∀ y < 50, is_ok $ nat.decidable_le x y -run_cmd verify $ ∀ x < 50, ∀ y < 50, is_ok $ nat.decidable_lt x y -run_cmd verify $ ∀ x < 200, is_ok $ nat.repr x -run_cmd verify $ ∀ x < 200, is_ok $ nat.bodd x -run_cmd verify $ ∀ x < 200, is_ok $ nat.div2 x -run_cmd verify $ ∀ x < 200, is_ok $ nat.bodd_div2 x -run_cmd verify $ ∀ x < 100, ∀ y < 40, is_ok $ nat.shiftl x y -run_cmd verify $ ∀ x < 100, ∀ y < 100, is_ok $ nat.shiftr x y -run_cmd verify $ ∀ x < 30, ∀ y < 30, is_ok $ nat.lor x y -run_cmd verify $ ∀ x < 30, ∀ y < 30, is_ok $ nat.land x y -run_cmd verify $ ∀ x < 30, ∀ y < 30, is_ok $ nat.ldiff x y -run_cmd verify $ ∀ x < 30, ∀ y < 30, is_ok $ nat.lxor x y -run_cmd verify $ ∀ x < 100, ∀ y < 10, is_ok $ nat.test_bit x y - -def ints : list ℤ := -(do i ← list.range 40, [-i, i]) ++ -(do s ← [-1,1], j ← list.range 20, [s*(2^31:nat) + j-10]) - -def small_ints : list ℤ := -(do i ← list.range 40, [-i, i]) - -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.add x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.mul x y -run_cmd verify $ ∀ x ∈ ints, is_ok $ int.neg x -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.quot x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.rem x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.gcd x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.decidable_eq x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.decidable_le x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.decidable_lt x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ small_ints, is_ok $ int.shiftl x y - -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.lor x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.land x y -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.ldiff x y -run_cmd verify $ ∀ x ∈ ints, is_ok $ int.lnot x -run_cmd verify $ ∀ x ∈ ints, ∀ y ∈ ints, is_ok $ int.lxor x y -run_cmd verify $ ∀ x ∈ ints, ∀ y < 10, is_ok $ int.test_bit x y diff --git a/old_tests/tests/lean/run/exists_intro1.lean b/old_tests/tests/lean/run/exists_intro1.lean deleted file mode 100644 index 4745b6a4bd..0000000000 --- a/old_tests/tests/lean/run/exists_intro1.lean +++ /dev/null @@ -1,35 +0,0 @@ -example : ∃ x : nat, x = x := -Exists.intro 0 rfl - -example : ∃ x : nat, x = x := -exists.intro 0 rfl - -lemma ex1 : ∃ x : nat, x = x := -Exists.intro 0 rfl - -lemma ex2 : ∃ x : nat, x = x := -exists.intro 0 rfl - -lemma ex3 : ∃ x y : nat, x = y := -exists.intro 0 (exists.intro 0 rfl) - -lemma ex4 : ∃ x y : nat, x = y + 1 := -exists.intro 1 (exists.intro 0 rfl) - -lemma ex5 : ∃ x y z : nat, x = y + z := -exists.intro 1 (exists.intro 1 (exists.intro 0 rfl)) - -lemma ex6 : ∃ x : nat, x = x := -⟨0, rfl⟩ - -lemma ex7 : ∃ x y z : nat, x = y + z := -⟨1, 1, 0, rfl⟩ - -lemma ex8 : ∃ x y z : nat, x = y + z := -(| 1, 1, 0, rfl |) - -example : ∃ x : nat, x = x := -⟨0, rfl⟩ - -example : ∃ x y z : nat, x = y + z := -⟨1, 1, 0, rfl⟩ diff --git a/old_tests/tests/lean/run/export.lean b/old_tests/tests/lean/run/export.lean deleted file mode 100644 index b86c085248..0000000000 --- a/old_tests/tests/lean/run/export.lean +++ /dev/null @@ -1,11 +0,0 @@ -constants a b : nat - -namespace boo - export nat (rec add) - #check a + b - #check nat.add -end boo - -open boo -#check a + b -#check nat.rec diff --git a/old_tests/tests/lean/run/export2.lean b/old_tests/tests/lean/run/export2.lean deleted file mode 100644 index 3472483fa0..0000000000 --- a/old_tests/tests/lean/run/export2.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -definition foo : nat := 30 - -namespace foo - definition x : nat := 10 - definition y : nat := 20 -end foo - -export foo - -example : x + y = foo := rfl diff --git a/old_tests/tests/lean/run/extend_local_ref.lean b/old_tests/tests/lean/run/extend_local_ref.lean deleted file mode 100644 index c7ced77571..0000000000 --- a/old_tests/tests/lean/run/extend_local_ref.lean +++ /dev/null @@ -1,17 +0,0 @@ -section -universe u - -structure a := -(a : Type u) - -structure b extends a -end - -section -parameter α : Type - -structure c := -(a : α) - -structure d extends c -end diff --git a/old_tests/tests/lean/run/fib_wrec.lean b/old_tests/tests/lean/run/fib_wrec.lean deleted file mode 100644 index 9272cf85c0..0000000000 --- a/old_tests/tests/lean/run/fib_wrec.lean +++ /dev/null @@ -1,33 +0,0 @@ -open nat - -definition fib.F (n : nat) : (Π (m : nat), m < n → nat) → nat := -nat.cases_on n - (λ (f : Π (m : nat), m < 0 → nat), succ 0) - (λ (n₁ : nat), nat.cases_on n₁ - (λ (f : Π (m : nat), m < (succ 0) → nat), succ 0) - (λ (n₂ : nat) (f : Π (m : nat), m < (succ (succ n₂)) → nat), - have l₁ : succ n₂ < succ (succ n₂), from lt_succ_self (succ n₂), - have l₂ : n₂ < succ (succ n₂), from nat.lt_trans (lt_succ_self n₂) l₁, - f (succ n₂) l₁ + f n₂ l₂)) - -definition fib (n : nat) := -well_founded.fix lt_wf fib.F n - -theorem fib.zero_eq : fib 0 = 1 := -well_founded.fix_eq lt_wf fib.F 0 - -theorem fib.one_eq : fib 1 = 1 := -well_founded.fix_eq lt_wf fib.F 1 - -theorem fib.succ_succ_eq (n : nat) : fib (succ (succ n)) = fib (succ n) + fib n := -well_founded.fix_eq lt_wf fib.F (succ (succ n)) - -example : fib 5 = 8 := -rfl - -example : fib 6 = 13 := -rfl - -#print "------------" -#reduce fib 10 -#eval fib 10 diff --git a/old_tests/tests/lean/run/find.lean b/old_tests/tests/lean/run/find.lean deleted file mode 100644 index d520a6b23f..0000000000 --- a/old_tests/tests/lean/run/find.lean +++ /dev/null @@ -1,4 +0,0 @@ -open nat - -lemma aux : ∃ x : nat, x > 10 := -exists.intro 15 dec_trivial diff --git a/old_tests/tests/lean/run/fingerprint.lean b/old_tests/tests/lean/run/fingerprint.lean deleted file mode 100644 index 8296af5ea9..0000000000 --- a/old_tests/tests/lean/run/fingerprint.lean +++ /dev/null @@ -1,36 +0,0 @@ -open tactic -meta def nat.to_expr (n : nat) : expr := reflect n -run_cmd attribute.fingerprint `reducible >>= trace - -definition ex0 : nat := -by nat.to_expr <$> attribute.fingerprint `reducible >>= exact - -attribute [reducible] -definition f : nat := 10 - -run_cmd attribute.fingerprint `reducible >>= trace - -definition ex1 : nat := -by nat.to_expr <$> attribute.fingerprint `reducible >>= exact - -#eval ex1 - -definition g : nat := 20 - -run_cmd attribute.fingerprint `reducible >>= trace - -definition ex2 : nat := -by nat.to_expr <$> attribute.fingerprint `reducible >>= exact - -#eval ex2 - -example : ex1 = ex2 := -rfl - -definition h : nat := 20 - -definition ex3 : nat := -by nat.to_expr <$> attribute.fingerprint `reducible >>= exact - -example : ex1 = ex3 := -rfl diff --git a/old_tests/tests/lean/run/fn_default.lean b/old_tests/tests/lean/run/fn_default.lean deleted file mode 100644 index a7036865aa..0000000000 --- a/old_tests/tests/lean/run/fn_default.lean +++ /dev/null @@ -1,6 +0,0 @@ -structure foo := -(bar : Π n : ℕ, ℕ := id) -(baz : Π {n : ℕ}, ℕ := id) -(bat : Π n : ℕ, ℕ := λ n, n) - -#check {foo.} diff --git a/old_tests/tests/lean/run/focus.lean b/old_tests/tests/lean/run/focus.lean deleted file mode 100644 index 2032cfa07d..0000000000 --- a/old_tests/tests/lean/run/focus.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat -example (n m : ℕ) : n + m = m + n := -begin - induction m with m IHm, - focus { induction n with n IHn, - focus { reflexivity }, - focus { exact congr_arg succ IHn }}, - focus { apply eq.trans (congr_arg succ IHm), - clear IHm, induction n with n IHn, - focus { reflexivity }, - focus { exact congr_arg succ IHn }} -end \ No newline at end of file diff --git a/old_tests/tests/lean/run/format.lean b/old_tests/tests/lean/run/format.lean deleted file mode 100644 index 4d02e0d295..0000000000 --- a/old_tests/tests/lean/run/format.lean +++ /dev/null @@ -1,6 +0,0 @@ -import system.io -open list - -#eval pp ([["aaa", "bbb", "ccc", "dddd", "eeeeee", "ffffff"], ["aaa", "bbb", "ccc", "dddd", "eeeeee", "ffffff"], - ["aaa", "bbb", "ccc", "dddd", "eeeeee", "ffffff"], ["aaa", "bbb", "ccc", "dddd", "eeeeee", "ffffff"]], - [(10:nat), 20, 30]) diff --git a/old_tests/tests/lean/run/full.lean b/old_tests/tests/lean/run/full.lean deleted file mode 100644 index 351a2a875c..0000000000 --- a/old_tests/tests/lean/run/full.lean +++ /dev/null @@ -1,7 +0,0 @@ -namespace foo - constant x : nat - #check x - #check x - set_option pp.full_names true - #check x -end foo diff --git a/old_tests/tests/lean/run/fun.lean b/old_tests/tests/lean/run/fun.lean deleted file mode 100644 index 45546a2bf9..0000000000 --- a/old_tests/tests/lean/run/fun.lean +++ /dev/null @@ -1,21 +0,0 @@ -open function bool - - -constant f : nat → bool -constant g : nat → nat - -#check f ∘ g ∘ g - -#check (id : nat → nat) - -constant h : nat → bool → nat - -#check swap h -#check swap h ff nat.zero - -#check (swap h ff nat.zero : nat) - -constant f1 : nat → nat → bool -constant f2 : bool → nat - -#check (f1 on f2) ff tt diff --git a/old_tests/tests/lean/run/fun_info1.lean b/old_tests/tests/lean/run/fun_info1.lean deleted file mode 100644 index 1ff9c492f3..0000000000 --- a/old_tests/tests/lean/run/fun_info1.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -set_option pp.binder_types true -definition foo (A : Type) : A → A := -sorry - -example (a : nat) (H : foo unit () = ()) : true := -by do - (lhs, rhs) ← get_local `H >>= infer_type >>= match_eq , - get_spec_subsingleton_info lhs >>= trace, - trace "-----------", - trace "ite information:", - c ← mk_const `ite, get_fun_info c >>= trace, - trace "eq.rec information:", - c ← mk_const `eq.rec, get_fun_info c >>= trace, - trace "and.intro information:", - c ← mk_const `and.intro, get_fun_info c >>= trace, - mk_const `trivial >>= exact diff --git a/old_tests/tests/lean/run/funext_issue.lean b/old_tests/tests/lean/run/funext_issue.lean deleted file mode 100644 index e263191876..0000000000 --- a/old_tests/tests/lean/run/funext_issue.lean +++ /dev/null @@ -1,4 +0,0 @@ -universes u - -example (α : Type u) (p : Prop) (a b : α) (h : p → a = b) : (λ x : p, a) = (λ x : p, b) := -funext h diff --git a/old_tests/tests/lean/run/funext_tactic.lean b/old_tests/tests/lean/run/funext_tactic.lean deleted file mode 100644 index 85d8290914..0000000000 --- a/old_tests/tests/lean/run/funext_tactic.lean +++ /dev/null @@ -1,56 +0,0 @@ -example : (λ x y : nat, x + y) = (λ x y : nat, y + x) := -begin - funext, - apply add_comm x y -end - -example : (λ x y : nat, x + y) = (λ x y : nat, y + x) := -begin - funext z w, - apply add_comm z w -end - -example : (λ x y : nat, x + y) = (λ x y : nat, y + x) := -begin - funext z, - funext w, - apply add_comm z w -end - -example : (λ x y : nat, x + y) = (λ x y : nat, y + x) := -begin - funext _, - funext _, - apply add_comm x y -end - -example : (λ x y : nat, x + y) = (λ x y : nat, y + x) := -begin - funext _ _, - apply add_comm x y -end - -example : (λ x y : nat, x + 0) = (λ x y : nat, 0 + x) := -begin - funext _ _, - apply add_comm x 0 -end - -example : (λ x y : nat, x + 0) = (λ x y : nat, 0 + x) := -begin - funext z _, - apply add_comm z 0 -end - -example : (λ x y : nat, x + 0) = (λ x y : nat, 0 + x) := -begin - funext _ z, - apply add_comm x 0 -end - -example : (λ x y : nat, x + 0) = (λ x y : nat, 0 + x) := -begin - funext z, - funext _, - apply add_comm z 0 -end diff --git a/old_tests/tests/lean/run/gcd.lean b/old_tests/tests/lean/run/gcd.lean deleted file mode 100644 index 27465da953..0000000000 --- a/old_tests/tests/lean/run/gcd.lean +++ /dev/null @@ -1,41 +0,0 @@ -open nat well_founded decidable prod - -namespace playground - --- Setup -definition pair_nat.lt := lex nat.lt nat.lt -definition pair_nat.lt.wf : well_founded pair_nat.lt := -prod.lex_wf lt_wf lt_wf -infixl `≺`:50 := pair_nat.lt - --- Lemma for justifying recursive call -private lemma lt₁ (x₁ y₁ : nat) : (x₁ - y₁, succ y₁) ≺ (succ x₁, succ y₁) := -lex.left _ _ _ (lt_succ_of_le (sub_le x₁ y₁)) - --- Lemma for justifying recursive call -private lemma lt₂ (x₁ y₁ : nat) : (succ x₁, y₁ - x₁) ≺ (succ x₁, succ y₁) := -lex.right _ _ (lt_succ_of_le (sub_le y₁ x₁)) - -definition gcd.F (p₁ : nat × nat) : (Π p₂ : nat × nat, p₂ ≺ p₁ → nat) → nat := -prod.cases_on p₁ (λ (x y : nat), -nat.cases_on x - (λ f, y) -- x = 0 - (λ x₁, nat.cases_on y - (λ f, succ x₁) -- y = 0 - (λ y₁ (f : (Π p₂ : nat × nat, p₂ ≺ (succ x₁, succ y₁) → nat)), - if y₁ ≤ x₁ then f (x₁ - y₁, succ y₁) (lt₁ _ _ ) - else f (succ x₁, y₁ - x₁) (lt₂ _ _)))) - -definition gcd (x y : nat) := -fix pair_nat.lt.wf gcd.F (x, y) - -theorem gcd_def_z_y (y : nat) : gcd 0 y = y := -well_founded.fix_eq pair_nat.lt.wf gcd.F (0, y) - -theorem gcd_def_sx_z (x : nat) : gcd (x+1) 0 = x+1 := -well_founded.fix_eq pair_nat.lt.wf gcd.F (x+1, 0) - -theorem gcd_def_sx_sy (x y : nat) : gcd (x+1) (y+1) = if y ≤ x then gcd (x-y) (y+1) else gcd (x+1) (y-x) := -well_founded.fix_eq pair_nat.lt.wf gcd.F (x+1, y+1) - -end playground diff --git a/old_tests/tests/lean/run/generalize_inst.lean b/old_tests/tests/lean/run/generalize_inst.lean deleted file mode 100644 index d7ca7d4a92..0000000000 --- a/old_tests/tests/lean/run/generalize_inst.lean +++ /dev/null @@ -1,8 +0,0 @@ -example : ∃(b : nat), b = 1 ∧ 0 ≤ b := -begin - apply exists.intro, - apply and.intro, - apply rfl, - generalize : 1 = z, - apply nat.zero_le -end diff --git a/old_tests/tests/lean/run/generalizes.lean b/old_tests/tests/lean/run/generalizes.lean deleted file mode 100644 index c1041b78e7..0000000000 --- a/old_tests/tests/lean/run/generalizes.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic - -theorem tst (A B : Type) (a : A) (b : B) : a == b → b == a := -by do - a ← get_local `a, b ← get_local `b, B ← get_local `B, - generalizes [a, b, B], - intro_lst [`B', `b, `a], H ← intro `H, - mk_app `heq.symm [H] >>= exact diff --git a/old_tests/tests/lean/run/ginductive_induction_tactic.lean b/old_tests/tests/lean/run/ginductive_induction_tactic.lean deleted file mode 100644 index 63faf8316b..0000000000 --- a/old_tests/tests/lean/run/ginductive_induction_tactic.lean +++ /dev/null @@ -1,21 +0,0 @@ -mutual inductive {u} foo, bla (α : Type u) -with foo : Type u -| mk₁ : α → bla → foo -with bla : Type u -| mk₂ : α → bla → bla -| mk₃ : list foo → bla - -def cidx {α} : bla α → nat -| (bla.mk₂ _ _) := 1 -| (bla.mk₃ _) := 2 - -def to_list {α} : bla α → list (foo α) -| (bla.mk₂ _ _) := [] -| (bla.mk₃ ls) := ls - -lemma ex {α} (b : bla α) (h : cidx b = 2) : b = bla.mk₃ (to_list b) := -begin - induction b, - {simp [cidx] at h, exact absurd h (dec_trivial)}, - {simp [to_list]} -end diff --git a/old_tests/tests/lean/run/ginductive_pred.lean b/old_tests/tests/lean/run/ginductive_pred.lean deleted file mode 100644 index 2db4af17d8..0000000000 --- a/old_tests/tests/lean/run/ginductive_pred.lean +++ /dev/null @@ -1,14 +0,0 @@ -inductive term : Type -| var : nat → term -| app : string → list term → term - -/- In the current system, it will be hard to work with mutually inductive predicates. - Reason: we cannot use well-founded recursion, and the induction principle for it - is too weak. -/ -mutual inductive var_occ, var_occ_list -with var_occ : nat → term → Prop -| leaf (n : nat) : var_occ n (term.var n) -| app (n : nat) (s : string) (ts : list term) : var_occ_list n ts → var_occ n (term.app s ts) -with var_occ_list : nat → list term → Prop -| head (n : nat) (t : term) (ts : list term) : var_occ n t → var_occ_list n (t::ts) -| tail (n : nat) (t : term) (ts : list term) : var_occ_list n ts → var_occ_list n (t::ts) diff --git a/old_tests/tests/lean/run/handthen.lean b/old_tests/tests/lean/run/handthen.lean deleted file mode 100644 index 4386e0e70c..0000000000 --- a/old_tests/tests/lean/run/handthen.lean +++ /dev/null @@ -1,37 +0,0 @@ -open tactic - -lemma ex1 (a b c : nat) : a + 0 = 0 + a ∧ b = b := -begin - -- We use `(` to go to regular tactic mode. - constructor; [skip, constructor], - -- Remaining goal is - -- |- a + 0 = 0 + a - simp -end - -lemma ex2 (a b c : nat) : a + 0 = 0 + a ∧ b = b := -begin - constructor; [skip, constructor], - simp -end - -lemma ex3 (a b c : nat) : a + 0 = 0 + a ∧ b = b := -begin - /- We can use {} to group a sequence of tactics in the - tac ; [tac_1, ..., tac_n] - notation. - However, a {} will not force the goal to be completely solved. - Example: - The first constructor tactic will produce two goals. - The `;` combinator will apply the tactics {trace "Case1: ", trace_state} to the first goal and - constructor to the second. - -/ - constructor; [{trace "Case1: ", trace_state}, constructor], - simp -end - -lemma ex4 (a : nat) : a = a := -begin - /- We can use tac;[] to make sure that tac did not produce any goal -/ - refl; [] -end diff --git a/old_tests/tests/lean/run/has_sizeof_indices.lean b/old_tests/tests/lean/run/has_sizeof_indices.lean deleted file mode 100644 index dd73833b03..0000000000 --- a/old_tests/tests/lean/run/has_sizeof_indices.lean +++ /dev/null @@ -1,15 +0,0 @@ -universes u - -inductive foo : nat → Type -| baz (n : nat) : foo n → foo (nat.succ n) - -lemma foo.size (α β : Type u) (n a : ℕ) : has_sizeof (foo a) := -by tactic.mk_has_sizeof_instance - -inductive bla : nat → bool → Type -| mk : bla 0 ff -| baz (n : nat) : bla n ff → bla (nat.succ n) tt -| boo (n : nat) : bla n tt → bla (nat.succ n) ff - -lemma bla.size (α β : Type u) (a : ℕ) (t : bool) : has_sizeof (bla a t) := -by tactic.mk_has_sizeof_instance diff --git a/old_tests/tests/lean/run/have1.lean b/old_tests/tests/lean/run/have1.lean deleted file mode 100644 index 8f9ed54dac..0000000000 --- a/old_tests/tests/lean/run/have1.lean +++ /dev/null @@ -1,9 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constants a b c : Prop -axiom Ha : a -axiom Hb : b -axiom Hc : c -#check have H1 : a, from Ha, - have H2 : a, from H1, - H2 diff --git a/old_tests/tests/lean/run/have2.lean b/old_tests/tests/lean/run/have2.lean deleted file mode 100644 index 8f9ed54dac..0000000000 --- a/old_tests/tests/lean/run/have2.lean +++ /dev/null @@ -1,9 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constants a b c : Prop -axiom Ha : a -axiom Hb : b -axiom Hc : c -#check have H1 : a, from Ha, - have H2 : a, from H1, - H2 diff --git a/old_tests/tests/lean/run/have3.lean b/old_tests/tests/lean/run/have3.lean deleted file mode 100644 index ae1a6f209d..0000000000 --- a/old_tests/tests/lean/run/have3.lean +++ /dev/null @@ -1,11 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constants a b c : Prop -axiom Ha : a -axiom Hb : b -axiom Hc : c -#check have H1 : a, from Ha, - have H2 : a, from H1, - have H3 : a, from H2, - have H4 : a, from H3, - H4 diff --git a/old_tests/tests/lean/run/have4.lean b/old_tests/tests/lean/run/have4.lean deleted file mode 100644 index 8b1fc7cee0..0000000000 --- a/old_tests/tests/lean/run/have4.lean +++ /dev/null @@ -1,12 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constants a b c : Prop -axiom Ha : a -axiom Hb : b -axiom Hc : c -#check - have H1 : a, from Ha, - have H2 : a, from H1, - have H3 : a, from H2, - have H4 : a, from H3, - H4 diff --git a/old_tests/tests/lean/run/have5.lean b/old_tests/tests/lean/run/have5.lean deleted file mode 100644 index 6a2d9ec80c..0000000000 --- a/old_tests/tests/lean/run/have5.lean +++ /dev/null @@ -1,13 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constant and : Prop → Prop → Prop -infixl `∧`:25 := and -constant and_intro : forall (a b : Prop), a → b → a ∧ b -constants a b c d : Prop -axiom Ha : a -axiom Hb : b -axiom Hc : c -#check - have a ∧ b := and_intro a b Ha Hb, - have H : a ∧ b := and_intro a b Ha Hb, - Ha diff --git a/old_tests/tests/lean/run/have6.lean b/old_tests/tests/lean/run/have6.lean deleted file mode 100644 index cc7f4265ca..0000000000 --- a/old_tests/tests/lean/run/have6.lean +++ /dev/null @@ -1,19 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constant and : Prop → Prop → Prop -infixl `∧`:25 := and -constant and_intro : forall (a b : Prop), a → b → a ∧ b -constants a b c d : Prop -axiom Ha : a -axiom Hb : b -axiom Hc : c -#check - have a ∧ b, from and_intro a b Ha Hb, - have b ∧ a, from and_intro b a Hb Ha, - have H : a ∧ b, from and_intro a b Ha Hb, - have H : a ∧ b, from and_intro a b Ha Hb, - have a ∧ b, from and_intro a b Ha Hb, - have b ∧ a, from and_intro b a Hb Ha, - have H : a ∧ b, from and_intro a b Ha Hb, - have H : a ∧ b, from and_intro a b Ha Hb, - Ha diff --git a/old_tests/tests/lean/run/heap.lean b/old_tests/tests/lean/run/heap.lean deleted file mode 100644 index ff86067a57..0000000000 --- a/old_tests/tests/lean/run/heap.lean +++ /dev/null @@ -1,32 +0,0 @@ -constant heap : Type -constant ptr : Type -constant val : Type -constant pt : ptr → val → heap -constant hunion : heap → heap → heap -constant is_def : heap → Prop - -infix `∙`:60 := hunion -infix `↣`:70 := pt - -/- -constant hunion_is_assoc : is_associative heap hunion -constant hunion_is_comm : is_commutative heap hunion -attribute [instance] hunion_is_comm hunion_is_assoc - -axiom noalias : ∀ (h : heap) (y₁ y₂ : ptr) (w₁ w₂ : val), is_def (h ∙ y₁ ↣ w₁ ∙ y₂ ↣ w₂) → y₁ ≠ y₂ - --/ - --- set_option profiler true - -lemma ex -(h₁ h₂ : heap) (x₁ x₂ x₃ x₄ : ptr) (v₁ v₂ v₃ : val) -(hcomm : ∀ x y, x ∙ y = y ∙ x) -(hassoc : ∀ x y z, (x ∙ y) ∙ z = x ∙ (y ∙ z)) -(hnoalias : ∀ h y₁ y₂ w₁ w₂, is_def (h ∙ y₁ ↣ w₁ ∙ y₂ ↣ w₂) → y₁ ≠ y₂) -: is_def (h₁ ∙ (x₁ ↣ v₁ ∙ x₂ ↣ v₂) ∙ h₂ ∙ (x₃ ↣ v₃)) → x₁ ≠ x₃ ∧ x₁ ≠ x₂ ∧ x₂ ≠ x₃ := -begin [smt] - intros, - smt_tactic.add_lemmas_from_facts, - iterate { ematch } -end diff --git a/old_tests/tests/lean/run/heap_code.lean b/old_tests/tests/lean/run/heap_code.lean deleted file mode 100644 index 57e3ee62df..0000000000 --- a/old_tests/tests/lean/run/heap_code.lean +++ /dev/null @@ -1,86 +0,0 @@ -structure coding := -(code : Type) -[code_dec_eq : decidable_eq code] -(decode : code → Type) - -instance coding_code_has_dec_eq (β : coding) : decidable_eq β.code := -β.code_dec_eq - -@[reducible] def typeof (β : coding) (c : β.code) : Type := -β.decode c - -structure ref {code : Type} (c : code) := -(idx : nat) - -structure heap (β : coding) := -(next : nat) -(mem : array next (Σ c : β.code, β.decode c)) - -def mk_heap (β : coding) : heap β := -{ next := 0, mem := array.nil } - -def mk_ref {β : coding} : heap β → Π c : β.code, typeof β c → ref c × heap β -| ⟨n, mem⟩ c v := - ({ idx := n }, ⟨n+1, mem.push_back ⟨c, v⟩⟩) - -def read {β : coding} {c : β.code} (h : heap β) (r : ref c) : option (typeof β c) := -match h, r with -| ⟨n, mem⟩, {idx := i} := - if h₁ : i < n - then let ⟨c', v⟩ := mem.read ⟨i, h₁⟩ in - if h₂ : c' = c - then eq.rec_on h₂ v - else none - else none -end - -def write {β : coding} {c : β.code} (h : heap β) (r : ref c) (v : typeof β c) : heap β := -match h, v with -| ⟨n, mem⟩, v := - if h₁ : r.idx < n - then ⟨n, mem.write ⟨r.idx, h₁⟩ ⟨c, v⟩⟩ - else h -end - -@[derive decidable_eq] -inductive simple_code -| Pair : simple_code → simple_code → simple_code -| Bool : simple_code -| Nat : simple_code -| Ref : simple_code → simple_code - -open simple_code - -def decode_simple_code : simple_code → Type -| Bool := bool -| Nat := nat -| (Ref c) := ref c -| (Pair c₁ c₂) := decode_simple_code c₁ × decode_simple_code c₂ - -def PairRefNat := Pair (Ref Nat) (Ref Nat) - -def C : coding := -{ code := simple_code, decode := decode_simple_code } - -def h : heap C := -let h₀ := mk_heap C in -let (r₀, h₁) := mk_ref h₀ Bool tt in -let (r₁, h₂) := mk_ref h₁ Nat (10:nat) in -let (r₂, h₃) := mk_ref h₂ PairRefNat (r₁, r₁) in -let h₄ := write h₃ r₀ ff in -let h₅ := write h₄ r₁ (20:nat) in -h₅ - -def r₀ : ref Bool := { idx := 0 } -def r₁ : ref Nat := { idx := 1 } -def r₂ : ref PairRefNat := { idx := 2 } - -#eval @id (option nat) $ read h r₁ - -/- In the following example the type_context exposes the internal encoding of decode_simple_code. - TODO(Leo): fix this issue by using refl lemmas. -/ -#eval -match read h r₂ : _ → option nat with -| some (r, _) := read h r -- to observe problem, hover over the first `r` -| none := some 0 -end diff --git a/old_tests/tests/lean/run/heap_mem.lean b/old_tests/tests/lean/run/heap_mem.lean deleted file mode 100644 index 1946f417b0..0000000000 --- a/old_tests/tests/lean/run/heap_mem.lean +++ /dev/null @@ -1,92 +0,0 @@ -/- We use the following auxiliary type instead of (Σ α : Type, α) - because the code generator produces better code for `pointed`. - For `pointed`, the code generator erases the field `α`. -/ -structure pointed := -(α : Type) (a : α) - -/- The following two commands demonstrate the difference. - To remove the overhead in the `sigma` case, the code - generator would have to support code specialization. -/ -#eval pointed.mk nat 10 -#eval (⟨nat, 10⟩ : Σ α : Type, α) - -structure heap := -(size : nat) -(mem : array size pointed) - -structure ref (α : Type) := -(idx : nat) - -def in_heap {α : Type} (r : ref α) (h : heap) : Prop := -∃ hlt : r.idx < h.size, (h.mem.read ⟨r.idx, hlt⟩).1 = α - -lemma lt_of_in_heap {α : Type} {r : ref α} {h : heap} (hin : in_heap r h) : r.idx < h.size := -by cases hin; assumption - -lemma cast_of_in_heap {α : Type} {r : ref α} {h : heap} (hin : in_heap r h) : (h.mem.read ⟨r.idx, lt_of_in_heap hin⟩).1 = α := -by cases hin; exact hin_h - -def mk_ref : heap → Π {α : Type}, α → ref α × heap -| ⟨n, mem⟩ α v := ({idx := n}, { size := n+1, mem := mem.push_back ⟨α, v⟩ }) - -def read : Π (h : heap) {α : Type} (r : ref α) (prf : in_heap r h), α -| ⟨n, mem⟩ α r hin := eq.rec_on (cast_of_in_heap hin) (mem.read ⟨r.idx, lt_of_in_heap hin⟩).2 - -def write : Π (h : heap) {α : Type} (r : ref α) (prf : in_heap r h) (a : α), heap -| ⟨n, mem⟩ α r hin a := { size := n, mem := mem.write ⟨r.idx, lt_of_in_heap hin⟩ ⟨α, a⟩ } - -lemma in_heap_mk_ref (h : heap) {α : Type} (a : α) : in_heap (mk_ref h a).1 (mk_ref h a).2 := -begin - cases h, simp [mk_ref, in_heap], dsimp, - have : h_size < h_size + 1, { apply nat.lt_succ_self }, - existsi this, - simp [array.push_back, array.read, d_array.read, *] -end - -lemma in_heap_mk_ref_of_in_heap {α β : Type} {h : heap} {r : ref α} (b : β) : in_heap r h → in_heap r (mk_ref h b).2 := -begin - intro hin, - have := lt_of_in_heap hin, - have hlt := nat.lt_succ_of_lt this, - cases h, simp [in_heap, mk_ref, *] at *, dsimp, - have : r.idx ≠ h_size, { intro heq, subst heq, exact absurd this (irrefl _) }, - simp [array.push_back, array.read, d_array.read, *], - existsi hlt, cases hin, assumption -end - -@[simp] lemma fin.mk_eq {n : nat} {i j : nat} (h₁ : i < n) (h₂ : j < n) (h₃ : i ≠ j) : fin.mk i h₁ ≠ fin.mk j h₂ := -fin.ne_of_vne h₃ - -lemma in_heap_write_of_in_heap {α β : Type} {h : heap} {r₁ : ref β} {r₂ : ref α} (a : α) : ∀ (hin₁ : in_heap r₁ h) (hin₂ : in_heap r₂ h), in_heap r₁ (write h r₂ hin₂ a) := -begin - intros, - have := lt_of_in_heap hin₁, - have := lt_of_in_heap hin₂, - have := cast_of_in_heap hin₁, - have := cast_of_in_heap hin₂, - cases h, simp [in_heap, write, *] at *, - dsimp, existsi this, - by_cases r₂.idx = r₁.idx, - { simp [*] at * }, - { simp [*] } -end - -inductive is_extension : heap → heap → Prop -| refl : ∀ h, is_extension h h -| by_mk_ref (h' h : heap) {α : Type} (a : α) (he : is_extension h' h) : is_extension (mk_ref h' a).2 h -| by_write (h' h : heap) {α : Type} (r : ref α) (hin : in_heap r h') (a : α) (he : is_extension h' h) : is_extension (write h' r hin a) h - -lemma is_extension.trans {h₁ h₂ h₃ : heap} : is_extension h₁ h₂ → is_extension h₂ h₃ → is_extension h₁ h₃ := -begin - intro he₁, induction he₁, - { intros, assumption }, - all_goals { intro he₂, constructor, apply he₁_ih, assumption } -end - -lemma in_heap_of_is_extension_of_in_heap {α : Type} {r : ref α} {h h' : heap} : is_extension h' h → in_heap r h → in_heap r h' := -begin - intro he, induction he generalizing α r, - { intros, assumption }, - { intro hin, apply in_heap_mk_ref_of_in_heap, apply he_ih, assumption }, - { intro hin, apply in_heap_write_of_in_heap, apply he_ih, assumption } -end diff --git a/old_tests/tests/lean/run/help_cmd.lean b/old_tests/tests/lean/run/help_cmd.lean deleted file mode 100644 index 202dc769f5..0000000000 --- a/old_tests/tests/lean/run/help_cmd.lean +++ /dev/null @@ -1,5 +0,0 @@ -#help options - -#help commands - -#print options diff --git a/old_tests/tests/lean/run/hinst_lemma1.lean b/old_tests/tests/lean/run/hinst_lemma1.lean deleted file mode 100644 index c94537ea51..0000000000 --- a/old_tests/tests/lean/run/hinst_lemma1.lean +++ /dev/null @@ -1,19 +0,0 @@ -open tactic - -constant p : nat → nat → Prop -constant q : nat → nat → Prop -constant r : nat → nat → Prop - -axiom foo : ∀ a b c : nat, p a b → q b c → q a c → r a c -axiom boo : ∀ a b c : nat, p a b → (:q b c:) → q a c → (:r a c:) - -meta def pp_lemma (n : name) : tactic unit := -do h ← hinst_lemma.mk_from_decl n, - h^.pp >>= trace - -example : true := -by do - pp_lemma `add_assoc, - pp_lemma `foo, - pp_lemma `boo, - constructor diff --git a/old_tests/tests/lean/run/hinst_lemmas1.lean b/old_tests/tests/lean/run/hinst_lemmas1.lean deleted file mode 100644 index d94d631e48..0000000000 --- a/old_tests/tests/lean/run/hinst_lemmas1.lean +++ /dev/null @@ -1,9 +0,0 @@ -run_cmd -do - tactic.trace "hinst_lemmas example:", - hs ← return $ hinst_lemmas.mk, - h₁ ← hinst_lemma.mk_from_decl `add_zero, - h₂ ← hinst_lemma.mk_from_decl `zero_add, - h₃ ← hinst_lemma.mk_from_decl `add_comm, - hs ← return $ ((hs^.add h₁)^.add h₂)^.add h₃, - hs^.pp >>= tactic.trace diff --git a/old_tests/tests/lean/run/ho.lean b/old_tests/tests/lean/run/ho.lean deleted file mode 100644 index ac2740b444..0000000000 --- a/old_tests/tests/lean/run/ho.lean +++ /dev/null @@ -1,9 +0,0 @@ -inductive star : Type -| z : star -| s : (nat → star) → star - -#check @star.rec -#check @star.cases_on - -example (f : nat → star) : ¬ star.z = star.s f := -assume H, star.no_confusion H diff --git a/old_tests/tests/lean/run/hole1.lean b/old_tests/tests/lean/run/hole1.lean deleted file mode 100644 index 0cbe0acdfd..0000000000 --- a/old_tests/tests/lean/run/hole1.lean +++ /dev/null @@ -1,8 +0,0 @@ -example : ∀ a b : nat, a + b = b + a := -λ a b, {! _+_ !} - -example : ∀ a b : nat, a + b = b + a := -begin - intros h, - exact λ x, {! _+_, "lt" !} -end diff --git a/old_tests/tests/lean/run/id.lean b/old_tests/tests/lean/run/id.lean deleted file mode 100644 index 930393a6d6..0000000000 --- a/old_tests/tests/lean/run/id.lean +++ /dev/null @@ -1,10 +0,0 @@ -#check id id -set_option pp.universes true -#check id id -#check id Prop -#check id nat -#check @id.{0} -#check @id.{1} -#check id nat.zero -#check @eq -#check eq eq diff --git a/old_tests/tests/lean/run/if_dollar_prec.lean b/old_tests/tests/lean/run/if_dollar_prec.lean deleted file mode 100644 index 5a07d154da..0000000000 --- a/old_tests/tests/lean/run/if_dollar_prec.lean +++ /dev/null @@ -1 +0,0 @@ -#check if tt then tt else id $ ff diff --git a/old_tests/tests/lean/run/imp.lean b/old_tests/tests/lean/run/imp.lean deleted file mode 100644 index 2bac495d15..0000000000 --- a/old_tests/tests/lean/run/imp.lean +++ /dev/null @@ -1,29 +0,0 @@ -constant N : Type.{1} -constants a b c : N -constant f : forall {a b : N}, N → N - -#check f -#check @f -#check @f a -#check @f a b -#check @f a b c - -noncomputable definition l1 : N → N → N → N := @f -noncomputable definition l2 : N → N → N := @f a -noncomputable definition l3 : N → N := @f a b -noncomputable definition l4 : N := @f a b c - -constant g : forall ⦃a b : N⦄, N → N - -#check g -#check g a -#check @g -#check @g a -#check @g a b -#check @g a b c - -noncomputable definition l5 : N → N → N → N := @g -noncomputable definition l6 : N → N → N := @g a -noncomputable definition l7 : N → N := @g a b -noncomputable definition l8 : N := @g a b c -noncomputable definition l9 : N → N → N → N := g diff --git a/old_tests/tests/lean/run/imp2.lean b/old_tests/tests/lean/run/imp2.lean deleted file mode 100644 index 64a83dc4f2..0000000000 --- a/old_tests/tests/lean/run/imp2.lean +++ /dev/null @@ -1,4 +0,0 @@ -#check (λ {A : Type} (a : A), a) (10:nat) -set_option trace.app_builder true -#check (λ {A} (a : A), a) 10 -#check (λ a, a) (10:nat) diff --git a/old_tests/tests/lean/run/imp3.lean b/old_tests/tests/lean/run/imp3.lean deleted file mode 100644 index 228573394b..0000000000 --- a/old_tests/tests/lean/run/imp3.lean +++ /dev/null @@ -1,14 +0,0 @@ -namespace old -class is_equiv {A B : Type} (f : A → B) := - (inv : B → A) - -#check @is_equiv.inv -namespace is_equiv -section - parameters A B : Type - parameter f : A → B - parameter c : is_equiv f - #check inv f -end -end is_equiv -end old diff --git a/old_tests/tests/lean/run/implicit.lean b/old_tests/tests/lean/run/implicit.lean deleted file mode 100644 index cdd13ea843..0000000000 --- a/old_tests/tests/lean/run/implicit.lean +++ /dev/null @@ -1,7 +0,0 @@ -definition f {A : Type} {B : Type} (f : A → B → Prop) ⦃C : Type⦄ {R : C → C → Prop} {c : C} (H : R c c) : R c c -:= H - -constant g : Prop → Prop → Prop -constant H : true ∧ true - -#check f g H diff --git a/old_tests/tests/lean/run/include_bug.lean b/old_tests/tests/lean/run/include_bug.lean deleted file mode 100644 index c6cdaaffd5..0000000000 --- a/old_tests/tests/lean/run/include_bug.lean +++ /dev/null @@ -1,5 +0,0 @@ -variables x y : nat -variable xy : x = y - -include xy -lemma xyeq : x = y := xy diff --git a/old_tests/tests/lean/run/ind0.lean b/old_tests/tests/lean/run/ind0.lean deleted file mode 100644 index 2c5db4fb06..0000000000 --- a/old_tests/tests/lean/run/ind0.lean +++ /dev/null @@ -1,7 +0,0 @@ -prelude -inductive nat : Type -| zero : nat -| succ : nat → nat - -#check nat -#check nat.rec.{1} diff --git a/old_tests/tests/lean/run/ind1.lean b/old_tests/tests/lean/run/ind1.lean deleted file mode 100644 index 4325598a1f..0000000000 --- a/old_tests/tests/lean/run/ind1.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive List (A : Sort*) : Sort* -| nil : List -| cons : A → List → List -namespace List end List open List -#check List.{1} -#check cons.{1} -#check List.rec.{1 1} diff --git a/old_tests/tests/lean/run/ind2.lean b/old_tests/tests/lean/run/ind2.lean deleted file mode 100644 index 9e0be79dec..0000000000 --- a/old_tests/tests/lean/run/ind2.lean +++ /dev/null @@ -1,14 +0,0 @@ -prelude -inductive nat : Type -| zero : nat -| succ : nat → nat -namespace nat end nat open nat - -inductive {u} vector (A : Type u) : nat → Type u -| vnil : vector zero -| vcons : Π {n : nat}, A → vector n → vector (succ n) -namespace vector end vector open vector -#check vector.{1} -#check vnil.{1} -#check vcons.{1} -#check vector.rec.{1 1} diff --git a/old_tests/tests/lean/run/ind3.lean b/old_tests/tests/lean/run/ind3.lean deleted file mode 100644 index 2850b28f25..0000000000 --- a/old_tests/tests/lean/run/ind3.lean +++ /dev/null @@ -1,21 +0,0 @@ -#exit -inductive tree (A : Type) : Type := -| node : A → forest A → tree A -with forest : Type := -| nil : forest A -| cons : tree A → forest A → forest A - - -#check tree.{1} -#check forest.{1} -#check tree.rec.{1 1} -#check forest.rec.{1 1} - -#print "===============" - -inductive group : Type := -mk_group : Π (carrier : Type) (mul : carrier → carrier → carrier) (one : carrier), group - -#check group.{1} -#check group.{2} -#check group.rec.{1 1} diff --git a/old_tests/tests/lean/run/ind5.lean b/old_tests/tests/lean/run/ind5.lean deleted file mode 100644 index 6fc537c951..0000000000 --- a/old_tests/tests/lean/run/ind5.lean +++ /dev/null @@ -1,10 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} - -inductive or (A B : Prop) : Prop -| intro_left : A → or -| intro_right : B → or - -#check or -#check or.intro_left -#check or.rec diff --git a/old_tests/tests/lean/run/ind6.lean b/old_tests/tests/lean/run/ind6.lean deleted file mode 100644 index ad1c594e99..0000000000 --- a/old_tests/tests/lean/run/ind6.lean +++ /dev/null @@ -1,11 +0,0 @@ -#exit -inductive tree.{u} (A : Type.{u}) : Type.{max u 1} := -| node : A → forest.{u} A → tree.{u} A -with forest : Type.{max u 1} := -| nil : forest.{u} A -| cons : tree.{u} A → forest.{u} A → forest.{u} A - -#check tree.{1} -#check forest.{1} -#check tree.rec.{1 1} -#check forest.rec.{1 1} diff --git a/old_tests/tests/lean/run/ind7.lean b/old_tests/tests/lean/run/ind7.lean deleted file mode 100644 index 52f13c1b87..0000000000 --- a/old_tests/tests/lean/run/ind7.lean +++ /dev/null @@ -1,11 +0,0 @@ -namespace list - inductive {u} list (A : Type u) : Type u - | nil : list - | cons : A → list → list - - #check list.{1} - #check list.cons.{1} - #check list.rec.{1 1} -end list - -#check list.list.{1} diff --git a/old_tests/tests/lean/run/ind8.lean b/old_tests/tests/lean/run/ind8.lean deleted file mode 100644 index fedeb032fa..0000000000 --- a/old_tests/tests/lean/run/ind8.lean +++ /dev/null @@ -1,18 +0,0 @@ -inductive Pair1 (A B : Type) -| mk ( ) : A → B → Pair1 - -#check Pair1.mk - -#check Pair1.mk Prop Prop true false - -inductive Pair2 {A : Type} (B : A → Type) -| mk ( ) : Π (a : A), B a → Pair2 - -#check @Pair2.mk - -#check Pair2.mk (λx, Prop) true false - -inductive Pair3 (A B : Type) -| mk : A → B → Pair3 - -#check Pair3.mk true false diff --git a/old_tests/tests/lean/run/ind_bug.lean b/old_tests/tests/lean/run/ind_bug.lean deleted file mode 100644 index 246d30277b..0000000000 --- a/old_tests/tests/lean/run/ind_bug.lean +++ /dev/null @@ -1,14 +0,0 @@ -constant N : Type.{1} -constant I : Type.{1} - -namespace foo - inductive p (a : N) : Prop - | intro : p -end foo - -open foo - -namespace bla - inductive p (a : I) : Prop - | intro : p -end bla diff --git a/old_tests/tests/lean/run/ind_cnst_params.lean b/old_tests/tests/lean/run/ind_cnst_params.lean deleted file mode 100644 index 86c745fd9d..0000000000 --- a/old_tests/tests/lean/run/ind_cnst_params.lean +++ /dev/null @@ -1,15 +0,0 @@ -inductive foo -| mk (a : nat) (b : nat) : bool → foo - -#print foo.mk - -#check foo.mk 0 0 tt - -universe variables u - -inductive List (α : Type u) -| nil {} (a : nat) : List -| cons (hd : α) (tail : List) : List - -#check List.cons "a" (List.nil 1) -#check List.cons "a" (List.nil 2) diff --git a/old_tests/tests/lean/run/ind_issue.lean b/old_tests/tests/lean/run/ind_issue.lean deleted file mode 100644 index be25c6e509..0000000000 --- a/old_tests/tests/lean/run/ind_issue.lean +++ /dev/null @@ -1,9 +0,0 @@ -def stack := list nat -instance : has_append stack := -by unfold stack; apply_instance - -example (s : stack) : s ++ [] = s := -begin - induction s, - refl, apply list.append_nil -end diff --git a/old_tests/tests/lean/run/ind_ns.lean b/old_tests/tests/lean/run/ind_ns.lean deleted file mode 100644 index 2c963e0c4a..0000000000 --- a/old_tests/tests/lean/run/ind_ns.lean +++ /dev/null @@ -1,6 +0,0 @@ -inductive day -| monday | tuesday | wednesday | thursday | friday | saturday | sunday - -#check day.monday -open day -#check monday diff --git a/old_tests/tests/lean/run/ind_tac1.lean b/old_tests/tests/lean/run/ind_tac1.lean deleted file mode 100644 index 18220e2562..0000000000 --- a/old_tests/tests/lean/run/ind_tac1.lean +++ /dev/null @@ -1,5 +0,0 @@ -#check @heq.rec_on - -attribute [recursor 6] heq.rec_on - -#print [recursor] heq.rec_on diff --git a/old_tests/tests/lean/run/indbug2.lean b/old_tests/tests/lean/run/indbug2.lean deleted file mode 100644 index 556d7dc4f9..0000000000 --- a/old_tests/tests/lean/run/indbug2.lean +++ /dev/null @@ -1,8 +0,0 @@ -set_option pp.implicit true -set_option pp.universes true -section -parameter {A : Type*} -definition foo : A → A → Type* := (λ x y, Type*) -inductive bar {a b : A} (f : foo a b) -| bar2 : bar -end diff --git a/old_tests/tests/lean/run/indimp.lean b/old_tests/tests/lean/run/indimp.lean deleted file mode 100644 index bc816e7bbf..0000000000 --- a/old_tests/tests/lean/run/indimp.lean +++ /dev/null @@ -1,20 +0,0 @@ -prelude -definition Prop := Type.{0} - -inductive nat -| zero : nat -| succ : nat → nat - -inductive list (A : Type) -| nil {} : list -| cons : A → list → list - -inductive list2 (A : Type) : Type -| nil2 {} : list2 -| cons2 : A → list2 → list2 - -inductive and (A B : Prop) : Prop -| and_intro : A → B → and - -inductive cls {T1 : Type} (R1 : T1 → T1 → Prop) {T2 : Type} (R2 : T2 → T2 → Prop) (f : T1 → T2) -| mk : (∀x y : T1, R1 x y → R2 (f x) (f y)) → cls diff --git a/old_tests/tests/lean/run/induction_generalizing_bug.lean b/old_tests/tests/lean/run/induction_generalizing_bug.lean deleted file mode 100644 index 33a093e9d6..0000000000 --- a/old_tests/tests/lean/run/induction_generalizing_bug.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat - -example (n : nat) (h : n > 0) : succ n > 0 ∧ n = n := -begin - split, - induction n generalizing h, - all_goals { admit }, -end diff --git a/old_tests/tests/lean/run/induction_tac3.lean b/old_tests/tests/lean/run/induction_tac3.lean deleted file mode 100644 index f0305aaf75..0000000000 --- a/old_tests/tests/lean/run/induction_tac3.lean +++ /dev/null @@ -1,24 +0,0 @@ -open tactic - -example (p q : Prop) : p ∨ q → q ∨ p := -by do - H ← intro `H, - induction H, - constructor_idx 2, assumption, - constructor_idx 1, assumption - -open nat -example (n : ℕ) : n = 0 ∨ n = succ (pred n) := -by do - n ← get_local `n, - induction n, - constructor_idx 1, reflexivity, - constructor_idx 2, reflexivity, - return () - -example (n : ℕ) (H : n ≠ 0) : n > 0 → n = succ (pred n) := -by do - n ← get_local `n, - induction n, - intro `H1, contradiction, - intros, reflexivity diff --git a/old_tests/tests/lean/run/induction_tactic_delta.lean b/old_tests/tests/lean/run/induction_tactic_delta.lean deleted file mode 100644 index fd887df051..0000000000 --- a/old_tests/tests/lean/run/induction_tactic_delta.lean +++ /dev/null @@ -1,15 +0,0 @@ -open tactic - --- This test makes sure that [foo'] is not unfolded in the major premise, --- since [foo'] is the type of the major premise of the provided recursor. - -inductive foo (n : nat) -| mk : foo - -definition foo' := @foo 0 -definition foo'.rec := @foo.rec - -example : Pi (x : foo'), x = x := -by do x ← intro `x, - induction x, - reflexivity diff --git a/old_tests/tests/lean/run/induction_with_drec.lean b/old_tests/tests/lean/run/induction_with_drec.lean deleted file mode 100644 index c5d3e5e22f..0000000000 --- a/old_tests/tests/lean/run/induction_with_drec.lean +++ /dev/null @@ -1,4 +0,0 @@ -universe u - -example {α β : Type u} (a : α) (b : β) (h : α = β) : (eq.rec_on h a : β) = b → a = eq.rec_on (h^.symm) b := -by induction h; intros; assumption diff --git a/old_tests/tests/lean/run/inductive_nonrec_after_rec.lean b/old_tests/tests/lean/run/inductive_nonrec_after_rec.lean deleted file mode 100644 index 09ae23af8e..0000000000 --- a/old_tests/tests/lean/run/inductive_nonrec_after_rec.lean +++ /dev/null @@ -1,71 +0,0 @@ -universe variables u - -inductive tree (α : Type u) -| leaf {} : tree -| node : tree → α → tree → tree - -open tree - -def tree.size {α : Type u} : tree α → nat -| leaf := 0 -| (node l a r) := tree.size l + tree.size r + 1 - -#eval tree.size (@leaf nat) -#eval tree.size (tree.node leaf 1 leaf) -#eval tree.size (tree.node (tree.node leaf 1 leaf) 2 leaf) - -lemma ex1 : tree.size (tree.node (tree.node leaf 1 leaf) 2 leaf) = 2 := -rfl - -def tree.elems_core {α : Type u} : tree α → list α → list α -| leaf lst := lst -| (node l a r) lst := - let lst₁ := tree.elems_core l lst, - lst₂ := a :: lst₁ - in tree.elems_core r lst₂ - -def tree.elems {α : Type u} (t : tree α) : list α := -(tree.elems_core t [])^.reverse - -#eval tree.elems (tree.node (tree.node (tree.node leaf 0 leaf) 1 leaf) 2 leaf) - -lemma ex2 : tree.elems (tree.node (tree.node (tree.node leaf 0 leaf) 1 leaf) 2 leaf) = [0, 1, 2] := -rfl - -lemma ex3 (t₁ t₂ : tree nat) : t₁ = leaf → t₂ = node leaf 1 leaf → t₁ ≠ t₂ := -begin [smt] - intros -end - -lemma ex4 (t₁ t₂ : tree nat) : t₁ = leaf → t₂ = node leaf 1 leaf → t₁ ≠ t₂ := -begin - intros, - subst t₁, subst t₂, - tactic.intro1, - contradiction -end - -lemma ex5 (a b : nat) (t₁ t₂ t₃ t₄ : tree nat) : node t₁ a t₂ = node t₃ b t₄ → - t₁ = t₃ ∧ a = b ∧ t₂ = t₄ := -begin [smt] - intros -end - -lemma ex6 (a b : nat) (t₁ t₂ t₃ t₄ : tree nat) : node t₁ a t₂ = node t₃ b t₄ → - t₁ = t₃ ∧ a = b ∧ t₂ = t₄ := -begin - intro h, - injection h with h₁ h₂ h₃, - split, assumption, split, assumption, assumption -end - -lemma ex7 {α : Type u} (t : tree α) : t ≠ leaf → tree.size t > 0 := -begin - induction t, - {intros, contradiction}, - {intros, unfold tree.size, apply nat.zero_lt_succ } -end - -inductive tree_list (α : Type u) : Type u -| leaf : tree_list -| node : list tree_list → α → tree_list diff --git a/old_tests/tests/lean/run/inductive_sorry.lean b/old_tests/tests/lean/run/inductive_sorry.lean deleted file mode 100644 index 37bb8d15b8..0000000000 --- a/old_tests/tests/lean/run/inductive_sorry.lean +++ /dev/null @@ -1,10 +0,0 @@ -inductive foo₁ (A : sorry → ℕ) -| mk : foo₁ - -inductive foo₂ : sorry → Type -| mk : foo₂ sorry - -inductive foo₃ -| mk : sorry → foo₃ - -structure foo₄ (A : sorry → ℕ) := (x : ℕ) diff --git a/old_tests/tests/lean/run/inductive_type_whnf.lean b/old_tests/tests/lean/run/inductive_type_whnf.lean deleted file mode 100644 index 941693e32b..0000000000 --- a/old_tests/tests/lean/run/inductive_type_whnf.lean +++ /dev/null @@ -1,3 +0,0 @@ -def pred (α : Type) := α → Prop - -inductive foo : pred ℕ diff --git a/old_tests/tests/lean/run/infix_paren.lean b/old_tests/tests/lean/run/infix_paren.lean deleted file mode 100644 index 7af261f9c5..0000000000 --- a/old_tests/tests/lean/run/infix_paren.lean +++ /dev/null @@ -1,32 +0,0 @@ -open list - -#eval filter (< 10) [20, 5, 10, 3, 2, 14, 1] -#eval qsort (λ x y, x < y) [20, 5, 10, 3, 2, 14, 1] -#eval foldl (+) 0 [1, 2, 3] - -example : foldl (+) 0 [3, 4, 1] = 8 := -rfl - -example : foldl (*) 2 [3, 4, 1] = 24 := -rfl - -#check (+) 1 2 - -example : (+) 1 2 = 3 := -rfl - -example : (*) 3 4 = 12 := -rfl - -example : (++) [1,2] [3,4] = [1,2,3,4] := -rfl - -example : (++) [1,2] [3,4] = [1,2] ++ [3,4] := -rfl - -/- -(-) is rejected since we have prefix notation for - --/ - -example : list.foldr (::) [] [1, 2, 3, 4] = [1, 2, 3, 4] := -rfl diff --git a/old_tests/tests/lean/run/inj_eq_hygiene.lean b/old_tests/tests/lean/run/inj_eq_hygiene.lean deleted file mode 100644 index d83b5fea22..0000000000 --- a/old_tests/tests/lean/run/inj_eq_hygiene.lean +++ /dev/null @@ -1,4 +0,0 @@ -namespace foo -def iff.intro := 5 -inductive foo | bar -end foo \ No newline at end of file diff --git a/old_tests/tests/lean/run/injection.lean b/old_tests/tests/lean/run/injection.lean deleted file mode 100644 index fca7cf494d..0000000000 --- a/old_tests/tests/lean/run/injection.lean +++ /dev/null @@ -1,2 +0,0 @@ -inductive term -| abs : tt → term → term diff --git a/old_tests/tests/lean/run/injection1.lean b/old_tests/tests/lean/run/injection1.lean deleted file mode 100644 index 3a19ed4ac4..0000000000 --- a/old_tests/tests/lean/run/injection1.lean +++ /dev/null @@ -1,39 +0,0 @@ -open nat tactic - -inductive vec (A : Type) : nat → Type -| nil : vec nat.zero -| cons : ∀ {n}, A → vec n → vec (succ n) - -example (n : nat) (v w : vec nat n) (a b : nat) : vec.cons a v = vec.cons b w → a = b := -by do - intro `H, - H ← get_local `H, - injection H, - trace_state, - assumption - -example (n : nat) (v w : vec nat n) (a b : nat) : vec.cons a v = vec.cons b w → v = w := -by do - intro `H, - H ← get_local `H, - injection H, - trace_state, - assumption - -#print "----------------" - -example (a b : nat) : succ a = succ b → a = b := -by do - intro `H, - H ← get_local `H, - injection H, - trace_state, - assumption - -example (a b c d : nat) : (a, b) = (c, d) → a = c := -by do - intro `H, - H ← get_local `H, - injection_with H [`H1, `H2], - H1 ← get_local `H1, - exact H1 diff --git a/old_tests/tests/lean/run/injection_ginductive.lean b/old_tests/tests/lean/run/injection_ginductive.lean deleted file mode 100644 index 38f2f8edc5..0000000000 --- a/old_tests/tests/lean/run/injection_ginductive.lean +++ /dev/null @@ -1,16 +0,0 @@ -inductive term -| const (n : string) : term -| app (fn : string) (args : list term) : term - -constant p : Prop → Prop -axiom p_ax : ∀ x, p x = x - -example (f₁ f₂ : string) (as₁ as₂ : list term) (h : term.app f₁ as₁ = term.app f₂ as₂) : p (as₁ = as₂) := -begin - injection h, - trace_state, - guard_hyp h_1 := f₁ = f₂, - guard_hyp h_2 := as₁ = as₂, - rw p_ax, - assumption -end diff --git a/old_tests/tests/lean/run/inliner_bug.lean b/old_tests/tests/lean/run/inliner_bug.lean deleted file mode 100644 index 88ca4122a7..0000000000 --- a/old_tests/tests/lean/run/inliner_bug.lean +++ /dev/null @@ -1,4 +0,0 @@ -@[inline] def g (n : nat) : nat := -nat.rec_on n 0 (λ m r, r + 2) - -#eval g 10 diff --git a/old_tests/tests/lean/run/inout_level.lean b/old_tests/tests/lean/run/inout_level.lean deleted file mode 100644 index 2a88929b68..0000000000 --- a/old_tests/tests/lean/run/inout_level.lean +++ /dev/null @@ -1,8 +0,0 @@ -section bug -variables (x y z : Type) -variables (f : x → y) (g : y → z) -variables (xy : set (x → y)) (yz : set (y → z)) (xz : set (x → z)) ---#check f ∈ xy ---#check g ∈ yz -#check (g ∘ f) ∈ xz --error -end bug diff --git a/old_tests/tests/lean/run/inst_bug.lean b/old_tests/tests/lean/run/inst_bug.lean deleted file mode 100644 index 2d07f7b96d..0000000000 --- a/old_tests/tests/lean/run/inst_bug.lean +++ /dev/null @@ -1,7 +0,0 @@ -namespace test -class inductive {u} is_equiv (A B : Type u) (f : A → B) : Type u -definition inverse (A B : Type*) (f : A → B) [H : is_equiv A B f] := Type* -definition foo (A : Type*) (B : A → Type*) (h : A → A) (g : Π(a : A), B a → B a) - [H : Π(a : A), is_equiv _ _ (g a)] (x : A) : Type* := -inverse (B (h x)) (B (h x)) (g (h x)) -end test diff --git a/old_tests/tests/lean/run/int_eq_num.lean b/old_tests/tests/lean/run/int_eq_num.lean deleted file mode 100644 index fcc01cafe0..0000000000 --- a/old_tests/tests/lean/run/int_eq_num.lean +++ /dev/null @@ -1,10 +0,0 @@ -def f : int → nat -| -100 := 0 -| 0 := 1 -| 3 := 2 -| _ := 4 - -#eval f (-100) -#eval f 0 -#eval f 3 -#eval f 5 diff --git a/old_tests/tests/lean/run/interactive1.lean b/old_tests/tests/lean/run/interactive1.lean deleted file mode 100644 index e0f42688e5..0000000000 --- a/old_tests/tests/lean/run/interactive1.lean +++ /dev/null @@ -1,48 +0,0 @@ -def f : nat → nat := λ a, a - -@[simp] lemma f_def (a : nat) : f a = a := -rfl - -def g : nat → nat := λ a, 1 + a - -lemma g_def (a : nat) : g a = 1 + a := -rfl - -example (a b c : nat) : b = 0 → c = 1 → a + b + f c = g (f a) := -begin - intros h1 h2, - simp [h1, h2, g_def, nat.add_comm 1 a] -end - -example (b c : nat) : b = 0 → c = b + 1 → c = 1 := -begin - intros h1 h2, - simp [h1] at h2, - assumption -end - -open nat - -example (b c : nat) : succ b = succ c → b + 2 = c + 2 := -begin - intro h, - injection h with h', clear h, - trace_state, - subst h' -end - -constant h : nat → nat → nat - -axiom bla : ∀ a b : nat, h a b = h b a -axiom boo : ∀ a : nat, h 0 a = a - -attribute [simp] boo bla - -example (a b : nat) : a = b → h 0 a = b := -begin - intro h, - simp [h, -bla] -- should fail if bla is used -end -open tactic -example (a b : nat) : a = b → h 0 a = b := -by simp [-bla] {contextual := tt} diff --git a/old_tests/tests/lean/run/interp.lean b/old_tests/tests/lean/run/interp.lean deleted file mode 100644 index f896a36bc5..0000000000 --- a/old_tests/tests/lean/run/interp.lean +++ /dev/null @@ -1,30 +0,0 @@ -open bool nat -open function - -inductive univ -| ubool : univ -| unat : univ -| uarrow : univ → univ → univ - -open univ - -attribute [reducible] -definition interp : univ → Type -| ubool := bool -| unat := nat -| (uarrow fr to) := interp fr → interp to - -definition foo : Π (u : univ) (el : interp u), interp u -| ubool tt := ff -| ubool ff := tt -| unat n := succ n -| (uarrow fr to) f := λ x : interp fr, f (foo fr x) - -definition is_even : nat → bool -| 0 := tt -| (succ n) := bnot (is_even n) - -example : foo unat (10:nat) = (11:nat) := rfl -example : foo ubool tt = ff := rfl -example : foo (uarrow unat ubool) (λ x : nat, is_even x) 3 = tt := rfl -example : foo (uarrow unat ubool) (λ x : nat, is_even x) 4 = ff := rfl diff --git a/old_tests/tests/lean/run/intros_defeq_canonizer_bug.lean b/old_tests/tests/lean/run/intros_defeq_canonizer_bug.lean deleted file mode 100644 index fd05d03606..0000000000 --- a/old_tests/tests/lean/run/intros_defeq_canonizer_bug.lean +++ /dev/null @@ -1,9 +0,0 @@ -constant {u} f {α : Type u} : α → α → α → α -axiom {u} fax {α : Type u} [ring α] (a b : α) : f a b a = 0 - -attribute [ematch] fax - -universe variables u - -lemma ex {α : Type u} [field α] (x y : α) : f (x + y) (y + x) (x + y) = 0 := -begin [smt] ematch end diff --git a/old_tests/tests/lean/run/introv.lean b/old_tests/tests/lean/run/introv.lean deleted file mode 100644 index ccf21f1e41..0000000000 --- a/old_tests/tests/lean/run/introv.lean +++ /dev/null @@ -1,18 +0,0 @@ -example : ∀ a b : nat, a = b → b = a := -begin - introv h, - exact h.symm -end - -example : ∀ a b : nat, a = b → ∀ c, b = c → a = c := -begin - introv h₁ h₂, - exact h₁.trans h₂ -end - -example : ∀ a b : nat, a = b → b = a := -begin - introv, - intro h, - exact h.symm -end diff --git a/old_tests/tests/lean/run/io_fs.lean b/old_tests/tests/lean/run/io_fs.lean deleted file mode 100644 index 59c417a2a8..0000000000 --- a/old_tests/tests/lean/run/io_fs.lean +++ /dev/null @@ -1,20 +0,0 @@ -import system.io -open io - - -def mk_test_file : io unit := -do h ← mk_file_handle "io_fs.txt" io.mode.write, - fs.put_str_ln h "hello world", - fs.put_str_ln h "hello world again", - fs.close h - -def read_test_file : io string := -do b ← fs.read_file "io_fs.txt", - return b^.to_string - -#eval do - mk_test_file, - c ← read_test_file, - put_str c, - if c = "hello world\nhello world again\n" then return () - else io.fail "file content does not match expected result" diff --git a/old_tests/tests/lean/run/io_process_env.lean b/old_tests/tests/lean/run/io_process_env.lean deleted file mode 100644 index 16144e8871..0000000000 --- a/old_tests/tests/lean/run/io_process_env.lean +++ /dev/null @@ -1,6 +0,0 @@ -import system.io - - -#eval do -res ← io.cmd {cmd := "printenv", args := ["foo"], env := [("foo", "bar")]}, -when (res ≠ "bar\n") $ io.fail $ "unexpected value for foo: " ++ res diff --git a/old_tests/tests/lean/run/io_run_tactic.lean b/old_tests/tests/lean/run/io_run_tactic.lean deleted file mode 100644 index ca2321ee64..0000000000 --- a/old_tests/tests/lean/run/io_run_tactic.lean +++ /dev/null @@ -1,15 +0,0 @@ -import system.io - -open tactic - -meta def get_decl_names_with_prefix (p : name) : tactic (list name) := -do env ← get_env, - return $ env.fold [] $ λ d r, - let n := d.to_name in - if p.is_prefix_of n then n :: r else r - -meta def main : io unit := -do io.put_str "Declarations with prefix 'nat'\n", - ns ← io.run_tactic (get_decl_names_with_prefix `nat), - ns.mmap' $ λ n, io.put_str_ln $ to_string n, - return () diff --git a/old_tests/tests/lean/run/io_state.lean b/old_tests/tests/lean/run/io_state.lean deleted file mode 100644 index 8d8f924c06..0000000000 --- a/old_tests/tests/lean/run/io_state.lean +++ /dev/null @@ -1,17 +0,0 @@ -import system.io -open io state_t - -@[reducible] def my_io := state_t nat io - -instance lift_io {α} : has_coe (io α) (my_io α) := -⟨state_t.lift⟩ - -def tst : my_io unit := -do x ← get, - println x, - put (x+10), - y ← get, - println y, - put_str "end of program" - -#eval tst.run 5 diff --git a/old_tests/tests/lean/run/is_def_eq_perf_bug.lean b/old_tests/tests/lean/run/is_def_eq_perf_bug.lean deleted file mode 100644 index 013efee25a..0000000000 --- a/old_tests/tests/lean/run/is_def_eq_perf_bug.lean +++ /dev/null @@ -1,7 +0,0 @@ -definition f (n : nat) : nat := -if n = 100000 then 1 else 0 - -open tactic - -example (n : nat) : f 100000 = (if (100000 : nat) = 100000 then 1 else 0) := -by reflexivity diff --git a/old_tests/tests/lean/run/is_true.lean b/old_tests/tests/lean/run/is_true.lean deleted file mode 100644 index de6efedb69..0000000000 --- a/old_tests/tests/lean/run/is_true.lean +++ /dev/null @@ -1,5 +0,0 @@ -open nat - -example : as_true (2 = (2:nat)) := trivial -example : as_false (3 = (2:nat)) := trivial -example : as_true (2 < (3:nat)) := trivial diff --git a/old_tests/tests/lean/run/isabelle.lean b/old_tests/tests/lean/run/isabelle.lean deleted file mode 100644 index ebdb0d5987..0000000000 --- a/old_tests/tests/lean/run/isabelle.lean +++ /dev/null @@ -1,112 +0,0 @@ -/- -Isabelle style tactics. -This test is based on a file created by Gabriel Ebner. --/ -universe variables u - -inductive lazy_list (α : Type u) : Type u -| nil {} : lazy_list -| cons : α → thunk (lazy_list) → lazy_list - -namespace lazy_list -variables {α β : Type u} -def singleton : α → lazy_list α -| a := cons a nil - -def append : lazy_list α → thunk (lazy_list α) → lazy_list α -| nil l := l () -| (cons h t) l := cons h (@append (t ()) l) - -def join : lazy_list (lazy_list α) → lazy_list α -| nil := nil -| (cons h t) := append h (join (t ())) - -def map (f : α → β) : lazy_list α → lazy_list β -| nil := nil -| (cons h t) := cons (f h) (map (t ())) - -def for (l : lazy_list α) (f : α → β) : lazy_list β := -map f l - -def of_list : list α → lazy_list α -| [] := nil -| (h::t) := cons h (of_list t) -end lazy_list - -meta def lazy_tactic (α : Type u) := -tactic_state → lazy_list (α × tactic_state) - -namespace lazy_tactic -open lazy_list - -meta def of_tactic {α : Type u} (t : tactic α) : lazy_tactic α := -λ s, match t s with -| result.success a new_s := lazy_list.singleton (a, new_s) -| result.exception f e s := lazy_list.nil -end - -meta instance {α : Type} : has_coe (tactic α) (lazy_tactic α) := -⟨of_tactic⟩ - -protected meta def return {α} (a : α) : lazy_tactic α := -λ s, lazy_list.singleton (a, s) - -protected meta def bind {α β} : lazy_tactic α → (α → lazy_tactic β) → lazy_tactic β := -λ t₁ t₂ s, join (for (t₁ s) (λ ⟨a, new_s⟩, t₂ a new_s)) - -protected meta def orelse {α} (t₁ t₂ : lazy_tactic α) : lazy_tactic α := -λ s, append (t₁ s) (t₂ s) - -protected meta def failure {α} : lazy_tactic α := -λ s, nil - -meta instance : monad lazy_tactic := -monad_from_pure_bind @lazy_tactic.return @lazy_tactic.bind - -meta instance : alternative lazy_tactic := -{ lazy_tactic.monad with - failure := @lazy_tactic.failure, - orelse := @lazy_tactic.orelse } - -meta def choose {α} (xs : list α) : lazy_tactic α := -λ s, of_list $ xs^.map (λ a, (a, s)) - -protected meta def run {α} (t : lazy_tactic α) : tactic α := -λ s, match t s with -| nil := tactic.failed s -| cons (a, new_s) ss := result.success a new_s -end - -open tactic - -private meta def try_constructors : list name → lazy_tactic unit -| [] := failure -| (c::cs) := (mk_const c >>= apply >> skip : tactic unit) <|> try_constructors cs - -/- Backtracking version of constructor -/ -meta def constructor : lazy_tactic unit := -do t ← target, - cs ← get_constructors_for t, - try_constructors cs - -end lazy_tactic - -open lazy_tactic - -example (p q : Prop) : q → p ∨ q := -by lazy_tactic.run $ do - tactic.intros, - constructor, - tactic.trace_state, - tactic.assumption - -meta def naive_instantiation : lazy_tactic unit := -let vals := [``(1),``(2),``(3)] in do -x ← choose vals, -y ← choose vals, -e ← tactic.to_expr ``(nat.add_comm %%x %%y), -tactic.trace e, -tactic.exact e - -lemma ex : 1 + 3 = 3 + 1 := -by naive_instantiation^.run diff --git a/old_tests/tests/lean/run/itac.lean b/old_tests/tests/lean/run/itac.lean deleted file mode 100644 index 4fce0c2114..0000000000 --- a/old_tests/tests/lean/run/itac.lean +++ /dev/null @@ -1,11 +0,0 @@ -axiom addz {A : Type} [has_add A] [has_zero A] : ∀ a : A, a + 0 = a - -example {A : Type} [has_add A] [has_zero A] (a b c : A) : (a + 0) + (b + 0) + (c + 0) = a + b + c := -begin - repeat {rw addz} -end - -example {A : Type} [has_add A] [has_zero A] (a b c : A) : (a + 0) + (b + 0) + (c + 0) = a + b + c := -begin - repeat {rw addz, trace "------", trace_state} -end diff --git a/old_tests/tests/lean/run/kabstract_cache.lean b/old_tests/tests/lean/run/kabstract_cache.lean deleted file mode 100644 index fb2bf6f91b..0000000000 --- a/old_tests/tests/lean/run/kabstract_cache.lean +++ /dev/null @@ -1,7 +0,0 @@ -open tactic - -example {α : Type} (f : α → α → α) (a b : α) (H₁ : a = b) (H₂ : f b a = a) : -let c := a in f c c = c := -by do dsimp_target, - e ← get_local `H₁, rewrite_target e {occs := occurrences.pos [1]}, - get_local `H₂ >>= exact diff --git a/old_tests/tests/lean/run/kcomp.lean b/old_tests/tests/lean/run/kcomp.lean deleted file mode 100644 index d86373cfff..0000000000 --- a/old_tests/tests/lean/run/kcomp.lean +++ /dev/null @@ -1,24 +0,0 @@ -set_option pp.notation false -constant A : Type -constants a b : A -constant P : A → Type -constant H₁ : a = a -constant H₂ : P a -constant H₃ : a = b -constant f {A : Type} (a : A) : a = a -#reduce (eq.rec H₂ (@f A a) : P a) -#reduce (eq.rec H₂ H₁ : P a) -#reduce (eq.rec H₂ H₃ : P b) -#reduce (eq.rec H₂ (@eq.refl A a) : P a) --- eval λ (A : Type) (a b : A) (H₁ : a = a) (P : A → Prop) (H₂ : P a) (H₃ : a = a) (c : A), eq.rec (eq.rec H₂ H₁) H₃ -#check @eq.rec A a P H₂ a -#check λ H : a = a, H₂ -inductive to_type {B : Type} : B → Type -| mk : Π (b : B), to_type b - -noncomputable definition tst1 : to_type (λ H : a = a, H₂) := to_type.mk (@eq.rec A a P H₂ a) -#check to_type.mk(λ H : a = a, H₂) -#check to_type.mk(@eq.rec A a P H₂ a) -#check to_type.mk(λ H : a = a, H₂) = to_type.mk(@eq.rec A a P H₂ a) --- #check to_type.mk(eq.rec H₂ H₁) = to_type.mk(H₂) --- #check to_type.mk(eq.rec H₂ (f a)) = to_type.mk(H₂) diff --git a/old_tests/tests/lean/run/kdepends_on.lean b/old_tests/tests/lean/run/kdepends_on.lean deleted file mode 100644 index 6e77ab20a8..0000000000 --- a/old_tests/tests/lean/run/kdepends_on.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -example (f : nat → nat) (a : nat) : f (f (a + 0)) = a → true := -by do - t ← target, - s ← to_expr ```(f a), - b ← kdepends_on t s, guard ¬b, - b ← kdepends_on t s semireducible, guard b, - s ← to_expr ```(f (a + 0)), - b ← kdepends_on t s, guard b, - intros, constructor diff --git a/old_tests/tests/lean/run/kha_inst_bug.lean b/old_tests/tests/lean/run/kha_inst_bug.lean deleted file mode 100644 index 31fa9c3d64..0000000000 --- a/old_tests/tests/lean/run/kha_inst_bug.lean +++ /dev/null @@ -1,5 +0,0 @@ -open nat - -example (a b : ℕ) : a - b = a - min a b := -if h : a ≥ b then by rw [min_eq_right h] -else by rw [sub_eq_zero_of_le (le_of_not_ge h), min_eq_left (le_of_not_ge h), nat.sub_self] diff --git a/old_tests/tests/lean/run/lambda_cons.lean b/old_tests/tests/lean/run/lambda_cons.lean deleted file mode 100644 index 31e1eba83a..0000000000 --- a/old_tests/tests/lean/run/lambda_cons.lean +++ /dev/null @@ -1 +0,0 @@ -#eval list.foldr (::) [] [1, 2, 3] diff --git a/old_tests/tests/lean/run/lambda_simp.lean b/old_tests/tests/lean/run/lambda_simp.lean deleted file mode 100644 index 280639ecf2..0000000000 --- a/old_tests/tests/lean/run/lambda_simp.lean +++ /dev/null @@ -1,11 +0,0 @@ -#print [simp] default - -constant addz (a : nat) : 0 + a = a -attribute [simp] addz - -open tactic - -def ex : (λ a b : nat, 0 + a) = (λ a b, a) := -by simp - -#print ex diff --git a/old_tests/tests/lean/run/lamexp.lean b/old_tests/tests/lean/run/lamexp.lean deleted file mode 100644 index 69a4587f58..0000000000 --- a/old_tests/tests/lean/run/lamexp.lean +++ /dev/null @@ -1,46 +0,0 @@ -inductive ty -| base : string → ty -| arr : ty → ty → ty - -namespace ty -instance : decidable_eq ty := by tactic.mk_dec_eq_instance -instance : inhabited ty := ⟨ty.base "o"⟩ -end ty - -@[reducible] def ctx := list ty - -inductive lamexp_core : ctx → ty → Type -| var : Π {Γ : ctx} {t} (n : ℕ), list.nth Γ n = some t → lamexp_core Γ t -| fv : Π {Γ}, string → Π t : ty, lamexp_core Γ t -| con : Π {Γ}, string → Π t : ty, lamexp_core Γ t -| app : Π {Γ} {t s}, lamexp_core Γ (ty.arr t s) → lamexp_core Γ t → lamexp_core Γ s -| abs : Π {Γ : ctx} {t s}, lamexp_core (t::Γ) s → lamexp_core Γ (ty.arr t s) - -namespace lamexp_core --- instance {Γ t} : decidable_eq (lamexp_core Γ t) := by tactic.mk_dec_eq_instance -instance {Γ t} : inhabited (lamexp_core Γ t) := ⟨lamexp_core.con "c" t⟩ -end lamexp_core - -@[reducible] def lamexp := lamexp_core [] - -namespace lamexp - -lemma nth_append {α} {ys : list α} : Π {n xs}, list.nth xs n ≠ none → list.nth (xs ++ ys) n = list.nth xs n -| 0 [] h := by contradiction -| (n+1) [] h := by contradiction -| 0 (x::xs) h := rfl -| (n+1) (x::xs) h := @nth_append n xs h - -def weaken_core : ∀ {Γ Δ t}, lamexp_core Γ t → lamexp_core (Γ ++ Δ) t -| Γ Δ .(t) (@lamexp_core.var .(Γ) t n h) := lamexp_core.var n $ - begin rw nth_append, assumption, rw h, intro, contradiction end -| Γ Δ .(t) (lamexp_core.fv n t) := lamexp_core.fv n t -| Γ Δ .(t) (lamexp_core.con n t) := lamexp_core.con n t -| Γ Δ .(s) (@lamexp_core.app .(Γ) t s a b) := lamexp_core.app (weaken_core a) (weaken_core b) -| Γ Δ (ty.arr .(t) .(s)) (@lamexp_core.abs .(Γ) t s a) := - lamexp_core.abs $ cast (by simp) (weaken_core a) - -def weaken {Γ t} : lamexp t → lamexp_core Γ t := -weaken_core - -end lamexp diff --git a/old_tests/tests/lean/run/let1.lean b/old_tests/tests/lean/run/let1.lean deleted file mode 100644 index 1ab0677883..0000000000 --- a/old_tests/tests/lean/run/let1.lean +++ /dev/null @@ -1,8 +0,0 @@ -#check - let f x y := x ∧ y, - g x := f x x, - a := g true - in λ (x : a), - let h x y := f x (g y), - b := h - in b diff --git a/old_tests/tests/lean/run/let2.lean b/old_tests/tests/lean/run/let2.lean deleted file mode 100644 index 07535a5b05..0000000000 --- a/old_tests/tests/lean/run/let2.lean +++ /dev/null @@ -1,21 +0,0 @@ -definition b := - let a := true ∧ true, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a, - a := a ∧ a in - a - -#check b diff --git a/old_tests/tests/lean/run/let3.lean b/old_tests/tests/lean/run/let3.lean deleted file mode 100644 index 87315a5524..0000000000 --- a/old_tests/tests/lean/run/let3.lean +++ /dev/null @@ -1,51 +0,0 @@ -definition p1 := (10, 20, 30) - -definition v1 : nat := -let (a, b, c) := p1 in -a + b + c - -definition v2 : nat := -let ⟨a, b, c⟩ := p1 in -a + b + c - -example : v2 = 60 := -rfl - -/- -let with patterns is just syntax sugar for the match convoy pattern. - - let (a, b, c) := p1 in - a + b + c - -is encoded as - - match p1 with - (a, b, c) := a + b + c - end - -One limitation is that the expexted type of the let-expression must be known. - -TODO(Leo): improve visit_convoy in the elaborator, and remove this restriction. --/ - -#eval -(let (a, b, c) := p1 in a + b : nat) -- We have to provide the type. - -#eval -(let (a, b) := p1, - (c, d) := b - in c + d : nat) - -definition v3 : nat := -let (a, b) := p1, - (c, d) := b -in c + d - -example : v3 = 50 := -rfl - -#check -(let (a, b, c) := p1 in a + b : nat) -- We have to provide the type. - -#reduce -(let (a, b, c) := p1 in a + b : nat) -- We have to provide the type. diff --git a/old_tests/tests/lean/run/let_vm_bug.lean b/old_tests/tests/lean/run/let_vm_bug.lean deleted file mode 100644 index f5d951413e..0000000000 --- a/old_tests/tests/lean/run/let_vm_bug.lean +++ /dev/null @@ -1,6 +0,0 @@ -def f : nat → nat := -let A := nat in -λ (a : A), a - -example : f 0 = 0 := -rfl diff --git a/old_tests/tests/lean/run/letters.lean b/old_tests/tests/lean/run/letters.lean deleted file mode 100644 index 869e05c855..0000000000 --- a/old_tests/tests/lean/run/letters.lean +++ /dev/null @@ -1,2 +0,0 @@ -variables 𝓞 : Prop -#check 𝓞 diff --git a/old_tests/tests/lean/run/level_bug1.lean b/old_tests/tests/lean/run/level_bug1.lean deleted file mode 100644 index 01bd9af56a..0000000000 --- a/old_tests/tests/lean/run/level_bug1.lean +++ /dev/null @@ -1,4 +0,0 @@ -definition f (a : Type) := Π r : Type, (a → r) → r - -definition blah2 : Π {a : Type} {r : Type} (sa : f a) (k : a → r), sa r k = sa r k := -λ (a : Type) (r : Type) (sa : f a) (k : a → r), rfl diff --git a/old_tests/tests/lean/run/level_bug2.lean b/old_tests/tests/lean/run/level_bug2.lean deleted file mode 100644 index 47121f0a35..0000000000 --- a/old_tests/tests/lean/run/level_bug2.lean +++ /dev/null @@ -1,4 +0,0 @@ -definition f (a : Type) := Π r : Type, (a → r) → r - -definition blah2 {a : Type} {r : Type} (sa : f a) (k : a → r) : sa r k = sa r k := -rfl diff --git a/old_tests/tests/lean/run/level_bug3.lean b/old_tests/tests/lean/run/level_bug3.lean deleted file mode 100644 index 987e94f0f6..0000000000 --- a/old_tests/tests/lean/run/level_bug3.lean +++ /dev/null @@ -1,11 +0,0 @@ -variables {a r : Type} - -definition f (a) := Πr, (a -> r) -> r - -lemma blah2 (sa : f a) (k : (a -> r)) : - sa r k = sa r k := - sorry - -lemma blah3 (sa : f a) (k : (a -> r)) : - sa r k = sa r k := - rfl diff --git a/old_tests/tests/lean/run/lift.lean b/old_tests/tests/lean/run/lift.lean deleted file mode 100644 index 147c7fdf82..0000000000 --- a/old_tests/tests/lean/run/lift.lean +++ /dev/null @@ -1,25 +0,0 @@ -open nat - -namespace test -inductive {u} lift (A : Type u) : Type (u+1) -| up : A → lift - -namespace lift -definition down {A : Type} (a : lift A) : A := -lift.rec (λ a, a) a - -theorem down_up {A : Type} (a : A) : down (up a) = a := -rfl - - -theorem up_down {A : Type} (a' : lift A) : up (down a') = a' := -lift.cases_on a' (λ a, rfl) - -end lift - -set_option pp.universes true -#check nat -#check lift nat -open lift -definition one1 : lift nat := up 1 -end test diff --git a/old_tests/tests/lean/run/lift2.lean b/old_tests/tests/lean/run/lift2.lean deleted file mode 100644 index 3b89e45984..0000000000 --- a/old_tests/tests/lean/run/lift2.lean +++ /dev/null @@ -1,13 +0,0 @@ -namespace test -inductive {u₁ u₂} lift (A : Type u₁) : Type (max 1 u₁ u₂) -| inj : A → lift - -set_option pp.universes true - -variables (A : Type 3) (B : Type 1) -#check A = lift.{1 3} B - -universe variables u -variables (C : Type (u+2)) (D : Type u) -#check C = lift.{u u+2} D -end test diff --git a/old_tests/tests/lean/run/lift_nested_rec.lean b/old_tests/tests/lean/run/lift_nested_rec.lean deleted file mode 100644 index 32a3d7eca3..0000000000 --- a/old_tests/tests/lean/run/lift_nested_rec.lean +++ /dev/null @@ -1,10 +0,0 @@ -definition f : nat → (nat × nat) → nat -| 0 m := m.1 -| (n+1) m := - match m with - | (a, b) := (f n (b, a + 1)) + (f n (a, b)) - end - -#check @f._main.equations._eqn_1 -#check @f._main.equations._eqn_2 -#check @f._match_1.equations._eqn_1 diff --git a/old_tests/tests/lean/run/list_mem_pred.lean b/old_tests/tests/lean/run/list_mem_pred.lean deleted file mode 100644 index c4b5cdb96a..0000000000 --- a/old_tests/tests/lean/run/list_mem_pred.lean +++ /dev/null @@ -1,29 +0,0 @@ -universe u - -inductive list_mem {α : Type u} : α → list α → Prop -| head (a : α) (l : list α) : list_mem a (a::l) -| tail (a b : α) (l : list α) : list_mem a l → list_mem a (b::l) - -lemma mem_self {α} (a : α) (l : list α) : list_mem a (a::l) := -list_mem.head a l - -open tactic - -lemma mem_cons_iff {α} (a y : α) (l : list α) : list_mem a (y :: l) ↔ (a = y ∨ list_mem a l) := -begin - apply iff.intro, - {intro h, cases h, {apply or.inl, refl}, {apply or.inr, assumption}}, - {intro h, cases h, {subst_vars, apply list_mem.head}, {apply list_mem.tail, assumption}} -end - -lemma list_mem_1 {α} (a : α) : ¬ list_mem a [] := -by intro h; cases h - -def test_list_mem_dcases_on - {α : Type u} - {C : Π (a : α) (a_1 : list α), list_mem a a_1 → Prop} - {a : α} {l : list α} - (n : list_mem a l) - (h₁ : ∀ (a : α) (l : list α), C a (a :: l) (list_mem.head a l)) - (h₂ : ∀ (a b : α) (l : list α) (a_1 : list_mem a l), C a (b :: l) (list_mem.tail a b l a_1)) : C a l n := -@list_mem.dcases_on α C a l n h₁ h₂ diff --git a/old_tests/tests/lean/run/list_notation.lean b/old_tests/tests/lean/run/list_notation.lean deleted file mode 100644 index 6917236d74..0000000000 --- a/old_tests/tests/lean/run/list_notation.lean +++ /dev/null @@ -1,27 +0,0 @@ -open nat - -#eval [1, 2, 3] - -#eval to_bool $ 1 ∈ [1, 2, 3] - -#eval to_bool $ 4 ∈ [1, 2, 3] - -#eval [1, 2, 3] ++ [3, 4] - -#eval 2 :: [3, 4] - -#eval ([] : list nat) - -#eval (∅ : list nat) - -#eval ({1, 3, 2, 2, 3, 1} : list nat) - -#eval [1, 2, 3] ∪ [3, 4, 1, 5] - -#eval [1, 2, 3] ∩ [3, 4, 1, 5] - -#eval (*10) <$> [1, 2, 3] - -#check ({1, 2, 3} : list nat) - -#check ({1, 2, 3, 4} : set nat) diff --git a/old_tests/tests/lean/run/listex.lean b/old_tests/tests/lean/run/listex.lean deleted file mode 100644 index 53cd5f4fae..0000000000 --- a/old_tests/tests/lean/run/listex.lean +++ /dev/null @@ -1,40 +0,0 @@ -universe variable u - -constant in_tail {α : Type u} {a b : α} {l : list α} : a ∈ l → a ∈ b::l -constant in_head {α : Type u} {a : α} {l : list α} : a ∈ a::l -constant in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r -constant in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r - -open expr tactic - -meta def search_mem_list : expr → expr → tactic expr -| a e := -(do m ← mk_app ``has_mem.mem [a, e], find_assumption m) -<|> -(do [_, _, l, r] ← match_app_of e ``has_append.append | failed, h ← search_mem_list a l, mk_app `in_left [l, r, h]) -<|> -(do [_, _, l, r] ← match_app_of e ``has_append.append | failed, h ← search_mem_list a r, mk_app `in_right [l, r, h]) -<|> -(do [_, b, t] ← match_app_of e ``list.cons | failed, is_def_eq a b, mk_app `in_head [b, t]) -<|> -(do [_, b, t] ← match_app_of e ``list.cons | failed, h ← search_mem_list a t, mk_app `in_tail [a, b, t, h]) - -meta def mk_mem_list : tactic unit := -do t ← target, - [_, _, _, a, e] ← match_app_of t ``has_mem.mem | failed, - search_mem_list a e >>= exact - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -by tactic.intros >> mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ b::b::c::l ++ [c, c, b] := -by tactic.intros >> mk_mem_list diff --git a/old_tests/tests/lean/run/listex2.lean b/old_tests/tests/lean/run/listex2.lean deleted file mode 100644 index 2056828ca4..0000000000 --- a/old_tests/tests/lean/run/listex2.lean +++ /dev/null @@ -1,63 +0,0 @@ -universe variable u - -constant in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l -constant in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l -constant in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r -constant in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r - -open expr tactic - -declare_trace search_mem_list - -meta def match_append (e : expr) : tactic (expr × expr) := -do [_, _, l, r] ← match_app_of e ``has_append.append | failed, return (l, r) - -meta def match_cons (e : expr) : tactic (expr × expr) := -do [_, a, t] ← match_app_of e ``list.cons | failed, return (a, t) - -meta def match_mem (e : expr) : tactic (expr × expr) := -do [_, _, _, a, t] ← match_app_of e ``has_mem.mem | failed, return (a, t) - -meta def search_mem_list : expr → expr → tactic expr -| a e := when_tracing `search_mem_list (do f₁ ← pp a, f₂ ← pp e, trace (to_fmt "search " ++ f₁ ++ to_fmt " in " ++ f₂)) >> -(do m ← to_expr ``(%%a ∈ %%e), find_assumption m) -<|> -(do (l, r) ← match_append e, h ← search_mem_list a l, to_expr ``(in_left %%r %%h)) -<|> -(do (l, r) ← match_append e, h ← search_mem_list a r, to_expr ``(in_right %%l %%h)) -<|> -(do (b, t) ← match_cons e, is_def_eq a b, to_expr ``(in_head %%b %%t)) -<|> -(do (b, t) ← match_cons e, h ← search_mem_list a t, to_expr ``(in_tail %%b %%h)) - -meta def mk_mem_list : tactic unit := -do t ← target, - (a, l) ← match_mem t, - search_mem_list a l >>= exact - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -by tactic.intros >> mk_mem_list - -set_option trace.search_mem_list true - -lemma ex1 (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -by tactic.intros >> mk_mem_list - -set_option trace.smt.ematch true - -/- Using ematching -/ -lemma ex2 (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -begin [smt] - intros, - add_lemma [in_left, in_right, in_head, in_tail], - iterate {ematch} -- It will loop if there is a matching loop -end diff --git a/old_tests/tests/lean/run/listex3.lean b/old_tests/tests/lean/run/listex3.lean deleted file mode 100644 index ae31b5ae67..0000000000 --- a/old_tests/tests/lean/run/listex3.lean +++ /dev/null @@ -1,43 +0,0 @@ -universe variable u - -constant in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l -constant in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l -constant in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r -constant in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r - -open expr tactic - -declare_trace search_mem_list - -meta def mk_mem_list_rec : tactic unit := -when_tracing `search_mem_list (do t ← target, f ← pp t, trace (to_fmt "search " ++ f)) ->> (assumption - <|> - (`[apply in_left] >> mk_mem_list_rec) - <|> - (`[apply in_right] >> mk_mem_list_rec) - <|> - (`[apply in_head]) - <|> - (`[apply in_tail] >> mk_mem_list_rec)) ->> done - -meta def mk_mem_list : tactic unit := -solve1 mk_mem_list_rec - -set_option trace.search_mem_list true - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a+0, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -by tactic.intros >> mk_mem_list - -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -by tactic.intros >> mk_mem_list diff --git a/old_tests/tests/lean/run/listex4.lean b/old_tests/tests/lean/run/listex4.lean deleted file mode 100644 index 1952064bcc..0000000000 --- a/old_tests/tests/lean/run/listex4.lean +++ /dev/null @@ -1,30 +0,0 @@ -universe variable u - -constant in_tail {α : Type u} {a : α} (b : α) {l : list α} : a ∈ l → a ∈ b::l -constant in_head {α : Type u} (a : α) (l : list α) : a ∈ a::l -constant in_left {α : Type u} {a : α} {l : list α} (r : list α) : a ∈ l → a ∈ l ++ r -constant in_right {α : Type u} {a : α} (l : list α) {r : list α} : a ∈ r → a ∈ l ++ r - -open expr tactic - -local attribute [intro] in_tail in_head in_left in_right - -meta def mk_mem_list : tactic unit := -solve1 (back_chaining) - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -set_option trace.tactic.back_chaining true - -example (a b c : nat) : a ∈ [b, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) : a ∈ [b, c] ++ [b, c, c] ++ [b, a, b] := -by mk_mem_list - -example (a b c : nat) (l : list nat) : a ∈ l → a ∈ [b, c] ++ b::l := -by tactic.intros >> mk_mem_list - -example (a b c : nat) (l₁ l₂ : list nat) : a ∈ l₁ → a ∈ b::b::c::l₂ ++ b::c::l₁ ++ [c, c, b] := -by tactic.intros >> mk_mem_list diff --git a/old_tests/tests/lean/run/local_notation.lean b/old_tests/tests/lean/run/local_notation.lean deleted file mode 100644 index 810105ac27..0000000000 --- a/old_tests/tests/lean/run/local_notation.lean +++ /dev/null @@ -1,9 +0,0 @@ -section - variables {A : Type} - variables f : A → A → A - local infixl `+++`:10 := f - - variables a b c : A - #check f a b - #check a +++ b -end diff --git a/old_tests/tests/lean/run/local_ns_shadow.lean b/old_tests/tests/lean/run/local_ns_shadow.lean deleted file mode 100644 index 47a6ee456d..0000000000 --- a/old_tests/tests/lean/run/local_ns_shadow.lean +++ /dev/null @@ -1,24 +0,0 @@ -#check λ (a b : nat) (heq : a = b), (heq.symm : b = a) - -example : ∀ (a b : nat), a = b → b = a := -begin - exact λ (a b : nat) (heq : a = b), heq.symm -end - -example : ∀ (a b : nat), a = b → b = a := -begin - intros a b heq, - exact heq.symm -end - -section - parameter x : nat - def foo.bla : nat × nat := - (x, x+1) - - def g : nat := - foo.bla.fst + foo.bla.snd -end - -example : g 10 = 21 := -rfl diff --git a/old_tests/tests/lean/run/local_shadowing_projection.lean b/old_tests/tests/lean/run/local_shadowing_projection.lean deleted file mode 100644 index 19687a2669..0000000000 --- a/old_tests/tests/lean/run/local_shadowing_projection.lean +++ /dev/null @@ -1,7 +0,0 @@ -def prod.cmp (a b : nat × nat) : ordering := -cmp a b - -namespace prod - def foo (a : nat × nat) (cmp : nat) := - a.cmp -end prod diff --git a/old_tests/tests/lean/run/lst64.lean b/old_tests/tests/lean/run/lst64.lean deleted file mode 100644 index 8a2a7a1665..0000000000 --- a/old_tests/tests/lean/run/lst64.lean +++ /dev/null @@ -1,74 +0,0 @@ -def mylist : list ℕ := -#[ - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 - -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 -] diff --git a/old_tests/tests/lean/run/mapply.lean b/old_tests/tests/lean/run/mapply.lean deleted file mode 100644 index 5987a1b3dc..0000000000 --- a/old_tests/tests/lean/run/mapply.lean +++ /dev/null @@ -1,20 +0,0 @@ -constant p : nat → Prop -constant q : nat → Prop -constant h : nat → Prop -axiom pq0 : q 0 → p 0 -axiom phx : ∀ x, h x → p x - -example (h₁ : h 1) : ∃ x, p x := -begin - constructor, - mapply pq0 <|> mapply phx, -- The first `mapply` should fail - assumption -end - -open nat -example : ∃ x, succ 0 > x := -begin - constructor, - fail_if_success { mapply succ_lt_succ }, - apply zero_lt_succ -end diff --git a/old_tests/tests/lean/run/match2.lean b/old_tests/tests/lean/run/match2.lean deleted file mode 100644 index 493a05216e..0000000000 --- a/old_tests/tests/lean/run/match2.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive imf (f : nat → nat) : nat → Type -| mk1 : ∀ (a : nat), imf (f a) -| mk2 : imf (f 0 + 1) - -definition inv_2 (f : nat → nat) : ∀ (b : nat), imf f b → {x : nat // x > b} → nat -| .(f a) (imf.mk1 .(f) a) x := a -| .(f 0 + 1) (imf.mk2 .(f)) x := subtype.val x diff --git a/old_tests/tests/lean/run/match3.lean b/old_tests/tests/lean/run/match3.lean deleted file mode 100644 index d07e0f0c96..0000000000 --- a/old_tests/tests/lean/run/match3.lean +++ /dev/null @@ -1,49 +0,0 @@ -open nat - -definition foo (a : nat) : nat := -match a with -| 0 := 0 -| (succ n) := n -end - -example : foo 3 = 2 := rfl - -open decidable - -protected theorem dec_eq : ∀ x y : nat, decidable (x = y) -| 0 0 := is_true rfl -| (succ x) 0 := is_false (λ h, nat.no_confusion h) -| 0 (succ y) := is_false (λ h, nat.no_confusion h) -| (succ x) (succ y) := - match (dec_eq x y) with - | (is_true H) := is_true (eq.rec_on H rfl) - | (is_false H) := is_false (λ h : succ x = succ y, nat.no_confusion h (λ heq : x = y, absurd heq H)) - end - -section - open list - parameter {A : Type} - parameter (p : A → Prop) - parameter [H : decidable_pred p] - include H - - definition filter : list A → list A - | nil := nil - | (a :: l) := - match (H a) with - | (is_true h) := a :: filter l - | (is_false h) := filter l - end - - theorem filter_nil : filter nil = nil := - rfl -end - -definition sub2 (a : nat) : nat := -match a with -| 0 := 0 -| 1 := 0 -| (b+2) := b -end - -example (a : nat) : sub2 (succ (succ a)) = a := rfl diff --git a/old_tests/tests/lean/run/match4.lean b/old_tests/tests/lean/run/match4.lean deleted file mode 100644 index 6768547a42..0000000000 --- a/old_tests/tests/lean/run/match4.lean +++ /dev/null @@ -1,24 +0,0 @@ -open nat bool inhabited prod - -definition diag (a b c : bool) : nat := -match (a, b, c) with - | (b, tt, ff) := 1 - | (ff, b, tt) := 2 - | (tt, ff, b) := 3 - | (b1, b2, b3) := arbitrary nat -end - -theorem diag1 (a : bool) : diag a tt ff = 1 := -bool.cases_on a rfl rfl - -theorem diag2 (a : bool) : diag ff a tt = 2 := -bool.cases_on a rfl rfl - -theorem diag3 (a : bool) : diag tt ff a = 3 := -bool.cases_on a rfl rfl - -theorem diag4_1 : diag ff ff ff = arbitrary nat := -rfl - -theorem diag4_2 : diag tt tt tt = arbitrary nat := -rfl diff --git a/old_tests/tests/lean/run/match_anonymous_constructor.lean b/old_tests/tests/lean/run/match_anonymous_constructor.lean deleted file mode 100644 index 055f92ab67..0000000000 --- a/old_tests/tests/lean/run/match_anonymous_constructor.lean +++ /dev/null @@ -1,13 +0,0 @@ -definition p1 := (10, 20, 30) - -definition v2 : nat := -match p1 with -⟨a, b⟩ := a -end - -example : v2 = 10 := rfl - -definition v3 : nat := -match p1 with -(| a, b |) := a -end diff --git a/old_tests/tests/lean/run/match_convoy.lean b/old_tests/tests/lean/run/match_convoy.lean deleted file mode 100644 index 03ba823406..0000000000 --- a/old_tests/tests/lean/run/match_convoy.lean +++ /dev/null @@ -1,73 +0,0 @@ -definition foo (a b : bool) : bool := -match a, b with -| tt, ff := tt -| tt, tt := tt -| ff, tt := tt -| ff, ff := ff -end - -example : foo tt tt = tt := rfl -example : foo tt ff = tt := rfl -example : foo ff tt = tt := rfl -example : foo ff ff = ff := rfl - -inductive vec (A : Type) : nat → Type -| nil {} : vec nat.zero -| cons : ∀ {n}, A → vec n → vec (nat.succ n) - -open vec - -definition boo (n : nat) (v : vec bool n) : vec bool n := -match n, v : ∀ (n : _), vec bool n → _ with -| 0, nil := nil -| n+1, cons a v := cons (bnot a) v -end - - -constant bag_setoid : ∀ A, setoid (list A) -attribute [instance] bag_setoid - -noncomputable definition bag (A : Type) : Type := -quotient (bag_setoid A) - -constant subcount : ∀ {A}, list A → list A → bool -constant list.count : ∀ {A}, A → list A → nat -constant all_of_subcount_eq_tt : ∀ {A} {l₁ l₂ : list A}, subcount l₁ l₂ = tt → ∀ a, list.count a l₁ ≤ list.count a l₂ -constant ex_of_subcount_eq_ff : ∀ {A} {l₁ l₂ : list A}, subcount l₁ l₂ = ff → ∃ a, ¬ list.count a l₁ ≤ list.count a l₂ -noncomputable definition count {A} (a : A) (b : bag A) : nat := -quotient.lift_on b (λ l, list.count a l) - (λ l₁ l₂ h, sorry) -noncomputable definition subbag {A} (b₁ b₂ : bag A) := ∀ a, count a b₁ ≤ count a b₂ -infix ⊆ := subbag - -attribute [instance] -noncomputable definition decidable_subbag {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match subcount l₁ l₂, rfl : ∀ (b : _), subcount l₁ l₂ = b → _ with - | tt, H := is_true (all_of_subcount_eq_tt H) - | ff, H := is_false (λ h, - exists.elim (ex_of_subcount_eq_ff H) - (λ w hw, absurd (h w) hw)) - end) - -attribute [instance] -noncomputable definition decidable_subbag2 {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match psigma.mk (subcount l₁ l₂) rfl : (Σ' (b : _), subcount l₁ l₂ = b) → _ with - | psigma.mk tt H := is_true (all_of_subcount_eq_tt H) - | psigma.mk ff H := is_false (λ h, - exists.elim (ex_of_subcount_eq_ff H) - (λ w hw, absurd (h w) hw)) - end) - -local notation ⟦ a , b ⟧ := psigma.mk a b - -attribute [instance] -noncomputable definition decidable_subbag3 {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match ⟦subcount l₁ l₂, rfl⟧ : (Σ' (b : _), subcount l₁ l₂ = b) → _ with - | ⟦tt, H⟧ := is_true (all_of_subcount_eq_tt H) - | ⟦ff, H⟧ := is_false (λ h, - exists.elim (ex_of_subcount_eq_ff H) - (λ w hw, absurd (h w) hw)) - end) diff --git a/old_tests/tests/lean/run/match_convoy2.lean b/old_tests/tests/lean/run/match_convoy2.lean deleted file mode 100644 index e18bbf0716..0000000000 --- a/old_tests/tests/lean/run/match_convoy2.lean +++ /dev/null @@ -1,11 +0,0 @@ -inductive vec (A : Type) : nat → Type -| nil {} : vec nat.zero -| cons : ∀ {n}, A → vec n → vec (nat.succ n) - -open vec - -definition boo (n : nat) (v : vec bool n) : vec bool n := -match n, v : ∀ (n : _), vec bool n → _ with -| 0, nil := nil -| n+1, cons a v := cons (bnot a) v -end diff --git a/old_tests/tests/lean/run/match_convoy3.lean b/old_tests/tests/lean/run/match_convoy3.lean deleted file mode 100644 index 067eb8c032..0000000000 --- a/old_tests/tests/lean/run/match_convoy3.lean +++ /dev/null @@ -1,30 +0,0 @@ -constant bag_setoid : ∀ A, setoid (list A) -attribute [instance] bag_setoid - -noncomputable definition bag (A : Type) : Type := -quotient (bag_setoid A) - -constant subcount : ∀ {A}, list A → list A → bool -constant list.count : ∀ {A}, A → list A → nat -constant all_of_subcount_eq_tt : ∀ {A} {l₁ l₂ : list A}, subcount l₁ l₂ = tt → ∀ a, list.count a l₁ ≤ list.count a l₂ -constant ex_of_subcount_eq_ff : ∀ {A} {l₁ l₂ : list A}, subcount l₁ l₂ = ff → ∃ a, ¬ list.count a l₁ ≤ list.count a l₂ -noncomputable definition count {A} (a : A) (b : bag A) : nat := -quotient.lift_on b (λ l, list.count a l) - (λ l₁ l₂ h, sorry) -noncomputable definition subbag {A} (b₁ b₂ : bag A) := ∀ a, count a b₁ ≤ count a b₂ -infix ⊆ := subbag - -attribute [instance] -noncomputable definition decidable_subbag {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match subcount l₁ l₂, rfl : ∀ (b : _), subcount l₁ l₂ = b → _ with - | tt, H := is_true (all_of_subcount_eq_tt H) - | ff, H := is_false (λ h, exists.elim (ex_of_subcount_eq_ff H) (λ w hw, hw (h w))) - end) - -noncomputable definition decidable_subbag2 {A} (b₁ b₂ : bag A) : decidable (b₁ ⊆ b₂) := -quotient.rec_on_subsingleton₂ b₁ b₂ (λ l₁ l₂, - match subcount l₁ l₂, rfl : ∀ (b : _), subcount l₁ l₂ = b → _ with - | tt, H := is_true (all_of_subcount_eq_tt H) - | ff, H := is_false (λ h, exists.elim (ex_of_subcount_eq_ff H) (λ w hw, absurd (h w) hw)) - end) diff --git a/old_tests/tests/lean/run/match_expr.lean b/old_tests/tests/lean/run/match_expr.lean deleted file mode 100644 index 2e20c2795b..0000000000 --- a/old_tests/tests/lean/run/match_expr.lean +++ /dev/null @@ -1,12 +0,0 @@ -open tactic -axiom Sorry : ∀ {A:Sort*}, A - -example (a b c : nat) (h₀ : c > 0) (h₁ : a > 1) (h₂ : b > 0) : a + b + c = 0 := -by do - [x, y] ← match_target_subexpr ``(λ x y : nat, x + y) | failed, - trace "------ subterms -------", - trace x, trace y, - (h, [z]) ← match_hypothesis ``(λ x : nat, x > 1) | failed, - trace "--- hypothesis of the form x > 1 ---", - trace h, trace z, - refine ``(Sorry) diff --git a/old_tests/tests/lean/run/match_expr2.lean b/old_tests/tests/lean/run/match_expr2.lean deleted file mode 100644 index fb070f7352..0000000000 --- a/old_tests/tests/lean/run/match_expr2.lean +++ /dev/null @@ -1,14 +0,0 @@ -#exit --- import algebra.ordered_ring -open tactic -axiom Sorry : ∀ {A:Type}, A - -example {A : Type} [ordered_ring A] (a b c : A) (h₀ : c > 0) (h₁ : a > 1) (h₂ : b > 0) : a + b + c = 0 := -by do - [x, y] ← match_target_subexpr `(λ x y : A, x + y) | failed, - trace "------ subterms -------", - trace x, trace y, - (h, [z]) ← match_hypothesis `(λ x : A, x > 1) | failed, - trace "--- hypothesis of the form x > 1 ---", - trace h, trace z, - refine `(Sorry) diff --git a/old_tests/tests/lean/run/match_fun.lean b/old_tests/tests/lean/run/match_fun.lean deleted file mode 100644 index a31313099b..0000000000 --- a/old_tests/tests/lean/run/match_fun.lean +++ /dev/null @@ -1,21 +0,0 @@ -open bool nat - -definition foo (b : bool) : nat → nat := -match b with -| tt := λ x : nat, 0 -| ff := λ y : nat, (succ 0) -end - -example : foo tt 1 = 0 := rfl -example : foo ff 1 = 1 := rfl - -definition zero_fn := λ x : nat, 0 - -definition foo2 : bool → nat → nat -| tt := succ -| ff := zero_fn - -example : foo2 tt 1 = 2 := rfl -example : foo2 tt 2 = 3 := rfl -example : foo2 ff 1 = 0 := rfl -example : foo2 ff 2 = 0 := rfl diff --git a/old_tests/tests/lean/run/match_pattern1.lean b/old_tests/tests/lean/run/match_pattern1.lean deleted file mode 100644 index 1b9aa0f0e8..0000000000 --- a/old_tests/tests/lean/run/match_pattern1.lean +++ /dev/null @@ -1,15 +0,0 @@ -open tactic expr - -set_option pp.all true - -example (a b c x y : nat) (H : nat.add (nat.add x y) y = 0) : true := -by do - a ← get_local `a, b ← get_local `b, c ← get_local `c, - nat_add : expr ← mk_const `nat.add, - p : pattern ← mk_pattern [] [a, b] (app_of_list nat_add [a, b]) [] [app_of_list nat_add [b, a], a, b], - trace (pattern.moutput p), - H ← get_local `H >>= infer_type, - lhs_rhs ← match_eq H, - r ← match_pattern p (prod.fst lhs_rhs), - trace r, - constructor diff --git a/old_tests/tests/lean/run/match_pattern2.lean b/old_tests/tests/lean/run/match_pattern2.lean deleted file mode 100644 index f0e3c6cee3..0000000000 --- a/old_tests/tests/lean/run/match_pattern2.lean +++ /dev/null @@ -1,42 +0,0 @@ -open tactic list expr - -private meta definition pattern_telescope : expr → list expr → tactic (list expr × expr × expr) -| e ps := -if expr.is_pi e = tt then do - n ← mk_fresh_name, - p ← return $ local_const n (binding_name e) (binding_info e) (binding_domain e), - new_e ← return $ instantiate_var (binding_body e) p, - pattern_telescope new_e (p :: ps) -else do - (lhs, rhs) ← match_eq e, - return (reverse ps, lhs, rhs) - -meta definition mk_pattern_for_constant : name → tactic pattern -| n := -do env ← get_env, - d : declaration ← returnex $ environment.get env n, - ls : list level ← return $ map level.param (declaration.univ_params d), - (some type) ← return $ declaration.instantiate_type_univ_params d ls | failed, - (es, lhs, rhs) ← pattern_telescope type [], - p : pattern ← mk_pattern ls es lhs [] [rhs, app_of_list (expr.const n ls) es], - return p - -open nat - -constant add.comm (a b : nat) : a + b = b + a - -example (a b : nat) (H : a + b + a + b = 0) : true := -by do - a ← get_local `a, b ← get_local `b, - H ← get_local `H >>= infer_type, - (lhs, rhs) ← match_eq H, - p ← mk_pattern_for_constant $ `add.comm, - (_, [rhs_inst, prf]) ← match_pattern p lhs | failed, - trace "match rhs", - trace rhs_inst, - trace "proof lhs = rhs", - trace prf, - prf_type ← infer_type prf, - trace "proof type:", - trace prf_type, - constructor diff --git a/old_tests/tests/lean/run/match_perf_issue.lean b/old_tests/tests/lean/run/match_perf_issue.lean deleted file mode 100644 index 2aec70c9be..0000000000 --- a/old_tests/tests/lean/run/match_perf_issue.lean +++ /dev/null @@ -1,27 +0,0 @@ -def f : nat → bool -| 0 := ff -| _ := tt - -inductive tree -| leaf : nat → tree -| node : nat → tree → tree → tree - -def mk_tree : nat → nat → tree -| 0 v := tree.leaf v -| (n+1) v := - let t := mk_tree n v in - tree.node v t t - -def tst : tree → nat -| (tree.leaf v) := v -| (tree.node v l r) := - match f v with - | tt := tst l - | ff := tst r - end - -def tree.is_node : tree → bool -| (tree.leaf v) := ff -| _ := tt - -#eval timeit "tst" $ tst (mk_tree 100 10) diff --git a/old_tests/tests/lean/run/matrix.lean b/old_tests/tests/lean/run/matrix.lean deleted file mode 100644 index 793b1a197f..0000000000 --- a/old_tests/tests/lean/run/matrix.lean +++ /dev/null @@ -1,17 +0,0 @@ -constant {u} matrix : Type u → Type u -constant same_dim {A : Type} : matrix A → matrix A → Prop -constant add1 {A : Type} (m1 m2 : matrix A) {H : same_dim m1 m2} : matrix A - -theorem same_dim_irrel {A : Type} {m1 m2 : matrix A} {H1 H2 : same_dim m1 m2} : @add1 A m1 m2 H1 = @add1 A m1 m2 H2 := -rfl -open eq -theorem same_dim_eq_args {A : Type} {m1 m2 m1' m2' : matrix A} (H1 : m1 = m1') (H2 : m2 = m2') (H : same_dim m1 m2) : same_dim m1' m2' := -subst H1 (subst H2 H) - -theorem add1_congr {A : Type} (m1 m2 m1' m2' : matrix A) (H1 : m1 = m1') (H2 : m2 = m2') (H : same_dim m1 m2) : @add1 A m1 m2 H = @add1 A m1' m2' (same_dim_eq_args H1 H2 H) := -have base : ∀ (H1 : m1 = m1) (H2 : m2 = m2), @add1 A m1 m2 H = @add1 A m1 m2 (eq.rec (eq.rec H H1) H2), from - assume H1 H2, rfl, -have general : ∀ (H1 : m1 = m1') (H2 : m2 = m2'), @add1 A m1 m2 H = @add1 A m1' m2' (eq.rec (eq.rec H H1) H2), from - subst H1 (subst H2 base), -calc @add1 A m1 m2 H = @add1 A m1' m2' (eq.rec (eq.rec H H1) H2) : general H1 H2 - ... = @add1 A m1' m2' (same_dim_eq_args H1 H2 H) : same_dim_irrel diff --git a/old_tests/tests/lean/run/matrix2.lean b/old_tests/tests/lean/run/matrix2.lean deleted file mode 100644 index a6ffae2e72..0000000000 --- a/old_tests/tests/lean/run/matrix2.lean +++ /dev/null @@ -1,13 +0,0 @@ -constant {u} matrix : Type u → Type u -constant same_dim {A : Type} : matrix A → matrix A → Prop -constant add1 {A : Type} (m1 m2 : matrix A) {H : same_dim m1 m2} : matrix A -open eq -theorem same_dim_eq_args {A : Type} {m1 m2 m1' m2' : matrix A} (H1 : m1 = m1') (H2 : m2 = m2') (H : same_dim m1 m2) : same_dim m1' m2' := -subst H1 (subst H2 H) - -theorem add1_congr {A : Type} (m1 m2 m1' m2' : matrix A) (H1 : m1 = m1') (H2 : m2 = m2') (H : same_dim m1 m2) : @add1 A m1 m2 H = @add1 A m1' m2' (same_dim_eq_args H1 H2 H) := -have base : ∀ (H1 : m1 = m1) (H2 : m2 = m2), @add1 A m1 m2 H = @add1 A m1 m2 (eq.rec (eq.rec H H1) H2), from - assume H1 H2, rfl, -have general : ∀ (H1 : m1 = m1') (H2 : m2 = m2'), @add1 A m1 m2 H = @add1 A m1' m2' (eq.rec (eq.rec H H1) H2), from - subst H1 (subst H2 base), -general H1 H2 diff --git a/old_tests/tests/lean/run/max_memory.lean b/old_tests/tests/lean/run/max_memory.lean deleted file mode 100644 index ea508d40d0..0000000000 --- a/old_tests/tests/lean/run/max_memory.lean +++ /dev/null @@ -1 +0,0 @@ -set_option max_memory 40 diff --git a/old_tests/tests/lean/run/mem_nil.lean b/old_tests/tests/lean/run/mem_nil.lean deleted file mode 100644 index 2848d9581d..0000000000 --- a/old_tests/tests/lean/run/mem_nil.lean +++ /dev/null @@ -1,4 +0,0 @@ -universe variables u - -example {α : Type u} (a : α) : a ∉ ([] : list α) := -sorry diff --git a/old_tests/tests/lean/run/meta1.lean b/old_tests/tests/lean/run/meta1.lean deleted file mode 100644 index 3fccf819aa..0000000000 --- a/old_tests/tests/lean/run/meta1.lean +++ /dev/null @@ -1,5 +0,0 @@ -definition bla (a : nat) := a - -meta definition foo (a : nat) := bla a - -meta constant A : nat diff --git a/old_tests/tests/lean/run/meta2.lean b/old_tests/tests/lean/run/meta2.lean deleted file mode 100644 index b368882c15..0000000000 --- a/old_tests/tests/lean/run/meta2.lean +++ /dev/null @@ -1,11 +0,0 @@ -import system.io -open io - -meta definition foo : nat → nat -| a := nat.cases_on a 1 (λ n, foo n + 2) - -#eval (foo 10) - - -meta definition loop : nat → io unit -| a := do put_str ">> ", print a, put_str "\n", loop (a+1) diff --git a/old_tests/tests/lean/run/meta3.lean b/old_tests/tests/lean/run/meta3.lean deleted file mode 100644 index 4b49fc4a91..0000000000 --- a/old_tests/tests/lean/run/meta3.lean +++ /dev/null @@ -1,3 +0,0 @@ -#check `foo.bla - -#eval mk_num_name (`foo.bla) 10 diff --git a/old_tests/tests/lean/run/meta_aux_defs.lean b/old_tests/tests/lean/run/meta_aux_defs.lean deleted file mode 100644 index 7427e28822..0000000000 --- a/old_tests/tests/lean/run/meta_aux_defs.lean +++ /dev/null @@ -1,55 +0,0 @@ -def f : nat → nat -| 0 := 1 -| (n+1) := f n + 10 - -#print f._main._meta_aux - -#print nat.add._main._meta_aux - --- set_option trace.debug.eqn_compiler.wf_rec true -mutual def even, odd -with even : nat → bool -| 0 := tt -| (n+1) := odd n -with odd : nat → bool -| 0 := ff -| (n+1) := even n - -#print even._main - -#print even._main._meta_aux -#print odd._main._meta_aux - -def fib : nat → nat -| 0 := 1 -| 1 := 1 -| (n+2) := fib (n+1) + fib n - -#eval fib 2 - -inductive stmt -| dec : stmt -| while : stmt → stmt -| print : string → stmt -| seq : stmt → stmt → stmt - -def eval : nat → nat → string → stmt → option (nat × string) -| (f+1) v o (stmt.print s) := some (v, o ++ s) -| (f+1) v o stmt.dec := some (v - 1, o) -| (f+2) v o (stmt.seq s₁ s₂) := - match eval (f+1) v o s₁ with - | some (v₁, o₁) := eval f v₁ o₁ s₂ - | none := none - end -| (f+2) v o (stmt.while s) := - if v > 0 then - match eval (f+1) v o s with - | some (v₁, o₁) := eval f v₁ o₁ (stmt.while s) - | none := none - end - else - some (v, o) -| _ v o s := none - -/- The performance of the following eval should not depend on the first argument. -/ -#eval eval 1000000000 3 "" (stmt.while (stmt.seq stmt.dec (stmt.print "hello\n"))) diff --git a/old_tests/tests/lean/run/meta_env1.lean b/old_tests/tests/lean/run/meta_env1.lean deleted file mode 100644 index bb10a1abac..0000000000 --- a/old_tests/tests/lean/run/meta_env1.lean +++ /dev/null @@ -1,47 +0,0 @@ -open list - -meta definition e := environment.mk_std 0 - -definition hints := reducibility_hints.regular 10 tt - -#eval environment.trust_lvl e - -#eval (environment.add e (declaration.defn `foo [] - (expr.sort (level.succ (level.zero))) - (expr.sort (level.succ (level.zero))) - hints tt) : exceptional environment) - -meta definition e1 := (environment.add e (declaration.defn `foo [] - (expr.sort (level.succ (level.zero))) - (expr.sort level.zero) - hints tt) : exceptional environment) - -#print "-----------" -open name - -#eval do - e₁ ← environment.add e (declaration.defn `foo [] - (expr.sort (level.succ (level.zero))) - (expr.sort level.zero) - hints tt), - e₂ ← environment.add_inductive e₁ `Two [] 0 (expr.sort (level.succ level.zero)) - [(`Zero, expr.const `Two []), - (`One, expr.const `Two [])] tt, - d₁ ← environment.get e₂ `Zero, - d₂ ← environment.get e₂ `foo, - /- TODO(leo): use - - return (declaration.type d) - - We currently don't use 'return' because the type is too high-order. - - return : ∀ {m : Type → Type} [monad m] {A : Type}, A → m A - It is the kind of example where we should fallback to first-order unification for - inferring the (m : Type → Type) - - The new elaborator should be able to handle it. - -/ - exceptional.success (declaration.type d₁, declaration.type d₂, - environment.is_recursor e₂ `Two.rec, - environment.constructors_of e₂ `Two, - environment.fold e₂ (to_fmt "") (λ d r, r ++ format.line ++ to_fmt (declaration.to_name d))) diff --git a/old_tests/tests/lean/run/meta_expr1.lean b/old_tests/tests/lean/run/meta_expr1.lean deleted file mode 100644 index 70677e61d2..0000000000 --- a/old_tests/tests/lean/run/meta_expr1.lean +++ /dev/null @@ -1,58 +0,0 @@ -open unsigned list - -meta definition e1 := expr.app (expr.app (expr.const `f []) (expr.mk_var 1)) (expr.const `a []) -meta definition e1' := expr.app (expr.app (expr.const `f []) (expr.mk_var 1)) (expr.const `a []) - -meta definition tst : e1 = e1' := -rfl - -#eval e1 - -#eval expr.fold e1 (0:nat) (λ e d n, n+1) - -meta definition l1 := expr.lam `a binder_info.default (expr.sort level.zero) (expr.mk_var 0) -meta definition l2 := expr.lam `b binder_info.default (expr.sort level.zero) (expr.mk_var 0) -meta definition l3 := expr.lam `a binder_info.default (expr.const `nat []) (expr.mk_var 0) - -#eval l1 -#eval l2 -#eval l3 -#eval decidable.to_bool (l1 = l2) -#eval decidable.to_bool (l1 =ₐ l2) - -#eval expr.lex_lt (expr.const `a []) (expr.const `b []) -#eval expr.lt (expr.const `a []) (expr.const `b []) - -meta definition v1 := expr.app (expr.app (expr.const `f []) (expr.mk_var 0)) (expr.mk_var 1) - -#eval v1 -#eval expr.instantiate_var v1 (expr.const `a []) - -#eval expr.instantiate_vars v1 [expr.const `a [], expr.const `b []] - -meta definition fv1 : expr := -expr.app - (expr.app (expr.const `f []) - (expr.local_const `a `a binder_info.default (expr.sort level.zero))) - (expr.local_const `b `b binder_info.default (expr.sort level.zero)) - -#eval fv1 - -#eval expr.abstract_local (expr.abstract_local fv1 `a) `b -#eval expr.abstract_locals fv1 [`a, `b] -#eval expr.abstract_locals fv1 [`b, `a] -#eval expr.lift_vars (expr.abstract_locals fv1 [`b, `a]) 1 1 -#eval expr.has_local fv1 -#eval expr.has_var fv1 -#eval expr.has_var (expr.abstract_locals fv1 [`b, `a]) - -meta definition foo : nat → expr -| 0 := expr.const `aa [level.zero, level.succ level.zero] -| (n+1) := foo n - -/- -#eval match foo 10 with -| expr.const n ls := list.head (list.tail ls) -| _ := level.zero -end --/ diff --git a/old_tests/tests/lean/run/meta_level1.lean b/old_tests/tests/lean/run/meta_level1.lean deleted file mode 100644 index 2831a8a9f3..0000000000 --- a/old_tests/tests/lean/run/meta_level1.lean +++ /dev/null @@ -1,22 +0,0 @@ -import system.io -open io - -#eval do pp (level.max (level.succ level.zero) (level.param `foo)), put_str "\n" - -#eval level.normalize (level.succ (level.max (level.max level.zero (level.succ level.zero)) (level.param `l₁))) - -#eval level.imax (level.mvar `m) (level.of_nat 10) - -#eval if level.zero = level.zero then "eq" else "neq" - -#eval level.occurs (level.param `l2) (level.max (level.param `l1) (level.param `l2)) - -#eval level.occurs (level.param `l3) (level.max (level.param `l1) (level.param `l2)) - -#eval level.eqv (level.max (level.param `l1) (level.param `l2)) (level.max (level.param `l2) (level.param `l1)) - -#eval level.eqv (level.max (level.param `l1) (level.param `l2)) (level.max (level.param `l2) (level.param `l2)) - -#eval level.has_param (level.max (level.param `l1) (level.param `l2)) `l1 -#eval level.has_param (level.max (level.param `l1) (level.param `l2)) `l2 -#eval level.has_param (level.max (level.param `l1) (level.param `l2)) `l3 diff --git a/old_tests/tests/lean/run/meta_mutual.lean b/old_tests/tests/lean/run/meta_mutual.lean deleted file mode 100644 index 0d3a228554..0000000000 --- a/old_tests/tests/lean/run/meta_mutual.lean +++ /dev/null @@ -1,17 +0,0 @@ -namespace foo - -meta mutual def even, odd -with even : nat → bool -| 0 := tt -| (n+1) := odd n -with odd : nat → bool -| 0 := ff -| (n+1) := even n - -#eval even 10 -#eval even 11 - -end foo - -#print foo.even._main -#print foo.odd._main diff --git a/old_tests/tests/lean/run/meta_tac1.lean b/old_tests/tests/lean/run/meta_tac1.lean deleted file mode 100644 index 2207e8f60f..0000000000 --- a/old_tests/tests/lean/run/meta_tac1.lean +++ /dev/null @@ -1,30 +0,0 @@ -set_option pp.all true - -open tactic list - -set_option pp.goal.compact true -set_option pp.binder_types true - -example : ∀ (p : Prop), p → p := -by do env ← get_env, - trace "testing", - intros, - assumption - -example : ∀ (p : Prop), p → p → p := -by do d ← get_decl $ `nat.add, - trace $ declaration.type d, - trace "nat.rec type:", - d ← get_decl $ `nat.rec, - trace $ declaration.type d, - trace_state, - r ← result, - trace r, - intro_lst [`_, `H1, `H2], - trace "-----------", - trace_result, - trace "-----------", - trace_state, - assumption, - trace "-----------", - trace_result diff --git a/old_tests/tests/lean/run/meta_tac2.lean b/old_tests/tests/lean/run/meta_tac2.lean deleted file mode 100644 index 063f025fbf..0000000000 --- a/old_tests/tests/lean/run/meta_tac2.lean +++ /dev/null @@ -1,60 +0,0 @@ -set_option pp.all true - -open tactic name list - -set_option pp.goal.compact true -set_option pp.binder_types true -set_option pp.delayed_abstraction true - -example : ∀ (p : Prop), p → p → p := -by do - intro_lst [`_, `H1, `H2], - trace_state, - trace_result, - trace "---------", - get_local `H1 >>= revert, - trace_state, - trace_result, - intro `H3, - trace_result, - assumption, - trace_result, - return () - -#print "=====================" - -example : ∀ (p : Prop), p → p → p := -by do - intro_lst [`_, `H1, `H2], - H1 ← get_local `H1, H2 ← get_local `H2, - revert_lst [H1, H2], - trace_state, - trace_result, - intro `H3, - trace_state, - trace "------------", - trace_result, - (assumption <|> trace "assumption failed"), - intro `H4, - assumption, - trace "------------", - trace_result, - return () - -#print "=====================" - -example : ∀ (p : Prop), p → p → p := -by do - intros, - get_local `p >>= revert, - trace_state, - trace_result, - trace "----------", - intro `p, - trace_state, - trace_result, - trace "----------", - intro_lst [`H1, `H2], - assumption, - trace_result, - return () diff --git a/old_tests/tests/lean/run/meta_tac3.lean b/old_tests/tests/lean/run/meta_tac3.lean deleted file mode 100644 index b3bfd66744..0000000000 --- a/old_tests/tests/lean/run/meta_tac3.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic name list - -set_option pp.goal.compact true -set_option pp.binder_types true - -example : ∀ (A B : Prop), A → A ∧ B → A → A := -by do - intro_lst [`_, `_, `H1, `H2, `H3], - trace_state, - h2 ← get_local `H2, - infer_type h2 >>= trace, - h1 ← get_local `H1, - h3 ← get_local `H3, - unify h1 h3, - (unify h2 h3 <|> trace "fail to unify H2 =?= H3"), - assumption, - trace_state, - result >>= trace, - trace "--------------", - return () diff --git a/old_tests/tests/lean/run/meta_tac4.lean b/old_tests/tests/lean/run/meta_tac4.lean deleted file mode 100644 index c826ee7724..0000000000 --- a/old_tests/tests/lean/run/meta_tac4.lean +++ /dev/null @@ -1,21 +0,0 @@ -open tactic name list - -definition foo (a : nat) := a + 1 > 0 -attribute [reducible] -definition boo (a : nat) := a + 1 > 0 - -example : ∀ (a b : nat), foo a → boo a → a + 1 > 0 → foo a := -by do - intro_lst [`_, `_, `H1, `H2, `H3], - trace_state, - h1 ← get_local_type `H1, - h2 ← get_local_type `H2, - h3 ← get_local_type `H3, - unify h1 h2, - unify h2 h3, - unify h1 h3, - (unify h1 h2 reducible <|> trace "H1 =?= H2 failed if only reducible constants can be unfolded"), - unify h2 h3 reducible, - (unify h1 h3 reducible <|> trace "H1 =?= H3 failed if only reducible constants can be unfolded"), - assumption, - return () diff --git a/old_tests/tests/lean/run/meta_tac5.lean b/old_tests/tests/lean/run/meta_tac5.lean deleted file mode 100644 index 3c52e6814a..0000000000 --- a/old_tests/tests/lean/run/meta_tac5.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic name list - -set_option pp.goal.compact true -set_option pp.beta false -set_option pp.binder_types true - -example : ∀ (A B : Prop), A → A ∧ B → A → A ∧ B := -by do - intro_lst [`_, `_, `H1, `H2, `H3], - trace_state, - rename `H2 `H5, - trace_state, - r ← get_local_type `H5, - trace r, - trace "----------", - assumption, - trace_state, - r ← result, - trace r, - return () diff --git a/old_tests/tests/lean/run/meta_tac6.lean b/old_tests/tests/lean/run/meta_tac6.lean deleted file mode 100644 index ccfeef82de..0000000000 --- a/old_tests/tests/lean/run/meta_tac6.lean +++ /dev/null @@ -1,26 +0,0 @@ -open tactic name list - -set_option pp.goal.compact true -set_option pp.binder_types true - -example : ∀ (A B : Prop), A → A ∧ B → A → A := -by do - intro_lst [`_, `_, `H1, `H2, `H3], - n : nat ← num_goals, - ctx : list expr ← local_context, - trace "Context: ", - for_each ctx (λ e, - do t ← infer_type e, - fmt₁ ← pp e, - fmt₂ ← pp t, - trace $ fmt₁ ++ to_fmt " : " ++ fmt₂), - trace "----------", - trace $ "num: " ++ to_string n, - trace_state, - get_local `H3 >>= clear, - (do {get_local `H3, return ()} <|> trace "get_local failed"), - trace_state, - assumption, - n : nat ← num_goals, - trace $ "num: " ++ to_string n, - return () diff --git a/old_tests/tests/lean/run/meta_tac7.lean b/old_tests/tests/lean/run/meta_tac7.lean deleted file mode 100644 index a39b86eeb7..0000000000 --- a/old_tests/tests/lean/run/meta_tac7.lean +++ /dev/null @@ -1,9 +0,0 @@ -open nat tactic - -example (a b c : Prop) (Ha : a) (Hb : b) (Hc : c) : b := -by do trace_state, assumption - -definition ex1 (a b c : Prop) : a → b → c → b := -by do intros, assumption - -#print ex1 diff --git a/old_tests/tests/lean/run/mixed_tmp_non_tmp_universe_bug.lean b/old_tests/tests/lean/run/mixed_tmp_non_tmp_universe_bug.lean deleted file mode 100644 index 6b9da80154..0000000000 --- a/old_tests/tests/lean/run/mixed_tmp_non_tmp_universe_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -#reduce default (bool × unit × nat) -#reduce default (bool × bool × bool × bool) diff --git a/old_tests/tests/lean/run/mk_byte.lean b/old_tests/tests/lean/run/mk_byte.lean deleted file mode 100644 index b0c261434f..0000000000 --- a/old_tests/tests/lean/run/mk_byte.lean +++ /dev/null @@ -1,40 +0,0 @@ -import data.vector namespace Ex -universe u --- def vector (α : Type u) (n : ℕ) := { l : list α // l.length = n } -namespace vector -variables {α : Type u} {n : ℕ} -@[pattern] def cons : α → vector α n → vector α (nat.succ n) -| a ⟨ v, h ⟩ := ⟨ a::v, congr_arg nat.succ h ⟩ - -def to_list' (v : vector α n) : list α := v.1 - -def drop (i : ℕ) : vector α n → vector α (n - i) -| ⟨l, p⟩ := ⟨ list.drop i l, by simp * ⟩ - -protected axiom eq {n : ℕ} : ∀ (a1 a2 : vector α n), to_list' a1 = to_list' a2 → a1 = a2 - -@[simp] axiom to_list'_cons (a : α) (v : vector α n) : to_list' (cons a v) = list.cons a (to_list' v) - -@[simp] axiom to_list'_drop {n m : ℕ} (v : vector α m) : to_list' (drop n v) = list.drop n (to_list' v) -end vector - -open Ex.vector - -@[reducible] def bitvec (n : ℕ) := vector bool n - -def byte_type := bitvec 8 - --- A byte is formed from concatenating two bits and a 6-bit field. -def mk_byte (a b : bool) (l : bitvec 6) : byte_type := cons a (cons b l) - --- Get the third component -def get_data (byte : byte_type) : bitvec 6 := vector.drop 2 byte - -lemma get_data_mk_byte {a b : bool} {l : bitvec 6} : get_data (mk_byte a b l) = l := -begin - apply vector.eq, - unfold mk_byte, - unfold get_data, - simp -end -end Ex diff --git a/old_tests/tests/lean/run/mk_dec_eq1.lean b/old_tests/tests/lean/run/mk_dec_eq1.lean deleted file mode 100644 index a26f43311e..0000000000 --- a/old_tests/tests/lean/run/mk_dec_eq1.lean +++ /dev/null @@ -1,34 +0,0 @@ -open tactic - -namespace test - -inductive enum1 : Type | ea | eb | ec | ed - -instance enum1_dec_eq : decidable_eq enum1 := -by mk_dec_eq_instance - -inductive Expr -| var : nat → Expr -| app : ∀ (n : nat) (e1 : Expr) (e2 : Expr) (e3 : Expr) (e4 : Expr), Expr -| Elet : Expr → Expr -| bla : list nat → Expr - -instance Expr_has_dec_eq : decidable_eq Expr := -by mk_dec_eq_instance -universe variables u v -def prod_decidable {A : Type u} {B : Type v} [decidable_eq A] [decidable_eq B] : decidable_eq (A × B) := -by mk_dec_eq_instance - -def sum_decidable {A : Type u} {B : Type v} [decidable_eq A] [decidable_eq B] : decidable_eq (sum A B) := -by mk_dec_eq_instance - -def nat_decidable : decidable_eq nat := -by mk_dec_eq_instance - -def list_decidable {A : Type u} [decidable_eq A] : decidable_eq (list A) := -by mk_dec_eq_instance - -def option_decidable {A : Type v} [decidable_eq A] : decidable_eq (option A) := -by mk_dec_eq_instance - -end test diff --git a/old_tests/tests/lean/run/mk_dec_eq_instance_indices.lean b/old_tests/tests/lean/run/mk_dec_eq_instance_indices.lean deleted file mode 100644 index 5d8e75e518..0000000000 --- a/old_tests/tests/lean/run/mk_dec_eq_instance_indices.lean +++ /dev/null @@ -1,46 +0,0 @@ -open tactic - -namespace X1 - -inductive Foo : unit -> Type -| mk : Foo () -> Foo () - -instance (u : unit) : decidable_eq (Foo u) := by mk_dec_eq_instance - -end X1 - -namespace X2 - -inductive Foo : bool -> bool -> Type -| mk₁ : Foo tt tt -| mk₂ : Foo ff ff -> Foo tt ff - -instance (idx₁ idx₂ : bool) : decidable_eq (Foo idx₁ idx₂) := by mk_dec_eq_instance - -end X2 - -namespace X3 - -constants (C : nat -> Type) -constants (c : Pi (n : nat), C n) - -inductive Foo : Pi (n : nat), C n -> Type -| mk₁ : Pi (n : nat), Foo n (c n) -> Foo (n+1) (c (n+1)) -| mk₂ : Foo 0 (c 0) - -noncomputable instance (n : nat) (c : C n) : decidable_eq (Foo n c) := by mk_dec_eq_instance - -end X3 - -namespace X4 - -inductive Foo -| mk (n : nat) (val : fin n) - -def fin_decidable (n) : decidable_eq (fin n) := -by mk_dec_eq_instance - -def dep_decidable : decidable_eq Foo := -by mk_dec_eq_instance - -end X4 diff --git a/old_tests/tests/lean/run/mk_dec_eq_instance_nested.lean b/old_tests/tests/lean/run/mk_dec_eq_instance_nested.lean deleted file mode 100644 index 8bc5f46570..0000000000 --- a/old_tests/tests/lean/run/mk_dec_eq_instance_nested.lean +++ /dev/null @@ -1,31 +0,0 @@ -open tactic - -namespace X1 - -inductive Wrap (A : Type) : Type -| mk : A -> Wrap - -inductive Foo : Type -| mk : Wrap Foo -> Foo - -instance : decidable_eq Foo := by mk_dec_eq_instance - -end X1 - -namespace X2 - -inductive Foo : Type -| mk : list Foo -> Foo - -instance : decidable_eq Foo := by mk_dec_eq_instance - -end X2 - -namespace X3 - -inductive Foo : bool -> Type -| mk : list (list (Foo tt)) -> Foo ff - -instance (b : bool) : decidable_eq (Foo b) := by mk_dec_eq_instance - -end X3 diff --git a/old_tests/tests/lean/run/mk_inhabited1.lean b/old_tests/tests/lean/run/mk_inhabited1.lean deleted file mode 100644 index efd321e939..0000000000 --- a/old_tests/tests/lean/run/mk_inhabited1.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -definition nat_inhabited : inhabited nat := -by mk_inhabited_instance - -definition list_inhabited {A : Type} : inhabited (list A) := -by mk_inhabited_instance - -definition prod_inhabited {A B : Type} [inhabited A] [inhabited B] : inhabited (A × B) := -by mk_inhabited_instance - -definition sum_inhabited₁ {A B : Type} [inhabited A] : inhabited (sum A B) := -by mk_inhabited_instance - -definition sum_inhabited₂ {A B : Type} [inhabited B] : inhabited (sum A B) := -by mk_inhabited_instance diff --git a/old_tests/tests/lean/run/mk_instance1.lean b/old_tests/tests/lean/run/mk_instance1.lean deleted file mode 100644 index 870b98f568..0000000000 --- a/old_tests/tests/lean/run/mk_instance1.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -example (a b : nat) : decidable (a = b) := -by do t ← mk_app `decidable_eq [expr.const `nat []], - i ← mk_instance t, - a ← get_local `a, - b ← get_local `b, - trace i, - exact (expr.app_of_list i [a, b]) - -example (a b : nat) : decidable (a = b) := -by do t ← target, - i ← mk_instance t, - trace i, - exact i - -example (a b : nat) : decidable (a = b) := -by target >>= mk_instance >>= exact diff --git a/old_tests/tests/lean/run/monad_error_problem.lean b/old_tests/tests/lean/run/monad_error_problem.lean deleted file mode 100644 index 7221c1c25a..0000000000 --- a/old_tests/tests/lean/run/monad_error_problem.lean +++ /dev/null @@ -1,27 +0,0 @@ -namespace issue -universes u v w -class monad_error (ε : out_param $ Type u) (m : Type w → Type v) := -[monad_m : monad m] -(fail : Π {α : Type w}, ε → m α) - -set_option pp.all true - -def unreachable {α} {m} [monad_error string m] : m α := -monad_error.fail m "unreachable" - -#check @unreachable -end issue - -namespace original_issue -universes u v -class monad_error (ε : out_param $ Type u) (m : Type u → Type v) := -[monad_m : monad m] -(fail : Π {α : Type u}, ε → m α) - -set_option pp.all true - -def unreachable {α} {m} [monad_error string m] : m α := -monad_error.fail m "unreachable" - -#check @unreachable -end original_issue diff --git a/old_tests/tests/lean/run/monad_univ_lift.lean b/old_tests/tests/lean/run/monad_univ_lift.lean deleted file mode 100644 index 012f22a8d7..0000000000 --- a/old_tests/tests/lean/run/monad_univ_lift.lean +++ /dev/null @@ -1,31 +0,0 @@ -universe variables u v - -def M : Type u → Type v := -sorry - -instance : monad M := -sorry - -def act1 : M unit := -return () - -def act2 : M (Σ (A : Type), A) := -return ⟨nat, 0⟩ - - -def {t s} up {A : Type s} (a : M A) : M (ulift.{t} A) := -sorry - -def {t s} down {A : Type s} (a : M (ulift.{t} A)) : M A := -sorry - -prefix `↑`:10 := up.{1} -prefix `↓`:10 := down.{1} - -def ex : M unit := -↓do - ↑act1, - act2, - ↑act1, - act2, - ↑act1 diff --git a/old_tests/tests/lean/run/mrw.lean b/old_tests/tests/lean/run/mrw.lean deleted file mode 100644 index 6b8130151b..0000000000 --- a/old_tests/tests/lean/run/mrw.lean +++ /dev/null @@ -1,6 +0,0 @@ -example (n : nat) : ∃ x, x + n = n + 1 := -begin - constructor, - fail_if_success {rw [zero_add] {unify := ff}}, - rw [add_comm] -end diff --git a/old_tests/tests/lean/run/mutual_inductive.lean b/old_tests/tests/lean/run/mutual_inductive.lean deleted file mode 100644 index 7a654501ba..0000000000 --- a/old_tests/tests/lean/run/mutual_inductive.lean +++ /dev/null @@ -1,126 +0,0 @@ -namespace X1 - -mutual inductive foo, bar -with foo : Type -| mk : foo -with bar : Type -| mk : bar - -#check @foo -#check @bar -#check @foo.rec -#check @bar.rec -#check @foo.has_sizeof_inst -#check @bar.has_sizeof_inst -end X1 - -namespace X2 - -mutual inductive foo, bar -with foo : Type -| mk : bar -> foo -with bar : Type -| mk : foo -> bar - -#check @foo -#check @bar -#check @foo.rec -#check @bar.rec -#check @foo.has_sizeof_inst -#check @bar.has_sizeof_inst -end X2 - -namespace X3 - -mutual inductive foo, bar -with foo : bool -> Type -| mk : bar -> foo tt -with bar : Type -| mk : foo tt -> bar - -#check @foo -#check @bar -#check @foo.rec -#check @bar.rec -#check @foo.has_sizeof_inst -#check @bar.has_sizeof_inst -end X3 - -namespace X4 - -mutual inductive foo, bar, rig -with foo : bool -> bool -> Type -| mk : bar tt -> foo tt tt -with bar : bool -> Type -| mk : foo tt tt -> bar tt -with rig : Type -| mk : foo tt tt -> bar tt -> rig - -#check @foo -#check @bar -#check @rig -#check @foo.rec -#check @bar.rec -#check @rig.rec -#check @foo.has_sizeof_inst -#check @bar.has_sizeof_inst -#check @rig.has_sizeof_inst -end X4 - -namespace X5 -mutual inductive foo, bar, rig (A : Type) -with foo : Pi (b : bool), b = b -> Type -| mk : A -> bar tt ff tt -> foo tt rfl -with bar : bool -> bool -> bool -> Type -| mk : A -> foo tt rfl -> bar tt ff tt -with rig : Type -| mk : A -> foo tt rfl -> bar tt ff tt -> rig -| put : A -> foo tt rfl -> bar tt ff tt -> rig - -#check @foo -#check @bar -#check @rig -#check @foo.rec -#check @bar.rec -#check @rig.rec -#check @foo.has_sizeof_inst -#check @bar.has_sizeof_inst -#check @rig.has_sizeof_inst -end X5 - -namespace X6 - -mutual inductive {l₁ l₂} foo, bar, rig (A : Type.{l₁}) (B : Type.{l₂}) -with foo : Pi (b : bool), b = b -> Type.{max l₁ l₂} -| mk : A -> B -> bar tt ff tt -> foo tt rfl -with bar : bool -> bool -> bool -> Type.{max l₁ l₂} -| mk : A -> B -> foo tt rfl -> bar tt ff tt -with rig : Type.{max l₁ l₂} -| mk : A -> B -> foo tt rfl -> bar tt ff tt -> rig - -#check @foo -#check @bar -#check @rig -#check @foo.rec -#check @bar.rec -#check @rig.rec -end X6 - -namespace X7 - -mutual inductive {l₁ l₂ l₃} foo, bar, rig (A : Type.{l₁}) (B : Type.{l₂}) (a : A) -with foo : Pi (b : bool), b = b -> Type.{max l₁ l₂ l₃} -| mk : A -> B -> Pi x : A, x = a -> bar tt ff tt -> foo tt rfl -with bar : bool -> bool -> bool -> Type.{max l₁ l₂ l₃} -| mk : A -> B -> foo tt rfl -> bar tt ff tt -with rig : Type.{max l₁ l₂ l₃} -| mk : A -> B -> (Pi x : A, x = a -> foo tt rfl) -> bar tt ff tt -> rig - -#check @foo -#check @bar -#check @rig -#check @foo.rec -#check @bar.rec -#check @rig.rec - -end X7 diff --git a/old_tests/tests/lean/run/mutual_parameter.lean b/old_tests/tests/lean/run/mutual_parameter.lean deleted file mode 100644 index ce6640d19b..0000000000 --- a/old_tests/tests/lean/run/mutual_parameter.lean +++ /dev/null @@ -1,17 +0,0 @@ -section -parameter (k : ℕ) - -mutual def foo, bar -with foo : ℕ → ℕ -| 0 := k -| (n+1) := bar n -with bar : ℕ → ℕ -| 0 := k+10 -| (n+1) := foo n - -def baz : ℕ := foo 3 - -def foo' (n : ℕ) := k+n -def baz' : ℕ := foo' 3 - -end \ No newline at end of file diff --git a/old_tests/tests/lean/run/mvar_backtrack.lean b/old_tests/tests/lean/run/mvar_backtrack.lean deleted file mode 100644 index 4c77fe8855..0000000000 --- a/old_tests/tests/lean/run/mvar_backtrack.lean +++ /dev/null @@ -1,14 +0,0 @@ -namespace foo -open nat - -class lt (n : out_param ℕ) (m : ℕ) -instance succ_lt_succ_of_lt (n m) [lt n m] : lt (succ n) (succ m) := by constructor -instance zero_lt_succ (m) : lt 0 (succ m) := by constructor - -class foo (n : out_param ℕ) (m : ℕ) -instance (n m) [lt n 10] [lt m n] : foo n m := by constructor - -def bar {n} (m) [foo n m] := n -#eval bar 0 -#eval bar 1 -end foo diff --git a/old_tests/tests/lean/run/my_tac_class.lean b/old_tests/tests/lean/run/my_tac_class.lean deleted file mode 100644 index 272fe7f58c..0000000000 --- a/old_tests/tests/lean/run/my_tac_class.lean +++ /dev/null @@ -1,68 +0,0 @@ -meta def mytac := -state_t nat tactic - -section -local attribute [reducible] mytac -meta instance : monad mytac := by apply_instance -meta instance : monad_state nat mytac := by apply_instance -meta instance : has_monad_lift tactic mytac := by apply_instance -end - -meta instance (α : Type) : has_coe (tactic α) (mytac α) := -⟨monad_lift⟩ - -namespace mytac - -meta def step {α : Type} (t : mytac α) : mytac unit := -t >> return () - -meta def istep {α : Type} (line0 col0 line col : nat) (t : mytac α) : mytac unit := -⟨λ v s, result.cases_on (@scope_trace _ line col (λ_, t.run v s)) - (λ ⟨a, v⟩ new_s, result.success ((), v) new_s) - (λ opt_msg_thunk e new_s, - match opt_msg_thunk with - | some msg_thunk := - let msg := λ _ : unit, msg_thunk () ++ format.line ++ to_fmt "value: " ++ to_fmt v ++ format.line ++ to_fmt "state:" ++ format.line ++ new_s^.to_format in - interaction_monad.result.exception (some msg) (some ⟨line, col⟩) new_s - | none := interaction_monad.silent_fail new_s - end)⟩ - -meta def execute (tac : mytac unit) : tactic unit := -tac.run 0 >> return () - -meta def save_info (p : pos) : mytac unit := -do v ← get, - s ← tactic.read, - tactic.save_info_thunk p - (λ _, to_fmt "Custom state: " ++ to_fmt v ++ format.line ++ - tactic_state.to_format s) - -namespace interactive -meta def intros : mytac unit := -tactic.intros >> return () - -meta def constructor : mytac unit := -tactic.constructor >> return () - -meta def trace (s : string) : mytac unit := -tactic.trace s - -meta def assumption : mytac unit := -tactic.assumption - -meta def inc : mytac punit := -modify (+1) - -end interactive -end mytac - -example (p q : Prop) : p → q → p ∧ q := -begin [mytac] - intros, - inc, - trace "test", - constructor, - inc, - assumption, - assumption -end diff --git a/old_tests/tests/lean/run/n3.lean b/old_tests/tests/lean/run/n3.lean deleted file mode 100644 index 34cc76fb18..0000000000 --- a/old_tests/tests/lean/run/n3.lean +++ /dev/null @@ -1,23 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -constant N : Type.{1} -constant and : Prop → Prop → Prop -infixr `∧`:35 := and -constant le : N → N → Prop -constant lt : N → N → Prop -constant f : N → N -constant add : N → N → N -infixl `+`:65 := add -precedence `≤`:50 -precedence `<`:50 -infixl ≤ := le -infixl < := lt -notation A ≤ B:prev ≤ C:prev := A ≤ B ∧ B ≤ C -notation A ≤ B:prev < C:prev := A ≤ B ∧ B < C -notation A < B:prev ≤ C:prev := A < B ∧ B ≤ C -constants a b c d e : N -#check a ≤ b ≤ f c + b ∧ a < b -#check a ≤ d -#check a < b ≤ c -#check a ≤ b < c -#check a < b diff --git a/old_tests/tests/lean/run/n5.lean b/old_tests/tests/lean/run/n5.lean deleted file mode 100644 index 9956924d54..0000000000 --- a/old_tests/tests/lean/run/n5.lean +++ /dev/null @@ -1,21 +0,0 @@ -prelude -constant N : Type.{1} -constant f : N → N → N → N -constant g : N → N → N -constant h : N → N → N → N -constant s : N → N → N → N → N - -precedence `*`:75 -precedence `|`:75 - -notation a * b:prev | c:prev := f a b c -notation a * b := g a b -notation a * b * c:prev := h a b c -notation a * b | c * d:prev := s a b c d - -constants a b c d e : N - -#check a * b -#check a * b | d -#check a * b * c -#check a * b | d * e diff --git a/old_tests/tests/lean/run/name_resolution_at_tactic_execution_time.lean b/old_tests/tests/lean/run/name_resolution_at_tactic_execution_time.lean deleted file mode 100644 index 09f1d26ad1..0000000000 --- a/old_tests/tests/lean/run/name_resolution_at_tactic_execution_time.lean +++ /dev/null @@ -1,16 +0,0 @@ -structure Foo : Type := (foo : ℕ) -open Foo -set_option pp.all true - -example (P : Prop) : P → P -| foo := by exact foo - -example (P : Prop) : P → P -| bla := - begin - rename bla foo, - exact foo - end - -example (f : Foo) : nat := -by exact foo f diff --git a/old_tests/tests/lean/run/name_resolution_with_params_bug.lean b/old_tests/tests/lean/run/name_resolution_with_params_bug.lean deleted file mode 100644 index 27f232ca87..0000000000 --- a/old_tests/tests/lean/run/name_resolution_with_params_bug.lean +++ /dev/null @@ -1,30 +0,0 @@ -section - - parameters x y : nat - def z := x + y - - lemma h0 : z = y + x := add_comm _ _ - - open tactic - - theorem foo₁ : z = y + x := -- doesn't work - begin - rw h0 - end - - - - - theorem foo₃ : z = y + x := -- doesn't work - by rewrite h0 - - theorem foo₄ : z = y + x := -- doesn't work - begin - simp [h0] - end - - theorem foo₅ : z = y + x := -- doesn't work - begin [smt] - ematch_using [h0] - end -end diff --git a/old_tests/tests/lean/run/namespace_local.lean b/old_tests/tests/lean/run/namespace_local.lean deleted file mode 100644 index e79b678332..0000000000 --- a/old_tests/tests/lean/run/namespace_local.lean +++ /dev/null @@ -1,11 +0,0 @@ -namespace foo - variable A : Type -end foo - -namespace bla - variable A : Type -end bla - -namespace foo - variable A : Type -end foo diff --git a/old_tests/tests/lean/run/nary_existsi.lean b/old_tests/tests/lean/run/nary_existsi.lean deleted file mode 100644 index 246e1fa40d..0000000000 --- a/old_tests/tests/lean/run/nary_existsi.lean +++ /dev/null @@ -1,6 +0,0 @@ -example : ∃ a b c : nat, a = b + c := -begin - existsi [_, _, _], - refl, - repeat {exact 0} -end diff --git a/old_tests/tests/lean/run/nasty_sizeof.lean b/old_tests/tests/lean/run/nasty_sizeof.lean deleted file mode 100644 index c7a73d1719..0000000000 --- a/old_tests/tests/lean/run/nasty_sizeof.lean +++ /dev/null @@ -1,3 +0,0 @@ -def nasty_sizeof : list nat → nat -| [] := 100000000 -| (a::as) := nasty_sizeof as + 100000000 diff --git a/old_tests/tests/lean/run/nat_bug.lean b/old_tests/tests/lean/run/nat_bug.lean deleted file mode 100644 index 2a7f560631..0000000000 --- a/old_tests/tests/lean/run/nat_bug.lean +++ /dev/null @@ -1,25 +0,0 @@ -open decidable -namespace experiment -inductive nat : Type -| zero : nat -| succ : nat → nat -definition refl := @eq.refl -namespace nat - -definition pred (n : nat) : nat := nat.rec zero (fun m x, m) n -theorem pred_zero : pred zero = zero := refl _ -theorem pred_succ (n : nat) : pred (succ n) = n := refl _ - -theorem zero_or_succ (n : nat) : n = zero ∨ n = succ (pred n) -:= nat.rec_on n - (or.intro_left _ (refl zero)) - (assume m IH, or.intro_right _ - (show succ m = succ (pred (succ m)), from congr_arg succ (symm (pred_succ m)))) - -theorem zero_or_succ2 (n : nat) : n = zero ∨ n = succ (pred n) -:= nat.rec_on n - (or.intro_left _ (refl zero)) - (assume m IH, or.intro_right _ - (show succ m = succ (pred (succ m)), from congr_arg succ (symm (pred_succ m)))) -end nat -end experiment diff --git a/old_tests/tests/lean/run/nat_bug4.lean b/old_tests/tests/lean/run/nat_bug4.lean deleted file mode 100644 index 335e675c50..0000000000 --- a/old_tests/tests/lean/run/nat_bug4.lean +++ /dev/null @@ -1,17 +0,0 @@ - -namespace experiment -inductive nat : Type -| zero : nat -| succ : nat → nat -namespace nat -definition add (x y : nat) : nat := nat.rec x (λn r, succ r) y -infixl `+` := add -definition mul (n m : nat) : nat := nat.rec zero (fun m x, x + n) m -infixl `*` := mul - -axiom mul_succ_right (n m : nat) : n * succ m = n * m + n -open eq -theorem small2 (n m l : nat) : n * succ l + m = n * l + n + m -:= subst (mul_succ_right n l) (eq.refl (n * succ l + m)) -end nat -end experiment diff --git a/old_tests/tests/lean/run/nat_bug7.lean b/old_tests/tests/lean/run/nat_bug7.lean deleted file mode 100644 index 0090342b1e..0000000000 --- a/old_tests/tests/lean/run/nat_bug7.lean +++ /dev/null @@ -1,16 +0,0 @@ -namespace experiment -inductive nat : Type -| zero : nat -| succ : nat → nat - -namespace nat -definition add (x y : nat) : nat := nat.rec x (λn r, succ r) y -infixl `+` := add - -axiom add_right_comm (n m k : nat) : n + m + k = n + k + m -open eq -#print "===========================" -theorem bug (a b c d : nat) : a + b + c + d = a + c + b + d -:= subst (add_right_comm a b c) (eq.refl (a + b + c + d)) -end nat -end experiment diff --git a/old_tests/tests/lean/run/nat_sub_ematch.lean b/old_tests/tests/lean/run/nat_sub_ematch.lean deleted file mode 100644 index 41a794ac20..0000000000 --- a/old_tests/tests/lean/run/nat_sub_ematch.lean +++ /dev/null @@ -1,13 +0,0 @@ -set_option trace.smt.ematch true - -example (a b c d : nat) (f : nat → nat) : f d = a + b → f d - a + c = c + b := -begin [smt] - intros, - eblast -end - -example (a b c d : nat) (f : nat → nat) : f d = a + b → f d - (a + c) = b - c := -begin [smt] - intros, - eblast -end diff --git a/old_tests/tests/lean/run/nateq.lean b/old_tests/tests/lean/run/nateq.lean deleted file mode 100644 index ac5723e07b..0000000000 --- a/old_tests/tests/lean/run/nateq.lean +++ /dev/null @@ -1,20 +0,0 @@ -open bool nat - -definition is_eq (a b : nat) : bool := -nat.rec_on a - (λ b, nat.cases_on b tt (λb₁, ff)) - (λ a₁ r₁ b, nat.cases_on b ff (λb₁, r₁ b₁)) - b - -example : is_eq 3 3 = tt := -rfl - -example : is_eq 3 5 = ff := -rfl - -theorem eq.to_is_eq (a b : nat) (H : a = b) : is_eq a b = tt := -have aux : is_eq a a = tt, from - nat.rec_on a - rfl - (λ (a₁ : nat) (ih : is_eq a₁ a₁ = tt), ih), -H ▸ aux diff --git a/old_tests/tests/lean/run/nested_begin_end.lean b/old_tests/tests/lean/run/nested_begin_end.lean deleted file mode 100644 index 960b96c804..0000000000 --- a/old_tests/tests/lean/run/nested_begin_end.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -example (p q : Prop) : p ∧ q ↔ q ∧ p := -by do - iff_intro ← mk_const `iff.intro, - and_intro ← mk_const `and.intro, - apply iff_intro, - solve1 (do - H ← intro `H, - apply and_intro, - mk_app `and.right [H] >>= exact, - mk_app `and.left [H] >>= exact), - solve1 (do - H ← intro `H, - apply and_intro, - mk_app `and.right [H] >>= exact, - mk_app `and.left [H] >>= exact) diff --git a/old_tests/tests/lean/run/nested_common_subexpr_issue.lean b/old_tests/tests/lean/run/nested_common_subexpr_issue.lean deleted file mode 100644 index 0d132c78f0..0000000000 --- a/old_tests/tests/lean/run/nested_common_subexpr_issue.lean +++ /dev/null @@ -1,17 +0,0 @@ --- set_option trace.compiler true - -def fib_aux : ℕ → ℕ × ℕ -| 0 := (0, 1) -| (n+1) := let p := fib_aux n in (p.2, p.1 + p.2) - -def fib (n) := (fib_aux n).2 - -#eval fib 10000 - -def fib_aux2 : ℕ → ℕ × ℕ -| 0 := (0, 1) -| (n+1) := let (a, b) := fib_aux2 n in (b, a + b) - -def fib2 (n) := (fib_aux2 n).2 - -#eval fib2 10000 diff --git a/old_tests/tests/lean/run/nested_inductive.lean b/old_tests/tests/lean/run/nested_inductive.lean deleted file mode 100644 index b8f9231a56..0000000000 --- a/old_tests/tests/lean/run/nested_inductive.lean +++ /dev/null @@ -1,166 +0,0 @@ -set_option trace.inductive_compiler.nested.define.failure true -set_option max_memory 1000000 - -inductive {u} vec (A : Type u) : nat -> Type u -| vnil : vec 0 -| vcons : Pi (n : nat), A -> vec n -> vec (n+1) - -namespace X1 -#print "simple" -inductive foo : Type -| mk : list foo -> foo - -end X1 - -namespace X2 -#print "with param" -inductive {u} foo (A : Type u) : Type u -| mk : A -> list foo -> foo - -end X2 - -namespace X3 -#print "with indices" -inductive {u} foo (A B : Type u) : Type u -| mk : A -> B -> vec foo 0 -> foo - -end X3 - -namespace X4 -#print "with locals in indices" -inductive {u} foo (A : Type u) : Type u -| mk : Pi (n : nat), A -> vec foo n -> foo - -end X4 - -namespace X5 -#print "nested-reflexive" -inductive {u} foo (A : Type u) : Type u -| mk : A -> (Pi (m : nat), vec foo m) -> foo - -end X5 - -namespace X6 -#print "locals + nested-reflexive locals in indices" -inductive {u} foo (A : Type u) : Type u -| mk : Pi (n : nat), A -> (Pi (m : nat), vec foo (n + m)) -> foo - -end X6 - -namespace X7 -#print "many different nestings" -inductive {u} foo (A : Type u) : Type u -| mk : Pi (n : nat), A -> list A -> prod A A -> (Pi (m : nat), vec foo (n + m)) -> vec foo n -> foo - -end X7 - -namespace X8 -#print "many different nestings, some sharing" -inductive {u} foo (A : Type u) : Type u -| mk₁ : Pi (n : nat), A -> (Pi (m : nat), vec (list foo) (n + m)) -> vec foo n -> foo -| mk₂ : Pi (n : nat), A -> list A -> prod A A -> (Pi (m : nat), vec foo (n + m)) -> vec foo n -> foo - -end X8 - -namespace X9b -#print "mutual + nesting" -mutual inductive {u} foo, bar -with foo : Type u -| mk : list (list foo) -> foo -with bar : Type u -| mk : list foo -> bar - -end X9b - -namespace X10 -#print "many layers of nesting nested inductive types" - -inductive wrap (A : Sort*) -| mk : A -> wrap - -inductive box (A : Sort*) -| mk : A -> wrap box -> box - -inductive foo (A : Sort*) -| mk : A -> box foo -> foo - -inductive bar -| mk : foo bar -> bar - -end X10 - -namespace X11 -#print "intro rule that introduces additional nesting" - -inductive {u} wrap (A : Type u) : Type u -| mk : list A -> wrap - -inductive {u} foo : Type u -| mk : wrap foo -> foo - -end X11 - -namespace X12 -#print "intro rule that introduces a lot of additional nesting" - -inductive wrap (A : Sort*) : Sort* -| mk : list (list A) -> wrap - -inductive {u} box (A : Type u) : Type u -| mk : A -> wrap box -> box - -end X12 - -namespace X13 -#print "with reducible definitions" - -attribute [reducible] definition list' := @list - -inductive wrap (A : Sort*) : Sort* -| mk : A -> list' A -> wrap - -attribute [reducible] definition wrap' := @wrap - -inductive {u} foo (A : Type u) : Type u -| mk : A -> wrap' (list' foo) -> foo - -end X13 - -namespace X14 -#print "with indices in original" - -inductive Foo : bool -> Type -| mk : list (Foo ff) -> Foo tt - -end X14 - -namespace X15 -#print "nested inductive propositions eliminating to Prop" - -universe variable l -inductive plist (A : Sort l) : Sort l -| nil : plist -| cons : A → plist → plist - -inductive foo (A : Type l) : ℕ → Prop -| mk : A → plist (plist (foo 0)) → or (foo 1) (foo 2) → foo 1 - -end X15 - -namespace X16 -#print "multiply nested inductive propositions" - -universe variable l -inductive wrap (A : Sort l) : Sort l -| mk : A -> wrap - -inductive box (A : Prop) : Prop -| mk : A -> wrap box -> box - -inductive foo (A : Sort*) : Prop -| mk : A -> box foo -> foo - -inductive bar : Prop -| mk : foo bar -> bar - -end X16 diff --git a/old_tests/tests/lean/run/nested_inductive_code_gen.lean b/old_tests/tests/lean/run/nested_inductive_code_gen.lean deleted file mode 100644 index ef330ff88a..0000000000 --- a/old_tests/tests/lean/run/nested_inductive_code_gen.lean +++ /dev/null @@ -1,23 +0,0 @@ -inductive term : Type -| var : nat → term -| app : list term → term -| cnst : string → term - -meta def term.to_string : term → string -| (term.var x) := "v#" ++ to_string x -| (term.app ts) := "(app " ++ to_string (list.map term.to_string ts) ++ ")" -| (term.cnst c) := c - -meta instance : has_to_string term := -⟨term.to_string⟩ - -set_option trace.compiler.preprocess true - -def var_of : term → list term -| (term.app (t::ts)) := ts -| _ := [term.app []] - -def tst : list term := -var_of (term.app [term.var 0, term.var 1, term.var 2, term.app [term.cnst "x"]]) - -#eval tst diff --git a/old_tests/tests/lean/run/nested_inductive_sizeof.lean b/old_tests/tests/lean/run/nested_inductive_sizeof.lean deleted file mode 100644 index 8bd72957b6..0000000000 --- a/old_tests/tests/lean/run/nested_inductive_sizeof.lean +++ /dev/null @@ -1,57 +0,0 @@ -set_option trace.inductive_compiler.nested.define.failure true -set_option max_memory 1000000 - -inductive {u} vec (A : Type u) : nat -> Type u -| vnil : vec 0 -| vcons : Pi (n : nat), A -> vec n -> vec (n+1) - -namespace X6 -#print "locals + nested-reflexive locals in indices" -inductive {u} foo (A : Type u) : Type u -| mk : Pi (n : nat), A -> (Pi (m : nat), vec foo (n + m)) -> foo - -#check foo.sizeof -#check foo.mk.sizeof_spec - -end X6 - -namespace X8 -#print "many different nestings, some sharing" -inductive {u} foo (A : Type u) : Type u -| mk₁ : Pi (n : nat), A -> (Pi (m : nat), vec (list foo) (n + m)) -> vec foo n -> foo -| mk₂ : Pi (n : nat), A -> list A -> prod A A -> (Pi (m : nat), vec foo (n + m)) -> vec foo n -> foo - -#check foo.sizeof -#check foo.mk₁.sizeof_spec -#check foo.mk₂.sizeof_spec - -end X8 - -namespace X9b -#print "mutual + nesting" -mutual inductive {u} foo, bar -with foo : Type u -| mk : list (list foo) -> foo -with bar : Type u -| mk : list foo -> bar - -#check foo.sizeof -#check foo.mk.sizeof_spec -#check bar.sizeof -#check bar.mk.sizeof_spec - -end X9b - -namespace X11 -#print "intro rule that introduces additional nesting" - -inductive {u} wrap (A : Type u) : Type u -| mk : list A -> wrap - -inductive {u} foo : Type u -| mk : wrap foo -> foo - -#check foo.sizeof -#check foo.mk.sizeof_spec - -end X11 diff --git a/old_tests/tests/lean/run/new_elab1.lean b/old_tests/tests/lean/run/new_elab1.lean deleted file mode 100644 index 8799fcd8ba..0000000000 --- a/old_tests/tests/lean/run/new_elab1.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat - -protected theorem my_add_comm : ∀ (n m : ℕ), n + m = m + n -| n 0 := eq.symm (nat.zero_add n) -| n (m+1) := - suffices succ (n + m) = succ (m + n), from - eq.symm (succ_add m n) ▸ this, - congr_arg succ (my_add_comm n m) diff --git a/old_tests/tests/lean/run/new_elab2.lean b/old_tests/tests/lean/run/new_elab2.lean deleted file mode 100644 index fc6d040e57..0000000000 --- a/old_tests/tests/lean/run/new_elab2.lean +++ /dev/null @@ -1,3 +0,0 @@ - -theorem ex {a : Prop} (H : ¬a) : a ↔ false := -iff.intro H (false.rec a) diff --git a/old_tests/tests/lean/run/new_proj_notation.lean b/old_tests/tests/lean/run/new_proj_notation.lean deleted file mode 100644 index 2805e97149..0000000000 --- a/old_tests/tests/lean/run/new_proj_notation.lean +++ /dev/null @@ -1,7 +0,0 @@ -variable x : list nat - -#check x^.map (+1) - -#check x^.foldl (+) 0 - -#eval [1, 2, 3]^.map (+3) diff --git a/old_tests/tests/lean/run/no_confusion1.lean b/old_tests/tests/lean/run/no_confusion1.lean deleted file mode 100644 index 190fd09082..0000000000 --- a/old_tests/tests/lean/run/no_confusion1.lean +++ /dev/null @@ -1,14 +0,0 @@ -open nat - -theorem ex1 (n : nat) : bit0 n ≠ 1 := -nat.cases_on n - (show 0 ≠ 1, from ne.symm nat.one_ne_zero) - (λ m h1, - have h2 : succ (succ (m + m)) = 1, from nat.succ_add m m ▸ h1, - nat.no_confusion h2 (λ h3, absurd h3 (nat.succ_ne_zero (m + m)))) - -theorem ex2 (n : nat) : succ n ≠ 0 := -λ h, nat.no_confusion h - -theorem ex3 (n : nat) : succ (succ n) ≠ 1 := -λ h, nat.no_confusion h (λ h, nat.no_confusion h) diff --git a/old_tests/tests/lean/run/no_confusion_bug.lean b/old_tests/tests/lean/run/no_confusion_bug.lean deleted file mode 100644 index 6e266f8e53..0000000000 --- a/old_tests/tests/lean/run/no_confusion_bug.lean +++ /dev/null @@ -1,13 +0,0 @@ -open nat - -inductive Fin : nat → Type -| fz : Π {n : nat}, Fin (succ n) -| fs : Π {n : nat}, Fin n → Fin (succ n) - -namespace Fin - - inductive le : ∀ {n : nat}, Fin n → Fin n → Prop - | lez : ∀ {n : nat} (j : Fin (succ n)), le fz j - | les : ∀ {n : nat} {i j : Fin n}, le i j → le (fs i) (fs j) - -end Fin diff --git a/old_tests/tests/lean/run/no_field_access.lean b/old_tests/tests/lean/run/no_field_access.lean deleted file mode 100644 index a0a2a7dd33..0000000000 --- a/old_tests/tests/lean/run/no_field_access.lean +++ /dev/null @@ -1,6 +0,0 @@ -namespace foo -constant bar : ℕ → ℕ -end foo - -noncomputable def foo : ℕ → ℕ -| x := @foo.bar x -- should not use field notation with '@' diff --git a/old_tests/tests/lean/run/noequations.lean b/old_tests/tests/lean/run/noequations.lean deleted file mode 100644 index 4aa7e93d5f..0000000000 --- a/old_tests/tests/lean/run/noequations.lean +++ /dev/null @@ -1,8 +0,0 @@ -example : empty → false. - -def f := empty → false -example : f. - -def g := ∀ (a : nat) (h : a = a), @eq.rec nat a (λ x, Prop) (empty → false) a h - -example : g. diff --git a/old_tests/tests/lean/run/noncomputable_example.lean b/old_tests/tests/lean/run/noncomputable_example.lean deleted file mode 100644 index de4542d7ef..0000000000 --- a/old_tests/tests/lean/run/noncomputable_example.lean +++ /dev/null @@ -1,19 +0,0 @@ -universe u -open classical psum - -variables (A : Type u) (h : (A → false) → false) - --- both noncomputable example... -noncomputable example : A := -match type_decidable A with -| (inl ha) := ha -| (inr hna) := false.rec _ (h hna) -end - --- ... and noncomputable theory should work -noncomputable theory -example : A := -match type_decidable A with -| (inl ha) := ha -| (inr hna) := false.rec _ (h hna) -end \ No newline at end of file diff --git a/old_tests/tests/lean/run/noncomputable_meta.lean b/old_tests/tests/lean/run/noncomputable_meta.lean deleted file mode 100644 index c2435fe503..0000000000 --- a/old_tests/tests/lean/run/noncomputable_meta.lean +++ /dev/null @@ -1,5 +0,0 @@ -constants (X : Type) (x y : X) - -noncomputable meta def foo : bool -> X -| tt := x -| ff := y diff --git a/old_tests/tests/lean/run/norm_num_tst.lean b/old_tests/tests/lean/run/norm_num_tst.lean deleted file mode 100644 index 9aa843b4ed..0000000000 --- a/old_tests/tests/lean/run/norm_num_tst.lean +++ /dev/null @@ -1,181 +0,0 @@ -open tactic - -meta def eval_num_tac : tactic unit := -do t ← target, - (lhs, rhs) ← match_eq t, - (new_lhs, pr1) ← norm_num lhs, - (new_rhs, pr2) ← norm_num rhs, - is_def_eq new_lhs new_rhs, - `[exact eq.trans %%pr1 (eq.symm %%pr2)] - --- nat examples - -example : 10 + 2 = 1 + 11 := by eval_num_tac - -example : 10 - 1 = 9 := by eval_num_tac -example : 12 - 5 = 3 + 4 := by eval_num_tac -example : 5 - 20 = 0 := by eval_num_tac -example : 0 - 2 = 0 := by eval_num_tac -example : 4 - (5 - 10) = 2 + (3 - 1) := by eval_num_tac -example : 0 - 0 = 0 := by eval_num_tac -example : 100 - 100 = 0 := by eval_num_tac -example : 5 * (2 - 3) = 0 := by eval_num_tac -example : 10 - 5 * 5 + (7 - 3) * 6 = 27 - 3 := by eval_num_tac - --- ordered field examples - -variable {α : Type} -variable [linear_ordered_field α] - -example : (-1 :α) * 1 = -1 := by eval_num_tac -example : (-2 :α) * 1 = -2 := by eval_num_tac -example : (-2 :α) * -1 = 2 := by eval_num_tac -example : (-2 :α) * -2 = 4 := by eval_num_tac -example : (1 : α) * 0 = 0 := by eval_num_tac - -example : ((1 : α) + 1) * 5 = 6 + 4 := by eval_num_tac - -example : (1 : α) = 0 + 1 := by eval_num_tac -example : (1 : α) = 1 + 0 := by eval_num_tac -example : (2 : α) = 1 + 1 := by eval_num_tac -example : (2 : α) = 0 + 2 := by eval_num_tac -example : (3 : α) = 1 + 2 := by eval_num_tac -example : (3 : α) = 2 + 1 := by eval_num_tac -example : (4 : α) = 3 + 1 := by eval_num_tac -example : (4 : α) = 2 + 2 := by eval_num_tac -example : (5 : α) = 4 + 1 := by eval_num_tac -example : (5 : α) = 3 + 2 := by eval_num_tac -example : (5 : α) = 2 + 3 := by eval_num_tac -example : (6 : α) = 0 + 6 := by eval_num_tac -example : (6 : α) = 3 + 3 := by eval_num_tac -example : (6 : α) = 4 + 2 := by eval_num_tac -example : (6 : α) = 5 + 1 := by eval_num_tac -example : (7 : α) = 4 + 3 := by eval_num_tac -example : (7 : α) = 1 + 6 := by eval_num_tac -example : (7 : α) = 6 + 1 := by eval_num_tac -example : 33 = 5 + (28 : α) := by eval_num_tac - -example : (12 : α) = 0 + (2 + 3) + 7 := by eval_num_tac -example : (105 : α) = 70 + (33 + 2) := by eval_num_tac - -example : (45000000000 : α) = 23000000000 + 22000000000 := by eval_num_tac - -example : (0 : α) - 3 = -3 := by eval_num_tac -example : (0 : α) - 2 = -2 := by eval_num_tac -example : (1 : α) - 3 = -2 := by eval_num_tac -example : (1 : α) - 1 = 0 := by eval_num_tac -example : (0 : α) - 3 = -3 := by eval_num_tac -example : (0 : α) - 3 = -3 := by eval_num_tac - -example : (12 : α) - 4 - (5 + -2) = 5 := by eval_num_tac -example : (12 : α) - 4 - (5 + -2) - 20 = -15 := by eval_num_tac - -example : (0 : α) * 0 = 0 := by eval_num_tac -example : (0 : α) * 1 = 0 := by eval_num_tac -example : (0 : α) * 2 = 0 := by eval_num_tac -example : (2 : α) * 0 = 0 := by eval_num_tac -example : (1 : α) * 0 = 0 := by eval_num_tac -example : (1 : α) * 1 = 1 := by eval_num_tac -example : (2 : α) * 1 = 2 := by eval_num_tac -example : (1 : α) * 2 = 2 := by eval_num_tac -example : (2 : α) * 2 = 4 := by eval_num_tac -example : (3 : α) * 2 = 6 := by eval_num_tac -example : (2 : α) * 3 = 6 := by eval_num_tac -example : (4 : α) * 1 = 4 := by eval_num_tac -example : (1 : α) * 4 = 4 := by eval_num_tac -example : (3 : α) * 3 = 9 := by eval_num_tac -example : (3 : α) * 4 = 12 := by eval_num_tac -example : (4 : α) * 4 = 16 := by eval_num_tac -example : (11 : α) * 2 = 22 := by eval_num_tac -example : (15 : α) * 6 = 90 := by eval_num_tac -example : (123456 : α) * 123456 = 15241383936 := by eval_num_tac - -example : (4 : α) / 2 = 2 := by eval_num_tac -example : (4 : α) / 1 = 4 := by eval_num_tac -example : (4 : α) / 3 = 4 / 3 := by eval_num_tac -example : (50 : α) / 5 = 10 := by eval_num_tac -example : (1056 : α) / 1 = 1056 := by eval_num_tac -example : (6 : α) / 4 = 3/2 := by eval_num_tac -example : (0 : α) / 3 = 0 := by eval_num_tac ---example : (3 : α) / 0 = 0 := by eval_num_tac -- this should fail -example : (9 * 9 * 9) * (12 : α) / 27 = 81 * (2 + 2) := by eval_num_tac -example : (-2 : α) * 4 / 3 = -8 / 3 := by eval_num_tac -example : - (-4 / 3) = 1 / (3 / (4 : α)) := by eval_num_tac - --- auto gen tests -example : ((25 * (1 / 1)) + (30 - 16)) = (39 : α) := by eval_num_tac -example : ((19 * (- 2 - 3)) / 6) = (-95/6 : α) := by eval_num_tac -example : - (3 * 28) = (-84 : α) := by eval_num_tac -example : - - (16 / ((11 / (- - (6 * 19) + 12)) * 21)) = (96/11 : α) := by eval_num_tac -example : (- (- 21 + 24) - - (- - (28 + (- 21 / - (16 / ((1 * 26) * ((0 * - 11) + 13))))) * 21)) = (79209/8 : α) := by eval_num_tac -example : (27 * (((16 + - (12 + 4)) + (22 - - 19)) - 23)) = (486 : α) := by eval_num_tac -example : - (13 * (- 30 / ((7 / 24) + - 7))) = (-9360/161 : α) := by eval_num_tac -example : - (0 + 20) = (-20 : α) := by eval_num_tac -example : (- 2 - (27 + (((2 / 14) - (7 + 21)) + (16 - - - 14)))) = (-22/7 : α) := by eval_num_tac -example : (25 + ((8 - 2) + 16)) = (47 : α) := by eval_num_tac -example : (- - 26 / 27) = (26/27 : α) := by eval_num_tac -example : ((((16 * (22 / 14)) - 18) / 11) + 30) = (2360/77 : α) := by eval_num_tac -example : (((- 28 * 28) / (29 - 24)) * 24) = (-18816/5 : α) := by eval_num_tac -example : ((- (18 - ((- - (10 + - 2) - - (23 / 5)) / 5)) - (21 * 22)) - (((20 / - ((((19 + 18) + 15) + 3) + - 22)) + 14) / 17)) = (-394571/825 : α) := by eval_num_tac -example : ((3 + 25) - - 4) = (32 : α) := by eval_num_tac -example : ((1 - 0) - 22) = (-21 : α) := by eval_num_tac -example : (((- (8 / 7) / 14) + 20) + 22) = (2054/49 : α) := by eval_num_tac -example : ((21 / 20) - 29) = (-559/20 : α) := by eval_num_tac -example : - - 20 = (20 : α) := by eval_num_tac -example : (24 - (- 9 / 4)) = (105/4 : α) := by eval_num_tac -example : (((7 / ((23 * 19) + (27 * 10))) - ((28 - - 15) * 24)) + (9 / - (10 * - 3))) = (-1042007/1010 : α) := by eval_num_tac -example : (26 - (- 29 + (12 / 25))) = (1363/25 : α) := by eval_num_tac -example : ((11 * 27) / (4 - 5)) = (-297 : α) := by eval_num_tac -example : (24 - (9 + 15)) = (0 : α) := by eval_num_tac -example : (- 9 - - 0) = (-9 : α) := by eval_num_tac -example : (- 10 / (30 + 10)) = (-1/4 : α) := by eval_num_tac -example : (22 - (6 * (28 * - 8))) = (1366 : α) := by eval_num_tac -example : ((- - 2 * (9 * - 3)) + (22 / 30)) = (-799/15 : α) := by eval_num_tac -example : - (26 / ((3 + 7) / - (27 * (12 / - 16)))) = (-1053/20 : α) := by eval_num_tac -example : ((- 29 / 1) + 28) = (-1 : α) := by eval_num_tac -example : ((21 * ((10 - (((17 + 28) - - 0) + 20)) + 26)) + ((17 + - 16) * 7)) = (-602 : α) := by eval_num_tac -example : (((- 5 - ((24 + - - 8) + 3)) + 20) + - 23) = (-43 : α) := by eval_num_tac -example : ((- ((14 - 15) * (14 + 8)) + ((- (18 - 27) - 0) + 12)) - 11) = (32 : α) := by eval_num_tac -example : (((15 / 17) * (26 / 27)) + 28) = (4414/153 : α) := by eval_num_tac -example : (14 - ((- 16 - 3) * - (20 * 19))) = (-7206 : α) := by eval_num_tac -example : (21 - - - (28 - (12 * 11))) = (125 : α) := by eval_num_tac -example : ((0 + (7 + (25 + 8))) * - (11 * 27)) = (-11880 : α) := by eval_num_tac -example : (19 * - 5) = (-95 : α) := by eval_num_tac -example : (29 * - 8) = (-232 : α) := by eval_num_tac -example : ((22 / 9) - 29) = (-239/9 : α) := by eval_num_tac -example : (3 + (19 / 12)) = (55/12 : α) := by eval_num_tac -example : - (13 + 30) = (-43 : α) := by eval_num_tac -example : - - - (((21 * - - ((- 25 - (- (30 - 5) / (- 5 - 5))) / (((6 + ((25 * - 13) + 22)) - 3) / 2))) / (- 3 / 10)) * (- 8 - 0)) = (-308/3 : α) := by eval_num_tac -example : - (2 * - (- 24 * 22)) = (-1056 : α) := by eval_num_tac -example : - - (((28 / - ((- 13 * - 5) / - (((7 - 30) / 16) + 6))) * 0) - 24) = (-24 : α) := by eval_num_tac -example : ((13 + 24) - (27 / (21 * 13))) = (3358/91 : α) := by eval_num_tac -example : ((3 / - 21) * 25) = (-25/7 : α) := by eval_num_tac -example : (17 - (29 - 18)) = (6 : α) := by eval_num_tac -example : ((28 / 20) * 15) = (21 : α) := by eval_num_tac -example : ((((26 * (- (23 - 13) - 3)) / 20) / (14 - (10 + 20))) / ((16 / 6) / (16 * - (3 / 28)))) = (-1521/2240 : α) := by eval_num_tac - -example : (46 / (- ((- 17 * 28) - 77) + 87)) = (23/320 : α) := by eval_num_tac -example : (73 * - (67 - (74 * - - 11))) = (54531 : α) := by eval_num_tac -example : ((8 * (25 / 9)) + 59) = (731/9 : α) := by eval_num_tac -example : - ((59 + 85) * - 70) = (10080 : α) := by eval_num_tac -example : (66 + (70 * 58)) = (4126 : α) := by eval_num_tac -example : (- - 49 * 0) = (0 : α) := by eval_num_tac -example : ((- 78 - 69) * 9) = (-1323 : α) := by eval_num_tac -example : - - (7 - - (50 * 79)) = (3957 : α) := by eval_num_tac -example : - (85 * (((4 * 93) * 19) * - 31)) = (18624180 : α) := by eval_num_tac -example : (21 + (- 5 / ((74 * 85) / 45))) = (26373/1258 : α) := by eval_num_tac -example : (42 - ((27 + 64) + 26)) = (-75 : α) := by eval_num_tac -example : (- ((38 - - 17) + 86) - (74 + 58)) = (-273 : α) := by eval_num_tac -example : ((29 * - (75 + - 68)) + (- 41 / 28)) = (-5725/28 : α) := by eval_num_tac -example : (- - (40 - 11) - (68 * 86)) = (-5819 : α) := by eval_num_tac -example : (6 + ((65 - 14) + - 89)) = (-32 : α) := by eval_num_tac -example : (97 * - (29 * 35)) = (-98455 : α) := by eval_num_tac -example : - (66 / 33) = (-2 : α) := by eval_num_tac -example : - ((94 * 89) + (79 - (23 - (((- 1 / 55) + 95) * (28 - (54 / - - - 22)))))) = (-1369070/121 : α) := by eval_num_tac -example : (- 23 + 61) = (38 : α) := by eval_num_tac -example : - (93 / 69) = (-31/23 : α) := by eval_num_tac -example : (- - ((68 / (39 + (((45 * - (59 - (37 + 35))) / (53 - 75)) - - (100 + - (50 / (- 30 - 59)))))) - (69 - (23 * 30))) / (57 + 17)) = (137496481/16368578 : α) := by eval_num_tac -example : (- 19 * - - (75 * - - 41)) = (-58425 : α) := by eval_num_tac -example : ((3 / ((- 28 * 45) * (19 + ((- (- 88 - (- (- 1 + 90) + 8)) + 87) * 48)))) + 1) = (1903019/1903020 : α) := by eval_num_tac -example : ((- - (28 + 48) / 75) + ((- 59 - 14) - 0)) = (-5399/75 : α) := by eval_num_tac -example : (- ((- (((66 - 86) - 36) / 94) - 3) / - - (77 / (56 - - - 79))) + 87) = (312254/3619 : α) := by eval_num_tac diff --git a/old_tests/tests/lean/run/not_bug1.lean b/old_tests/tests/lean/run/not_bug1.lean deleted file mode 100644 index 7b0721cd2f..0000000000 --- a/old_tests/tests/lean/run/not_bug1.lean +++ /dev/null @@ -1,20 +0,0 @@ -open bool - -constant List : Type.{1} -constant nil : List -constant cons : bool → List → List - -infixr `::` := cons -notation `[` l:(foldr `,` (h t, cons h t) nil `]`) := l - -#check [] -#check [tt] -#check [tt, ff] -#check [tt, ff, ff] -#check tt :: ff :: [tt, ff, ff] -#check tt :: [] -constants a b c : bool -#check a :: b :: nil -#check [a, b] -#check [a, b, c] -#check [] diff --git a/old_tests/tests/lean/run/ns.lean b/old_tests/tests/lean/run/ns.lean deleted file mode 100644 index 6182c360f1..0000000000 --- a/old_tests/tests/lean/run/ns.lean +++ /dev/null @@ -1,18 +0,0 @@ -prelude -constant nat : Type.{1} -constant f : nat → nat - -namespace foo - constant int : Type.{1} - constant f : int → int - constant a : nat - constant i : int - #check _root_.f a - #check f i -end foo - -open foo -constants a : nat -constants i : int -#check f foo.a -#check f foo.i diff --git a/old_tests/tests/lean/run/ns1.lean b/old_tests/tests/lean/run/ns1.lean deleted file mode 100644 index f1e40bb838..0000000000 --- a/old_tests/tests/lean/run/ns1.lean +++ /dev/null @@ -1,8 +0,0 @@ -namespace foo -namespace boo -theorem tst : true := trivial -end boo -end foo - -open foo -#check boo.tst diff --git a/old_tests/tests/lean/run/ns2.lean b/old_tests/tests/lean/run/ns2.lean deleted file mode 100644 index d1d55132e2..0000000000 --- a/old_tests/tests/lean/run/ns2.lean +++ /dev/null @@ -1,34 +0,0 @@ -definition foo.id {A : Type} (a : A) := a -constant foo.T : Type.{1} -#check foo.id -#check foo.T - -inductive foo.v.I | unit : foo.v.I - -#check foo.v.I -#check foo.v.I.unit - -namespace foo - #check id - #check T - #check v.I -end foo - -namespace bla - definition vvv.pr {A : Type} (a b : A) := a - #check vvv.pr -end bla -#check bla.vvv.pr - -namespace bla -namespace vvv - #check pr - inductive my.empty : Type -end vvv -end bla -#check bla.vvv.my.empty - -namespace foo.bla - structure vvv.xyz := mk -end foo.bla -#check foo.bla.vvv.xyz.mk diff --git a/old_tests/tests/lean/run/num.lean b/old_tests/tests/lean/run/num.lean deleted file mode 100644 index 6c73dd7dc3..0000000000 --- a/old_tests/tests/lean/run/num.lean +++ /dev/null @@ -1,5 +0,0 @@ -#check 14 -#check 0 -#check 3 -#check 2 -#check 4 diff --git a/old_tests/tests/lean/run/occurs_check_bug1.lean b/old_tests/tests/lean/run/occurs_check_bug1.lean deleted file mode 100644 index cd9cfc4584..0000000000 --- a/old_tests/tests/lean/run/occurs_check_bug1.lean +++ /dev/null @@ -1,15 +0,0 @@ -open nat prod -open decidable - -constant modulo' (x : ℕ) (y : ℕ) : ℕ -infixl `mod`:70 := modulo' - -constant gcd_aux : ℕ × ℕ → ℕ - -noncomputable definition gcd' (x y : ℕ) : ℕ := gcd_aux (x, y) - -theorem gcd_def (x y : ℕ) : gcd' x y = @ite (y = 0) (nat.decidable_eq (snd (x, y)) 0) nat x (gcd' y (x mod y)) := -sorry - -theorem gcd_succ (m n : ℕ) : gcd' m (succ n) = gcd' (succ n) (m mod succ n) := -eq.trans (gcd_def _ _) (if_neg (nat.succ_ne_zero _)) diff --git a/old_tests/tests/lean/run/offset1.lean b/old_tests/tests/lean/run/offset1.lean deleted file mode 100644 index 507970fb6c..0000000000 --- a/old_tests/tests/lean/run/offset1.lean +++ /dev/null @@ -1,16 +0,0 @@ -open nat - -inductive {u} vec (α : Type u) : ℕ → Type u -| nil {} : vec 0 -| cons : α → Π {n : nat}, vec n → vec (n+1) - -namespace vec -def head {α : Type*} : Π {n : ℕ}, vec α (n+1) → α -| n (cons x xs) := x -end vec - -constants (dret : Π {n : ℕ}, vec nat n → (vec nat n → nat) → nat) -axiom dret_spec : Π {n : ℕ} (xs : vec nat n) (f : vec nat n → nat), dret xs f = f xs - -example (v : vec nat (id 1)) : dret v vec.head = vec.head v := -by rw dret_spec diff --git a/old_tests/tests/lean/run/one.lean b/old_tests/tests/lean/run/one.lean deleted file mode 100644 index 026a7a41e9..0000000000 --- a/old_tests/tests/lean/run/one.lean +++ /dev/null @@ -1,21 +0,0 @@ -inductive {u} one1 : Type (max 1 u) -| unit : one1 - -set_option pp.universes true -#check one1 - -inductive {u} one2 : Type (max 1 u) -| unit : one2 - -#check one2 - -section foo - universe u2 - parameter A : Type u2 - - inductive {u} wrapper : Type (max 1 u u2) - | mk : A → wrapper - #check wrapper -end foo - -#check wrapper diff --git a/old_tests/tests/lean/run/one2.lean b/old_tests/tests/lean/run/one2.lean deleted file mode 100644 index 95a23f8d98..0000000000 --- a/old_tests/tests/lean/run/one2.lean +++ /dev/null @@ -1,22 +0,0 @@ -inductive {u} one1 : Type u -| unit : one1 - -inductive pone : Type 0 -| unit : pone - -inductive {u} two : Type (max 1 u) -| o : two -| u : two - -inductive {u} wrap : Type (max 1 u) -| mk : true → wrap - -inductive {u} wrap2 (A : Type u) : Type (max 1 u) -| mk : A → wrap2 - -set_option pp.universes true -#check @one1.rec -#check @pone.rec -#check @two.rec -#check @wrap.rec -#check @wrap2.rec diff --git a/old_tests/tests/lean/run/opaque_hint_bug.lean b/old_tests/tests/lean/run/opaque_hint_bug.lean deleted file mode 100644 index 9c1e5d5ef0..0000000000 --- a/old_tests/tests/lean/run/opaque_hint_bug.lean +++ /dev/null @@ -1,13 +0,0 @@ -inductive List (T : Type) : Type -| nil {} : List -| cons : T → List → List - - -section - variable {T : Type} - - definition concat (s t : List T) : List T - := List.rec t (fun x l u, List.cons x u) s - - attribute [reducible] concat -end diff --git a/old_tests/tests/lean/run/opt1.lean b/old_tests/tests/lean/run/opt1.lean deleted file mode 100644 index 9d2a669aaa..0000000000 --- a/old_tests/tests/lean/run/opt1.lean +++ /dev/null @@ -1,6 +0,0 @@ -#eval options.get_string options.mk `opt1 "" -#eval options.get_string (options.set_string options.mk `opt1 "val1") `opt1 "" -#eval if (options.mk = options.mk) then bool.tt else bool.ff -#eval if (options.mk = (options.set_string options.mk `opt1 "val1")) then bool.tt else bool.ff -#eval options.get_nat (options.set_nat options.mk `opt1 10) `opt1 0 -#eval options.get_nat (options.set_nat options.mk `opt1 10) `opt2 0 diff --git a/old_tests/tests/lean/run/opt_param_cc.lean b/old_tests/tests/lean/run/opt_param_cc.lean deleted file mode 100644 index 22fdd09767..0000000000 --- a/old_tests/tests/lean/run/opt_param_cc.lean +++ /dev/null @@ -1,27 +0,0 @@ -def f (a : nat) (b : nat := a) (c : nat := a) := -a + b + c - -lemma ex1 (a a' b c d : nat) (h : b = c) (h2 : a = a') : f a b d = f a' c d := -by cc - -lemma ex2 (a a' b c d : nat) (h : b = c) (h2 : a = a') : f a b d = f a' c d := -by rw [h, h2] - -set_option pp.beta true -set_option pp.all true - -lemma ex3 (a a' b c d : nat) (h : b = c) (h2 : a = a') : f a b d = f a' c d := -begin - simp [h, h2], -end - -open tactic - -run_cmd do c ← mk_const `f, get_fun_info c >>= trace -run_cmd do c ← mk_const `eq, get_fun_info c >>= trace -run_cmd do c ← mk_const `id, get_fun_info c >>= trace - -set_option trace.congr_lemma true -set_option trace.app_builder true - -run_cmd do h ← mk_const `f, l ← mk_congr_lemma_simp h, trace l^.type diff --git a/old_tests/tests/lean/run/opt_param_cnsts.lean b/old_tests/tests/lean/run/opt_param_cnsts.lean deleted file mode 100644 index 50c7ff9344..0000000000 --- a/old_tests/tests/lean/run/opt_param_cnsts.lean +++ /dev/null @@ -1,5 +0,0 @@ -constant foo (a : nat) (b : bool := tt) : nat -axiom fooAx : foo 0 = 0 - -example : foo 0 = foo 0 tt := -rfl diff --git a/old_tests/tests/lean/run/order_defaults.lean b/old_tests/tests/lean/run/order_defaults.lean deleted file mode 100644 index 97bcbab9b3..0000000000 --- a/old_tests/tests/lean/run/order_defaults.lean +++ /dev/null @@ -1,20 +0,0 @@ -example : preorder unit := { - le := λ _ _, true, - le_refl := λ _, trivial, - le_trans := λ _ _ _ _ _, trivial, -} - -example : partial_order unit := { - le := λ _ _, true, - le_refl := λ _, trivial, - le_trans := λ _ _ _ _ _, trivial, - le_antisymm := by intros a b; intros; cases a; cases b; refl -} - -example : linear_order unit := { - le := λ _ _, true, - le_refl := λ _, trivial, - le_trans := λ _ _ _ _ _, trivial, - le_antisymm := by intros a b; intros; cases a; cases b; refl, - le_total := λ _ _, or.inl trivial, -} diff --git a/old_tests/tests/lean/run/over2.lean b/old_tests/tests/lean/run/over2.lean deleted file mode 100644 index a9546d0a1f..0000000000 --- a/old_tests/tests/lean/run/over2.lean +++ /dev/null @@ -1,14 +0,0 @@ -open nat - -namespace N1 - definition foo (a : nat) := a -end N1 - -namespace N2 - definition foo (a : nat) := a -end N2 - -open N1 N2 - -definition boo1 := N1.foo -definition boo2 := N2.foo diff --git a/old_tests/tests/lean/run/over3.lean b/old_tests/tests/lean/run/over3.lean deleted file mode 100644 index 8267330e9c..0000000000 --- a/old_tests/tests/lean/run/over3.lean +++ /dev/null @@ -1,7 +0,0 @@ -constant foo.f {A B : Type} : (A → B) → (B → A) -constant bla.f {A : Type} : (A → nat) → (A → nat) - -open foo bla - -noncomputable example : nat → bool := -f (λ b, bool.cases_on b 0 1) diff --git a/old_tests/tests/lean/run/over_subst.lean b/old_tests/tests/lean/run/over_subst.lean deleted file mode 100644 index f890b3557a..0000000000 --- a/old_tests/tests/lean/run/over_subst.lean +++ /dev/null @@ -1,25 +0,0 @@ -namespace experiment -namespace nat -constant nat : Type.{1} -constant add : nat → nat → nat -constant le : nat → nat → Prop -constant one : nat -infixl `+` := add -infix `≤` := le -axiom add_assoc (a b c : nat) : (a + b) + c = a + (b + c) -axiom add_le_left {a b : nat} (H : a ≤ b) (c : nat) : c + a ≤ c + b -end nat - -namespace int -constant int : Type.{1} -constant add : int → int → int -constant le : int → int → Prop -constant one1 : int -infixl `+` := add -infix `≤` := le -axiom add_assoc (a b c : int) : (a + b) + c = a + (b + c) -axiom add_le_left {a b : int} (H : a ≤ b) (c : int) : c + a ≤ c + b -noncomputable definition lt (a b : int) := a + one1 ≤ b -infix `<` := lt -end int -end experiment diff --git a/old_tests/tests/lean/run/overload2.lean b/old_tests/tests/lean/run/overload2.lean deleted file mode 100644 index cc9408d80e..0000000000 --- a/old_tests/tests/lean/run/overload2.lean +++ /dev/null @@ -1,59 +0,0 @@ -inductive F2 : Type -| O : F2 -| I : F2 - -namespace F2 - -definition add : F2 → F2 → F2 -| O O := O -| O I := I -| I O := I -| I I := O - -infix + := F2.add - -end F2 - -open F2 nat - -#reduce (1 : nat) + 1 -#reduce (1 : nat) + (1 : nat) - -example : true := -begin - have H : (1 : nat) + (1 : nat) = 2, - reflexivity, - constructor -end - -example : true := -begin - have H : 1 + 1 = 2, - reflexivity, - constructor -end - -example : true := -begin - have H : (1:nat) + 1 = 2, - reflexivity, - constructor -end - -example : true := -begin - have H : I + O = I, - reflexivity, - constructor -end - -example : true := -begin - have H1 : I + O = I, - reflexivity, - have H2 : 1 + 0 = 1, - reflexivity, - have H3 : (1:int) + 0 = 1, - reflexivity, - constructor -end diff --git a/old_tests/tests/lean/run/overload_issue.lean b/old_tests/tests/lean/run/overload_issue.lean deleted file mode 100644 index 7f85502f8d..0000000000 --- a/old_tests/tests/lean/run/overload_issue.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic - -example : true := -by do - trace $ "hello", - constructor diff --git a/old_tests/tests/lean/run/pack_unpack1.lean b/old_tests/tests/lean/run/pack_unpack1.lean deleted file mode 100644 index 01e3191c00..0000000000 --- a/old_tests/tests/lean/run/pack_unpack1.lean +++ /dev/null @@ -1,80 +0,0 @@ -inductive {u} tree_core (A : Type u) : bool → (Type u) -| leaf' : A → tree_core ff -| node' : tree_core tt → tree_core ff -| nil' {} : tree_core tt -| cons' : tree_core ff → tree_core tt → tree_core tt - -attribute [reducible] -definition tree (A : Sort*) := tree_core A ff - -attribute [reducible] -definition tree_list (A : Sort*) := tree_core A tt - -open tree_core - -definition pack {A : Sort*} : list (tree A) → tree_core A tt -| [] := nil' -| (a::l) := cons' a (pack l) - -definition unpack {A : Sort*} : ∀ {b}, tree_core A b → list (tree A) -| .(tt) nil' := [] -| .(tt) (cons' a t) := a :: unpack t -| .(ff) (leaf' a) := [] -| .(ff) (node' l) := [] - -attribute [inverse] -lemma unpack_pack {A : Sort*} : ∀ (l : list (tree A)), unpack (pack l) = l -| [] := rfl -| (a::l) := - show a :: unpack (pack l) = a :: l, from - congr_arg (λ x, a :: x) (unpack_pack l) - -attribute [inverse] -lemma pack_unpack {A : Sort*} : ∀ t : tree_core A tt, pack (unpack t) = t := -λ t, - @tree_core.rec_on - A - (λ b, bool.cases_on b (λ t, true) (λ t, pack (unpack t) = t)) - tt t - (λ a, trivial) - (λ t ih, trivial) - rfl - (λ h t ih1 ih2, - show cons' h (pack (unpack t)) = cons' h t, from - congr_arg (λ x, cons' h x) ih2) - -attribute [pattern] -definition tree.node {A : Sort*} (l : list (tree A)) : tree A := -tree_core.node' (pack l) - -attribute [pattern] -definition tree.leaf {A : Sort*} : A → tree A := -tree_core.leaf' - -set_option trace.eqn_compiler true - -definition sz {A : Sort*} : tree A → nat -| (tree.leaf a) := 1 -| (tree.node l) := list.length l + 1 - -constant P {A : Sort*} : tree A → Type 1 -constant mk1 {A : Sort*} (a : A) : P (tree.leaf a) -constant mk2 {A : Sort*} (l : list (tree A)) : P (tree.node l) - -noncomputable definition bla {A : Sort*} : ∀ n : tree A, P n -| (tree.leaf a) := mk1 a -| (tree.node l) := mk2 l - -#check bla._main.equations._eqn_1 -#check bla._main.equations._eqn_2 - -definition foo {A : Sort*} : nat → tree A → nat -| 0 _ := 0 -| (n+1) (tree.leaf a) := 0 -| (n+1) (tree.node []) := foo n (tree.node []) -| (n+1) (tree.node (x::xs)) := foo n x - -#check @foo._main.equations._eqn_1 -#check @foo._main.equations._eqn_2 -#check @foo._main.equations._eqn_3 -#check @foo._main.equations._eqn_4 diff --git a/old_tests/tests/lean/run/pack_unpack2.lean b/old_tests/tests/lean/run/pack_unpack2.lean deleted file mode 100644 index 43df2b3854..0000000000 --- a/old_tests/tests/lean/run/pack_unpack2.lean +++ /dev/null @@ -1,31 +0,0 @@ ---set_option trace.inductive_compiler.nested.define true -inductive {u} tree (A : Type u) : Type u -| leaf : A -> tree -| node : list tree -> tree - -set_option trace.eqn_compiler true -definition sz {A : Type*} : tree A → nat -| (tree.leaf a) := 1 -| (tree.node l) := list.length l + 1 - -constant P {A : Type*} : tree A → Type 1 -constant mk1 {A : Type*} (a : A) : P (tree.leaf a) -constant mk2 {A : Type*} (l : list (tree A)) : P (tree.node l) - -noncomputable definition bla {A : Type*} : ∀ n : tree A, P n -| (tree.leaf a) := mk1 a -| (tree.node l) := mk2 l - -#check bla._main.equations._eqn_1 -#check bla._main.equations._eqn_2 - -definition foo {A : Type*} : nat → tree A → nat -| 0 _ := sorry -| (n+1) (tree.leaf a) := 0 -| (n+1) (tree.node []) := foo n (tree.node []) -| (n+1) (tree.node (x::xs)) := foo n x - -#check @foo._main.equations._eqn_1 -#check @foo._main.equations._eqn_2 -#check @foo._main.equations._eqn_3 -#check @foo._main.equations._eqn_4 diff --git a/old_tests/tests/lean/run/pack_unpack3.lean b/old_tests/tests/lean/run/pack_unpack3.lean deleted file mode 100644 index 1d7e15e8d2..0000000000 --- a/old_tests/tests/lean/run/pack_unpack3.lean +++ /dev/null @@ -1,29 +0,0 @@ -inductive {u} vec (A : Type u) : nat -> Type u -| vnil : vec 0 -| vcons : Pi (n : nat), A -> vec n -> vec (n+1) - -inductive {u} tree (A : Type u) : Type u -| leaf : A -> tree -| node : Pi (n : nat), vec (list (list tree)) n -> tree - --- set_option trace.eqn_compiler true - -constant {u} P {A : Type u} : tree A → Type -constant {u} mk1 {A : Type u} (a : A) : P (tree.leaf a) -constant {u} mk2 {A : Type u} (n : nat) (xs : vec (list (list (tree A))) n) : P (tree.node n xs) - -noncomputable definition {u} bla {A : Type u} : ∀ n : tree A, P n -| (tree.leaf a) := mk1 a -| (tree.node n xs) := mk2 n xs - -#check bla._main.equations._eqn_1 -#check bla._main.equations._eqn_2 - -definition {u} foo {A : Type u} : nat → tree A → nat -| 0 _ := sorry -| (n+1) (tree.leaf a) := 0 -| (n+1) (tree.node m xs) := foo n (tree.node m xs) - -#check @foo._main.equations._eqn_1 -#check @foo._main.equations._eqn_2 -#check @foo._main.equations._eqn_3 diff --git a/old_tests/tests/lean/run/parent_struct_inst.lean b/old_tests/tests/lean/run/parent_struct_inst.lean deleted file mode 100644 index 94e9e4b080..0000000000 --- a/old_tests/tests/lean/run/parent_struct_inst.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -class A := (n : ℕ) - -definition f [A] := A.n - -structure B extends A := -(Hf : f = 0) - -example : B := ⟨⟨0⟩, rfl⟩ - -example : B := (| (| 0 |), rfl |) diff --git a/old_tests/tests/lean/run/parent_struct_ref.lean b/old_tests/tests/lean/run/parent_struct_ref.lean deleted file mode 100644 index c77fec5feb..0000000000 --- a/old_tests/tests/lean/run/parent_struct_ref.lean +++ /dev/null @@ -1,10 +0,0 @@ -open nat - -structure point (A B : Type) := -(x : A) (y : B) - -structure foo extends p1 : point nat nat := -(H1 : point.x p1 + point.y p1 > 10) - -#check foo.p1 -#check foo.H1 diff --git a/old_tests/tests/lean/run/partial_explicit.lean b/old_tests/tests/lean/run/partial_explicit.lean deleted file mode 100644 index 9fd9462c6c..0000000000 --- a/old_tests/tests/lean/run/partial_explicit.lean +++ /dev/null @@ -1,17 +0,0 @@ -section -variables a b c : nat -variable H1 : a = b -variable H2 : a + b + a + b = 0 - -example : b + b + a + b = 0 := - @eq.rec_on _ _ (λ x, x + b + a + b = 0) _ H1 H2 -end - -section -variables (f : Π {T : Type} {a : T} {P : T → Prop}, P a → Π {b : T} {Q : T → Prop}, Q b → Prop) -variables (T : Type) (a : T) (P : T → Prop) (pa : P a) -variables (b : T) (Q : T → Prop) (qb : Q b) - -#check @f T a P pa b Q qb -- Prop -#check f pa qb -- Prop -end diff --git a/old_tests/tests/lean/run/partial_explicit1.lean b/old_tests/tests/lean/run/partial_explicit1.lean deleted file mode 100644 index 81f676f906..0000000000 --- a/old_tests/tests/lean/run/partial_explicit1.lean +++ /dev/null @@ -1,2 +0,0 @@ -lemma eq_rect (A : Type) (x : A) (P : A → Type) (f : P x) (y : A) (e : x = y) : P y := - @eq.rec_on _ _ (λ (y : A), P y) _ e f diff --git a/old_tests/tests/lean/run/pathsimp.lean b/old_tests/tests/lean/run/pathsimp.lean deleted file mode 100644 index ff0d60df42..0000000000 --- a/old_tests/tests/lean/run/pathsimp.lean +++ /dev/null @@ -1,43 +0,0 @@ -universes u v - -inductive path {α : Type u} (a : α) : α → Type u -| refl : path a - -namespace path - -attribute [refl] path.refl - -@[symm] def symm {α : Type u} {a b : α} (h : path a b) : path b a := -by induction h; refl - -@[trans] def trans {α : Type u} {a b c : α} (h : path a b) (h' : path b c) : path a c := -by induction h; induction h'; refl - -@[congr] def congr {α : Type u} {β : Type v} (f f' : α → β) (a a' : α) - (hf : path f f') (ha : path a a') : path (f a) (f' a') := -by induction hf; induction ha; refl - -def mp {α β : Type u} (h : path α β) : α → β := -by intro; induction h; assumption - -open tactic expr - -meta def path_simp_target (sls : simp_lemmas) := do -tgt ← target, -(tgt', prf) ← simplify sls [] tgt {lift_eq:=ff} `path, -prf ← mk_mapp `path.symm [none, tgt, tgt', prf], -mk_mapp `path.mp [tgt', tgt, prf] >>= apply - -def nat_zero_add (n : ℕ) : path (0 + n) n := sorry - -def foo (n : ℕ) : path (0 + (0 + n)) n := by do -let sls := simp_lemmas.mk, --- path.congr can be used as a congruence lemma -sls ← sls.add_congr ``path.congr, --- nat_zero_add can be used as a simplification lemma even though it has --- associated equational lemmas -sls ← sls.add_simp ``nat_zero_add, -trace sls, -path_simp_target sls, reflexivity - -end path \ No newline at end of file diff --git a/old_tests/tests/lean/run/period_after_eqns.lean b/old_tests/tests/lean/run/period_after_eqns.lean deleted file mode 100644 index 6d3985368d..0000000000 --- a/old_tests/tests/lean/run/period_after_eqns.lean +++ /dev/null @@ -1,6 +0,0 @@ -def f : nat → nat -| 0 := 1 -| (a+1) := 1 -. - -#check 10 diff --git a/old_tests/tests/lean/run/pi_patterns.lean b/old_tests/tests/lean/run/pi_patterns.lean deleted file mode 100644 index e14b7934a1..0000000000 --- a/old_tests/tests/lean/run/pi_patterns.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic - -run_cmd do `(%%a → %%b) ← pure ↑`(nat → nat) | failed, skip -run_cmd do `(%%a → %%b) ← pure ↑`(Π (b : nat), nat) | failed, skip -run_cmd do `(λ a : %%a, (%%b : %%c)) ← pure ↑`(λ n, n + 1) | failed, skip -run_cmd do `(let a := (%%a : %%c) in (%%b : %%d)) ← pure ↑`(let n := 1 in n) | failed, skip diff --git a/old_tests/tests/lean/run/pp_unit.lean b/old_tests/tests/lean/run/pp_unit.lean deleted file mode 100644 index 5468cb6c8d..0000000000 --- a/old_tests/tests/lean/run/pp_unit.lean +++ /dev/null @@ -1,4 +0,0 @@ -#check unit.star -#check () -set_option pp.all true -#check () diff --git a/old_tests/tests/lean/run/prec_max.lean b/old_tests/tests/lean/run/prec_max.lean deleted file mode 100644 index 1ab6577a04..0000000000 --- a/old_tests/tests/lean/run/prec_max.lean +++ /dev/null @@ -1,18 +0,0 @@ -open nat - -reserve postfix ⁻¹:(max + 1) - -postfix ⁻¹ := eq.symm - -constant foo (a b : nat) : a + b = 0 - -theorem tst1 (a b : nat) : 0 = a + b := -(foo _ _)⁻¹ - -constant f {a b : nat} (h1 : 0 = a + b) (h2 : a = b) : a = 0 ∧ b = 0 - -example (a b : nat) : a = 0 ∧ b = 0 := -f (foo _ _)⁻¹ sorry - -example (a b : nat) : a = 0 ∧ b = 0 := -f (foo _ _)⁻¹ sorry⁻¹ diff --git a/old_tests/tests/lean/run/pred_to_subtype_coercion.lean b/old_tests/tests/lean/run/pred_to_subtype_coercion.lean deleted file mode 100644 index 6d58bc18a5..0000000000 --- a/old_tests/tests/lean/run/pred_to_subtype_coercion.lean +++ /dev/null @@ -1,21 +0,0 @@ -universe variables u - -attribute [instance] -definition pred2subtype {A : Type u} : has_coe_to_sort (A → Prop) := -⟨Type u, λ p : A → Prop, subtype p⟩ - -definition below (n : nat) : nat → Prop := -λ i, i < n - -#check λ x : below 10, x - -definition f : below 10 → nat -| ⟨a, h⟩ := a - -lemma zlt10 : 0 < 10 := -sorry - -#check f ⟨0, zlt10⟩ - -definition g (a : below 10) : nat := -subtype.val a diff --git a/old_tests/tests/lean/run/pred_using_structure_cmd.lean b/old_tests/tests/lean/run/pred_using_structure_cmd.lean deleted file mode 100644 index 9216ebf0ed..0000000000 --- a/old_tests/tests/lean/run/pred_using_structure_cmd.lean +++ /dev/null @@ -1,14 +0,0 @@ -variable {A : Type} - -structure has_refl (R : A → A → Prop) : Prop := -(refl : ∀ a, R a a) -namespace test -structure is_equiv (R : A → A → Prop) extends has_refl R : Prop := -(symm : ∀ a b, R a b → R b a) -(trans : ∀ a b c, R a b → R b c → R a c) - -#check @has_refl.refl -#check @is_equiv.symm -#check @is_equiv.trans -#check @is_equiv.to_has_refl -end test diff --git a/old_tests/tests/lean/run/print_inductive.lean b/old_tests/tests/lean/run/print_inductive.lean deleted file mode 100644 index d5bcd043b1..0000000000 --- a/old_tests/tests/lean/run/print_inductive.lean +++ /dev/null @@ -1,3 +0,0 @@ -#print inductive nat - -#print inductive list diff --git a/old_tests/tests/lean/run/print_poly.lean b/old_tests/tests/lean/run/print_poly.lean deleted file mode 100644 index a5fcdba8a7..0000000000 --- a/old_tests/tests/lean/run/print_poly.lean +++ /dev/null @@ -1,12 +0,0 @@ -open nat - -#print pp.max_depth -#print + -#print - - -#print nat -#print nat.zero -#print nat.add -#print nat.rec -#print classical.em -#print quot.lift diff --git a/old_tests/tests/lean/run/priority_test.lean b/old_tests/tests/lean/run/priority_test.lean deleted file mode 100644 index b70f28adcd..0000000000 --- a/old_tests/tests/lean/run/priority_test.lean +++ /dev/null @@ -1,22 +0,0 @@ -open nat - -class foo := -(a : nat) (b : nat) - -attribute [instance, priority std.priority.default+1] -definition i1 : foo := -foo.mk 1 1 - -attribute [instance] -definition i2 : foo := -foo.mk 2 2 - -example : foo.a = 1 := -rfl - -attribute [instance, priority std.priority.default+2] -definition i3 : foo := -foo.mk 3 3 - -example : foo.a = 3 := -rfl diff --git a/old_tests/tests/lean/run/priority_test2.lean b/old_tests/tests/lean/run/priority_test2.lean deleted file mode 100644 index 1b12b528fc..0000000000 --- a/old_tests/tests/lean/run/priority_test2.lean +++ /dev/null @@ -1,47 +0,0 @@ -open nat - -class foo := -(a : nat) (b : nat) - -attribute [instance, priority std.priority.default-2] -definition i1 : foo := -foo.mk 1 1 - -example : foo.a = 1 := -rfl - -attribute [instance, priority std.priority.default-1] -definition i2 : foo := -foo.mk 2 2 - -example : foo.a = 2 := -rfl - -attribute [instance] -definition i3 : foo := -foo.mk 3 3 - -example : foo.a = 3 := -rfl - -attribute [instance, priority std.priority.default-1] -definition i4 : foo := -foo.mk 4 4 - -example : foo.a = 3 := -rfl - -attribute [instance, priority std.priority.default+2] i4 - -example : foo.a = 4 := -rfl - -attribute [instance, priority std.priority.default+3] i1 - -example : foo.a = 1 := -rfl - -attribute [instance, priority std.priority.default+4] i2 - -example : foo.a = 2 := -rfl diff --git a/old_tests/tests/lean/run/private_names.lean b/old_tests/tests/lean/run/private_names.lean deleted file mode 100644 index 61ecb3c395..0000000000 --- a/old_tests/tests/lean/run/private_names.lean +++ /dev/null @@ -1,11 +0,0 @@ -namespace bla -section - private definition foo : inhabited Prop := - inhabited.mk false - - attribute [instance, priority 1000] foo - - example : default Prop = false := - rfl -end -end bla diff --git a/old_tests/tests/lean/run/prod_notation.lean b/old_tests/tests/lean/run/prod_notation.lean deleted file mode 100644 index 31cc882830..0000000000 --- a/old_tests/tests/lean/run/prod_notation.lean +++ /dev/null @@ -1,4 +0,0 @@ -open prod - -definition tst1 : nat × Prop × nat × Prop := (1, true, 2, false) -definition tst2 : nat × nat × nat := (1, 2, 3) diff --git a/old_tests/tests/lean/run/proj_unify.lean b/old_tests/tests/lean/run/proj_unify.lean deleted file mode 100644 index af8827129e..0000000000 --- a/old_tests/tests/lean/run/proj_unify.lean +++ /dev/null @@ -1,66 +0,0 @@ -open tactic - --- Unify (prod.fst ?m) with (prod.fst (1,2)) -example : true := -by do - type ← to_expr ``(nat × nat), - m₁ ← mk_meta_var type, - t₁ ← mk_app ``prod.fst [m₁], - t₂ ← to_expr ``(prod.fst (1, 2)), - unify t₁ t₂, - constructor - --- Unify (prod.fst (?m, 2)) with (prod.fst (3, 1)) -example : true := -by do - type ← to_expr ``(nat), - m₁ ← mk_meta_var type, - two ← to_expr ``(2), - mk ← mk_app ``prod.mk [m₁, two], - t₁ ← mk_app ``prod.fst [mk], - t₂ ← to_expr ``(prod.fst (3, 1)), - trace t₁, trace t₂, - unify t₁ t₂, - four ← to_expr ``(4), - fail_if_success (unify m₁ four), - three ← to_expr ``(3), - unify m₁ three, - constructor - --- Unify (prod.fst ?m) with (id (prod.fst (1,2))) -example : true := -by do - type ← to_expr ``(nat × nat), - m₁ ← mk_meta_var type, - t₁ ← mk_app ``prod.fst [m₁], - t₂ ← to_expr ``(id (prod.fst (1, 2))), - unify t₁ t₂, - constructor - --- Unify (id (prod.fst ?m)) with (prod.fst (1,2)) -example : true := -by do - type ← to_expr ``(nat × nat), - m₁ ← mk_meta_var type, - s ← mk_app ``prod.fst [m₁], - t₁ ← mk_app ``id [s], - t₂ ← to_expr ``(id (prod.fst (1, 2))), - unify t₁ t₂, - constructor - --- Unify (prod.fst (?m, 2)) with (id (prod.fst (3, 1))) -example : true := -by do - type ← to_expr ``(nat), - m₁ ← mk_meta_var type, - two ← to_expr ``(2), - mk ← mk_app ``prod.mk [m₁, two], - t₁ ← mk_app ``prod.fst [mk], - t₂ ← to_expr ``(id (prod.fst (3, 1))), - trace t₁, trace t₂, - unify t₁ t₂, - four ← to_expr ``(4), - fail_if_success (unify m₁ four), - three ← to_expr ``(3), - unify m₁ three, - constructor diff --git a/old_tests/tests/lean/run/protected.lean b/old_tests/tests/lean/run/protected.lean deleted file mode 100644 index 92c607ac36..0000000000 --- a/old_tests/tests/lean/run/protected.lean +++ /dev/null @@ -1,8 +0,0 @@ -namespace foo - protected definition C := true - definition D := true -end foo - -open foo -#check foo.C -#check D diff --git a/old_tests/tests/lean/run/psum_wf_rec.lean b/old_tests/tests/lean/run/psum_wf_rec.lean deleted file mode 100644 index 8e4e40b991..0000000000 --- a/old_tests/tests/lean/run/psum_wf_rec.lean +++ /dev/null @@ -1,25 +0,0 @@ -def psum.alt.sizeof {α β} [has_sizeof α] [has_sizeof β] : psum α β → nat -| (psum.inl a) := 2*sizeof a + 2 -| (psum.inr b) := 2*sizeof b + 1 - -def sum_has_sizeof_2 {α β} [has_sizeof α] [has_sizeof β] : has_sizeof (psum α β) := -⟨psum.alt.sizeof⟩ - -local attribute [instance] sum_has_sizeof_2 -local attribute [simp] add_comm add_left_comm add_assoc mul_assoc mul_comm mul_left_comm - -mutual def f, g -with f : ℕ → ℕ -| n := g n + 1 -with g : ℕ → ℕ -| 0 := 0 -| (n+1) := - /- The following is a hint for the equation compiler. - We will be able to delete it as soon as we have decision procedures for arithmetic -/ - have 2 + n * 2 < 1 + 2 * (n + 1), from - begin - rw [left_distrib], simp, - well_founded_tactics.cancel_nat_add_lt, - tactic.comp_val - end, - f n diff --git a/old_tests/tests/lean/run/ptst.lean b/old_tests/tests/lean/run/ptst.lean deleted file mode 100644 index f6b91b05fa..0000000000 --- a/old_tests/tests/lean/run/ptst.lean +++ /dev/null @@ -1,4 +0,0 @@ -open prod nat - --- Test tuple notation -#check ((3:nat), false, (1:int), true) diff --git a/old_tests/tests/lean/run/qed_perf_bug.lean b/old_tests/tests/lean/run/qed_perf_bug.lean deleted file mode 100644 index e9c51e71ad..0000000000 --- a/old_tests/tests/lean/run/qed_perf_bug.lean +++ /dev/null @@ -1,17 +0,0 @@ -definition f (n : nat) : nat := -if n = 100000 then 1 else 0 - -example (n : nat) : f 100000 = (if (100000 : nat) = 100000 then 1 else 0) := -rfl - -example (n : nat) : f 100000 = (if (100000 : nat) = 100000 then 1 else 0) := -by unfold f - -example (n : nat) : f 100000 = (if (100000 : nat) = 100000 then 1 else 0) := -by simp [f] - -example (n : nat) : f 100000 = (if (100000 : nat) = 100000 then 1 else 0) := -by dsimp [f]; refl - -example (n : nat) : f 100000 = (if (100000 : nat) = 100000 then 1 else 0) := -by delta f; refl diff --git a/old_tests/tests/lean/run/qexpr1.lean b/old_tests/tests/lean/run/qexpr1.lean deleted file mode 100644 index cd85492414..0000000000 --- a/old_tests/tests/lean/run/qexpr1.lean +++ /dev/null @@ -1,24 +0,0 @@ -open tactic - -#check -λ (A : Type) (a b c d : A) (H1 : a = b) (H2 : c = b) (H3 : d = c), -have Hac : a = c, by do { - h ← get_local `H2, - hs ← mk_app `eq.symm [h], - x ← to_expr ```(eq.trans H1 %%hs), - exact x }, -show a = d, by do { - x ← to_expr ```( - have aux : a = c, from Hac, - have c = d, by do { symmetry, assumption }, - show a = d, by do { - get_local `Hac >>= clear, - get_local `H1 >>= clear, - trace "NESTED CALL:", - trace_state, - transitivity, - get_local `aux >>= exact, - assumption }), - trace "-----------", - trace_state, - exact x } diff --git a/old_tests/tests/lean/run/quote1.lean b/old_tests/tests/lean/run/quote1.lean deleted file mode 100644 index 97139db658..0000000000 --- a/old_tests/tests/lean/run/quote1.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic list - -meta definition foo (a : pexpr) : pexpr := -```(%%a + %%a + %%a + b) - -example (a b : nat) : a = a := -by do - a ← get_local `a, - t1 ← mk_app ``has_add.add [a, a], - t2 ← to_expr (foo (to_pexpr t1)), - trace t2, - r ← mk_app (`eq.refl) [a], - exact r - -private def f := unit -#check ``f diff --git a/old_tests/tests/lean/run/quote_bas.lean b/old_tests/tests/lean/run/quote_bas.lean deleted file mode 100644 index 0287318d3f..0000000000 --- a/old_tests/tests/lean/run/quote_bas.lean +++ /dev/null @@ -1,78 +0,0 @@ -universes u v w - -namespace quote_bas - -inductive Expr (V : Type u) -| One {} : Expr -| Var (v : V) : Expr -| Mult (a b : Expr) : Expr - -@[reducible] def Value := nat -def Env (V : Type u) := V → Value - -open Expr - -def evalExpr {V} (vs : Env V) : Expr V → Value -| One := 1 -| (Var v) := vs v -| (Mult a b) := evalExpr a * evalExpr b - -def novars : Env empty := -empty.rec _ - -def singlevar (x : Value) : Env unit := -λ _, x - -open sum - -def merge {A : Type u} {B : Type v} (a : Env A) (b : Env B) : Env (sum A B) -| (inl j) := a j -| (inr j) := b j - -def map_var {A : Type u} {B : Type v} (f : A → B) : Expr A → Expr B -| One := One -| (Var v) := Var (f v) -| (Mult a b) := Mult (map_var a) (map_var b) - -def sum_assoc {A : Type u} {B : Type v} {C : Type w} : sum (sum A B) C → sum A (sum B C) -| (inl (inl a)) := inl a -| (inl (inr b)) := inr (inl b) -| (inr c) := inr (inr c) - -attribute [simp] evalExpr map_var sum_assoc merge - -@[simp] lemma eval_map_var_shift {A : Type u} {B : Type v} (v : Env A) (v' : Env B) (e : Expr A) : evalExpr (merge v v') (map_var inl e) = evalExpr v e := -begin - induction e, - reflexivity, - reflexivity, - simp [*] -end - -@[simp] lemma eval_map_var_sum_assoc {A : Type u} {B : Type v} {C : Type w} (v : Env A) (v' : Env B) (v'' : Env C) (e : Expr (sum (sum A B) C)) : - evalExpr (merge v (merge v' v'')) (map_var sum_assoc e) = evalExpr (merge (merge v v') v'') e := -begin - induction e, - reflexivity, - { cases e with v₁, cases v₁, all_goals {simp} }, - { simp [*] } -end - -class Quote {V : out_param $ Type u} (l : out_param $ Env V) (n : Value) {V' : out_param $ Type v} (r : out_param $ Env V') := -(quote : Expr (sum V V')) -(eval_quote : evalExpr (merge l r) quote = n) - -export Quote (quote eval_quote) -attribute [simp] eval_quote - -instance quote_one (V) (v : Env V) : Quote v 1 novars := -{ quote := One, - eval_quote := rfl } - -instance quote_mul {V : Type u} (v : Env V) (n) {V' : Type v} (v' : Env V') (m) {V'' : Type w} (v'' : Env V'') - [Quote v n v'] [Quote (merge v v') m v''] : - Quote v (n * m) (merge v' v'') := -{ quote := Mult (map_var sum_assoc (map_var inl (quote n))) (map_var sum_assoc (quote m)), - eval_quote := by simp } - -end quote_bas diff --git a/old_tests/tests/lean/run/quote_patterns.lean b/old_tests/tests/lean/run/quote_patterns.lean deleted file mode 100644 index 43201128df..0000000000 --- a/old_tests/tests/lean/run/quote_patterns.lean +++ /dev/null @@ -1,7 +0,0 @@ -meta def f : expr → option (expr × expr × expr) -| `(%%x = %%c*%%y) := some (x, c, y) -| _ := none - -meta def g : expr → nat -| `(%%x = 0) := 2 -| _ := 0 diff --git a/old_tests/tests/lean/run/quote_wo_eval.lean b/old_tests/tests/lean/run/quote_wo_eval.lean deleted file mode 100644 index d5d997ca1f..0000000000 --- a/old_tests/tests/lean/run/quote_wo_eval.lean +++ /dev/null @@ -1,6 +0,0 @@ -meta def loop : nat → nat -| n := loop n - -meta def tst : expr := `(loop 1) - -#eval tst diff --git a/old_tests/tests/lean/run/rand_tst.lean b/old_tests/tests/lean/run/rand_tst.lean deleted file mode 100644 index 12aebf3233..0000000000 --- a/old_tests/tests/lean/run/rand_tst.lean +++ /dev/null @@ -1,18 +0,0 @@ -import system.io -universes u -open io - -def prg (seed : nat): io unit := -do put_str_ln ("Generating random numbers using seed: " ++ to_string seed), - set_rand_gen (mk_std_gen seed), - iterate 20 $ λ i, - if i > 0 then - do { n ← rand 0 18446744073709551616, - put_str_ln $ to_string n, - return $ some (i - 1) } - else - return none, - return () - -#eval prg 1 -#eval prg 2 diff --git a/old_tests/tests/lean/run/random.lean b/old_tests/tests/lean/run/random.lean deleted file mode 100644 index e7ce38e1c5..0000000000 --- a/old_tests/tests/lean/run/random.lean +++ /dev/null @@ -1,82 +0,0 @@ -import system.io -universes u - -def tst1 : nat := -let s := mk_std_gen, /- create standard random number generator -/ - (v, s') := rand_nat s 0 100 /- generate a random nat in [0, 100]. -/ -in v - -#eval tst1 - -def tst2 : bool × bool × bool × bool := -let s := mk_std_gen, /- create standard random number generator -/ - (b₁, s₁) := rand_bool s, /- generate a random Boolean -/ - (b₂, s₂) := rand_bool s₁, /- generate another random Boolean -/ - (b₃, s₃) := rand_bool s₂, - (b₄, _) := rand_bool s₃ -in (b₁, b₂, b₃, b₄) - -#eval tst2 - -/- `rand_list sz g lo hi` generates a list of size `sz` with - random nat's in [lo, hi] generated by `g`. -/ -def rand_list : nat → std_gen → nat → nat → list nat × std_gen -| 0 g lo hi := ([], g) -| (n+1) g lo hi := - let (l, g₁) := rand_list n g lo hi, - (v, g₂) := rand_nat g₁ lo hi - in (v::l, g₂) - -#eval (rand_list 20 mk_std_gen 0 10).1 - -/- Version of rand_list that is parametrized by any random number generator implementation -/ -def gen_rand_list {gen : Type u} [random_gen gen] : nat → gen → nat → nat → list nat × gen -| 0 g lo hi := ([], g) -| (n+1) g lo hi := - let (l, g₁) := gen_rand_list n g lo hi, - (v, g₂) := rand_nat g₁ lo hi - in (v::l, g₂) - -#eval (gen_rand_list 20 mk_std_gen 0 10).1 - -/- We can implement our own number generators. - Here is a 'dumb' one that just generates a sequence -/ - -structure dummy_gen := -(lo hi : nat) -(next : nat := lo) - -instance : random_gen dummy_gen := -{ range := λ s, (s.lo, s.hi), - next := λ s, (s.next, {next := s.next + 1, ..s}), - split := λ s, (s, s) } - -def mk_dummy_gen (lo : nat := 0) (hi : nat := 100000) : dummy_gen := -{lo := lo, hi := hi} - -/- Invoke gen_rand_list using the dummy generator. -/ -#eval (gen_rand_list 20 mk_dummy_gen 0 10).1 - -open io -/- The io monad has a number generator. - The action `rand` generates a random number. --/ -def prg₁ : io unit := -do v₁ ← rand, - put_str_ln (to_string v₁), - v₂ ← rand 0 100, -- we can provide lower and upper bounds - put_str_ln (to_string v₂) - -#eval prg₁ -#eval prg₁ /- generate different results since the "World" was modified by previous eval -/ - -/- The default number generator for the io monad is - based on the C++ std::rand procedure, but the - user can use set_rand_gen to modify it. --/ -def prg₂ : io unit := -do set_rand_gen mk_std_gen, - prg₁ - -#eval prg₂ -#eval prg₂ /- generate same result -/ diff --git a/old_tests/tests/lean/run/rb_map1.lean b/old_tests/tests/lean/run/rb_map1.lean deleted file mode 100644 index 4010e22ecd..0000000000 --- a/old_tests/tests/lean/run/rb_map1.lean +++ /dev/null @@ -1,44 +0,0 @@ -import system.io -open io -section -open native.nat_map - -#eval size (insert (insert (mk nat) 10 20) 10 21) - -meta definition m := (insert (insert (insert (mk nat) 10 20) 5 50) 10 21) - -#eval find m 10 -#eval find m 5 -#eval find m 8 -#eval contains m 5 -#eval contains m 8 - -open list - -meta definition m2 := of_list [((1:nat), "one"), (2, "two"), (3, "three")] - -#eval size m2 -#eval find m2 1 -#eval find m2 4 -#eval find m2 3 - -section - -#eval do pp m2, put_str "\n" -end -#eval m2 - -end - -section -open native.rb_map --- Mapping from (nat × nat) → nat -meta definition m3 := insert (insert (mk (nat × nat) nat) (1, 2) 3) (2, 2) 4 - -#eval find m3 (1, 2) -#eval find m3 (2, 1) -#eval find m3 (2, 2) - - -#eval pp m3 -end diff --git a/old_tests/tests/lean/run/rbtree1.lean b/old_tests/tests/lean/run/rbtree1.lean deleted file mode 100644 index d451b4040e..0000000000 --- a/old_tests/tests/lean/run/rbtree1.lean +++ /dev/null @@ -1,5 +0,0 @@ -#eval rbtree.from_list [3, 4, 2, 5, 1] (<) -#eval rbtree.from_list [3, 4, 2, 5, 1] (>) -#eval (rbtree.from_list [3, 4, 2, 5]).to_list -#eval rbtree.from_list [3, 4, 2, 5] -#eval rbtree.to_list $ rbtree.from_list [3, 4, 2, 5] diff --git a/old_tests/tests/lean/run/reader.lean b/old_tests/tests/lean/run/reader.lean deleted file mode 100644 index 7aadc489ed..0000000000 --- a/old_tests/tests/lean/run/reader.lean +++ /dev/null @@ -1,11 +0,0 @@ -import system.io - -def lifted_test : state_t ℕ (reader_t ℕ io) unit := -do 0 ← get, - 1 ← read, - adapt_reader (λ n, (n, 2)) ((do p ← read, - put p.2) : state_t ℕ (reader_t (ℕ × ℕ) io) _), - 2 ← get, - pure () - -#eval (lifted_test.run 0).run 1 diff --git a/old_tests/tests/lean/run/rebind_bind.lean b/old_tests/tests/lean/run/rebind_bind.lean deleted file mode 100644 index f41756b239..0000000000 --- a/old_tests/tests/lean/run/rebind_bind.lean +++ /dev/null @@ -1,12 +0,0 @@ -class mono_monad (m : Type) (α : out_param Type) := -(pure : α → m) -(bind : m → (α → m) → m) - -export mono_monad (bind pure) - -instance : mono_monad bool bool := -{ pure := id, bind := λ b f, if b then f b else b } - -#eval do b ← tt, - b' ← ff, - mono_monad.pure _ b diff --git a/old_tests/tests/lean/run/rec_and_tac_issue.lean b/old_tests/tests/lean/run/rec_and_tac_issue.lean deleted file mode 100644 index 18114fa83b..0000000000 --- a/old_tests/tests/lean/run/rec_and_tac_issue.lean +++ /dev/null @@ -1,5 +0,0 @@ -open nat - -def f : ℕ → ℕ → ℕ -| 0 b := 0 -| (succ n) b := begin cases b with b', exact 0, exact f n b' end diff --git a/old_tests/tests/lean/run/rec_eq_ematch_bug.lean b/old_tests/tests/lean/run/rec_eq_ematch_bug.lean deleted file mode 100644 index 3e1b53a8ba..0000000000 --- a/old_tests/tests/lean/run/rec_eq_ematch_bug.lean +++ /dev/null @@ -1,29 +0,0 @@ -inductive Nat -| Z : Nat -| S : Nat → Nat - -open Nat -constant Add : Nat → Nat → Nat -axiom Add_Zero : ∀ a, Add a Z = a -axiom Zero_Add : ∀ a, Add Z a = a -axiom Add_Succ : ∀ a b, Add a (S b) = S (Add a b) -axiom Succ_Add : ∀ a b, Add (S a) b = S (Add a b) - -local attribute [ematch] Add_Zero Zero_Add Add_Succ Succ_Add - -open smt_tactic - -lemma Add_comm : ∀ a b : Nat, Add a b = Add b a -| a Z := - begin [smt] - /- local hypothesis nat_add_comm should have been deleted -/ - add_lemmas_from_facts, - ematch - end -| a (S b) := - have ih : Add a b = Add b a, from Add_comm a b, - begin [smt] - /- local hypothesis nat_add_comm should have been deleted -/ - add_lemmas_from_facts, - ematch - end diff --git a/old_tests/tests/lean/run/rec_meta_issue.lean b/old_tests/tests/lean/run/rec_meta_issue.lean deleted file mode 100644 index 24722d2b59..0000000000 --- a/old_tests/tests/lean/run/rec_meta_issue.lean +++ /dev/null @@ -1,12 +0,0 @@ -open tactic - -meta def left_right_search (tac := assumption) : tactic unit := - tac -<|> (left >> left_right_search) -<|> (right >> left_right_search) - -example (p q r : Prop) : r → p ∨ q ∨ r := -begin intros, left_right_search end - -example (a b c : nat) : a = b ∨ b = c ∨ a = a := -begin left_right_search reflexivity end diff --git a/old_tests/tests/lean/run/record1.lean b/old_tests/tests/lean/run/record1.lean deleted file mode 100644 index 19c75569d4..0000000000 --- a/old_tests/tests/lean/run/record1.lean +++ /dev/null @@ -1,43 +0,0 @@ -structure point (A : Type) (B : Type) := -mk :: (x : A) (y : B) - -#check point -#check @ point.rec -#check point.mk -#check point.x -#check point.y -#check point.rec_on - -inductive color -| red | green | blue - -structure color_point (A : Type) (B : Type) extends point A B := -mk :: (c : color) - -#check @color_point.rec_on -#check color_point.rec_on -#check color_point.to_point - -section -variables a b : nat - -example : point.x (point.mk a b) = a := -rfl - -example : point.y (point.mk a b) = b := -rfl - -variables cc : color - -example : {color_point . x := a, y := b, c := cc}.x = a := -rfl - -example : {color_point . x := a, y := b, c := cc}.y = b := -rfl - -example : {color_point . x := a, y := b, c := cc}.c = cc := -rfl - -example : {color_point . x := a, y := b, c := cc}.to_point = point.mk a b := -rfl -end diff --git a/old_tests/tests/lean/run/record10.lean b/old_tests/tests/lean/run/record10.lean deleted file mode 100644 index 04b6d0dd62..0000000000 --- a/old_tests/tests/lean/run/record10.lean +++ /dev/null @@ -1,15 +0,0 @@ -set_option old_structure_cmd true - -#print prefix semigroup - -#print "=======================" - -class has_two_muls (A : Type) extends has_mul A renaming mul→mul1, - private has_mul A renaming mul→mul2 - -#print prefix has_two_muls - -#print "=======================" - -class another_two_muls (A : Type) extends has_mul A renaming mul→mul1, - has_mul A renaming mul→mul2 diff --git a/old_tests/tests/lean/run/record2.lean b/old_tests/tests/lean/run/record2.lean deleted file mode 100644 index 3956718703..0000000000 --- a/old_tests/tests/lean/run/record2.lean +++ /dev/null @@ -1,20 +0,0 @@ -set_option pp.universes true - -section - parameter (A : Type) - - section - parameter (B : Type) - - structure point := - mk :: (x : A) (y : B) - - #check point - #check point.mk - #check point.x - end - - #check point - #check point.mk - #check point.x -end diff --git a/old_tests/tests/lean/run/record4.lean b/old_tests/tests/lean/run/record4.lean deleted file mode 100644 index 9454f3b9dd..0000000000 --- a/old_tests/tests/lean/run/record4.lean +++ /dev/null @@ -1,8 +0,0 @@ -structure point (A : Type) (B : Type) := -mk :: (x : A) (y : B) - -inductive color -| red | green | blue - -structure color_point (A : Type) (B : Type) extends point A B := -mk :: (c : color) diff --git a/old_tests/tests/lean/run/record7.lean b/old_tests/tests/lean/run/record7.lean deleted file mode 100644 index 74270828d3..0000000000 --- a/old_tests/tests/lean/run/record7.lean +++ /dev/null @@ -1,7 +0,0 @@ -structure point (A : Type) (B : Type) := -mk :: (x : A) (y : B) - -structure point2 (A : Type) (B : Type) extends point A B := -make - -#print prefix point2 diff --git a/old_tests/tests/lean/run/record8.lean b/old_tests/tests/lean/run/record8.lean deleted file mode 100644 index d8f7471f51..0000000000 --- a/old_tests/tests/lean/run/record8.lean +++ /dev/null @@ -1,4 +0,0 @@ -structure point := -(x y : nat) - -#check point.x diff --git a/old_tests/tests/lean/run/record9.lean b/old_tests/tests/lean/run/record9.lean deleted file mode 100644 index 5c126635ec..0000000000 --- a/old_tests/tests/lean/run/record9.lean +++ /dev/null @@ -1,6 +0,0 @@ -constant {u} fibrant : Type u → Prop - -structure {u} Fib : Type (u+1) := -{type : Type u} (pred : fibrant type) - -#check Fib.mk diff --git a/old_tests/tests/lean/run/reflected.lean b/old_tests/tests/lean/run/reflected.lean deleted file mode 100644 index 1d929d4851..0000000000 --- a/old_tests/tests/lean/run/reflected.lean +++ /dev/null @@ -1,4 +0,0 @@ -meta def eval_list (α : Type) [reflected α] (e : expr) : tactic (list α) := -tactic.eval_expr (list α) e - -run_cmd eval_list ℕ ↑`([1, 2]) >>= tactic.trace diff --git a/old_tests/tests/lean/run/reflected_coercion_with_mvars.lean b/old_tests/tests/lean/run/reflected_coercion_with_mvars.lean deleted file mode 100644 index b9e96c6f5f..0000000000 --- a/old_tests/tests/lean/run/reflected_coercion_with_mvars.lean +++ /dev/null @@ -1,2 +0,0 @@ -meta example : expr := -`(1 + 1 : nat) diff --git a/old_tests/tests/lean/run/reflexive_elim_prop_bug.lean b/old_tests/tests/lean/run/reflexive_elim_prop_bug.lean deleted file mode 100644 index e0343fa58c..0000000000 --- a/old_tests/tests/lean/run/reflexive_elim_prop_bug.lean +++ /dev/null @@ -1,30 +0,0 @@ -namespace tst1 - -inductive Foo : Type -| node : (ℕ → Foo) → Foo -| leaf : Foo - -constant Bar : Type -constant P : Bar → Prop -constant Q : Bar → Type -axiom P_ax : ∀ b, P b - -lemma foo_error : ∀ (foo : Foo) (b : Bar), P b -| (Foo.node f) := λ b, foo_error (f 0) b -| Foo.leaf := λ b, P_ax b - -end tst1 - -namespace tst2 - -inductive Foo : Type -| node : (ℕ → Foo) → Foo - -constant Bar : Type -constant P : Bar → Prop -constant Q : Bar → Type - -lemma foo_error : ∀ (foo : Foo) (b : Bar), P b -| (Foo.node f) := λ b, foo_error (f 0) b - -end tst2 diff --git a/old_tests/tests/lean/run/regset.lean b/old_tests/tests/lean/run/regset.lean deleted file mode 100644 index f8938aa8ec..0000000000 --- a/old_tests/tests/lean/run/regset.lean +++ /dev/null @@ -1,13 +0,0 @@ -namespace regset - -section -parameter symbol : Type - -@[reducible] def lang : Type := -set (list symbol) - -def concat : lang → lang → lang := -λ a b : lang, { ll : list symbol | ∃xs ys : list symbol, ll = list.append xs ys ∧ xs ∈ a ∧ ys ∈ b } - -end -end regset diff --git a/old_tests/tests/lean/run/rel_tac1.lean b/old_tests/tests/lean/run/rel_tac1.lean deleted file mode 100644 index c562fd82e3..0000000000 --- a/old_tests/tests/lean/run/rel_tac1.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic - -example (a b : nat) : a = a := -by reflexivity - -example (a : nat) (b : bool) : a == b → b == a := -by do intros, symmetry, trace_state, assumption - -#print "-----------" - -example (a : nat) (b : bool) (c : string) : a == b → b == c → a == c := -by do - intro_lst [`H1, `H2], - transitivity, - trace_state, - get_local `H1 >>= exact, - assumption - -example (a b : bool) : a == a := -by reflexivity diff --git a/old_tests/tests/lean/run/repeat_tac.lean b/old_tests/tests/lean/run/repeat_tac.lean deleted file mode 100644 index 19008f635b..0000000000 --- a/old_tests/tests/lean/run/repeat_tac.lean +++ /dev/null @@ -1,2 +0,0 @@ -example (p q r s : Prop) : p → q → r → s → (p ∧ q) ∧ (r ∧ s ∧ p) ∧ (p ∧ r ∧ q) := -by intros; repeat { constructor }; assumption diff --git a/old_tests/tests/lean/run/reserve.lean b/old_tests/tests/lean/run/reserve.lean deleted file mode 100644 index 8945ca7b6c..0000000000 --- a/old_tests/tests/lean/run/reserve.lean +++ /dev/null @@ -1,8 +0,0 @@ -reserve infix `=?=`:50 -reserve infixr `&&&`:25 - -notation a `=?=` b := eq a b -notation a `&&&` b := and a b - -set_option pp.notation false -#check λ a b : nat, a =?= b &&& b =?= a diff --git a/old_tests/tests/lean/run/resolve_name_bug.lean b/old_tests/tests/lean/run/resolve_name_bug.lean deleted file mode 100644 index 3b2d539f81..0000000000 --- a/old_tests/tests/lean/run/resolve_name_bug.lean +++ /dev/null @@ -1,27 +0,0 @@ -open tactic - -constant f : nat → nat - -meta def check_expr (p : pexpr) (t : expr) : tactic unit := -do e ← to_expr p, guard (t = e) - -namespace foo -axiom f_lemma1 : f 0 = 1 -namespace bla -axiom f_lemma2 : f 1 = 2 - -def g (a : nat) := a + 1 - -example : g 0 = 1 := -begin - unfold g -end - -example : f (f 0) = 2 := -by rewrite [f_lemma1, f_lemma2] - -lemma ex2 : f (f 0) = 2 := -by simp [f_lemma1, f_lemma2] - -end bla -end foo diff --git a/old_tests/tests/lean/run/revert_crash.lean b/old_tests/tests/lean/run/revert_crash.lean deleted file mode 100644 index 4f4861d86b..0000000000 --- a/old_tests/tests/lean/run/revert_crash.lean +++ /dev/null @@ -1,13 +0,0 @@ -constant α: Type - -inductive P: α → Prop - -inductive Q: α → α → Prop -| of: ∀ {a₁ a₂}, Q a₁ a₂ - -example {a: α} (P_a: P a) (Q_a: ∃ a', Q a' a): true := -begin - cases Q_a with a' Q_a'_a, - cases Q_a'_a, - cases P_a, -end diff --git a/old_tests/tests/lean/run/root.lean b/old_tests/tests/lean/run/root.lean deleted file mode 100644 index ffa6be13b5..0000000000 --- a/old_tests/tests/lean/run/root.lean +++ /dev/null @@ -1,14 +0,0 @@ -constant foo : Prop - -namespace N1 - constant foo : Prop - #check N1.foo - #check _root_.foo - namespace N2 - constant foo : Prop - #check N1.foo - #check N1.N2.foo - #print raw foo - #print raw _root_.foo - end N2 -end N1 diff --git a/old_tests/tests/lean/run/run_tactic1.lean b/old_tests/tests/lean/run/run_tactic1.lean deleted file mode 100644 index 44415dcac6..0000000000 --- a/old_tests/tests/lean/run/run_tactic1.lean +++ /dev/null @@ -1,32 +0,0 @@ -open tactic - -run_cmd tactic.trace "hello world" - -run_cmd do - N ← to_expr ``(nat), - v ← to_expr ``(10), - add_decl (declaration.defn `val10 [] N v reducibility_hints.opaque tt) - -#eval val10 - -example : val10 = 10 := rfl - -meta definition mk_defs : nat → command -| 0 := skip -| (n+1) := do - let N := `(ℕ), - let v := `(n), - add_decl (declaration.defn (name.append_after `val n) [] N v reducibility_hints.opaque tt), - mk_defs n - -run_cmd mk_defs 10 - -example : val_1 = 1 := rfl -example : val_2 = 2 := rfl -example : val_3 = 3 := rfl -example : val_4 = 4 := rfl -example : val_5 = 5 := rfl -example : val_6 = 6 := rfl -example : val_7 = 7 := rfl -example : val_8 = 8 := rfl -example : val_9 = 9 := rfl diff --git a/old_tests/tests/lean/run/rvec.lean b/old_tests/tests/lean/run/rvec.lean deleted file mode 100644 index 363f356cfc..0000000000 --- a/old_tests/tests/lean/run/rvec.lean +++ /dev/null @@ -1,23 +0,0 @@ -open nat -universe variables u - -inductive rvec (α : Type u) : nat → Type u -| nil {} : rvec 0 -| cons : Π {n}, rvec n → α → rvec (succ n) - -namespace rvec - -local infix :: := cons -variables {α β δ : Type u} - -def map (f : α → β) : Π {n : nat}, rvec α n → rvec β n -| 0 nil := nil -| (succ n) (v::a) := map v :: f a - -def map₂ (f : α → β → δ) : Π {n : nat}, rvec α n → rvec β n → rvec δ n -| 0 nil nil := nil -| (succ n) (v::a) (w::b) := map₂ v w :: f a b - -lemma ex1 : map succ (nil::1::2) = nil::2::3 := -rfl -end rvec diff --git a/old_tests/tests/lean/run/rw1.lean b/old_tests/tests/lean/run/rw1.lean deleted file mode 100644 index cede0eb480..0000000000 --- a/old_tests/tests/lean/run/rw1.lean +++ /dev/null @@ -1,84 +0,0 @@ -namespace Ex1 - -variables - (f : nat → nat → nat) - (p : nat → nat → Prop) - (h₁ : ∀ a b c, p b c → f a b = a) - (x y z : nat) - (h₂ : p y z) -include f h₁ x y z h₂ -open tactic - -example : f x y = 0 + x := -begin - rw [h₁], - /- Resulting goals - ... ⊢ x = 0 + x - ... ⊢ p y ?m_1 - ... ⊢ ℕ -- This is ?m_1 - -/ - (do n ← num_goals, guard $ n = 3), - simp, - exact h₂ -end - -example : f x y = 0 + x := -begin - rw [h₁] {new_goals := new_goals.non_dep_only}, - /- Resulting goals - ... ⊢ x = 0 + x - ... ⊢ p y ?m_1 - - ?m_1 is not included as a new goal because it occurs above. - -/ - (do n ← num_goals, guard $ n = 2), - simp, - exact h₂ -end - -example : f x y = 0 + x := -begin - rw [h₁] {new_goals := new_goals.all}, - /- Resulting goals - ... ⊢ x = 0 + x - ... ⊢ ℕ -- This is ?m_1 - ... ⊢ p y ?m_1 - - The order is preserved in this mode. - -/ - (do n ← num_goals, guard $ n = 3), - simp, - exact z, - exact h₂ -end - -end Ex1 - -namespace Ex2 -open tactic - -constant f : nat → nat -constant p : nat → Prop -/- The following lemma has an "auto_param", i.e., if `h` is not provided we - try to synthesize it using the `assumption` tactic -/ -lemma f_lemma (a : nat) (h : p a . assumption) : f a = a := -sorry - -/- `rw` has support for "auto_param"'s. -/ -example (x : nat) (h : p x) : f x = 0 + x := -begin - rw [f_lemma], - (do n ← num_goals, guard $ n = 1), - simp -end - -/- We can disable auto_param support. -/ -example (x : nat) (h : p x) : f x = 0 + x := -begin - rw [f_lemma] {auto_param := ff}, - (do n ← num_goals, guard $ n = 2), - simp, - exact h -end - -end Ex2 diff --git a/old_tests/tests/lean/run/rw_eqn_lemmas.lean b/old_tests/tests/lean/run/rw_eqn_lemmas.lean deleted file mode 100644 index 44827f740d..0000000000 --- a/old_tests/tests/lean/run/rw_eqn_lemmas.lean +++ /dev/null @@ -1,21 +0,0 @@ -open nat well_founded - -def gcd' : ℕ → ℕ → ℕ | y := λ x, -if h : y = 0 then - x -else - have x % y < y, by { apply mod_lt, cases y, contradiction, apply succ_pos }, - gcd' (x % y) y - -lemma gcd_zero_right (x : nat) : gcd' 0 x = x := -begin - rw [gcd'], - simp -end - -lemma ex (x : nat) (h : gcd' 0 x = 0) : x + x = 0 := -begin - rw [gcd'] at h, - simp at h, - simp [h] -end diff --git a/old_tests/tests/lean/run/rw_set1.lean b/old_tests/tests/lean/run/rw_set1.lean deleted file mode 100644 index c3bc458368..0000000000 --- a/old_tests/tests/lean/run/rw_set1.lean +++ /dev/null @@ -1,14 +0,0 @@ -namespace foo - attribute [simp] nat.add_assoc - #print nat.add_assoc -end foo - -#print nat.add_assoc - -namespace foo - #print nat.add_assoc - attribute [simp] nat.add_comm - open nat - #print "---------" - #print [simp] default -end foo diff --git a/old_tests/tests/lean/run/rw_set3.lean b/old_tests/tests/lean/run/rw_set3.lean deleted file mode 100644 index 1d6cda167f..0000000000 --- a/old_tests/tests/lean/run/rw_set3.lean +++ /dev/null @@ -1,14 +0,0 @@ -open tactic nat - -constant f : nat → nat -constant g : nat → nat - -axiom foo : ∀ x, f x = 1 -axiom bla : ∀ x, f x = 2 - -attribute [simp] foo -attribute [simp] bla - -#print [simp] default - -example : f 5 = 2 := by simp diff --git a/old_tests/tests/lean/run/rw_set4.lean b/old_tests/tests/lean/run/rw_set4.lean deleted file mode 100644 index 274962455f..0000000000 --- a/old_tests/tests/lean/run/rw_set4.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -attribute [congr, priority std.priority.default+1] -theorem forall_congr_prop_eq {P₁ P₂ Q₁ Q₂ : Prop} : - P₁ = P₂ → (P₂ → Q₁ = Q₂) → (P₁ → Q₁) = (P₂ → Q₂) := -sorry - -#print [congr] default - -example (A : Type) (a b c : A) : (a = b) → (a = c) → a = b := by simp {contextual := tt} -example (A : Type) (a b c : A) : (a = c) → (a = b) → a = b := by simp {contextual := tt} diff --git a/old_tests/tests/lean/run/sec_bug.lean b/old_tests/tests/lean/run/sec_bug.lean deleted file mode 100644 index 25faf4ef67..0000000000 --- a/old_tests/tests/lean/run/sec_bug.lean +++ /dev/null @@ -1,7 +0,0 @@ -namespace foo -section bla - definition tst := true -end bla -end foo - -#check foo.tst diff --git a/old_tests/tests/lean/run/sec_notation.lean b/old_tests/tests/lean/run/sec_notation.lean deleted file mode 100644 index 8e037eaac3..0000000000 --- a/old_tests/tests/lean/run/sec_notation.lean +++ /dev/null @@ -1,15 +0,0 @@ -open nat - -section - parameter (A : Type) - definition f (a b : A) : A := a - - definition add2 (a : nat) : nat := a + 2 - - postfix `+.2`:100 := add2 - - #reduce 3 +.2 -end - -example : 3 +.2 = 5 := -rfl diff --git a/old_tests/tests/lean/run/sec_var.lean b/old_tests/tests/lean/run/sec_var.lean deleted file mode 100644 index d4ab3b30e4..0000000000 --- a/old_tests/tests/lean/run/sec_var.lean +++ /dev/null @@ -1,25 +0,0 @@ -section - parameter A : Type - definition foo : ∀ ⦃ a b : A ⦄, a = b → a = b := - assume a b H, H - - variable a : A - set_option pp.implicit true - #check foo (eq.refl a) - #check foo - #check foo = (λ (a b : A) (H : a = b), H) -end - -#check foo = (λ (A : Type) (a b : A) (H : a = b), H) - -section - variable A : Type - definition foo2 : ∀ ⦃ a b : A ⦄, a = b → a = b := - assume a b H, H - - variable a : A - set_option pp.implicit true - #check foo2 A (eq.refl a) - #check foo2 - #check foo2 A = (λ (a b : A) (H : a = b), H) -end diff --git a/old_tests/tests/lean/run/seclvl.lean b/old_tests/tests/lean/run/seclvl.lean deleted file mode 100644 index d0e6df26f6..0000000000 --- a/old_tests/tests/lean/run/seclvl.lean +++ /dev/null @@ -1,22 +0,0 @@ -section - variables (A B C : Type) - definition foo := A → B - - #check foo A B - #check foo B C - #check foo A A -end - -constants A B C : Type -#check foo A B -#check foo B C -#check foo A A - -section - variables (A B C : Type) - definition foo2 := A → B - - #check foo2 A B - #check foo2 B C - #check foo2 A A -end diff --git a/old_tests/tests/lean/run/secnot.lean b/old_tests/tests/lean/run/secnot.lean deleted file mode 100644 index 2feae89500..0000000000 --- a/old_tests/tests/lean/run/secnot.lean +++ /dev/null @@ -1,23 +0,0 @@ -section -variable {A : Type} -definition f (a b : A) := a -infixl ` ◀ `:65 := f -variables a b : A -#check a ◀ b -end - -inductive List (T : Type) : Type -| nil {} : List -| cons : T → List → List - -namespace List -section -variable {T : Type} -notation `[` l:(foldr `,` (h t, cons h t) nil) `]` := l -#check [(10:nat), 20, 30] -end -end List - -open List -#check [(10:nat), 20, 40] -#check (10:nat) ◀ 20 diff --git a/old_tests/tests/lean/run/section1.lean b/old_tests/tests/lean/run/section1.lean deleted file mode 100644 index 850f1c9d47..0000000000 --- a/old_tests/tests/lean/run/section1.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic - -section - set_option pp.universes true - set_option pp.implicit true - variable {A : Type} - variables {a b : A} - variable H : a = b - variables H1 H2 : b = a - #check H1 - #check H - #check H2 -end diff --git a/old_tests/tests/lean/run/section2.lean b/old_tests/tests/lean/run/section2.lean deleted file mode 100644 index b3bb04eb1f..0000000000 --- a/old_tests/tests/lean/run/section2.lean +++ /dev/null @@ -1,13 +0,0 @@ -section foo - variable A : Type - variable a : nat -end foo - -namespace n1 -section foo - variable A : Type - definition id (a : A) := a - variable a : nat - #check n1.id _ a -end foo -end n1 diff --git a/old_tests/tests/lean/run/section3.lean b/old_tests/tests/lean/run/section3.lean deleted file mode 100644 index 771a6565ce..0000000000 --- a/old_tests/tests/lean/run/section3.lean +++ /dev/null @@ -1,6 +0,0 @@ -section - parameter (A : Type) - definition foo := A - definition bar {X : Type} {A : X} : foo := - sorry -end diff --git a/old_tests/tests/lean/run/section4.lean b/old_tests/tests/lean/run/section4.lean deleted file mode 100644 index 888ab5d074..0000000000 --- a/old_tests/tests/lean/run/section4.lean +++ /dev/null @@ -1,36 +0,0 @@ -set_option pp.universes true -set_option pp.implicit true - -section - universe k - parameter A : Type - - section - universe variable l - universe variable u - parameter B : Type - definition foo (a : A) (b : B) := b - - inductive mypair - | mk : A → B → mypair - - #print mypair.rec - #check mypair.mk - - definition pr1' : mypair → A - | (mypair.mk a b) := a - - definition pr2' : mypair → B - | (mypair.mk a b) := b - - end - #check mypair.rec - variable a : A - #check foo nat a 0 - - definition pr1 : mypair nat → A - | (mypair.mk a b) := a - - definition pr2 : mypair nat → nat - | (mypair.mk a b) := b -end diff --git a/old_tests/tests/lean/run/section5.lean b/old_tests/tests/lean/run/section5.lean deleted file mode 100644 index 223aeacfab..0000000000 --- a/old_tests/tests/lean/run/section5.lean +++ /dev/null @@ -1,19 +0,0 @@ -section foo - parameter A : Type - variable a : A - definition foo := a - - #check foo - - class point := - (x : A) (y : A) -end foo - -#check foo - -attribute [instance] -definition point_nat : point nat := -point.mk nat.zero nat.zero - -#print classes -#check point diff --git a/old_tests/tests/lean/run/section_var_bug.lean b/old_tests/tests/lean/run/section_var_bug.lean deleted file mode 100644 index 7f48bd207e..0000000000 --- a/old_tests/tests/lean/run/section_var_bug.lean +++ /dev/null @@ -1,11 +0,0 @@ -section -variable {A : Type} -variable [s : setoid A] -variable {B : quotient s → Type} -include s - -attribute [reducible] -protected definition ex (f : Π a, B ⟦a⟧) (a : A) : Σ q, B q := -sigma.mk ⟦a⟧ (f a) - -end diff --git a/old_tests/tests/lean/run/set1.lean b/old_tests/tests/lean/run/set1.lean deleted file mode 100644 index 8eba655b78..0000000000 --- a/old_tests/tests/lean/run/set1.lean +++ /dev/null @@ -1,5 +0,0 @@ -variables A : Type - -example (s₁ s₂ s₃ : set A) : s₁ ⊆ s₂ → s₂ ⊆ s₃ → s₁ ⊆ s₃ := -assume h₁ h₂ a ains₁, -h₂ (h₁ ains₁) diff --git a/old_tests/tests/lean/run/set_attr1.lean b/old_tests/tests/lean/run/set_attr1.lean deleted file mode 100644 index a9f8c89794..0000000000 --- a/old_tests/tests/lean/run/set_attr1.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -constant f : nat → nat -constant foo : ∀ n, f n = n + 1 -constant zadd : ∀ n, 0 + n = n - -definition ex1 (n : nat) : 0 + f n = n + 1 := -by do - set_basic_attribute `simp `foo ff, - set_basic_attribute `simp `zadd ff, - `[simp] diff --git a/old_tests/tests/lean/run/shadow1.lean b/old_tests/tests/lean/run/shadow1.lean deleted file mode 100644 index 1afec52a8a..0000000000 --- a/old_tests/tests/lean/run/shadow1.lean +++ /dev/null @@ -1,33 +0,0 @@ -variable a : nat - -definition f : nat → nat -| (nat.succ a) := a -| nat.zero := nat.zero - -example : f 3 = 2 := -rfl - -definition g : nat → nat -| a := a - -example (a : nat) : g a = a := -rfl - -definition h (a : nat) : nat → nat -| a := a - -example (a b : nat) : h a b = b := -rfl - -definition o : nat := 0 - -definition f2 : nat → nat -| o := 0 - -example (a : nat) : f2 a = 0 := rfl - -definition f3 : nat → nat -| (a+1) := a -| nat.zero := nat.zero - -example : f3 10 = 9 := rfl diff --git a/old_tests/tests/lean/run/show_goal.lean b/old_tests/tests/lean/run/show_goal.lean deleted file mode 100644 index 6480a347a8..0000000000 --- a/old_tests/tests/lean/run/show_goal.lean +++ /dev/null @@ -1,27 +0,0 @@ -open tactic - -lemma ex1 (a b c : nat) : a + 0 = 0 + a ∧ 0 + b = b ∧ c + b = b + c := -begin - repeat {any_goals {constructor}}, - show c + b = b + c, { apply add_comm }, - show a + 0 = 0 + a, { simp }, - show 0 + b = b, { rw [zero_add] } -end - -/- Same example, but the local context of each goal is different -/ -lemma ex3 : (∀ a : nat, a + 0 = 0 + a) ∧ (∀ b : nat, 0 + b = b) ∧ (∀ b c : nat, c + b = b + c) := -begin - repeat {any_goals {constructor}}, all_goals {intros}, - show c + b = b + c, { apply add_comm }, - show a + 0 = 0 + a, { simp }, - show 0 + b = b, { rw [zero_add] } -end - -/- Same example, but the local context of each goal is different -/ -lemma ex4 : (∀ a : nat, a + 0 = 0 + a) ∧ (∀ b : nat, 0 + b = b) ∧ (∀ b c : nat, c + b = b + c) := -begin - repeat {any_goals {constructor}}, all_goals {intros}, - show c + b = _, { apply add_comm }, - show a + _ = 0 + a, { simp }, - show _ = b, { rw [zero_add] } -end diff --git a/old_tests/tests/lean/run/sigma_match.lean b/old_tests/tests/lean/run/sigma_match.lean deleted file mode 100644 index 31f85efb8c..0000000000 --- a/old_tests/tests/lean/run/sigma_match.lean +++ /dev/null @@ -1,29 +0,0 @@ -open sigma - -constant {l₁ l₂} hom {A : Type l₁} {B : Type l₂} (a : A) (b : B) : Type (max l₁ l₂) - -attribute [reducible] -noncomputable definition arrow_ob (A B : Type) : Type := -Σ (a : A) (b : B), hom a b - -noncomputable definition src1 {A B : Type} (x : arrow_ob A B) : A := -match x with - (sigma.mk a (sigma.mk b h)) := a -end - -noncomputable definition src2 {A B : Type} : arrow_ob A B → A -| (sigma.mk a (sigma.mk b c)) := a - -noncomputable definition src3 {A B : Type} (x : arrow_ob A B) : A := -match x with - (sigma.mk a (sigma.mk b c)) := a -end - -example (A B : Type) (x : arrow_ob A B) : src1 x = src2 x := -rfl - -example (A B : Type) (x : arrow_ob A B) : src1 x = src3 x := -rfl - -example (A B : Type) (x : arrow_ob A B) : src2 x = src3 x := -rfl diff --git a/old_tests/tests/lean/run/simp1.lean b/old_tests/tests/lean/run/simp1.lean deleted file mode 100644 index 29372b2590..0000000000 --- a/old_tests/tests/lean/run/simp1.lean +++ /dev/null @@ -1,10 +0,0 @@ -constants (A : Type.{1}) (f : A → A → A) (x y z : A) (g : A → A) -attribute [simp] -lemma foo : f x y = y := sorry -attribute [simp] -lemma bar : g y = z := sorry - -open tactic - -example : g (f x y) = z := by simp -example : g (f x (f x y)) = z := by simp diff --git a/old_tests/tests/lean/run/simp_arrow.lean b/old_tests/tests/lean/run/simp_arrow.lean deleted file mode 100644 index bf7b8582a6..0000000000 --- a/old_tests/tests/lean/run/simp_arrow.lean +++ /dev/null @@ -1,7 +0,0 @@ -example (p q : Prop) (h₀ : q) : ∀ (h : p ∧ true), q := -begin - simp, intros, - trace_state, - guard_hyp h := p, - exact h₀ -end diff --git a/old_tests/tests/lean/run/simp_at_bug.lean b/old_tests/tests/lean/run/simp_at_bug.lean deleted file mode 100644 index ec2c5c765f..0000000000 --- a/old_tests/tests/lean/run/simp_at_bug.lean +++ /dev/null @@ -1,7 +0,0 @@ -def f (x : nat) := x - -example (a b : nat) (h₁ : a = b) (h₂ : a = 0) : b = f 0 := -begin - simp [h₁] at a h₂, - simp [h₂, f] -end diff --git a/old_tests/tests/lean/run/simp_attr_eqns.lean b/old_tests/tests/lean/run/simp_attr_eqns.lean deleted file mode 100644 index 2696265838..0000000000 --- a/old_tests/tests/lean/run/simp_attr_eqns.lean +++ /dev/null @@ -1,56 +0,0 @@ -open nat tactic - -def g : nat → nat → nat := -λ x y, x * y - -def f : nat → nat -| 0 := 10 -| (succ a) := g (f a) 2 - -lemma ex0 (b a : nat) : b = f a → f (succ (succ a)) = g (g b 2) 2 := -begin - intro h, - simp [f], - guard_target g (g (f a) 2) 2 = g (g b 2) 2, - subst b -end - -attribute [simp] f - -lemma ex1 (b a : nat) : b = f a → f (succ a) = g b 2 := -begin - intro h, - simp, - guard_target g (f a) 2 = g b 2, - subst b -end - -lemma ex2 (b a : nat) : b = f a → f (succ (succ a)) = g (g b 2) 2 := -begin - intro h, - simp, - guard_target g (g (f a) 2) 2 = g (g b 2) 2, - subst b -end - -local attribute [-simp] f - -lemma ex3 (b a : nat) : b = f a → f (succ a) = g b 2 := -begin - intro h, - fail_if_success {simp}, - subst b, - reflexivity -end - -run_cmd mk_simp_attr `mysimp - -attribute [mysimp] f - -lemma ex4 (b a : nat) : b = f a → f (succ a) = g b 2 := -begin - intro h, - simp with mysimp, - guard_target g (f a) 2 = g b 2, - subst b -end diff --git a/old_tests/tests/lean/run/simp_auto_param.lean b/old_tests/tests/lean/run/simp_auto_param.lean deleted file mode 100644 index 8e3bb4b8ee..0000000000 --- a/old_tests/tests/lean/run/simp_auto_param.lean +++ /dev/null @@ -1,7 +0,0 @@ -constant f : nat → nat -axiom fax (x : nat) (h : x > 0 . tactic.assumption) : f x = x - -example (a : nat) (h : a > 0) : f (f a) = a := -begin - simp [fax] -end diff --git a/old_tests/tests/lean/run/simp_beta.lean b/old_tests/tests/lean/run/simp_beta.lean deleted file mode 100644 index 8ce8fb56e8..0000000000 --- a/old_tests/tests/lean/run/simp_beta.lean +++ /dev/null @@ -1,11 +0,0 @@ -example (a b : nat) (h : a = b) : (λ x, x) a = b := -begin - simp, - exact h -end - -example (a b : nat) (h : a = b) : (λ x, x) a = b := -begin - fail_if_success {simp {beta := ff}}, - exact h -end diff --git a/old_tests/tests/lean/run/simp_coe.lean b/old_tests/tests/lean/run/simp_coe.lean deleted file mode 100644 index 0d0a1ca376..0000000000 --- a/old_tests/tests/lean/run/simp_coe.lean +++ /dev/null @@ -1,19 +0,0 @@ -example (p : Prop) (h : p) : tt → p := -begin - simp, assumption -end - -local attribute [semireducible] coe_sort_bool - -example (p : Prop) (h : p) : tt → p := -begin - fail_if_success {simp}, - intro, assumption -end - -local attribute [reducible] coe_sort_bool - -example (p : Prop) (h : p) : tt → p := -begin - simp, assumption -end diff --git a/old_tests/tests/lean/run/simp_constructor.lean b/old_tests/tests/lean/run/simp_constructor.lean deleted file mode 100644 index 281d6ff35c..0000000000 --- a/old_tests/tests/lean/run/simp_constructor.lean +++ /dev/null @@ -1,53 +0,0 @@ -inductive term -| var : string → term -| app : string → list term → term - -example (h : term.var "a" = term.app "f" []) : false := -begin - simp at h, - exact false.elim h -end - -example : ¬ term.var "a" = term.app "f" [] := -by simp - -universes u - -inductive vec (α : Type u) : nat → Type u -| nil : vec 0 -| cons : Π {n}, α → vec n → vec (nat.succ n) - -#check @vec.cons.inj_eq - -example (a b : nat) (h : a == b) : a + 1 = b + 1 := -begin - subst h -end - -mutual inductive Expr, Expr_list -with Expr : Type -| var : string → Expr -| app : string → Expr_list → Expr -with Expr_list : Type -| nil : Expr_list -| cons : Expr → Expr_list → Expr_list - -#check @Expr.app.inj_eq - -example {α : Type u} (n : nat) (a₁ a₂ : α) (t : vec α n) (h : vec.cons a₁ t = vec.cons a₂ t) : a₁ = a₂ := -begin - simp at h, - exact h -end - -example (a₁ a₂ : nat) (h₁ : a₁ > 0) (h₂ : a₂ > 0) (h : a₁ = a₂) : subtype.mk a₁ h₁ = subtype.mk a₂ h₂ := -begin - simp, - exact h -end - -example (a₁ a₂ : nat) (h₁ : a₁ > 0) (h₂ : a₂ > 0) (h : subtype.mk a₁ h₁ = subtype.mk a₂ h₂) : a₁ = a₂ := -begin - simp at h, - exact h -end diff --git a/old_tests/tests/lean/run/simp_dif.lean b/old_tests/tests/lean/run/simp_dif.lean deleted file mode 100644 index f7f9f63580..0000000000 --- a/old_tests/tests/lean/run/simp_dif.lean +++ /dev/null @@ -1,24 +0,0 @@ -constant safe_div (a b : nat) : b ≠ 0 → nat - -example (a b : nat) (h : ¬b ≠ 0) : (if h : b ≠ 0 then safe_div a b h else a) = a := -by simp [dif_neg h] -example (a b : nat) (h : b ≠ 0) : (if h : b ≠ 0 then safe_div a b h else a) = safe_div a b h := -by simp [dif_pos h] -example (a b : nat) (h : ¬b ≠ 0) : (if h : b ≠ 0 then safe_div a b h else a) = a := -by rw [dif_neg h] -example (a b : nat) (h : b ≠ 0) : (if h : b ≠ 0 then safe_div a b h else a) = safe_div a b h := -by rw [dif_pos h] - -example (a b : nat) : (if h : b ≠ 0 then safe_div a b h else a) = a ∨ ∃ h, (if h : b ≠ 0 then safe_div a b h else a) = safe_div a b h := -begin - by_cases (b ≠ 0), - {apply or.inr, rw [dif_pos h], existsi h, refl}, - {apply or.inl, rw [dif_neg h]} -end - -example (a b : nat) : (if h : b ≠ 0 then safe_div a b h else a) = a ∨ ∃ h, (if h : b ≠ 0 then safe_div a b h else a) = safe_div a b h := -begin - by_cases (b ≠ 0), - {apply or.inr, simp [dif_pos h], existsi h, trivial}, - {apply or.inl, simp [dif_neg h]} -end diff --git a/old_tests/tests/lean/run/simp_eqns.lean b/old_tests/tests/lean/run/simp_eqns.lean deleted file mode 100644 index 1ab0bd26ca..0000000000 --- a/old_tests/tests/lean/run/simp_eqns.lean +++ /dev/null @@ -1,21 +0,0 @@ -def f : nat → nat -| 0 := 1 -| (n+1) := f n + 10 - -example (n : nat) : f (n+1) = f n + 10 := -by simp [f] - -example (n : nat) : f 0 = 1 := -by simp [f] - -def g : nat → nat -| 0 := 2 -| (n+1) := - match f n with - | 0 := 0 - | 1 := 3 - | _ := 4 - end - -example (n : nat) : g (0+1) = 3 := -by simp [g, f] diff --git a/old_tests/tests/lean/run/simp_eta.lean b/old_tests/tests/lean/run/simp_eta.lean deleted file mode 100644 index 738376f7fe..0000000000 --- a/old_tests/tests/lean/run/simp_eta.lean +++ /dev/null @@ -1,12 +0,0 @@ -example (f g : nat → nat) (h : f = g) : (λ x, f x) = g := -begin - simp, - guard_target f = g, - exact h -end - -example (f g : nat → nat) (h : f = g) : (λ x, f x) = g := -begin - fail_if_success {simp {eta := ff}}, - exact h -end diff --git a/old_tests/tests/lean/run/simp_if_true_false.lean b/old_tests/tests/lean/run/simp_if_true_false.lean deleted file mode 100644 index fba9dd22bd..0000000000 --- a/old_tests/tests/lean/run/simp_if_true_false.lean +++ /dev/null @@ -1,2 +0,0 @@ -example (m n p : ℕ) : ite (m = m) n p = n := by simp -example (m n p : ℕ) : ite (m ≠ m) n p = p := by simp diff --git a/old_tests/tests/lean/run/simp_inductive_compiler_issue.lean b/old_tests/tests/lean/run/simp_inductive_compiler_issue.lean deleted file mode 100644 index 5e40fc5b26..0000000000 --- a/old_tests/tests/lean/run/simp_inductive_compiler_issue.lean +++ /dev/null @@ -1,8 +0,0 @@ -structure box (α : Type) := -(val : α) - -def f1 (g h : ℕ → ℕ) (b : bool) : ℕ → ℕ := -box.val (bool.cases_on b (box.mk g) (box.mk h)) - -def f2 (g h : box (ℕ → ℕ)) (b : bool) : ℕ → ℕ := -box.val (bool.cases_on b g h) diff --git a/old_tests/tests/lean/run/simp_iota_eqn.lean b/old_tests/tests/lean/run/simp_iota_eqn.lean deleted file mode 100644 index e4accdcac5..0000000000 --- a/old_tests/tests/lean/run/simp_iota_eqn.lean +++ /dev/null @@ -1,29 +0,0 @@ -def f {α : Type} (a : α) : α := -a - -example (a : nat) (h : a = 3) : [1,2].map nat.succ = [2, f a] := -begin - simp!, - guard_target nat.succ 2 = f a, - simp [f, h] -end - -def foo : bool → bool → bool -| tt tt := tt -| ff ff := tt -| _ _ := ff - -example : foo tt tt = f tt := -begin - simp!, - guard_target tt = f tt, - simp [f] -end - -example (b : bool) (h : b = tt) : foo b tt = f tt := -begin - fail_if_success { simp! }, - simp! [h], - guard_target tt = f tt, - simp [f] -end diff --git a/old_tests/tests/lean/run/simp_lemma_issue.lean b/old_tests/tests/lean/run/simp_lemma_issue.lean deleted file mode 100644 index 8ab5da1773..0000000000 --- a/old_tests/tests/lean/run/simp_lemma_issue.lean +++ /dev/null @@ -1,16 +0,0 @@ -universe variables u - -def ex {α : Type u} [comm_semiring α] (a : α) : 0 + a = a := -zero_add a - -local attribute [-simp] zero_add add_zero -attribute [simp] ex - -example (a b : nat) : 0 + 0 + a = a := -by simp - -local attribute [-ematch] zero_add add_zero -attribute [ematch] ex - -example (a b : nat) : 0 + 0 + a = a := -by using_smt $ smt_tactic.eblast diff --git a/old_tests/tests/lean/run/simp_lemmas_with_mvars.lean b/old_tests/tests/lean/run/simp_lemmas_with_mvars.lean deleted file mode 100644 index b60d75b33e..0000000000 --- a/old_tests/tests/lean/run/simp_lemmas_with_mvars.lean +++ /dev/null @@ -1,31 +0,0 @@ -lemma {u} if_pos' {c : Prop} [h : decidable c] (hc : c) {α : Sort u} (t e : α) : (ite c t e) = t := -if_pos hc - -example (a b : nat) (h : a = b) : (if a = b then 0 else 1) = cond (if a = b then tt else ff) 0 1 := -begin - simp only [if_pos' h, cond], -end - -example (a b : nat) (h : a = b) : (if a = b then 0 else 1) = cond (if a = b then tt else ff) 0 1 := -begin - simp only [if_pos h, cond], -end - -example (a b c : nat) : a + b + c = b + a + c := -begin - simp only [add_comm _ b] -end - -example (a b c : nat) (h : c = 0) : a + b + 0 = b + a + c := -begin - simp only [add_comm _ b], - guard_target b + a + 0 = b + a + c, - rw h -end - -example (a b c : nat) (h : c = 0) : 0 + (a + b) = b + a + c := -begin - simp only [add_comm _ c, add_comm a _], - guard_target 0 + (b + a) = c + (b + a), - rw h -end diff --git a/old_tests/tests/lean/run/simp_match_reducibility_issue.lean b/old_tests/tests/lean/run/simp_match_reducibility_issue.lean deleted file mode 100644 index 32c67e8f52..0000000000 --- a/old_tests/tests/lean/run/simp_match_reducibility_issue.lean +++ /dev/null @@ -1,14 +0,0 @@ -import data.vector namespace test -universes u v - -section - open vector - variable α : Type u - variables m n k : ℕ - variable v : vector α m - variable w : vector α n - - theorem append_nil : append v nil = v := - by cases v; simp [vector.append, vector.nil]; reflexivity -end -end test diff --git a/old_tests/tests/lean/run/simp_norm.lean b/old_tests/tests/lean/run/simp_norm.lean deleted file mode 100644 index 7cc5d4e212..0000000000 --- a/old_tests/tests/lean/run/simp_norm.lean +++ /dev/null @@ -1,11 +0,0 @@ -universes u v - -axiom map_bind_lemma : ∀ {α β : Type u} {m : Type u → Type v} [monad m] (f : α → β) (x : m α), f <$> x = x >>= pure ∘ f -attribute [norm] function.comp map_bind_lemma - -example : nat.succ <$> [1, 2] = [2, 3] := -begin - simp with norm, - guard_target [1, 2] >>= (λ x, pure (nat.succ x)) = [2, 3], - simp [has_bind.bind, pure, has_pure.pure, list.ret] -end diff --git a/old_tests/tests/lean/run/simp_options.lean b/old_tests/tests/lean/run/simp_options.lean deleted file mode 100644 index dec3fbadd4..0000000000 --- a/old_tests/tests/lean/run/simp_options.lean +++ /dev/null @@ -1,57 +0,0 @@ -lemma simp_rule : - forall (A B C : Type) - (xs : list A) - (f: A → B) - (g: B → C), (list.map g $ (list.map f) xs) = list.map (g ∘ f) xs := -begin - intros, - induction xs, - simp [list.map], - simp [list.map], -end - -lemma simp_wildcard : -forall (A B C : Type) -(a b : list A) -(a' b' : list C) -(f : A → B) -(g h : B → C), -(list.map g $ list.map f a) = a' -> -(list.map h $ list.map f b) = b' -> -a' = list.map (g ∘ f) a ∧ b' = list.map (h ∘ f) b := -begin - intros A B C a b a' b' f g h a₁ a₂, - simp [simp_rule] at *, - rw [a₁, a₂], - split; reflexivity -end - -run_cmd mk_simp_attr `foo -run_cmd mk_simp_attr `bar - -constants (f : ℕ → ℕ) (a b c : ℕ) (fab : f a = f b) (fbc : f b = f c) -constants (p : ℕ → Prop) (pfa : p (f a)) (pfb : p (f b)) (pfc :p (f c)) - -attribute [simp, foo] fbc - -example : p (f a) := -by simp [fab]; exact pfc - -example : p (f a) := -by simp only [fab]; exact pfb - -example : p (f a) := -by simp only [fab] with foo bar; exact pfc - -example (h : p (f a)) : p (f c) := -by simp [fab] at h; assumption - -example (h : p (f a)) : p (f b) := -by simp only [fab] at h; assumption - -example (h₁ : p (f a)) (h₂ : p (f a)) : p (f a) := -begin - simp only [fab] at h₁ ⊢, - tactic.fail_if_success `[exact h₂], - exact h₁ -end diff --git a/old_tests/tests/lean/run/simp_partial_app.lean b/old_tests/tests/lean/run/simp_partial_app.lean deleted file mode 100644 index a478a3e071..0000000000 --- a/old_tests/tests/lean/run/simp_partial_app.lean +++ /dev/null @@ -1,17 +0,0 @@ -open tactic - -example (a : list nat) : a = [1, 2] → a^.map nat.succ = [2, 3] := -begin - intros, - guard_target list.map nat.succ a = [2, 3], - subst a, - simp [list.map] -end - -constant f {α : Type} [has_zero α] (a b : α) : a ≠ 0 → b ≠ 0 → α -axiom fax {α : Type} [has_zero α] (a : α) : f a = λ b h₁ h₂, a - -lemma ex : f 1 2 dec_trivial dec_trivial = 1 := -begin - simp [fax] -end diff --git a/old_tests/tests/lean/run/simp_proj.lean b/old_tests/tests/lean/run/simp_proj.lean deleted file mode 100644 index 1efe50b5c3..0000000000 --- a/old_tests/tests/lean/run/simp_proj.lean +++ /dev/null @@ -1,66 +0,0 @@ -def f (a : nat) := (a, 0) - -example (a b : nat) (h : a = b) : (f a).1 = b := -begin - simp [f], - guard_target a = b, - exact h -end - -example (a b : nat) (h : a = b) : (f a).1 = b := -begin - simp [f] {proj := ff}, - guard_target (a, 0)^.1 = b, - exact h -end - -def g (a : nat) := (λ x, x) a - -example (a b : nat) (h : a = b) : g a = b := -begin - simp [g], - guard_target a = b, - exact h -end - -example (a b : nat) (h : a = b) : g a = b := -begin - simp [g] {beta := ff}, - guard_target (λ x, x) a = b, - exact h -end - -example (a b : nat) : a + b = b + a := -begin - simp only [has_add.add], - guard_target nat.add a b = nat.add b a, - apply nat.add_comm -end - -example (a b : nat) : a + b = b + a := -begin - unfold has_add.add, - guard_target nat.add a b = nat.add b a, - apply nat.add_comm -end - -example (a b : nat) : a + b = b + a := -begin - simp only [*, has_add.add] at *, - guard_target nat.add a b = nat.add b a, - apply nat.add_comm -end - -example (a b : nat) : a + b = b + a := -begin - simp only [*, has_add.add], - guard_target nat.add a b = nat.add b a, - apply nat.add_comm -end - -example (a b : nat) : a + b = b + a := -begin - conv { simp only [has_add.add] }, - guard_target nat.add a b = nat.add b a, - apply nat.add_comm -end diff --git a/old_tests/tests/lean/run/simp_proof_failure.lean b/old_tests/tests/lean/run/simp_proof_failure.lean deleted file mode 100644 index 11bf1b66d3..0000000000 --- a/old_tests/tests/lean/run/simp_proof_failure.lean +++ /dev/null @@ -1,8 +0,0 @@ -def α : Type := ℕ → ℕ - -set_option trace.app_builder true -example (x y : α) (H : x = y) (n : ℕ) : x n = y n := -by simp [H] - -example (x y : α) (H₁ : x = y) (m n : ℕ) (H₂ : m = n) : x m = y n := -by simp [H₁, H₂] diff --git a/old_tests/tests/lean/run/simp_refl_lemma_perf_issue.lean b/old_tests/tests/lean/run/simp_refl_lemma_perf_issue.lean deleted file mode 100644 index 93daf4a335..0000000000 --- a/old_tests/tests/lean/run/simp_refl_lemma_perf_issue.lean +++ /dev/null @@ -1,15 +0,0 @@ -def foo (a : nat) (b : nat) := b -def g (a : nat) := foo (1000000000000 + 1) a -def f (a : nat) := foo (1 + 1000000000000) a - -lemma foo_lemma (a b : nat) : foo b a = foo (1 + 1000000000000) a := -rfl - -lemma f_fold_lemma (a : nat) : foo (1 + 1000000000000) a = f a := -rfl - -lemma ex (a : nat) (p : nat → Prop) (h : p (f a)) : p (g a) := -begin - simp only [g, foo_lemma, f_fold_lemma], - exact h, -end diff --git a/old_tests/tests/lean/run/simp_rfl_proof_issue.lean b/old_tests/tests/lean/run/simp_rfl_proof_issue.lean deleted file mode 100644 index 0b283611d1..0000000000 --- a/old_tests/tests/lean/run/simp_rfl_proof_issue.lean +++ /dev/null @@ -1,16 +0,0 @@ -@[irreducible] def f : nat → nat -| 0 := 1 -| (n+1) := 2 * f n - -lemma ex1 (n : nat) : f (n+1) = 2 * f n := -begin - fail_if_success {refl}, - simp only [f] -end - -lemma ex2 (n : nat) (h : f (n+1) = 0) : 2 * f n = 0 := -begin - fail_if_success {exact h}, - simp only [f] at h, - exact h -end diff --git a/old_tests/tests/lean/run/simp_single_pass.lean b/old_tests/tests/lean/run/simp_single_pass.lean deleted file mode 100644 index 7566ca893f..0000000000 --- a/old_tests/tests/lean/run/simp_single_pass.lean +++ /dev/null @@ -1,14 +0,0 @@ -open nat well_founded - -def gcd' : ℕ → ℕ → ℕ | y := λ x, -if h : y = 0 then - x -else - have x % y < y, by { apply mod_lt, cases y, contradiction, apply succ_pos }, - gcd' (x % y) y - -lemma gcd'_zero_right (x : nat) : gcd' 0 x = x := -begin - simp [gcd'] {single_pass := tt}, - simp -end diff --git a/old_tests/tests/lean/run/simp_subgoals.lean b/old_tests/tests/lean/run/simp_subgoals.lean deleted file mode 100644 index 5770461efa..0000000000 --- a/old_tests/tests/lean/run/simp_subgoals.lean +++ /dev/null @@ -1,22 +0,0 @@ -axiom DivS (x : nat) : x ≠ 0 → x / x = 1 - -open tactic - -example (x : nat) (h : x ≠ 0) : x / x = 1 := -begin - simp[DivS, h] -end - -example (x : nat) (h : x ≠ 0) : x / x = 1 := -begin - fail_if_success {simp [DivS]}, - simp [DivS] {discharger := assumption} -end - -constant f : nat → nat → nat -axiom flemma : ∀ a b, b ≠ 0 → a ≠ 0 → f a b = 0 - -example (x : nat) (h : x ≠ 0) : f 1 x = 0 := -begin - simp [flemma] {discharger := trace "subgoal" >> trace_state >> (assumption <|> comp_val)} -end diff --git a/old_tests/tests/lean/run/simp_univ_metavars.lean b/old_tests/tests/lean/run/simp_univ_metavars.lean deleted file mode 100644 index 278f993344..0000000000 --- a/old_tests/tests/lean/run/simp_univ_metavars.lean +++ /dev/null @@ -1,78 +0,0 @@ -meta def blast : tactic unit := using_smt $ return () - -structure { u v } Category := - (Obj : Type u ) - (Hom : Obj -> Obj -> Type v) - (identity : Π X : Obj, Hom X X) - (compose : Π ⦃X Y Z : Obj⦄, Hom X Y → Hom Y Z → Hom X Z) - (left_identity : ∀ ⦃X Y : Obj⦄ (f : Hom X Y), compose (identity _) f = f) - -#check @Category.mk.inj_eq - -structure Functor (C : Category) (D : Category) := - (onObjects : C^.Obj → D^.Obj) - (onMorphisms : Π ⦃X Y : C^.Obj⦄, - C^.Hom X Y → D^.Hom (onObjects X) (onObjects Y)) - -structure NaturalTransformation { C D : Category } ( F G : Functor C D ) := - (components: Π X : C^.Obj, D^.Hom (F^.onObjects X) (G^.onObjects X)) - -definition IdentityNaturalTransformation { C D : Category } (F : Functor C D) : NaturalTransformation F F := - { - components := λ X, D^.identity (F^.onObjects X) - } - -definition vertical_composition_of_NaturalTransformations - { C D : Category } - { F G H : Functor C D } - ( α : NaturalTransformation F G ) - ( β : NaturalTransformation G H ) : NaturalTransformation F H := - { - components := λ X, D^.compose (α^.components X) (β^.components X) - } - --- We'll want to be able to prove that two natural transformations are equal if they are componentwise equal. -lemma NaturalTransformations_componentwise_equal - { C D : Category } - { F G : Functor C D } - ( α β : NaturalTransformation F G ) - ( w : ∀ X : C^.Obj, α^.components X = β^.components X ) : α = β := - begin - induction α with αc, - induction β with βc, - have hc : αc = βc := funext w, - subst hc - end - -@[simp] -lemma vertical_composition_of_NaturalTransformations_components - { C D : Category } - { F G H : Functor C D } - { α : NaturalTransformation F G } - { β : NaturalTransformation G H } - { X : C^.Obj } : - (vertical_composition_of_NaturalTransformations α β)^.components X = D^.compose (α^.components X) (β^.components X) := -by blast - -@[simp] -lemma IdentityNaturalTransformation_components - { C D : Category } - { F : Functor C D } - { X : C^.Obj } : - (IdentityNaturalTransformation F)^.components X = D^.identity (F^.onObjects X) := -by blast - -definition FunctorCategory ( C D : Category ) : Category := -{ - Obj := Functor C D, - Hom := λ F G, NaturalTransformation F G, - identity := λ F, IdentityNaturalTransformation F, - compose := @vertical_composition_of_NaturalTransformations C D, - - left_identity := begin - intros F G f, - apply NaturalTransformations_componentwise_equal, - intros, - simp [ D^.left_identity ] - end -} diff --git a/old_tests/tests/lean/run/simp_univ_poly.lean b/old_tests/tests/lean/run/simp_univ_poly.lean deleted file mode 100644 index 1daf5325ed..0000000000 --- a/old_tests/tests/lean/run/simp_univ_poly.lean +++ /dev/null @@ -1,25 +0,0 @@ -namespace test -universes u v - -def equinumerous (α : Type u) (β : Type v) := -∃ f : α → β, function.bijective f - -local infix ` ≈ ` := equinumerous - -@[refl] lemma refl {α} : α ≈ α := sorry -@[trans] lemma trans {α β γ} : - α ≈ β → β ≈ γ → α ≈ γ := sorry - -@[congr] lemma equinumerous.congr_eqn {α α' β β'} : - α ≈ α' → β ≈ β' → (α ≈ β) = (α' ≈ β') := sorry - -@[congr] lemma congr_sum {α α' β β'} : - α ≈ α' → β ≈ β' → (α ⊕ β) ≈ (α' ⊕ β') := sorry - -@[simp] lemma eqn_ulift {α} : ulift α ≈ α := sorry - -@[simp] lemma sum_empty {α} : (α ⊕ empty) ≈ α := sorry - --- rewriting `ulift empty` ==> `empty` changes the universe level -example {α : Type u} : (α ⊕ ulift empty) ≈ α := by simp -end test diff --git a/old_tests/tests/lean/run/simp_zeta.lean b/old_tests/tests/lean/run/simp_zeta.lean deleted file mode 100644 index e3ebedb8db..0000000000 --- a/old_tests/tests/lean/run/simp_zeta.lean +++ /dev/null @@ -1,12 +0,0 @@ -example (n : ℕ) : let m := 0 + n in m = n := -begin -intro, -dsimp [m], -simp, -end - -example (n : ℕ) : let m := 0 + n in m = n := -begin -intro, -simp *, -end \ No newline at end of file diff --git a/old_tests/tests/lean/run/simple.lean b/old_tests/tests/lean/run/simple.lean deleted file mode 100644 index 3c6233398a..0000000000 --- a/old_tests/tests/lean/run/simple.lean +++ /dev/null @@ -1,25 +0,0 @@ -prelude -definition Prop : Sort.{1} := Sort.{0} -section - parameter A : Sort* - - definition Eq (a b : A) : Prop - := ∀P : A → Prop, P a → P b - @[elab_simple] - theorem subst (P : A → Prop) (a b : A) (H1 : Eq a b) (H2 : P a) : P b - := H1 P H2 - - theorem refl (a : A) : Eq a a - := λ (P : A → Prop) (H : P a), H - - theorem symm (a b : A) (H : Eq a b) : Eq b a - := subst (λ x : A, Eq x a) a b H (refl a) - - theorem trans (a b c : A) (H1 : Eq a b) (H2 : Eq b c) : Eq a c - := subst (λ x : A, Eq a x) b c H2 H1 -end - -#check subst.{1} -#check refl.{1} -#check symm.{1} -#check trans.{1} diff --git a/old_tests/tests/lean/run/simplifier_custom_relations.lean b/old_tests/tests/lean/run/simplifier_custom_relations.lean deleted file mode 100644 index f87307442b..0000000000 --- a/old_tests/tests/lean/run/simplifier_custom_relations.lean +++ /dev/null @@ -1,34 +0,0 @@ -open tactic - - -constants (A : Type) (rel : A → A → Prop) - (rel.refl : ∀ a, rel a a) - (rel.symm : ∀ a b, rel a b → rel b a) - (rel.trans : ∀ a b c, rel a b → rel b c → rel a c) - -attribute [refl] rel.refl -attribute [symm] rel.symm -attribute [trans] rel.trans - -constants (x y z : A) (f g h : A → A) - (H₁ : rel (f x) (g y)) - (H₂ : rel (h (g y)) z) - (Hf : ∀ (a b : A), rel a b → rel (f a) (f b)) - (Hg : ∀ (a b : A), rel a b → rel (g a) (g b)) - (Hh : ∀ (a b : A), rel a b → rel (h a) (h b)) - -attribute [simp] H₁ H₂ -attribute [congr] Hf Hg Hh - -#print [simp] default -#print [congr] default - -meta definition relsimp_core (e : expr) : tactic (expr × expr) := -do S ← simp_lemmas.mk_default, - e_type ← infer_type e >>= whnf, - simplify S [] e {} `rel - -example : rel (h (f x)) z := -by do e₁ ← to_expr ```(h (f x)), - (e₁', pf) ← relsimp_core e₁, - exact pf diff --git a/old_tests/tests/lean/run/simulate_on.lean b/old_tests/tests/lean/run/simulate_on.lean deleted file mode 100644 index 30af9b067d..0000000000 --- a/old_tests/tests/lean/run/simulate_on.lean +++ /dev/null @@ -1,7 +0,0 @@ -example (a b c : nat) : a = 0 → b = 1 → c = 0 → b + a + c = b := -begin - intros, - repeat {subst ‹_ = 0›}, -- substitute all equalities of the form `_ = 0` - guard_target b + 0 + 0 = b, - reflexivity -end diff --git a/old_tests/tests/lean/run/size_of1.lean b/old_tests/tests/lean/run/size_of1.lean deleted file mode 100644 index 454e12d6c0..0000000000 --- a/old_tests/tests/lean/run/size_of1.lean +++ /dev/null @@ -1,10 +0,0 @@ -open tactic - -example : sizeof [tt, tt] < sizeof [tt, ff, tt] := -dec_trivial - -example : sizeof [tt, tt] = sizeof [ff, ff] := -dec_trivial - -example : sizeof (3:nat) < sizeof ([3] : list nat) := -dec_trivial diff --git a/old_tests/tests/lean/run/sizeof2.lean b/old_tests/tests/lean/run/sizeof2.lean deleted file mode 100644 index d5e9ee4021..0000000000 --- a/old_tests/tests/lean/run/sizeof2.lean +++ /dev/null @@ -1,28 +0,0 @@ -open tactic - -example : sizeof (λ a : nat, a) = 0 := -rfl - -example : sizeof Type = 0 := -rfl - -example : sizeof Prop = 0 := -rfl - -example (p : Prop) (H : p) : sizeof H = 0 := -rfl - -example (A : Type) (a b : A) : sizeof [a, b] = 3 := -rfl - -example : sizeof [(1:nat), 4] = 8 := -rfl - -example : sizeof [tt, ff, tt] = 7 := -rfl - -set_option pp.implicit true - -#check sizeof Prop -#check sizeof [tt, ff, tt] -#check λ (A : Type) (a b : A), sizeof [a, b] diff --git a/old_tests/tests/lean/run/slack_eqn_issue.lean b/old_tests/tests/lean/run/slack_eqn_issue.lean deleted file mode 100644 index 6e06f9a6e0..0000000000 --- a/old_tests/tests/lean/run/slack_eqn_issue.lean +++ /dev/null @@ -1,14 +0,0 @@ -lemma test1 {p : ℕ → Prop} {a : ℕ} (h : p a) : ∀b, b = a → p b -| ._ rfl := h - -lemma test2 {p : ℕ → Prop} {a : ℕ} (h : p a) : ∀b, b = a → p a -| ._ rfl := h - -lemma test3 {p : ℕ → Prop} {a : ℕ} (h : p a) : ∀b, a = b → p b -| ._ rfl := h - -lemma test4 {p : ℕ → Prop} {a : ℕ} {f : ℕ → ℕ} (h : p (f a)) : ∀b, b = f a → p b -| ._ rfl := h - -lemma test5 {p : ℕ → Prop} {a : ℕ} {f : ℕ → ℕ} (h : p (f a)) : ∀b, f a = b → p b -| ._ rfl := h diff --git a/old_tests/tests/lean/run/smt_array.lean b/old_tests/tests/lean/run/smt_array.lean deleted file mode 100644 index 209c0a7b42..0000000000 --- a/old_tests/tests/lean/run/smt_array.lean +++ /dev/null @@ -1,21 +0,0 @@ -namespace ex -constant array : Type -constant read : array → nat → nat -constant write : array → nat → nat → array -axiom rw1 : ∀ a i v, read (: write a i v :) i = v -axiom rw2 : ∀ a i j v, i = j ∨ (: read (write a i v) j :) = read a j - -attribute [ematch] rw1 rw2 - -lemma ex3 (a1 a2 a3 a4 a5 : array) (v : nat) : -a2 = write a1 0 v → -a3 = write a2 1 v → -a4 = write a3 2 v → -a5 = write a4 3 v → -read a5 4 = read a1 4 -:= -begin [smt] - intros, eblast -end - -end ex diff --git a/old_tests/tests/lean/run/smt_assert_define.lean b/old_tests/tests/lean/run/smt_assert_define.lean deleted file mode 100644 index f24446b574..0000000000 --- a/old_tests/tests/lean/run/smt_assert_define.lean +++ /dev/null @@ -1,40 +0,0 @@ -open smt_tactic - -constant p : nat → nat → Prop -constant f : nat → nat -axiom pf (a : nat) : p (f a) (f a) → p a a - -lemma ex1 (a b c : nat) : a = b + 0 → a + c = b + c := -by using_smt $ do - pr ← tactic.to_expr ```(add_zero b), - note `h none pr, - trace_state, return () - -lemma ex2(a b c : nat) : a = b → p (f a) (f b) → p a b := -by using_smt $ do - intros, - t ← tactic.to_expr ```(p (f a) (f a)), - assert `h t, -- assert automatically closed the new goal - trace_state, - tactic.trace "-----", - pr ← tactic.to_expr ```(pf _ h), - note `h2 none pr, - trace_state, - return () - -def foo := 0 -lemma fooex : foo = 0 := rfl - -lemma ex3 (a b c : nat) : a = b + foo → a + c = b + c := -begin [smt] - intros, - add_fact fooex, - ematch -end - -lemma ex4 (a b c : nat) : a = b → p (f a) (f b) → p a b := -begin [smt] - intros, - have h : p (f a) (f a), - add_fact (pf _ h) -end diff --git a/old_tests/tests/lean/run/smt_destruct.lean b/old_tests/tests/lean/run/smt_destruct.lean deleted file mode 100644 index 993ebfcdf6..0000000000 --- a/old_tests/tests/lean/run/smt_destruct.lean +++ /dev/null @@ -1,56 +0,0 @@ -open smt_tactic - -lemma ex1 (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → ¬p ∨ ¬q → false := -by using_smt $ do - intros, - trace_state, - a_1 ← tactic.get_local `a_1, - destruct a_1, - iterate close - -lemma ex2 (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → ¬p ∨ ¬q → false := -begin [smt] - intros, - have h : p ∨ q, - destruct h -end - -lemma ex3 (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → ¬p ∨ ¬q → false := -begin [smt] - intros, - destruct a_1 -- bad style, it relies on automatically generated names -end - -lemma ex4 (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → ¬p ∨ ¬q → false := -begin [smt] -- the default configuration is classical - intros, - by_cases p -end - -lemma ex5 (p q : Prop) [decidable p] : p ∨ q → p ∨ ¬q → ¬p ∨ q → ¬p ∨ ¬q → false := -begin [smt] with {smt_config .}^.set_classical ff, - intros, - by_cases p -- will fail if p is not decidable -end - -lemma ex6 (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → p ∧ q := -begin [smt] -- the default configuration is classical - intros, - by_contradiction, - trace_state, - by_cases p, -end - -lemma ex7 (p q : Prop) [decidable p] : p ∨ q → p ∨ ¬q → ¬p ∨ q → p ∧ q := -begin [smt] with {smt_config .}^.set_classical ff, - intros, - by_cases p -- will fail if p is not decidable -end - -lemma ex8 (p q : Prop) [decidable p] [decidable q] : p ∨ q → p ∨ ¬q → ¬p ∨ q → p ∧ q := -begin [smt] with {smt_config .}^.set_classical ff, - intros, - by_contradiction, -- will fail if p or q is not decidable - trace_state, - by_cases p -- will fail if p is not decidable -end diff --git a/old_tests/tests/lean/run/smt_ematch1.lean b/old_tests/tests/lean/run/smt_ematch1.lean deleted file mode 100644 index 7046a0d2fa..0000000000 --- a/old_tests/tests/lean/run/smt_ematch1.lean +++ /dev/null @@ -1,77 +0,0 @@ -constant f : nat → nat -axiom fax : ∀ x, f x = x - -attribute [ematch] fax - -lemma ex1 (a b c : nat) : f a = b → b = f c → a = c := -begin [smt] - intros, - trace_state, - ematch -end - -constant g : nat → nat → nat -axiom gax : ∀ x, g x x = x - -lemma ex2 (a b c d e : nat) : d = a → c = e → g a d = b → b = g e c → f a = c := -begin [smt] - intros, - add_lemma gax, - ematch -end - -lemma ex3 (a b c d e : nat) : d = a → c = e → g a d = b → b = g e c → f a = c := -begin [smt] - intros, - ematch_using [fax, gax] -end - -local attribute [-ematch] fax - -lemma ex4 (a b c d e : nat) : d = a → c = e → g a d = b → b = g e c → f a = c := -begin [smt] - intros, - add_lemma [fax, gax], - ematch -end - -lemma ex5 (a b c d e : nat) : d = a → c = e → g a d = b → b = g e c → f a = c := -begin [smt] - intros, - ematch_using [fax, gax] -end - -lemma ex6 (a b c d e : nat) : (∀ x, g x (f x) = 0) → a = f b → g b a + 0 = f 0 := -begin [smt] - intros, - have h : ∀ x, g x (f x) = 0, - add_lemma [h, fax, add_zero], - ematch -end - -lemma ex7 (a b c d e : nat) : (∀ x, g x (f x) = 0) → a = f b → g b a + 0 = f 0 := -begin [smt] - intros, - have h : ∀ x, g x (f x) = 0, - ematch_using [h, fax, add_zero] -end - -local attribute [ematch] fax add_zero - -open smt_tactic - -lemma ex8 (a b c d e : nat) : (∀ x, g x (f x) = 0) → a = f b → g b a + 0 = f 0 := -begin [smt] - intros, - add_lemmas_from_facts, - ematch -end - -lemma ex9 (a b c d e : nat) : d ≠ e → (∀ x, g x (f x) = 0) → a = f b → g b a + 0 = f 0 := -begin [smt] - intros, - get_facts >>= trace, - get_refuted_facts >>= trace, - add_lemmas_from_facts, - ematch -end diff --git a/old_tests/tests/lean/run/smt_ematch2.lean b/old_tests/tests/lean/run/smt_ematch2.lean deleted file mode 100644 index a1e2de83cb..0000000000 --- a/old_tests/tests/lean/run/smt_ematch2.lean +++ /dev/null @@ -1,109 +0,0 @@ -universe variables u -namespace foo -variables {α : Type u} - -open smt_tactic -meta def no_ac : smt_config := -{ cc_cfg := { ac := ff }} - -meta def blast : tactic unit := -using_smt_with no_ac $ intros >> iterate (ematch >> try close) - -section add_comm_monoid -variables [add_comm_monoid α] -attribute [ematch] add_comm add_assoc - -theorem add_comm_three (a b c : α) : a + b + c = c + b + a := -by blast - -theorem add.comm4 : ∀ (n m k l : α), n + m + (k + l) = n + k + (m + l) := -by blast -end add_comm_monoid - - -section group -variable [group α] -attribute [ematch] mul_assoc mul_left_inv one_mul - -theorem inv_mul_cancel_left (a b : α) : a⁻¹ * (a * b) = b := -by blast -end group - - -namespace subt -constant subt : nat → nat → Prop -axiom subt_trans {a b c : nat} : subt a b → subt b c → subt a c -attribute [ematch] subt_trans - -lemma ex (a b c d : nat) : subt a b → subt b c → subt c d → subt a d := -by blast -end subt - - -section ring -variables [ring α] (a b : α) -attribute [ematch] zero_mul -lemma ex2 : a = 0 → a * b = 0 := -by blast - -definition ex1 (a b : int) : a = 0 → a * b = 0 := -by blast -end ring - - -namespace cast1 -constant C : nat → Type -constant f : ∀ n, C n → C n -axiom fax (n : nat) (a : C (2*n)) : (: f (2*n) a :) = a -attribute [ematch] fax - -lemma ex3 (n m : nat) (a : C n) : n = 2*m → f n a = a := -by blast -end cast1 - - -namespace cast2 -constant C : nat → Type -constant f : ∀ n, C n → C n -constant g : ∀ n, C n → C n → C n -axiom gffax (n : nat) (a b : C n) : (: g n (f n a) (f n b) :) = a -attribute [ematch] gffax - -lemma ex4 (n m : nat) (a c : C n) (b : C m) : n = m → a == f m b → g n a (f n c) == b := -by blast -end cast2 - - -namespace cast3 -constant C : nat → Type -constant f : ∀ n, C n → C n -constant g : ∀ n, C n → C n → C n -axiom gffax (n : nat) (a b : C n) : (: g n a b :) = a -attribute [ematch] gffax - -lemma ex5 (n m : nat) (a c : C n) (b : C m) (e : m = n) : a == b → g n a a == b := -by blast -end cast3 - -namespace tuple -constant {α} tuple: Type α → nat → Type α -constant nil {α : Type u} : tuple α 0 -constant append {α : Type u} {n m : nat} : tuple α n → tuple α m → tuple α (n + m) -infix ` ++ ` := append -axiom append_assoc {α : Type u} {n₁ n₂ n₃ : nat} (v₁ : tuple α n₁) (v₂ : tuple α n₂) (v₃ : tuple α n₃) : - (v₁ ++ v₂) ++ v₃ == v₁ ++ (v₂ ++ v₃) -attribute [ematch] append_assoc - -variables {p m n q : nat} -variables {xs : tuple α m} -variables {ys : tuple α n} -variables {zs : tuple α p} -variables {ws : tuple α q} -lemma ex6 : p = m + n → zs == xs ++ ys → zs ++ ws == xs ++ (ys ++ ws) := -by blast - -def ex : p = n + m → zs == xs ++ ys → zs ++ ws == xs ++ (ys ++ ws) := -by blast -end tuple - -end foo diff --git a/old_tests/tests/lean/run/smt_ematch3.lean b/old_tests/tests/lean/run/smt_ematch3.lean deleted file mode 100644 index 3a15b3733e..0000000000 --- a/old_tests/tests/lean/run/smt_ematch3.lean +++ /dev/null @@ -1,47 +0,0 @@ -namespace Ex -open nat -notation `⟦`:max a `⟧`:0 := cast (by simp) a - -inductive vector (α : Type) : nat → Type -| nil {} : vector 0 -| cons : Π {n}, α → vector n → vector (succ n) - -namespace vector -local attribute [simp] add_succ succ_add add_comm - -variable {α : Type} - -def app : Π {n m : nat}, vector α n → vector α m → vector α (n + m) -| 0 m nil w := ⟦ w ⟧ -| (succ n) m (cons a v) w := ⟦ cons a (app v w) ⟧ - -lemma app_nil_right {n : nat} (v : vector α n) : app v nil == v := -begin induction v, reflexivity, {[smt] ematch_using [app, add_comm, zero_add, add_zero] }, end - -def smt_cfg : smt_config := -{ cc_cfg := {ac := ff}} - -lemma app_assoc {n₁ n₂ n₃ : nat} (v₁ : vector α n₁) (v₂ : vector α n₂) (v₃ : vector α n₃) : - app v₁ (app v₂ v₃) == app (app v₁ v₂) v₃ := -begin - intros, - induction v₁, - {[smt] ematch_using [app, zero_add] }, - {[smt] with smt_cfg, iterate { ematch_using [app, add_succ, succ_add, add_comm, add_assoc] }} -end - -def rev : Π {n : nat}, vector α n → vector α n -| 0 nil := nil -| (n+1) (cons x xs) := app (rev xs) (cons x nil) - -lemma rev_app : ∀ {n₁ n₂ : nat} (v₁ : vector α n₁) (v₂ : vector α n₂), - rev (app v₁ v₂) == app (rev v₂) (rev v₁) := -begin - intros, - induction v₁, - {[smt] iterate {ematch_using [app, rev, zero_add, add_zero, add_comm, app_nil_right]}}, - {[smt] iterate {ematch_using [app, rev, zero_add, add_zero, add_comm, app_assoc, add_one]} } -end - -end vector -end Ex diff --git a/old_tests/tests/lean/run/smt_ematch_alg_issue.lean b/old_tests/tests/lean/run/smt_ematch_alg_issue.lean deleted file mode 100644 index e549ca7c4d..0000000000 --- a/old_tests/tests/lean/run/smt_ematch_alg_issue.lean +++ /dev/null @@ -1,11 +0,0 @@ -lemma {u} ring_add_comm {α : Type u} [ring α] : ∀ (a b : α), (: a + b :) = b + a := -add_comm - -open smt_tactic -meta def no_ac : smt_config := -{ cc_cfg := { ac := ff }} - -lemma ex {α : Type} [field α] (a b : α) : a + b = b + a := -begin [smt] with no_ac, - ematch_using [ring_add_comm] -end diff --git a/old_tests/tests/lean/run/smt_facts_as_hinst_lemmas.lean b/old_tests/tests/lean/run/smt_facts_as_hinst_lemmas.lean deleted file mode 100644 index 012fa7f8ec..0000000000 --- a/old_tests/tests/lean/run/smt_facts_as_hinst_lemmas.lean +++ /dev/null @@ -1,9 +0,0 @@ -lemma aux : nat.succ 0 = 1 := -rfl - -attribute [ematch] aux - -lemma ex (a : nat) : a = 1 → nat.succ 0 = a := -begin [smt] - close -end diff --git a/old_tests/tests/lean/run/smt_not_exists.lean b/old_tests/tests/lean/run/smt_not_exists.lean deleted file mode 100644 index dadc141dae..0000000000 --- a/old_tests/tests/lean/run/smt_not_exists.lean +++ /dev/null @@ -1,19 +0,0 @@ -universe variables u - -def ex (p q : nat → nat → Prop) (h : ∃ x, p x x ∧ q x x) : ∃ x y, p x y := -begin [smt] - by_contra, - destruct h, - smt_tactic.add_lemmas_from_facts, - ematch -end - -#print ex - -lemma ex2 (p q : nat → nat → Prop) (h : ∃ x, p x x ∧ q x x) : ∃ x, p x x := -begin [smt] - by_contra, - destruct h, - smt_tactic.add_lemmas_from_facts, - ematch -end diff --git a/old_tests/tests/lean/run/smt_rsimp.lean b/old_tests/tests/lean/run/smt_rsimp.lean deleted file mode 100644 index 09d4f39c58..0000000000 --- a/old_tests/tests/lean/run/smt_rsimp.lean +++ /dev/null @@ -1,13 +0,0 @@ -constant p {α} : α → α → Prop -axiom pax {α} : ∀ n : α, p n n - -open tactic - -example (s t : list nat) (h : t = s) : p (s ++ []) ([] ++ t) := -begin [smt] - add_simp_lemmas, - ematch, - rsimp, - guard_target p s s, - apply pax -end diff --git a/old_tests/tests/lean/run/smt_tactic.lean b/old_tests/tests/lean/run/smt_tactic.lean deleted file mode 100644 index 7da4df32c9..0000000000 --- a/old_tests/tests/lean/run/smt_tactic.lean +++ /dev/null @@ -1,13 +0,0 @@ -namespace tactic.interactive - -meta def smt (tac : smt_tactic.interactive.itactic) : tactic unit := -solve1 $ using_smt $ tac - -end tactic.interactive - -def f (a : nat) := a - -example (a b c : nat) (h₁ : a = b) (h₂ : b = c) : f b = c + 0 := -begin - smt { trace_state, change f b = c, add_lhs_lemma f.equations._eqn_1, ematch } -end diff --git a/old_tests/tests/lean/run/smt_tests.lean b/old_tests/tests/lean/run/smt_tests.lean deleted file mode 100644 index c4a4c59ed4..0000000000 --- a/old_tests/tests/lean/run/smt_tests.lean +++ /dev/null @@ -1,88 +0,0 @@ -attribute [pre_smt] add_zero zero_add mul_one one_mul - -constant p : nat → nat → Prop -constants a b : nat -constant h : p (a + 1 * b + 0) (a + b) - -open tactic smt_tactic - -def ex : p (a + b) (a + b) := -begin [smt] - do { - h ← to_expr ```(h), - t ← infer_type h, - (new_t, he) ← preprocess t, -- use smt_tactic preprocessor - new_h ← mk_app `eq.mp [he, h], - exact new_h - } -end - -def foo : nat → nat -| 0 := 0 -| (n+1) := 2*n - -lemma ex1 (n : nat) : n = 0 → foo (n+1) = 2*0 := -begin [smt] - intros, - add_lemma [mul_zero, zero_mul], - add_eqn_lemmas foo, - ematch -end - -lemma ex2 (n : nat) : n = 0 → foo (n+1) = 2*0 := -begin [smt] - intros, - ematch_using [foo, mul_zero, zero_mul], -end - -lemma ex3 (n : nat) : n = 0 → foo n = 0 := -begin [smt] - intros, - add_eqn_lemmas foo -end - -def boo : nat → nat -| 0 := 1 -| (n+1) := - match foo n with - | 0 := 2 - | _ := 3 - end - -lemma ex4 (n : nat) : n = 0 → boo (n+1) = 2 := -begin [smt] - intros, - add_eqn_lemmas boo foo, - ematch, -end - -lemma ex5 (n : nat) : n = 0 → boo (n+1) = 2 := -begin [smt] - intros, - ematch_using [boo, foo] -end - -def r (x : nat) := x - -lemma ex6 (n : nat) : n = 0 → boo (n+1) = r 2 := -begin [smt] - intros, - add_eqn_lemmas boo foo r, - (smt_tactic.get_lemmas >>= smt_tactic.trace), - ematch, -end - -lemma ex7 (a b : nat) : a = 0 → b = a → b = 0 := -begin [smt] - intros, - try { trace "hello", @smt_tactic.failed unit }, -end - -set_option trace.smt true - -lemma ex8 (n : nat) : n = 0 → boo (n+1) = r 2 := -begin [smt] - intros, - add_eqn_lemmas boo foo r, - ematch, -end diff --git a/old_tests/tests/lean/run/smt_tests2.lean b/old_tests/tests/lean/run/smt_tests2.lean deleted file mode 100644 index 41bfe07638..0000000000 --- a/old_tests/tests/lean/run/smt_tests2.lean +++ /dev/null @@ -1,53 +0,0 @@ -lemma ex1 (a b c : nat) (f : nat → nat → nat) : f 0 1 = 1 → (λ x y : nat, x) = f → false := -begin [smt] - intros -end - -lemma ex2 (a b c : nat) (f : nat → nat → nat) : f 0 1 = 1 → f = (λ x y, x) → false := -begin [smt] - intros -end - -lemma ex3 (a b c : nat) (f : nat → nat) : f = (λ x, x) → f 0 = 1 → false := -begin [smt] - intros -end - -lemma ex4 (a b c : nat) (f : nat → nat) : (λ x : nat, x) = f → f 0 = 1 → false := -begin [smt] - intros -end - -open list -universe variables u - -lemma ex5 {α : Type u} (l : list α) (a : α) (f : α → α × α) : - f = (λ x, (x, x)) → map f (a::l) = (a, a) :: map f l := -begin [smt] - intros, - add_eqn_lemmas map, - ematch -end - -lemma ex6 {α : Type u} (l : list α) (a : α) (f : α → α × α) : - map f (a::l) ≠ (a, a) :: map f l → f = (λ x, (x, x)) → false := -begin [smt] - intros, - add_eqn_lemmas map, - ematch -end - -lemma ex7 (a b c : nat) (f : nat → nat → nat) : f 0 1 = 1 → (λ (x : nat) (y : char), x) == f → f = (λ (x : nat) (y : nat), 2) → false := -begin [smt] - intros -end - -/- -The following kind of propagation is not supported yet. -We can add it if it is needed in practice. - -example (a b c : nat) (f : nat → nat → nat) : (λ x : nat, x) = f b → f b 0 = 1 → false := -begin [smt] - close -end --/ diff --git a/old_tests/tests/lean/run/smt_tests3.lean b/old_tests/tests/lean/run/smt_tests3.lean deleted file mode 100644 index 780ff728ce..0000000000 --- a/old_tests/tests/lean/run/smt_tests3.lean +++ /dev/null @@ -1,39 +0,0 @@ -def f : nat → nat -| 0 := 1 -| (n+1) := f n + 1 - -lemma ex(a : nat) : f a ≠ 0 := -begin - induction a, - dsimp [f], intro x, contradiction, - dsimp [f], - change nat.succ (f a_n) ≠ 0, - apply nat.succ_ne_zero -end - -lemma ex2 (a : nat) : f a ≠ 0 := -begin [smt] - induction a, - { intros, ematch_using [f] }, - { iterate { ematch_using [f, nat.add_one, nat.succ_ne_zero] }} -end - -lemma ex3 (a : nat) : f (a+1) = f a + 1 := -begin [smt] - dsimp [f] -end - -lemma ex4 (a : nat) : f (a+1) = f a + 1 := -begin [smt] - simp [f] -end - -lemma ex5 (a : nat) : f (a+1) = f a + 1 := -begin [smt] - ematch_using [f] -end - -lemma ex6 (a : nat) : f 0 = 1 := -begin [smt] - ematch_using [f] -end diff --git a/old_tests/tests/lean/run/sorry.lean b/old_tests/tests/lean/run/sorry.lean deleted file mode 100644 index 8685e3a5af..0000000000 --- a/old_tests/tests/lean/run/sorry.lean +++ /dev/null @@ -1,5 +0,0 @@ -definition b : Prop := -sorry - -theorem tst : true = false := -sorry diff --git a/old_tests/tests/lean/run/soundness.lean b/old_tests/tests/lean/run/soundness.lean deleted file mode 100644 index 99f5e17689..0000000000 --- a/old_tests/tests/lean/run/soundness.lean +++ /dev/null @@ -1,172 +0,0 @@ -/- -Copyright (c) 2015 Microsoft Corporation. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. - -Author: Leonardo de Moura - -Define propositional calculus, valuation, provability, validity, prove soundness. - -This file is based on Floris van Doorn Coq files. - -Similar to soundness.lean, but defines Nc in Type. -The idea is to be able to prove soundness using recursive equations. --/ -open nat bool list decidable - -attribute [reducible] -definition PropVar := nat - -inductive PropF -| Var : PropVar → PropF -| Bot : PropF -| Conj : PropF → PropF → PropF -| Disj : PropF → PropF → PropF -| Impl : PropF → PropF → PropF - -namespace PropF - notation `#`:max P:max := Var P - local notation A ∨ B := Disj A B - local notation A ∧ B := Conj A B - local infixr `⇒`:27 := Impl - notation `⊥` := Bot - - def Neg (A) := A ⇒ ⊥ - notation ~ A := Neg A - def Top := ~⊥ - notation `⊤` := Top - def BiImpl (A B) := A ⇒ B ∧ B ⇒ A - infixr `⇔`:27 := BiImpl - - def valuation := PropVar → bool - - def TrueQ (v : valuation) : PropF → bool - | (# P) := v P - | ⊥ := ff - | (A ∨ B) := TrueQ A || TrueQ B - | (A ∧ B) := TrueQ A && TrueQ B - | (A ⇒ B) := bnot (TrueQ A) || TrueQ B - - attribute [reducible] - def is_true (b : bool) := b = tt - - -- the valuation v satisfies a list of PropF, if forall (A : PropF) in Γ, - -- (TrueQ v A) is tt (the Boolean true) - def Satisfies (v) (Γ : list PropF) := ∀ A, A ∈ Γ → is_true (TrueQ v A) - def Models (Γ A) := ∀ v, Satisfies v Γ → is_true (TrueQ v A) - - infix `⊨`:80 := Models - - def Valid (p) := [] ⊨ p - reserve infix ` ⊢ `:26 - - /- Provability -/ - - inductive Nc : list PropF → PropF → Type - infix ⊢ := Nc - | Nax : ∀ Γ A, A ∈ Γ → Γ ⊢ A - | ImpI : ∀ Γ A B, A::Γ ⊢ B → Γ ⊢ A ⇒ B - | ImpE : ∀ Γ A B, Γ ⊢ A ⇒ B → Γ ⊢ A → Γ ⊢ B - | BotC : ∀ Γ A, (~A)::Γ ⊢ ⊥ → Γ ⊢ A - | AndI : ∀ Γ A B, Γ ⊢ A → Γ ⊢ B → Γ ⊢ A ∧ B - | AndE₁ : ∀ Γ A B, Γ ⊢ A ∧ B → Γ ⊢ A - | AndE₂ : ∀ Γ A B, Γ ⊢ A ∧ B → Γ ⊢ B - | OrI₁ : ∀ Γ A B, Γ ⊢ A → Γ ⊢ A ∨ B - | OrI₂ : ∀ Γ A B, Γ ⊢ B → Γ ⊢ A ∨ B - | OrE : ∀ Γ A B C, Γ ⊢ A ∨ B → A::Γ ⊢ C → B::Γ ⊢ C → Γ ⊢ C - - infix ⊢ := Nc - - def Provable (A) := [] ⊢ A - - def Prop_Soundness := ∀ A, Provable A → Valid A - - def Prop_Completeness := ∀ A, Valid A → Provable A - - open Nc - - lemma weakening2 : ∀ {Γ A Δ}, Γ ⊢ A → Γ ⊆ Δ → Δ ⊢ A - | ._ ._ Δ (Nax Γ A Hin) Hs := Nax _ _ (Hs Hin) - | ._ .(A ⇒ B) Δ (ImpI Γ A B H) Hs := ImpI _ _ _ (weakening2 H (cons_subset_cons A Hs)) - | ._ ._ Δ (ImpE Γ A B H₁ H₂) Hs := ImpE _ _ _ (weakening2 H₁ Hs) (weakening2 H₂ Hs) - | ._ ._ Δ (BotC Γ A H) Hs := BotC _ _ (weakening2 H (cons_subset_cons (~A) Hs)) - | ._ .(A ∧ B) Δ (AndI Γ A B H₁ H₂) Hs := AndI _ _ _ (weakening2 H₁ Hs) (weakening2 H₂ Hs) - | ._ ._ Δ (AndE₁ Γ A B H) Hs := AndE₁ _ _ _ (weakening2 H Hs) - | ._ ._ Δ (AndE₂ Γ A B H) Hs := AndE₂ _ _ _ (weakening2 H Hs) - | ._ .(A ∨ B) Δ (OrI₁ Γ A B H) Hs := OrI₁ _ _ _ (weakening2 H Hs) - | ._ .(A ∨ B) Δ (OrI₂ Γ A B H) Hs := OrI₂ _ _ _ (weakening2 H Hs) - | ._ ._ Δ (OrE Γ A B C H₁ H₂ H₃) Hs := - OrE _ _ _ _ (weakening2 H₁ Hs) (weakening2 H₂ (cons_subset_cons A Hs)) (weakening2 H₃ (cons_subset_cons B Hs)) - - lemma weakening : ∀ Γ Δ A, Γ ⊢ A → Γ++Δ ⊢ A := - λ Γ Δ A H, weakening2 H (subset_append_left Γ Δ) - - lemma deduction : ∀ Γ A B, Γ ⊢ A ⇒ B → A::Γ ⊢ B := - λ Γ A B H, ImpE _ _ _ (weakening2 H (subset_cons A Γ)) (Nax _ _ (mem_cons_self A Γ)) - - lemma prov_impl : ∀ A B, Provable (A ⇒ B) → ∀ Γ, Γ ⊢ A → Γ ⊢ B := - λ A B Hp Γ Ha, - have wHp : Γ ⊢ (A ⇒ B), from weakening _ _ _ Hp, - ImpE _ _ _ wHp Ha - - lemma Satisfies_cons : ∀ {A Γ v}, Satisfies v Γ → is_true (TrueQ v A) → Satisfies v (A::Γ) := - λ A Γ v s t B BinAG, - or.elim BinAG - (λ e : B = A, by rewrite e; exact t) - (λ i : B ∈ Γ, s _ i) - - attribute [simp] is_true TrueQ - - theorem Soundness_general {v : valuation} : ∀ {A Γ}, Γ ⊢ A → Satisfies v Γ → is_true (TrueQ v A) - | ._ ._ (Nax Γ A Hin) s := s _ Hin - | .(A ⇒ B) ._ (ImpI Γ A B H) s := - by_cases - (λ t : is_true (TrueQ v A), - have Satisfies v (A::Γ), from Satisfies_cons s t, - have TrueQ v B = tt, from Soundness_general H this, - by simp[*]) - (λ f : ¬ is_true (TrueQ v A), - have TrueQ v A = ff, by simp at f; simp[*], - have bnot (TrueQ v A) = tt, by simp[*], - by simp[*]) - | ._ ._ (ImpE Γ A B H₁ H₂) s := - have aux : TrueQ v A = tt, from Soundness_general H₂ s, - have bnot (TrueQ v A) || TrueQ v B = tt, from Soundness_general H₁ s, - by simp [aux] at this; simp[*] - | ._ ._ (BotC Γ A H) s := by_contradiction - (λ n : TrueQ v A ≠ tt, - have TrueQ v A = ff, by {simp at n; simp[*]}, - have TrueQ v (~A) = tt, begin change (bnot (TrueQ v A) || ff = tt), simp[*] end, - have Satisfies v ((~A)::Γ), from Satisfies_cons s this, - have TrueQ v ⊥ = tt, from Soundness_general H this, - absurd this ff_ne_tt) - | .(A ∧ B) ._ (AndI Γ A B H₁ H₂) s := - have TrueQ v A = tt, from Soundness_general H₁ s, - have TrueQ v B = tt, from Soundness_general H₂ s, - by simp[*] - | ._ ._ (AndE₁ Γ A B H) s := - have TrueQ v (A ∧ B) = tt, from Soundness_general H s, - by simp [TrueQ] at this; simp [*, is_true] - | ._ ._ (AndE₂ Γ A B H) s := - have TrueQ v (A ∧ B) = tt, from Soundness_general H s, - by simp at this; simp[*] - | .(A ∨ B) ._ (OrI₁ Γ A B H) s := - have TrueQ v A = tt, from Soundness_general H s, - by simp[*] - | .(A ∨ B) ._ (OrI₂ Γ A B H) s := - have TrueQ v B = tt, from Soundness_general H s, - by simp[*] - | ._ ._ (OrE Γ A B C H₁ H₂ H₃) s := - have TrueQ v A || TrueQ v B = tt, from Soundness_general H₁ s, - have or (TrueQ v A = tt) (TrueQ v B = tt), by simp at this; simp[*], - or.elim this - (λ At, - have Satisfies v (A::Γ), from Satisfies_cons s At, - Soundness_general H₂ this) - (λ Bt, - have Satisfies v (B::Γ), from Satisfies_cons s Bt, - Soundness_general H₃ this) - - theorem Soundness : Prop_Soundness := - λ A H v s, Soundness_general H s - -end PropF diff --git a/old_tests/tests/lean/run/specialize.lean b/old_tests/tests/lean/run/specialize.lean deleted file mode 100644 index 8acc7effef..0000000000 --- a/old_tests/tests/lean/run/specialize.lean +++ /dev/null @@ -1,26 +0,0 @@ -open tactic - -lemma test1 (x y z : Prop) (f : x → y → z) (xp : x) (yp : y) : z := -begin - specialize (f xp yp), assumption -end - -lemma test2 (B C : Prop) (f : forall (A : Prop), A → C) (x : B) : C := -begin - specialize f _ x, exact f, -end - -lemma test3 (B C : Prop) (f : forall {A : Prop}, A → C) (x : B) : C := -begin - specialize (f x), exact f, -end - -lemma test4 (B C : Prop) (f : forall {A : Prop}, A → C) (x : B) : C := -begin - specialize (@f _ x), exact f, -end - -lemma test5 (X : Type) [has_add X] (f : forall {A : Type} [has_add A], A → A → A) (x : X) : X := -begin - specialize (f x x), assumption -end diff --git a/old_tests/tests/lean/run/state.lean b/old_tests/tests/lean/run/state.lean deleted file mode 100644 index 32e09d37fe..0000000000 --- a/old_tests/tests/lean/run/state.lean +++ /dev/null @@ -1,52 +0,0 @@ -import system.io - -def lifted_test : reader_t ℕ (state_t ℕ io) unit := -do 0 ← read, -- unlifted - 1 ← get, -- transparently lifted through reader_t - - put 2, - 2 ← get, - - modify (+1), - 3 ← get, - - put 4 <|> put 5, - 4 ← get, -- left branch wins - - modify (+1) >> monad_fail.fail "" <|> modify (+2), - 6 ← get, -- an outer state_t makes the state backtrack - pure () - -#eval (lifted_test.run 0).run 1 - -def infer_test {m} [monad_state ℕ m] [monad m] : m ℕ := -do n ← get, - -- can infer σ through class inference - pure n.succ - -def adapt_test : reader_t ℕ (state_t (ℕ × ℕ) io) unit := -do -- zoom in on second elem - adapt_state - (λ p, (prod.snd p, prod.fst p)) -- note: type of `p` is not known yet - (λ m n, (n, m)) - -- note: inner monad type must be known - -- note: the reader_t layer is not discarded - (read >>= put : reader_t ℕ (state_t ℕ io) punit), - (1, 0) ← get, - - -- zoom out - 3 ← adapt_state - (λ p, ((p, 3), p)) - (λ q _, q.1) - ((do q ← get, pure q.2) : reader_t ℕ (state_t ((ℕ × ℕ) × ℕ) io) ℕ), - pure () - -#eval (adapt_test.run 0).run (1, 2) - -def bistate_test : state_t ℕ (state_t bool io) unit := -do 0 ← get, -- outer state_t wins - -- can always lift manually - tt ← monad_lift (get : state_t bool io bool), - pure () - -#eval (bistate_test.run 0).run tt diff --git a/old_tests/tests/lean/run/strict_quoted_name_in_patexpr.lean b/old_tests/tests/lean/run/strict_quoted_name_in_patexpr.lean deleted file mode 100644 index a958b97fae..0000000000 --- a/old_tests/tests/lean/run/strict_quoted_name_in_patexpr.lean +++ /dev/null @@ -1,13 +0,0 @@ -open tactic - -namespace baz - -theorem bar : true := trivial - -meta def foo : tactic unit := -do applyc ``bar - -end baz - -example : true := -by baz.foo diff --git a/old_tests/tests/lean/run/struc_names.lean b/old_tests/tests/lean/run/struc_names.lean deleted file mode 100644 index 9e35e71d5f..0000000000 --- a/old_tests/tests/lean/run/struc_names.lean +++ /dev/null @@ -1,12 +0,0 @@ -namespace foo - - class structA := - mk :: (a : nat) - - class structB extends structA := - mk :: (b : nat) - - #check @structA.a - #check @structB.to_structA - -end foo diff --git a/old_tests/tests/lean/run/struct_auto_at_simp.lean b/old_tests/tests/lean/run/struct_auto_at_simp.lean deleted file mode 100644 index 490368da46..0000000000 --- a/old_tests/tests/lean/run/struct_auto_at_simp.lean +++ /dev/null @@ -1,13 +0,0 @@ -structure S (f : nat → nat) := -(ax : ∀ x, f x = x . tactic.assumption) - -example (g : nat → nat) (s : S g) (x : nat) : g (g x) = x := -by simp [s.ax] - -constant h : nat → nat -axiom h_ax (x : nat) (p : x > 0 . tactic.comp_val) : h x = x - -example (a : nat) : a > 0 → h a = a := -begin - intros, simp [h_ax, *] -end diff --git a/old_tests/tests/lean/run/struct_bug1.lean b/old_tests/tests/lean/run/struct_bug1.lean deleted file mode 100644 index a78e263d56..0000000000 --- a/old_tests/tests/lean/run/struct_bug1.lean +++ /dev/null @@ -1,15 +0,0 @@ -variable (A : Type*) - -structure foo (a : A) := -(eqpr : a = a) - -section - parameter (B : Type*) - - structure foo2 (b : B) := - (eqpr : b = b) - - #check foo2 - - definition tst : B → Type := foo2 -end diff --git a/old_tests/tests/lean/run/struct_bug2.lean b/old_tests/tests/lean/run/struct_bug2.lean deleted file mode 100644 index 8ba53241e4..0000000000 --- a/old_tests/tests/lean/run/struct_bug2.lean +++ /dev/null @@ -1,3 +0,0 @@ -structure foo := -(a : ℕ := 42) -(b : a = a) diff --git a/old_tests/tests/lean/run/struct_bug3.lean b/old_tests/tests/lean/run/struct_bug3.lean deleted file mode 100644 index 75bcb6f6db..0000000000 --- a/old_tests/tests/lean/run/struct_bug3.lean +++ /dev/null @@ -1,5 +0,0 @@ -structure foo := -(f : Π {α : Type}, α) -(g : Π {α : Type}, α := @f) - -structure bar extends foo diff --git a/old_tests/tests/lean/run/struct_extend_univ.lean b/old_tests/tests/lean/run/struct_extend_univ.lean deleted file mode 100644 index 36a86aa7e1..0000000000 --- a/old_tests/tests/lean/run/struct_extend_univ.lean +++ /dev/null @@ -1,3 +0,0 @@ -universe u -class foo (α : Sort u) := (a : α) -class bar (α : Type u) extends foo α := (b : α) diff --git a/old_tests/tests/lean/run/struct_inst_exprs2.lean b/old_tests/tests/lean/run/struct_inst_exprs2.lean deleted file mode 100644 index 15d123f48f..0000000000 --- a/old_tests/tests/lean/run/struct_inst_exprs2.lean +++ /dev/null @@ -1,21 +0,0 @@ -#exit --- import data.nat.basic -open nat - -structure s1 (A : Type) := -(x : A) (y : A) (h : x = y) - -structure s2 (A : Type) := -(mul : A → A → A) (one : A) - -structure s3 (A : Type) extends s1 A, s2 A := -(mul_one : ∀ a : A, mul a one = a) - -definition v1 : s1 nat := {| s1, x := 10, y := 10, h := rfl |} -definition v2 : s2 nat := {| s2, mul := nat.add, one := zero |} -definition v3 : s3 nat := {| s3, mul_one := nat.add_zero, v1, v2 |} - -example : s3.x v3 = 10 := rfl -example : s3.y v3 = 10 := rfl -example : s3.mul v3 = nat.add := rfl -example : s3.one v3 = nat.zero := rfl diff --git a/old_tests/tests/lean/run/struct_value.lean b/old_tests/tests/lean/run/struct_value.lean deleted file mode 100644 index 6046a0ab20..0000000000 --- a/old_tests/tests/lean/run/struct_value.lean +++ /dev/null @@ -1,43 +0,0 @@ -#check { prod . fst := 10, snd := 20 } - -#check ({ fst := 10, snd := 20 } : nat × nat) - -definition p : nat × nat := -{ snd := 20, fst := 10 } - -#print p - -meta def attr : user_attribute := -{ name := `foo, descr := "hello world" } - -#print attr - -definition p2 := -{ p with fst := 20 } - -#print p2 - -structure point := -(x : nat) (y : nat) - -structure point3d extends point := -(z : nat) - -definition p1 : point := { x := 1, y := 1 } - -definition p3 : point3d := { p1 with z := 10 } - -#print p3 - -#check { point3d . x := 1, y := 2, z := 3 } - -#check (⟨10, rfl⟩ : Σ' x : nat, x = x) - -#check ((| 10, rfl |) : Σ' x : nat, x = x) - -#check ({ fst := 10, snd := rfl } : Σ' x : nat, x = x) - -definition f (a : nat) : Σ' x : nat, x = x := -{ fst := a, snd := rfl } - -#print f diff --git a/old_tests/tests/lean/run/structure_default_value_issue.lean b/old_tests/tests/lean/run/structure_default_value_issue.lean deleted file mode 100644 index d3f638c94d..0000000000 --- a/old_tests/tests/lean/run/structure_default_value_issue.lean +++ /dev/null @@ -1,24 +0,0 @@ -namespace test -universes u v w - -structure lens (α : Type u) (β : Type v) := -(get : α → β) -(modify : α → (β → β) → α) -(set : α → β → α := λ a b, modify a (λ _, b)) - -def lens.compose {α : Type u} {β : Type v} {σ : Type w} (t : lens β σ) (s : lens α β) : lens α σ := -{ get := t^.get ∘ s^.get, - modify := λ a f, s^.modify a $ λ b, t^.modify b f, - set := λ a v, s^.modify a $ λ b, t^.set b v } - -infix `∙`:1 := lens.compose - -def fst {α β} : lens (α × β) α := -{ get := prod.fst, - modify := λ ⟨a, b⟩ f, (f a, b) } - -def snd {α β} : lens (α × β) β := -{ get := prod.snd, - modify := λ ⟨a, b⟩ f, (a, f b) } - -end test diff --git a/old_tests/tests/lean/run/structure_doc_string.lean b/old_tests/tests/lean/run/structure_doc_string.lean deleted file mode 100644 index 1a8914c200..0000000000 --- a/old_tests/tests/lean/run/structure_doc_string.lean +++ /dev/null @@ -1,5 +0,0 @@ -structure foo := -(x : nat) - -/-- doc string -/ -def x := 10 diff --git a/old_tests/tests/lean/run/structure_instance_delayed_abstr.lean b/old_tests/tests/lean/run/structure_instance_delayed_abstr.lean deleted file mode 100644 index 0521004498..0000000000 --- a/old_tests/tests/lean/run/structure_instance_delayed_abstr.lean +++ /dev/null @@ -1,2 +0,0 @@ -example : ℕ × ℕ := -{fst := have ℕ, from 0, by exact this, snd := 0} diff --git a/old_tests/tests/lean/run/structure_opt_param.lean b/old_tests/tests/lean/run/structure_opt_param.lean deleted file mode 100644 index 70c538d16b..0000000000 --- a/old_tests/tests/lean/run/structure_opt_param.lean +++ /dev/null @@ -1,17 +0,0 @@ -structure S (α : Type := int) := -(a b : α) - -def x : S := -{a := 10, b := 10} - -#check x.a - -def y : S nat := -{a := 10, b := 10} - -#check y.a - -def z : S string := -{a := "hello", b := "world"} - -#check z.a diff --git a/old_tests/tests/lean/run/structure_result_universe.lean b/old_tests/tests/lean/run/structure_result_universe.lean deleted file mode 100644 index daeed723d1..0000000000 --- a/old_tests/tests/lean/run/structure_result_universe.lean +++ /dev/null @@ -1,18 +0,0 @@ -structure foo1 (A : Type) : Type := -(elt : A) - -structure {u} foo2 (A : Type u) : Type (u+1) := -(val : A) - -structure {u} foo3 (A : Type u) : Type (max u 1) := -(val : A) - -universe variable u - -structure foo4 (A : Type u) : Type (max u 1) := -(val : A) - -#check foo1 -#check foo2 -#check foo3 -#check foo4 diff --git a/old_tests/tests/lean/run/sub.lean b/old_tests/tests/lean/run/sub.lean deleted file mode 100644 index 8f9fb20950..0000000000 --- a/old_tests/tests/lean/run/sub.lean +++ /dev/null @@ -1,2 +0,0 @@ -#check { x : nat // x > 0 } -#check { x : nat → nat // true } diff --git a/old_tests/tests/lean/run/sub_bug.lean b/old_tests/tests/lean/run/sub_bug.lean deleted file mode 100644 index c2d8664ea6..0000000000 --- a/old_tests/tests/lean/run/sub_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -open nat subtype -#check { x : nat // x > 0} diff --git a/old_tests/tests/lean/run/subobject_from_source.lean b/old_tests/tests/lean/run/subobject_from_source.lean deleted file mode 100644 index ee72db3612..0000000000 --- a/old_tests/tests/lean/run/subobject_from_source.lean +++ /dev/null @@ -1,7 +0,0 @@ -structure foo := -(a b : ℕ := 2) - -structure bar extends foo := -(c : ℕ) - -example (b : bar) : b.to_foo = {c := 2, ..b}.to_foo := rfl diff --git a/old_tests/tests/lean/run/subst_heq.lean b/old_tests/tests/lean/run/subst_heq.lean deleted file mode 100644 index c32b5a3489..0000000000 --- a/old_tests/tests/lean/run/subst_heq.lean +++ /dev/null @@ -1,9 +0,0 @@ -example (a b : nat) (h : a == b) : a + 1 = b + 1 := -begin - subst h -end - -example (a b : nat) (h : a == b) : a + 1 = b + 1 := -begin - subst_vars -end diff --git a/old_tests/tests/lean/run/subst_tac1.lean b/old_tests/tests/lean/run/subst_tac1.lean deleted file mode 100644 index c0bad7e897..0000000000 --- a/old_tests/tests/lean/run/subst_tac1.lean +++ /dev/null @@ -1,17 +0,0 @@ -constant p : nat → Prop -open tactic -set_option pp.all true - -definition ex (a b c : nat) (H : p c) : a = b → p a → p b := -by do intro `H1, intro `H2, - get_local `a >>= subst, - trace_state, - assumption - -#print ex - -example (a b c : nat) (H : p c) : a = b → p a → p b := -by do intros, - get_local `b >>= subst, - trace_state, - assumption diff --git a/old_tests/tests/lean/run/subst_vars.lean b/old_tests/tests/lean/run/subst_vars.lean deleted file mode 100644 index 9592aa988e..0000000000 --- a/old_tests/tests/lean/run/subst_vars.lean +++ /dev/null @@ -1,4 +0,0 @@ -open tactic - -example (a b c d : nat) : a = b → b = c → d = c → a = d := -by intros; subst_vars diff --git a/old_tests/tests/lean/run/suffices.lean b/old_tests/tests/lean/run/suffices.lean deleted file mode 100644 index 374a5dc359..0000000000 --- a/old_tests/tests/lean/run/suffices.lean +++ /dev/null @@ -1,6 +0,0 @@ -variables {a b c : Prop} - -theorem foo (Ha : a) (Hab : a → b) (Hbc : b → c) : c := -suffices b, from Hbc this, -suffices a, from Hab this, -Ha diff --git a/old_tests/tests/lean/run/sufficies.lean b/old_tests/tests/lean/run/sufficies.lean deleted file mode 100644 index 0dcff7247b..0000000000 --- a/old_tests/tests/lean/run/sufficies.lean +++ /dev/null @@ -1,9 +0,0 @@ -open nat - -protected theorem one_le_bit0 (n : ℕ) : n ≠ 0 → 1 ≤ bit0 n := -nat.cases_on n - (λ h, absurd rfl h) - (λ n h, - suffices 1 ≤ succ (succ (bit0 n)), from - eq.symm (nat.bit0_succ_eq n) ▸ this, - succ_le_succ (zero_le (succ (bit0 n)))) diff --git a/old_tests/tests/lean/run/super.lean b/old_tests/tests/lean/run/super.lean deleted file mode 100644 index 91ed12d571..0000000000 --- a/old_tests/tests/lean/run/super.lean +++ /dev/null @@ -1,4 +0,0 @@ -constant f : nat → nat -notation a `²` := f a -variable a : nat -#check a² diff --git a/old_tests/tests/lean/run/t1.lean b/old_tests/tests/lean/run/t1.lean deleted file mode 100644 index eccdc97f3a..0000000000 --- a/old_tests/tests/lean/run/t1.lean +++ /dev/null @@ -1,10 +0,0 @@ -prelude -definition Prop : Type.{1} := Type.{0} -#print raw ((Prop)) -#print raw Prop -#print raw fun (x y : Prop), x x -#print raw fun (x y : Prop) {z : Prop}, x y -#print raw λ [x : Prop] [y : Prop] {z : Prop}, x z -#print raw Pi (x y : Prop) {z : Prop}, x -#print raw ∀ (x y : Prop) {z : Prop}, x -#print raw forall {x y : Prop} w {z : Prop}, x diff --git a/old_tests/tests/lean/run/t10.lean b/old_tests/tests/lean/run/t10.lean deleted file mode 100644 index 10f2c3b7a8..0000000000 --- a/old_tests/tests/lean/run/t10.lean +++ /dev/null @@ -1,5 +0,0 @@ -set_option pp.colors true -set_option pp.unicode false -#print options -set_option pp.unicode true -#print options diff --git a/old_tests/tests/lean/run/t11.lean b/old_tests/tests/lean/run/t11.lean deleted file mode 100644 index 90e224390b..0000000000 --- a/old_tests/tests/lean/run/t11.lean +++ /dev/null @@ -1,15 +0,0 @@ -constant A : Type -constants a b c : A -constant f : A → A → A -#check f a b -section - universe variables u v - parameters A B : Type u - parameters {C D : Type v} - parameters [e : A] [d : A] - #check A - #check B - definition g (a : A) (b : B) (c : C) : A := e -end -#check g.{2 1} -constants x y : A diff --git a/old_tests/tests/lean/run/t2.lean b/old_tests/tests/lean/run/t2.lean deleted file mode 100644 index 8409a6ead1..0000000000 --- a/old_tests/tests/lean/run/t2.lean +++ /dev/null @@ -1,9 +0,0 @@ -universe variable l -universe variable u -#print raw Type -#print raw Type.{1} -#print raw Type.{2} -#print raw Type.{l+1} -#print raw Type.{max l u 1} -#print raw Type.{imax (l+1) u 1} -#print raw Type.{imax (l+1) l u} diff --git a/old_tests/tests/lean/run/t3.lean b/old_tests/tests/lean/run/t3.lean deleted file mode 100644 index 4c151017ab..0000000000 --- a/old_tests/tests/lean/run/t3.lean +++ /dev/null @@ -1,23 +0,0 @@ -prelude -constant int : Type.{1} -constant nat : Type.{1} -namespace int -constant plus : int → int → int -end int - -namespace nat -constant plus : nat → nat → nat -end nat - -open int nat - -constants a b : int - - -#check plus a b - -constant f : int → int → int -constant g : nat → nat → int -notation A `+`:65 B:65 := f A (g B B) -constant n : nat -#check a + n diff --git a/old_tests/tests/lean/run/t4.lean b/old_tests/tests/lean/run/t4.lean deleted file mode 100644 index cf33aa2fea..0000000000 --- a/old_tests/tests/lean/run/t4.lean +++ /dev/null @@ -1,12 +0,0 @@ -namespace foo - definition {u} f (A : Type u) : Type u := A - #check f.{1} -end foo - -constant N : Type -section - variable A : Type* - definition g (a : A) (B : Type*) : A := a - #check g.{_ 2} -end -#check g.{2 3} diff --git a/old_tests/tests/lean/run/t5.lean b/old_tests/tests/lean/run/t5.lean deleted file mode 100644 index 904967a813..0000000000 --- a/old_tests/tests/lean/run/t5.lean +++ /dev/null @@ -1,19 +0,0 @@ -constant N : Type.{1} -namespace foo - constant N : Type.{2} - namespace tst - constant N : Type.{3} - #print raw N - end tst -end foo -#print raw N -namespace foo - #print raw N - namespace tst - #print raw N N -> N - section - variable N : Type.{4} -- Shadow previous ones. - #print raw N - end - end tst -end foo diff --git a/old_tests/tests/lean/run/t6.lean b/old_tests/tests/lean/run/t6.lean deleted file mode 100644 index ee7ff2b9d5..0000000000 --- a/old_tests/tests/lean/run/t6.lean +++ /dev/null @@ -1,16 +0,0 @@ -prelude -precedence `+` : 65 -precedence `++` : 100 -constant N : Type.{1} -constant f : N → N → N -constant a : N -#check - let g x y := f x y, - infix + := g, - b : N := a+a, - c := b+a, - h (x : N) := x+x, - postfix ++ := h, - d := c++, - r (x : N) : N := x++++ - in f b (r c) diff --git a/old_tests/tests/lean/run/t7.lean b/old_tests/tests/lean/run/t7.lean deleted file mode 100644 index 278eb1a8b0..0000000000 --- a/old_tests/tests/lean/run/t7.lean +++ /dev/null @@ -1,3 +0,0 @@ -constant A : Type.{1} -constant f : A → A → A -#print raw f _ (f _ _) diff --git a/old_tests/tests/lean/run/t9.lean b/old_tests/tests/lean/run/t9.lean deleted file mode 100644 index d0d2cafd61..0000000000 --- a/old_tests/tests/lean/run/t9.lean +++ /dev/null @@ -1,15 +0,0 @@ -prelude -definition bool : Sort 1 := Sort 0 -definition and (p q : bool) : bool -:= ∀ c : bool, (p → q → c) → c -infixl `∧`:25 := and -theorem and_intro (p q : bool) (H1 : p) (H2 : q) : p ∧ q -:= λ (c : bool) (H : p → q → c), H H1 H2 -theorem and_elim_left (p q : bool) (H : p ∧ q) : p -:= H p (λ (H1 : p) (H2 : q), H1) -theorem and_elim_right (p q : bool) (H : p ∧ q) : q -:= H q (λ (H1 : p) (H2 : q), H2) -theorem and_comm (p q : bool) (H : p ∧ q) : q ∧ p -:= have H1 : p, from and_elim_left p q H, - have H2 : q, from and_elim_right p q H, - show q ∧ p, from and_intro q p H2 H1 diff --git a/old_tests/tests/lean/run/tactic_io.lean b/old_tests/tests/lean/run/tactic_io.lean deleted file mode 100644 index cd09b8f2bf..0000000000 --- a/old_tests/tests/lean/run/tactic_io.lean +++ /dev/null @@ -1,16 +0,0 @@ -import system.io - -section - - -def tst_io : io string := -do b ← io.fs.read_file "tactic_io.lean", - return b^.to_string -end - -open tactic -meta def tac : tactic unit := -do s ← tactic.unsafe_run_io tst_io, - trace s - -run_cmd tac diff --git a/old_tests/tests/lean/run/tactic_mode_scope_bug.lean b/old_tests/tests/lean/run/tactic_mode_scope_bug.lean deleted file mode 100644 index a4c33e8717..0000000000 --- a/old_tests/tests/lean/run/tactic_mode_scope_bug.lean +++ /dev/null @@ -1,15 +0,0 @@ -example (p q : Prop) : p ∧ q → q ∧ p := -begin - intro h, - have hp : p := h^.left, - have hq : q := h^.right, - exact ⟨hq, hp⟩ -end - -example (p q : Prop) (hp : q) (hq : p) : p ∧ q → q ∧ p := -begin - intro h, - have hp : p := h^.left, - have hq : q := h^.right, - exact ⟨hq, hp⟩ -end diff --git a/old_tests/tests/lean/run/tactic_ref.lean b/old_tests/tests/lean/run/tactic_ref.lean deleted file mode 100644 index 8772b6baca..0000000000 --- a/old_tests/tests/lean/run/tactic_ref.lean +++ /dev/null @@ -1,36 +0,0 @@ -open tactic - -meta def tst1 (n : nat) : tactic nat := -using_new_ref n $ λ r, do - v ← read_ref r, - trace v, - write_ref r (v*2), - v ← read_ref r, - trace v, - return v - -example : true := -by do - v ← tst1 10, - guard (v = 20), - constructor - -meta def tst2 : tactic nat := -do r ← using_new_ref 0 $ λ r, do { - return r - }, - read_ref r -- Should produce an exception, the reference is not valid anymore - -run_cmd fail_if_success $ tst2 - -meta def tst3 (n : nat) : tactic nat := -using_new_ref n $ λ r, - (write_ref r (n+10) >> failed) -- The state should be restored during backtracking - <|> - (read_ref r) - -example : true := -by do - v ← tst3 10, - guard (v = 10), - constructor diff --git a/old_tests/tests/lean/run/tc_inout1.lean b/old_tests/tests/lean/run/tc_inout1.lean deleted file mode 100644 index ef3cb83f54..0000000000 --- a/old_tests/tests/lean/run/tc_inout1.lean +++ /dev/null @@ -1,75 +0,0 @@ -universe variables u v - -/- -Type class parameter can be annotated with out_param. -Given (C a_1 ... a_n), we replace a_i with a temporary metavariable ?x_i IF -- Case 1 - a_i is an out_param -OR -- Case 2 - a_i depends on a_j for j < i, and a_j was replaced with a temporary metavariable ?x_j. - This case is needed to make sure the new C-application is type correct. - It may be counterintuitive to some users. - @kha and @leodemoura have discussed a different approach - where a type class declaration is rejected IF - it contains a regular parameter X that depends on an `out` parameter Y. - If we reject this kind of declaration, then we don't need - this extra case which may artificially treat regular parameters - as `out` (**). --/ - -class is_monoid (α : Type) (op : α → α → α) (e : out_param α) := -(op_assoc : associative op) -(left_neutral : ∀ a : α, op e a = a) -(right_neutral : ∀ a : α, op a e = a) - -lemma assoc {α : Type} {op : α → α → α} {e : α} [is_monoid α op e] : ∀ a b c : α, op (op a b) c = op a (op b c) := -@is_monoid.op_assoc α op e _ - -instance nat_add_monoid : is_monoid nat nat.add 0 := sorry -instance nat_mul_monoid : is_monoid nat nat.mul 1 := sorry -instance int_mul_monoid : is_monoid int int.mul 1 := sorry - -open tactic - -run_cmd do - M ← to_expr ``(is_monoid nat nat.add), - m₁ ← mk_mvar, - i ← mk_instance (M m₁), - /- found nat_add_monoid -/ - trace i, - instantiate_mvars (M m₁) >>= trace - -run_cmd do - M ← to_expr ``(is_monoid nat nat.mul), - m₁ ← mk_mvar, - i ← mk_instance (M m₁), - /- found nat_mul_monoid -/ - trace i, - instantiate_mvars (M m₁) >>= trace - - -section -local infix + := nat.add - -example (a b c : nat) : (a + b) + c = a + (b + c) := -assoc a b c -end - -section -class has_mem2 (α : out_param $ Type u) (γ : Type v) := -(mem : α → γ → Prop) - -def mem2 {α : Type u} {γ : Type v} [has_mem2 α γ] : α → γ → Prop := -has_mem2.mem - -local infix ∈ := mem2 - -instance (α : Type u) : has_mem2 α (list α) := -⟨list.mem⟩ - -#check λ a (s : list nat), a ∈ s - -set_option pp.notation false -#check ∀ a ∈ [1, 2, 3], a > 0 -end diff --git a/old_tests/tests/lean/run/tc_loop.lean b/old_tests/tests/lean/run/tc_loop.lean deleted file mode 100644 index 3bec3c7196..0000000000 --- a/old_tests/tests/lean/run/tc_loop.lean +++ /dev/null @@ -1,8 +0,0 @@ -open tactic - -#check (do { trace "foo", trace_state } : tactic unit) -axiom Sorry {A : Sort*} : A -#check -λ (A : Sort*) (a b c d : A) (H₁ : a = b) (H₂ : c = b) (H₃ : d = c), -have a = c, by do { trace "have-expr...", trace_state, transitivity, assumption, symmetry, assumption }, -show a = d, from Sorry diff --git a/old_tests/tests/lean/run/term_app.lean b/old_tests/tests/lean/run/term_app.lean deleted file mode 100644 index 7306622db6..0000000000 --- a/old_tests/tests/lean/run/term_app.lean +++ /dev/null @@ -1,11 +0,0 @@ -inductive term -| const : string → term -| app : string → list term → term - -mutual def num_consts, num_consts_lst -with num_consts : term → nat -| (term.const n) := 1 -| (term.app n ts) := num_consts_lst ts -with num_consts_lst : list term → nat -| [] := 0 -| (t::ts) := num_consts t + num_consts_lst ts diff --git a/old_tests/tests/lean/run/term_app2.lean b/old_tests/tests/lean/run/term_app2.lean deleted file mode 100644 index 299c0230e2..0000000000 --- a/old_tests/tests/lean/run/term_app2.lean +++ /dev/null @@ -1,70 +0,0 @@ -lemma nat.lt_add_of_lt {a b c : nat} : a < b → a < c + b := -begin - intro h, - have aux₁ := nat.le_add_right b c, - have aux₂ := lt_of_lt_of_le h aux₁, - rwa [add_comm] at aux₂ -end - -lemma nat.lt_one_add_of_lt {a b : nat} : a < b → a < 1 + b := -begin - intro h, - have aux := lt.trans h (nat.lt_succ_self _), - rwa [<- nat.add_one, add_comm] at aux -end - -namespace list -def attach_aux {α} (l : list α) : Π (c : list α), (∀ x : α, x ∈ c → x ∈ l) → list {a : α // a ∈ l} -| [] h := [] -| (a::as) h := - ⟨a, h a (list.mem_cons_self _ _)⟩ :: attach_aux as (λ x hin, h x (list.mem_cons_of_mem _ hin)) - -def attach {α} (l : list α) : list {a : α // a ∈ l} := -attach_aux l l (λ x h, h) - -open well_founded_tactics - -lemma sizeof_lt_sizeof_of_mem {α} [has_sizeof α] {a : α} : ∀ {l : list α}, a ∈ l → sizeof a < sizeof l -| [] h := absurd h (not_mem_nil _) -| (b::bs) h := - begin - cases eq_or_mem_of_mem_cons h with h_1 h_2, - subst h_1, - {unfold_sizeof, cancel_nat_add_lt, trivial_nat_lt}, - {have aux₁ := sizeof_lt_sizeof_of_mem h_2, - unfold_sizeof, - exact nat.lt_one_add_of_lt (nat.lt_add_of_lt aux₁)} - end -end list - -inductive term -| const : string → term -| app : string → list term → term - -def num_consts : term → nat -| (term.const n) := 1 -| (term.app n ts) := - ts.attach.foldl - (λ r p, - have sizeof p.1 < n.length + (1 + sizeof ts), from - calc sizeof p.1 < 1 + (n.length + sizeof ts) : nat.lt_one_add_of_lt (nat.lt_add_of_lt (list.sizeof_lt_sizeof_of_mem p.2)) - ... = n.length + (1 + sizeof ts) : by simp, - r + num_consts p.1) - 0 - -#eval num_consts (term.app "f" [term.const "x", term.app "g" [term.const "x", term.const "y"]]) - -#check num_consts.equations._eqn_2 - -def num_consts' : term → nat -| (term.const n) := 1 -| (term.app n ts) := - ts.attach.foldl - (λ r ⟨t, h⟩, - have sizeof t < n.length + (1 + sizeof ts), from - calc sizeof t < 1 + (n.length + sizeof ts) : nat.lt_one_add_of_lt (nat.lt_add_of_lt (list.sizeof_lt_sizeof_of_mem h)) - ... = n.length + (1 + sizeof ts) : by simp, - r + num_consts' t) - 0 - -#check num_consts'.equations._eqn_2 diff --git a/old_tests/tests/lean/run/term_pred.lean b/old_tests/tests/lean/run/term_pred.lean deleted file mode 100644 index ab839fdc72..0000000000 --- a/old_tests/tests/lean/run/term_pred.lean +++ /dev/null @@ -1,25 +0,0 @@ -inductive term -| app : string → list term → term -| var : string → term - -inductive bin_only : term → Prop -| leaf : ∀ x, bin_only (term.var x) -| bin_app : ∀ op a b, bin_only a → bin_only b → bin_only (term.app op [a, b]) - -example (op : string) (a : term) : ¬ bin_only (term.app op [a]) := -begin - intro h, - cases h -end - -example (op : string) (a b : term) (H : bin_only (term.app op [a, b])) : bin_only a := -begin - cases H, - assumption -end - -example (op : string) (a b : term) (H : bin_only (term.app op [a, b])) : bin_only b := -begin - cases H with _ _ _ _ H1 H2, - exact H2 -end diff --git a/old_tests/tests/lean/run/test_all.sh b/old_tests/tests/lean/run/test_all.sh deleted file mode 100644 index db1928444d..0000000000 --- a/old_tests/tests/lean/run/test_all.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 1 ]; then - echo "Usage: test_all.sh [lean-executable-path]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -"$LEAN" --test-suite *.lean || (rm *.test_suite.out *.status; false) diff --git a/old_tests/tests/lean/run/test_perm_ac1.lean b/old_tests/tests/lean/run/test_perm_ac1.lean deleted file mode 100644 index 135fc17d7e..0000000000 --- a/old_tests/tests/lean/run/test_perm_ac1.lean +++ /dev/null @@ -1,53 +0,0 @@ -#exit - -open expr decidable tactic nat - -meta definition is_poly_bin_app : expr → option name -| (app (app (app (app (const op ls) A) s) lhs) rhs) := some op -| _ := none - -meta definition is_add (e : expr) : bool := -match (is_poly_bin_app e) with -| (some op) := to_bool (op = `add) -| none := ff -end - -meta definition perm_add (e1 e2 : expr) : tactic expr := -do when (is_add e1 = ff) (fail "given expression is not an addition"), - add_fn : expr ← return $ app_fn (app_fn e1), - A : expr ← return $ app_arg (app_fn add_fn), - s1 : expr ← mk_app `add_semigroup [A] >>= mk_instance, - assoc : expr ← mk_mapp `add.assoc [some A, some s1], - s2 : expr ← mk_app `add_comm_semigroup [A] >>= mk_instance, - comm : expr ← mk_mapp `add.comm [some A, some s2], - perm_ac add_fn assoc comm e1 e2 - -meta definition tst_perm : tactic unit := -do trace "--------", - (lhs, rhs) ← target >>= match_eq, - H ← perm_add lhs rhs, - trace H, - exact H - -set_option trace.tactic.perm_ac true - -example (a b c d : nat) : d + b + c + a = a + b + c + d := -by tst_perm - -example (a b c d : nat) : a + b + c + d = d + c + b + a := -by tst_perm - -example (a b c d : nat) : ((b + a) + (d + c)) = (c + d) + (a + b) := -by tst_perm - -example (a b c d e f : nat) : (e + d) + (c + (b + (a + f))) = f + (b + (c + (d + (e + a)))) := -by tst_perm - -example (a b c d e f : nat) : (c + b + a) + (f + (e + d)) = a + b + c + d + e + f := -by tst_perm - -example (a b c d e f : nat) : a + (c + b) + (e + d) + f = f + (b + (c + (d + (e + a)))) := -by tst_perm - -example (a b c d e f : nat) : a + (d + b + c) + (f + e) = a + (b + (c + (d + (e + f)))) := -by tst_perm diff --git a/old_tests/tests/lean/run/test_single.sh b/old_tests/tests/lean/run/test_single.sh deleted file mode 100755 index 900d380269..0000000000 --- a/old_tests/tests/lean/run/test_single.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -f=$2 -echo "-- testing $f" -if [[ -f $f.status ]]; then - echo "-- using result from test_all.sh" - cat $f.test_suite.out - status=$(cat $f.status) - rm $f.test_suite.out $f.status -else - "$LEAN" -j 0 "$f" - status=$? -fi -if [ "$status" -eq 0 ]; then - echo "-- checked" -else - echo "failed $f" - exit 1 -fi diff --git a/old_tests/tests/lean/run/thunk_overload.lean b/old_tests/tests/lean/run/thunk_overload.lean deleted file mode 100644 index 5e012de4ae..0000000000 --- a/old_tests/tests/lean/run/thunk_overload.lean +++ /dev/null @@ -1,41 +0,0 @@ -/- Thunk gadget works with overloaded functions -/ -namespace foo - -def f (a : nat) (b : thunk nat) : nat := -a + b () - -end foo - -namespace boo - -def f (a : bool) (b : bool) : bool := -a && b - -end boo - -namespace bla - -def f (a : bool) (b : thunk nat) : nat := -if a then b() else 42 - -end bla - -open foo boo bla - -example : f 10 10 = 20 := -rfl - -example : f 10 10 = foo.f 10 10 := -rfl - -example : f tt tt = tt := -rfl - -example : f tt tt = boo.f tt tt := -rfl - -example : f tt 10 = 10 := -rfl - -example : f tt 10 = bla.f tt 10 := -rfl diff --git a/old_tests/tests/lean/run/trace_call_stack_segfault.lean b/old_tests/tests/lean/run/trace_call_stack_segfault.lean deleted file mode 100644 index a8eae4e5b6..0000000000 --- a/old_tests/tests/lean/run/trace_call_stack_segfault.lean +++ /dev/null @@ -1,3 +0,0 @@ -open tactic - -run_cmd trace_call_stack diff --git a/old_tests/tests/lean/run/trace_crash.lean b/old_tests/tests/lean/run/trace_crash.lean deleted file mode 100644 index 9de236f29e..0000000000 --- a/old_tests/tests/lean/run/trace_crash.lean +++ /dev/null @@ -1,8 +0,0 @@ -constant f : nat → nat → nat -constant fax1 : ∀ x, f x x = f x 0 -constant fax2 : ∀ x, f x 0 = x - -set_option trace.type_context.is_def_eq true - -example (a : nat) : f a a = a := -by simp [fax1, fax2] diff --git a/old_tests/tests/lean/run/trace_tst.lean b/old_tests/tests/lean/run/trace_tst.lean deleted file mode 100644 index ac604522d1..0000000000 --- a/old_tests/tests/lean/run/trace_tst.lean +++ /dev/null @@ -1,3 +0,0 @@ -open nat - -#eval trace "step1" (trace "hello" (succ 3)) diff --git a/old_tests/tests/lean/run/tree_map.lean b/old_tests/tests/lean/run/tree_map.lean deleted file mode 100644 index 7e4eb975e6..0000000000 --- a/old_tests/tests/lean/run/tree_map.lean +++ /dev/null @@ -1,20 +0,0 @@ -universes u v - -inductive tree (α : Type u) : Type u -| node : α → list tree → tree - -mutual def tree.map, tree.map_lst {α : Type u} {β : Type v} (f : α → β) -with tree.map : tree α → tree β -| (tree.node a ts) := tree.node (f a) (tree.map_lst ts) -with tree.map_lst : list (tree α) → list (tree β) -| [] := [] -| (t::ts) := tree.map t :: tree.map_lst ts - -example {α : Type u} {β : Type v} (f : α → β) (a : α) (ts : list (tree α)) : tree.map f (tree.node a ts) = tree.node (f a) (tree.map_lst f ts) := -by simp [tree.map] - -example {α : Type u} {β : Type v} (f : α → β) : tree.map_lst f [] = [] := -by simp [tree.map_lst] - -example {α : Type u} {β : Type v} (f : α → β) (t : tree α) (ts : list (tree α)) : tree.map_lst f (t::ts) = tree.map f t :: tree.map_lst f ts := -by simp [tree.map_lst] diff --git a/old_tests/tests/lean/run/try_for1.lean b/old_tests/tests/lean/run/try_for1.lean deleted file mode 100644 index d78f076f8f..0000000000 --- a/old_tests/tests/lean/run/try_for1.lean +++ /dev/null @@ -1,22 +0,0 @@ -meta def f : nat → nat -| n := f (n + 1) - -#eval try_for 100 (f 10) - -#eval try_for 1000 (f 10) - -meta def mk : nat → list nat -| 0 := [] -| (n+1) := n :: mk n - -example : true := -begin - tactic.fail_if_success (guard(to_bool (try_for 1 ((mk 1000)^.length) = some 1000))), - constructor -end - -example : true := -begin - guard (try_for 100 ((mk 1000)^.length) = some 1000), - constructor -end diff --git a/old_tests/tests/lean/run/tuple_head_issue.lean b/old_tests/tests/lean/run/tuple_head_issue.lean deleted file mode 100644 index 09afd9dd40..0000000000 --- a/old_tests/tests/lean/run/tuple_head_issue.lean +++ /dev/null @@ -1,7 +0,0 @@ -import data.vector open nat -universe variables u -variable {α : Type u} - -def head (n) : vector α (succ n) → α -| ⟨[], H⟩ := by contradiction -| ⟨a::b, H⟩ := a diff --git a/old_tests/tests/lean/run/type_equations.lean b/old_tests/tests/lean/run/type_equations.lean deleted file mode 100644 index df88a94762..0000000000 --- a/old_tests/tests/lean/run/type_equations.lean +++ /dev/null @@ -1,41 +0,0 @@ -open nat - -inductive Expr -| zero : Expr -| one : Expr -| add : Expr → Expr → Expr - -namespace Expr - -inductive direct_subterm : Expr → Expr → Prop -| add_1 : ∀ e₁ e₂ : Expr, direct_subterm e₁ (add e₁ e₂) -| add_2 : ∀ e₁ e₂ : Expr, direct_subterm e₂ (add e₁ e₂) - -theorem direct_subterm_wf : well_founded direct_subterm := -sorry -/- -begin - constructor, intro e, induction e, - repeat (constructor; intro y hlt; cases hlt; repeat assumption) -end --/ - -definition subterm := tc direct_subterm - -theorem subterm_wf : well_founded subterm := -tc.wf direct_subterm_wf - -local infix `+` := Expr.add - -set_option pp.notation false - -definition ev : Expr → nat -| zero := 0 -| one := 1 -| ((a : Expr) + b) := has_add.add (ev a) (ev b) - -definition foo : Expr := add zero (add one one) - -example : ev foo = 2 := -rfl -end Expr diff --git a/old_tests/tests/lean/run/u_eq_max_u_v.lean b/old_tests/tests/lean/run/u_eq_max_u_v.lean deleted file mode 100644 index 132f33e372..0000000000 --- a/old_tests/tests/lean/run/u_eq_max_u_v.lean +++ /dev/null @@ -1,91 +0,0 @@ -universe variables u v u1 u2 v1 v2 - -set_option pp.universes true - -open smt_tactic -meta def blast : tactic unit := using_smt $ intros >> add_lemmas_from_facts >> iterate_at_most 3 ematch -notation `♮` := by blast - -structure semigroup_morphism { α β : Type u } ( s : semigroup α ) ( t: semigroup β ) := - (map: α → β) - (multiplicative : ∀ x y : α, map(x * y) = map(x) * map(y)) - -attribute [simp] semigroup_morphism.multiplicative - -@[reducible] instance semigroup_morphism_to_map { α β : Type u } { s : semigroup α } { t: semigroup β } : has_coe_to_fun (semigroup_morphism s t) := -{ F := λ f, Π x : α, β, - coe := semigroup_morphism.map } - -@[reducible] definition semigroup_identity { α : Type u } ( s: semigroup α ) : semigroup_morphism s s := ⟨ id, ♮ ⟩ - -@[reducible] definition semigroup_morphism_composition - { α β γ : Type u } { s: semigroup α } { t: semigroup β } { u: semigroup γ} - ( f: semigroup_morphism s t ) ( g: semigroup_morphism t u ) : semigroup_morphism s u := -{ - map := λ x, g (f x), - multiplicative := begin intros, simp [coe_fn] end -} - -local attribute [simp] mul_comm mul_assoc mul_left_comm - -@[reducible] definition semigroup_product { α β : Type u } ( s : semigroup α ) ( t: semigroup β ) : semigroup (α × β) := { - mul := λ p q, (p^.fst * q^.fst, p^.snd * q^.snd), - mul_assoc := begin - intros, - simp [@has_mul.mul (α × β)] - end -} - -definition semigroup_morphism_product - { α β γ δ : Type u } - { s_f : semigroup α } { s_g: semigroup β } { t_f : semigroup γ} { t_g: semigroup δ } - ( f : semigroup_morphism s_f t_f ) ( g : semigroup_morphism s_g t_g ) - : semigroup_morphism (semigroup_product s_f s_g) (semigroup_product t_f t_g) := { - map := λ p, (f p.1, g p.2), - multiplicative := - begin - -- cf https://groups.google.com/d/msg/lean-user/bVs5FdjClp4/tfHiVjLIBAAJ - intros, - unfold has_mul.mul, - dsimp [coe_fn], - simp - end -} - -structure Category := - (Obj : Type u) - (Hom : Obj → Obj → Type v) - -structure Functor (C : Category.{ u1 v1 }) (D : Category.{ u2 v2 }) := - (onObjects : C^.Obj → D^.Obj) - (onMorphisms : Π { X Y : C^.Obj }, - C^.Hom X Y → D^.Hom (onObjects X) (onObjects Y)) - -@[reducible] definition ProductCategory (C : Category) (D : Category) : - Category := - { - Obj := C^.Obj × D^.Obj, - Hom := (λ X Y : C^.Obj × D^.Obj, C^.Hom (X^.fst) (Y^.fst) × D^.Hom (X^.snd) (Y^.snd)) - } - -namespace ProductCategory - notation C `×` D := ProductCategory C D -end ProductCategory - -structure PreMonoidalCategory - extends carrier : Category := - (tensor : Functor (carrier × carrier) carrier) - -definition CategoryOfSemigroups : Category := -{ - Obj := Σ α : Type u, semigroup α, - Hom := λ s t, semigroup_morphism s.2 t.2 -} - -definition PreMonoidalCategoryOfSemigroups : PreMonoidalCategory := { - CategoryOfSemigroups with - tensor := { - onObjects := λ p, sigma.mk (p.1.1 × p.2.1) (semigroup_product p.1.2 p.2.2), - onMorphisms := λ s t f, semigroup_morphism_product f.1 f.2 - } -} diff --git a/old_tests/tests/lean/run/unfold_default_values.lean b/old_tests/tests/lean/run/unfold_default_values.lean deleted file mode 100644 index a615009621..0000000000 --- a/old_tests/tests/lean/run/unfold_default_values.lean +++ /dev/null @@ -1,10 +0,0 @@ -structure S := -(x : nat) -(y : nat := 10) - -example (a : nat) (h : 10 = a) : {S . x := 10}^.y = a := -begin - simp [S.y._default], - guard_target 10 = a, - exact h -end diff --git a/old_tests/tests/lean/run/unfold_issue.lean b/old_tests/tests/lean/run/unfold_issue.lean deleted file mode 100644 index 2d3f4a0f2f..0000000000 --- a/old_tests/tests/lean/run/unfold_issue.lean +++ /dev/null @@ -1,11 +0,0 @@ -def f : nat → nat → nat -| 0 := λ x, x -| (n+1) := λ x, x + 1 - -meta def check_expr (p : pexpr) (t : expr) : tactic unit := -do e ← tactic.to_expr p, guard (t = e) - -example (n : nat): f (n+1) n = n + 1 := -begin - unfold f -end diff --git a/old_tests/tests/lean/run/unfold_lemmas.lean b/old_tests/tests/lean/run/unfold_lemmas.lean deleted file mode 100644 index 0b304f79ea..0000000000 --- a/old_tests/tests/lean/run/unfold_lemmas.lean +++ /dev/null @@ -1,10 +0,0 @@ -open nat well_founded - -def gcd' : ℕ → ℕ → ℕ | y := λ x, -if h : y = 0 then - x -else - have x % y < y, by { apply mod_lt, cases y, contradiction, apply succ_pos }, - gcd' (x % y) y - -@[simp] lemma gcd_zero_right (x : nat) : gcd' 0 x = x := rfl diff --git a/old_tests/tests/lean/run/uni_issue1.lean b/old_tests/tests/lean/run/uni_issue1.lean deleted file mode 100644 index d56d97fb03..0000000000 --- a/old_tests/tests/lean/run/uni_issue1.lean +++ /dev/null @@ -1,8 +0,0 @@ -namespace experiment -inductive nat : Type -| zero : nat -| succ : nat → nat - -definition is_zero (n : nat) : Prop -:= nat.rec true (λ n r, false) n -end experiment diff --git a/old_tests/tests/lean/run/uni_var_bug.lean b/old_tests/tests/lean/run/uni_var_bug.lean deleted file mode 100644 index 226a6127f9..0000000000 --- a/old_tests/tests/lean/run/uni_var_bug.lean +++ /dev/null @@ -1,13 +0,0 @@ -section -universe variable u -variables {A B : Type.{u}} -theorem foo (H : A = B) : A = B := H -theorem bar {C D : Type} (H : C = D) : C = D := -foo H -end - -universe variable u -variables {A B : Type.{u}} -theorem foo2 (H : A = B) : A = B := H -theorem bar2 {C D : Type} (H : C = D) : C = D := -foo2 H diff --git a/old_tests/tests/lean/run/unicode.lean b/old_tests/tests/lean/run/unicode.lean deleted file mode 100644 index 0b91f068c7..0000000000 --- a/old_tests/tests/lean/run/unicode.lean +++ /dev/null @@ -1,8 +0,0 @@ -constant N : Type -constant α : N -constant β₁ : N -#check β₁ -constant δ : N -#check δ -constant δ₁₁ : N -#check δ₁₁ diff --git a/old_tests/tests/lean/run/unification_hints.lean b/old_tests/tests/lean/run/unification_hints.lean deleted file mode 100644 index 43e596e3b2..0000000000 --- a/old_tests/tests/lean/run/unification_hints.lean +++ /dev/null @@ -1,39 +0,0 @@ -open list nat - -namespace toy -constants (A : Type.{1}) (f h : A → A) (x y z : A) -attribute [irreducible] -noncomputable definition g (x y : A) : A := f z - -@[unify] -noncomputable definition toy_hint (x y : A) : unification_hint := -{ pattern := g x y ≟ f z, - constraints := [] } - -open tactic - -set_option trace.type_context.unification_hint true - -definition ex1 (a : A) (H : g x y = a) : f z = a := -by do {trace_state, assumption} - -#print ex1 -end toy - -namespace add -constants (n : ℕ) -@[unify] definition add_zero_hint (m n : ℕ) [has_add ℕ] [has_one ℕ] [has_zero ℕ] : unification_hint := -{ pattern := m + 1 ≟ succ n, - constraints := [m ≟ n] } - -attribute [irreducible] has_add.add - -open tactic - - -definition ex2 (H : n + 1 = 0) : succ n = 0 := -by assumption - -#print ex2 - -end add diff --git a/old_tests/tests/lean/run/unify_approx_bug.lean b/old_tests/tests/lean/run/unify_approx_bug.lean deleted file mode 100644 index 5d156ef15c..0000000000 --- a/old_tests/tests/lean/run/unify_approx_bug.lean +++ /dev/null @@ -1,275 +0,0 @@ -open tactic - -/- - Given a metavariable ?m with local context - - (α : Type) (a : α) - - then, the following unification problem should fail - - ?m α =?= ((λ (α : Type) (a : α), α) α a) - - type_context will try the type incorrect assignment - - ?m := λ α', ((λ (α : Type) (a : α), α) α' a) --/ -def ex1 (α : Type) (a : α) : Type → Type := -by do - fail_if_success - (do - mvar1 ← mk_meta_var `(Type → Type), - alpha ← to_expr ```(α), - t ← to_expr ```((λ (α : Type) (a : α), α) α a), - unify (mvar1 alpha) t semireducible tt, -- should fail - exact mvar1), - intros, assumption - -/- - Given metavariable ?m_1 and ?m_2 with local context - - (α : Type) (a : α) - - then, the following unification constrains should be solved - - ?m_1 α =?= id ?m_2 - ?m_2 =?= α - - The first constraint is solved using first-order unification - because we cannot guarantee that the solution will be type correct - for every term we may assign to `?m_2` - - ?m_1 := λ α', id ?m_2[α := α'] - - So, we get `?m_2 := α`. - - Remark: see option c) at workaround A2 described at type_context::process_assignment --/ -def ex2 (α : Type) (a : α) : Type → Type := -by do - mvar1 ← mk_meta_var `(Type → Type), - mvar2 ← mk_meta_var `(Type), - alpha ← to_expr ```(α), - t ← to_expr ```(id %%mvar2), - unify (mvar1 alpha) t semireducible tt, -- first-order unification is used here - unify mvar2 alpha, - exact mvar1 - -/- - Given metavariable ?m_1 and ?m_2 with local context - - (α : Type) (a : α) - - then, the following unification constrains should be solved - - ?m_1 α =?= id ?m_2 - ?m_2 =?= ((λ (α : Type) (a : α), α) α a) - - Again, similarly to the previous example, we use - first-order unification to process the first constraint, - and we get `?m_2 := α`. The second constraint - is satisfied because `((λ (α : Type) (a : α), α) α a)` - is definitionally equal to `α`. --/ -def ex3 (α : Type) (a : α) : Type → Type := -by do - mvar1 ← mk_meta_var `(Type → Type), - mvar2 ← mk_meta_var `(Type), - alpha ← to_expr ```(α), - t ← to_expr ```(id %%mvar2), - unify (mvar1 alpha) t semireducible tt, -- should create an auxiliary mvar and assign it to mvar2 - t ← to_expr ```((λ (α : Type) (a : α), α) α a), - unify mvar2 t semireducible tt, -- should fail `a` is not in the scope - exact mvar1 - -def f (α : Type) (a : α) := α - -constant f' (α : Type) (a : α) : Type - -/- - Given a metavariable ?m with local context - - (α : Type) (a : α) - - then, the following unification problem should fail - - ?m α =?= f α a - - type_context will try the type incorrect assignment - - ?m := λ α', f α' a --/ -def ex4 (α : Type) (a : α) : Type → Type := -by do - fail_if_success - (do - mvar1 ← mk_meta_var `(Type → Type), - alpha ← to_expr ```(α), - t ← to_expr ```(f α a), - unify (mvar1 alpha) t semireducible tt, -- should fail - exact mvar1), - intros, assumption - -/- - Given a metavariable ?m with local context - - (α : Type) (a : α) - - then, the following unification problem should work - - ?m α a =?= f α a - - type_context assigns - - ?m := λ α' a', f α' a' --/ -def ex5 (α : Type) (a : α) : Π A : Type, A → Type := -by do - mvar1 ← mk_meta_var `(Π A : Type, A → Type), - alpha ← to_expr ```(α), - a ← to_expr ```(a), - t ← to_expr ```(f α a), - unify (mvar1 alpha a) t semireducible tt, -- should work - exact mvar1 - -def ex5b (α : Type) (a : α) : Π A : Type, A → Type := -by do - mvar1 ← mk_meta_var `(Π A : Type, A → Type), - alpha ← to_expr ```(α), - a ← to_expr ```(a), - t ← to_expr ```(f' α a), - unify (mvar1 alpha a) t semireducible tt, -- should work - exact mvar1 - -/- - Given metavariable ?m_1 and ?m_2 with local context - - (α : Type) (a : α) - - then, the following unification constrains should be solved - - ?m_1 α =?= id ?m_2 - ?m_2 =?= f α a - - The first constraint is solved using first-order unification. - See option c) at workaround A2 described at type_context::process_assignment. - Then, we get `?m_2 := α`. The second constraint succeeds - because `f α a` is definitionally equal to `α`. --/ -def ex6 (α : Type) (a : α) : Type → Type := -by do mvar1 ← mk_meta_var `(Type → Type), - mvar2 ← mk_meta_var `(Type), - alpha ← to_expr ```(α), - t ← to_expr ```(id %%mvar2), - unify (mvar1 alpha) t semireducible tt, - t ← to_expr ```(f α a), - unify mvar2 t semireducible tt, - exact mvar1 - -/- - Given metavariable ?m_1 and ?m_2 with local context - - (α : Type) (a : α) - - then, the following unification constrains should be solved - - ?m_1 α =?= id ?m_2 - ?m_2 =?= f' α a - - Similar to previous example, but this one fails because - `f' α a` is not definitionally equal to `α`. --/ -def ex6b (α : Type) (a : α) : Type → Type := -by do - fail_if_success - (do mvar1 ← mk_meta_var `(Type → Type), - mvar2 ← mk_meta_var `(Type), - alpha ← to_expr ```(α), - t ← to_expr ```(id %%mvar2), - unify (mvar1 alpha) t semireducible tt, - t ← to_expr ```(f' α a), - unify mvar2 t semireducible tt, - exact mvar1), - intros, assumption - -def g (α : Type) (a b : α) := α - -/- - Given a metavariable ?m with local context - - (α : Type) (a : α) - - then, the following unification problem should fail - - ?m α =?= g α a a - - type_context will try the type incorrect assignment - - ?m := λ α', g α' a a --/ -def ex7 (α : Type) (a : α) : Type → Type := -by do - fail_if_success - (do - mvar1 ← mk_meta_var `(Type → Type), - alpha ← to_expr ```(α), - t ← to_expr ```(g α a a), - unify (mvar1 alpha) t semireducible tt, -- should fail - exact mvar1), - intros, assumption - -constant C (α : Type) (a : α) : Type - -/- - Given a metavariable ?m with local context - - (α : Type) (a : α) (x : C α a) - - then, the following unification problem should fail - - ?m α x =?= α - - type_context will try the type incorrect assignment - - ?m := λ (α' : Type) (x' : C α' a), α' - - type_context detects the problem when it tries to unify the type of `?m` - with type of (λ (α' : Type) (x' : C α' a), α') --/ -def ex8 (α : Type) (a : α) (x : C α a) : Type := -by do - fail_if_success - (do - mvar_type ← to_expr ```(C α a → Type), - mvar_type ← to_expr ```(Type → %%mvar_type), - mvar1 ← mk_meta_var mvar_type, - alpha ← to_expr ```(α), - x ← to_expr ```(x), - unify (mvar1 alpha x) alpha semireducible tt, -- should fail - exact (mvar1 alpha x)), - assumption - -/- - Given a metavariable ?m with local context - - (α : Type) (a : α) - - then, the following unification problem should work - - ?m α =?= a - - type_context assigns - - ?m := λ α', a - - The point of this example is to make sure - future modifications to type_context do not - prevent us from solving valid problems like this one. --/ -def ex9 (α : Type) (a : α) : Type → α := -by do - mvar_type ← to_expr ```(Type → α), - mvar1 ← mk_meta_var mvar_type, - alpha ← to_expr ```(α), - t ← to_expr ```(a), - unify (mvar1 alpha) t semireducible tt, -- should work - exact mvar1 diff --git a/old_tests/tests/lean/run/unify_delta_fo_issue.lean b/old_tests/tests/lean/run/unify_delta_fo_issue.lean deleted file mode 100644 index 5411e123ca..0000000000 --- a/old_tests/tests/lean/run/unify_delta_fo_issue.lean +++ /dev/null @@ -1,43 +0,0 @@ -open tactic - -constant f : nat → nat - -noncomputable def f' (x y : nat) : nat := -f x - -/- - Unifier should be able to solve - - ?m 0 =?= f' 0 b - - by unfolding f' - --/ -noncomputable def ex1 (a b : nat) : nat := -by do - mvar_type ← to_expr ```(nat → nat), - mvar1 ← mk_meta_var mvar_type, - z ← to_expr ```(0), - t ← to_expr ```(f' 0 b), - unify (mvar1 z) t semireducible tt, -- should work, type_context should unfold (f' 0 b) - trace mvar1, - exact (mvar1 z) - -meta def ITac := tactic unit - -/- - Unifier should be able to solve - - ?m unit =?= ITac - - by unfolding ITac --/ -meta def ex2 : Type := -by do - mvar_type ← to_expr ```(Type → Type), - mvar1 ← mk_meta_var mvar_type, - u ← to_expr ```(unit), - t ← to_expr ```(ITac), - unify (mvar1 u) t semireducible tt, -- should work, type_context should unfod ITac - trace mvar1, - exact (mvar1 u) diff --git a/old_tests/tests/lean/run/unify_fo_approx_bug1.lean b/old_tests/tests/lean/run/unify_fo_approx_bug1.lean deleted file mode 100644 index 18ed175445..0000000000 --- a/old_tests/tests/lean/run/unify_fo_approx_bug1.lean +++ /dev/null @@ -1,11 +0,0 @@ -#check ( return (1, 1) : list (nat × nat) ) - -constant A : Type -constant B : Type - -set_option pp.binder_types true -set_option pp.universes true - -#check λ (A : Type) (B : Type) (a : A) (b : B), (return (a, b) : list (A × B)) - -#check λ (A : Type) (B : Type) (C : Type) (a : A) (b : B) (c : C), (return (a, b, a, c) : list (A × B × A × C)) diff --git a/old_tests/tests/lean/run/univ1.lean b/old_tests/tests/lean/run/univ1.lean deleted file mode 100644 index 5095b95be7..0000000000 --- a/old_tests/tests/lean/run/univ1.lean +++ /dev/null @@ -1,27 +0,0 @@ -namespace S1 -axiom I : Type* -definition F (X : Type*) : Type* := (X → Prop) → Prop -axiom {u} unfoldd : I.{u} → F I.{u} -axiom {l} foldd : F I.{l} → I.{l} -axiom iso1 : ∀x, foldd (unfoldd x) = x -end S1 - -namespace S2 -universe variables u -axiom I : Type.{u} -definition F (X : Type*) : Type* := (X → Prop) → Prop -axiom unfoldd : I → F I -axiom foldd : F I → I -axiom iso1 : ∀x, foldd (unfoldd x) = x -end S2 - - -namespace S3 -section - parameter I : Type* - definition F (X : Type*) : Type* := (X → Prop) → Prop - parameter unfoldd : I → F I - parameter foldd : F I → I - parameter iso1 : ∀x, foldd (unfoldd x) = x -end -end S3 diff --git a/old_tests/tests/lean/run/univ2.lean b/old_tests/tests/lean/run/univ2.lean deleted file mode 100644 index 4ade51cf7c..0000000000 --- a/old_tests/tests/lean/run/univ2.lean +++ /dev/null @@ -1,8 +0,0 @@ -axiom I : Type -definition F (X : Type) : Type := (X → Prop) → Prop -axiom unfoldd : I → F I -axiom foldd : F I → I -axiom iso1 : ∀x, foldd (unfoldd x) = x - -theorem iso2 : ∀x, foldd (unfoldd x) = x -:= sorry diff --git a/old_tests/tests/lean/run/univ_bug1.lean b/old_tests/tests/lean/run/univ_bug1.lean deleted file mode 100644 index 5fed27ae57..0000000000 --- a/old_tests/tests/lean/run/univ_bug1.lean +++ /dev/null @@ -1,27 +0,0 @@ ----------------------------------------------------------------------------------------------------- ---- Copyright (c) 2014 Microsoft Corporation. All rights reserved. ---- Released under Apache 2.0 license as described in the file LICENSE. ---- Author: Jeremy Avigad ----------------------------------------------------------------------------------------------------- -open nat - -namespace nsimp --- set_option pp.universes true --- set_option pp.implicit true - --- first define a class of homogeneous equality -class inductive simplifies_to {T : Type} (t1 t2 : T) : Prop -| mk : t1 = t2 → simplifies_to - -theorem get_eq {T : Type} {t1 t2 : T} (C : simplifies_to t1 t2) : t1 = t2 := -simplifies_to.rec (λx, x) C - -theorem infer_eq {T : Type} (t1 t2 : T) {C : simplifies_to t1 t2} : t1 = t2 := -simplifies_to.rec (λx, x) C - -attribute [instance] -theorem simp_app (S T : Type) (f1 f2 : S → T) (s1 s2 : S) - (C1 : simplifies_to f1 f2) (C2 : simplifies_to s1 s2) : simplifies_to (f1 s1) (f2 s2) := -simplifies_to.mk (congr (get_eq C1) (get_eq C2)) - -end nsimp diff --git a/old_tests/tests/lean/run/univ_bug2.lean b/old_tests/tests/lean/run/univ_bug2.lean deleted file mode 100644 index 3b7e3b8391..0000000000 --- a/old_tests/tests/lean/run/univ_bug2.lean +++ /dev/null @@ -1,22 +0,0 @@ ----------------------------------------------------------------------------------------------------- ---- Copyright (c) 2014 Microsoft Corporation. All rights reserved. ---- Released under Apache 2.0 license as described in the file LICENSE. ---- Author: Jeremy Avigad ----------------------------------------------------------------------------------------------------- -open nat - --- first define a class of homogeneous equality -class inductive simplifies_to {T : Type} (t1 t2 : T) : Prop -| mk : t1 = t2 → simplifies_to - -namespace simplifies_to - -theorem get_eq {T : Type} {t1 t2 : T} (C : simplifies_to t1 t2) : t1 = t2 := -simplifies_to.rec (λx, x) C - -attribute [instance] -theorem simp_app (S : Type) (T : Type) (f1 f2 : S → T) (s1 s2 : S) - [C1 : simplifies_to f1 f2] [C2 : simplifies_to s1 s2] : simplifies_to (f1 s1) (f2 s2) := -mk (congr (get_eq C1) (get_eq C2)) - -end simplifies_to diff --git a/old_tests/tests/lean/run/univ_cnstr1.lean b/old_tests/tests/lean/run/univ_cnstr1.lean deleted file mode 100644 index 026d372893..0000000000 --- a/old_tests/tests/lean/run/univ_cnstr1.lean +++ /dev/null @@ -1,13 +0,0 @@ -constant {u₁ u₂ v} M : (Type (max u₁ u₂) → Type v) → Type -attribute [class] M - -constant {u} L : Type u → Type u - -constant {u₁ u₂} I : M.{u₁ u₂ (max u₁ u₂)} L.{max u₁ u₂} - -attribute [instance] I - -constant {u₁ u₂ v} R : ∀ {m : Type (max u₁ u₂) → Type v} [M m] {A : Type u₁} (a : A), m (ulift.{u₂} A) - -noncomputable example : L (ulift.{3} unit) := -R () diff --git a/old_tests/tests/lean/run/univ_delay_thm_bug.lean b/old_tests/tests/lean/run/univ_delay_thm_bug.lean deleted file mode 100644 index 415ef0b3a6..0000000000 --- a/old_tests/tests/lean/run/univ_delay_thm_bug.lean +++ /dev/null @@ -1,2 +0,0 @@ -lemma foo : ∀B A : Type _, ∀a:A, a=a := -let x : ∀A, ∀a:A, a=a := @rfl in λB, x diff --git a/old_tests/tests/lean/run/univ_elab_issue.lean b/old_tests/tests/lean/run/univ_elab_issue.lean deleted file mode 100644 index 528ff5fade..0000000000 --- a/old_tests/tests/lean/run/univ_elab_issue.lean +++ /dev/null @@ -1,2 +0,0 @@ -meta def foo (ex_lst : list name) (e : expr) : list name := -e^.fold [] (λ c _ l, l) diff --git a/old_tests/tests/lean/run/unreachable_cases.lean b/old_tests/tests/lean/run/unreachable_cases.lean deleted file mode 100644 index ee09c3f88b..0000000000 --- a/old_tests/tests/lean/run/unreachable_cases.lean +++ /dev/null @@ -1,19 +0,0 @@ -open nat prod - -inductive ifin : ℕ → Type -- inductively defined fin-type -| fz : Π n, ifin (succ n) -| fs : Π {n}, ifin n → ifin (succ n) - -open ifin - -definition foo {N : Type} : Π{n : ℕ}, N → ifin n → (N × ifin n) -| (succ k) n (fz .(k)) := sorry -| (succ k) n (fs x) := sorry - -definition bar {N : Type} : Π{n : ℕ}, (N × ifin n) → (N × ifin n) -| (succ k) (n, fz .(k)) := sorry -| (succ k) (n, fs x) := sorry - -definition bar2 {N : Type} : Π{n : ℕ}, (N × ifin n) → (N × ifin n) -| (succ k) (n, fz .(k)) := sorry -| (succ k) (n, fs x) := sorry diff --git a/old_tests/tests/lean/run/untrusted_examples.lean b/old_tests/tests/lean/run/untrusted_examples.lean deleted file mode 100644 index b27cedb7b7..0000000000 --- a/old_tests/tests/lean/run/untrusted_examples.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -set_option pp.all true - -meta example (m1 : tactic nat) (m2 : nat → tactic bool) : true := -by do - m1 ← get_local `m1, - m2 ← get_local `m2, - b ← mk_app `has_bind.bind [m1, m2], - trace b, - constructor diff --git a/old_tests/tests/lean/run/user_simp_attributes.lean b/old_tests/tests/lean/run/user_simp_attributes.lean deleted file mode 100644 index bdeaaaf3f3..0000000000 --- a/old_tests/tests/lean/run/user_simp_attributes.lean +++ /dev/null @@ -1,37 +0,0 @@ -run_cmd mk_simp_attr `boo -run_cmd mk_simp_attr `bla - -constant f : nat → nat - -set_option trace.user_attributes_cache true - -@[boo] lemma ex : ∀ x, f x = 1 := -sorry - -example : f 0 = 1 := -by simp with boo - -#print "----" - -example : f 2 = 1 := -by simp with boo - -#print "----" - -constant g : nat → nat - -@[boo] lemma ex2 : ∀ x, g x = x := -sorry - -constant h : nat → nat - -@[bla] lemma ex3 : ∀ x, h x = x := -sorry - -example : f 2 = g 1 := -by simp with boo - -#print "-------" - -example : f 2 = h (g 1) := -by simp with boo bla diff --git a/old_tests/tests/lean/run/using_smt1.lean b/old_tests/tests/lean/run/using_smt1.lean deleted file mode 100644 index d66cfce35b..0000000000 --- a/old_tests/tests/lean/run/using_smt1.lean +++ /dev/null @@ -1,53 +0,0 @@ -open smt_tactic tactic - -lemma ex1 (a b c : nat) : a = c → a = b → b = c := -by using_smt intros - -set_option pp.all true - -lemma ex2 (a b c : nat) : a > nat.zero → a = c → a = b → b = c := -by using_smt intros - -lemma ex3 (p q r : Prop) : p → q → ¬p → r := -by using_smt intros - -lemma ex4 (a b c : nat) : a > nat.zero → 0 < a := -by simp [(>)]; using_smt intros - -lemma ex5 (a b c d : nat) : a ≠ d → a = b ∧ b = c → a = c := -by using_smt intros - -set_option pp.all false - -lemma ex6 (f : nat → nat) (a b c : nat) : - f a = 0 → - f b = 1 → - f a = f b ∨ f a = c → - c = 0 := -by using_smt intros - -lemma ex7 (f : nat → nat) (a b c d e: nat) : - f a = 0 → - f a = d → - f b = e → - f b = 1 → - d = e ∨ f a = c → - c = 0 := -by using_smt intros - -lemma ex8 (f : bool → bool) (a b c : bool) : - f a = ff → - f b = tt → - f a = f b ∨ f a = c → - c = ff := -by using_smt intros - -lemma ex9 (f : list nat → list nat) (a b c : list nat) : - f a = [] → - f b = [0, 1] → - f a = f b ∨ f a = c → - c = [] := -by using_smt intros - -lemma ex10 (a b c d e : int) : a = b → b ≠ c → (a = c ∨ d = e) → d = e := -by using_smt intros diff --git a/old_tests/tests/lean/run/using_smt2.lean b/old_tests/tests/lean/run/using_smt2.lean deleted file mode 100644 index b09ca63a89..0000000000 --- a/old_tests/tests/lean/run/using_smt2.lean +++ /dev/null @@ -1,40 +0,0 @@ -open smt_tactic - -lemma ex (p q : Prop) : p → q → p := -by using_smt $ intros - -lemma ex2 (p q : Prop) : ¬ p → q → ¬ p := -by using_smt $ intros - -lemma ex3 (p q : Prop) : p → (p ↔ q) → q := -by using_smt $ intros - -lemma ex4 (p q : Prop) : p → (p → q) → q := -by using_smt $ intros - -lemma ex5 (p q : Prop) : (p → q) → p → q := -by using_smt $ intros - -lemma ex6 (p q r : Prop) : (p → r → q) → r → p → q := -by using_smt $ intros - -lemma ex7 (p q r s t o : Prop) : (p ∨ t → o ∨ r → q ∧ s) → r → p → q := -by using_smt $ intros - -lemma ex8 (p q : Prop) (a b c : nat) : (p ∨ q → a = b ∨ a = c) → a ≠ b → p → c = a := -by using_smt $ intros - -lemma ex9 (p q : Prop) [decidable p] [decidable q] (a b c : nat) : (if p ∨ q then (a = b ∨ a = c) else (a = 0)) → p → a ≠ b → c = a := -by using_smt $ intros - -lemma ex10 (p q : Prop) : p → (p ↔ ¬q) → ¬q := -by using_smt $ intros - -lemma ex11 (p q r s : Prop) : (p ∨ q → not (r ∨ s)) → p → not r := -by using_smt $ intros - -lemma ex12 (p q r : Prop) (a b c : nat): (p → q ∧ r ∧ a = b + c) → p → (c + b = a ∧ r) := -by using_smt $ intros - -lemma ex13 (a b c d : nat) : b = d → c = d → (if a > 10 then b else c) = b := -by using_smt $ intros diff --git a/old_tests/tests/lean/run/using_smt3.lean b/old_tests/tests/lean/run/using_smt3.lean deleted file mode 100644 index da8cd68c8b..0000000000 --- a/old_tests/tests/lean/run/using_smt3.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -lemma ex1 : let x := 1 in ∀ y, x = y → y = 1 := -by using_smt $ smt_tactic.intros >> get_local `x >>= (fun a, trace a) - -open tactic_result - -meta def fail_if_success {α : Type} (t : smt_tactic α) : smt_tactic unit := -⟨λ ss ts, match t.run ss ts with -| success _ _ := failed ts -| exception _ _ _ := success ((), ss) ts -end⟩ - -def my_smt_config : smt_config := -{ pre_cfg := { zeta := tt } } - -lemma ex2 : let x := 1 in ∀ y, x = y → y = 1 := -by using_smt_with my_smt_config $ smt_tactic.intros >> fail_if_success (get_local `x) >> return () diff --git a/old_tests/tests/lean/run/vars_anywhere.lean b/old_tests/tests/lean/run/vars_anywhere.lean deleted file mode 100644 index e3529b2599..0000000000 --- a/old_tests/tests/lean/run/vars_anywhere.lean +++ /dev/null @@ -1,9 +0,0 @@ -variable {A : Type} - -#check @id - -inductive List -| nil : List -| cons : A → List → List - -#check @List.cons diff --git a/old_tests/tests/lean/run/vector2.lean b/old_tests/tests/lean/run/vector2.lean deleted file mode 100644 index 6618114fa0..0000000000 --- a/old_tests/tests/lean/run/vector2.lean +++ /dev/null @@ -1,13 +0,0 @@ -namespace Ex -open nat - -inductive vector (A : Type) : nat → Type -| vnil : vector nat.zero -| vcons : Π {n : nat}, A → vector n → vector (succ n) - -namespace vector - theorem vcons.inj₁ {A : Type} {n : nat} (a₁ a₂ : A) (v₁ v₂ : vector A n) : vcons a₁ v₁ = vcons a₂ v₂ → a₁ = a₂ := - assume h, vector.no_confusion h (λ n h t, h) - -end vector -end Ex diff --git a/old_tests/tests/lean/run/vector3.lean b/old_tests/tests/lean/run/vector3.lean deleted file mode 100644 index 2563fdd40c..0000000000 --- a/old_tests/tests/lean/run/vector3.lean +++ /dev/null @@ -1,15 +0,0 @@ -namespace Ex -open nat - -inductive vector (A : Type) : nat → Type -| vnil : vector nat.zero -| vcons : Π {n : nat}, A → vector n → vector (succ n) - -namespace vector - theorem vcons.inj₁ {A : Type} {n : nat} (a₁ a₂ : A) (v₁ v₂ : vector A n) : vcons a₁ v₁ = vcons a₂ v₂ → a₁ = a₂ := - assume h, vector.no_confusion h (λ n h t, h) - - theorem vcons.inj₂ {A : Type} {n : nat} (a₁ a₂ : A) (v₁ v₂ : vector A n) : vcons a₁ v₁ = vcons a₂ v₂ → v₁ == v₂ := - assume h, vector.no_confusion h (λ n h t, t) -end vector -end Ex diff --git a/old_tests/tests/lean/run/vm_check_bug.lean b/old_tests/tests/lean/run/vm_check_bug.lean deleted file mode 100644 index 129047de9d..0000000000 --- a/old_tests/tests/lean/run/vm_check_bug.lean +++ /dev/null @@ -1,7 +0,0 @@ -def f : nat → nat → nat -| (x+1) (y+1) := f (x+100000000) y -| (x+1) 0 := x -| 0 (y+1) := 1 -| 0 0 := 1 - -#eval f 1 1000 diff --git a/old_tests/tests/lean/run/vm_eval1.lean b/old_tests/tests/lean/run/vm_eval1.lean deleted file mode 100644 index 6b37423aeb..0000000000 --- a/old_tests/tests/lean/run/vm_eval1.lean +++ /dev/null @@ -1,34 +0,0 @@ -open bool nat - --- set_option trace.compiler.code_gen true - -attribute [reducible] -definition foo (b : bool) : Type := -cond b nat (nat → nat) - -definition bla (b : bool) : foo b → nat := -bool.cases_on b (λ f, f 100) (λ n, n) - -definition of_dec (p : Prop) [h : decidable p] : bool := -decidable.cases_on h (λ h, ff) (λ h, tt) - -definition boo (n : nat) := bla (of_dec (n > 10)) - -definition x : nat := 20 - -definition tst (b : bool) (a : nat) : foo b := -bool.cases_on b (λ n : nat, n * a) a - -#reduce bla ff (λ n : nat, n+10) -#reduce bla tt x -#reduce boo 11 x -#reduce boo 9 (λ n : nat, n+20) -#reduce tst ff 4 10 -#reduce tst tt 3 -#print "---------" -#eval bla ff (λ n : nat, n+10) -#eval bla tt x -#eval boo 11 x -#eval boo 9 (λ n : nat, n+20) -#eval tst ff 4 10 -#eval tst tt 3 diff --git a/old_tests/tests/lean/run/wfrec1.lean b/old_tests/tests/lean/run/wfrec1.lean deleted file mode 100644 index 281240429e..0000000000 --- a/old_tests/tests/lean/run/wfrec1.lean +++ /dev/null @@ -1,17 +0,0 @@ -private def S := psigma (λ _ : nat, nat) -private def R : S → S → Prop := psigma.skip_left nat (<) -private def Rwf : well_founded R := - psigma.skip_left_wf nat nat.lt_wf - -private def f_aux : ∀ (p₁ : S), (∀ p₂ : S, R p₂ p₁ → nat) → nat -| ⟨n, m+1⟩ F := F ⟨n+10, m - n⟩ (psigma.mk_skip_left _ _ (nat.sub_lt_succ _ _)) -| ⟨n, 0⟩ F := n - -def f (n m : nat) : nat := -well_founded.fix Rwf f_aux ⟨n, m⟩ - -lemma f.eq_1 (n m : nat) : f n (m+1) = f (n+10) (m - n) := -well_founded.fix_eq Rwf f_aux ⟨n, m+1⟩ - -lemma f.eq_2 (n m : nat) : f n 0 = n := -well_founded.fix_eq Rwf f_aux ⟨n, 0⟩ diff --git a/old_tests/tests/lean/run/whenIO.lean b/old_tests/tests/lean/run/whenIO.lean deleted file mode 100644 index 4656f58c77..0000000000 --- a/old_tests/tests/lean/run/whenIO.lean +++ /dev/null @@ -1,8 +0,0 @@ -import system.io -open io - -def iowhen (b : bool) (a : io unit) : io unit := -if b = tt then a else return () - -#eval iowhen tt (put_str "hello\n") -#eval iowhen ff (put_str "error\n") diff --git a/old_tests/tests/lean/run/whnf_mvar.lean b/old_tests/tests/lean/run/whnf_mvar.lean deleted file mode 100644 index 845783682e..0000000000 --- a/old_tests/tests/lean/run/whnf_mvar.lean +++ /dev/null @@ -1,21 +0,0 @@ -open tactic - -example (x : nat) : true := -by do - m ← mk_mvar, - x ← get_local `x, - unify m x, - guard (m ≠ x), - m' ← whnf m, - guard (m' = x), - constructor - -example (x : nat) : true := -by do - m ← mk_mvar, - z ← to_expr ``(0), - e ← to_expr ``(@nat.rec (λ _, bool) ff (λ _ _, tt) %%m) tt ff, - unify m z, - e' ← whnf e, - guard (e' = `(ff)), - constructor diff --git a/old_tests/tests/lean/run/whnfinst.lean b/old_tests/tests/lean/run/whnfinst.lean deleted file mode 100644 index a0d119f707..0000000000 --- a/old_tests/tests/lean/run/whnfinst.lean +++ /dev/null @@ -1,15 +0,0 @@ -open decidable - -attribute [reducible] -definition decidable_bin_rel {A : Type} (R : A → A → Prop) := Πx y, decidable (R x y) - -section - variable {A : Type} - variable (R : A → A → Prop) - - theorem tst1 (H : Πx y, decidable (R x y)) (a b c : A) : decidable (R a b ∧ R b a) := - by tactic.apply_instance - - theorem tst2 (H : decidable_bin_rel R) (a b c : A) : decidable (R a b ∧ R b a ∨ R b b) := - by tactic.apply_instance -end diff --git a/old_tests/tests/lean/run/with_cases1.lean b/old_tests/tests/lean/run/with_cases1.lean deleted file mode 100644 index 88da611668..0000000000 --- a/old_tests/tests/lean/run/with_cases1.lean +++ /dev/null @@ -1,41 +0,0 @@ -example (n : nat) (m : nat) : n > m → m < n := -begin - with_cases { revert m, induction n }, - case nat.zero : m' { show 0 > m' → m' < 0, admit }, - case nat.succ : n' ih m' { show nat.succ n' > m' → m' < nat.succ n', admit } -end - -example (n : nat) (m : nat) : n > m → m < n := -begin - with_cases { revert m, induction n }, - case nat.zero { show ∀ m, 0 > m → m < 0, admit }, - case nat.succ { show ∀ m, nat.succ n_n > m → m < nat.succ n_n, admit } -end - -example (n : nat) (m : nat) : n > m → m < n := -begin - with_cases { induction n generalizing m }, - case nat.zero { show 0 > m → m < 0, admit }, - case nat.succ { show nat.succ n_n > m → m < nat.succ n_n, admit } -end - -example (n : nat) (m : nat) : n > m → m < n := -begin - with_cases { induction n generalizing m }, - case nat.zero : m' { show 0 > m' → m' < 0, admit }, - case nat.succ : n' ih m' { show nat.succ n' > m' → m' < nat.succ n', admit } -end - -example (n : nat) (m : nat) : n > m → m < n := -begin - with_cases { induction n generalizing m }, - case nat.zero : m' { show 0 > m' → m' < 0, admit }, - case nat.succ : n' ih { show nat.succ n' > m → m < nat.succ n', admit } -end - -example (n : nat) (m : nat) : n > m → m < n := -begin - with_cases { induction n generalizing m }, - case nat.zero { show 0 > m → m < 0, admit }, - case nat.succ : n' ih { show nat.succ n' > m → m < nat.succ n', admit } -end diff --git a/old_tests/tests/lean/run/with_update_class.lean b/old_tests/tests/lean/run/with_update_class.lean deleted file mode 100644 index 749ea65f09..0000000000 --- a/old_tests/tests/lean/run/with_update_class.lean +++ /dev/null @@ -1,10 +0,0 @@ -universe variables u - -class foo (A : Type u) := -(x : A) - -class bla (A : Type u) extends foo A := -(y : nat) - -def ex {A : Type u} [s : foo A] : bla A := -{ s with y := 0 } diff --git a/old_tests/tests/lean/run/xrewrite1.lean b/old_tests/tests/lean/run/xrewrite1.lean deleted file mode 100644 index a36137fdb5..0000000000 --- a/old_tests/tests/lean/run/xrewrite1.lean +++ /dev/null @@ -1,10 +0,0 @@ -open nat tactic -constant zeroadd (a : nat) : 0 + a = a - -meta definition xrewrite (th_name : name) : tactic unit := -do th ← mk_const th_name, - rewrite_target th, - try reflexivity - -example (a : nat) : (0 + a) + (0 + a) + (0 + a) = a + a + a := -by xrewrite `zeroadd diff --git a/old_tests/tests/lean/sec.lean b/old_tests/tests/lean/sec.lean deleted file mode 100644 index 599b3f0371..0000000000 --- a/old_tests/tests/lean/sec.lean +++ /dev/null @@ -1,11 +0,0 @@ --- -open prod - -section - variable A : Type - variable a : A - variable A : Type - variable b : A - - definition foo := a -end diff --git a/old_tests/tests/lean/sec.lean.expected.out b/old_tests/tests/lean/sec.lean.expected.out deleted file mode 100644 index e49d1af06a..0000000000 --- a/old_tests/tests/lean/sec.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -sec.lean:7:11: error: invalid parameter/variable declaration, 'A' has already been declared diff --git a/old_tests/tests/lean/sec3.lean b/old_tests/tests/lean/sec3.lean deleted file mode 100644 index e378680522..0000000000 --- a/old_tests/tests/lean/sec3.lean +++ /dev/null @@ -1,6 +0,0 @@ -section - parameter A : Type - definition tst (a : A) := a - set_option pp.universes true - #check tst.{1} -end diff --git a/old_tests/tests/lean/sec3.lean.expected.out b/old_tests/tests/lean/sec3.lean.expected.out deleted file mode 100644 index 1bee900b1f..0000000000 --- a/old_tests/tests/lean/sec3.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -sec3.lean:5:9: error: invalid use of explicit universe parameter, identifier is a variable, parameter or a constant bound to parameters in a section -tst : A → A diff --git a/old_tests/tests/lean/sec_param_pp.lean b/old_tests/tests/lean/sec_param_pp.lean deleted file mode 100644 index 6b2e078238..0000000000 --- a/old_tests/tests/lean/sec_param_pp.lean +++ /dev/null @@ -1,20 +0,0 @@ -section - parameters {A : Type*} (a : A) - variable f : A → A → A - - definition id2 : A := a - #check id2 - - - definition pr (b : A) : A := f a b - - #check pr f id2 - - set_option pp.universes true - - #check pr f id2 - - definition pr2 (B : Type*) (b : B) : A := a - - #check pr2 nat 10 -end diff --git a/old_tests/tests/lean/sec_param_pp.lean.expected.out b/old_tests/tests/lean/sec_param_pp.lean.expected.out deleted file mode 100644 index 505ec31c91..0000000000 --- a/old_tests/tests/lean/sec_param_pp.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -id2 : A -pr f id2 : A -pr f id2 : A -pr2.{0} ℕ 10 : A diff --git a/old_tests/tests/lean/sec_param_pp2.lean b/old_tests/tests/lean/sec_param_pp2.lean deleted file mode 100644 index 770b29f4d9..0000000000 --- a/old_tests/tests/lean/sec_param_pp2.lean +++ /dev/null @@ -1,17 +0,0 @@ -section - parameters {A : Type} (a : A) - - section - parameters {B : Type} (b : B) - - variable f : A → B → A - - definition id2 := f a b - - #check id2 - set_option pp.universes true - #check id2 - end - #check id2 -end -#check id2 diff --git a/old_tests/tests/lean/sec_param_pp2.lean.expected.out b/old_tests/tests/lean/sec_param_pp2.lean.expected.out deleted file mode 100644 index bf212bb403..0000000000 --- a/old_tests/tests/lean/sec_param_pp2.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -id2 : (A → B → A) → A -id2 : (A → B → A) → A -id2 : ?M_1 → (A → ?M_1 → A) → A -id2 : ?M_1 → Π {B : Type}, B → (?M_1 → B → ?M_1) → ?M_1 diff --git a/old_tests/tests/lean/server/crash1.input b/old_tests/tests/lean/server/crash1.input deleted file mode 100644 index 8b19434204..0000000000 --- a/old_tests/tests/lean/server/crash1.input +++ /dev/null @@ -1,6 +0,0 @@ -{"command":"sync","file_name":"c:/Users/leonardo/projects/lean/build/debug/tst.lean","content":"def f : nat → nat\n| 0 := 0\n| (n+1) := f n + f n\n\nopen tactic\n\n\n\nmeta def tac : tactic unit :=\ndo x ← target,\n y ← infer_type x >>= whnf,\n trace y,\n return ()\n"} -{"command":"check"} -{"command":"sync","file_name":"c:/Users/leonardo/projects/lean/build/debug/tst.lean","content":"def f : nat → nat\n| 0 := 0\n| (n+1) := f n + f n\n\nopen tactic\n\nset_option trace.compiler\n\nmeta def tac : tactic unit :=\ndo x ← target,\n y ← infer_type x >>= whnf,\n trace y,\n return ()\n"} -{"command":"check"} -{"command":"sync","file_name":"c:/Users/leonardo/projects/lean/build/debug/tst.lean","content":"def f : nat → nat\n| 0 := 0\n| (n+1) := f n + f n\n\nopen tactic\n\nset_option trace.compiler true\n\nmeta def tac : tactic unit :=\ndo x ← target,\n y ← infer_type x >>= whnf,\n trace y,\n return ()\n"} -{"command":"check"} diff --git a/old_tests/tests/lean/set_attr1.lean b/old_tests/tests/lean/set_attr1.lean deleted file mode 100644 index 567145adb3..0000000000 --- a/old_tests/tests/lean/set_attr1.lean +++ /dev/null @@ -1,16 +0,0 @@ -open tactic - -constant f : nat → nat -constant foo : ∀ n, f n = n + 1 -constant addz : ∀ n, n + 0 = n - -definition ex1 (n : nat) : f n + 0 = n + 1 := -by do - set_basic_attribute `simp `foo ff, - set_basic_attribute `simp `addz ff, - `[simp] - -definition ex2 (n : nat) : f n + 0 = n + 1 := -by do - unset_attribute `simp `foo, - `[simp] -- should fail since we remove [simp] attribute from `foo` diff --git a/old_tests/tests/lean/set_attr1.lean.expected.out b/old_tests/tests/lean/set_attr1.lean.expected.out deleted file mode 100644 index a5e7ab33f3..0000000000 --- a/old_tests/tests/lean/set_attr1.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -set_attr1.lean:14:3: error: tactic failed, there are unsolved goals -state: -n : ℕ -⊢ f n = n + 1 diff --git a/old_tests/tests/lean/set_of.lean b/old_tests/tests/lean/set_of.lean deleted file mode 100644 index 213e3220ac..0000000000 --- a/old_tests/tests/lean/set_of.lean +++ /dev/null @@ -1,9 +0,0 @@ -#check {x : nat | x > 0} -#check {x | x > 0} -#check {p : nat × nat | p.1 > p.2 } - -set_option pp.binder_types false - -#check {x : nat | x > 0} -#check {x | x > 0} -#check {p : nat × nat | p.1 > p.2 } diff --git a/old_tests/tests/lean/set_of.lean.expected.out b/old_tests/tests/lean/set_of.lean.expected.out deleted file mode 100644 index f2ed5cb2d6..0000000000 --- a/old_tests/tests/lean/set_of.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -{x : ℕ | x > 0} : set ℕ -{x : ℕ | x > 0} : set ℕ -{p : ℕ × ℕ | p.fst > p.snd} : set (ℕ × ℕ) -{x | x > 0} : set ℕ -{x | x > 0} : set ℕ -{p | p.fst > p.snd} : set (ℕ × ℕ) diff --git a/old_tests/tests/lean/set_opt_tac.lean b/old_tests/tests/lean/set_opt_tac.lean deleted file mode 100644 index 62db3b67f2..0000000000 --- a/old_tests/tests/lean/set_opt_tac.lean +++ /dev/null @@ -1,15 +0,0 @@ -open tactic bool - -example (a b : nat) (H : a + b = 0) : a = a := -by do - H ← get_local `H, - t ← infer_type H, - trace t, - set_bool_option `pp.all tt, - trace "after pp.all true", - trace t, - rfl_e ← mk_const `rfl, - apply rfl_e - -#print "set_bool_option tactic does not affect other commands" -#check (0:nat) + 1 diff --git a/old_tests/tests/lean/set_opt_tac.lean.expected.out b/old_tests/tests/lean/set_opt_tac.lean.expected.out deleted file mode 100644 index 0ad38d56d1..0000000000 --- a/old_tests/tests/lean/set_opt_tac.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -a + b = 0 -after pp.all true -@eq.{1} nat (@has_add.add.{0} nat nat.has_add a b) (@has_zero.zero.{0} nat nat.has_zero) -set_bool_option tactic does not affect other commands -0 + 1 : ℕ diff --git a/old_tests/tests/lean/shadow.lean b/old_tests/tests/lean/shadow.lean deleted file mode 100644 index 0ce3d00fbf..0000000000 --- a/old_tests/tests/lean/shadow.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat - -variable a : nat - --- The variable 'a' in the following definition is not the variable 'a' above -definition tadd : nat → nat → nat -| 0 b := b -| (succ a) b := succ (tadd a b) diff --git a/old_tests/tests/lean/shadow.lean.expected.out b/old_tests/tests/lean/shadow.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/showenv.l b/old_tests/tests/lean/showenv.l deleted file mode 100644 index 24df3df1fe..0000000000 --- a/old_tests/tests/lean/showenv.l +++ /dev/null @@ -1,3 +0,0 @@ -set_option pp::colors false -print "===BEGIN ENVIRONMENT===" -print environment diff --git a/old_tests/tests/lean/simp_except.lean b/old_tests/tests/lean/simp_except.lean deleted file mode 100644 index c53f70dbbc..0000000000 --- a/old_tests/tests/lean/simp_except.lean +++ /dev/null @@ -1,34 +0,0 @@ -constant f : nat → nat - -namespace foo -axiom fax : ∀ x, f x = x -end foo - -attribute [simp] foo.fax - -example (a : nat) : f a = a := -by simp -- works - -example (a : nat) : f a = a := -by simp [-fax] -- Error: unknown identifier 'fax' - -example (a : nat) : f a = a := -by simp [-foo.fax] -- Error: simplify failed to simplify - -section -open foo -example (a : nat) : f a = a := -by simp [-fax] -- Error: simplify failed to simplify -end - -example (a : nat) (h : a = 0) : a = 0 := -by simp [-h] -- Error: invalid local exception h, '*' was not used - -example (a : nat) (h : a = 0) : a = 0 := -by simp [*, -h] -- Error: simplify failed to simplify - -example (a : nat) (h : a = 0) : a = 0 := -by simp [*] -- works - -example (a b : nat) (h : b = 0) (h₁ : a = b) (h₂ : b = a) : b = 0 := -by simp [*, -h₁, -h₂] -- we can prevent loops by removing "bad" hypotheses diff --git a/old_tests/tests/lean/simp_except.lean.expected.out b/old_tests/tests/lean/simp_except.lean.expected.out deleted file mode 100644 index 6b8b502ecf..0000000000 --- a/old_tests/tests/lean/simp_except.lean.expected.out +++ /dev/null @@ -1,22 +0,0 @@ -simp_except.lean:13:3: error: unknown identifier 'fax' -state: -a : ℕ -⊢ f a = a -simp_except.lean:16:3: error: simplify tactic failed to simplify -state: -a : ℕ -⊢ f a = a -simp_except.lean:21:3: error: simplify tactic failed to simplify -state: -a : ℕ -⊢ f a = a -simp_except.lean:25:3: error: invalid local exception h, '*' was not used -state: -a : ℕ, -h : a = 0 -⊢ a = 0 -simp_except.lean:28:3: error: simplify tactic failed to simplify -state: -a : ℕ, -h : a = 0 -⊢ a = 0 diff --git a/old_tests/tests/lean/slow/test_single.sh b/old_tests/tests/lean/slow/test_single.sh deleted file mode 100755 index 0cce45ba64..0000000000 --- a/old_tests/tests/lean/slow/test_single.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -f=$2 -echo "-- testing $f" -if "$LEAN" "$f"; then - echo "-- checked" -else - echo "failed $f" - exit 1 -fi diff --git a/old_tests/tests/lean/slow_error.lean b/old_tests/tests/lean/slow_error.lean deleted file mode 100644 index a760e3e97e..0000000000 --- a/old_tests/tests/lean/slow_error.lean +++ /dev/null @@ -1,4 +0,0 @@ -variable a : user_attribute string -variable b : string - -#check a = b diff --git a/old_tests/tests/lean/slow_error.lean.expected.out b/old_tests/tests/lean/slow_error.lean.expected.out deleted file mode 100644 index f53e302385..0000000000 --- a/old_tests/tests/lean/slow_error.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -slow_error.lean:4:9: error: type mismatch at application - a = b -term - b -has type - string -but is expected to have type - (user_attribute string) diff --git a/old_tests/tests/lean/smart_unfolding.lean b/old_tests/tests/lean/smart_unfolding.lean deleted file mode 100644 index 58ab4ef7b6..0000000000 --- a/old_tests/tests/lean/smart_unfolding.lean +++ /dev/null @@ -1,5 +0,0 @@ -constant n : nat -#reduce n + (nat.succ n) - -set_option type_context.smart_unfolding false -#reduce n + (nat.succ n) diff --git a/old_tests/tests/lean/smart_unfolding.lean.expected.out b/old_tests/tests/lean/smart_unfolding.lean.expected.out deleted file mode 100644 index f1243c7056..0000000000 --- a/old_tests/tests/lean/smart_unfolding.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -nat.succ (nat.add n n) -nat.succ - ((nat.rec ⟨λ (a : ℕ), a, punit.star⟩ - (λ (n : ℕ) - (ih : pprod (ℕ → ℕ) (nat.rec punit (λ (n : ℕ) (ih : Type), pprod (pprod (ℕ → ℕ) ih) punit) n)), - ⟨λ (a : ℕ), nat.succ (ih.fst a), ⟨ih, punit.star⟩⟩) - n).fst - n) diff --git a/old_tests/tests/lean/smt_begin_end1.lean b/old_tests/tests/lean/smt_begin_end1.lean deleted file mode 100644 index 9db40378ed..0000000000 --- a/old_tests/tests/lean/smt_begin_end1.lean +++ /dev/null @@ -1,36 +0,0 @@ -constant p : nat → nat → Prop -constant f : nat → nat -axiom pf (a : nat) : p (f a) (f a) → p a a - -example (a b c : nat) : a = b → p (f a) (f b) → p a b := -begin [smt] - intros, - have h : p (f a) (f a), - trace_state, - add_fact (pf _ h) -end - -example (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → ¬p ∨ ¬q → false := -begin [smt] - by_cases p, -end - -example (a b c : nat) : a = b → p (f a) (f b) → p a b := -begin - intro h, - subst h, - begin [smt] - intros, - have h₁ : p (f a) (f a), - trace_state, - add_fact (pf _ h₁) - end -end - -example (p q : Prop) : p ∨ q → p ∨ ¬q → ¬p ∨ q → p ∧ q := -begin [smt] - intros, - tactic.split, - { by_cases p }, - { by_cases p } -end diff --git a/old_tests/tests/lean/smt_begin_end1.lean.expected.out b/old_tests/tests/lean/smt_begin_end1.lean.expected.out deleted file mode 100644 index 3f023d9132..0000000000 --- a/old_tests/tests/lean/smt_begin_end1.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -a b c : ℕ, -a_1 : a = b, -a_2 : p (f a) (f b), -h : p (f a) (f a) -facts: {p (f a) (f a), p (f a) (f b), a = b} -equalities: {{b, a}, {f a, f b}} -⊢ p a b -a c : ℕ, -a_1 h₁ : p (f a) (f a) -facts: {p (f a) (f a)} -⊢ p a a diff --git a/old_tests/tests/lean/string_imp.lean b/old_tests/tests/lean/string_imp.lean deleted file mode 100644 index d5fb520956..0000000000 --- a/old_tests/tests/lean/string_imp.lean +++ /dev/null @@ -1,15 +0,0 @@ -#eval ("abc" ++ "cde").length -#eval "abc".pop_back -#eval "".pop_back -#eval "abcd".pop_back -#eval ("abcd".mk_iterator.nextn 2).remaining_to_string -#eval ("abcd".mk_iterator.nextn 2).prev_to_string -#eval ("abcd".mk_iterator.nextn 10).remaining_to_string -#eval ("abcd".mk_iterator.nextn 10).prev_to_string -#eval "foo.lean".popn_back 5 -#eval "foo.lean".backn 5 -#eval "αβγ".pop_back -#eval "αβ".length -#eval ("αβcc".mk_iterator.next.insert "_foo_").to_string -#eval ("αβcc".mk_iterator.next.next.insert "_foo_").to_string -#eval ("αβcc".mk_iterator.next.next.prev.insert "_foo_").to_string diff --git a/old_tests/tests/lean/string_imp.lean.expected.out b/old_tests/tests/lean/string_imp.lean.expected.out deleted file mode 100644 index a17d310596..0000000000 --- a/old_tests/tests/lean/string_imp.lean.expected.out +++ /dev/null @@ -1,15 +0,0 @@ -6 -"ab" -"" -"abc" -"cd" -"ab" -"" -"abcd" -"foo" -".lean" -"αβ" -2 -"α_foo_βcc" -"αβ_foo_cc" -"α_foo_βcc" diff --git a/old_tests/tests/lean/string_imp2.lean b/old_tests/tests/lean/string_imp2.lean deleted file mode 100644 index a257235dc1..0000000000 --- a/old_tests/tests/lean/string_imp2.lean +++ /dev/null @@ -1,73 +0,0 @@ -def f (s : string) : string := -s ++ " " ++ s - -def g (s : string) : string := -s.push ' ' ++ s.push '-' - -def h (s : string) : string := -let it₁ := s.mk_iterator in -let it₂ := it₁.next in -it₁.remaining_to_string ++ "-" ++ it₂.remaining_to_string - -def r (s : string) : string := -let it₁ := s.mk_iterator.to_end in -let it₂ := it₁.prev in -it₁.prev_to_string ++ "-" ++ it₂.prev_to_string - -def s (s : string) : string := -let it₁ := s.mk_iterator.to_end in -let it₂ := it₁.prev in -(it₁.insert "abc").to_string ++ (it₂.insert "de").to_string - -#eval "hello" ++ "hello" -#eval f "hello" -#eval (f "αβ").length -#eval "hello".to_list -#eval "αβ".to_list -#eval "".to_list -#eval "αβγ".to_list -#eval "αβγ".fold [] (λ r c, c::r) -#eval "".fold 0 (λ r c, r+1) -#eval "αβγ".fold 0 (λ r c, r+1) -#eval "αβγ".mk_iterator.1 -#eval "αβγ".mk_iterator.next.1 -#eval "αβγ".mk_iterator.next.next.1 -#eval "αβγ".mk_iterator.next.2 -#eval "αβ".1 -#eval string.empty -#eval "αβ".push 'a' -#eval g "α" -#eval "".mk_iterator.curr -#eval ("αβγ".mk_iterator.set_curr 'a').to_string -#eval (("αβγ".mk_iterator.set_curr 'a').next.set_curr 'b').to_string -#eval ((("αβγ".mk_iterator.set_curr 'a').next.set_curr 'b').next.set_curr 'c').to_string -#eval ((("αβγ".mk_iterator.set_curr 'a').next.set_curr 'b').prev.set_curr 'c').to_string -#eval ("abc".mk_iterator.set_curr '0').to_string -#eval (("abc".mk_iterator.set_curr '0').next.set_curr '1').to_string -#eval ((("abc".mk_iterator.set_curr '0').next.set_curr '1').next.set_curr '2').to_string -#eval ((("abc".mk_iterator.set_curr '0').next.set_curr '1').prev.set_curr '2').to_string -#eval ("abc".mk_iterator.set_curr (char.of_nat 955)).to_string -#eval h "abc" -#eval "abc".mk_iterator.remaining_to_string -#eval ("a".push (char.of_nat 0)) ++ "bb" -#eval (("a".push (char.of_nat 0)) ++ "αb").length -#eval r "abc" -#eval "abc".mk_iterator.to_end.prev_to_string -#eval "".mk_iterator.has_next -#eval "a".mk_iterator.has_next -#eval "a".mk_iterator.next.has_next -#eval "".mk_iterator.has_prev -#eval "a".mk_iterator.next.has_prev -#eval "αβ".mk_iterator.next.has_prev -#eval "αβ".mk_iterator.next.prev.has_prev -#eval ("αβ".mk_iterator.to_end.insert "abc").to_string -#eval ("αβ".mk_iterator.next.insert "abc").to_string -#eval s "αβ" -#eval ("abcdef".mk_iterator.next.remove 2).to_string -#eval ("abcdef".mk_iterator.next.next.remove 2).to_string -#eval ("abcdef".mk_iterator.next.remove 3).to_string -#eval (("abcdef".mk_iterator.next.next.next.remove 100).prev.set_curr 'a').to_string -#eval ("abcdef".mk_iterator.next.next.next.remove 100).has_next -#eval ("abcdef".mk_iterator.next.next.next.remove 100).prev.has_next -#eval to_bool $ "abc" = "abc" -#eval to_bool $ "abc" = "abd" diff --git a/old_tests/tests/lean/string_imp2.lean.expected.out b/old_tests/tests/lean/string_imp2.lean.expected.out deleted file mode 100644 index e5064c055c..0000000000 --- a/old_tests/tests/lean/string_imp2.lean.expected.out +++ /dev/null @@ -1,52 +0,0 @@ -"hellohello" -"hello hello" -5 -['h', 'e', 'l', 'l', 'o'] -['α', 'β'] -[] -['α', 'β', 'γ'] -['γ', 'β', 'α'] -0 -3 -[] -['α'] -['β', 'α'] -['β', 'γ'] -['α', 'β'] -"" -"αβa" -"α α-" -'A' -"aβγ" -"abγ" -"abc" -"cbγ" -"0bc" -"01c" -"012" -"21c" -"λbc" -"abc-bc" -"abc" -"a\x00bb" -4 -"abc-ab" -"abc" -ff -tt -ff -ff -tt -tt -ff -"αβabc" -"αabcβ" -"αβabcαdeβ" -"adef" -"abef" -"aef" -"aba" -ff -tt -tt -ff diff --git a/old_tests/tests/lean/struct_class.lean b/old_tests/tests/lean/struct_class.lean deleted file mode 100644 index d373aeb3ea..0000000000 --- a/old_tests/tests/lean/struct_class.lean +++ /dev/null @@ -1,12 +0,0 @@ -prelude -import init.core - -class point (A : Type*) (B : Type*) := -mk :: (x : A) (y : B) - -#print point - -structure point2 (A : Type*) (B : Type*) := -mk :: (x : A) (y : B) - -#print point2 diff --git a/old_tests/tests/lean/struct_class.lean.expected.out b/old_tests/tests/lean/struct_class.lean.expected.out deleted file mode 100644 index 777da9a153..0000000000 --- a/old_tests/tests/lean/struct_class.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -@[class] -structure point : Type u_1 → Type u_2 → Type (max u_1 u_2) -fields: -point.x : Π (A : Type u_1) (B : Type u_2) [c : point A B], A -point.y : Π (A : Type u_1) (B : Type u_2) [c : point A B], B -structure point2 : Type u_1 → Type u_2 → Type (max u_1 u_2) -fields: -point2.x : Π {A : Type u_1} {B : Type u_2}, point2 A B → A -point2.y : Π {A : Type u_1} {B : Type u_2}, point2 A B → B diff --git a/old_tests/tests/lean/structure_elab_segfault.lean b/old_tests/tests/lean/structure_elab_segfault.lean deleted file mode 100644 index f20931298d..0000000000 --- a/old_tests/tests/lean/structure_elab_segfault.lean +++ /dev/null @@ -1,2 +0,0 @@ -structure foo {A} (R) (x : list A) : Prop := (bar : R x) -structure test : Type := (f : ∀ x y, true) diff --git a/old_tests/tests/lean/structure_elab_segfault.lean.expected.out b/old_tests/tests/lean/structure_elab_segfault.lean.expected.out deleted file mode 100644 index 6c8e460133..0000000000 --- a/old_tests/tests/lean/structure_elab_segfault.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -structure_elab_segfault.lean:1:0: error: infer type failed, sort expected - ?m_1[A] -structure_elab_segfault.lean:2:0: error: infer type failed, sort expected - ?m_1[x] diff --git a/old_tests/tests/lean/structure_instance_bug.lean b/old_tests/tests/lean/structure_instance_bug.lean deleted file mode 100644 index a2fd48d279..0000000000 --- a/old_tests/tests/lean/structure_instance_bug.lean +++ /dev/null @@ -1,11 +0,0 @@ -structure weird (A : Type) := -{B : Type} (op : A → B → A) - -definition foo1 : weird nat := -{ op := nat.add } - -definition foo2 : weird nat := -⟨ nat.add ⟩ - -definition foo3 : weird nat := -{ B := nat, op := nat.add } diff --git a/old_tests/tests/lean/structure_instance_bug.lean.expected.out b/old_tests/tests/lean/structure_instance_bug.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/structure_instance_bug2.lean b/old_tests/tests/lean/structure_instance_bug2.lean deleted file mode 100644 index 9051ec14a9..0000000000 --- a/old_tests/tests/lean/structure_instance_bug2.lean +++ /dev/null @@ -1,13 +0,0 @@ -def default_smt_pre_config : smt_pre_config := {} - -def my_pre_config1 : smt_pre_config := -{ default_smt_pre_config . zeta := tt } - -def my_pre_config2 : smt_pre_config := -{ default_smt_pre_config with zeta := tt } - -structure st := -(i : ℕ) - -example (s : st) : unit × st := -{s with i := 0} diff --git a/old_tests/tests/lean/structure_instance_bug2.lean.expected.out b/old_tests/tests/lean/structure_instance_bug2.lean.expected.out deleted file mode 100644 index 218cbcb3cc..0000000000 --- a/old_tests/tests/lean/structure_instance_bug2.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -structure_instance_bug2.lean:4:0: error: invalid structure instance, 'default_smt_pre_config' is not the name of a structure type -structure_instance_bug2.lean:13:0: error: invalid structure value { ... }, field 'fst' was not provided -structure_instance_bug2.lean:13:0: error: invalid structure value { ... }, field 'snd' was not provided -structure_instance_bug2.lean:13:0: error: invalid structure value { ... }, 'i' is not a field of structure 'prod' diff --git a/old_tests/tests/lean/structure_instance_bug3.lean.expected.out b/old_tests/tests/lean/structure_instance_bug3.lean.expected.out deleted file mode 100644 index de2c3808b5..0000000000 --- a/old_tests/tests/lean/structure_instance_bug3.lean.expected.out +++ /dev/null @@ -1,7 +0,0 @@ -structure_instance_bug3.lean:1:30: error: invalid structure value { ... }, field 'id_map' was not provided -structure_instance_bug3.lean:1:30: error: invalid structure value { ... }, field 'pure_bind' was not provided -structure_instance_bug3.lean:1:30: error: invalid structure value { ... }, field 'bind_assoc' was not provided -structure_instance_bug3.lean:1:30: error: failed to synthesize type class instance for -⊢ has_pure set -structure_instance_bug3.lean:1:30: error: failed to synthesize type class instance for -⊢ has_bind set diff --git a/old_tests/tests/lean/structure_instance_info.lean b/old_tests/tests/lean/structure_instance_info.lean deleted file mode 100644 index cf1a793aa8..0000000000 --- a/old_tests/tests/lean/structure_instance_info.lean +++ /dev/null @@ -1,9 +0,0 @@ -open tactic - -run_cmd -do let e := pexpr.mk_structure_instance { struct := some "prod", field_names := ["fst", "snd"], field_values := [``(1), ``(2)] }, - let f := pexpr.mk_structure_instance { field_names := ["snd"], field_values := [``(1)], sources := [e] }, - to_expr e >>= trace, - to_expr f >>= trace, - trace $ e.get_structure_instance_info >>= structure_instance_info.struct, - trace $ f.get_structure_instance_info >>= structure_instance_info.struct diff --git a/old_tests/tests/lean/structure_instance_info.lean.expected.out b/old_tests/tests/lean/structure_instance_info.lean.expected.out deleted file mode 100644 index 68543668bc..0000000000 --- a/old_tests/tests/lean/structure_instance_info.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -(1, 2) -((1, 2).fst, 1) -(some prod) -none diff --git a/old_tests/tests/lean/structure_instances.lean b/old_tests/tests/lean/structure_instances.lean deleted file mode 100644 index 4641df4b9b..0000000000 --- a/old_tests/tests/lean/structure_instances.lean +++ /dev/null @@ -1,28 +0,0 @@ -meta def mk_c := `[exact 1] - -structure foo (α : Type) := -(a : α) -(b : α := a) -(c : α . mk_c) - -def f : foo ℕ := {a := 1} -#check ({a := 1} : foo ℕ) -#check ({foo . a := 1} : foo ℕ) -#check ({..} : foo ℕ) -#check ({foo . ..} : foo ℕ) -#check {c := 1, ..f} -#check {..f} - -#check {.., a := 1} -- ".." must be last item -#check {..f, a := 1} -- "..f" cannot be followed by key-value pair - -structure bar := -(a : ℕ := 0) -(b : ℕ := 0) - -structure baz := -(b : ℕ := 2) -(c : ℕ := 2) - -#check ({.} : bar) -#check ({a := 1, ..{bar.}, ..{baz.}} : foo ℕ) diff --git a/old_tests/tests/lean/structure_instances.lean.expected.out b/old_tests/tests/lean/structure_instances.lean.expected.out deleted file mode 100644 index da07cf23d4..0000000000 --- a/old_tests/tests/lean/structure_instances.lean.expected.out +++ /dev/null @@ -1,22 +0,0 @@ -{a := 1, b := 1, c := 1} : foo ℕ -{a := 1, b := 1, c := 1} : foo ℕ -{a := ?M_1, b := ?M_1, c := 1} : foo ℕ -{a := ?M_1, b := ?M_1, c := 1} : foo ℕ -{a := f.a, b := f.b, c := 1} : foo ℕ -{a := f.a, b := f.b, c := f.c} : foo ℕ -structure_instances.lean:16:10: error: invalid expression -structure_instances.lean:16:12: error: invalid structure instance, '}' expected -structure_instances.lean:16:7: error: invalid structure notation source, not a structure - ⁇ -which has type - ?m_1 -structure_instances.lean:16:7: error: invalid structure value {...}, expected type is not known(solution: use qualified structure instance { struct_id . ... } -structure_instances.lean:16:14: error: command expected -structure_instances.lean:17:13: error: invalid structure instance, '}' expected -structure_instances.lean:17:7: error: function expected at - {a := f.a, b := f.b, c := f.c} -term has type - foo ℕ -structure_instances.lean:17:15: error: command expected -{a := 0, b := 0} : bar -{a := 1, b := {a := 0, b := 0}.b, c := {b := 2, c := 2}.c} : foo ℕ diff --git a/old_tests/tests/lean/structure_patterns.lean b/old_tests/tests/lean/structure_patterns.lean deleted file mode 100644 index e3ce38f157..0000000000 --- a/old_tests/tests/lean/structure_patterns.lean +++ /dev/null @@ -1,13 +0,0 @@ -meta def mk_c := `[exact 1] - -structure foo (α : Type) := -(a : α) -(b : α := a) -(c : α . mk_c) - -example : foo ℕ → ℕ | {a := a} := a -example : foo ℕ → ℕ | {foo . a := a} := a -example : foo ℕ → ℕ | {a := nat.succ n} := n -example : foo ℕ → ℕ | {..} := 0 -example : foo ℕ → ℕ | {b:=b, ..} := b -example : foo ℕ → ℕ | {..f} := 0 -- error diff --git a/old_tests/tests/lean/structure_patterns.lean.expected.out b/old_tests/tests/lean/structure_patterns.lean.expected.out deleted file mode 100644 index ddcede2a50..0000000000 --- a/old_tests/tests/lean/structure_patterns.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -structure_patterns.lean:10:8: error: non-exhaustive match, the following cases are missing: -_example {a := 0, b := _, c := _} -structure_patterns.lean:10:0: warning: declaration '[anonymous]' uses sorry -structure_patterns.lean:13:25: error: invalid occurrence of structure notation source in pattern diff --git a/old_tests/tests/lean/structure_result_type_may_be_zero.lean b/old_tests/tests/lean/structure_result_type_may_be_zero.lean deleted file mode 100644 index b7a4326818..0000000000 --- a/old_tests/tests/lean/structure_result_type_may_be_zero.lean +++ /dev/null @@ -1 +0,0 @@ -structure {uA uB} Fun (A : Sort uA) (B : Sort uB) : Sort (imax uA uB) := (item : Π(a : A), B) diff --git a/old_tests/tests/lean/structure_result_type_may_be_zero.lean.expected.out b/old_tests/tests/lean/structure_result_type_may_be_zero.lean.expected.out deleted file mode 100644 index b9ec0db4da..0000000000 --- a/old_tests/tests/lean/structure_result_type_may_be_zero.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -structure_result_type_may_be_zero.lean:1:70: error: invalid universe polymorphic structure declaration, the resultant universe is not Prop (i.e., 0), but it may be Prop for some parameter values (solution: use 'l+1' or 'max 1 l') diff --git a/old_tests/tests/lean/structure_segfault.lean b/old_tests/tests/lean/structure_segfault.lean deleted file mode 100644 index 15a08dd3b1..0000000000 --- a/old_tests/tests/lean/structure_segfault.lean +++ /dev/null @@ -1,15 +0,0 @@ -universes u - -namespace ex - -structure group (α : Type u) : Type u - -structure T (α : extends group α := () - -structure ring (α : Type u) : Type u - -class T (α : Type*) extends ring x α - -class S (α : Type*) extends ((λ x, group x) α) - -end ex diff --git a/old_tests/tests/lean/structure_segfault.lean.expected.out b/old_tests/tests/lean/structure_segfault.lean.expected.out deleted file mode 100644 index 52712633a2..0000000000 --- a/old_tests/tests/lean/structure_segfault.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -structure_segfault.lean:7:17: error: invalid expression -structure_segfault.lean:7:25: error: invalid 'structure', expression must be a 'parent' structure -structure_segfault.lean:11:33: error: unknown identifier 'x' -structure_segfault.lean:11:28: error: invalid 'structure', expression must be a 'parent' structure -structure_segfault.lean:13:30: error: invalid 'structure', expression must be a 'parent' structure diff --git a/old_tests/tests/lean/structure_with_index_error.lean b/old_tests/tests/lean/structure_with_index_error.lean deleted file mode 100644 index c913ef4a2e..0000000000 --- a/old_tests/tests/lean/structure_with_index_error.lean +++ /dev/null @@ -1 +0,0 @@ -structure foo : true → Type := (bar : true) diff --git a/old_tests/tests/lean/structure_with_index_error.lean.expected.out b/old_tests/tests/lean/structure_with_index_error.lean.expected.out deleted file mode 100644 index 180126ac08..0000000000 --- a/old_tests/tests/lean/structure_with_index_error.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -structure_with_index_error.lean:1:14: error: invalid 'structure', 'Type' expected diff --git a/old_tests/tests/lean/subpp.lean b/old_tests/tests/lean/subpp.lean deleted file mode 100644 index 156f0fd92b..0000000000 --- a/old_tests/tests/lean/subpp.lean +++ /dev/null @@ -1,2 +0,0 @@ --- -#check {x : nat // x > 0 } diff --git a/old_tests/tests/lean/subpp.lean.expected.out b/old_tests/tests/lean/subpp.lean.expected.out deleted file mode 100644 index f3614e04e1..0000000000 --- a/old_tests/tests/lean/subpp.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -{x // x > 0} : Type diff --git a/old_tests/tests/lean/subst_bug.lean b/old_tests/tests/lean/subst_bug.lean deleted file mode 100644 index 548dc24842..0000000000 --- a/old_tests/tests/lean/subst_bug.lean +++ /dev/null @@ -1,5 +0,0 @@ -open tactic - -example (b1 b2 : bool) (h : b1 = ff) : b1 && b2 = ff := -by do h ← get_local `h, - subst h diff --git a/old_tests/tests/lean/subst_bug.lean.expected.out b/old_tests/tests/lean/subst_bug.lean.expected.out deleted file mode 100644 index e739c2e29a..0000000000 --- a/old_tests/tests/lean/subst_bug.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -subst_bug.lean:4:3: error: tactic failed, there are unsolved goals -state: -b2 : bool -⊢ ff && b2 = ff diff --git a/old_tests/tests/lean/synth_inferred_mismatch.lean b/old_tests/tests/lean/synth_inferred_mismatch.lean deleted file mode 100644 index 91e8383404..0000000000 --- a/old_tests/tests/lean/synth_inferred_mismatch.lean +++ /dev/null @@ -1,7 +0,0 @@ - -constant f (c : Prop) [decidable c] : Prop -constant fax (c : Prop) [decidable c] : f c -attribute [elab_simple] fax - -example (c : Prop) [decidable c] (h : c) : f c := -(fax _ : @f c (is_true h)) diff --git a/old_tests/tests/lean/synth_inferred_mismatch.lean.expected.out b/old_tests/tests/lean/synth_inferred_mismatch.lean.expected.out deleted file mode 100644 index 9c2d321d86..0000000000 --- a/old_tests/tests/lean/synth_inferred_mismatch.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -synth_inferred_mismatch.lean:7:1: error: synthesized type class instance is not definitionally equal to expression inferred by typing rules, synthesized - _inst_1 -inferred - is_true h diff --git a/old_tests/tests/lean/t10.lean b/old_tests/tests/lean/t10.lean deleted file mode 100644 index 568ebc8ea9..0000000000 --- a/old_tests/tests/lean/t10.lean +++ /dev/null @@ -1,23 +0,0 @@ -prelude constant N : Type.{1} -definition B : Type.{1} := Type.{0} -constant ite : B → N → N → N -constant and : B → B → B -constant f : N → N -constant p : B -constant q : B -constant x : N -constant y : N -constant z : N -infixr ` ∧ `:25 := and -notation `if` c `then` t:45 `else` e:45 := ite c t e -#check if p ∧ q then f x else y -#check if p ∧ q then q else y -constant list : Type.{1} -constant nil : list -constant cons : N → list → list --- Non empty lists -notation `[` l:(foldr `, ` (h t, cons h t) nil) `]` := l -#check [x, y, z, x, y, y] -#check [x] -notation `[` `]` := nil -#check [] diff --git a/old_tests/tests/lean/t10.lean.expected.out b/old_tests/tests/lean/t10.lean.expected.out deleted file mode 100644 index cfbb81a723..0000000000 --- a/old_tests/tests/lean/t10.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -if p ∧ q then f x else y : N -t10.lean:14:7: error: type mismatch at application - ite (p ∧ q) q -term - q -has type - B -but is expected to have type - N -[x, y, z, x, y, y] : list -[x] : list -[] : list diff --git a/old_tests/tests/lean/t11.lean b/old_tests/tests/lean/t11.lean deleted file mode 100644 index d7a077f619..0000000000 --- a/old_tests/tests/lean/t11.lean +++ /dev/null @@ -1,11 +0,0 @@ -prelude constant A : Type.{1} -definition bool : Type.{1} := Type.{0} -constant Exists (P : A → bool) : bool -notation `exists` binders `, ` b:(scoped b, Exists b) := b -notation `∃` binders `, ` b:(scoped b, Exists b) := b -constant p : A → bool -constant q : A → A → bool -#check exists x : A, p x -#check ∃ x y : A, q x y -notation `{` binder `|` b:scoped `}` := b -#check {x : A | x} diff --git a/old_tests/tests/lean/t11.lean.expected.out b/old_tests/tests/lean/t11.lean.expected.out deleted file mode 100644 index 43663bc410..0000000000 --- a/old_tests/tests/lean/t11.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -∃ (x : A), p x : bool -∃ (x y : A), q x y : bool -λ (x : A), x : A → A diff --git a/old_tests/tests/lean/t12.lean b/old_tests/tests/lean/t12.lean deleted file mode 100644 index 4e10e26ad3..0000000000 --- a/old_tests/tests/lean/t12.lean +++ /dev/null @@ -1,7 +0,0 @@ -prelude precedence `+` : 65 -precedence `*` : 75 -constant N : Type.{1} -#check λ (f : N -> N -> N) (g : N → N → N) (infix + := f) (infix * := g) (x y : N), x+x*y -constant f : N → N → N -constant a : N -#check a+a -- + notation is not available anymore diff --git a/old_tests/tests/lean/t12.lean.expected.out b/old_tests/tests/lean/t12.lean.expected.out deleted file mode 100644 index 73c66536fe..0000000000 --- a/old_tests/tests/lean/t12.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -λ (f g : N → N → N) (x y : N), f x (g x y) : (N → N → N) → (N → N → N) → N → N → N -a : N -t12.lean:7:8: error: command expected diff --git a/old_tests/tests/lean/t13.lean b/old_tests/tests/lean/t13.lean deleted file mode 100644 index 70c7ac4113..0000000000 --- a/old_tests/tests/lean/t13.lean +++ /dev/null @@ -1,12 +0,0 @@ -prelude constant A : Type.{1} -constant f : A → A → A -constant g : A → A → A -precedence `+` : 65 -infixl + := f -infixl + := g -constant a : A -constant b : A -#print raw a+b -- + is overloaded -#check fun (h : A → A → A) - (infixl + := h), -- Like local declarations, local notation "shadows" global one. - a+b diff --git a/old_tests/tests/lean/t13.lean.expected.out b/old_tests/tests/lean/t13.lean.expected.out deleted file mode 100644 index 5e0b935028..0000000000 --- a/old_tests/tests/lean/t13.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -[choice g f] a b -λ (h : A → A → A), h a b : (A → A → A) → A diff --git a/old_tests/tests/lean/t14.lean b/old_tests/tests/lean/t14.lean deleted file mode 100644 index b2f114d2c2..0000000000 --- a/old_tests/tests/lean/t14.lean +++ /dev/null @@ -1,41 +0,0 @@ -prelude namespace foo - constant A : Type - constant a : A - constant x : A - constant c : A -end foo - -section - open foo (renaming a->b x->y) (hiding c) - #check b - #check y - #check c -- Error -end - -section - open foo (a x) - #check a - #check x - #check c -- Error -end - -section - open foo (a x) (hiding c) -- Error -end - -section - open foo - #check a - #check c - #check A -end - -namespace foo - constant f : A → A → A - infix ` * `:75 := f -end foo - -section - open foo - #check a * c -end diff --git a/old_tests/tests/lean/t14.lean.expected.out b/old_tests/tests/lean/t14.lean.expected.out deleted file mode 100644 index ed667f6e60..0000000000 --- a/old_tests/tests/lean/t14.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -b : A -y : A -t14.lean:12:9: error: unknown identifier 'c' -a : foo.A -x : foo.A -t14.lean:19:9: error: unknown identifier 'c' -t14.lean:23:26: error: invalid 'open/export' command option, mixing explicit and implicit 'open/export' options -a : A -c : A -A : Type -a * c : A diff --git a/old_tests/tests/lean/t2.lean b/old_tests/tests/lean/t2.lean deleted file mode 100644 index fb21d6e8b1..0000000000 --- a/old_tests/tests/lean/t2.lean +++ /dev/null @@ -1,2 +0,0 @@ -#print "hello world" -#print "testing" diff --git a/old_tests/tests/lean/t2.lean.expected.out b/old_tests/tests/lean/t2.lean.expected.out deleted file mode 100644 index 32eab3e59e..0000000000 --- a/old_tests/tests/lean/t2.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -hello world -testing diff --git a/old_tests/tests/lean/t5.lean b/old_tests/tests/lean/t5.lean deleted file mode 100644 index d72a271d41..0000000000 --- a/old_tests/tests/lean/t5.lean +++ /dev/null @@ -1,13 +0,0 @@ -constant N : Type.{1} -constant f : N → N -constant a : N -noncomputable definition g (a : N) : N := f a -#check g -namespace foo - noncomputable definition h : N := f a - #check h - private noncomputable definition q : N := f a - #check q -end foo -#check foo.h -#check q -- Error q is now hidden diff --git a/old_tests/tests/lean/t5.lean.expected.out b/old_tests/tests/lean/t5.lean.expected.out deleted file mode 100644 index 47bcf06573..0000000000 --- a/old_tests/tests/lean/t5.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -g : N → N -h : N -q : N -foo.h : N -t5.lean:13:7: error: unknown identifier 'q' diff --git a/old_tests/tests/lean/t6.lean b/old_tests/tests/lean/t6.lean deleted file mode 100644 index 0b1666df00..0000000000 --- a/old_tests/tests/lean/t6.lean +++ /dev/null @@ -1,11 +0,0 @@ -prelude definition Prop : Type := Sort 0 -section - variable {A : Type*} -- Mark A as implicit parameter - variable R : A → A → Prop - definition id (a : A) : A := a - definition refl : Prop := forall (a : A), R a a - definition symm : Prop := forall (a b : A), R a b -> R b a -end -#check id.{2} -#check refl.{1} -#check symm.{1} diff --git a/old_tests/tests/lean/t6.lean.expected.out b/old_tests/tests/lean/t6.lean.expected.out deleted file mode 100644 index cf7d444a02..0000000000 --- a/old_tests/tests/lean/t6.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -id : ?M_1 → ?M_1 -refl : (?M_1 → ?M_1 → Prop) → Prop -symm : (?M_1 → ?M_1 → Prop) → Prop diff --git a/old_tests/tests/lean/tactic_error_pos.lean b/old_tests/tests/lean/tactic_error_pos.lean deleted file mode 100644 index ffbd369c65..0000000000 --- a/old_tests/tests/lean/tactic_error_pos.lean +++ /dev/null @@ -1,45 +0,0 @@ -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - exact (or.inl _) - --^ type mismatch here (OK) -end - -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - exact (and.intro _ h2) - --^ don't know how to synthesize placeholder here (OK) -end - -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - abstract {exact (and.intro _ h2)} - --^ don't know how to synthesize placeholder here (OK) -end - -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - {exact (and.intro _ h2) } <|> apply and.intro - --^ should not show error here (BUG) -end - -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - try {exact (and.intro _ h2) } - --^ should not show error here (BUG) -end - -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - repeat {exact (and.intro _ h2) } - --^ should not show error here (BUG) -end - -open tactic -meta def mytac : tactic unit := -`[apply (or.inl _)] - -example (p q : Prop) (h1 : p) (h2 : q) : p ∧ q := -begin - mytac ---^ failed to unify error here, it shoult *not* be at mytac or.inl (OK) -end diff --git a/old_tests/tests/lean/tactic_error_pos.lean.expected.out b/old_tests/tests/lean/tactic_error_pos.lean.expected.out deleted file mode 100644 index ca91e7d850..0000000000 --- a/old_tests/tests/lean/tactic_error_pos.lean.expected.out +++ /dev/null @@ -1,80 +0,0 @@ -tactic_error_pos.lean:3:9: error: invalid type ascription, term has type - ?m_1 ∨ ?m_2 -but is expected to have type - p ∧ q -state: -p q : Prop, -h1 : p, -h2 : q -⊢ p ∧ q -tactic_error_pos.lean:9:19: error: don't know how to synthesize placeholder -context: -p q : Prop, -h1 : p, -h2 : q -⊢ p -state: -p q : Prop, -h1 : p, -h2 : q -⊢ p ∧ q -tactic_error_pos.lean:15:29: error: don't know how to synthesize placeholder -context: -p q : Prop, -h1 : p, -h2 : q -⊢ p -state: -p q : Prop, -h1 : p, -h2 : q -⊢ p ∧ q -tactic_error_pos.lean:23:0: error: tactic failed, there are unsolved goals -state: -2 goals -p q : Prop, -h1 : p, -h2 : q -⊢ p - -p q : Prop, -h1 : p, -h2 : q -⊢ q -tactic_error_pos.lean:29:0: error: tactic failed, there are unsolved goals -state: -p q : Prop, -h1 : p, -h2 : q -⊢ p ∧ q -tactic_error_pos.lean:35:0: error: tactic failed, there are unsolved goals -state: -p q : Prop, -h1 : p, -h2 : q -⊢ p ∧ q -tactic_error_pos.lean:43:2: error: invalid apply tactic, failed to unify - p ∧ q -with - ?m_1 ∨ ?m_2 -state: -4 goals -p q : Prop, -h1 : p, -h2 : q -⊢ p ∧ q - -p q : Prop, -h1 : p, -h2 : q -⊢ Prop - -p q : Prop, -h1 : p, -h2 : q -⊢ Prop - -p q : Prop, -h1 : p, -h2 : q -⊢ ?m_1 diff --git a/old_tests/tests/lean/tactic_failure.lean b/old_tests/tests/lean/tactic_failure.lean deleted file mode 100644 index 1e460db66f..0000000000 --- a/old_tests/tests/lean/tactic_failure.lean +++ /dev/null @@ -1,4 +0,0 @@ -open tactic - -example (A B : Type) : B → A := -by do intro `Hb, assumption diff --git a/old_tests/tests/lean/tactic_failure.lean.expected.out b/old_tests/tests/lean/tactic_failure.lean.expected.out deleted file mode 100644 index b9ea71e8c4..0000000000 --- a/old_tests/tests/lean/tactic_failure.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -tactic_failure.lean:4:3: error: assumption tactic failed -state: -A B : Type, -Hb : B -⊢ A diff --git a/old_tests/tests/lean/tactic_state_pp.lean b/old_tests/tests/lean/tactic_state_pp.lean deleted file mode 100644 index 7a3323895a..0000000000 --- a/old_tests/tests/lean/tactic_state_pp.lean +++ /dev/null @@ -1,39 +0,0 @@ -universe variables u - -inductive Vec (α : Type u) : nat → Type u -| nil : Vec 0 -| cons : ∀ {n}, α → Vec n → Vec (nat.succ n) - -constant f {α : Type u} {n : nat} : Vec α n → nat -axiom fax1 (α : Type u) : f (Vec.nil α) = 0 -axiom fax2 {α : Type u} {n : nat} (v : Vec α (nat.succ n)) : f v = 1 - -open tactic -meta def pp_state_core : tactic format := -do t ← target, - t_fmt ← pp t, - return $ to_fmt "Goal: " ++ t_fmt - -meta def pp_state (s : tactic_state) : format := -match pp_state_core s with -| result.success r _ := r -| result.exception _ _ _ := "failed to pretty print" -end - -meta instance i2 : has_to_format tactic_state := -⟨λ s, to_fmt "My custom goal visualizer" ++ format.line ++ pp_state s⟩ - -example {α : Type u} {n : nat} (v : Vec α n) : f v ≠ 2 := -begin - destruct v, - intros, intro, have h := fax1 α, cc, - -- intros n1 h t, intros, intro, have h := fax2 (Vec.cons h t), cc -end - -open nat -example : ∀ n, 0 < n → succ (pred n) = n := -begin - intro n, - destruct n, - dsimp, intros, have h := lt_irrefl 0, cc, -end diff --git a/old_tests/tests/lean/tactic_state_pp.lean.expected.out b/old_tests/tests/lean/tactic_state_pp.lean.expected.out deleted file mode 100644 index 9877874619..0000000000 --- a/old_tests/tests/lean/tactic_state_pp.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -tactic_state_pp.lean:31:0: error: tactic failed, there are unsolved goals -state: -My custom goal visualizer -Goal: ∀ {n_1 : ℕ} (a : α) (a_1 : Vec α n_1), - (λ (a : ℕ) (w : Vec α a), n = a → v == w → f v ≠ 2) (nat.succ n_1) (Vec.cons a a_1) -tactic_state_pp.lean:39:0: error: tactic failed, there are unsolved goals -state: -My custom goal visualizer -Goal: ∀ (n_1 : ℕ), (λ (w : ℕ), n = w → 0 < n → succ (pred n) = n) (succ n_1) diff --git a/old_tests/tests/lean/task.lean b/old_tests/tests/lean/task.lean deleted file mode 100644 index 8f1b91f3d8..0000000000 --- a/old_tests/tests/lean/task.lean +++ /dev/null @@ -1,10 +0,0 @@ -run_cmd tactic.run_async (tactic.trace - "trace message from a different task") - -def {u} foo {α : Type u} {n : ℕ} : array (0+n) α → array n α := -if n = 0 then - λ v, cast (by async { simp }) v -else - λ v, cast (by async { simp }) v - -#print foo diff --git a/old_tests/tests/lean/task.lean.expected.out b/old_tests/tests/lean/task.lean.expected.out deleted file mode 100644 index 6a214d8e1f..0000000000 --- a/old_tests/tests/lean/task.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -trace message from a different task -def foo : Π {α : Type u} {n : ℕ}, array (0 + n) α → array n α := -λ {α : Type u} {n : ℕ}, ite (n = 0) (λ (v : array (0 + n) α), cast _ v) (λ (v : array (0 + n) α), cast _ v) diff --git a/old_tests/tests/lean/test.sh b/old_tests/tests/lean/test.sh deleted file mode 100755 index fa0988c814..0000000000 --- a/old_tests/tests/lean/test.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -cd "$(dirname "$0")" -if [ $# -ne 2 -a $# -ne 1 ]; then - echo "Usage: test.sh [lean-executable-path] [yes/no]?" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../library:. -if [ $# -ne 2 ]; then - INTERACTIVE=no -else - INTERACTIVE=$2 -fi - -NUM_ERRORS=0 -for f in *.lean; do - echo "-- testing $f" - if [ ${f: -6} == ".hlean" ]; then - CONFIG="config.hlean" - else - CONFIG="config.lean" - fi - "$LEAN" -j0 -t $CONFIG "$f" &> "$f.produced.out.1" - sed "/warning: imported file uses 'sorry'/d" "$f.produced.out.1" > "$f.produced.out" - rm -f -- "$f.produced.out.1" - if test -f "$f.expected.out"; then - if diff -I "executing external script" "$f.produced.out" "$f.expected.out"; then - echo "-- checked" - else - echo "ERROR: file $f.produced.out does not match $f.expected.out" - NUM_ERRORS=$(($NUM_ERRORS+1)) - if [ $INTERACTIVE == "yes" ]; then - meld "$f.produced.out" "$f.expected.out" - if diff -I "executing external script" "$f.produced.out" "$f.expected.out"; then - echo "-- mismath was fixed" - fi - fi - fi - else - echo "ERROR: file $f.expected.out does not exist" - NUM_ERRORS=$(($NUM_ERRORS+1)) - if [ $INTERACTIVE == "yes" ]; then - read -p "copy $f.produced.out (y/n)? " - if [ $REPLY == "y" ]; then - cp -- "$f.produced.out" "$f.expected.out" - echo "-- copied $f.produced.out --> $f.expected.out" - fi - fi - fi -done -if [ $NUM_ERRORS -gt 0 ]; then - echo "-- Number of errors: $NUM_ERRORS" - exit 1 -else - echo "-- Passed" - exit 0 -fi diff --git a/old_tests/tests/lean/test_all.sh b/old_tests/tests/lean/test_all.sh deleted file mode 100755 index fa6965fb09..0000000000 --- a/old_tests/tests/lean/test_all.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 1 ]; then - echo "Usage: test_all.sh [lean-executable-path]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../library:. -fs=() -for f in *.lean -do - ff=$(./readlinkf.sh "$f") - if [[ "$OSTYPE" == "msys" ]]; then - # Windows running MSYS2 - # Replace /c/ with c:, and / with \\ - ff=$(echo $ff | sed 's|^/\([a-z]\)/|\1:/|' | sed 's|/|\\\\|g') - fi - fs+=("$ff") -done -"$LEAN" --test-suite "${fs[@]}" || (rm *.test_suite.out *.status; false) diff --git a/old_tests/tests/lean/test_single.sh b/old_tests/tests/lean/test_single.sh deleted file mode 100755 index b475d397de..0000000000 --- a/old_tests/tests/lean/test_single.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -if [ $# -ne 3 -a $# -ne 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file] [yes/no]?" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../library:. -if [ $# -ne 3 ]; then - INTERACTIVE=no -else - INTERACTIVE=$3 -fi -f=$2 -ff=$(./readlinkf.sh "$f") - -if [[ "$OSTYPE" == "msys" ]]; then - # Windows running MSYS2 - # Replace /c/ with c:, and / with \\ - ff=$(echo $ff | sed 's|^/\([a-z]\)/|\1:/|' | sed 's|/|\\\\|g') -fi - -DIFF=diff -if diff --color --help >/dev/null 2>&1; then - DIFF="diff --color"; -fi - -echo "-- testing $f" -if [[ -f "$f.status" ]]; then - echo "-- using result from test_all.sh" -else - "$LEAN" --test-suite "$ff" -fi -sed 's|does\\not\\exist|does/not/exist|' "$f.test_suite.out" | sed "/warning: imported file uses 'sorry'/d" | sed "/warning: using 'sorry'/d" | sed "/failed to elaborate theorem/d" | sed "s|^$ff|$f|" > "$f.produced.out" -rm "$f.test_suite.out" "$f.status" -if test -f "$f.expected.out"; then - if $DIFF -u --ignore-all-space -I "executing external script" "$f.expected.out" "$f.produced.out"; then - echo "-- checked" - exit 0 - else - echo "ERROR: file $f.produced.out does not match $f.expected.out" - if [ $INTERACTIVE == "yes" ]; then - meld "$f.produced.out" "$f.expected.out" - if diff -I "executing external script" "$f.expected.out" "$f.produced.out"; then - echo "-- mismatch was fixed" - fi - fi - exit 1 - fi -else - echo "ERROR: file $f.expected.out does not exist" - if [ $INTERACTIVE == "yes" ]; then - read -p "copy $f.produced.out (y/n)? " - if [ $REPLY == "y" ]; then - cp -- "$f.produced.out" "$f.expected.out" - echo "-- copied $f.produced.out --> $f.expected.out" - fi - fi - exit 1 -fi diff --git a/old_tests/tests/lean/test_single_pp.sh b/old_tests/tests/lean/test_single_pp.sh deleted file mode 100755 index 80f6ea7b44..0000000000 --- a/old_tests/tests/lean/test_single_pp.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Script for testing if Lean can parse the output produced by its -# pretty printer -if [ $# -ne 2 ]; then - echo "Usage: test_single_pp.sh [lean-executable-path] [file]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -f=$2 -echo "-- testing $f" -"$LEAN" -j0 "$f" showenv.l &> "$f.pp.out" -if grep "===BEGIN ENVIRONMENT===" "$f.pp.out"; then - awk 'BEGIN { SHOW = 0 } { if (SHOW == 1) print $0 } /===BEGIN ENVIRONMENT===/ { SHOW = 1 }' "$f.pp.out" > "$f.pp" - rm -f -- "$f.pp.out" - if "$LEAN" "$f.pp"; then - rm -f -- "$f.pp" - echo "-- checked" - else - echo "-- failed to parse output produced by Lean" - exit 1 - fi -else - echo "-- unexpected output produced by Lean" - exit 1 -fi diff --git a/old_tests/tests/lean/trace1.lean b/old_tests/tests/lean/trace1.lean deleted file mode 100644 index 43c8a36d3d..0000000000 --- a/old_tests/tests/lean/trace1.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -example : true := -by do - when_tracing `app_builder $ do { - trace "hello", - trace "world" }, - constructor - -set_option trace.app_builder true -#print "------------" - -example : true := -by do - when_tracing `app_builder $ do { - trace "hello", - trace "world" }, - constructor diff --git a/old_tests/tests/lean/trace1.lean.expected.out b/old_tests/tests/lean/trace1.lean.expected.out deleted file mode 100644 index 65b0c43b02..0000000000 --- a/old_tests/tests/lean/trace1.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ ------------- -hello -world diff --git a/old_tests/tests/lean/trace2.lean b/old_tests/tests/lean/trace2.lean deleted file mode 100644 index e0d20eded7..0000000000 --- a/old_tests/tests/lean/trace2.lean +++ /dev/null @@ -1,20 +0,0 @@ -open tactic - -declare_trace foo.bla - -example : true := -by do - when_tracing `foo.bla $ do { - trace "hello", - trace "world" }, - constructor - -set_option trace.foo.bla true -#print "------------" - -example : true := -by do - when_tracing `foo.bla $ do { - trace "hello", - trace "world" }, - constructor diff --git a/old_tests/tests/lean/trace2.lean.expected.out b/old_tests/tests/lean/trace2.lean.expected.out deleted file mode 100644 index 65b0c43b02..0000000000 --- a/old_tests/tests/lean/trace2.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ ------------- -hello -world diff --git a/old_tests/tests/lean/trace_kabstract.lean b/old_tests/tests/lean/trace_kabstract.lean deleted file mode 100644 index 4e0937d185..0000000000 --- a/old_tests/tests/lean/trace_kabstract.lean +++ /dev/null @@ -1,8 +0,0 @@ -set_option trace.rewrite true -set_option trace.kabstract true - -example (f : nat → nat) (a b : nat) (h : f a = a) : f (f a) = a := -begin - rw h, - rw h -end diff --git a/old_tests/tests/lean/trace_kabstract.lean.expected.out b/old_tests/tests/lean/trace_kabstract.lean.expected.out deleted file mode 100644 index 0b4ec10763..0000000000 --- a/old_tests/tests/lean/trace_kabstract.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -[rewrite] before kabstract -[kabstract] found target: -f a -[rewrite] before kabstract -[kabstract] found target: -f a diff --git a/old_tests/tests/lean/trust0/basic.lean b/old_tests/tests/lean/trust0/basic.lean deleted file mode 100644 index eaccddeed0..0000000000 --- a/old_tests/tests/lean/trust0/basic.lean +++ /dev/null @@ -1,151 +0,0 @@ -/- -Copyright (c) 2014 Microsoft Corporation. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Floris van Doorn, Leonardo de Moura --/ -prelude -import init.logic - -notation `ℕ` := nat - -namespace nat - -inductive less_than_or_equal (a : ℕ) : ℕ → Prop -| refl : less_than_or_equal a -| step : Π {b}, less_than_or_equal b → less_than_or_equal (succ b) - -instance : has_le ℕ := -⟨nat.less_than_or_equal⟩ - -@[reducible] protected def le (n m : ℕ) := nat.less_than_or_equal n m -@[reducible] protected def lt (n m : ℕ) := nat.less_than_or_equal (succ n) m - -instance : has_lt ℕ := -⟨nat.lt⟩ - -def pred : ℕ → ℕ -| 0 := 0 -| (a+1) := a - -protected def sub : ℕ → ℕ → ℕ -| a 0 := a -| a (b+1) := pred (sub a b) - -protected def mul : nat → nat → nat -| a 0 := 0 -| a (b+1) := (mul a b) + a - -instance : has_sub ℕ := -⟨nat.sub⟩ - -instance : has_mul ℕ := -⟨nat.mul⟩ - -instance : decidable_eq ℕ -| zero zero := is_true rfl -| (succ x) zero := is_false (λ h, nat.no_confusion h) -| zero (succ y) := is_false (λ h, nat.no_confusion h) -| (succ x) (succ y) := - match decidable_eq x y with - | is_true xeqy := is_true (xeqy ▸ eq.refl (succ x)) - | is_false xney := is_false (λ h, nat.no_confusion h (λ xeqy, absurd xeqy xney)) - end - -def {u} repeat {α : Type u} (f : ℕ → α → α) : ℕ → α → α -| 0 a := a -| (succ n) a := f n (repeat n a) - -instance : inhabited ℕ := -⟨nat.zero⟩ - -@[simp] lemma nat_zero_eq_zero : nat.zero = 0 := -rfl - -/- properties of inequality -/ - -@[refl] protected def le_refl : ∀ a : ℕ, a ≤ a := -less_than_or_equal.refl - -lemma le_succ (n : ℕ) : n ≤ succ n := -less_than_or_equal.step (nat.le_refl n) - -lemma succ_le_succ {n m : ℕ} : n ≤ m → succ n ≤ succ m := -λ h, less_than_or_equal.rec (nat.le_refl (succ n)) (λ a b, less_than_or_equal.step) h - -lemma zero_le : ∀ (n : ℕ), 0 ≤ n -| 0 := nat.le_refl 0 -| (n+1) := less_than_or_equal.step (zero_le n) - -lemma zero_lt_succ (n : ℕ) : 0 < succ n := -succ_le_succ (zero_le n) - -def succ_pos := zero_lt_succ - -lemma not_succ_le_zero : ∀ (n : ℕ), succ n ≤ 0 → false -. - -lemma not_lt_zero (a : ℕ) : ¬ a < 0 := not_succ_le_zero a - -lemma pred_le_pred {n m : ℕ} : n ≤ m → pred n ≤ pred m := -λ h, less_than_or_equal.rec_on h - (nat.le_refl (pred n)) - (λ n, nat.rec (λ a b, b) (λ a b c, less_than_or_equal.step) n) - -lemma le_of_succ_le_succ {n m : ℕ} : succ n ≤ succ m → n ≤ m := -pred_le_pred - -instance decidable_le : ∀ a b : ℕ, decidable (a ≤ b) -| 0 b := is_true (zero_le b) -| (a+1) 0 := is_false (not_succ_le_zero a) -| (a+1) (b+1) := - match decidable_le a b with - | is_true h := is_true (succ_le_succ h) - | is_false h := is_false (λ a, h (le_of_succ_le_succ a)) - end - -instance decidable_lt : ∀ a b : ℕ, decidable (a < b) := -λ a b, nat.decidable_le (succ a) b - -protected lemma eq_or_lt_of_le {a b : ℕ} (h : a ≤ b) : a = b ∨ a < b := -less_than_or_equal.cases_on h (or.inl rfl) (λ n h, or.inr (succ_le_succ h)) - -lemma lt_succ_of_le {a b : ℕ} : a ≤ b → a < succ b := -succ_le_succ - -@[simp] lemma succ_sub_succ_eq_sub (a b : ℕ) : succ a - succ b = a - b := -nat.rec_on b - (show succ a - succ zero = a - zero, from (eq.refl (succ a - succ zero))) - (λ b, congr_arg pred) - -lemma not_succ_le_self : ∀ n : ℕ, ¬succ n ≤ n := -λ n, nat.rec (not_succ_le_zero 0) (λ a b c, b (le_of_succ_le_succ c)) n - -protected lemma lt_irrefl (n : ℕ) : ¬n < n := -not_succ_le_self n - -protected lemma le_trans {n m k : ℕ} (h1 : n ≤ m) : m ≤ k → n ≤ k := -less_than_or_equal.rec h1 (λ p h2, less_than_or_equal.step) - -lemma pred_le : ∀ (n : ℕ), pred n ≤ n -| 0 := less_than_or_equal.refl 0 -| (succ a) := less_than_or_equal.step (less_than_or_equal.refl a) - -lemma pred_lt : ∀ {n : ℕ}, n ≠ 0 → pred n < n -| 0 h := absurd rfl h -| (succ a) h := lt_succ_of_le (less_than_or_equal.refl _) - -lemma sub_le (a b : ℕ) : a - b ≤ a := -nat.rec_on b (nat.le_refl (a - 0)) (λ b₁, nat.le_trans (pred_le (a - b₁))) - -lemma sub_lt : ∀ {a b : ℕ}, 0 < a → 0 < b → a - b < a -| 0 b h1 h2 := absurd h1 (nat.lt_irrefl 0) -| (a+1) 0 h1 h2 := absurd h2 (nat.lt_irrefl 0) -| (a+1) (b+1) h1 h2 := - eq.symm (succ_sub_succ_eq_sub a b) ▸ - show a - b < succ a, from - lt_succ_of_le (sub_le a b) - -protected lemma lt_of_lt_of_le {n m k : ℕ} : n < m → m ≤ k → n < k := -nat.le_trans - -end nat diff --git a/old_tests/tests/lean/trust0/t1.lean b/old_tests/tests/lean/trust0/t1.lean deleted file mode 100644 index fd5d599a56..0000000000 --- a/old_tests/tests/lean/trust0/t1.lean +++ /dev/null @@ -1,2 +0,0 @@ -import system.io -#print trust diff --git a/old_tests/tests/lean/trust0/test_single.sh b/old_tests/tests/lean/trust0/test_single.sh deleted file mode 100755 index c166aafdce..0000000000 --- a/old_tests/tests/lean/trust0/test_single.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -if [ $# -lt 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file] [options]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -f=$2 -shift 2 -echo "-- testing $f" -if "$LEAN" $@ "$f"; then - echo "-- checked" -else - echo "failed $f" - exit 1 -fi diff --git a/old_tests/tests/lean/trust10/test_single.sh b/old_tests/tests/lean/trust10/test_single.sh deleted file mode 100755 index c166aafdce..0000000000 --- a/old_tests/tests/lean/trust10/test_single.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -if [ $# -lt 2 ]; then - echo "Usage: test_single.sh [lean-executable-path] [file] [options]" - exit 1 -fi -ulimit -s 8192 -LEAN=$1 -export LEAN_PATH=../../../library:. -f=$2 -shift 2 -echo "-- testing $f" -if "$LEAN" $@ "$f"; then - echo "-- checked" -else - echo "failed $f" - exit 1 -fi diff --git a/old_tests/tests/lean/try_for_heap.lean b/old_tests/tests/lean/try_for_heap.lean deleted file mode 100644 index 4a4c0fdd3d..0000000000 --- a/old_tests/tests/lean/try_for_heap.lean +++ /dev/null @@ -1,58 +0,0 @@ -constant heap : Type -constant ptr : Type -constant val : Type -constant pt : ptr → val → heap -constant hunion : heap → heap → heap -constant is_def : heap → Prop - -infix `∙`:60 := hunion -infix `↣`:70 := pt - -/- -constant hunion_is_assoc : is_associative heap hunion -constant hunion_is_comm : is_commutative heap hunion -attribute [instance] hunion_is_comm hunion_is_assoc - -axiom noalias : ∀ (h : heap) (y₁ y₂ : ptr) (w₁ w₂ : val), is_def (h ∙ y₁ ↣ w₁ ∙ y₂ ↣ w₂) → y₁ ≠ y₂ - --/ -open tactic - -meta def my_tac : tactic unit := -using_smt `[ { [smt] - intros, - smt_tactic.add_lemmas_from_facts, - eblast - } ] - --- set_option profiler true - -example -(h₁ h₂ : heap) (x₁ x₂ x₃ x₄ : ptr) (v₁ v₂ v₃ : val) -(hcomm : ∀ x y, x ∙ y = y ∙ x) -(hassoc : ∀ x y z, (x ∙ y) ∙ z = x ∙ (y ∙ z)) -(hnoalias : ∀ h y₁ y₂ w₁ w₂, is_def (h ∙ y₁ ↣ w₁ ∙ y₂ ↣ w₂) → y₁ ≠ y₂) -: is_def (h₁ ∙ (x₁ ↣ v₁ ∙ x₂ ↣ v₂) ∙ h₂ ∙ (x₃ ↣ v₃)) → x₁ ≠ x₃ ∧ x₁ ≠ x₂ ∧ x₂ ≠ x₃ := -by my_tac -- should work - -example -(h₁ h₂ : heap) (x₁ x₂ x₃ x₄ : ptr) (v₁ v₂ v₃ : val) -(hcomm : ∀ x y, x ∙ y = y ∙ x) -(hassoc : ∀ x y z, (x ∙ y) ∙ z = x ∙ (y ∙ z)) -(hnoalias : ∀ h y₁ y₂ w₁ w₂, is_def (h ∙ y₁ ↣ w₁ ∙ y₂ ↣ w₂) → y₁ ≠ y₂) -: is_def (h₁ ∙ (x₁ ↣ v₁ ∙ x₂ ↣ v₂) ∙ h₂ ∙ (x₃ ↣ v₃)) → x₁ ≠ x₃ ∧ x₁ ≠ x₂ ∧ x₂ ≠ x₃ := -by try_for 100 $ my_tac -- should timeout - -/- -Remark: disable this test because it was too slow. -TODO(Leo): enable again after we resolve the cache issues, and re-implement the SMT -tactic framework - -example -(h₁ h₂ : heap) (x₁ x₂ x₃ x₄ : ptr) (v₁ v₂ v₃ : val) -(hcomm : ∀ x y, x ∙ y = y ∙ x) -(hassoc : ∀ x y z, (x ∙ y) ∙ z = x ∙ (y ∙ z)) -(hnoalias : ∀ h y₁ y₂ w₁ w₂, is_def (h ∙ y₁ ↣ w₁ ∙ y₂ ↣ w₂) → y₁ ≠ y₂) -: is_def (h₁ ∙ (x₁ ↣ v₁ ∙ x₂ ↣ v₂) ∙ h₂ ∙ (x₃ ↣ v₃)) → x₁ ≠ x₃ ∧ x₁ ≠ x₂ ∧ x₂ ≠ x₃ := -by try_for 100000 $ my_tac -- should work --/ diff --git a/old_tests/tests/lean/try_for_heap.lean.expected.out b/old_tests/tests/lean/try_for_heap.lean.expected.out deleted file mode 100644 index 7db00fb307..0000000000 --- a/old_tests/tests/lean/try_for_heap.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -try_for_heap.lean:44:3: error: try_for tactic failed, timeout -state: -h₁ h₂ : heap, -x₁ x₂ x₃ x₄ : ptr, -v₁ v₂ v₃ : val, -hcomm : ∀ (x y : heap), x∙y = y∙x, -hassoc : ∀ (x y z : heap), x∙y∙z = x∙(y∙z), -hnoalias : ∀ (h : heap) (y₁ y₂ : ptr) (w₁ w₂ : val), is_def (h∙y₁↣w₁∙y₂↣w₂) → y₁ ≠ y₂ -⊢ is_def (h₁∙(x₁↣v₁∙x₂↣v₂)∙h₂∙x₃↣v₃) → - x₁ ≠ x₃ ∧ x₁ ≠ x₂ ∧ x₂ ≠ x₃ diff --git a/old_tests/tests/lean/tuple.lean b/old_tests/tests/lean/tuple.lean deleted file mode 100644 index b84936f53a..0000000000 --- a/old_tests/tests/lean/tuple.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat prod - -set_option pp.universes true - -definition {u} tuple (A : Type (u+1)) (n : nat) : Type (u+1) := -nat.rec_on n A (λ n r, r × A) - -#check @tuple diff --git a/old_tests/tests/lean/tuple.lean.expected.out b/old_tests/tests/lean/tuple.lean.expected.out deleted file mode 100644 index 0e90d53f47..0000000000 --- a/old_tests/tests/lean/tuple.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -tuple.{u_1} : Type (u_1+1) → ℕ → Type (u_1+1) diff --git a/old_tests/tests/lean/type_class_bug.lean b/old_tests/tests/lean/type_class_bug.lean deleted file mode 100644 index c554779e99..0000000000 --- a/old_tests/tests/lean/type_class_bug.lean +++ /dev/null @@ -1,11 +0,0 @@ -set_option pp.all true -#check -(do { - a : nat ← [1], - return a } : list nat ) - -#check -(do { - a : nat ← [1, 2, 3], - b : nat ← [3, 4], - return (a, b) } : list (nat × nat) ) diff --git a/old_tests/tests/lean/type_class_bug.lean.expected.out b/old_tests/tests/lean/type_class_bug.lean.expected.out deleted file mode 100644 index eb0c05e047..0000000000 --- a/old_tests/tests/lean/type_class_bug.lean.expected.out +++ /dev/null @@ -1,16 +0,0 @@ -@has_bind.bind.{0 0} list.{0} (@monad.to_has_bind.{0 0} list.{0} list.monad.{0}) nat nat - (@list.cons.{0} nat (@has_one.one.{0} nat nat.has_one) (@list.nil.{0} nat)) - (λ (a : nat), @return.{0 0} list.{0} list.monad.{0} nat a) : - list.{0} nat -@has_bind.bind.{0 0} list.{0} (@monad.to_has_bind.{0 0} list.{0} list.monad.{0}) nat (prod.{0 0} nat nat) - (@list.cons.{0} nat (@has_one.one.{0} nat nat.has_one) - (@list.cons.{0} nat (@bit0.{0} nat nat.has_add (@has_one.one.{0} nat nat.has_one)) - (@list.cons.{0} nat (@bit1.{0} nat nat.has_one nat.has_add (@has_one.one.{0} nat nat.has_one)) - (@list.nil.{0} nat)))) - (λ (a : nat), - @has_bind.bind.{0 0} list.{0} (@monad.to_has_bind.{0 0} list.{0} list.monad.{0}) nat (prod.{0 0} nat nat) - (@list.cons.{0} nat (@bit1.{0} nat nat.has_one nat.has_add (@has_one.one.{0} nat nat.has_one)) - (@list.cons.{0} nat (@bit0.{0} nat nat.has_add (@bit0.{0} nat nat.has_add (@has_one.one.{0} nat nat.has_one))) - (@list.nil.{0} nat))) - (λ (b : nat), @return.{0 0} list.{0} list.monad.{0} (prod.{0 0} nat nat) (@prod.mk.{0 0} nat nat a b))) : - list.{0} (prod.{0 0} nat nat) diff --git a/old_tests/tests/lean/type_error_at_eval_expr.lean b/old_tests/tests/lean/type_error_at_eval_expr.lean deleted file mode 100644 index 641fa2500f..0000000000 --- a/old_tests/tests/lean/type_error_at_eval_expr.lean +++ /dev/null @@ -1,6 +0,0 @@ -open tactic - -run_cmd do - e ← to_expr ``([5] : list ℕ), - eval_expr ℕ e, - return () diff --git a/old_tests/tests/lean/type_error_at_eval_expr.lean.expected.out b/old_tests/tests/lean/type_error_at_eval_expr.lean.expected.out deleted file mode 100644 index 543ed6211c..0000000000 --- a/old_tests/tests/lean/type_error_at_eval_expr.lean.expected.out +++ /dev/null @@ -1,6 +0,0 @@ -type_error_at_eval_expr.lean:3:0: error: type error at eval_expr, argument has type - list ℕ -but is expected to have type - ℕ -state: -⊢ true diff --git a/old_tests/tests/lean/unfold1.lean b/old_tests/tests/lean/unfold1.lean deleted file mode 100644 index 7784ddccdd..0000000000 --- a/old_tests/tests/lean/unfold1.lean +++ /dev/null @@ -1,18 +0,0 @@ -open tactic - -meta definition rewriteH (Hname : name) : tactic unit := -do do h ← get_local Hname, - rewrite_target h, - try reflexivity - -example (l : list nat) : list.append l [] = l := -by do - get_local `l >>= λ H, induction H [`h, `t, `iH], - -- - dunfold_target [`list.append], - trace_state, - trace "------", - reflexivity, - dunfold_target [`list.append], - trace_state, - rewriteH `iH diff --git a/old_tests/tests/lean/unfold1.lean.expected.out b/old_tests/tests/lean/unfold1.lean.expected.out deleted file mode 100644 index 94631707b5..0000000000 --- a/old_tests/tests/lean/unfold1.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -2 goals -⊢ list.nil = list.nil - -h : ℕ, -t : list ℕ, -iH : list.append t list.nil = t -⊢ list.append (h :: t) list.nil = h :: t ------- -h : ℕ, -t : list ℕ, -iH : list.append t list.nil = t -⊢ h :: list.append t list.nil = h :: t diff --git a/old_tests/tests/lean/unfold_crash.lean b/old_tests/tests/lean/unfold_crash.lean deleted file mode 100644 index 1155aee4f1..0000000000 --- a/old_tests/tests/lean/unfold_crash.lean +++ /dev/null @@ -1,13 +0,0 @@ --- -open nat tactic - -example (a b : nat) : a = succ b → a = b + 1 := -by do - H ← intro `H, - try (dunfold_hyp [`nat.succ] H), - dunfold_target [`add, `has_add.add, `has_one.one, `nat.add, `one], - trace_state, - t ← target, - expected ← to_expr ```(a = succ b), - guard (t = expected), - assumption diff --git a/old_tests/tests/lean/unfold_crash.lean.expected.out b/old_tests/tests/lean/unfold_crash.lean.expected.out deleted file mode 100644 index 2e48796691..0000000000 --- a/old_tests/tests/lean/unfold_crash.lean.expected.out +++ /dev/null @@ -1,3 +0,0 @@ -a b : ℕ, -H : a = succ b -⊢ a = succ b diff --git a/old_tests/tests/lean/uni_bug1.lean b/old_tests/tests/lean/uni_bug1.lean deleted file mode 100644 index ca00c51ee8..0000000000 --- a/old_tests/tests/lean/uni_bug1.lean +++ /dev/null @@ -1,9 +0,0 @@ --- -open nat prod - -constant R : nat → nat → Prop -constant f (a b : nat) (H : R a b) : nat -axiom Rtrue (a b : nat) : R a b - - -#check f 1 0 (Rtrue (fst (prod.mk 1 (0:nat))) 0) diff --git a/old_tests/tests/lean/uni_bug1.lean.expected.out b/old_tests/tests/lean/uni_bug1.lean.expected.out deleted file mode 100644 index b4ea4f6ab8..0000000000 --- a/old_tests/tests/lean/uni_bug1.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -f 1 0 _ : ℕ diff --git a/old_tests/tests/lean/unicode_lit.lean b/old_tests/tests/lean/unicode_lit.lean deleted file mode 100644 index 69438d5c55..0000000000 --- a/old_tests/tests/lean/unicode_lit.lean +++ /dev/null @@ -1,2 +0,0 @@ -#eval "≠∀Π∃⁻ʰℵ⬝" -#eval "≠∀Π∃⁻ʰℵ⬝".to_list.map char.to_nat diff --git a/old_tests/tests/lean/unicode_lit.lean.expected.out b/old_tests/tests/lean/unicode_lit.lean.expected.out deleted file mode 100644 index 2ab9ad6608..0000000000 --- a/old_tests/tests/lean/unicode_lit.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -"≠∀Π∃⁻ʰℵ⬝" -[8800, 8704, 928, 8707, 8315, 688, 8501, 11037] diff --git a/old_tests/tests/lean/unification_hints1.lean b/old_tests/tests/lean/unification_hints1.lean deleted file mode 100644 index fe2025de47..0000000000 --- a/old_tests/tests/lean/unification_hints1.lean +++ /dev/null @@ -1,46 +0,0 @@ --- -open list nat - -namespace toy -constants (A : Type) (f h : A → A) (x y z : A) -attribute [irreducible] -noncomputable definition g (x y : A) : A := f z - -#unify (g x y), (f z) - -@[unify] -noncomputable definition toy_hint (x y : A) : unification_hint := -{ pattern := g x y ≟ f z, - constraints := [] } - -#unify (g x y), (f z) -#print [unify] - -end toy - - -namespace canonical -inductive Canonical -| mk : Π (carrier : Type*) (op : carrier → carrier), Canonical - -attribute [irreducible] -definition Canonical.carrier (s : Canonical) : Type* := -Canonical.rec_on s (λ c op, c) - -constants (A : Type) (f : A → A) (x : A) -noncomputable definition A_canonical : Canonical := Canonical.mk A f - -#unify (Canonical.carrier A_canonical), A - -@[unify] -noncomputable definition Canonical_hint (C : Canonical) : unification_hint := -{ pattern := C^.carrier ≟ A, - constraints := [C ≟ A_canonical] } - --- TODO(dhs): we mark carrier as irreducible and prove A_canonical explicitly to work around the fact that --- the default_type_context does not recognize the elaborator metavariables as metavariables, --- and so cannot perform the assignment. -#unify (Canonical.carrier A_canonical), A -#print [unify] - -end canonical diff --git a/old_tests/tests/lean/unification_hints1.lean.expected.out b/old_tests/tests/lean/unification_hints1.lean.expected.out deleted file mode 100644 index a5e531cd33..0000000000 --- a/old_tests/tests/lean/unification_hints1.lean.expected.out +++ /dev/null @@ -1,17 +0,0 @@ -g x y =?= f z -unification failed -g x y =?= f z -g x y =?= f z -unification successful -unification hints: -(has_add.add, nat.succ) #2 + succ #1 =?= succ #0 {#0 =?= #2 + #1} -(toy.f, toy.g) f z =?= g #1 #0 {} -Canonical.carrier A_canonical =?= A -unification failed -Canonical.carrier A_canonical =?= A -Canonical.carrier A_canonical =?= A -unification successful -unification hints: -(has_add.add, nat.succ) #2 + succ #1 =?= succ #0 {#0 =?= #2 + #1} -(toy.f, toy.g) toy.f toy.z =?= toy.g #1 #0 {} -(canonical.A, canonical.Canonical.carrier) A =?= Canonical.carrier #0 {#0 =?= A_canonical} diff --git a/old_tests/tests/lean/unification_hints2.lean b/old_tests/tests/lean/unification_hints2.lean deleted file mode 100644 index c85c4f3a6b..0000000000 --- a/old_tests/tests/lean/unification_hints2.lean +++ /dev/null @@ -1,28 +0,0 @@ -open nat - -constant F : nat → Type -constant F.suc (n : nat) (f : F n) : F (succ n) -constant F.raise (n m : nat) (f : F m) : F (m + n) - -example (m n : nat) (i : F m) : F.raise (succ n) m i = F.suc _ (F.raise n _ i) := -begin - trace_state, -- the result should not contain recursor applications because the stdlib contains the unification hint add_succ_defeq_succ_add_hint - admit -end - - -@[unify] def {u} cons_append_hint (α : Type u) (a b : α) (l₁ l₂ l₃: list α) : unification_hint := -{ pattern := (a :: l₁) ++ l₂ =?= b :: l₃, - constraints := [l₃ =?= l₁ ++ l₂, a =?= b] } - -constant {u} G (α : Type u) : list α → Type -constant {u} G.cons (α : Type u) (a : α) (l : list α) (g : G α l) : G α (a :: l) -constant {u} G.raise (α : Type u) (l₁ l₂ : list α) (g : G α l₂) : G α (l₁ ++ l₂) - -universe u - -example (α : Type u) (a b : α) (l₁ l₂ : list α) (i : G α l₂) : G.raise α (a::l₁) l₂ i = G.cons α a _ (G.raise α _ _ i) := -begin - trace_state, -- the result should not contain recursor applications because we declared cons_append_hint above - admit -end diff --git a/old_tests/tests/lean/unification_hints2.lean.expected.out b/old_tests/tests/lean/unification_hints2.lean.expected.out deleted file mode 100644 index 89b99cee35..0000000000 --- a/old_tests/tests/lean/unification_hints2.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -m n : ℕ, -i : F m -⊢ F.raise (succ n) m i = F.suc (m + n) (F.raise n m i) -unification_hints2.lean:7:0: warning: declaration '[anonymous]' uses sorry -α : Type u, -a b : α, -l₁ l₂ : list α, -i : G α l₂ -⊢ G.raise α (a :: l₁) l₂ i = G.cons α a (l₁ ++ l₂) (G.raise α l₁ l₂ i) -unification_hints2.lean:24:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/unify3.lean b/old_tests/tests/lean/unify3.lean deleted file mode 100644 index 6c92d3bc8a..0000000000 --- a/old_tests/tests/lean/unify3.lean +++ /dev/null @@ -1,28 +0,0 @@ -open tactic - -set_option pp.all true - -example (a b : nat) : a = b → a = a := -by do - intro `H, - eqc : expr ← mk_const `eq, - A ← mk_mvar, - m₁ ← mk_mvar, - m₂ ← mk_mvar, - e ← return (expr.app_of_list eqc [A, m₁, m₂]), - trace "pattern: ", - trace e, - H ← get_local `H, - Ht ← infer_type H, - trace "term to unify: ", - trace Ht, - unify Ht e, - trace "unification results using whnf: ", - whnf A >>= trace, - whnf m₁ >>= trace, - whnf m₂ >>= trace, - trace "unification results using get_assignment: ", - get_assignment A >>= trace, - get_assignment m₁ >>= trace, - get_assignment m₂ >>= trace, - mk_app `eq.refl [m₁] >>= exact diff --git a/old_tests/tests/lean/unify3.lean.expected.out b/old_tests/tests/lean/unify3.lean.expected.out deleted file mode 100644 index c4524a40bc..0000000000 --- a/old_tests/tests/lean/unify3.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -pattern: -@eq.{?l_1} ?m_2 ?m_3 ?m_4 -term to unify: -@eq.{1} nat a b -unification results using whnf: -nat -a -b -unification results using get_assignment: -nat -a -b diff --git a/old_tests/tests/lean/unify_tac1.lean b/old_tests/tests/lean/unify_tac1.lean deleted file mode 100644 index ab348a9841..0000000000 --- a/old_tests/tests/lean/unify_tac1.lean +++ /dev/null @@ -1,24 +0,0 @@ -open tactic - -example (A : Type) (a : A) (p : A → Prop) (H : p a) : ∃ x, p x := -by do - constructor, - tgt ← target, - t ← get_local `H >>= infer_type, - unify tgt t, -- Succeeds unifying p a =?= p ?m_1 - assumption - -example (A : Type) (a : A) (p : A → Prop) (H : p a) : ∃ x, p x := -by do - econstructor, - tgt ← target, - t ← get_local `H >>= infer_type, - is_def_eq tgt t, -- Fails at p a =?= p ?m_1 - assumption - -example (a : nat) : true := -by do - t1 ← to_expr ```(nat.succ a), - t2 ← to_expr ```(a + 1), - is_def_eq t1 t2, -- Succeeds - constructor diff --git a/old_tests/tests/lean/unify_tac1.lean.expected.out b/old_tests/tests/lean/unify_tac1.lean.expected.out deleted file mode 100644 index 8c57fd7ec8..0000000000 --- a/old_tests/tests/lean/unify_tac1.lean.expected.out +++ /dev/null @@ -1,10 +0,0 @@ -unify_tac1.lean:12:3: error: is_def_eq tactic failed, the following expressions are not definitionally equal (remark: is_def_eq tactic does modify the metavariable assignment) - p ?m_1 : Prop -and - p a : Prop -state: -A : Type, -a : A, -p : A → Prop, -H : p a -⊢ p ?m_1 diff --git a/old_tests/tests/lean/univ.lean b/old_tests/tests/lean/univ.lean deleted file mode 100644 index f5f19cd3d4..0000000000 --- a/old_tests/tests/lean/univ.lean +++ /dev/null @@ -1,20 +0,0 @@ --- - -definition id2 (A : Type*) (a : A) := a - -#check id2 Type* nat - -#check id2 Type* nat - - -#check id2 Type nat - -#check id2 _ nat - -#check id2 (Sort (_+1)) nat - -#check id2 (Sort (0+1)) nat - -#check id2 Type* (Type 1) - -#check id2 (Type*) (Type 1) diff --git a/old_tests/tests/lean/univ.lean.expected.out b/old_tests/tests/lean/univ.lean.expected.out deleted file mode 100644 index cb8f622003..0000000000 --- a/old_tests/tests/lean/univ.lean.expected.out +++ /dev/null @@ -1,8 +0,0 @@ -id2 Type ℕ : Type -id2 Type ℕ : Type -id2 Type ℕ : Type -id2 Type ℕ : Type -id2 Type ℕ : Type -id2 Type ℕ : Type -id2 (Type 2) (Type 1) : Type 2 -id2 (Type 2) (Type 1) : Type 2 diff --git a/old_tests/tests/lean/univ_vars.lean b/old_tests/tests/lean/univ_vars.lean deleted file mode 100644 index 4ea3ba217a..0000000000 --- a/old_tests/tests/lean/univ_vars.lean +++ /dev/null @@ -1,28 +0,0 @@ --- -set_option pp.universes true - -universe variable u -variable A : Type.{u} - -definition id1 (a : A) : A := a -#check @id1 - -variable B : Type - -definition id2 (a : B) : B := a -#check @id2 - -universe variable k -variable C : Type.{k} - -definition id3 (a : C) := a - -#check @id3 - -universe variables l m -variable A₁ : Type.{l} -variable A₂ : Type.{l} -definition foo (a₁ : A₁) (a₂ : A₂) := a₁ == a₂ -#check @foo - -#check Type.{m} diff --git a/old_tests/tests/lean/univ_vars.lean.expected.out b/old_tests/tests/lean/univ_vars.lean.expected.out deleted file mode 100644 index 35e5098cc2..0000000000 --- a/old_tests/tests/lean/univ_vars.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -id1.{u_1} : Π (A : Type u_1), A → A -id2 : Π (B : Type), B → B -id3.{u_1} : Π (C : Type u_1), C → C -foo.{u_1} : Π (A₁ A₂ : Type u_1), A₁ → A₂ → Prop -Type m : Type (m+1) diff --git a/old_tests/tests/lean/user_attribute.lean b/old_tests/tests/lean/user_attribute.lean deleted file mode 100644 index 01ae0ccab6..0000000000 --- a/old_tests/tests/lean/user_attribute.lean +++ /dev/null @@ -1,45 +0,0 @@ -@[user_attribute] -meta def foo_attr : user_attribute := { name := `foo, descr := "bar" } - -attribute [foo] eq.refl - -#print [foo] -#print eq.refl -run_cmd attribute.get_instances `foo >>= tactic.pp >>= tactic.trace -#print "---" - --- compound names -@[user_attribute] -meta def foo_baz_attr : user_attribute := { name := `foo.baz, descr := "bar" } - -attribute [foo.baz] eq.refl - -#print [foo.baz] -#print eq.refl -run_cmd attribute.get_instances `foo.baz >>= tactic.pp >>= tactic.trace - --- can't redeclare attributes -@[user_attribute] -meta def duplicate : user_attribute := { name := `reducible, descr := "bar" } - - --- wrong type -@[user_attribute] -meta def bar := "bar" - -section - variable x : string - - @[user_attribute] - meta def baz_attr : user_attribute := { name := `baz, descr := x } -end - --- parameterized attributes - -@[user_attribute] meta def pattr : user_attribute unit name := -{ name := `pattr, descr := "pattr", parser := lean.parser.ident } - -@[pattr poing] -def foo := 1 - -run_cmd pattr.get_param `foo >>= tactic.trace diff --git a/old_tests/tests/lean/user_attribute.lean.expected.out b/old_tests/tests/lean/user_attribute.lean.expected.out deleted file mode 100644 index 15b31e94d8..0000000000 --- a/old_tests/tests/lean/user_attribute.lean.expected.out +++ /dev/null @@ -1,16 +0,0 @@ -eq.refl -@[foo, refl] -constructor eq.refl : ∀ {α : Sort u} (a : α), a = a -[eq.refl] ---- -eq.refl -@[foo, foo.baz, refl] -constructor eq.refl : ∀ {α : Sort u} (a : α), a = a -[eq.refl] -user_attribute.lean:23:9: error: an attribute named [reducible] has already been registered -user_attribute.lean:28:9: error: invalid [user_attribute] usage, must be applied to definition of type `user_attribute` -user_attribute.lean:28:9: error: don't know how to synthesize placeholder -context: -⊢ Sort ? -user_attribute.lean:34:11: error: invalid [user_attribute] usage, must be applied to definition of type `user_attribute` -poing diff --git a/old_tests/tests/lean/user_command.lean b/old_tests/tests/lean/user_command.lean deleted file mode 100644 index 1e247f8677..0000000000 --- a/old_tests/tests/lean/user_command.lean +++ /dev/null @@ -1,36 +0,0 @@ -open lean -open lean.parser -open interactive -open tactic - --- missing tk -@[user_command] -meta def foo_cmd : parser unit := pure () - --- wrong return type -@[user_command] -meta def foo_cmd (_ : parse $ tk "foo") : unit := () - -foo - -@[user_command] -meta def foo_cmd (_ : parse $ tk "foo") : parser unit := -trace "foo" - -run_cmd skip - -foo -private foo - -@[user_command] -meta def foo_cmd2 (_ : parse $ tk "foo") : parser unit := -trace "bar" - -foo - -@[user_command] -meta def foo_cmd3 (dmi : decl_meta_info) (_ : parse $ tk "foo") : parser unit := -trace format!"{dmi.modifiers.is_private}" - -foo -private foo diff --git a/old_tests/tests/lean/user_command.lean.expected.out b/old_tests/tests/lean/user_command.lean.expected.out deleted file mode 100644 index e8c9ed4b42..0000000000 --- a/old_tests/tests/lean/user_command.lean.expected.out +++ /dev/null @@ -1,11 +0,0 @@ -user_command.lean:8:9: error: invalid user-defined command, must take `interactive.parse (lean.parser.tk c)` parameter, optionally preceded by `interactive.decl_meta_info` parameter -user_command.lean:14:0: error: unknown identifier 'foo' -user_command.lean:12:50: error: function expected at - () -term has type - punit -foo -user_command.lean:23:8: error: command does not accept modifiers -bar -ff -tt diff --git a/old_tests/tests/lean/user_notation.lean b/old_tests/tests/lean/user_notation.lean deleted file mode 100644 index 193ee0cc98..0000000000 --- a/old_tests/tests/lean/user_notation.lean +++ /dev/null @@ -1,25 +0,0 @@ -open lean (parser) -open lean.parser -open interactive -open tactic - -reserve prefix `unquote! `:100 -@[user_notation] -meta def unquote_macro (_ : parse $ tk "unquote!") (e : parse lean.parser.pexpr) : parser pexpr := -↑(to_expr e >>= eval_expr pexpr) - -#eval unquote! ``(1 + 1) - -reserve infix ` +⋯+ `:65 -@[user_notation] -meta def upto_notation (e₁ : parse lean.parser.pexpr) (_ : parse $ tk "+⋯+") (n₂ : ℕ) : parser pexpr := -do n₁ ← ↑(to_expr e₁ >>= eval_expr nat), - pure $ (n₂+1-n₁).repeat (λ i e, ``(%%e + %%(reflect $ n₁ + i))) ``(0) - -#check 1 +⋯+ 10 - -@[user_notation] -meta def no_tk (e₁ : parse lean.parser.pexpr) := e₁ - -@[user_notation] -meta def no_parser (e₁ : parse $ tk "(") := e₁ diff --git a/old_tests/tests/lean/user_notation.lean.expected.out b/old_tests/tests/lean/user_notation.lean.expected.out deleted file mode 100644 index 0944bac5bd..0000000000 --- a/old_tests/tests/lean/user_notation.lean.expected.out +++ /dev/null @@ -1,12 +0,0 @@ -2 -0 + (1 + 0) + (1 + 1) + (1 + 2) + (1 + 3) + (1 + 4) + (1 + 5) + (1 + 6) + (1 + 7) + (1 + 8) + (1 + 9) : ℕ -user_notation.lean:22:9: error: invalid user-defined notation, must start with `interactive.parse (lean.parser.tk c)` parameter, optionally preceded by `interactive.parse lean.parser.pexpr` parameter -user_notation.lean:22:9: error: don't know how to synthesize placeholder -context: -e₁ : parse lean.parser.pexpr -⊢ Sort ? -user_notation.lean:25:9: error: invalid user-defined notation, must return type `lean.parser p` -user_notation.lean:25:9: error: don't know how to synthesize placeholder -context: -e₁ : parse (tk "(") -⊢ Sort ? diff --git a/old_tests/tests/lean/utf8.lean b/old_tests/tests/lean/utf8.lean deleted file mode 100644 index 0763dd872d..0000000000 --- a/old_tests/tests/lean/utf8.lean +++ /dev/null @@ -1,6 +0,0 @@ ---open list - -#eval "α₁".length -#eval "α₁ → β₁".length -#eval "∀ α : nat → nat, α 0 ≥ 0".length -#print "------------" diff --git a/old_tests/tests/lean/utf8.lean.expected.out b/old_tests/tests/lean/utf8.lean.expected.out deleted file mode 100644 index cc75999268..0000000000 --- a/old_tests/tests/lean/utf8.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -2 -7 -24 ------------- diff --git a/old_tests/tests/lean/var.lean b/old_tests/tests/lean/var.lean deleted file mode 100644 index 99677e3310..0000000000 --- a/old_tests/tests/lean/var.lean +++ /dev/null @@ -1,12 +0,0 @@ --- - - -section - variable A : Type - parameter a : A -end - -section - variable A : Type - variable a : A -end diff --git a/old_tests/tests/lean/var.lean.expected.out b/old_tests/tests/lean/var.lean.expected.out deleted file mode 100644 index bca60353aa..0000000000 --- a/old_tests/tests/lean/var.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -var.lean:6:12: error: invalid parameter declaration 'a', it depends on variable 'A' diff --git a/old_tests/tests/lean/var2.lean b/old_tests/tests/lean/var2.lean deleted file mode 100644 index 9eec24b472..0000000000 --- a/old_tests/tests/lean/var2.lean +++ /dev/null @@ -1,14 +0,0 @@ --- - - -section - universe l - variable A : Type.{l} - variable a : A - parameter B : Type.{l} - parameter b : B - - definition foo := fun (H : A = B), cast H a = b -end - -#check foo diff --git a/old_tests/tests/lean/var2.lean.expected.out b/old_tests/tests/lean/var2.lean.expected.out deleted file mode 100644 index 969a5f5c7f..0000000000 --- a/old_tests/tests/lean/var2.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -foo : Π (B : Type u_1), B → Π (A : Type u_1), A → A = B → Prop diff --git a/old_tests/tests/lean/vm_eval_crash.lean b/old_tests/tests/lean/vm_eval_crash.lean deleted file mode 100644 index 2e2d009e4e..0000000000 --- a/old_tests/tests/lean/vm_eval_crash.lean +++ /dev/null @@ -1 +0,0 @@ -#eval 10 diff --git a/old_tests/tests/lean/vm_eval_crash.lean.expected.out b/old_tests/tests/lean/vm_eval_crash.lean.expected.out deleted file mode 100644 index f599e28b8a..0000000000 --- a/old_tests/tests/lean/vm_eval_crash.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/old_tests/tests/lean/vm_inline_aux.lean b/old_tests/tests/lean/vm_inline_aux.lean deleted file mode 100644 index ec585f38d4..0000000000 --- a/old_tests/tests/lean/vm_inline_aux.lean +++ /dev/null @@ -1,11 +0,0 @@ -namespace ex -set_option trace.compiler.optimize_bytecode true - -@[inline] def {u} cond {a : Type u} : bool → a → a → a -| tt x y := x -| ff x y := y - --- cond should be inlined here -def foo (x : bool) := -100 + cond x (10*10) (20*20) -end ex diff --git a/old_tests/tests/lean/vm_inline_aux.lean.expected.out b/old_tests/tests/lean/vm_inline_aux.lean.expected.out deleted file mode 100644 index bdcfa8523f..0000000000 --- a/old_tests/tests/lean/vm_inline_aux.lean.expected.out +++ /dev/null @@ -1,24 +0,0 @@ -[compiler.optimize_bytecode] ex.cond._main 4 -0: move 2 -1: cases2 4 -2: move 0 -3: ret -4: move 1 -5: ret -[compiler.optimize_bytecode] ex.cond 1 -0: scnstr #0 -1: closure ex.cond._main 1 -2: ret -[compiler.optimize_bytecode] ex.foo 1 -0: move 0 -1: cases2 6 -2: scnstr #20 -3: scnstr #20 -4: cfun nat.mul -5: goto 9 -6: scnstr #10 -7: scnstr #10 -8: cfun nat.mul -9: scnstr #100 -10: cfun nat.add -11: ret diff --git a/old_tests/tests/lean/vm_let_expr.lean b/old_tests/tests/lean/vm_let_expr.lean deleted file mode 100644 index 08d3c86012..0000000000 --- a/old_tests/tests/lean/vm_let_expr.lean +++ /dev/null @@ -1,11 +0,0 @@ -meta def mk_value (n : nat) : nat := -trace "mk_value" (2 * n) - -meta def mk_fn (sz : nat) : nat → nat := -let n := mk_value sz in -λ x, x + n - -#eval let f := mk_fn 10 in f 1 + f 2 + f 3 + f 4 - - -#eval ((let x := mk_value 10 in mk_fn x) 10) diff --git a/old_tests/tests/lean/vm_let_expr.lean.expected.out b/old_tests/tests/lean/vm_let_expr.lean.expected.out deleted file mode 100644 index 780eccea38..0000000000 --- a/old_tests/tests/lean/vm_let_expr.lean.expected.out +++ /dev/null @@ -1,5 +0,0 @@ -90 -mk_value -50 -mk_value -mk_value diff --git a/old_tests/tests/lean/vm_noncomputable_real.lean b/old_tests/tests/lean/vm_noncomputable_real.lean deleted file mode 100644 index 43fcf47254..0000000000 --- a/old_tests/tests/lean/vm_noncomputable_real.lean +++ /dev/null @@ -1,11 +0,0 @@ -def ℝ := set ℕ -constant ℝ.sub' : ℝ → ℝ → ℝ -/- -The following definition is accepted because the type is (ℝ → ℝ → ℝ) which is defeq to (ℝ → ℝ → ℕ → Prop). -The code generator can handle it because it is returning a type. Morally, it is the function that takes -three arguments and returns an unit. --/ -def ℝ.sub (a b : ℝ) := (λ b, a.sub' b) b -instance : has_sub ℝ := ⟨ℝ.sub⟩ -constant ℝ.nonneg : ℝ → Prop -instance : has_le ℝ := ⟨λ a b, (b - a).nonneg⟩ diff --git a/old_tests/tests/lean/vm_noncomputable_real.lean.expected.out b/old_tests/tests/lean/vm_noncomputable_real.lean.expected.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/old_tests/tests/lean/vm_sorry.lean b/old_tests/tests/lean/vm_sorry.lean deleted file mode 100644 index 93a1d933cc..0000000000 --- a/old_tests/tests/lean/vm_sorry.lean +++ /dev/null @@ -1,21 +0,0 @@ -def half_baked : bool → ℕ -| tt := 42 -| ff := sorry - -#eval (half_baked tt) -#eval (half_baked ff) - -meta def my_partial_fun : bool → ℕ -| tt := 42 -| ff := undefined - -#eval (my_partial_fun ff) - -open expr tactic -run_cmd (do v ← to_expr ``(half_baked ff) >>= whnf, - trace $ to_string v^.is_sorry) - -example : 0 = 1 := by admit -example : 0 = 1 := by mk_sorry >>= exact -example : 0 = 1 := by exact sorry -example : 0 = 1 := by sorry diff --git a/old_tests/tests/lean/vm_sorry.lean.expected.out b/old_tests/tests/lean/vm_sorry.lean.expected.out deleted file mode 100644 index 3a2cc58146..0000000000 --- a/old_tests/tests/lean/vm_sorry.lean.expected.out +++ /dev/null @@ -1,9 +0,0 @@ -vm_sorry.lean:1:0: warning: declaration 'half_baked' uses sorry -42 -vm_sorry.lean:6:0: error: half_baked._main: trying to evaluate sorry -vm_sorry.lean:12:0: error: undefined -(some nat) -vm_sorry.lean:18:0: warning: declaration '[anonymous]' uses sorry -vm_sorry.lean:19:0: warning: declaration '[anonymous]' uses sorry -vm_sorry.lean:20:0: warning: declaration '[anonymous]' uses sorry -vm_sorry.lean:21:0: warning: declaration '[anonymous]' uses sorry diff --git a/old_tests/tests/lean/vm_string_lt_bug.lean b/old_tests/tests/lean/vm_string_lt_bug.lean deleted file mode 100644 index 43f04ac193..0000000000 --- a/old_tests/tests/lean/vm_string_lt_bug.lean +++ /dev/null @@ -1,22 +0,0 @@ -open native - -#eval to_bool ("a" < "b") -#eval to_bool ("b" < "b") - -namespace test1 -meta def m := rb_map.mk string nat - -meta def m' := m.insert "foo" 10 - -#eval m'.find "foo" -end test1 - -namespace test2 - -meta def m := rb_map.mk nat nat - -meta def m' := m.insert 3 10 - -#eval m'.find 3 - -end test2 diff --git a/old_tests/tests/lean/vm_string_lt_bug.lean.expected.out b/old_tests/tests/lean/vm_string_lt_bug.lean.expected.out deleted file mode 100644 index 1d01eb7a04..0000000000 --- a/old_tests/tests/lean/vm_string_lt_bug.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -tt -ff -(some 10) -(some 10) diff --git a/old_tests/tests/lean/whnf.lean b/old_tests/tests/lean/whnf.lean deleted file mode 100644 index f8f27ad3c1..0000000000 --- a/old_tests/tests/lean/whnf.lean +++ /dev/null @@ -1,8 +0,0 @@ -open nat - -#reduce [whnf] (fun x, x + 1) (2:nat) -#reduce (fun x, x + 1) (2:nat) - -variable a : nat -#reduce [whnf] a + succ nat.zero -#reduce a + succ nat.zero diff --git a/old_tests/tests/lean/whnf.lean.expected.out b/old_tests/tests/lean/whnf.lean.expected.out deleted file mode 100644 index 2a13868ed4..0000000000 --- a/old_tests/tests/lean/whnf.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -succ (nat.add 2 0) -3 -succ (nat.add a 0) -succ a diff --git a/old_tests/tests/lean/whnf_cache_bug.lean b/old_tests/tests/lean/whnf_cache_bug.lean deleted file mode 100644 index 143b861a10..0000000000 --- a/old_tests/tests/lean/whnf_cache_bug.lean +++ /dev/null @@ -1,11 +0,0 @@ -open tactic - -example : true := -by do - N ← to_expr ``(nat), - e ← mk_meta_var N, - whnf e >>= trace, - s ← to_expr ``(1 + 1), - unify e s, - whnf e >>= trace, - constructor diff --git a/old_tests/tests/lean/whnf_cache_bug.lean.expected.out b/old_tests/tests/lean/whnf_cache_bug.lean.expected.out deleted file mode 100644 index 88ecbab263..0000000000 --- a/old_tests/tests/lean/whnf_cache_bug.lean.expected.out +++ /dev/null @@ -1,2 +0,0 @@ -?m_1 -nat.succ (nat.add 1 0) diff --git a/old_tests/tests/lean/whnf_core1.lean b/old_tests/tests/lean/whnf_core1.lean deleted file mode 100644 index 4fefc2346a..0000000000 --- a/old_tests/tests/lean/whnf_core1.lean +++ /dev/null @@ -1,14 +0,0 @@ -open tactic - -definition f (a : nat) := a + 2 - -attribute [reducible] -definition g (a : nat) := a + 2 - -example (a : nat) : true := -by do - to_expr ```(f a) >>= whnf >>= trace, - to_expr ```(g a) >>= whnf >>= trace, - to_expr ```(f a) >>= (λ e, whnf e reducible) >>= trace, - to_expr ```(g a) >>= (λ e, whnf e reducible) >>= trace, - constructor diff --git a/old_tests/tests/lean/whnf_core1.lean.expected.out b/old_tests/tests/lean/whnf_core1.lean.expected.out deleted file mode 100644 index 7c0a202149..0000000000 --- a/old_tests/tests/lean/whnf_core1.lean.expected.out +++ /dev/null @@ -1,4 +0,0 @@ -nat.succ (nat.add a (nat.add 1 0)) -nat.succ (nat.add a (nat.add 1 0)) -f a -a + 2 diff --git a/old_tests/tests/lean/with_cases.lean b/old_tests/tests/lean/with_cases.lean deleted file mode 100644 index 6c086639d5..0000000000 --- a/old_tests/tests/lean/with_cases.lean +++ /dev/null @@ -1,19 +0,0 @@ -open tactic - -example (p q : Prop) [s₁ : decidable p] [s₂ : decidable q] : true := -begin - unfreeze_local_instances, - with_cases { cases s₁; cases s₂ }, - trace_state, - all_goals { intros, trivial } -end - -def split (p : Prop) {q : Prop} [decidable p] (pos : p → q) (neg : ¬ p → q) : q := -decidable.by_cases pos neg - -example (p q : Prop) [decidable p] [decidable q] : true := -begin - with_cases { apply split p; apply split q; intros hq hp }, - trace_state, - all_goals { intros, trivial } -end diff --git a/old_tests/tests/lean/with_cases.lean.expected.out b/old_tests/tests/lean/with_cases.lean.expected.out deleted file mode 100644 index 894f671d71..0000000000 --- a/old_tests/tests/lean/with_cases.lean.expected.out +++ /dev/null @@ -1,40 +0,0 @@ -4 goals -case decidable.is_false, decidable.is_false -p q : Prop -⊢ ¬p → ¬q → true - -case decidable.is_false, decidable.is_true -p q : Prop -⊢ ¬p → q → true - -case decidable.is_true, decidable.is_false -p q : Prop -⊢ p → ¬q → true - -case decidable.is_true, decidable.is_true -p q : Prop -⊢ p → q → true -4 goals -case pos, pos -p q : Prop, -_inst_1 : decidable p, -_inst_2 : decidable q -⊢ q → p → true - -case pos, neg -p q : Prop, -_inst_1 : decidable p, -_inst_2 : decidable q -⊢ ¬q → p → true - -case neg, pos -p q : Prop, -_inst_1 : decidable p, -_inst_2 : decidable q -⊢ q → ¬p → true - -case neg, neg -p q : Prop, -_inst_1 : decidable p, -_inst_2 : decidable q -⊢ ¬q → ¬p → true diff --git a/old_tests/tests/lean/wrong_arity.lean b/old_tests/tests/lean/wrong_arity.lean deleted file mode 100644 index aab37aa129..0000000000 --- a/old_tests/tests/lean/wrong_arity.lean +++ /dev/null @@ -1,5 +0,0 @@ -open nat - -theorem succ_ne_self : ∀ (n : ℕ), succ n ≠ n -| 0 h := absurd h (nat.succ_ne_zero 0) -| n := sorry diff --git a/old_tests/tests/lean/wrong_arity.lean.expected.out b/old_tests/tests/lean/wrong_arity.lean.expected.out deleted file mode 100644 index 806d096fd3..0000000000 --- a/old_tests/tests/lean/wrong_arity.lean.expected.out +++ /dev/null @@ -1 +0,0 @@ -wrong_arity.lean:5:6: error: invalid match/equations expression, each case must have the same number of patterns diff --git a/packages/.gitignore b/packages/.gitignore deleted file mode 100644 index 1cb9f3cfa7..0000000000 --- a/packages/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.olean -/_target -/leanpkg.path diff --git a/packages/leanpkg.toml b/packages/leanpkg.toml deleted file mode 100644 index 0a32219ee2..0000000000 --- a/packages/leanpkg.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "test_registry" -version = "0.1" -lean_version = "master" - -[dependencies] -super = { git = "https://github.com/leanprover/super", rev = "master" } -mini_crush = { git = "https://github.com/leanprover/mini_crush", rev = "master" } diff --git a/tmp/bad2.lean b/tmp/bad2.lean deleted file mode 100644 index a5485870e8..0000000000 --- a/tmp/bad2.lean +++ /dev/null @@ -1,7 +0,0 @@ -inductive imf (f : nat → nat) : nat → Type -| mk1 : ∀ (a : nat), imf (f a) -| mk2 : imf (f 0 + 1) - -definition inv_2 (f : nat → nat) : ∀ (b : nat), imf f b → {x : nat \ x > b} →nat -| ⌞f a⌟ (imf.mk1 ⌞f⌟ a) x := a -| ⌞f 0 + 1⌟ (imf.mk2 ⌞f⌟) x := subtype.elt_of x diff --git a/tmp/bench30.lean b/tmp/bench30.lean deleted file mode 100644 index ff3b88755d..0000000000 --- a/tmp/bench30.lean +++ /dev/null @@ -1,11 +0,0 @@ -lemma {u} ex {α : Type u} [linear_ordered_comm_ring α] - (a_1 a_2 a_3 a_4 a_5 a_6 a_7 a_8 a_9 a_10 - a_11 a_12 a_13 a_14 a_15 a_16 a_17 a_18 a_19 a_20 - a_21 a_22 a_23 a_24 a_25 a_26 a_27 a_28 a_29 a_30 : α) : - a_1 + a_2 + a_3 + a_4 + a_5 + a_6 + a_7 + a_8 + a_9 + a_10 -+ a_11 + a_12 + a_13 + a_14 + a_15 + a_16 + a_17 + a_18 + a_19 + a_20 -+ a_21 + a_22 + a_23 + a_24 + a_25 + a_26 + a_27 + a_28 + a_29 + a_30 = - a_30 + a_29 + a_28 + a_27 + a_26 + a_25 + a_24 + a_23 + a_22 + a_21 + - a_20 + a_19 + a_18 + a_17 + a_16 + a_15 + a_14 + a_13 + a_12 + a_11 + - a_10 + a_9 + a_8 + a_7 + a_6 + a_5 + a_4 + a_3 + a_2 + a_1 := -by simp diff --git a/tmp/debugger_example.lean b/tmp/debugger_example.lean deleted file mode 100644 index b18b57871f..0000000000 --- a/tmp/debugger_example.lean +++ /dev/null @@ -1,11 +0,0 @@ -import tools.debugger - -set_option debugger true -set_option debugger.autorun true - -open tactic - -local attribute [breakpoint] tactic.constructor - -example (p q : Prop) : p → q → p ∧ q := -by do intros, constructor, repeat assumption diff --git a/tmp/div2.lean b/tmp/div2.lean deleted file mode 100644 index f0681087eb..0000000000 --- a/tmp/div2.lean +++ /dev/null @@ -1,19 +0,0 @@ -def R : (Σ _ : nat, nat) → (Σ _ : nat, nat) → Prop := -sigma.lex nat.lt (λ _, empty_relation) - -def Rwf : well_founded R := -sigma.lex_wf nat.lt_wf (λ _, empty_wf) - -set_option trace.debug.eqn_compiler.wf_rec true -set_option trace.eqn_compiler.wf_rec true -set_option trace.app_builder true --- set_option trace.eqn_compiler.elim_match true - -def Div : nat → Prop → nat → nat -| x p y := - if h : 0 < y ∧ y ≤ x - then - have x - y < x, from nat.sub_lt (nat.lt_of_lt_of_le h.left h.right) h.left, - Div (x - y) p y + 1 - else 0 --- using_well_founded R Rwf diff --git a/tmp/even_odd.lean b/tmp/even_odd.lean deleted file mode 100644 index 0bba9914d2..0000000000 --- a/tmp/even_odd.lean +++ /dev/null @@ -1,41 +0,0 @@ -import data.vector -open nat -universes u v - --- set_option trace.eqn_compiler.wf_rec true -set_option trace.debug.eqn_compiler.wf_rec true --- set_option trace.debug.eqn_compiler.mutual true - -mutual def even, odd -with even : nat → bool -| 0 := tt -| (a+1) := odd a -with odd : nat → bool -| 0 := ff -| (a+1) := even a - -#print even -#print even._main -#print _mutual.even.odd - -#eval even 3 -#eval even 4 -#eval odd 3 -#eval odd 4 -#check even.equations._eqn_1 -#check even.equations._eqn_2 -#check odd.equations._eqn_1 -#check odd.equations._eqn_2 - -mutual def f, g {α β : Type u} (p : α × β) -with f : Π n : nat, vector (α × β) n -| 0 := vector.nil -| (succ n) := vector.cons p $ (g n p.1).map (λ b, (p.1, b)) -with g : Π n : nat, α → vector β n -| 0 a := vector.nil -| (succ n) a := vector.cons p.2 $ (f n).map (λ p, p.2) - -#check @f.equations._eqn_1 -#check @f.equations._eqn_2 -#check @g.equations._eqn_1 -#check @g.equations._eqn_2 diff --git a/tmp/fresh_name.txt b/tmp/fresh_name.txt deleted file mode 100644 index 4cf128c85b..0000000000 --- a/tmp/fresh_name.txt +++ /dev/null @@ -1,104 +0,0 @@ -Plan for fixing "mk_fresh_name". ------------ - -We want to be able create "unique" names without using global and/or -thread local variables. The motivations are: -1- Issue #1601 -2- `tactic.mk_fresh_name : tactic name` breaks referencial transparency. - We can tolerate this problem since `tactic.mk_fresh_name` is a meta function, - but the previous item is a big problem. -3- `mk_fresh_name` is not safe. In Lean 3, we expose `name` objects - in the Lean API. Thus, malicious users may create names that - are identical to names that will be returned by `mk_fresh_name` in - the future (e.g., when type checking a declaration). - It is conceivable that malicious user may create a type incorrect declaration - that will type check using this vulnerability. - -We would first add back the `name_generator` class. -https://github.com/leanprover/lean/blob/CADE25/src/util/name_generator.h - -It is really annoying to carry the name generator object around. -The plumbing can be minimized by using the following two tricks. - -1- `name_generator::mk_child` returns a new name generator that - creates names that will never clash with the ones created using - the parent name generator or any other of its descendants. - By using `mk_child`, we can avoid passing `name_generator` objects - and/or writing functions such as - ``` - std::pair foo(name_generator const & g, expr const & e); - ... - std::pair p = foo(g, e); - result_type r = p.first; - g = p.second; - - ``` - where an updated name generator is returned. With `mk_child`, we can write - ``` - result_type foo(name_generator const & g, expr const & e); - ... - result_type r = foo(g.mk_child(), e); - ``` - -2- Internal prefixes. A module `M` may want to create a local/temporary - name generator that is guaranteed to create names that will - not clash with names created by users of this module. - We say it is "local/temporary" because we do not want to - include a name generator parameter in `M`s interface. - We can accomplish that by creating a name generator with - an unique prefix that only module `M` can use. - The static method - ``` - static name name::mk_internal_unique_name(); - ``` - was created for this purpose. However, like `mk_fresh_name`, - it is not safe, since malicious users may again create the same - names using the Lean API. So, our plan is to - a) Delete `name::mk_internal_unique_name` - b) Use `_M` as a prefix for module `M` if `M` is - not a kernel module. - c) For the kernel type checker we use the prefix - `_kernel`, and throw an error if the input term - contains a name with the prefix `_kernel`. - Remark: this approach is safer than passing a name generator - as an argument to the kernel. A malicious user may manually - create the names that will be created by the name generator - in the same way he would do it in the scenario above where - `mk_fresh_name` is used. - - -The current implementation also uses `mk_tagged_fresh_name`. This -procedure is used by modules that need to create fresh names, and an -efficient method for detecting fresh names created by them. The idea -is simple, it just prefix the fresh name with an unique prefix. We can -simulate this by adding the method -`name_generator::mk_tagged_child(name const & prefix)`. Here `prefix` -must be an atomic internal name (e.g., `_inst`, `to_fmt`, etc). It -will be implemented as -``` - name_generator mk_tagged_child(name const & prefix) { - lean_assert(prefix.is_atomic()); - lean_assert(is_internal_name(prefix)); - return name_generator(prefix + next()); - } -``` - -In the new design, the parser has a name_generator and -saves it in the parser snapshots. The methods `name_generator::mk_child` -and `name_generator::mk_tagged_child` to propagate the `name_generator`. -No synchronization is needed between threads. The kernel type checker -does not take `name_generator`'s as described above. -The class `abstract_type_context` should provide a `mk_fresh_name` primitive. - -Impact on the cache -------------------- - -We have caches in thread local storage, and some of them -rely on the fact that the names returned by `mk_fresh_name` are always -different from previously generated names. This assumption will -not be true after we replace `mk_fresh_name` with the `name_generator` object. -So, we plan to implement a thread local storage reset operation described at commit -ec1a490a1. The reset operation should be performed whenever we restore a parser snapshot. - - -To be continued.... diff --git a/tmp/micro_lenses.lean b/tmp/micro_lenses.lean deleted file mode 100644 index 76458e9361..0000000000 --- a/tmp/micro_lenses.lean +++ /dev/null @@ -1,102 +0,0 @@ -universes u v w - -structure lens (α : Type u) (β : Type v) := -(get : α → β) -(modify : α → (β → β) → α) -(set : α → β → α := λ a b, modify a (λ _, b)) - -def lens.compose {α : Type u} {β : Type v} {σ : Type w} (t : lens β σ) (s : lens α β) : lens α σ := -{ get := t^.get ∘ s^.get, - modify := λ a f, s^.modify a $ λ b, t^.modify b f, - set := λ a v, s^.modify a $ λ b, t^.set b v } - -infix `∙`:1 := lens.compose - -def fst {α β} : lens (α × β) α := -{ get := prod.fst, - modify := λ ⟨a, b⟩ f, (f a, b), - set := λ ⟨a, b⟩ a', (a', b)} - -def snd {α β} : lens (α × β) β := -{ get := prod.snd, - modify := λ ⟨a, b⟩ f, (a, f b), - set := λ ⟨a, b⟩ b', (a, b') } - -def idx {α} {n} (i : fin n) : lens (array α n) α := -{ get := λ a, a^.read i, - modify := λ a f, a^.write i $ f $ a^.read i, - set := λ a b, a^.write i b } - -def modify_ith {α} : nat → list α → (α → α) → list α -| _ [] f := [] -| 0 (b::l) f := f b :: l -| (n+1) (b::l) f := b :: modify_ith n l f - -def ith {α} [inhabited α] : nat → list α → α -| 0 (a::l) := a -| (n+1) (a::l) := ith n l -| _ _ := default α - -def nth {α} [inhabited α] (i : nat) : lens (list α) α := -{ get := ith i, - modify := modify_ith i } - -set_option trace.array.update true - -def f (a : array nat 10 × array bool 5) : array nat 10 × array bool 5 := -(idx 2 ∙ snd)^.set ((idx 1 ∙ fst)^.set a 1) ff - -#eval f (mk_array 10 0, mk_array 5 tt) - -#eval (idx 2 ∙ snd)^.set ((idx 1 ∙ fst)^.set (mk_array 10 0, mk_array 5 tt) 1) ff - -#eval let p₀ := (mk_array 10 0, mk_array 5 tt), - p₁ := (idx 1 ∙ fst)^.set p₀ 1, - p₂ := (idx 2 ∙ snd)^.set p₁ ff in - p₂ - -example : (fst ∙ nth 1)^.set [(1, 2), (3, 4), (0, 3)] 30 = [(1, 2), (30, 4), (0, 3)] := -rfl - -example : (snd ∙ nth 1)^.get [(1, 2), (3, 4), (0, 3)] = 4 := -rfl - -def micro_lens (f : Type u → Type w) [functor f] (α β : Type u) := -(β → f β) → α → f α - -def micro_lens.compose {f : Type u → Type w} [functor f] {α β δ: Type u} (l₁ : micro_lens f β δ) (l₂ : micro_lens f α β) : micro_lens f α δ := -λ g a, l₂ (l₁ g) a - -instance : applicative id := -{pure := λ _ a, a, - seq := λ _ _ f a, f a} - -def micro_lens.modify {α β : Type u} (l : micro_lens id α β) (a : α) (b : β → β) : α := -l b a - -def micro_lens.set {α β : Type u} (l : micro_lens id α β) (a : α) (b : β) : α := -l (λ _, b) a - -def fconst (α : Type v) (β : Type u) : Type v := -α - -instance (α : Type v) : functor (fconst α) := -{map := λ (β δ : Type u) f a, a} - -def micro_lens.get {α β : Type u} (l : micro_lens (fconst β) α β) (a : α) : β := -l (λ b, b) a - -def pi₁ {f : Type u → Type w} [functor f] {α β : Type u} : micro_lens f (α × β) α := -λ g ⟨a, b⟩, (λ x, (x, b)) <$> g a - -def pi₂ {f : Type u → Type w} [functor f] {α β : Type u} : micro_lens f (α × β) β := -λ g ⟨a, b⟩, (λ x, (a, x)) <$> g b - -#eval micro_lens.get pi₁ (10, 20) -#eval micro_lens.get pi₂ (10, 20) -#eval micro_lens.set pi₂ (10, 20) 100 -#eval micro_lens.set (pi₁ ∘ pi₁) ((10, 20), 30) 1 -#eval micro_lens.set (pi₁ ∘ pi₂) ((10, 20), 30) 1 -#eval micro_lens.set pi₂ (((10, 20), 30) : (nat × nat) × nat) 1 -#eval micro_lens.get (pi₁ ∘ pi₂) ((10, 20), 30) -#eval micro_lens.modify (pi₁ ∘ pi₂) ((10, 20), 30) (+1) diff --git a/tmp/mini_crush.lean b/tmp/mini_crush.lean deleted file mode 100644 index e2c0fdd3a1..0000000000 --- a/tmp/mini_crush.lean +++ /dev/null @@ -1,451 +0,0 @@ -declare_trace mini_crush - -namespace mini_crush -open smt_tactic tactic - -/- Collect relevant functions -/ -meta def is_auto_construction : name → bool -| (name.mk_string "brec_on" p) := tt -| (name.mk_string "cases_on" p) := tt -| (name.mk_string "rec_on" p) := tt -| (name.mk_string "no_confusion" p) := tt -| (name.mk_string "below" p) := tt -| _ := ff - -meta def is_relevant_fn (n : name) : tactic bool := -do env ← get_env, - if ¬env^.is_definition n ∨ is_auto_construction n then return ff - else if env^.in_current_file n then return tt - else in_open_namespaces n - -meta def collect_revelant_fns_aux : name_set → expr → tactic name_set -| s e := -e^.mfold s $ λ t _ s, - match t with - | expr.const c _ := - if s^.contains c then return s - else mcond (is_relevant_fn c) - (do new_s ← return $ if c^.is_internal then s else s^.insert c, - d ← get_decl c, - collect_revelant_fns_aux new_s d^.value) - (return s) - | _ := return s - end - -meta def collect_revelant_fns : tactic name_set := -do ctx ← local_context, - s₁ ← mfoldl (λ s e, infer_type e >>= collect_revelant_fns_aux s) mk_name_set ctx, - target >>= collect_revelant_fns_aux s₁ - -/- repeat simp & intro -/ - - - -meta def collect_ctx_simps : tactic (list expr) := - - -meta def size (e : expr) : nat := -e^.fold 1 (λ e _ n, n+1) - -structure config := -(num_rounds := 5) -(max_depth := 2) -(timeout := 10000) - -meta def close_easy (cfg : config) : smt_tactic unit := -all_goals (repeat_at_most cfg^.num_rounds (ematch >> try close)) - -meta def destruct_and_close (cfg : config) (e : expr) : smt_tactic unit := -destruct e >> close_easy cfg - -meta def induction_and_close (cfg : config) (e : expr) : smt_tactic unit := -smt_tactic.induction e >> close_easy cfg - -open expr tactic - -meta def is_inductive (e : expr) : tactic bool := -do type ← infer_type e, - C ← return type^.get_app_fn, - env ← get_env, - return $ C^.is_constant && env^.is_inductive C^.const_name - -open monad - -meta def collect_inductive_aux : expr_set → expr → tactic expr_set -| S e := - if S^.contains e then return S - else do - new_S ← cond (is_inductive e) (return $ S^.insert e) (return S), - if e^.is_app - then fold_explicit_args e new_S collect_inductive_aux - else return new_S - -meta def collect_inductive : expr → tactic expr_set := -collect_inductive_aux mk_expr_set - -meta def collect_inductive_from_target_aux : tactic (list expr) := -do S ← target >>= collect_inductive, - return $ list.qsort (λ e₁ e₂, size e₁ < size e₂) $ S^.to_list - -meta def collect_inductive_from_target : smt_tactic (list expr) := -collect_inductive_from_target_aux - -meta def snapshot := smt_state × tactic_state - -meta def save : smt_tactic snapshot := -smt_tactic.read - -meta def restore : snapshot → smt_tactic unit := -smt_tactic.write - -open smt_tactic - -meta def rsimp_target : smt_tactic unit := -do ccs ← to_cc_state, - rsimp.rsimplify_goal ccs - -meta def try_snapshots {α} (cont : α → smt_tactic unit) : list (α × snapshot) → smt_tactic unit -| [] := failed -| ((a, s)::ss) := (restore s >> cont a) <|> try_snapshots ss - -meta def search {α} (max_depth : nat) (act : nat → α → smt_tactic (list (α × snapshot))) : nat → α → smt_tactic unit -| n s := do - all_goals $ try intros >> try close, - now - <|> - if n > max_depth then trace "max depth reached" >> trace_state >> failed - else all_goals $ try intros >> act n s >>= try_snapshots (search (n+1)) - -meta def init_lemmas : smt_tactic unit := -do /- Add equational lemmas for relevant functions -/ - fns ← collect_revelant_fns, - mfor' fns^.to_list add_ematch_eqn_lemmas_for, - /- Add [rsimp] lemmas -/ - get_hinst_lemmas_for_attr `rsimp_attr >>= add_lemmas - -meta def try_induction_aux (hs : hinst_lemmas) (cont : smt_tactic unit) : list expr → smt_tactic unit -| [] := failed -| (e::es) := (induction e >> all_goals (set_lemmas hs >> try intros >> cont >> now)) <|> try_induction_aux es - -meta def try_induction (hs : hinst_lemmas) (cont : smt_tactic unit) : smt_tactic unit := -collect_inductive_from_target >>= mfilter (λ e, return $ e^.is_local_constant) >>= try_induction_aux hs cont - -meta def mini_crush_1 (cfg : config := {}) : tactic unit := -using_smt $ do - init_lemmas, hs ← get_lemmas, - close_easy cfg, - now - <|> - try_induction hs (close_easy cfg) - -universe variable u - -export nat (succ) - -def is_zero : ℕ → bool -| 0 := tt -| (succ _) := ff - -def plus : ℕ → ℕ → ℕ -| 0 m := m -| (succ n') m := succ (plus n' m) - -def times : ℕ → ℕ → ℕ -| 0 m := m -| (succ n) m := plus m (times n m) - -@[simp] theorem n_plus_0 (n : ℕ) : plus n 0 = n := -by mini_crush_1 - -@[simp] theorem plus_assoc (n1 n2 n3 : nat) : plus (plus n1 n2) n3 = plus n1 (plus n2 n3) := -by mini_crush_1 - -inductive nat_list : Type -| NNil : nat_list -| NCons : nat → nat_list → nat_list - -open nat_list - -def nlength : nat_list → ℕ -| NNil := 0 -| (NCons _ ls') := succ (nlength ls') - -def napp : nat_list → nat_list → nat_list -| NNil ls2 := ls2 -| (NCons n ls1') ls2 := NCons n (napp ls1' ls2) - -theorem nlength_napp (ls1 ls2 : nat_list) : nlength (napp ls1 ls2) = plus (nlength ls1) (nlength ls2) := -by mini_crush_1 - -inductive nat_btree : Type -| NLeaf : nat_btree -| NNode : nat_btree → ℕ → nat_btree → nat_btree - -open nat_btree - -def nsize : nat_btree → ℕ -| NLeaf := succ 0 -| (NNode tr1 _ tr2) := plus (nsize tr1) (nsize tr2) - -def nsplice : nat_btree → nat_btree → nat_btree -| NLeaf tr2 := NNode tr2 0 NLeaf -| (NNode tr1' n tr2') tr2 := NNode (nsplice tr1' tr2) n tr2' - -theorem nsize_nsplice (tr1 tr2 : nat_btree) : nsize (nsplice tr1 tr2) = plus (nsize tr2) (nsize tr1) := -by mini_crush_1 - -inductive formula : Type -| Eq : nat → nat → formula -| And : formula → formula → formula -| Forall : (nat → formula) → formula - -open formula - -example forall_refl : formula := Forall (λ x, Eq x x) - -def formula_denote : formula → Prop -| (Eq n1 n2) := n1 = n2 -| (And f1 f2) := formula_denote f1 ∧ formula_denote f2 -| (Forall f') := ∀ n : nat, formula_denote (f' n) - -def swapper : formula → formula -| (Eq n1 n2) := Eq n2 n1 -| (And f1 f2) := And (swapper f2) (swapper f1) -| (Forall f') := Forall (λ n, swapper (f' n)) - -attribute [simp] formula_denote swapper - -theorem swapper_preserves_truth (f) : formula_denote f → formula_denote (swapper f) := -by induction f; simph; intros; rsimp - -exit -begin [smt] induction f, admit, admit, intros, init_lemmas, add_lemmas_from_facts, eblast, rsimp_target, intros, eblast, rsimp_target end - -exit - -begin [smt] - induction ls1, - init_lemmas, eblast - -end - - - - - - -exit - - (intros >> close >> now) - <|> - (if n > max_depth then (trace "max depth reached" >> rsimp >> trace_state) - else all_goals $ intros ) - - -exit - smt_tactic.intros >> collect_inductive_from_target >>= try_destruct cfg >>= try_snapshots (search (n+1)) - - - -meta def try_and_save {α} (t : smt_tactic α) : smt_tactic (option (α × nat × snapshot)) := -do { - s ← save, - a ← t, - new_s ← save, - n ← num_goals, - restore s, - return (a, n, new_s) -} <|> return none - -meta def try_all_aux {α} (ts : α → smt_tactic unit) : list α → list (α × nat × snapshot) → smt_tactic (list (α × nat × snapshot)) -| [] [] := failed -| [] rs := return rs^.reverse -| (v::vs) rs := do - r ← try_and_save (ts v), - match r with - | some (_, 0, s) := return [(v, 0, s)] - | some (_, n, s) := try_all_aux vs ((v, n, s)::rs) - | none := try_all_aux vs rs - end - -meta def try_all {α} (ts : α → smt_tactic unit) (vs : list α) : smt_tactic (list (α × nat × snapshot)) := -try_all_aux ts vs [] - -meta def sort_snapshots (rs : list (expr × nat × snapshot)) : list snapshot := -let ss := flip list.qsort rs $ λ ⟨e₁, n₁, _⟩ ⟨e₂, n₂, _⟩, if n₁ ≠ n₂ then n₁ < n₂ else size e₁ < size e₂ in -ss^.for $ λ ⟨_, _, s⟩, s - -meta def try_destruct (cfg : config) (es : list expr) : smt_tactic (list snapshot) := -sort_snapshots <$> try_all (destruct_and_close cfg) es - -meta def try_induction (cfg : config) (es : list expr) : smt_tactic (list snapshot) := -sort_snapshots <$> try_all (induction_and_close cfg) es - -meta def try_snapshots {α} (cont : smt_tactic α) : list snapshot → smt_tactic α -| [] := failed -| (s::ss) := (restore s >> cont) <|> try_snapshots ss - -meta def search (cfg : config) : nat → smt_tactic unit -| n := - close >> now - <|> - if n > cfg^.max_depth then trace "max depth reached" >> rsimp >> trace_state - else all_goals $ - smt_tactic.intros >> collect_inductive_from_target >>= try_destruct cfg >>= try_snapshots (search (n+1)) - -meta def with_smt (t : smt_tactic unit) : tactic unit := -using_smt_with {em_attr := `rsimp_attr} t - -meta def strategy_1 (cfg : config := {}) : tactic unit := -try_for cfg^.timeout (try simph >> try intros >> try simph >> try contradiction >> now) - -meta def strategy_2 (cfg : config := {}) : tactic unit := -try_for cfg^.timeout $ with_smt $ - collect_inductive_from_target >>= try_induction cfg >>= - try_snapshots (all_goals $ - trace "------------" >> trace_state >> now) - --- exit --- try close >> try simph >> try intros >> try simph >> try contradiction >> now) - -meta def strategy_3 (cfg : config := {}) : tactic unit := -try_for cfg^.timeout $ with_smt $ - collect_inductive_from_target >>= try_induction cfg >>= - try_snapshots (all_goals $ - trace "------------" >> trace_state >> trace "--------" >> - try close >> try (search cfg 1)) - -meta def main (cfg : config := {}) : tactic unit := -strategy_2 <|> strategy_3 - -end mini_crush - -meta def mini_crush := mini_crush.main - -universe variable u - -export nat (succ) - -def is_zero : ℕ → bool -| 0 := tt -| (succ _) := ff - -def plus : ℕ → ℕ → ℕ -| 0 m := m -| (succ n') m := succ (plus n' m) - -def times : ℕ → ℕ → ℕ -| 0 m := m -| (succ n) m := plus m (times n m) - -attribute [simp] is_zero plus - -set_option trace.smt.ematch true - -theorem n_plus_0 (n : ℕ) : plus n 0 = n := -by mini_crush.strategy_3 - -exit - -inductive nat_list : Type -| NNil : nat_list -| NCons : nat → nat_list → nat_list - -open nat_list - -def nlength : nat_list → ℕ -| NNil := 0 -| (NCons _ ls') := succ (nlength ls') - -def napp : nat_list → nat_list → nat_list -| NNil ls2 := ls2 -| (NCons n ls1') ls2 := NCons n (napp ls1' ls2) - -attribute [simp] nlength napp - -theorem nlength_napp (ls1 ls2 : nat_list) : nlength (napp ls1 ls2) = plus (nlength ls1) (nlength ls2) := -by induction ls1; rsimp - -inductive nat_btree : Type -| NLeaf : nat_btree -| NNode : nat_btree → ℕ → nat_btree → nat_btree - -open nat_btree - -def nsize : nat_btree → ℕ -| NLeaf := succ 0 -| (NNode tr1 _ tr2) := plus (nsize tr1) (nsize tr2) - -def nsplice : nat_btree → nat_btree → nat_btree -| NLeaf tr2 := NNode tr2 0 NLeaf -| (NNode tr1' n tr2') tr2 := NNode (nsplice tr1' tr2) n tr2' - -attribute [simp] nsize nsplice - -theorem plus_assoc (n1 n2 n3 : nat) : plus (plus n1 n2) n3 = plus n1 (plus n2 n3) := -by induction n1; simph - -attribute [simp] n_plus_0 plus_assoc - -theorem nsize_nsplice (tr1 tr2 : nat_btree) : nsize (nsplice tr1 tr2) = plus (nsize tr2) (nsize tr1) := -by induction tr1; simph - -export list (nil cons) - -def length {α : Type u} : list α → ℕ -| nil := 0 -| (cons _ ls') := succ (length ls') - -def app {α : Type u} : list α → list α → list α -| nil ls2 := ls2 -| (cons x ls1') ls2 := cons x (app ls1' ls2) - -attribute [simp] length app - -theorem length_app {α : Type u} (ls1 ls2 : list α) : length (app ls1 ls2) = plus (length ls1) (length ls2) := -by induction ls1; simph - - -inductive pformula : Type -| Truth : pformula -| Falsehood : pformula -| Conjunction : pformula → pformula → pformula. - -open pformula - -def pformula_denote : pformula → Prop -| Truth := true -| Falsehood := false -| (Conjunction f1 f2) := pformula_denote f1 ∧ pformula_denote f2 - -attribute [simp] pformula_denote - -open pformula - -inductive formula : Type -| Eq : nat → nat → formula -| And : formula → formula → formula -| Forall : (nat → formula) → formula - -open formula - -example forall_refl : formula := Forall (λ x, Eq x x) - -def formula_denote : formula → Prop -| (Eq n1 n2) := n1 = n2 -| (And f1 f2) := formula_denote f1 ∧ formula_denote f2 -| (Forall f') := ∀ n : nat, formula_denote (f' n) - -def swapper : formula → formula -| (Eq n1 n2) := Eq n2 n1 -| (And f1 f2) := And (swapper f2) (swapper f1) -| (Forall f') := Forall (λ n, swapper (f' n)) - -attribute [simp] formula_denote swapper - -theorem swapper_preserves_truth (f) : formula_denote f → formula_denote (swapper f) := -begin - (do s ← mini_crush.collect_revelant_fns, tactic.trace s^.to_list), - induction f; intro h; simp at h; simph; intros; rsimp - -end diff --git a/tmp/perf.info b/tmp/perf.info deleted file mode 100644 index f49b4e576b..0000000000 --- a/tmp/perf.info +++ /dev/null @@ -1,26 +0,0 @@ -NO FREE VAR OPT base - -../../library/init/algebra/ordered_field.lean 2.64 2.00 -../../library/init/algebra/ordered_group.lean 1.76 1.55 -../../library/init/data/list/lemmas.lean 1.18 1.16 - - -NO HAS LOCAL - -../../library/init/algebra/ordered_field.lean 2.00 2.00 -../../library/init/algebra/ordered_group.lean 1.55 1.55 -../../library/init/data/list/lemmas.lean 1.18 1.16 - -NO TYPE CLASS CACHE - -../../library/init/algebra/ordered_field.lean 2.20 2.00 -../../library/init/algebra/ordered_group.lean 1.58 1.55 -../../library/init/data/list/lemmas.lean 1.22 1.16 -../../perf/bench30.lean 1.08 (0.62) 0.74 (0.30 elab) (over 2300 type class resolution problems) - -NO TYPE INFERENCE CACHE - -../../library/init/algebra/ordered_field.lean 2.14 2.00 -../../library/init/algebra/ordered_group.lean 1.57 1.55 -../../library/init/data/list/lemmas.lean 1.17 1.16 -../../perf/bench30.lean 1.30 (0.83) 0.74 (0.30 elab) (over 100000 type inferences) 0.02 QED time diff --git a/tmp/wf_ex.lean b/tmp/wf_ex.lean deleted file mode 100644 index 38db365ffb..0000000000 --- a/tmp/wf_ex.lean +++ /dev/null @@ -1,171 +0,0 @@ -open tactic - -/- User spec - -f 0 0 = some 1 -f 0 m = f m 0 -f (n+1) m = match f n m with - | some a := some (a+1) - | none := none - end --/ - -/- Define f_aux using well-founded recursion -/ -constant R : (nat × nat) → (nat × nat) → Prop -axioms R_wf : well_founded R - -axiom Dec (p₂ p₁ : nat × nat) : R p₂ p₁ - -definition f_aux : Π (p₁ : nat × nat), (Π (p₂ : nat × nat), R p₂ p₁ → option nat) → option nat -| (0, 0) F := some 1 -| (0, m) F := F (m, 0) (Dec (m, 0) (0, m)) -| (n+1, m) F := match F (n, m) (Dec (n,m) (n+1, m)) with - | some a := some (a+1) - | none := none - end - -lemma f_aux.eq_1 (F : Π (p₂ : nat × nat), R p₂ (0,0) → option nat) : f_aux (0, 0) F = some 1 := -rfl - -lemma f_aux.eq_2 (m : nat) (F : Π (p₂ : nat × nat), R p₂ (0, m+1) → option nat) : - f_aux (0, m+1) F = F (m+1, 0) (Dec (m+1, 0) (0, m+1)) := -rfl - -/- The procedure is bottom-up, and will define the auxiliary function match_1 for the nexted match -/ - -definition match_1 : option nat → option nat -| (some a) := some (a+1) -| none := none - -lemma match_1.eq_1 (a : nat) : match_1 (some a) = some (a+1) := -rfl - -lemma match_1.eq_2 : match_1 none = none := -rfl - -lemma f_aux.eq_3 (n m : nat) (F : Π (p₂ : nat × nat), R p₂ (n+1, m) → option nat) : - f_aux (n+1, m) F = match_1 (F (n, m) (Dec (n,m) (n+1, m))) := -rfl - -/- "Expand" match_1 at f_aux.eq_3 -/ - -meta_definition rewrite_H (H : expr) : tactic unit := -rewrite_core semireducible tt occurrences.all ff H - -lemma f_aux.eq_3_a - (n m : nat) - (a : nat) - (F : Π (p₂ : nat × nat), R p₂ (n+1, m) → option nat) - (H : F (n, m) (Dec (n, m) (n+1, m)) = some a) : - f_aux (n+1, m) F = some (a+1) := -by do rewrite `f_aux.eq_3, get_local `H >>= rewrite_H, rewrite `match_1.eq_1 - -lemma f_aux.eq_3_b - (n m : nat) - (F : Π (p₂ : nat × nat), R p₂ (n+1, m) → option nat) - (H : F (n, m) (Dec (n, m) (n+1, m)) = none) : - f_aux (n+1, m) F = none := -by do rewrite `f_aux.eq_3, get_local `H >>= rewrite_H, rewrite `match_1.eq_2 - -/- Define f using fix -/ - -definition f (n m : nat) : option nat := -well_founded.fix R_wf f_aux (n, m) - -/- Prove lemmas about 'f' using well_founded.fix_eq -/ - -lemma f.eq_1 : f 0 0 = some 1 := -well_founded.fix_eq R_wf f_aux (0, 0) - -lemma f.eq_2 (m : nat) : f 0 (m+1) = f (m+1) 0 := -well_founded.fix_eq R_wf f_aux (0, m+1) - -lemma f.eq_3_a (n m a : nat) (H : f n m = some a) : f (n+1) m = some (a+1) := -eq.trans (well_founded.fix_eq R_wf f_aux (n+1, m)) - (f_aux.eq_3_a n m a (λ y h, well_founded.fix R_wf f_aux y) H) - -lemma f.eq_3_b (n m : nat) (H : f n m = none) : f (n+1) m = none := -eq.trans (well_founded.fix_eq R_wf f_aux (n+1, m)) - (f_aux.eq_3_b n m (λ y h, well_founded.fix R_wf f_aux y) H) - -/- Create f_aux.ind based on the structure of f_aux and generated equations -/ - -lemma f_aux.ind - (C : nat → nat → Type) - (m₁ : C 0 0) - (m₂ : ∀ m, C 0 m) - (m₃ : ∀ n m a, f n m = some a → C n m → C (n+1) m) - (m₄ : ∀ n m, f n m = none → C n m → C (n+1) m) : - Π (p₁ : nat × nat), (Π (p₂ : nat × nat), R p₂ p₁ → C (pr₁ p₂) (pr₂ p₂)) → C (pr₁ p₁) (pr₂ p₁) -| (0, 0) F := m₁ -| (0, m) F := m₂ m -| (n+1, m) F := - have C n m, from F (n, m) (Dec (n, m) (n+1, m)), - match f n m, rfl : ∀ x, f n m = x → _ with - | some a, H₁ := m₃ n m a H₁ this - | none, H₂ := m₄ n m H₂ this - end - -lemma f.ind - (C : nat → nat → Type) - (m₁ : C 0 0) - (m₂ : ∀ m, C 0 m) - (m₃ : ∀ n m a, f n m = some a → C n m → C (n+1) m) - (m₄ : ∀ n m, f n m = none → C n m → C (n+1) m) - (n m : nat) : C n m := -well_founded.fix R_wf (f_aux.ind C m₁ m₂ m₃ m₄) (n, m) - -constant unpair : nat → nat × nat -constant decode (A : Type) : nat → option A -constant decode_list (A : Type) : nat → nat → option (list A) -/- -User spec -definition decode_list_core : nat → nat → option (list A) -| 0 v := some [] -| (succ n) v := - match unpair v with - | (v₁, v₂) := - match decode A v₁ with - | some a := - match decode_list_core n v₂ with - | some l := some (a::l) - | none := none - end - | none := none - end - end --/ - -lemma decode_list_aux.ind - (A : Type) - (C : nat → nat → Type) - (m₁ : ∀ v, C 0 v) - (m₂ : ∀ n v v₁ v₂ a ls, unpair v = (v₁, v₂) → decode A v₁ = some a → decode_list A n v₂ = some ls → C n v₂ → C (n+1) v) - (m₃ : ∀ n v v₁ v₂ a, unpair v = (v₁, v₂) → decode A v₁ = some a → decode_list A n v₂ = none → C n v₂ → C (n+1) v) - (m₄ : ∀ n v v₁ v₂, unpair v = (v₁, v₂) → decode A v₁ = none → C (n+1) v) : - Π (p₁ : nat × nat), (Π (p₂ : nat × nat), R p₂ p₁ → C (pr₁ p₂) (pr₂ p₂)) → C (pr₁ p₁) (pr₂ p₁) -| (0, v) F := m₁ v -| (n+1, v) F := - match unpair v, rfl : ∀ x, unpair v = x → _ with - | (v₁, v₂), Heq₁ := - match decode A v₁, rfl : ∀ x, decode A v₁ = x → _ with - | some a, Heq₂ := - have aux : R (n, v₂) (n+1, v) → C n v₂, from F (n, v₂), - have C n v₂, from aux (Dec (n, v₂) (n+1, v)), - match decode_list A n v₂, rfl : ∀ x, decode_list A n v₂ = x → _ with - | some ls, He₃ := m₂ n v v₁ v₂ a ls Heq₁ Heq₂ He₃ this - | none, He₃ := m₃ n v v₁ v₂ a Heq₁ Heq₂ He₃ this - end - | none, Heq₂ := m₄ n v v₁ v₂ Heq₁ Heq₂ - end - end - -lemma decode_list.ind - (A : Type) - (C : nat → nat → Type) - (m₁ : ∀ v, C 0 v) - (m₂ : ∀ n v v₁ v₂ a ls, unpair v = (v₁, v₂) → decode A v₁ = some a → decode_list A n v₂ = some ls → C n v₂ → C (n+1) v) - (m₃ : ∀ n v v₁ v₂ a, unpair v = (v₁, v₂) → decode A v₁ = some a → decode_list A n v₂ = none → C n v₂ → C (n+1) v) - (m₄ : ∀ n v v₁ v₂, unpair v = (v₁, v₂) → decode A v₁ = none → C (n+1) v) - (n m : nat) : C n m := -well_founded.fix R_wf (decode_list_aux.ind A C m₁ m₂ m₃ m₄) (n, m)