Commit graph

806 commits

Author SHA1 Message Date
Leonardo de Moura
4b6583ae9f refactor(util): move mpz/mpq to util
The new lean_obj objects will be defined at util.
Reason: we will define `name`, `options`, `format`, ... on top of lean_obj.
lean_obj depends on mpz.
Remark: lean_obj will replace vm_obj.
2018-04-12 16:43:11 -07:00
Leonardo de Moura
d1cdae9d90 chore(util/sequence): remove dead code 2018-04-12 16:43:10 -07:00
Leonardo de Moura
efb9fb0802 chore(kernel): remove opportunistic hash consing support
It just adds extra complexity and is in conflict for our plans for
Lean4. Moreover, in our experiments it impacts negatively on
performance: master and lean4 branches. The negative impact has been
confirmed by @kha too.
2018-04-12 16:43:10 -07:00
Leonardo de Moura
39ef7aeee2 chore(util): remove memory_pool
memory_pool object introduces memory contention and unnecessary
complexity. Moreover, it actually reduces performance when we compile
Lean using JEMALLOC.

Here are the numbers for corelib

jemalloc with memory_pool:    13.83 secs
jemalloc without memory_pool: 13.60 secs
2018-04-12 16:43:10 -07:00
Leonardo de Moura
1dd7165694 chore(util): remove dead code 2018-04-12 16:43:10 -07:00
Leonardo de Moura
4c14668bf0 chore(util/lru_cache): remove dead code 2018-04-12 16:43:10 -07:00
Leonardo de Moura
e3c1f6c7da chore(util/numerics): remove more leftovers from Lean1 2018-04-12 16:43:10 -07:00
Leonardo de Moura
46b0fd35ec chore(util/numerics): remove Z/pZ field
This abstraction was added when we started Lean.
We wanted to focus on nonlinear arithmetic and support dReal.
The zpz module was going to be used to implement polynomial
factorization procedures similar to the ones in Z3 and computer algebra
systems.

This is not a goal for the Lean project anymore.
2018-04-12 16:43:10 -07:00
Leonardo de Moura
ee3589d99c chore(util/numerics): remove float/double
These two abstractions were added when we planned to have an efficient
Simplex module, written in C++, in Lean. We have moved this module to
Z3. So, we don't need these abstractions anymore.
2018-04-12 16:43:10 -07:00
Leonardo de Moura
e938a75361 chore(util/numerics): remove binary rationals
Binary rationals were added when we started the Lean project.
We wanted to use them to implement an algebraic number module similar to the
one we implemented in Z3.
If one day we implement algebraic numbers in Lean, we will do it in Lean
instead of C++.
2018-04-12 16:43:10 -07:00
Leonardo de Moura
ee8a79a270 chore(*): remove C API 2018-04-10 16:48:02 -07:00
Nuno Lopes
9152aaa7d6 fix(bit_tricks): make sure no one calls math.h's log2()
this fixes the bit_trick test with MSVC
2018-03-06 11:21:28 -08:00
Leonardo de Moura
bdea7d420d chore(*): type_context ==> type_context_old 2018-03-05 12:38:24 -08:00
Nuno Lopes
7b45d28e77 chore(unicode): use utf8 chars directly in strings 2018-02-13 10:42:08 -08:00
Nuno Lopes
977e11f9be fix(warnings): fix warnings on VS. its now /W2 clean 2018-02-13 10:42:08 -08:00
Nuno Lopes
a8594c5bd0 fix(msvc): fix linking of .exe 2018-02-06 10:11:10 -08:00
Leonardo de Moura
cee73e8309 chore(util/lp): remove lp module
It has been moved to Z3.
2018-01-23 12:18:30 -08:00
Nuno Lopes
0d820fa23d fix(build): fix Cygwin build 2018-01-22 18:07:04 -08:00
Mario Carneiro
f369e34bd6 chore(library/standard): remove standard.lean (unused, and confusing given stdlib) 2017-07-28 16:47:53 +01:00
Sebastian Ullrich
16fe494736 feat(frontends/lean/scanner): accept arbitrary escaped identifiers 2017-06-28 10:43:19 -07:00
Leonardo de Moura
6af3084f9a feat(util/numerics/mpz): add mpz(uint64) constructor 2017-06-02 16:36:40 -07:00
Leonardo de Moura
d21945fa86 feat(library/phash_map): add persistent hash_map based on phashtable 2017-05-05 12:36:13 -07:00
Leonardo de Moura
4c9247d220 test(tests/library/phashtable): another perf test 2017-05-04 16:29:19 -07:00
Leonardo de Moura
9d5dacd554 test(tests/library/phashtable): add tests 2017-05-04 16:18:03 -07:00
Leonardo de Moura
bdf4d69702 feat(library): add persistent hashtable based on parray 2017-05-04 15:35:25 -07:00
Leonardo de Moura
ae96ebf6ee feat(library/parray): split "long" delta paths 2017-05-03 16:07:49 -07:00
Leonardo de Moura
6092966702 fix(library/parray): missing desctrutor/constructor invocations at reroot 2017-05-03 13:17:26 -07:00
Leonardo de Moura
97ab603325 feat(library/parray): add ensure_unshared 2017-05-03 12:57:15 -07:00
Leonardo de Moura
a69052e7ee feat(library/parray): add parray thread safe version
We will use the thread safe version for implementing persistent hash maps.
The hash maps will be used to implement decision procedures and refactor
the congruence closure and ematching modules.
The persistent hash maps based on thread safe parrays are performant
when most of the time there is a single thread updating them.

