File: pattern.mli

package info (click to toggle)
coq-doc 8.20.0-2
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 46,708 kB
  • sloc: ml: 234,429; sh: 4,686; python: 3,359; ansic: 2,644; makefile: 842; lisp: 172; javascript: 87; xml: 24; sed: 2
file content (57 lines) | stat: -rw-r--r-- 2,545 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

open Names

(** {5 Patterns} *)

(** Cases pattern variables *)
type patvar = Id.t

type case_info_pattern =
    { cip_style : Constr.case_style;
      cip_ind : inductive option;
      cip_extensible : bool (** does this match end with _ => _ ? *) }

type 'i uninstantiated_pattern =
  | PGenarg : Genarg.glob_generic_argument -> [ `uninstantiated ] uninstantiated_pattern

type 'i constr_pattern_r =
  | PRef of GlobRef.t
  | PVar of Id.t
  | PEvar of (Evar.t * 'i constr_pattern_r list)
  | PRel of int
  | PApp of 'i constr_pattern_r * 'i constr_pattern_r array
  | PSoApp of patvar * 'i constr_pattern_r list
  | PProj of Projection.t * 'i constr_pattern_r
  | PLambda of Name.t * 'i constr_pattern_r * 'i constr_pattern_r
  | PProd of Name.t * 'i constr_pattern_r * 'i constr_pattern_r
  | PLetIn of Name.t * 'i constr_pattern_r * 'i constr_pattern_r option * 'i constr_pattern_r
  | PSort of Sorts.family
  | PMeta of patvar option
  | PIf of 'i constr_pattern_r * 'i constr_pattern_r * 'i constr_pattern_r
  | PCase of case_info_pattern * (Name.t array * 'i constr_pattern_r) option * 'i constr_pattern_r *
      (int * Name.t array * 'i constr_pattern_r) list (** index of constructor, nb of args *)
  | PFix of (int array * int) * (Name.t array * 'i constr_pattern_r array * 'i constr_pattern_r array)
  | PCoFix of int * (Name.t array * 'i constr_pattern_r array * 'i constr_pattern_r array)
  | PInt of Uint63.t
  | PFloat of Float64.t
  | PString of Pstring.t
  | PArray of 'i constr_pattern_r array * 'i constr_pattern_r * 'i constr_pattern_r
  | PUninstantiated of 'i uninstantiated_pattern

type constr_pattern = [ `any ] constr_pattern_r

(** Nota : in a [PCase], the array of branches might be shorter than
    expected, denoting the use of a final "_ => _" branch *)

type _ pattern_kind =
  | Any
  | Uninstantiated : [`uninstantiated] pattern_kind