Commit graph

633 commits

Author SHA1 Message Date
Leonardo de Moura
e741cc29ef test(metavar): encode two of the bad examples as unit tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-22 08:15:36 -07:00
Leonardo de Moura
59914a36f3 refactor(metavar): reorganize and simplify metavariables
- Use hierarchical names instead of unsigned integers to identify metavariables.
- Associate type with metavariable.
- Replace metavar_env with substitution.
- Rename meta_ctx --> local_ctx
- Rename meta_entry --> local_entry
- Disable old elaborator
- Rename unification_problems to unification_constraints
- Add metavar_generator
- Fix metavar unit tests
- Modify type checker to use metavar_generator
- Fix placeholder module

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-22 08:15:36 -07:00
Leonardo de Moura
93d4466d06 refactor(interval): move interval unit tests to tests/util/interval
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-21 18:17:34 -07:00
Leonardo de Moura
f18d35555e refactor(interval): organize template source code using the approach described at http://www.codeproject.com/Articles/3515/How-To-Organize-Template-Source-Code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-21 18:15:27 -07:00
Leonardo de Moura
e208309abd refactor(numerics): rename power operator to pow, the idea is to follow the C/C++ name convention for the power operator
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-21 17:23:56 -07:00
Leonardo de Moura
1429cc9df2 feat(numerics): add finite field Z/pZ
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-18 13:27:28 -07:00
Leonardo de Moura
bdade0e638 fix(numerics): problem with gcd tests on OSX
Now, we only test gcd(a, b) for a != b && a != 0 && b != 0.
When one of these conditions do not hold, the result is implementation dependent.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-17 10:38:02 -07:00
Leonardo de Moura
cf2c0f8ebb feat(numerics): add gcd and extended gcd templates (for primitive types)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 18:18:20 -07:00
Leonardo de Moura
39f68ed0d6 feat(numerics): add is_prime function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 17:25:08 -07:00
Leonardo de Moura
1097bbfb22 fix(style): fix warnings produced by cpplint.py, disable sizeof(type) warning
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 17:04:39 -07:00
Leonardo de Moura
105f55c68b feat(numerics): add zero() method to all numeric_traits
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 16:55:17 -07:00
Leonardo de Moura
ff04c5a2e2 test(numerics): add test to make sure that zeros of different precision mpfp numbers are the equal.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 16:54:43 -07:00
Leonardo de Moura
467eff4662 add(numerics): add prime number generator/iterator
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 16:05:45 -07:00
Leonardo de Moura
0783805671 feat(kernel): add weight to kernel definitions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-15 14:50:08 -07:00
Leonardo de Moura
5bd6ba37d0 fix(light_checker): fix inconsistent cache bug in light_checker, add tests that expose the problem
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-01 19:25:58 -07:00
Leonardo de Moura
aa5be3262f fix(type_checker): fix inconsistent cache bug in type_checker, add tests that expose the problem
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-01 19:23:55 -07:00
Leonardo de Moura
2089d12bd0 fix(replace_using_ctx): fix inconsistent cache bug in replace_using_ctx, and add tests that expose the problem
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-01 18:52:18 -07:00
Soonho Kong
c50bc13be0 test(library/rewriter): add more tests 2013-10-01 00:30:38 -07:00
Leonardo de Moura
15979ab991 fix(lean): fix warnings produced by cppcheck
Fix (relevant) warnings produced by http://cppcheck.sourceforge.net.
Most warnings produced were incorrect. The tool does not seem to support some of the C++11 new features.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-30 21:38:55 -07:00
Leonardo de Moura
30089aa4f8 test(type_checker): add example showing how to use the kernel exception formatter
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-30 16:39:29 -07:00
Soonho Kong
54f4c4d9bc test(library/rewriter/fo_match): clean up enable_trace 2013-09-29 18:36:01 -07:00
Leonardo de Moura
21f9699661 test(splay_tree): add missing test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-29 17:28:10 -07:00
Leonardo de Moura
790c2a72d5 test(safe_arith): add unit tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-29 17:20:32 -07:00
Leonardo de Moura
1179b6b52b test(hash): add missing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-29 17:20:32 -07:00
Leonardo de Moura
57b6148bbb test(buffer): add missing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-29 17:20:32 -07:00
Leonardo de Moura
02f621aa45 test(lazy_list): add more tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-29 14:38:35 -07:00
Leonardo de Moura
3c8dff9085 feat(lazy_list): implement ML-like lazy lists
We will use lazy lists to represent the set of solutions produced by the elaborator. The elaborator plugins will also use lazy lists.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-29 12:35:26 -07:00
Soonho Kong
4602dfd209 test(util/numerics): more tests to improve coverage 2013-09-28 23:38:17 -07:00
Soonho Kong
fb3635a9ef test(util/numerics/mpbp): add more tests for improving coverage 2013-09-28 01:01:52 -07:00
Leonardo de Moura
d2667d56c0 test(lean/parser): add more tests for improving coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-27 09:59:50 -07:00
Leonardo de Moura
0ff69d28f3 test(lean/scanner): add more tests for improving coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-27 09:59:50 -07:00
Leonardo de Moura
6fc177056e refactor(tests/frontends/lean): use consistent name convention for file names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-27 09:59:50 -07:00
Soonho Kong
6a0d211d54 test(fo_match): add more unittests
[skip ci]
2013-09-27 01:53:42 -07:00
Leonardo de Moura
9d8ff0eadb test(mpz): add unit tests for mpz
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-26 20:01:39 -07:00
Leonardo de Moura
5cce74d116 test(library): add tests for improving coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-26 19:43:10 -07:00
Leonardo de Moura
54e63fd4de feat(splay_tree): add fold and for_each templates for splay_tree and splay_map
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-26 18:18:20 -07:00
Leonardo de Moura
d7ed1560a9 feat(name_generator): add name_generator for unique names modulo a prefix
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-26 18:18:06 -07:00
Leonardo de Moura
19f4554145 test(exception): add tests for improving coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-26 08:35:13 -07:00
Leonardo de Moura
a24dbc3527 test(buffer): add tests for improving coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-26 08:35:13 -07:00
Leonardo de Moura
4bae715350 fix(memory): disable problematic test when tcmalloc is used
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 22:39:49 -07:00
Leonardo de Moura
c00534209a test(splay_map): add tests for improving code coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 22:12:49 -07:00
Leonardo de Moura
23e2f72f42 test(list): add tests for improving code coverage
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 22:04:24 -07:00
Leonardo de Moura
db4e5ab0ad feat(expr_lt): improve expr_lt performance by using hash codes, and add more tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 21:59:58 -07:00
Leonardo de Moura
a7707dd669 test(bit_tricks): add tests for log2 2013-09-25 20:58:01 -07:00
Leonardo de Moura
44a16cab6a test(exception): add new tests exception and parser_exception
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 20:57:53 -07:00
Leonardo de Moura
87e749cd12 test(trace): add unit test for trace module
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 20:30:05 -07:00
Leonardo de Moura
e16f45854b refactor(deep_copy): simplify deep_copy implementation, and move unit test to separate file
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 20:25:24 -07:00
Leonardo de Moura
037ebfd1d4 refactor(util): make 'util/test.h' the first include
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 20:13:05 -07:00
Soonho Kong
ad62f9762b fix(tests/util): use lean_assert_eq 2013-09-25 19:22:36 -07:00
Soonho Kong
475338080f fix(tests/interval): use new lean_assert and lean_assert_eq 2013-09-25 18:40:45 -07:00
Soonho Kong
1d8b7dc193 Update 'orelse' and 'then' rewriter to take a list of rewriters 2013-09-25 16:46:39 -07:00
Soonho Kong
a50f5f92b8 Rename 'rewrite' to 'Rewriter', change type of rewriter::operator() 2013-09-25 15:38:16 -07:00
Soonho Kong
57e9e2c658 Re-implement rewrite module using rewrite_cell 2013-09-24 19:11:09 -07:00
Leonardo de Moura
ba0528c298 Implement total order on expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-24 12:16:32 -07:00
Leonardo de Moura
e23813f15d Add support for creating unique internal names.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-24 11:01:30 -07:00
Leonardo de Moura
1779b29355 Implement map using splay_trees
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-24 01:44:46 -07:00
Soonho Kong
71fb150333 Fix type of rewrite() to take an env. Add skeletons for other rewriters 2013-09-24 01:20:45 -07:00
Soonho Kong
81c9de229b Add then and orelse rewrite combinators and tests 2013-09-24 01:19:03 -07:00
Soonho Kong
9ba6068858 Update fo_match 2013-09-24 01:19:03 -07:00
Soonho Kong
f89ededddc Add rewrite and first-order pattern matching skeletal 2013-09-24 01:19:03 -07:00
Leonardo de Moura
b78b2e0585 Add remaining splay tree methods
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-24 01:04:02 -07:00
Leonardo de Moura
d31f3facac Implement splay trees
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-23 22:31:18 -07:00
Leonardo de Moura
46d6c41835 Fix bug in the type checker (when type checking terms with meta-variables).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-22 19:12:19 -07:00
Leonardo de Moura
c847d27763 Improve higher order unification
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-21 00:41:49 -07:00
Leonardo de Moura
d29ec9ab6f Add tests for memory.cpp
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-20 22:37:13 -07:00
Leonardo de Moura
7ac94ee976 Add max_sharing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-20 22:01:40 -07:00
Leonardo de Moura
d34cfe3f8a Add simple formatter tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-20 21:46:32 -07:00
Leonardo de Moura
42482622f6 Add imitation for lambdas and Pis
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-19 16:28:23 -07:00
Leonardo de Moura
d7cc5d2404 Fix bug in ho_unifier
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-19 16:28:23 -07:00
Leonardo de Moura
2f29ff70d7 Implement higher-order unification
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-18 20:46:00 -07:00
Soonho Kong
27d5ae13d7 Move src/interval to src/util/interval 2013-09-17 14:10:53 -07:00
Leonardo de Moura
3df6149daa Add support for metavariables in the type checker.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 11:09:59 -07:00
Leonardo de Moura
30b19c314a Add basic support for metavariables at is_convertible. Swap is_convertible arguments to make it more intuitive.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 07:15:47 -07:00
Leonardo de Moura
a26c7d47f2 Add simplification to add_lift
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 03:14:02 -07:00
Leonardo de Moura
99e8d2feae Add simplification rule to add_inst
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 02:57:28 -07:00
Leonardo de Moura
21c7a45f67 Relax definition of identity_stack. Fix printer for metavariable contexts.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 02:09:45 -07:00
Leonardo de Moura
d3bce584f4 Add support for new metavariable representation in the normalizer.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 01:57:21 -07:00
Leonardo de Moura
99a163f11d Simplify metavariable context. Now, we have only 'lift' and 'inst' instead of 'subst', 'lift' and 'lower'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-16 19:32:28 -07:00
Leonardo de Moura
cad562a448 Add support for metavariables in the normalizer.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-16 19:32:28 -07:00
Leonardo de Moura
f79f046294 Add partial support for metavariables in the normalizer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-15 21:23:50 -07:00
Leonardo de Moura
2800292947 Add timestamp to metavar_env
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-15 19:50:48 -07:00
Leonardo de Moura
5a4bc331d2 Make unification_problems a virtual class. Associate a 'standard' context with each metavariable in metavar_env
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-15 19:38:36 -07:00
Leonardo de Moura
63e102055e Move metavariables to the kernel. This is the first step for implementing the new elaborator.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-15 12:09:01 -07:00
Soonho Kong
e4b327bbaa Use C++11's <random> in pdeque/pvector tests (cygwin doesn't support rand_r) 2013-09-15 01:38:57 -07:00
Soonho Kong
c96a6982a0 Add <ctime> header for time() in pdeque/pvector tests 2013-09-13 20:42:49 -07:00
Soonho Kong
eda25e77a4 Use time(0) as an initial seed for rand_r() in pvector/pdeque tests 2013-09-13 20:28:15 -07:00
Soonho Kong
bc60b47295 Apply coding style 2013-09-13 18:48:09 -07:00
Leonardo de Moura
8c735f1daa Use consistent coding style for spaces after ','
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-13 12:49:03 -07:00
Leonardo de Moura
573ec5ccc2 Rename import_all. The idea is to use consistent name for library files.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-13 09:06:46 -07:00
Leonardo de Moura
070c87bef0 Rename arith library files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-13 08:55:09 -07:00
Soonho Kong
5c3866cd71 Use fullpath in #include directives, add missing STL headers 2013-09-13 03:35:29 -07:00
Leonardo de Moura
4c19cc6957 Rename lean frontend files. The prefix lean_ is not necessary anymore.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 20:09:35 -07:00
Leonardo de Moura
26097475fd Use fullpath in #include directives.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 20:04:10 -07:00
Leonardo de Moura
c655e9fe7b Move sexpr_funcs to sexpr_fn. Using consistent file name conventions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 18:27:46 -07:00
Leonardo de Moura
2e990ef7d3 Fix warnings
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 14:02:40 -07:00
Leonardo de Moura
bc69e7803f Add support for writing a[i] = v instead of a.set(i, v) in the pdeque class.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 11:18:26 -07:00
Leonardo de Moura
74b8a4f0ac Add support for writing a[i] = v instead of a.set(i, v) in the pvector class.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 11:12:02 -07:00
Leonardo de Moura
f972cc9aae Fix bugs in pvector. Improve test driver
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 11:01:40 -07:00
Leonardo de Moura
55ff49d2d5 Replace queue.h with pdeque.h
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 10:09:54 -07:00
Leonardo de Moura
cd5e45bae2 Reduce pvector delta_cell quota on reads. Add example that demonstrates why this is needed.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 08:28:24 -07:00
Soonho Kong
5858c9d5e0 Update tests/util/list.cpp to suppress a g++ warning 2013-09-12 01:39:04 -07:00
Leonardo de Moura
f7196e05ff Add 'persistent' vectors. We should use the same approach for queues.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-11 19:48:55 -07:00
Leonardo de Moura
ef0e0ad382 Add (optional) performance tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-11 19:48:55 -07:00
Leonardo de Moura
37498f9fb8 Add persistent queues
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-11 19:48:54 -07:00
Leonardo de Moura
3657320edb Add basic list functions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-11 19:48:54 -07:00
Soonho Kong
3505ed8adb Use suppressions file to ignore certain valgrind warnings 2013-09-10 15:37:09 -07:00
Leonardo de Moura
6fe86ffefd Fix initialized memory error reported by Valgrind. Disable 2 tests that produce memory leaks due to a bug in g++.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-10 13:51:02 -07:00
Leonardo de Moura
1cee392483 Add light_checker: module for extracting the type of (fully elaborated) expressions. It is much faster than type_checker, which infers the type but also check whether the input is type correct or not.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-07 22:33:18 -07:00
Leonardo de Moura
33c4b44b2b Encapsulate context implementation. The current implementantion based on lists may be a performance problem in the future, and we should be able to change it without affecting the whole code base.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-07 11:15:11 -07:00
Leonardo de Moura
c674bb3790 Add castlib as an independent library
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-06 23:40:47 -07:00
Leonardo de Moura
7a9d53d0d7 Refactor arith libraries
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-06 23:19:47 -07:00
Leonardo de Moura
2459c4ae7c Add (optional) type to let declarations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-06 10:06:26 -07:00
Leonardo de Moura
87d3961158 Improve elaborator error messages
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-04 16:36:58 -07:00
Leonardo de Moura
e955c054ca Modify type checker. Now, it only accepts builtin values that have been declared in the environment. The idea is to be able to track which classes of builtin values have been used in a given environment. We want to be able to quantify the size of the trusted code base for a particular development.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-04 08:30:04 -07:00
Leonardo de Moura
9f64e2b14b Fix another cdash warning
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-04 04:43:55 -07:00
Leonardo de Moura
6f3fa63ccb Add missing test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-03 14:51:34 -07:00
Leonardo de Moura
a154f4e439 Modify Set command in the default lean frontend. Now, the lean prefix (for lean default frontend specific options) is optional when we are in the lean front-end.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-03 11:07:28 -07:00
Leonardo de Moura
a341643335 Fix unit tests for Windows
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-03 10:44:51 -07:00
Leonardo de Moura
544229e5d3 Create pp::unicode option. The idea is to be able to disable unicode characters, but still be able to use mixfix notation.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-03 10:11:45 -07:00
Leonardo de Moura
fd44ec8d79 Improve application type mismatch error messages
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-02 18:28:12 -07:00
Leonardo de Moura
b483d0dc45 Replace Int::sub and Real::sub with definitions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-02 16:31:30 -07:00
Leonardo de Moura
0a67679afb Add natural numbers. Fix how coercions and overloads interact (switch to approach used in C++). Add notation for natural and integer arithmetic. Rename m and u universe variables to M and U.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-02 12:24:29 -07:00
Leonardo de Moura
db88920f81 Rename normalize and type_check to normalizer and type_checker (using a consistent naming convention)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-02 08:43:38 -07:00
Leonardo de Moura
e8c09015ad Move elaborator to lean default frontend. It is getting too specific
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-01 18:22:24 -07:00
Leonardo de Moura
61a8fd16db Remove unnecessary files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-01 14:57:08 -07:00
Leonardo de Moura
9d9f9797e4 Improve elaborator interface. Now, the metavariables are created inside the elaborator. The elaborator-user only needs to create placeholders. Motivaton: the placeholders are meaningful independently of the elaborator. On the other hand, the metavariables depend on the elaborator state.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-31 17:11:06 -07:00
Leonardo de Moura
2aac94f2e6 Refactor elaborator using new metavar library.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 01:25:06 -07:00
Leonardo de Moura
682df7699d Fix is_convertible propositions => type
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 01:24:06 -07:00
Leonardo de Moura
1f6943e3a4 Add head_reduce_mmv (reduction function modulo metavariables)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-29 14:15:17 -07:00
Leonardo de Moura
2cf9ca9345 Add metavariable utilities. They will be used to refactor the elaborator.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-29 13:49:22 -07:00
Leonardo de Moura
01e4b4b7fe Add postprocessor functional object to the replace_fn template. Add unit-test that demonstrates how to build a replacer that builds a trace. The trace associates new expressions with the old ones that were used to create it.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-28 10:47:19 -07:00
Leonardo de Moura
cdab19b88c Simplify the elaborator
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-27 20:39:38 -07:00
Leonardo de Moura
8dacd97801 Remove obsolete commands. 2013-08-27 16:03:45 -07:00
Leonardo de Moura
85daaea8ce Rename get_exs in oper to get_deno
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-27 09:49:48 -07:00
Leonardo de Moura
76c968a5b8 Add basic support for hiding implicit arguments when pretty printing.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-26 20:35:10 -07:00
Leonardo de Moura
7003f85213 Add implicit argument management to lean frontend.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-26 10:16:29 -07:00
Leonardo de Moura
0a34959716 Fix a bug. Add another test.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-25 20:43:50 -07:00
Leonardo de Moura
3721577700 Fix bugs in elaborator. Cleanup tests.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-25 18:46:33 -07:00
Leonardo de Moura
02b72acc2f Add implicit arguments unit tests 2013-08-24 18:23:39 -07:00
Leonardo de Moura
f08c06d582 Add head_beta tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-23 09:42:49 -07:00
Leonardo de Moura
670dc5ad55 Add option to control maximum recursion depth in the expression normalizer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>