We use a small hack to make sure we don't have any overhead for

   parray<T, false>

i.e., the thread unsafe version used in the VM.
2017-05-02 17:15:09 -07:00
Leonardo de Moura
1ffc01f1d5 chore(tests/frontends/lean/lean_scanner): fix test 2017-03-28 18:00:19 -07:00
Gabriel Ebner
d90dda01b0 chore(*): fix tests 2017-03-23 09:03:43 +01:00
Gabriel Ebner
a591e35544 chore(*): fix tests 2017-03-23 09:00:59 +01:00
Corey Richardson
52f84c139b chore(lp): don't use readdir_r on glibc
glibc (unfortunately) deprecated readdir_r, as their readdir is already
reentrant. Future versions of POSIX will assume readdir is reentrant,
see https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html
2017-03-22 08:24:55 -07:00
Sebastian Ullrich
b3887f21a4 fix(shell/server): remove unnecessary dependencies of info_task and use intermediate envs 2017-03-08 10:40:59 -08:00
Leonardo de Moura
04fd50e4e8 chore(*): fix tests and style 2017-02-20 23:53:44 -08:00
Leonardo de Moura
e9a98362d3 feat(library): functional arrays 2017-02-20 22:00:02 -08:00
Leonardo de Moura
7eef501ae1 chore(*): remove mpfr dependency
closes #1380
2017-02-17 20:36:53 -08:00
Sebastian Ullrich
9d8c84713c refactor(*): reduce exception context info from expr to pos_info 2017-02-17 13:45:57 +01:00
Leonardo de Moura
8f2a8a3cd3 chore(tests/shell): leftover 2017-02-15 21:40:27 -08:00
Leonardo de Moura
7ebf16ca26 fix(library/equations_compiler): performance issues at structural_rec module and equational lemma generator
There were two performance bottlenecks in the recursive equation
compiler. Both bottlenecks were due to conversion checking.

1- We allow patterns such as (x+1) in the left-hand-side of a
   recursive equation. This is kind of pattern has to be reduced
   since it is not a constructor. Moreover, when we are trying to
   compile using structural recursion, we need to find an element
   that is structurally smaller in recursive applications.
   Again, we need to use reduction since the pattern may be (x+2),
   and in the recursive application we have (x+1). Now, consider
   the following equation

         f (x+1) (y+1) := f complex_term y

   It will first check whether complex_term is structurally smaller
   than (x+1), and the compiler will timeout trying to reduce
   complex_term.

   This commit adds the following workaround. The structural
   recursion module from now on will only unfold reducible constants
   and constants marked as patterns. This is not a complete
   solution. It will timeout in the following equation:

         f (x+1) (y+1) := f (x+1000000000000) y

   For this one, we need to add a whnf "fuel" option to type_context

2- Equational lemma generation was producing lemmas that are too
   expensive to check. Suppose we the following two definitions

       | f x 0     := 1
       | f x (y+1) := f complex_term y

    and

       | g 0     y    := 1
       | g (x+1) y    := g x complex_term

    Before this commit, we would generate the following proofs for
    the second equation of each definition:

         eq.refl (f complex_term y)
         eq.refl (g x complex_term)

    This proof triggers the following definitionally equality test:

             f x     (y+1)  =?= f complex_term y
             g (x+1) y      =?= g x complex_term

    Since, we have f/g on both sides, the type checker will try
    first to unify the arguments, and may timeout trying to solve

               x  =?= complex_term
               y  =?= complex_term

    since it may take a long time to reduce `complex_term`.

    We workaround this problem by creating a slightly different
    proof.

          eq.refl (unfold_of(f x (y+1)))
          eq.refl (unfold_of(g (x+1) y))

    where unfold_of(t) is the result of applying one delta reduction
    step.
2017-02-15 21:31:28 -08:00
Leonardo de Moura
002ffc81bb fix(tests/shared/univ): memory access violation 2017-02-12 16:29:13 -08:00
Leonardo de Moura
4fdd512636 fix(tests/shared/univ): bus error on OSX 2017-02-11 09:27:46 -08:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
Leonardo de Moura
01414cf21c feat(frontends/lean): add token class, and procedure for consuming the tokens 2017-02-03 18:11:06 -08:00
Gabriel Ebner
61804eb8e9 chore(util/sexpr): remove mpz and mpq cases 2017-01-31 09:39:31 +01:00
Leonardo de Moura
52164d56b9 chore(tests/shell/shell): style 2017-01-13 07:39:06 -08:00
Sebastian Ullrich
b180c54c0e feat(shell): move lean.js to server mode 2017-01-13 07:34:54 -08:00
Gabriel Ebner
2867163db0 fix(tests): initialize util module 2016-12-08 13:11:53 -08:00
Gabriel Ebner
60f0f30c5c fix(tests/shared/thread): fix single-threaded build 2016-12-08 07:13:48 -08:00
Leonardo de Moura
f9a0029a47 chore(tests/util/thread): enable test on OSX 2016-12-05 09:24:17 -08:00