Leonardo de Moura
8e9d88c2cf
refactor(builtin/kernel): prove iff::intro, and add a new name for it boolext (Boolean extensionality)
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 18:31:45 -08:00
Leonardo de Moura
a4b3d6d6c8
refactor(builtin/kernel): prove eta using function extensionality, and rename abst and abstpi to funext and allext
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 17:25:14 -08:00
Leonardo de Moura
9c8026b86e
refactor(builtin/macros): remove 'take', 'discharge' and 'instantiate' macros
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 16:58:01 -08:00
Leonardo de Moura
bdec4c8799
refactor(builtin/Nat): mark constants as opaque
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 16:53:08 -08:00
Leonardo de Moura
2e3b92ef36
refactor(builtin/kernel): cleanup
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 16:52:43 -08:00
Leonardo de Moura
a6e0dcc96c
fix(builtin/cast): remove dominj axiom, it is not consistent with the new semantics of Pi/forall
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 16:19:11 -08:00
Leonardo de Moura
57640ecf19
fix(library/elaborator): array bounds
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 13:18:49 -08:00
Leonardo de Moura
2b2aa228e3
refactor(builtin/kernel): start with small universes
...
The universe constraint manager is more flexible now.
We don't need to start with a huge universe U >= 512.
We can start small, and increase it on demand.
If module mod1 needs it, it can always add
universe U >= 3
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 12:35:00 -08:00
Leonardo de Moura
cfe576f551
fix(library/elaborator): bug in the elaborator
...
The elaborator was not handling correctly constraints of the form
ctx |- ?m << (Pi x : A, B)
and
ctx |- (Pi x : A, B) << ?m
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 12:10:50 -08:00
Leonardo de Moura
dd6c13abb0
fix(util/buffer): warning produced by clang++
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 11:27:11 -08:00
Leonardo de Moura
85de05e5cf
chore(kernel/unification_constraint): update max_constraint comment to reflect its new semantics
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 01:09:47 -08:00
Leonardo de Moura
abf61be8f6
chore(library/tactic): remove imp_tac, it is not needed anymore
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 00:57:04 -08:00
Leonardo de Moura
048151487e
feat(kernel): use Pi as forall/implication
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-08 00:38:39 -08:00
Leonardo de Moura
e12d6e44cd
fix(util/name): bug in Lua API
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 17:52:51 -08:00
Leonardo de Moura
8ce6266e6b
feat(library/kernel_bindings): add new predicates for kernel objects in the Lua API
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 17:36:54 -08:00
Leonardo de Moura
6f4ca7bd2a
feat(frontends/lean): expose is_explicit function in the Lua API
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 17:36:27 -08:00
Leonardo de Moura
4fdc0406be
feat(util/name): additional methods to name Lua API
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 17:35:34 -08:00
Leonardo de Moura
248d55d454
chore(util/script_state): remove dead code
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 16:59:50 -08:00
Leonardo de Moura
2cd2527d9f
refactor(shell): move read-eval-loop script to repl.lua
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 16:56:22 -08:00
Leonardo de Moura
0bc2c51c9c
fix(build): put back the dependency on lean executable for .olean files
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 16:13:58 -08:00
Leonardo de Moura
d12d0f036f
feat(kernel/environment): universe variables now live in their own namespace
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 15:57:36 -08:00
Leonardo de Moura
95515ca5df
chore(*): fix warnings produced by clang++
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 15:39:49 -08:00
Leonardo de Moura
a3af87f8d3
chore(frontends/lean/frontend): remove dead code
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 15:28:21 -08:00
Leonardo de Moura
0363faeec8
fix(frontends/lean/scanner): assertion violation, and add more tests
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 15:12:34 -08:00
Leonardo de Moura
fb73514913
fix(frontends/lean/parser): parser aborted if the scanner throws an exception in the first call to scan(); position information was being shown twice for scanner exceptions
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 15:04:30 -08:00
Leonardo de Moura
f12a76a5cd
test(frontends/lean/scanner): missing tests
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 15:03:46 -08:00
Leonardo de Moura
c7338a8eab
chore(frontends/lean/scanner): remove dead code
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 14:37:28 -08:00
Leonardo de Moura
29db6accb8
test(tests/lean): new tests for exercising the environment object
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 14:34:21 -08:00
Leonardo de Moura
f67eab000b
fix(util/serializer): nontermination on corrupted files
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 14:21:54 -08:00
Leonardo de Moura
d5ddb186d9
feat(library/kernel_bindings): add load method to Lua API
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 14:21:24 -08:00
Leonardo de Moura
6077dc61b7
feat(builtin): remove lean executable as a dependency for builtin .lean files
...
Otherwise, we have to rebuild all .lean files whenever we change the executable.
This commit also adds a test for each .lean file.
This is useful for increasing coverage and having a log on how long does it take to process these files.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 13:53:30 -08:00
Leonardo de Moura
0a20356a51
fix(kernel/environment): we should not add an universe contraint object to the set of object when an integer overflow occurs
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 13:43:22 -08:00
Leonardo de Moura
17c4cce89c
fix(library/elaborator): remove_detail procedure was keeping a lot of details when typeof_mvar_justification was being used
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 13:24:46 -08:00
Leonardo de Moura
0f1737d62c
fix(frontends/lean): more precise position information for infix operators
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 13:19:26 -08:00
Leonardo de Moura
0bdecb6aa4
style(builtin/Nat): name convention
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 00:05:51 -08:00
Leonardo de Moura
c5d13abd6f
refactor(builtin/Nat): rename destruct to discriminate
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 23:05:27 -08:00
Leonardo de Moura
abb9b8af83
fix(frontends/lean): bug in pop::context command, and add new tests for the universe command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 17:14:07 -08:00
Leonardo de Moura
4424a314e0
feat(kernel): add get_universe_distance method
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 17:13:13 -08:00
Leonardo de Moura
5fe8c32da9
feat(kernel): use new universe contraints in the environment, allow new constraints to be added
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 16:46:11 -08:00
Leonardo de Moura
b5a30855f8
feat(kernel/universe_constraints): add new class for managing universe constraints
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 15:01:28 -08:00
Leonardo de Moura
68832dc6f2
fix(builtin/macros): comments
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 12:07:13 -08:00
Leonardo de Moura
929a536e2f
fix(builtin/README): update documentation
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 12:03:11 -08:00
Leonardo de Moura
62bb2ab2f9
fix(builtin/Nat): name convention
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 11:41:14 -08:00
Leonardo de Moura
645e748302
feat(frontends/lean): add 'using' command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 11:41:14 -08:00
Leonardo de Moura
8c956280d9
chore(frontends/lean): rename setoption and setopaque commands to set::option and set::opaque
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-06 11:41:03 -08:00
Leonardo de Moura
7222a2d1a9
feat(builtin/kernel): use the same notation for mp, eq::mp and forall::elim
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 21:39:31 -08:00
Leonardo de Moura
935c2a03a3
feat(*): change name conventions for Lean builtin libraries
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 19:21:44 -08:00
Leonardo de Moura
771b099c0c
fix(frontends/lean): must invoke lua GC before closing a scope, reason: we may still have references to the current environment inside of the Lua state object
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 16:38:29 -08:00
Leonardo de Moura
9d6bd7501c
feat(doc/lean): include lean documentation scripts in the test set
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 13:16:47 -08:00
Leonardo de Moura
4ba097a141
feat(frontends/lean): use lowercase commands, replace 'endscope' and 'endnamespace' with 'end'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 13:06:36 -08:00
Leonardo de Moura
6569b07b7c
feat(frontends/lean/parser): rename 'show' expression to 'have'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 11:25:58 -08:00
Leonardo de Moura
0b4bdceb10
feat(builtin/macros): rename 'For' macro to 'take'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 11:08:55 -08:00
Leonardo de Moura
9f08156a73
feat(frontends/lean/parser): combine Echo and Show commands into the 'print' command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 11:03:35 -08:00
Leonardo de Moura
ce1213a020
feat(frontends/lean): use '(* ... *)' instead of '(** ... **)' for script code blocks
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 10:32:47 -08:00
Leonardo de Moura
028a9bd9bd
feat(frontends/lean/scanner): use Lua style comments in Lean
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-05 08:53:27 -08:00
Leonardo de Moura
f5cc2458a9
fix(frontends/lean/parser_calc): missing save calls
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-03 18:26:30 -08:00
Leonardo de Moura
fbe0bccf51
chore(*): name convention, proof construnction functions/macros start with upper-case
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-03 18:11:01 -08:00
Leonardo de Moura
9eb4dc4a81
feat(kernel, library/elaborator, frontends/lean): improve how elaborator_exceptions are displayed in the Lean frontend
...
This commit affects different modules.
I used the following approach:
1- I store the metavariable environment at unification_failure_justifications. The idea is to capture the set of instantiated metavariables at the time of failure.
2- I added a remove_detail function. It removes propagation steps from the justification tree object. I also remove the backtracking search space associated with higher-order unificiation. I keep only the search related to case-splits due to coercions and overloads.
3- I use the metavariable environment captured at step 1 when pretty printing the justification of an elaborator_exception.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-03 17:18:23 -08:00
Leonardo de Moura
66ec538c63
doc(doc/lean/calc.md): calculational proof documentation
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-03 11:52:21 -08:00
Leonardo de Moura
5b5cebe750
refactor(builtin/Nat): use obtain-from instead of ExistsElim, and use more user-friendly argument order for Induction
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-03 10:33:57 -08:00
Leonardo de Moura
9f3706e365
feat(builtin/macros): add obtain-from macro for ExistsElim
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-03 10:32:49 -08:00
Leonardo de Moura
d7efdff83d
feat(builtin/Nat): add more leq theorems
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 22:48:10 -08:00
Leonardo de Moura
cf35e7bed7
feat(frontends/lean): add support for disequalities in calculational proofs
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 22:47:45 -08:00
Leonardo de Moura
6329d1828d
feat(frontends/lean): reuse name expression
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 20:08:21 -08:00
Leonardo de Moura
92c7145d7f
feat(kernel/expr): maximize sharing before serializing
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 20:03:42 -08:00
Leonardo de Moura
2d5800ace4
feat(builtin/Nat): leq axiom, and some theorems
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 18:24:32 -08:00
Leonardo de Moura
9620b00e24
feat(kernel/metavar): is instantiate_metavars, we are also instantiating assigned metavariables that occur in the local context of unassinged ones.
...
This modification improves the effectiveness of the process_metavar_inst procedure in the Lean elaborator.
For example, suppose we have the constraint
ctx |- ?M1[inst:0 ?M2] == a
If ?M1 and ?M2 are unassigned, then we have to consider the two possible solutions:
?M1 == a
or
?M1 == #0 and ?M2 == a
On the other hand, if ?M2 is assigned to b, then we can ignore the second case.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 16:08:38 -08:00
Leonardo de Moura
ecc5d1bc3a
refactor(kernel): move printer to library, cleanup io_state interface
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 13:37:50 -08:00
Leonardo de Moura
0592261847
refactor(kernel/io_state): move io_state_stream to library
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 13:14:21 -08:00
Leonardo de Moura
b81d3309b9
fix(kernel): remove ios hack
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 13:03:25 -08:00
Leonardo de Moura
9c5fa72f56
fix(library/elaborator): avoid unused variable warning in release build
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 12:40:41 -08:00
Leonardo de Moura
430b75f38f
test(tests/lean): add version of the Nat library full of holes
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 12:31:13 -08:00
Leonardo de Moura
307099b1cb
refactor(builtin/Nat): cleanup all proofs using calculational proof style
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 12:13:26 -08:00
Leonardo de Moura
e714bd7982
feat(frontends/lean): add syntax sugar for applying Subst in calculational proofs
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 11:23:55 -08:00
Leonardo de Moura
111949b9be
feat(frontends/lean): calculational proofs
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 10:53:14 -08:00
Leonardo de Moura
0cb741285c
chore(*): do not type check imported modules when running .cpp tests
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 07:11:55 -08:00
Leonardo de Moura
d7493ea86c
refactor(frontends/lean/parser): use std::function
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 06:53:34 -08:00
Leonardo de Moura
5540fc861a
refactor(frontends/lean/parser): break parser in smaller chunks
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 06:48:40 -08:00
Leonardo de Moura
7d18e9b32e
refactor(frontends/lean/parser): cleanup
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-02 04:37:21 -08:00
Leonardo de Moura
49425f1a5b
feat(builtin/Nat): multiplication axioms and theorems
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 21:32:07 -08:00
Leonardo de Moura
d72b165db4
feat(builtin/Nat): cleanup and add PlusAssoc
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 17:19:12 -08:00
Leonardo de Moura
aa009b6b05
feat(builtin/Nat): add basic axioms and theorems
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 15:53:53 -08:00
Leonardo de Moura
b2a8f4118d
feat(library/elaborator): process ho-match before normalizing
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 14:46:19 -08:00
Leonardo de Moura
7726ccad28
chore(builtin): rename nat, int and real modules to Nat, Int and Real.
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 13:52:25 -08:00
Leonardo de Moura
43909ca66b
feat(frontends/lean/pp): pretty print SetOpaque command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 13:16:44 -08:00
Leonardo de Moura
770145a361
feat(builtin): use namespaces when defining nat, int and real.
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 12:55:09 -08:00
Leonardo de Moura
d633622d90
feat(frontends/lean/parser): namespaces
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 12:28:18 -08:00
Leonardo de Moura
c423198a69
feat(builtin/kernel): add Not.*Elim theorems
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 11:35:21 -08:00
Leonardo de Moura
a8bc9fb4e0
refactor(builtin/kernel): mark exists as opaque after proving key theorems
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 11:00:32 -08:00
Leonardo de Moura
74cae2a154
refactor(library/elaborator): remove hackish rule
...
After the recent fixes, the hack in process_metavar is not needed anymore.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 10:55:39 -08:00
Leonardo de Moura
5f29146e0b
feat(library/elaborator): use is_convertible for constraints without metavariables in the elaborator
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 03:14:01 -08:00
Leonardo de Moura
cbd1f98365
fix(library/elaborator): bug at method process_metavar_inst, add new test that exposed the bug
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-01 03:02:41 -08:00
Leonardo de Moura
0d815b8594
refactor(kernel/context): hide that the context is implemented using lists
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-31 19:43:50 -08:00
Leonardo de Moura
1cb7408c46
fix(kernel/normalizer): metavariable reification was incorrect, add tst11 at tests/kernel/normalizer.cpp to expose the bug
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-31 16:24:36 -08:00
Leonardo de Moura
cd3bbb1ebf
fix(kernel/builtin): enforcing design decision: semantic attachments are NOT simplifiers, they should do only evaluation
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-31 10:14:17 -08:00
Leonardo de Moura
c485b4bc4c
fix(kernel/environment): binary file reader, force the file to be read in binary mode
...
We need this flag to be able to read the file on Windows.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-30 18:20:40 -08:00
Leonardo de Moura
1f6e959139
feat(deserializer): protect against corrupted binary files
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-30 18:05:38 -08:00
Leonardo de Moura
c473a484bb
feat(util/object_serializer): protect against corrupted files
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-30 17:58:20 -08:00
Leonardo de Moura
390a78a8d2
chore(frontends/lean/parser): remove 'Skipped' message
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-30 15:35:12 -08:00
Leonardo de Moura
909b10f515
fix(builtin): dependency
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-30 15:31:19 -08:00