Gabriel Ebner
04f9eb0b4f
refactor(library/init/meta/expr): pure Lean implementation of reflected
2017-06-01 10:17:51 +02:00
Leonardo de Moura
8b0cca57d1
fix(library/noncomputable): fixes #1631
...
This commit fixes issue #1631 . However, it is not a perfect solution.
This commit improves the predicate that checks whether a definition is
noncomputable or not. This predicate was implemented before we had
a code generator.
We should refactor the code and use the code generator to check
whether a definition is noncomputable or not. Otherwise, we will
keep finding mismatches between the predicate at noncomputable.cpp
and what the code generator implements.
2017-05-31 23:16:37 -07:00
Leonardo de Moura
42eeb445d4
fix(library): make sure `(t) does not evaluate t
...
See #1631
2017-05-31 22:03:15 -07:00
Leonardo de Moura
e163b5c884
feat(library/init/meta/expr): binder_info.other ==> binder_info.aux_decl
2017-05-23 21:42:52 -07:00
Sebastian Ullrich
49e5c69447
fix(init/meta/expr): have all reflected defns accept Sort
2017-05-23 11:00:33 +02:00
Sebastian Ullrich
9507297687
fix(init/meta/expr,library): reflect should accept Props
...
Fixes #1590
2017-05-19 14:17:06 +02:00
Sebastian Ullrich
84997bf4de
refactor(init/meta/expr): unify expr and pexpr
2017-05-17 10:38:12 -07:00
Leonardo de Moura
4575c9e038
feat(frontends/lean): swap (t) and ``(t) semantics
2017-05-15 09:41:31 -07:00
Sebastian Ullrich
808ab73d93
refactor(init): use list for expr.macro args
2017-05-14 19:17:28 -07:00
Sebastian Ullrich
42eb0c680e
feat(kernel/inductive,library/inductive_compiler): do not enforce positivity rule on meta inductives
2017-05-14 19:17:28 -07:00
Sebastian Ullrich
4b21b13649
refactor(init): replace has_quote class with reflected
2017-05-09 16:02:42 -07:00
Sebastian Ullrich
ead6318ee0
feat(frontends/lean/elaborator): substitute reflected locals into expr quotes
2017-05-09 16:02:41 -07:00
Sebastian Ullrich
2825c5fbcc
feat(frontends/lean/elaborator): elaborate ``(e) to type reflected e` if possible and add coercion reflected -> expr
2017-05-09 16:02:41 -07:00
Leonardo de Moura
5cef84709f
refactor(library): avoid auxiliary definitions such as add/mul/le/etc
...
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures
This commit also improves the support for projections in the
unifier/matcher.
Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b =?= @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b =?= nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b =?= @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
Sebastian Ullrich
0ca6e2c96f
refactor(library/{type_context,compiler/preprocess},frontends/lean/elaborator): use opaque, general type class instead of special app elaboration for eval_expr
2017-04-27 16:04:59 -07:00
Sebastian Ullrich
c8c8c27654
feat(init/meta): add has_to_format instances and prefer direct has_to_tactic_format implementations
2017-04-11 17:07:28 -07:00
Sebastian Ullrich
026c5ee509
fix(library/init/meta/expr,library/vm/vm_expr): fix macro args
2017-04-11 17:07:28 -07:00
Leonardo de Moura
71685e4dd6
feat(frontends/lean): add support for t.<id> and t.<idx> when t is a composite term
...
Replace `^.` with `.` in the stdlib
2017-03-28 17:47:49 -07:00
Sebastian Ullrich
3ead6be9ca
feat(init): add default value proofs to the monadic hierarchy
2017-03-27 13:42:08 -07:00
Sebastian Ullrich
9cf80a6c94
feat(init/meta/interactive): rw goal info on ]
2017-03-22 07:54:12 -07:00
Leonardo de Moura
31b6dc222d
feat(library/init/meta/expr): add expr.is_annotation
2017-03-18 13:40:11 -07:00
Daniel Selsam
538ac8d187
feat(inductive_compiler): generate injectivity lemmas
2017-03-10 22:27:18 -08:00
Johannes Hölzl
0ad5f5bc89
feat(library/init/meta/expr): add instantiate_local(s)
2017-03-07 19:30:51 -08:00
Sebastian Ullrich
5d68938a9c
feat(frontends/lean): expr literals ```(...)
2017-03-05 08:37:16 -08:00
Leonardo de Moura
57c125c60e
chore(library/init/meta/expr): unsigned ==> nat
2017-02-24 19:34:11 -08:00
Sebastian Ullrich
a443a5b7a6
chore(init/meta,tools/super): remove obsolete set_option eqn_compiler.max_steps
2017-02-23 01:52:13 +01:00
Sebastian Ullrich
908a7bd9f3
feat(frontends/lean/parser): expr patterns
2017-02-23 01:52:13 +01:00
Sebastian Ullrich
a053175714
refactor(init/meta,library/vm): use structure for position information
2017-02-21 11:06:39 -08:00
Leonardo de Moura
2f6f1eb458
feat(library/init): add helper functions
2017-02-18 16:23:15 -08:00
Johannes Hölzl
bb4920fcbc
feat(library/vm/vm_expr): export instantiate_univ_params
2017-02-17 20:08:18 -08:00
Sebastian Ullrich
e8fa54cc51
refactor(init/meta): move macro creation defs from expr to pexpr
2017-02-17 13:45:57 +01:00
Sebastian Ullrich
d15591a2d8
feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters
2017-02-17 13:45:56 +01:00
Leonardo de Moura
edd5e97045
feat(frontends/lean/elaborator): coercion from (decidable) Prop to bool
...
This is a hard coded extra case. It is not an instance of has_coe.
Even if we change has_coe to accomodate this case, it will not be a
satisfactory solution because this coercion depends on the element and
not the type, and the element usually contains metavariables.
We should eventually write a tactic for synthesizing coercions.
2017-02-14 18:41:32 -08:00
Leonardo de Moura
5ca18b8d2e
feat(library/init/meta): add helper functions
2017-02-11 16:52:06 -08:00
Leonardo de Moura
c5dc8e651a
chore(library/init/meta): cleanup
2017-02-08 15:33:25 -08:00
Gabriel Ebner
95068e4e79
feat(library/sorry): make sorry a macro
2017-02-05 14:01:03 +01:00
Gabriel Ebner
952f444710
feat(init/meta/task): allow task creation from VM
2017-01-28 08:27:23 +01:00
Leonardo de Moura
b1d097e63a
feat(library/init/meta): add 'delta' tactic for applying delta reduction
...
closes #1331
2017-01-26 19:04:07 -08:00
Leonardo de Moura
0c4c41ae54
feat(library/init/meta): produce nicer error message for overloaded simp/ematch lemma
2017-01-07 14:13:46 -08:00
Leonardo de Moura
d333c444cd
test(tests/lean/run): add tactic examples
2017-01-06 18:48:03 -08:00
Leonardo de Moura
8eadaf51d8
feat(library/init/meta/smt): add helper tactics: get_facts, proof_for, refutation_for, add_lemmas_from_facts, ...
2017-01-05 12:59:11 -08:00
Gabriel Ebner
6b15f6cef9
feat(library/tools/super): add super prover
2016-12-16 18:18:13 -08:00
Daniel Selsam
f952dbc78e
fix(init/meta/expr.lean): is_app_of can return true for constants as well
2016-12-08 11:23:53 -08:00
Jared Roesch
e65d90ac79
feat(*): C++ code generator
...
in progress move of Lean.native to init
2016-12-05 16:11:41 -08:00
Leonardo de Moura
242ad1bd65
feat(library/init/meta/comp_value_tactics): add comp_val tactic for testing
2016-11-22 17:03:21 -08:00
Leonardo de Moura
c816b80855
chore(*): don't use upper case letter for type variables, and camelCase for declarations
2016-11-17 14:54:08 -08:00
Leonardo de Moura
a7af70da2e
feat(library/vm): add expr.copy_pos_info
2016-11-10 11:50:38 -08:00
Leonardo de Moura
0d74ad97a7
chore(library/init): definition => def
2016-10-06 16:04:12 -07:00
Gabriel Ebner
6883720cc7
fix(library/init/meta/expr): consistently compare expressions
2016-10-05 15:17:02 -07:00
Leonardo de Moura
990c414b86
feat(library/init/meta/converter): add 'congr' and 'depthfirst' conversionals
2016-10-05 15:05:22 -07:00