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

« back to all changes in this revision

Viewing changes to lib/heap.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: heap.mli 6621 2005-01-21 17:24:37Z herbelin $ i*)
 
10
 
 
11
(* Heaps *)
 
12
 
 
13
module type Ordered = sig
 
14
  type t
 
15
  val compare : t -> t -> int
 
16
end
 
17
 
 
18
module type S =sig
 
19
  
 
20
  (* Type of functional heaps *)
 
21
  type t
 
22
 
 
23
  (* Type of elements *)
 
24
  type elt
 
25
    
 
26
  (* The empty heap *)
 
27
  val empty : t
 
28
    
 
29
  (* [add x h] returns a new heap containing the elements of [h], plus [x];
 
30
     complexity $O(log(n))$ *)
 
31
  val add : elt -> t -> t
 
32
    
 
33
  (* [maximum h] returns the maximum element of [h]; raises [EmptyHeap]
 
34
     when [h] is empty; complexity $O(1)$ *)
 
35
  val maximum : t -> elt
 
36
    
 
37
  (* [remove h] returns a new heap containing the elements of [h], except
 
38
     the maximum of [h]; raises [EmptyHeap] when [h] is empty; 
 
39
     complexity $O(log(n))$ *) 
 
40
  val remove : t -> t
 
41
    
 
42
  (* usual iterators and combinators; elements are presented in
 
43
     arbitrary order *)
 
44
  val iter : (elt -> unit) -> t -> unit
 
45
    
 
46
  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
 
47
    
 
48
end
 
49
 
 
50
exception EmptyHeap
 
51
 
 
52
(*S Functional implementation. *)
 
53
 
 
54
module Functional(X: Ordered) : S with type elt=X.t