| 1 |
(************************************************************************) |
| 2 |
(* * The Rocq Prover / The Rocq Development Team *) |
| 3 |
(* v * Copyright INRIA, CNRS and contributors *) |
| 4 |
(* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 |
(* \VV/ **************************************************************) |
| 6 |
(* // * This file is distributed under the terms of the *) |
| 7 |
(* * GNU Lesser General Public License Version 2.1 *) |
| 8 |
(* * (see LICENSE file for the text of the license) *) |
| 9 |
(************************************************************************) |
| 10 |
|
| 11 |
(** Various syntactic shorthands that are useful with [Program]. *) |
| 12 |
|
| 13 |
Require Export Corelib.Program.Tactics. |
| 14 |
|
| 15 |
Set Implicit Arguments. |
| 16 |
|
| 17 |
(** A simpler notation for subsets defined on a cartesian product. *) |
| 18 |
|
| 19 |
Notation "{ ( x , y ) : A | P }" := |
| 20 |
(sig (fun anonymous : A => let (x,y) := anonymous in P)) |
| 21 |
(x name, y name) : type_scope. |
| 22 |
|
| 23 |
Declare Scope program_scope. |
| 24 |
Delimit Scope program_scope with prg. |
| 25 |
|
| 26 |
(** Generates an obligation to prove False. *) |
| 27 |
|
| 28 |
Notation " ! " := (False_rect _ _) : program_scope. |
| 29 |
|
| 30 |
(** Abbreviation for first projection and hiding of proofs of subset objects. *) |
| 31 |
|
| 32 |
Notation " ` t " := (proj1_sig t) (at level 10, t at next level) : program_scope. |
| 33 |
|
| 34 |
(** Coerces objects to their support before comparing them. *) |
| 35 |
|
| 36 |
(** Construct a dependent disjunction from a boolean. *) |
| 37 |
|
| 38 |
Abbreviation dec := sumbool_of_bool. |
| 39 |
|
| 40 |
(** The notations [in_right] and [in_left] construct objects of a dependent disjunction. *) |
| 41 |
|
| 42 |
(** Hide proofs and generates obligations when put in a term. *) |
| 43 |
|
| 44 |
Abbreviation in_left := (@left _ _ _). |
| 45 |
Abbreviation in_right := (@right _ _ _). |
| 46 |
|
| 47 |
(** Extraction directives *) |
| 48 |
(* |
| 49 |
Extraction Inline proj1_sig. |
| 50 |
Extract Inductive unit => "unit" [ "()" ]. |
| 51 |
Extract Inductive bool => "bool" [ "true" "false" ]. |
| 52 |
Extract Inductive sumbool => "bool" [ "true" "false" ]. |
| 53 |
(* Extract Inductive prod "'a" "'b" => " 'a * 'b " [ "(,)" ]. *) |
| 54 |
(* Extract Inductive sigT => "prod" [ "" ]. *) |
| 55 |
*) |