lean4-htt/src/frontends/lean
Leonardo de Moura 872b698bc3 feat(elaborator): add option m_assume_injectivity for getting more concise solutions
We may miss solutions, but the solutions found are much more readable.
For example, without this option, for elaboration problem

Theorem Example4 (a b c d e : N) (H: (a = b ∧ b = e ∧ b = c) ∨ (a = d ∧ d = c)) : (h a c) = (h c a) :=
    DisjCases H
              (fun H1 : _,
                   let AeqC := Trans (Conjunct1 H1) (Conjunct2 (Conjunct2 H1))
                   in CongrH AeqC (Symm AeqC))
              (fun H1 : _,
                   let AeqC := Trans (Conjunct1 H1) (Conjunct2 H1)
                   in CongrH AeqC (Symm AeqC))

the elaborator generates

Theorem Example4 (a b c d e : N) (H : a = b ∧ b = e ∧ b = c ∨ a = d ∧ d = c) : (h a c) = (h c a) :=
    DisjCases
        H
        (λ H1 : if
               Bool
               (if Bool (a = b) (if Bool (if Bool (if Bool (b = e) (if Bool (b = c) ⊥ ⊤) ⊤) ⊥ ⊤) ⊥ ⊤) ⊤)
               ⊥
               ⊤,
           let AeqC := Trans (Conjunct1 H1) (Conjunct2 (Conjunct2 H1)) in CongrH AeqC (Symm AeqC))
        (λ H1 : if Bool (if Bool (a = d) (if Bool (d = c) ⊥ ⊤) ⊤) ⊥ ⊤,
           let AeqC := Trans (Conjunct1 H1) (Conjunct2 H1) in CongrH AeqC (Symm AeqC))

The solution is correct, but it is not very readable. The problem is that the elaborator expands the definitions of \/ and /\.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-24 16:47:50 -07:00
..
CMakeLists.txt refactor(frontends/lean/elaborator): delete old_elaborator, and create frontend_elaborator class that will be based on library/elaborator/elaborator 2013-10-24 10:45:59 -07:00
coercion.h Rename lean frontend files. The prefix lean_ is not necessary anymore. 2013-09-12 20:09:35 -07:00
frontend.cpp feat(frontends/lean): add get_coercions method 2013-10-24 14:38:09 -07:00
frontend.h feat(frontends/lean): add get_coercions method 2013-10-24 14:38:09 -07:00
frontend_elaborator.cpp feat(elaborator): add option m_assume_injectivity for getting more concise solutions 2013-10-24 16:47:50 -07:00
frontend_elaborator.h feat(frontends/lean): hook new elaborator in the default frontend 2013-10-24 15:14:29 -07:00
notation.cpp Apply coding style 2013-09-13 18:48:09 -07:00
notation.h Rename lean frontend files. The prefix lean_ is not necessary anymore. 2013-09-12 20:09:35 -07:00
operator_info.cpp refactor(debug): improve lean_unreachable(), now we can avoid 'fake' return statements 2013-09-25 21:27:20 -07:00
operator_info.h Use fullpath in #include directives, add missing STL headers 2013-09-13 03:35:29 -07:00
parser.cpp feat(frontends/lean): hook new elaborator in the default frontend 2013-10-24 15:14:29 -07:00
parser.h Rename lean frontend files. The prefix lean_ is not necessary anymore. 2013-09-12 20:09:35 -07:00
pp.cpp refactor(frontends/lean/elaborator): delete old_elaborator, and create frontend_elaborator class that will be based on library/elaborator/elaborator 2013-10-24 10:45:59 -07:00
pp.h refactor(kernel): move printer and formatter objects to the kernel 2013-10-22 08:15:36 -07:00
scanner.cpp Rename lean frontend files. The prefix lean_ is not necessary anymore. 2013-09-12 20:09:35 -07:00
scanner.h Use fullpath in #include directives, add missing STL headers 2013-09-13 03:35:29 -07:00