Commit graph

29 commits

Author SHA1 Message Date
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
4eaba93591 Add trigonometric functions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-02 17:03:02 -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
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
4ef4655183 Add homogeneous equality
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-30 14:26:12 -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
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
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
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
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
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
2d27573e0c Add ImpAntisym axiom
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 08:29:20 -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
Leonardo de Moura
345894d4ed Add => as a primitive. Define Not, And and Or using =>. Add MP and Discharge as axioms.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 20:22:09 -07:00
Leonardo de Moura
d88ff6f8e1 Add more theorems
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 19:10:38 -07:00
Leonardo de Moura
d1388f5e3c Define Lean forall. Prove forall elimination.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 16:44:58 -07:00
Leonardo de Moura
3ff3eb6444 Add Eta axiom
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 14:47:13 -07:00
Leonardo de Moura
68d092f5ef Prove congr1, congr2 and congr theorems. Add xtrans theorem.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 14:37:30 -07:00
Leonardo de Moura
ab915fb3f0 Add add_theorem
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 12:24:20 -07:00
Leonardo de Moura
9d6b421be9 Add theorems Truth, EqMP and EqTElim
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 12:17:55 -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
33d2dd2d8b Add subst proof rule. Define symm and trans using subst.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-06 02:03:22 -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
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
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