Skip to content

Commit

Permalink
use hollight 3.0 (#5)
Browse files Browse the repository at this point in the history
- HOLLight_Real.Quotient: remove Local Definition of a
- hol_upto_real.ml: update wrt HOL-Light 3.0
- erasing.lp: update wrt Deducteam/hol2dk#161 and Deducteam/hol2dk#149
- reproduce: update hollight, hol2dk and lambdapi versions
- reproduce: add stage mechanism to run reproduce again by skipping stages that succeeded
- terms.v, theorems.v: type arguments have readable names now
  • Loading branch information
fblanqui authored Jan 10, 2025
1 parent 484b4ad commit 556e7c0
Show file tree
Hide file tree
Showing 10 changed files with 436 additions and 402 deletions.
3 changes: 2 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- [Frédéric Blanqui](https://blanqui.gitlabpages.inria.fr/)
- Amal Makni
- [Anthony Bordg](https://sites.google.com/site/anthonybordg/) for the alignment of the types sum, list, option
- Amal Makni for the alignment of subtypes, quotient types and part of the type of real numbers
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## Unreleased

- HOLLight_Real.Quotient: remove Local Definition of a
- hol_upto_real.ml: update wrt HOL-Light 3.0
- erasing.lp: update wrt https://github.com/Deducteam/hol2dk/pull/161 and https://github.com/Deducteam/hol2dk/pull/149
- reproduce: update hollight, hol2dk and lambdapi versions
- reproduce: add stage mechanism to run reproduce again by skipping stages that succeeded
- terms.v, theorems.v: type arguments have readable names now

## 1.0.0 (2024-11-03)

First release.
19 changes: 10 additions & 9 deletions HOLLight_Real.v
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,22 @@ Section Quotient.
Lemma is_eq_class_of x : is_eq_class (class_of x).
Proof. exists x. reflexivity. Qed.

Local Definition a := el A.
Lemma non_empty : is_eq_class (class_of (el A)).
Proof. exists (el A). reflexivity. Qed.

Definition quotient := subtype (is_eq_class_of a).
Definition quotient := subtype non_empty.

Definition mk_quotient : (A -> Prop) -> quotient := mk (is_eq_class_of a).
Definition dest_quotient : quotient -> (A -> Prop) := dest (is_eq_class_of a).
Definition mk_quotient : (A -> Prop) -> quotient := mk non_empty.
Definition dest_quotient : quotient -> (A -> Prop) := dest non_empty.

Lemma mk_dest_quotient : forall x, mk_quotient (dest_quotient x) = x.
Proof. exact (mk_dest (is_eq_class_of a)). Qed.
Proof. exact (mk_dest non_empty). Qed.

Lemma dest_mk_aux_quotient : forall x, is_eq_class x -> (dest_quotient (mk_quotient x) = x).
Proof. exact (dest_mk_aux (is_eq_class_of a)). Qed.
Proof. exact (dest_mk_aux non_empty). Qed.

Lemma dest_mk_quotient : forall x, is_eq_class x = (dest_quotient (mk_quotient x) = x).
Proof. exact (dest_mk (is_eq_class_of a)). Qed.
Proof. exact (dest_mk non_empty). Qed.

Definition elt_of : quotient -> A := fun x => ε (dest_quotient x).

Expand Down Expand Up @@ -1616,7 +1617,7 @@ Proof.
induction 1; unfold list_pred; intros R h; apply h.
left; reflexivity.
right. exists a''. exists (_dest_list l''). split. reflexivity. apply h.
induction l''. auto. right. exists a0. exists (_dest_list l''). split. reflexivity.
induction l''. auto. right. exists a. exists (_dest_list l''). split. reflexivity.
apply h. exact IHl''.
Qed.

Expand All @@ -1631,7 +1632,7 @@ Proof.
intro e. rewrite <- e. intros P h. apply h. destruct (_mk_list r).
left. reflexivity. right. exists t0. exists (_dest_list l). split.
reflexivity. apply h. generalize l.
induction l0. left; reflexivity. right. exists a0. exists (_dest_list l0). split.
induction l0. left; reflexivity. right. exists a. exists (_dest_list l0). split.
reflexivity. apply h. exact IHl0.
Qed.

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
HOL-Light definition of real numbers in Coq
-------------------------------------------

This library provides a representation in Coq of the definition of real numbers in HOL-Light.
This library provides a translation in Coq of the definition of real numbers in HOL-Light.

It has been automatically generated from HOL-Light using [hol2dk](https://github.com/Deducteam/hol2dk) and [lambdapi](https://github.com/Deducteam/lambdapi).

Proofs are not included but can be regenerated and rechecked by running [reproduce](https://github.com/Deducteam/coq-hol-light-real/blob/main/reproduce).
Proofs are not included but can be regenerated and rechecked by running [reproduce](https://github.com/Deducteam/coq-hol-light-real/blob/main/reproduce) (it takes around 5 minutes on a machine with 32 processors Intel Core i9-13950HX and 64 Gb RAM).

As HOL-Light is based on higher-order logic, this library assumes classical logic, Hilbert's ε operator, functional and propositional extensionnality (see [HOLLight.v](https://github.com/Deducteam/coq-hol-light-real/blob/main/HOLLight.v) for more details):

Expand All @@ -17,8 +17,6 @@ Axiom prop_ext : forall {P Q : Prop}, (P -> Q) -> (Q -> P) -> P = Q.
Axiom proof_irrelevance : forall (P:Prop) (p1 p2:P), p1 = p2.
```

Remark: the files `real*.v` are copied from [coq-fourcolor](https://github.com/coq-community/fourcolor) (commit c028f9b).

**Installation using [opam](https://opam.ocaml.org/)**

```
Expand Down
16 changes: 8 additions & 8 deletions erasing.lp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ builtin "ex_def" ≔ ∃_def;
builtin "not" ≔ ¬;
builtin "not_def" ≔ ¬_def;

builtin "True" ≔ T;
builtin "T_def" ≔ T_def;
builtin "True" ≔ ;
builtin "T_def" ≔ ⊤_def;

builtin "False" ≔ F;
builtin "F_def" ≔ F_def;
builtin "False" ≔ ;
builtin "F_def" ≔ ⊥_def;

builtin "ex1" ≔ ∃!;
builtin "ex1_def" ≔ ∃!_def;
builtin "ex1" ≔ ∃;
builtin "ex1_def" ≔ ∃_def;

// natural deduction rules
builtin "Logic.I" ≔ Tᵢ;
builtin "Logic.I" ≔ ⊤ᵢ;
builtin "conj" ≔ ∧ᵢ;
builtin "proj1" ≔ ∧ₑ₁;
builtin "proj2" ≔ ∧ₑ₂;
Expand Down Expand Up @@ -259,7 +259,7 @@ builtin "treal_mul" ≔ treal_mul;
builtin "treal_inv" ≔ treal_inv;
builtin "treal_neg" ≔ treal_neg;

builtin "real" ≔ real;
builtin "real" ≔ Real;
builtin "mk_real" ≔ mk_real;
builtin "dest_real" ≔ dest_real;
builtin "axiom_23" ≔ axiom_23;
Expand Down
104 changes: 104 additions & 0 deletions hol_lib_upto_real.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
(* ========================================================================= *)
(* HOL LIGHT *)
(* *)
(* Modern OCaml version of the HOL theorem prover *)
(* *)
(* John Harrison *)
(* *)
(* (c) Copyright, University of Cambridge 1998 *)
(* (c) Copyright, John Harrison 1998-2024 *)
(* (c) Copyright, Juneyoung Lee 2024 *)
(* ========================================================================= *)

include Bignum;;
open Hol_loader;;

(* ------------------------------------------------------------------------- *)
(* Bind these to names that are independent of OCaml versions before they *)
(* are potentially overwritten by an identifier of the same name. In older *)
(* and newer Ocaml versions these are respectively: *)
(* *)
(* Pervasives.sqrt -> Float.sqrt *)
(* Pervasives.abs_float -> Stdlib.abs_float / Float.abs *)
(* ------------------------------------------------------------------------- *)

let float_sqrt = sqrt;;
let float_fabs = abs_float;;

(* ------------------------------------------------------------------------- *)
(* Various tweaks to OCaml and general library functions. *)
(* ------------------------------------------------------------------------- *)

loads "system.ml";; (* Set up proper parsing and load bignums *)
loads "lib.ml";; (* Various useful general library functions *)

(* ------------------------------------------------------------------------- *)
(* The logical core. *)
(* ------------------------------------------------------------------------- *)

loads "fusion.ml";;

(* ------------------------------------------------------------------------- *)
(* Some extra support stuff needed outside the core. *)
(* ------------------------------------------------------------------------- *)

loads "basics.ml";; (* Additional syntax operations and other utilities *)
loads "nets.ml";; (* Term nets for fast matchability-based lookup *)

(* ------------------------------------------------------------------------- *)
(* The interface. *)
(* ------------------------------------------------------------------------- *)

loads "printer.ml";; (* Crude prettyprinter *)
loads "preterm.ml";; (* Preterms and their interconversion with terms *)
loads "parser.ml";; (* Lexer and parser *)

(* ------------------------------------------------------------------------- *)
(* Higher level deductive system. *)
(* ------------------------------------------------------------------------- *)

loads "equal.ml";; (* Basic equality reasoning and conversionals *)
loads "bool.ml";; (* Boolean theory and basic derived rules *)
loads "drule.ml";; (* Additional derived rules *)
loads "tactics.ml";; (* Tactics, tacticals and goal stack *)
loads "itab.ml";; (* Toy prover for intuitionistic logic *)
loads "simp.ml";; (* Basic rewriting and simplification tools *)
loads "theorems.ml";; (* Additional theorems (mainly for quantifiers) etc. *)
loads "ind_defs.ml";; (* Derived rules for inductive definitions *)
loads "class.ml";; (* Classical reasoning: Choice and Extensionality *)
loads "trivia.ml";; (* Some very basic theories, e.g. type ":1" *)
loads "canon.ml";; (* Tools for putting terms in canonical forms *)
loads "meson.ml";; (* First order automation: MESON (model elimination) *)
loads "firstorder.ml";; (* More utilities for first-order shadow terms *)
loads "metis.ml";; (* More advanced first-order automation: Metis *)
loads "thecops.ml";; (* Connection-based automation: leanCoP and nanoCoP *)
loads "quot.ml";; (* Derived rules for defining quotient types *)
loads "impconv.ml";; (* More powerful implicational rewriting etc. *)

(* ------------------------------------------------------------------------- *)
(* Mathematical theories and additional proof tools. *)
(* ------------------------------------------------------------------------- *)

loads "pair.ml";; (* Theory of pairs *)
loads "compute.ml";; (* General call-by-value reduction tool for terms *)
loads "nums.ml";; (* Axiom of Infinity, definition of natural numbers *)
loads "recursion.ml";; (* Tools for primitive recursion on inductive types *)
loads "arith.ml";; (* Natural number arithmetic *)
loads "wf.ml";; (* Theory of wellfounded relations *)
loads "calc_num.ml";; (* Calculation with natural numbers *)
loads "normalizer.ml";; (* Polynomial normalizer for rings and semirings *)
loads "grobner.ml";; (* Groebner basis procedure for most semirings *)
loads "ind_types.ml";; (* Tools for defining inductive types *)
loads "lists.ml";; (* Theory of lists *)
loads "realax.ml";; (* Definition of real numbers *)
loads "calc_int.ml";; (* Calculation with integer-valued reals *)
loads "realarith.ml";; (* Universal linear real decision procedure *)
loads "real.ml";; (* Derived properties of reals *)
(*
loads "calc_rat.ml";; (* Calculation with rational-valued reals *)
loads "int.ml";; (* Definition of integers *)
loads "sets.ml";; (* Basic set theory *)
loads "iterate.ml";; (* Iterated operations *)
loads "cart.ml";; (* Finite Cartesian products *)
loads "define.ml";; (* Support for general recursive definitions *)
*)
Loading

0 comments on commit 556e7c0

Please sign in to comment.