aboutsummaryrefslogtreecommitdiff
path: root/lib/searchstack.mli
diff options
context:
space:
mode:
authorgareuselesinge2013-08-08 18:50:39 +0000
committergareuselesinge2013-08-08 18:50:39 +0000
commit6bac888419048aa8fe06b49bf94f64893228bb00 (patch)
treee01a628f3419265b786318feada5d98cbaba5ab8 /lib/searchstack.mli
parent0faf3c5a53113ec8f31c1747c9cafe4118831282 (diff)
Searchable stack data structure
It is like Stack but one can search without popping git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16670 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/searchstack.mli')
-rw-r--r--lib/searchstack.mli25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/searchstack.mli b/lib/searchstack.mli
new file mode 100644
index 0000000000..6c81a2a9c9
--- /dev/null
+++ b/lib/searchstack.mli
@@ -0,0 +1,25 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+type 'a t
+type ('a,'b) search = [ `Stop of 'b | `Cont of 'a ]
+
+val create : unit -> 'a t
+val push : 'a -> 'a t -> unit
+val find : ('c -> 'a -> ('c, 'b) search) -> 'c -> 'a t -> 'b
+val is_empty : 'a t -> bool
+val iter : ('a -> unit) -> 'a t -> unit
+val clear : 'a t -> unit
+val length : 'a t -> int
+
+(* may raise Stack.Empty *)
+val pop : 'a t -> 'a
+val top : 'a t -> 'a
+
+(* Extra *)
+val to_list : 'a t -> 'a list