Commit graph

99 commits

Author SHA1 Message Date
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
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
e218b92a9d Modify verbose message for Set command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-02 12:29:21 -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
c97e669f0c Add coercion support in the elaborator and pretty printer
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-01 19:09:07 -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
42be7a4989 Add coercion declarations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-01 18:11:28 -07:00
Leonardo de Moura
598daa40bc Refactor elaborator for supporting overloads
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-01 10:24:10 -07:00
Leonardo de Moura
b2924bba99 Fix typos
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-01 10:03:15 -07:00
Leonardo de Moura
e54338f4a8 Add a real example. Fix bug in the parser
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-31 19:32: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
71b8b6408e Handle (and pretty print) elaborator error messages in the lean default frontend
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-31 16:46:41 -07:00
Leonardo de Moura
dadbf15e70 Change how the (auxiliary) explicit definitions are encoded in the system. The previous encoding was confusing the pretty printer, and the definition looked recursive.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 16:37:21 -07:00
Leonardo de Moura
1b6d51b0aa Mark implicit arguments of builtin symbols
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 15:56:04 -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
1e370023b1 Attach elaborator the lean default parser
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 13:25:30 -07:00
Leonardo de Moura
45d89ace65 Fix name clash problem when pretty printing
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 13:25:12 -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
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
a9c6088d11 Uniform notation declarations. 2013-08-27 15:59:13 -07:00
Leonardo de Moura
5aae838e1c Add missing mixfix notation
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-27 10:09:46 -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
206c7fa203 Implement support for notation + implicit arguments. Cleanup pretty printer code for handling implicit arguments.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-27 09:45:00 -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
fc6cc17925 Improve lean pretty printer support for implicit argument annotations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-26 19:19:56 -07:00
Leonardo de Moura
7bca3705ca Add implicit argument declarations to lean parser.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-26 10:16:29 -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
7e130ac47f Propagate interrupt to normalizer in the lean frontend
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-25 11:34:46 -07:00
Leonardo de Moura
b42e04297d Add support for creating meta-variables in the parser.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-25 11:18:19 -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
ece6e6ca6a Add interrupt to parser. Add elaborator to parser. Add placeholder support in the scanner.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-25 11:02:34 -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
0b112b6637 Add sstream to simplify the generation of exception messages.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-24 11:55:17 -07:00
Leonardo de Moura
48ba655bd5 Store position at parser_error. It produces better error messages.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-24 11:30:54 -07:00
Leonardo de Moura
55eaef1a44 Save position information when parsing expression in the lean default fronted.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-24 09:56:07 -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
aceae7a1b2 Change policy for adding input to readline history.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 19:43:47 -07:00
Leonardo de Moura
bd3b422158 Add support for READLINE. Remark: it is not enabled by default. Rename tcmalloc option to TCMALLOC (using consistent name convention for cmake parameters).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 19:08:44 -07:00
Leonardo de Moura
59e63c0421 Add prompt when in interactive mode. Fix Show Environment [num]
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 18:24:26 -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
65898f6d5b Add Import command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 17:02:09 -07:00
Leonardo de Moura
90678566b4 Improve lambda/pi formatting
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 17:02:09 -07:00
Soonho Kong
3f40953efc Add comments for unicode symbols, fix a typo 2013-08-21 14:35:45 -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
6534142fb9 Fix annoying problem when an integer occurs in the end of a command. Example 'Show 1.' was being parsed as 'Show 1.0'.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-21 11:57:22 -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