Commit graph

20 commits

Author SHA1 Message Date
Leonardo de Moura
3e32d9bef2 feat(library/tactic): add support for Pi's at to_proof_state
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-22 16:40:55 -08:00
Leonardo de Moura
51aee83b70 refactor(kernel/metavar_env): use the same approach used in the class environment in the class metavar_env
This modification was motivated by a bug exposed by tst17 at tests/kernel/type_checker.
metavar_env is now a smart point to metavar_env_cell.
ro_metavar_env is a read-only smart pointer. It is useful to make sure we are using proof_state correctly.

example showing that the approach for caching metavar_env is broken in the type_checker

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-13 18:59:15 -08:00
Leonardo de Moura
2e5e5e187f chore(util/rc): remove unnecessary argument from LEAN_COPY_REF and LEAN_MOVE_REF macros
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-13 15:01:24 -08:00
Leonardo de Moura
f97c260b0b refactor(kernel/environment): add ro_environment
The environment object is a "smart-pointer".
Before this commit, the use of "const &" for environment objects was broken.
For example, suppose we have a function f that should not modify the input environment.
Before this commit, its signature would be
       void f(environment const & env)
This is broken, f's implementation can easilty convert it to a read-write pointer by using
the copy constructor.
       environment rw_env(env);
Now, f can use rw_env to update env.

To fix this issue, we now have ro_environment. It is a shared *const* pointer.
We can convert an environment into a ro_environment, but not the other way around.

ro_environment can also be seen as a form of documentation.
For example, now it is clear that type_inferer is not updating the environment, since its constructor takes a ro_environment.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-12 16:48:34 -08:00
Leonardo de Moura
c0b9c7ffc4 refactor(library/io_state): simplify regular/diagnostic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-10 13:09:35 -08:00
Leonardo de Moura
3e1fd06903 refactor(kernel/expr): remove 'null' expression, and operator bool for expression
After this commit, a value of type 'expr' cannot be a reference to nullptr.
This commit also fixes several bugs due to the use of 'null' expressions.

TODO: do the same for kernel objects, sexprs, etc.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-07 23:21:10 -08:00
Leonardo de Moura
fa98c1358f feat(library/tactic): add disj_tactic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-05 04:49:06 -08:00
Leonardo de Moura
1a221d8bbe feat(library/tactic): add focus tactical
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-30 11:28:38 -08:00
Leonardo de Moura
dae86c2ffa feat(frontends/lean/parser): add basic tactic support in the frontend
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-28 21:08:12 -08:00
Leonardo de Moura
956f203a55 refactor(bindings/lua): move Lua bindings to the file associated with them
The directory bindings/lua was getting too big and had too many dependencies.
Moreover, it was getting too painful to edit/maintain two different places.
Now, the bindings for module X are in the directory that defines X.
For example, the bindings for util/name.cpp are located at util/name.cpp.

The only exception is the kernel. We do not want to inflate the kernel
with Lua bindings. The bindings for the kernel classes are located
at bindings/kernel_bindings.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-26 19:15:56 -08:00
Leonardo de Moura
c22f863114 refactor(library/tactic): improve solve method
Now, it produces the following outcomes:
1- A proof
2- A counterexample
3- A list of (unsolved) final states

Remark: the solve method does not check whether the proof or counterexample is correct.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-25 13:04:12 -08:00
Leonardo de Moura
9a8ea0c735 feat(library/tactic): add precision and counterexample builder to proof state
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-25 11:43:16 -08:00
Leonardo de Moura
500ed7a05b refactor(library/tactic): remove dead code, make proof_state a smart pointer, cleanup
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-25 10:39:40 -08:00
Leonardo de Moura
2c65fdb346 refactor(library/tactic): cleanup
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-25 01:06:34 -08:00
Leonardo de Moura
796fb3c3bf refactor(library/tactic): remove justification_builder
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-21 17:29:06 -08:00
Leonardo de Moura
41062fdf9f feat(library/tactic): add pretty printer for goal and proof_state objects, add solve method for tactics, add trivial example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-21 17:29:06 -08:00
Leonardo de Moura
680ec8abba refactor(library/tactic): reorganize tactic API, add assumption_tactic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-21 17:29:06 -08:00
Leonardo de Moura
63bbf07f64 feat(library/tactic): add 'idtac' tactic and 'then' tactical
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-21 17:29:06 -08:00
Leonardo de Moura
a03841c18b feat(tactic): refine tactic API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-21 17:29:06 -08:00
Leonardo de Moura
3a6aa2dc75 feat(library/tactic): add tactic framework APIs
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-20 17:19:05 -08:00