Commit graph

8 commits

Author SHA1 Message Date
Leonardo de Moura
f650a1b873 refactor(library/init/meta): avoid '_core' idiom using default parameters
I kept a few core methods (e.g., exact_core and apply_core). Reason:
if we use default parameters

    meta constant exact (e : expr) (md := semireducible) : tactic unit

then, we will not be able to write

    to_expr p >>= exact

The workaround is

    do t <- to_expr p, exact t

or
    to_expr p >>= (fun x, exact x)

One alternative is to change how we handle default parameters, and
eta-expand applications that involve default parameters.
We may also have an attribute [eta_expand]. Then

    attribute [eta_expand] foo

instructs the elaborator to automatically eta-expand foo-applications.
The attribute would give users more control, and avoid potential
performance problems. Without the attribute, then for every function
application the elaborator has to check the type and decide whether it
must be eta-expanded or not.

@gebner @kha What do you think?
2017-02-14 09:46:55 -08:00
Sebastian Ullrich
fd2c42a8bf chore(library, tests): switch to new attribute declaration syntax
sed -Ei 's/^(\s*)((private |protected )?(noncomputable )?(abbreviation|definition|meta_definition|theorem|lemma|proposition|corollary)\s+\S+\s*)((\s*\[(\S+(\s+[0-9]+)*|priority.*)\])+)\s*/\1attribute \6\n\1\2/' library/**/*.lean tests/**/*.lean
sed -Ei 's/\s+$//' library/**/*.lean  # remove trailing whitespace
2016-08-12 15:36:12 -07:00
Leonardo de Moura
7ddf1e817b chore(frontends/lean): coercions are disabled by default 2016-07-29 13:03:23 -07:00
Leonardo de Moura
dbeb0fec16 feat(library/init/meta): export reducible and semireducible to tactic namespace 2016-06-28 10:31:01 +01:00
Leonardo de Moura
d524ab013f refactor(library/init/meta): make sure 'transparency' is the first argument 2016-06-28 10:25:38 +01:00
Leonardo de Moura
6a0f11f705 feat(library/tactic/tactic_state,library/init/meta/tactic): add mk_meta_univ, mk_meta_var, mk_const
This commit also changes the semantics of the unify tactic.
It fails if the arguments are not unifiable.
2016-06-18 11:12:51 -07:00
Leonardo de Moura
a16e3343a0 chore(library,frontends/lean): disable modules that need to be refactored 2016-06-14 10:02:11 -07:00
Leonardo de Moura
a732e8ec30 feat(library/tactic/tactic_state): add 'unify_core' where user can specify transparency mode 2016-06-11 19:14:23 -07:00