impermeable / coq-waterproof

The Waterproof plugin for the Coq proof assistant allows you to write Coq proofs in a style that resembles handwritten mathematical proofs, designed to help university students with learning how to prove mathematical statements.
https://impermeable.github.io/
GNU Lesser General Public License v3.0
30 stars 9 forks source link

Refactor databases #11

Closed jim-portegies closed 1 year ago

jim-portegies commented 1 year ago

Set up the databases in a more flexible way, that also separates theory from tactics better.

In particular:

jim-portegies commented 1 year ago

Importing now works according to database configuration modules. Here is an example.

Require Import Waterproof.populate_database.
Require Import Waterproof.load.

Module DBExample <: db_config.
Module preload_module := wp_all.
Ltac2 append_databases := true.
Ltac2 global_databases () := [ @arith; @zarith; @real; @wp_core; @wp_classical_logic; @wp_constructive_logic; @wp_integers; @wp_reals; @wp_subsets].
Ltac2 decidability_databases () := [ @nocore; @wp_decidability_nat; @wp_decidability_reals].
Ltac2 negation_databases () := [ @nocore; @wp_negation_nat; @wp_negation_int; @wp_negation_reals].
Ltac2 first_attempt_databases () := [ @core; @wp_subsets; @wp_classical_logic].
End DBExample.

(** Importing now works as follows: *)
Module Import db_DBExample := databases(DBExample).

In the above code, wp_all is a database preload module defined in populate_databases.v. One can define custom preload modules too:

Module my_preload_module <: preload_module.
(** Add lemmas to databases here. *)
End my_preload_module.