Commit graph

327 commits

Author SHA1 Message Date
Leonardo de Moura
be1ea2ddc7 Add name_set typedef
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-23 19:34:10 -07:00
Leonardo de Moura
198fd46fc2 Track recursion depth at normalizer. Add fluid let template.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
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
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
eb4315baab Add small trick to improve pretty printer performance. Now, deep.lean takes 0.140secs to be processed.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 22:54:58 -07:00
Leonardo de Moura
56d2d2a112 Improve pretty printer performance for deep formulas and formats with long lines. Add example that demonstrates performance problem (before: 13 secs, after: 1 sec).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 22:45:48 -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
ce470f57db Add set options to lean_parser. Add support for disabling unicode output. Use channels in lean_parser.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 12:42:55 -07:00
Leonardo de Moura
6f36611010 Fix clang++ error
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
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
eba4172a0c Remove verbosity.cpp, verbosity message channel should not be a global.
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
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
6edae938b7 Improve list iterator
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-17 11:31:36 -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
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
577256fedc Add highlight_keyword, highlight_builtin, highlight_command for consistent formatting
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-15 19:02:28 -07:00
Soonho Kong
a6f3122146 Fix cygwin error caused by the use of thread_local in numerics/float class 2013-08-15 13:49:15 -07:00
Soonho Kong
eb29a67395 Fix mpfp::operator^= to resolve operator overloading problem 2013-08-14 23:49:26 -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
f604be760d Add helper function for maps.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-14 18:17:18 -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
Soonho Kong
43b25a0231 Add operator<(mpq, double) to mpq 2013-08-14 13:45:29 -07:00
Soonho Kong
70f383eb82 Add unary minus operator overloadings to mpq & mpfp 2013-08-14 00:01:03 -07:00
Soonho Kong
5f143f164e Fix numeric_traits<mpfp>::pi constants 2013-08-13 20:09:06 -07:00
Soonho Kong
02900e2c83 Add abs/floor/ceil to double/float/mpq/mpfp 2013-08-13 20:09:06 -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
e123dd8e58 Use numeric_traits<mpfp>::get_mpfp_rnd() as a default rounding mode in mpfp operations 2013-08-13 00:35:14 -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
Leonardo de Moura
fb56869aae Fix cygwin problem.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 15:22:08 -07:00
Soonho Kong
71e10a0336 Add missing initialization of numeric_traits<mpfp>::rnd 2013-08-12 14:58:17 -07:00
Leonardo de Moura
2ad9c89684 Fix memory leak in mpfp. Add mpfp finalizer to avoid Valgrind warnings.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 11:36:15 -07:00
Soonho Kong
99df36f747 Add missing header <numeric> to format.h 2013-08-12 10:58:07 -07:00
Leonardo de Moura
e07830d0f5 Fix nasty crash that only happens when using cygwin.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-11 14:35:58 -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
19440bc103 Fix clang warning
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 16:58:15 -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
3d9f9a12d1 Enable automatic coercion from 'char const *' to hierachical name
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
Soonho Kong
375bc817cc Add more to mpfp 2013-08-09 22:41:07 -07:00
Soonho Kong
40bdd1a36b Fix typos in format.h (error messages) 2013-08-09 22:41:07 -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
Soonho Kong
635407ca4a Fix sexpr_text_length function to handle quotation in string 2013-08-08 12:24:42 -07:00
Soonho Kong
9516d9f88f Restructure format, and fix bugs 2013-08-08 12:24:19 -07:00
Soonho Kong
fe9d2147d2 Improve performance of format by using "space_upto_line_break" instead of "fits" 2013-08-08 10:34:15 -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
0f48f73e14 Add constants and transcendental functions to mpfp 2013-08-07 19:32:15 -07:00
Soonho Kong
03dc15868b Add more operator overloadings to mpfp 2013-08-07 19:32:15 -07:00
Soonho Kong
93b99cf1ec Add constants(Pi, 1/2Pi, 2Pi) to double, float, and mpq 2013-08-07 19:32:03 -07:00
Soonho Kong
2a8c9e9c06 Reformat mpfp.h 2013-08-07 19:32:03 -07:00
Soonho Kong
d3dbcadf8b Add placeholders for transcendental functions in mpbq & mpq 2013-08-07 19:32:02 -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
84de625ee4 Rename pp functions (that do not use format lib) to print
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 12:10:10 -07:00
Leonardo de Moura
722e2b0ed4 Reformat code (make formating more consistent)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 08:17:33 -07:00
Soonho Kong
5efd2fdd6f Update util/numerics/CMakeLists.txt to add mpfp, double, float 2013-08-06 20:01:09 -07:00
Soonho Kong
fb41a4f5a3 Add numeric_traits for double and float 2013-08-06 20:00:37 -07:00
Soonho Kong
d22b4bc9f1 Add mpfp, a wrapper for MPFR 2013-08-06 19:59:58 -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
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
Soonho Kong
52232f37cb Add numeric_traits<double> and numeric_traits<float> which are using MPFR 2013-08-05 18:57:09 -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
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
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
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
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
5be67bd42c Add forall, foldl, foldr to sexpr_funcs 2013-08-01 13:43:27 -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
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
5889c6488f Add list template.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 16:32:50 -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
ed3df178ac Improve hash for hierarchical names.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-24 14:56:32 -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
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
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
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
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
05991c827b Add S-expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-20 17:22:13 -07:00
Leonardo de Moura
f71fdea42e Add hash goodies, and name::hash()
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-20 14:23:34 -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
52bd8b8b52 Add verbosity stream
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-19 10:01:40 -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
Leonardo de Moura
4ccf770b64 Move mpz, mpq and mpbq to numerics directory
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-17 14:33:00 -07:00
Leonardo de Moura
d028041135 Add methods to mpz, mpq, mpbq
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-17 14:24:35 -07:00
Leonardo de Moura
eaa76ee9d2 Add missing operators to mpz, mpq, mpbq. Add pp functions for debugging
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-17 12:43:05 -07:00
Leonardo de Moura
139f4f2a7f Add simple build system based on cmake
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 22:10:51 -07:00
Leonardo de Moura
e9c9974ee0 Reorganize methods. Remove num_macros.h. Add binary rationals mpbq.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 21:08:38 -07:00
Leonardo de Moura
c6e68289da Fix cygwin problems
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 17:38:51 -07:00
Leonardo de Moura
e7bfd9a77d Add missing operators
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 17:20:24 -07:00
Leonardo de Moura
5c76cac9b1 Add wrapper for GMP mpq numbers
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 17:18:36 -07:00
Leonardo de Moura
31563b95bd Add wrapper from GMP mpz numbers
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 13:13:59 -07:00
Leonardo de Moura
5a0801789b Add GMP initialization
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 10:29:17 -07:00
Leonardo de Moura
3eaf8dea2a Make reference counting thread safe
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-16 10:11:14 -07:00
Leonardo de Moura
4f5cafdebf Add support files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-07-15 18:43:32 -07:00