Commit graph

199 commits

Author SHA1 Message Date
Leonardo de Moura
2986f0543e Simplify how universe variable constraints are represented in the kernel. Allow universe variable to be created without an environment.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-05 20:06:42 -07:00
Leonardo de Moura
7e2d7dcf3d Add more builtin constants
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
Soonho Kong
8dab224137 Fix CMakeLists.txt 2013-08-05 19:16:52 -07:00
Soonho Kong
52232f37cb Add numeric_traits<double> and numeric_traits<float> which are using MPFR 2013-08-05 18:57:09 -07:00
Soonho Kong
a6f825caa5 Add MPFR & restructure cmake directory 2013-08-05 17:58:54 -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
15a4152ce8 Fix merge problem
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:13:56 -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
1fec8b0d5b Rename (stack) value to svalue
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:12:15 -07:00
Leonardo de Moura
0b8fa3b167 Remove dead code
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
Leonardo de Moura
b67a92cf10 Add scanner base class
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-03 16:10:20 -07:00
Soonho Kong
bac75541dc Add static_asserts to template funcs in expr.h & replace.h 2013-08-02 20:00:40 -07:00
Soonho Kong
fd7f0e9658 Update format test 2013-08-02 20:00:40 -07:00
Soonho Kong
83edc38fa1 Change folddoc to fold_right, add static_asserts for template functions 2013-08-02 19:48:11 -07:00
Soonho Kong
5f10d47035 Change operators in format:
f1 + f2 = f1 <> f2
f1 ^ f2 = f1 <> " " <> f2
2013-08-02 19:17:29 -07:00
Soonho Kong
bddecd7d9c Roll back to flatten(line) == " " 2013-08-02 19:16:19 -07:00
Soonho Kong
4ebb96d7cd Add static_asserts to sexpr_funcs.h 2013-08-02 18:26:51 -07:00
Soonho Kong
cda969187a Add one small test to expr 2013-08-02 10:34:46 -07:00
Leonardo de Moura
ae697ddda7 Update CMakeLists.txt: bison++ and flex
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-02 07:56:18 -07:00
Leonardo de Moura
a8c77ff40e Disable eta-reduction for now.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-01 23:19:34 -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
229b4f8759 Update format.cpp, flatten(LINE) = "" instead of " " 2013-08-01 18:53:41 -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
426c3a667a Update format
1) operator+ is <> (previously, it was a + b = a <> ' ' <> b)
2) using sstream to compute length of text
2013-08-01 15:41:45 -07:00
Soonho Kong
0f98ee03b5 Use 'nullptr' instead of '0' 2013-08-01 13:57:43 -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
Soonho Kong
5be67bd42c Add forall, foldl, foldr to sexpr_funcs 2013-08-01 13:43:27 -07:00
Leonardo de Moura
10def5cabe Remove duplicate code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-29 21:34:16 -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
299ec9c254 Fix space
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-28 23:14:27 -07:00
Leonardo de Moura
279e524c9e Fix bug in universe levels
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-28 23:11:35 -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
a241d5f4b1 Add eta-reduction
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-26 12:37:13 -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
09708209a7 Improve documentation
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-26 11:43:53 -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
1398c927cd Fix compilation error with clang++
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
4b61639f4d Use consistent naming for functional objects
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -07:00
Leonardo de Moura
4ae0c4c445 Remove dead code
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
17e69e32d7 Add expression offset pair
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
fc27c4af89 Add Doxyfile (configuration file for Doxygen) 2013-07-24 08:22:12 -04: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
Soonho Kong
03b1ce643e Restructure format, add group and flatten 2013-07-23 18:42:31 -07:00
Soonho Kong
71638a8ad4 Add pretty-print: format.cpp, format.h 2013-07-23 10:43:41 -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
dd74284fdc Cleanup eq_functor
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-23 09:12:15 -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
c32dfe22b6 Add expressions (dependent type theory)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-22 12:46:11 -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