~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to pretyping/matching.mli

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(************************************************************************)
 
2
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
 
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
 
4
(*   \VV/  **************************************************************)
 
5
(*    //   *      This file is distributed under the terms of the       *)
 
6
(*         *       GNU Lesser General Public License Version 2.1        *)
 
7
(************************************************************************)
 
8
 
 
9
(*i $Id: matching.mli 11739 2009-01-02 19:33:19Z herbelin $ i*)
 
10
 
 
11
(*i*)
 
12
open Names
 
13
open Term
 
14
open Environ
 
15
open Pattern
 
16
open Termops
 
17
(*i*)
 
18
 
 
19
(*s This modules implements pattern-matching on terms *)
 
20
 
 
21
exception PatternMatchingFailure
 
22
 
 
23
val special_meta : metavariable
 
24
 
 
25
type bound_ident_map = (identifier * identifier) list
 
26
 
 
27
(* [matches pat c] matches [c] against [pat] and returns the resulting
 
28
   assignment of metavariables; it raises [PatternMatchingFailure] if
 
29
   not matchable; bindings are given in increasing order based on the
 
30
   numbers given in the pattern *)
 
31
val matches : constr_pattern -> constr -> patvar_map
 
32
 
 
33
(* [extended_matches pat c] also returns the names of bound variables
 
34
   in [c] that matches the bound variables in [pat]; if several bound
 
35
   variables or metavariables have the same name, the metavariable,
 
36
   or else the rightmost bound variable, takes precedence *)
 
37
val extended_matches : 
 
38
  constr_pattern -> constr -> bound_ident_map * patvar_map
 
39
 
 
40
(* [is_matching pat c] just tells if [c] matches against [pat] *)
 
41
val is_matching : constr_pattern -> constr -> bool
 
42
 
 
43
(* [matches_conv env sigma] matches up to conversion in environment
 
44
   [(env,sigma)] when constants in pattern are concerned; it raises
 
45
   [PatternMatchingFailure] if not matchable; bindings are given in
 
46
   increasing order based on the numbers given in the pattern *)
 
47
val matches_conv :env -> Evd.evar_map -> constr_pattern -> constr -> patvar_map
 
48
 
 
49
(* The type of subterm matching results: a substitution + a context
 
50
   (whose hole is denoted with [special_meta]) + a continuation that
 
51
   either returns the next matching subterm or raise PatternMatchingFailure *)
 
52
type subterm_matching_result =
 
53
    (bound_ident_map * patvar_map) * constr * (unit -> subterm_matching_result)
 
54
 
 
55
(* [match_subterm n pat c] returns the substitution and the context
 
56
   corresponding to the first **closed** subterm of [c] matching [pat], and
 
57
   a continuation that looks for the next matching subterm.
 
58
   It raises PatternMatchingFailure if no subterm matches the pattern *)
 
59
val match_subterm : constr_pattern -> constr -> subterm_matching_result
 
60
 
 
61
(* [match_appsubterm pat c] returns the substitution and the context
 
62
   corresponding to the first **closed** subterm of [c] matching [pat], 
 
63
   considering application contexts as well. It also returns a
 
64
   continuation that looks for the next matching subterm.
 
65
   It raises PatternMatchingFailure if no subterm matches the pattern *)
 
66
val match_appsubterm : constr_pattern -> constr -> subterm_matching_result
 
67
 
 
68
(* [match_subterm_gen] calls either [match_subterm] or [match_appsubterm] *)
 
69
val match_subterm_gen : bool (* true = with app context *) -> 
 
70
   constr_pattern -> constr -> subterm_matching_result
 
71
 
 
72
(* [is_matching_appsubterm pat c] tells if a subterm of [c] matches
 
73
   against [pat] taking partial subterms into consideration *)
 
74
val is_matching_appsubterm : ?closed:bool -> constr_pattern -> constr -> bool
 
75
 
 
76
(* [is_matching_conv env sigma pat c] tells if [c] matches against [pat]
 
77
   up to conversion for constants in patterns *)
 
78
val is_matching_conv :
 
79
  env -> Evd.evar_map -> constr_pattern -> constr -> bool