Conflicts:
	src/tests/kernel/normalize.cpp
2013-08-23 09:42:49 -07:00
Leonardo de Moura
42a7094ca2 Fix bug in display_decimal. Add more mpq tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-23 09:42:49 -07:00
Leonardo de Moura
f1462dc51e Change lean frontend specific options. Now, frontend specific options must begin with the frontend name.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 10:55:55 -07:00
Leonardo de Moura
60fdcf0011 Add option_declaration tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 08:59:39 -07:00
Leonardo de Moura
5d813c30d0 Add missing option test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 08:51:33 -07:00
Leonardo de Moura
fbd25cac9f Add hierarchical names tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 08:48:52 -07:00
Leonardo de Moura
1b5fcb80ee Add sexpr tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 08:30:52 -07:00
Leonardo de Moura
6272408f12 Add format tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 08:20:42 -07:00
Leonardo de Moura
3c5f993191 Fix bugs in options module. Add more tests.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-22 08:08:55 -07:00
Leonardo de Moura
0ffa76aa5e Fix unused variable warnings
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 17:02:09 -07:00
Leonardo de Moura
31460aa5b8 Add option declarations. Add Help.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 17:02:09 -07:00
Leonardo de Moura
d750469667 Move frontend to frontends/lean
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 09:04:49 -07:00
Leonardo de Moura
7778ae0ade Fix cyclic reference: frontend -> state -> pp_formatter -> frontend. Now pp_formatter is only valid while frontend is still alive. This should not be problem in practice.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-20 20:16:02 -07:00
Leonardo de Moura
3f5a2a83cc Add methods for setting options. Add string output channel.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-20 20:16:02 -07:00
Leonardo de Moura
4fa2468a85 Add output_channel and state abstractions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-20 20:16:02 -07:00
Leonardo de Moura
d82c60a314 Add test normalizer interrupt
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-20 20:16:02 -07:00
Leonardo de Moura
88cc3dc20d Add interrupt to normalizer. Fix tests (they were not using the basic printer).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 20:05:56 -07:00
Leonardo de Moura
f6ea9fca7d Remove interrupt.cpp. We changed the way we will handle interruptions in Lean.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 20:05:56 -07:00
Leonardo de Moura
b964edfb3e Add interrupt method to type checker.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 20:05:56 -07:00
Leonardo de Moura
f5e0150db3 Allow notation to be associated with arbitrary expression (instead of only constants).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 20:05:56 -07:00
Leonardo de Moura
f0b5ec8dfa Fix bug in parse_arrow
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 20:05:56 -07:00
Leonardo de Moura
de80db3985 Add support for pretty printing Dags. Find unused prefix for naming shared expressions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 12:04:40 -07:00
Leonardo de Moura
90ad0ba3b3 Add is_prefix_of for hierarchical names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-19 11:43:46 -07:00
Leonardo de Moura
676ebcca3d Add parse_arrow
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-18 15:44:39 -07:00
Leonardo de Moura
7a9319b72e Pretty print let expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-18 15:25:20 -07:00
Leonardo de Moura
843253355b Improve parser
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-18 11:02:29 -07:00
Leonardo de Moura
823fe6df07 Move test from lean.cpp
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-18 11:02:29 -07:00
Soonho Kong
ec83fd8093 Fix interval::acosh and add more tests on interval to improve code coverage 2013-08-18 01:20:16 -07:00
Leonardo de Moura
65b4845fbc Add more tests to improve coverage. Fix bug in mpz.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-18 00:28:50 -07:00
Leonardo de Moura
06f1b2a7db Add parse_expr. Add more tests.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 18:35:50 -07:00
Leonardo de Moura
685aeae43a Add parser skeleton
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 18:13:55 -07:00
Leonardo de Moura
f1961ab33f Add another pp example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 12:38:32 -07:00
Leonardo de Moura
80ec48c93d Make sure formatter can be used even when associated frontend is not in scope.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 12:33:19 -07:00
Leonardo de Moura
a6f36ba546 Improve formatter usage. Fix bug in object printer.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 11:29:43 -07:00
Leonardo de Moura
0f3af23778 Fix crash when trying to format an object created by a different frontend.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 11:04:22 -07:00
Leonardo de Moura
b633c866e6 Expose environment API in the frontend object. Add support for formatting objects.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 10:55:42 -07:00
Leonardo de Moura
c6226c6951 Fix typo
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 20:51:11 -07:00
Leonardo de Moura
15c1c97873 Refactor frontend pretty printer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 20:40:39 -07:00
Leonardo de Moura
0fbfef8eb0 Remove sanitize_names from kernel
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 20:40:39 -07:00
Leonardo de Moura
111cdd4e62 Remove pretty printer from kernel. Add basic printing capability to exprlib module.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 20:40:39 -07:00
Leonardo de Moura
519a290f32 Refactor kernel objects
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 20:40:39 -07:00
Soonho Kong
93475ac2eb Clean up interval check function 2013-08-16 19:58:56 -07:00
Soonho Kong
3d8eda2239 Fix src/tests/interval/CMakeLists.txt to have different test names 2013-08-16 19:58:56 -07:00
Leonardo de Moura
c41b3dc4d8 Add kernel_exceptions. The idea is to avoid expression formatting in the kernel. It also allows different frontends to display the error messages is a different way.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 12:51:12 -07:00
Leonardo de Moura
1038f7346e Refine initialization order. Polish Universe command pretty printer.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-16 09:30:08 -07:00
Leonardo de Moura
790d4a4447 Move pretty printer to frontend. Add support for mixfix pretty printing
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Leonardo de Moura
5395ced0e5 Improve comments
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Leonardo de Moura
e9106f7512 Delete obsolete function continue_on_violation
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Leonardo de Moura
99219f998b Rename files sets.h and maps.h to expr_sets.h and expr_maps.h
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Leonardo de Moura
013fa866fa Add iterator for traversing local objects (i.e., ignores objects defined in ancestor environments)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Leonardo de Moura
2b7834c5fc Add methods for creating infix, prefix, postfix operators in the frontend object
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Soonho Kong
c5db989e38 Add csc, sec, cot to interval & add tests for them 2013-08-15 17:44:11 -07:00
Soonho Kong
25bfb58f17 Update interval tests to reduce compile-time 2013-08-15 11:32:27 -07:00
Soonho Kong
7059836e21 Add more tests for float and double interval 2013-08-14 23:49:27 -07:00
Leonardo de Moura
2d74ff5fe0 Cache results of the normalizer. Add example that demonstrates the exponential performance improvement.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 23:18:50 -07:00
Leonardo de Moura
984c4149fa Add helper functions for creating Let expressions. Add simple type checking test for Let expressions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 22:30:12 -07:00
Soonho Kong
da764aec14 Add more test to interval, to check inclusion property of the results 2013-08-14 19:55:47 -07:00
Leonardo de Moura
913fd14549 Add operator== to list
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:18 -07:00
Leonardo de Moura
285c8dafdc Display context_entry body when pretty printing contexts.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:18 -07:00
Leonardo de Moura
d71c36ed60 Improve sanitizer test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:18 -07:00
Leonardo de Moura
23d245bb2e Sanitize context names before generating error messages. Add [[ noreturn ]] attribute to functions that always throw exceptions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:18 -07:00
Leonardo de Moura
a6f0a69186 Avoid head and tail when manipulating contexts
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:18 -07:00
Leonardo de Moura
56305e4672 Add sanitize_names for (local) contexts
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:17 -07:00
Leonardo de Moura
338ce88ea0 Add occurs function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:17 -07:00
Soonho Kong
43b25a0231 Add operator<(mpq, double) to mpq 2013-08-14 13:45:29 -07:00
Soonho Kong
5a38480cf7 Remove "continue_on_violation(true);" from tests 2013-08-14 13:24:18 -07:00
Soonho Kong
56f4050932 Add {float,double,mpfp}_interval.cpp in tests/interval 2013-08-14 10:56:05 -07:00
Soonho Kong
840403db42 Add more test 2013-08-14 00:01:29 -07:00
Soonho Kong
d51e2e3a25 Add more test to interval 2013-08-13 23:05:00 -07:00
Soonho Kong
60ee5e08fb Add more test to interval 2013-08-13 20:09:06 -07:00
Leonardo de Moura
2dad1e0e33 Fix type mismatch error message
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 19:24:11 -07:00
Leonardo de Moura
392b347f53 Add expr_formatter and expr_locator. Add better error messages. Improve simple printer.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 19:16:40 -07:00
Leonardo de Moura
3bcbdf7c7b Add options to customize formatter
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 16:19:30 -07:00
Leonardo de Moura
11a9cac5d6 Refactor kernel objects
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 15:13:54 -07:00
Leonardo de Moura
00c06839a4 Fix scanner. Add scanner tests. Add itera to list::iterator. Add parser_exce.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 10:55:41 -07:00
Leonardo de Moura
0a4e03efc5 Remove option name::separator, it can't be configured during runtime
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 08:18:01 -07:00
Leonardo de Moura
963afa4861 Add missing files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 07:07:14 -07:00
Leonardo de Moura
2ea7479ee9 Move sexpr/format/options to util/sexpr (reason: circular dependency between util and numerics lib), now numerics depend on util, and sexpr depends on numerics and util. Add scanner to frontend.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-13 03:40:51 -07:00
Soonho Kong
c700707f37 Add more tests to interval 2013-08-13 00:35:14 -07:00
Leonardo de Moura
8142317983 Fix typo
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 19:15:12 -07:00
Leonardo de Moura
50cf3e42f1 Add operator_info
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 19:12:44 -07:00
Soonho Kong
916e348dec Disable thread-related tests on OSX due to the bug on gcc-4.8.1 2013-08-12 14:58:18 -07:00
Soonho Kong
6bbe592e2a Add double/mpfp interval tests 2013-08-12 14:58:18 -07:00
Leonardo de Moura
ca4c37528f Fix cygwin compilation error
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 14:50:48 -07:00
Leonardo de Moura
276240748e Add simple thread example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 14:10:21 -07:00
Leonardo de Moura
4eeb72b0ee Fix performance problem in has_free_var. Add new test at src/tests/kernel/free_vars.cpp that exposes the problem.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-11 11:19:59 -07:00
Leonardo de Moura
6d9a342f17 Add regression test to expose bug fixed in previous commit.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 22:14:27 -07:00
Leonardo de Moura
5c6ee647a9 Fix bug in has_free_vars_fn. Add optimization to type_checker.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 22:05:04 -07:00
Leonardo de Moura
7ebaac62a8 Add scoped_map. Cache type checker results.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 19:27:56 -07:00
Leonardo de Moura
f79c0d3546 Add support for cygwin
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 14:21:13 -07:00
Leonardo de Moura
03461df55e Add frontend object
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 14:21:13 -07:00
Leonardo de Moura
9fbe99bf58 Rename define_uv -> add_uvar
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 14:21:13 -07:00
Leonardo de Moura
c6d0afcc40 Rename sexpr eqp to is_eqp
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 14:21:13 -07:00
Leonardo de Moura
e5fe016a44 Add pretty printer for s-expressions and options
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-08 18:38:18 -07:00
Leonardo de Moura
33e8e4af23 Add initializer list constructor for hierarchical names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-08 18:38:18 -07:00
Leonardo de Moura
f18149934b Move sexpr to util directory
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-08 18:38:18 -07:00
Leonardo de Moura
b50d9df784 Add options
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-08 18:38:18 -07:00
Leonardo de Moura
ecf9506abe Add object iterator for environment objects
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-08 18:38:18 -07:00
Leonardo de Moura
bede62e2f7 Fix bug in sexpr operator <<.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 21:53:19 -07:00
Soonho Kong
b970c964ff Add transcendental functions to interval (still need to fill more...) 2013-08-07 19:32:15 -07:00
Soonho Kong
ea6b4ddca7 Add more tests to interval 2013-08-07 19:32:03 -07:00
Leonardo de Moura
2670e94398 Add pretty printer for Lean environment
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 19:10:12 -07:00
Leonardo de Moura
f8e3563034 Add scoped sets
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 13:54:18 -07:00
Leonardo de Moura
5acedcddbb Remove useless is_* functions. We can use equality for that (more readable and similar performance).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 08:34:50 -07:00
Soonho Kong
975730a3fb Add test for mpfp 2013-08-06 20:00:37 -07:00
Leonardo de Moura
84f4a32c0e Change name convention for creating Lean expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 11:27:14 -07:00
Leonardo de Moura
30513398bb Add basic definitions and axioms
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-05 20:06:42 -07:00
Leonardo de Moura
8aee11e538 Fix test failure when using clang++ and release mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-05 20:06:42 -07:00
Leonardo de Moura
f6057e2b28 Add more environment tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-05 20:06:42 -07:00
Leonardo de Moura
0c610e0a77 Fix bug in type checker
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-05 20:06:42 -07:00
Leonardo de Moura
70de591934 Add definitions and facts
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 20:52:14 -07:00
Leonardo de Moura
5f77a2367f Allow Boolean expressions (aka propositions) to be used as types.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 18:26:01 -07:00
Leonardo de Moura
4b5d60f2b2 Add get_uvar method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 17:47:54 -07:00
Leonardo de Moura
c97db1f0cf Add children environments
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 16:07:37 -07:00
Leonardo de Moura
95447deea3 Add normalization a = b for values (aka semantic attachments)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 14:54:33 -07:00
Leonardo de Moura
f0ccb2a03e Rename eqp --> is_eqp. The name is too similar to heterogeneous equality constructor eq.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 09:41:49 -07:00
Leonardo de Moura
3f789ce2b7 Add let and heterogeneous equality. Add bool_type and bool_value.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-04 09:37:52 -07:00
Leonardo de Moura
b979436c40 Add basic semantic attachments for arithmetic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 19:57:06 -07:00
Leonardo de Moura
0a679074f0 Add support for semantic attachments. Remove expr_numeral
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:12:15 -07:00
Leonardo de Moura
cce469119f Flip order of the arguments for instance and abstract. Simplify type_checker.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:12:15 -07:00
Leonardo de Moura
190855ad1b Add (relaxed) version of instantiate that can substitute terms containing free variables
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:12:15 -07:00
Leonardo de Moura
2972bdfec3 Rename abst_type to abst_domain
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:12:12 -07:00
Leonardo de Moura
e1e3e6b2d6 Add instantiate tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:10:20 -07:00
Soonho Kong
fd7f0e9658 Update format test 2013-08-02 20:00:40 -07:00
Soonho Kong
cda969187a Add one small test to expr 2013-08-02 10:34:46 -07:00
Leonardo de Moura
c13b9a792a Add small example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-01 22:07:28 -07:00
Leonardo de Moura
3ef9d21875 Fix bugs in type checker
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-01 21:40:39 -07:00
Leonardo de Moura
7b00561a94 Normalize level expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-01 21:40:39 -07:00
Leonardo de Moura
e220d7c525 Add type checker. Fix normalization with non-empty context
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-01 21:40:36 -07:00
Leonardo de Moura
bed5f09907 Rename normalize context to local_context. Create context. Fix bug in name.cpp
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-01 21:39:02 -07:00
Soonho Kong
322c2b472d Add more to expr pretty-print 2013-08-01 18:54:06 -07:00
Soonho Kong
e898bb996c Fix performance bug in format, add paren combinator 2013-08-01 18:03:51 -07:00
Soonho Kong
5a89bffe83 Add pp to expr 2013-08-01 15:42:06 -07:00
Soonho Kong
a7910e1fe7 Update format.cpp & format.h + Update format tests 2013-08-01 13:43:49 -07:00
Soonho Kong
092b8889e4 Add more tests on sexpr_funcs 2013-08-01 13:43:27 -07:00
Leonardo de Moura
4efa9a92df Fix performance issue
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-29 21:33:43 -07:00
Leonardo de Moura
08b750c825 Remove Prop from kernel
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-29 19:49:34 -07:00
Leonardo de Moura
6452c69b96 Use level at kernel expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-29 19:44:26 -07:00
Leonardo de Moura
537e2c101c Add more tests. Fix bug in universe implication test.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-29 19:05:43 -07:00
Leonardo de Moura
a4f456c99e Universe levels
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-28 22:34:39 -07:00
Leonardo de Moura
13bce7bb6f checkpoint
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-26 14:16:29 -07:00
Leonardo de Moura
ed13132c12 Add has_free_var, lower_free_vars
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-26 12:27:55 -07:00
Leonardo de Moura
bf0cca3805 Add multi-thread tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-25 22:33:13 -07:00
Leonardo de Moura
b6236130f9 Fix stack overflow at travis when using clang++ 3.3 in debug mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-25 22:05:09 -07:00
Leonardo de Moura
f7138b6ecf Fix normalize
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-25 19:13:45 -07:00
Leonardo de Moura
14c899e7ca Add normalize
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 19:36:54 -07:00
Leonardo de Moura
5889c6488f Add list template.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 16:32:50 -07:00
Leonardo de Moura
b45a5d231c Add buffer test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 15:01:19 -07:00
Leonardo de Moura
c2ebe42ca8 Move numerics and sexpr to util
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:57:51 -07:00
Leonardo de Moura
1f7011353b Add (temporary) buffer class
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:57:51 -07:00
Leonardo de Moura
0fb93ad6ef Expose max_sharing_fn object
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
ed3df178ac Improve hash for hierarchical names.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
59592ed36b Add deep copy for kernel expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
ceb6537e3a Fix race condition when updating expression flags: max_shared and closed
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
9b3c47a521 Refactor instantiate/abstract code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
c7b12a2815 Add abstract/instantiate for kernel expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
ed6d6483fe Rename abst_expr -> abst_body
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
9fd88e6e27 Add small demo
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
576726bf58 Use operator() for creating applications
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:31 -07:00
Leonardo de Moura
54a02b4fc7 Simplify expr accessor names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:31 -07:00
Leonardo de Moura
2c3fc09e3c Add has_free_vars/closed function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:31 -07:00
Leonardo de Moura
6a2c9ef076 Rename/Reorg some kernel files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:31 -07:00
Leonardo de Moura
90f498994a Add some overloads
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:31 -07:00
Soonho Kong
e5c39cad9c Add color code in format.cpp to test how it looks on terminal 2013-07-23 18:42:40 -07:00
Soonho Kong
ab81a57d86 Add test cases for format 2013-07-23 18:42:36 -07:00
Leonardo de Moura
f00d8c4683 Fix bug in max_sharing
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-23 09:18:18 -07:00
Leonardo de Moura
79d00f4d78 Rename max_sharing files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-23 09:01:54 -07:00
Leonardo de Moura
5aa25a635f Add max_shared flag to expr_cell. Improve app constructor.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-23 08:59:39 -07:00
Leonardo de Moura
2a9d0de57b Add max_shared: function for computing maximally shared expressions. 2013-07-22 19:31:27 -07:00
Leonardo de Moura
aed8a07c1b Add sexpr test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-22 19:02:11 -07:00
Leonardo de Moura
e6a694ebcc Add expr test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-22 17:58:35 -07:00
Leonardo de Moura
06320c8615 Replace expr == with recursive function. Add goodies for traversing expressions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-22 16:40:17 -07:00
Leonardo de Moura
c4cd6c4f84 Add tests for kernel expression
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-22 13:04:27 -07:00
Leonardo de Moura
a2e72dbd92 Rename get_kind() -> kind()
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-22 09:30:55 -07:00
Leonardo de Moura
03cc3739d4 Fix bugs in mpbq.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 20:12:04 -07:00
Leonardo de Moura
24cf1a7c3d Add cmp (total order) for sexpr
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 17:05:32 -07:00
Leonardo de Moura
f6e18045f3 Add eqp (pointer equality) tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 15:59:10 -07:00
Leonardo de Moura
9e966a0e57 Add total order for hierarchical names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 15:56:18 -07:00
Leonardo de Moura
ecb7316943 Fix bugs in hierarchical names module. Add unit tests.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 15:08:14 -07:00
Leonardo de Moura
ecc8e8f813 Improve consistency of unit tests names
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 14:52:20 -07:00
Leonardo de Moura
8af56394cc Add foreach for S-expression lists
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 14:32:36 -07:00
Leonardo de Moura
b8315e5593 Fix ambiguous overloads. Improve == test for sexprs. Remove redundant code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-21 14:25:56 -07:00
Leonardo de Moura
80d8fdbf48 Fix tests exit code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-20 18:04:05 -07:00
Leonardo de Moura
403e6a141b Add useful goodies for S-expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-20 18:01:10 -07:00
Leonardo de Moura
05991c827b Add S-expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-20 17:22:13 -07:00
Leonardo de Moura
eda1a337de Add more tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-20 14:23:52 -07:00
Leonardo de Moura
f7e59366ea Add neg, div, power to interval. Fix bug in -= operator at interval. Add some unit tests for interval class
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-19 19:24:38 -07:00
Leonardo de Moura
63e596885c Add support for (soft) interrupts
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-19 19:12:55 -07:00
Leonardo de Moura
c581990f67 Clean white-spaces
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-19 10:29:33 -07:00
Leonardo de Moura
7f3bd4f254 Add inv method to interval
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-19 10:04:25 -07:00
Leonardo de Moura
5063c8cfa1 Add interval template
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-19 10:01:53 -07:00
Leonardo de Moura
8353181fd1 Add basic mpq tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-18 11:10:15 -07:00
Leonardo de Moura
e559bf73a9 Add basic testing infrastructure using CTest
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-18 09:12:07 -07:00