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
|
be7fa0932a
|
Add unicode name for the types: Nat, Int and Real
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-04 09:03:41 -07:00 |
|
Leonardo de Moura
|
d41160f8a5
|
Modify environment. Now, when a builtin value is declared, if it has a unicode alternative representation, then we add it as a definition. Now, everything that occurs in the environment has been 'declared'.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-04 08:53:00 -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
|
887f696f66
|
Factor duplicate code. Add more comments
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-03 23:27:58 -07:00 |
|
Leonardo de Moura
|
fc9e395818
|
Define absolute value function and notation for it. Add new example.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-03 20:39:54 -07:00 |
|
Leonardo de Moura
|
3992c4b8f9
|
Define divides, and add examples
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-03 20:18:20 -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
|
e031d7bc10
|
Improve error messages when overloads+coercions do not work
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 20:05:47 -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
|
72188691de
|
Add hyperbolic functions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 17:28:43 -07:00 |
|
Leonardo de Moura
|
4eaba93591
|
Add trigonometric functions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 17:03:02 -07:00 |
|
Leonardo de Moura
|
395513258e
|
Define mod and unary minus
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 16:31:44 -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
|
abc939382b
|
Add Real arithmetic. Fix elaborator for coercions. Now, two overloads are considered ambiguous if they need the same number of coercions. Improve pretty printer for nest infix operators with same precedence and associativity.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 13:20:00 -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
|
7acf438bf4
|
Metavariables will not be part of the kernel
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 09:36:04 -07:00 |
|
Leonardo de Moura
|
990f428a81
|
Remove virtual method kind from value class and subclasses. We can use dynamic_cast to achieve the same goal
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 09:35:10 -07:00 |
|
Leonardo de Moura
|
81d0203ee0
|
Replace macros TypeM, TypeU, Int, Bool, True and False with constant global expressions. The macros were producing counterintuitive behavior. For example, we had an enumeration type with an element called Int.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-02 09:11:53 -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
|
42be7a4989
|
Add coercion declarations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-09-01 18:11:28 -07:00 |
|
Leonardo de Moura
|
51640ecff8
|
Move files in examples directory to tests directory. They are not real examples
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-31 19:16:30 -07:00 |
|
Leonardo de Moura
|
4a28a64685
|
Fix type checker for let expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-31 14:19:24 -07:00 |
|
Leonardo de Moura
|
4ef4655183
|
Add homogeneous equality
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-30 14:26:12 -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
|
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
|
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
|
25e47a8a2f
|
Add check_interrupted 'macro'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-25 11:03:09 -07:00 |
|
Leonardo de Moura
|
dc91a7adb8
|
Add Ctrl-C support for interrupting Lean shell.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-24 16:11:35 -07:00 |
|
Leonardo de Moura
|
f0edf2b4a3
|
Pretty print kernel exceptions. Improve default lean frontend error messages.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-24 13:16:43 -07:00 |
|
Leonardo de Moura
|
18a195029b
|
Refactor expression equality
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
|
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
|
218b6ac8b7
|
Fix typo
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-23 09:42:49 -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
|
b2ba0618c9
|
Use normalizer object in type checker. The idea is to make sure the interruption is propagated to normalizer.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-19 20:05:56 -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
|
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
|
ce43c1cbae
|
Fix cup symbol. In Emacs, the unicode characters cup and cap are assigned incorrectly.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-18 18:43:31 -07:00 |
|
Leonardo de Moura
|
a46bf357b0
|
Fix bug in level.cpp. Add new example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-18 18:37:47 -07:00 |
|
Leonardo de Moura
|
95cfac426d
|
Add parse_level. Fix bug at environment::is_ge
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-18 18:25:34 -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
|
afd62ced87
|
Add parse_let
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-18 15:25:20 -07:00 |
|
Leonardo de Moura
|
cdccca9316
|
Rename builtin operator if-then-else
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-18 11:02:29 -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
|
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
|
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
|
e792e079e2
|
Add formatter API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-16 20:40:39 -07:00 |
|
Leonardo de Moura
|
cbff5ea856
|
Cleanup
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 |
|
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
|
abab4b667a
|
Define implies using ite operator. Rename mk_bin_op to mk_bin_rop (it is using right associativity). Add mk_bin_lop (for left assoc).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-16 09:04:59 -07:00 |
|
Leonardo de Moura
|
efbf3a434d
|
Highlight assignment keyword
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-15 20:00:12 -07:00 |
|
Leonardo de Moura
|
5ec2780321
|
Extend formatter with support for definitions and postulates.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-15 19:26:58 -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
|
d6d221b992
|
Move auxiliary files away from kernel
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 |
|
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 |
|
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 |
|
Leonardo de Moura
|
b0f2ee6de0
|
Add notation support to frontend object
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-14 18:17:18 -07:00 |
|
Leonardo de Moura
|
5bfb074eaf
|
Create objects for universe variable declarations.
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
|
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
|
e5b8c45b3f
|
Rename type to domain in contexts (aka telescopes). Reason: make name convention consistent with the one used for abstractions (lambdas and pis).
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 |
|
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
|
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
|
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 |
|
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
|
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
|
3a1514982f
|
Add small optimization.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-10 21:02:45 -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
|
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
|
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 |
|
Soonho Kong
|
a1229692b0
|
Add static_asserts for higher-order functions in kernel/for_each.h and kernel/pp.cpp
|
2013-08-09 22:41:07 -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
|
2d4caa7450
|
Mark 'implicit' parameters, and move them to the beginning
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-07 21:53:19 -07:00 |
|
Leonardo de Moura
|
e558edcd52
|
Use ',' as separator for lambda
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-07 21:53:19 -07:00 |
|
Leonardo de Moura
|
3fbc506271
|
Rename Truth to Trivial, and delete Trivial macro
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-07 21:53:19 -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
|
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
|
dd21cdcc95
|
Add more theorems.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-07 11:23:04 -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 |
|
Leonardo de Moura
|
2d27573e0c
|
Add ImpAntisym axiom
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-07 08:29:20 -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 |
|
Leonardo de Moura
|
58fef282c3
|
Refactor theorems. Add new theorems.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
|
2013-08-07 01:16:37 -07:00 |
|