lean2/tests/lean/sum3.lean.expected.out
Leonardo de Moura d4b08fcf96 feat(library/elaborator): be 'lazy' when normalizing terms in the elaborator
Unification constraints of the form

         ctx |- ?m[inst:i v] == T

         and

         ctx |- (?m a1 ... an) == T

are delayed by elaborator because the produce case-splits.
On the other hand, the step that puts terms is head-normal form is eagerly applied.
This is a bad idea for constraints like the two above. The elaborator will put T in head normal form
before executing process_meta_app and process_meta_inst. This is just wasted work, and creates
fully unfolded terms for solvers and provers.

The new test demonstrates the problem. In this test, we mark several terms as non-opaque.
Without this commit, the produced goal is a huge term.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-02-06 21:08:00 -08:00

30 lines
693 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Set: pp::colors
Set: pp::unicode
Imported 'macros'
Imported 'pair'
Imported 'subtype'
Imported 'optional'
Using: subtype
Using: optional
Defined: sum_pred
Defined: sum
Proved: sum::inl_pred
Proved: sum::inr_pred
Proved: sum::inhabl
Proved: sum::inhabr
Defined: sum::inl
Defined: sum::inr
Proved: sum::inl_inj
Proved: sum::inr_inj
Proved: sum::distinct
sum3.lean:96:0: error: invalid tactic command, unexpected end of file
Proof state:
A :
(Type U),
B :
(Type U),
n :
sum A B,
pred :
(proj1 (subtype::rep n) = optional::none) ≠ (proj2 (subtype::rep n) = optional::none)
⊢ (∃ a : A, n = sum::inl a B) (∃ b : B, n = sum::inr A b)