Commit graph

174 commits

Author SHA1 Message Date
Leonardo de Moura
df3280e86e feat(util): add lru cache
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-03 13:26:02 -07:00
Leonardo de Moura
5a5d66edc8 feat(util/trie): add value() method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-03 01:19:23 -07:00
Leonardo de Moura
7b28419260 chore(*): disable multi thread support for OSX, remove the !defined(APPLE) directives
We should re-enable multi thread support for OSX as soon as the bug in clang is fixed.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-02 18:23:26 -07:00
Leonardo de Moura
01eda46b69 feat(util/trie): add for_each and display methods
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-13 18:23:27 -07:00
Leonardo de Moura
bfa6193bfe feat(util/trie): add merge method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-13 17:59:20 -07:00
Leonardo de Moura
479685cb97 feat(util): add basic trie datastructure
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-13 17:40:33 -07:00
Soonho Kong
468abb72b8 tests(util/rb_tree): wrap tst6 with #if !defined 2014-05-02 01:39:13 -04:00
Leonardo de Moura
2b97474958 test(util/rb_tree): reduce test time for rb_tree
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-01 10:08:18 -07:00
Leonardo de Moura
1fd447b451 chore(util): fix style
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-04-17 10:54:10 -07:00
Leonardo de Moura
c78e6787aa test(util/rb_tree): multi-thread test for rb trees
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-20 10:20:28 -07:00
Leonardo de Moura
42e253c962 fix(*): style and clang warnings
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:56 -07:00
Leonardo de Moura
f855dbb7b0 feat(util): add maps based on red-black trees
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:56 -07:00
Leonardo de Moura
1ab12eb105 refactor(util/splay_map): remove unnecessary operation
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:56 -07:00
Leonardo de Moura
528ea367ad feat(util): add red-black trees
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:56 -07:00
Leonardo de Moura
2a73389ed3 refactor(kernel): justification objects
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:56 -07:00
Leonardo de Moura
50300126a5 refactor(util/name_generator): make sure there is no risk of overflow, name generators will be extensively used in version 0.2
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:56 -07:00
Leonardo de Moura
3c8ccdd33d test(util/exception): experiment with exceptions with nested std::function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-03-18 10:27:55 -07:00
Leonardo de Moura
84e211b81b fix(frontends/lean): missing ':' in error messages
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-09 11:19:58 -08:00
Leonardo de Moura
f7c7dd4ed4 feat(frontends/lean): include filename in error messages, use GNU error message style
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-09 11:01:27 -08:00
Leonardo de Moura
3715b10ce7 feat(util/sexpr/options): serialization for options
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 20:40:00 -08:00
Leonardo de Moura
dbebb4a4a1 feat(util/sexpr): serialization for sexpr
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 20:19:56 -08:00
Leonardo de Moura
9c6dc5d230 feat(util/serializer): add hackish write_double/read_double
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 19:46:45 -08:00
Leonardo de Moura
abc370a011 feat(util/numerics): serialization for mpz and mpq
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 18:32:01 -08:00
Leonardo de Moura
49df0c435d feat(util/serializer): make sure the read/write is portable
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 18:07:19 -08:00
Leonardo de Moura
d05695c331 feat(util/name): serialization for hierarchical names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 17:47:20 -08:00
Leonardo de Moura
b72937c02c feat(util/serializer): simple serialization infrastructure
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-27 16:50:06 -08:00
Leonardo de Moura
daef2b7b24 feat(util/sexpr/options): add is_eqp predicate for options
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-20 10:53:53 -08:00
Leonardo de Moura
2253d8079b chore(util/pdeque): remove unused template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-14 23:31:44 -08:00
Leonardo de Moura
5aa9264091 feat(util/list): add remove_last template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-14 23:08:10 -08:00
Leonardo de Moura
1b1032eb99 feat(util/list): improved filter that reuses list cells
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-14 20:15:37 -08:00
Leonardo de Moura
450d6a4b1e refactor(util/splay_tree): replace find with splay_find
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-12 17:27:30 -08:00
Leonardo de Moura
cdec9762ce chore(util/pvector): remove unused template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-10 20:32:10 -08:00
Leonardo de Moura
e7ae749221 feat(boost): implement multi-threading support using Boost
To use Boost instead of the standard library, we must use the cmake option
    -D BOOST=ON

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-09 17:24:32 -08:00
Leonardo de Moura
8f2fe273ea refactor(*): isolate std::thread dependency
This commit allows us to build Lean without the pthread dependency.
It is also useful if we want to implement multi-threading on top of Boost.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-09 15:20:26 -08:00
Leonardo de Moura
e2999d3ff6 feat(*): add component name to check_stack and check_system
I also reduced the stack size to 8 Mb in the tests at tests/lean and tests/lean/slow. The idea is to simulate stackoverflow conditions.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-07 15:11:55 -08:00
Leonardo de Moura
fa35fd6989 chore(*): make sure LEAN_THREAD_UNSAFE build flag is handled correctly
When LEAN_THREAD_UNSAFE=ON, we:

- Do not run tests at tests/lua/threads
- Disable thread object at Lua API
- par tactical becomes an alias for interleave
- Disable some unit tests that use threads

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-04 10:27:22 -08:00
Soonho Kong
4de3b772fd feat(util/stackinfo): implement get_stack_size (Mac OSX version) 2013-12-01 22:24:12 -05:00
Leonardo de Moura
74dfdd02de feat(util): add primitives for checking the amount of available stack space
Recursive functions that may go very deep should invoke the function check_stack. It throws an exception if the amount of stack space is limited.

The function check_system() is syntax sugar for
    check_interrupted();
    check_stack();

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-01 17:19:27 -08:00
Leonardo de Moura
737e634556 fix(util/list): bug in map template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-01 08:51:24 -08:00
Leonardo de Moura
7ff791eb9f feat(util/name_set): add mk_unique (with respect to a name_set)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-30 11:28:38 -08:00
Leonardo de Moura
6da13cc245 feat(util/list): map_append template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-30 11:28:38 -08:00
Leonardo de Moura
fe79bbf2b7 feat(util/list): filter template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-30 11:28:38 -08:00
Leonardo de Moura
8e87ef5da8 feat(util/lazy_list): add repeat and repeat_at_most templates for lazy_lists
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-24 11:16:37 -08:00
Leonardo de Moura
40a2f0a588 refactor(util/lazy_list): polish lazy_list API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-23 17:45:01 -08:00
Leonardo de Moura
bcd88cac08 style(util): missing includes
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-23 17:05:46 -08:00
Leonardo de Moura
924187b055 feat(util/lazy_list): add par template for lazy lists)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-23 16:51:17 -08:00
Leonardo de Moura
157a2b36db feat(lazy_list): add timeout template for lazy_lists
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-23 16:27:36 -08:00
Leonardo de Moura
f19944cf09 refactor(util/lazy_list): 'lazier' lazy_lists
In the new implementation, even the head of the lazy list is computed on demand.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-23 15:33:30 -08:00
Leonardo de Moura
9eb6da2a31 feat(util): add optional template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-23 13:27:22 -08:00
Leonardo de Moura
a776c8b158 feat(util/interrupt): add sleep_for, and simplify request_interrupt
The Lean sleep_for checks the interrupt flag from time to time.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-22 11:32:12 -08:00