Commit graph

693 commits

Author SHA1 Message Date
Leonardo de Moura
b9489ce585 fix(frontends/let): let-expression pretty printer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-29 10:58:27 -07:00
Leonardo de Moura
d8548369e7 feat(frontends/lean/pp): improve let-expr pretty printer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-29 07:46:58 -07:00
Leonardo de Moura
be56fcf0bd fix(frontends/lean/pp): pretty print 'let-expressions', closes #87
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 18:20:58 -07:00
Leonardo de Moura
1e80a9dfe9 feat(frontends/lean): avoid exponential blowup when processing let-expressions with a lot of sharing, cleanup show-expression
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 16:27:52 -07:00
Leonardo de Moura
d536475e49 refactor(library): more implicit_args for: and_assoc, and_comm, or_assoc, or_comm, if_pos, if_neg
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 11:10:04 -07:00
Leonardo de Moura
6b7e79b62f feat(library/data/nat): mark more arguments implicit
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 10:38:58 -07:00
Leonardo de Moura
8de9cab62d test(tests/lean/interactive): add --server test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 07:41:38 -07:00
Jeremy Avigad
00a049a667 refactor(library/logic): rename connectives -> core, basic -> connectives 2014-08-27 18:43:24 -07:00
Leonardo de Moura
2d78387541 refactor(library/logic/basic): rename absurd_elim to absurd, delete contrapos and trivial_not_true theorems
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-27 18:34:09 -07:00
Leonardo de Moura
477b7b4811 fix(tests/lean/run/class_coe): adjust test to reflect library changes
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-27 17:55:42 -07:00
Leonardo de Moura
8719dff361 fix(frontends/lean): distribute '@' over choice
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-27 16:31:18 -07:00
Leonardo de Moura
c7e9e238ec fix(frontends/lean/server): ignore output produced by worker thread, fixes #98
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-27 10:46:49 -07:00
Leonardo de Moura
a8d58fdd33 refactor(library): mark absurd_elim argument as implicit
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-26 18:27:39 -07:00
Leonardo de Moura
dd99e60a00 refactor(frontends/lean/info_manager): store environment+options in the info_manager, fixes #96
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-26 18:07:09 -07:00
Leonardo de Moura
4ab0dd4700 fix(tests/lean): adjust test to reflect recent changes
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-26 09:12:18 -07:00
Leonardo de Moura
c11fd6b0d2 fix(tests/lean/run): adjust tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-25 21:39:46 -07:00
Leonardo de Moura
04d9eb17d1 feat(kernel/conveter): improve support for proof irrelevant in the converter
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-25 11:19:18 -07:00
Leonardo de Moura
42a8fb5965 chore(tests/lean/run/matrix): simplify same_dim_irrel proof
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-25 09:27:19 -07:00
Leonardo de Moura
60d5e87a66 test(tests/lean/run): add matrix test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-25 09:04:39 -07:00
Leonardo de Moura
cbc81ea6c5 chore(*): minimize dependencies on tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-24 19:58:48 -07:00
Leonardo de Moura
dbaf81e16d refactor(library): remove unnecessary 'standard' subdirectory
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-23 18:08:09 -07:00
Jeremy Avigad
47a1c00a6d refactor(library/standard): collect notation in general_notation 2014-08-23 17:53:02 -07:00
Leonardo de Moura
2f699fa53a feat(*): make sections 'permanent', and add 'transient' contexts, closes #88
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-23 15:45:15 -07:00
Leonardo de Moura
e602c4ba49 feat(frontends/lean): change multicomment to /- ... -/
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-22 17:55:13 -07:00
Leonardo de Moura
c5a44aca44 fix(frontends/lean/elaborator): do not expose type information produced when synthesizing class instances
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-22 17:07:12 -07:00
Leonardo de Moura
a5f0593df1 feat(*): change inductive datatype syntax
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-22 15:46:10 -07:00
Leonardo de Moura
626cd952e7 test(tests/lean/run): add overload test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-22 15:23:33 -07:00
Leonardo de Moura
01000ff7df feat(library): add typed_expr macro
We use it to enforce that a let-variable has the expected type

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-22 11:26:06 -07:00
Leonardo de Moura
937c465685 fix(library/unifier): too much reduction
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-21 21:37:51 -07:00
Leonardo de Moura
07bc0727e2 feat(frontends/lean): 'let [inline]' is the default
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-21 18:24:22 -07:00
Leonardo de Moura
6cf73b51e2 fix(library/unifier): bug in occurs_check, the dependency may be eliminated by reducing term
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-21 17:56:18 -07:00
Leonardo de Moura
bb6dbe0e6f fix(library/unifier): we should preprocess choice constraints before we start solving any constraint, fixes #85
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-21 16:58:25 -07:00
Leonardo de Moura
725f5ba0a0 feat(frontends/lean): use 'begin-end' instead of 'proof-qed' for blocks of tactics, closes #81
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-21 16:58:25 -07:00
Leonardo de Moura
359c72b02f fix(frontends/lean/pp): bug when pretty printing binder information, fixes #73
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-21 09:28:07 -07:00
Leonardo de Moura
8375626cb6 fix(doc/lean/tutorial): adjust tutorial to library changes, fix test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-20 18:32:53 -07:00
Jeremy Avigad
6264fb52d6 fix(lean/library/standard): fix tests, more cleanup 2014-08-20 18:04:31 -07:00
Leonardo de Moura
f5987b7bda refactor(library/unifier): make it easier to add new options to the unifier
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-20 17:30:08 -07:00
Leonardo de Moura
b60c9d9ecc test(tests/lean/run): add test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-20 16:46:19 -07:00
Leonardo de Moura
f0d50e0d33 feat(frontends/lean): change the name resolution rules: when in a namespace N that defines C, then C always refers to N.C (i.e., it overrides any alias)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-18 18:58:50 -07:00
Leonardo de Moura
08ae17650b feat(frontends/lean): try overloaded notation and declarations in the order they were defined
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-18 18:58:50 -07:00
Leonardo de Moura
919f02983e feat(frontends/lean/elaborator): case-split on coercions that cannot be resolved by postponing
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-18 18:58:50 -07:00
Leonardo de Moura
4a96fefd96 fix(library/unifier): bug in unifier priority queue
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-18 18:58:50 -07:00
Leonardo de Moura
1d306c09ee fix(tests/lean/interactive): remove leftover from test output
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-17 17:29:52 -07:00
Leonardo de Moura
05b0f24cb5 fix(frontends/lean/decl_cmds): improve error message for invalid end of theorem
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-17 17:03:54 -07:00
Leonardo de Moura
13af81d554 fix(tests/lean/interactive): adjust test output to reflect new features
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-17 15:23:53 -07:00
Leonardo de Moura
55b0a03e3d refactor(frontends/lean/info_manager): to allow cache to be used when producing info data, fixes #37, closes #45
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-17 12:16:32 -07:00
Leonardo de Moura
1436212a34 fix(library/unifier): use depth-first search strategy for solving class-instance constraints
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-16 13:51:24 -07:00
Leonardo de Moura
670bfe24f5 chore(build): remove hott library directory, and move hott tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-15 13:30:56 -07:00
Leonardo de Moura
094459504b fix(tests/lean/run): adjust test to changes in the library
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-15 13:27:18 -07:00
Leonardo de Moura
28b7d87f1f feat(frontends/lean/pp): pretty print numerals
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-14 09:12:22 -07:00
Leonardo de Moura
e778e3faec fix(tests/lean): adjust tests expected output
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-13 12:35:14 -07:00
Leonardo de Moura
60ab6d3bd8 feat(frontends/lean): remove feature that in declarations such as (A B : Type), forced A and B to be in the same universe
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-12 17:40:30 -07:00
Leonardo de Moura
7d0c0818e5 test(tests/lean/slow): add self contained path_groupoids test file
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-11 16:44:30 -07:00
Leonardo de Moura
70c0eda9fc feat(frontends/lean): make sure all scopes are closed in the end of the module
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-07 17:08:59 -07:00
Leonardo de Moura
1a67e69678 feat(library/scoped_ext): force user to end a scope with an identifier matching the one used in beginning of scope, closes #30
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-07 16:59:08 -07:00
Leonardo de Moura
2486c483cf chore(kernel/error_msgs): change type mismatch error messages, closes #33
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-07 16:18:40 -07:00
Leonardo de Moura
9e6c5695be fix(library/unifier): make sure the imitation step is type correct, fix ensure_sufficient_args
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-07 16:09:45 -07:00
Leonardo de Moura
4ad7e709aa feat(frontends/lean): default for inductive types, closes #32
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-07 07:52:37 -07:00
Leonardo de Moura
8d9ca4c4ea fix(tests/lean): remove obsolete test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-06 19:40:02 -07:00
Leonardo de Moura
a173b7f6e6 test(tests/lean/interactive): add old 'interactive' tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-06 14:57:08 -07:00
Leonardo de Moura
069f217215 fix(frontends/lean/elaborator): use full local context for metavariables due to coercions and overloads
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-05 17:21:21 -07:00
Leonardo de Moura
9cc2015caa feat(library/unifier): better error message for invalid local context
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-05 16:25:22 -07:00
Leonardo de Moura
d1924097d5 feat(library/match): add 'local' backtracking
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-05 10:09:00 -07:00
Leonardo de Moura
e6ffda0c51 feat(library/match): add basic match_plugin that just invokes whnf before failing
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-05 08:37:03 -07:00
Leonardo de Moura
56d151ef7f feat(frontends/lean): 'partial' aliases. closes #24
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-04 22:08:10 -07:00
Leonardo de Moura
50b0c17092 feat(library/unifier): add more information in error messages due to type errors when assigning metavariables
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-03 09:49:30 -07:00
Leonardo de Moura
938b4e8421 test(tests/lean/run): add unicode in identifiers test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-02 20:05:46 -07:00
Leonardo de Moura
fbc4a7af3b feat(library/unifier): when unifier.expensive == true, then use only restrict higher-order unification (a fragment slightly more general than higher-order pattern matching) for solving class-instance constraints
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-02 14:30:25 -07:00
Leonardo de Moura
5e2185cfbe feat(library/unifier): postpone as much as possible universe constraints of the form ?m1 =?= max(l1, l2) and ?m1 =?= imax(l1, l2) where ?m1 occurs in the right hand side. When there is nothing else to be done, try to solve them by reducing to ?m1 = l1 and ?m1 = l2.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-02 09:14:35 -07:00
Leonardo de Moura
3795d466c1 fix(frontends/lean/elaborator): provide type information for expressions using '@' operator, and strict function applications
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-01 20:57:24 -07:00
Leonardo de Moura
4cb8fb20fe fix(frontends/lean/elaborator): bug when mixing string and non-strict implict arguments
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-01 10:58:20 -07:00
Leonardo de Moura
01908c4dac chore(tests/lean): add 'expensive' file
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-01 10:35:32 -07:00
Leonardo de Moura
8e6324185a fix(tests/lean): adjust tests to new library structure
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-01 09:37:23 -07:00
Leonardo de Moura
6ca80b5000 feat(frontends/lean): add 'sorry'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-31 18:35:57 -07:00
Leonardo de Moura
de05c041c7 feat(library/unifier): add flag for enabling/disabling expensive extensions in the unifier
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-31 16:46:16 -07:00
Leonardo de Moura
f57fc33442 fix(library/unifier): bug that was making unifier miss solutions, and add a new case-split that tries to solve flex_rigid constraints by putting the rhs into whnf
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-31 16:46:16 -07:00
Leonardo de Moura
9637ceb86e feat(frontends/lean): allow user to provide a terminator for 'foldr' and 'foldl'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-30 15:04:44 -07:00
Leonardo de Moura
450131692a fix(library/converter): missing constraint on eta expansion
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-30 10:43:47 -07:00
Leonardo de Moura
936bb2744b fix(library/unifier): add a flag to sign that a choice constraint owns a metavariable ?m, that is, it has the right to assign ?m, and the unifier should postpone any other constraint that tries to assign ?m
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-29 17:32:55 -07:00
Leonardo de Moura
320bc55e85 fix(frontends/lean/elaborator): use preprocessed expression when displaying errors
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-29 14:25:50 -07:00
Leonardo de Moura
b15f1bb8c7 fix(frontends/lean/elaborator): apply coercions in definitions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-29 13:55:39 -07:00
Leonardo de Moura
501cae37e5 fix(frontends/lean/parser): bug in check_constant_next (when invoked inside of a section)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-29 13:04:58 -07:00
Leonardo de Moura
105c29b51e refactor(library/standard): use new coding style, rename bool.b0 and bool.b1 to bool.ff and bool.tt
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-28 19:59:38 -07:00
Leonardo de Moura
5f360cd8ec feat(kernel/error_msgs): improve application type mismatch error messages
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-28 07:08:12 -07:00
Leonardo de Moura
4b2e403023 test(tests/lean/run): add more tests sent by Cody
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-27 12:17:38 -07:00
Leonardo de Moura
faee08591f fix(*): make sure elaborator and type_checker use the same "rules" for treating opaque definitions
This is a big change because we have to store in constraints whether we can use the "relaxed" rules or not.
The "relaxed" case says that when type checking the value of an opaque definition we can treat other opaque definitions in the same module as transparent.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-27 12:12:54 -07:00
Leonardo de Moura
6ca120bf77 test(tests/lean/run): add Cody's file to test suite
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-27 08:17:46 -07:00
Leonardo de Moura
0cdd4a267c feat(frontends/lean/pp): pretty print 'show' expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-26 21:56:35 -07:00
Leonardo de Moura
60cc9ac8e2 feat(frontends/lean/pp): pretty print 'have' expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-26 21:35:26 -07:00
Leonardo de Moura
cf35c07786 fix(frontends/lean): fix 'let' annotation placement and pretty printer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-26 21:00:22 -07:00
Leonardo de Moura
206206060f test(tests/lean/hott): add some of Vladimir's definitions as tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-26 20:50:37 -07:00
Leonardo de Moura
70ef92cd5e feat(build): add tests/lean/slow test directory, and add nat_wo_hints.lean file that elaborates nat.lean without using any hint
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-26 10:53:44 -07:00
Leonardo de Moura
23af5ab217 fix(library/unifier): eager whnf application
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-26 10:37:02 -07:00
Leonardo de Moura
709b5ce90f fix(kernel/justification): duplicate position
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 21:16:49 -07:00
Leonardo de Moura
70c887a0bd fix(library/unifier): fix cryptic error message
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 21:10:32 -07:00
Leonardo de Moura
e79b0b11cf test(tests/lean/run): another test for the unifier
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 20:55:05 -07:00
Leonardo de Moura
cf44c80ffb fix(library/inductive_unifier_plugin): do not try to solve type incorrect constraints
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 16:00:38 -07:00
Leonardo de Moura
7b84503133 fix(library/unifier): do not let a unification plugin to 'prioritize' a flex-flex constraint, and add missing case
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 15:03:57 -07:00
Leonardo de Moura
0f12e5a35b fix(library/inductive_unifier_plugin): unification problem failure on problems with inductive datatypes
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 13:49:45 -07:00
Leonardo de Moura
a59eec39b8 feat(frontends/lean): improve 'type mismatch' error position, and annotate 'have'-expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 09:44:40 -07:00