(************************************************************************) (* * The Rocq Prover / The Rocq 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) *) (************************************************************************)
(** Type of regular tree with nodes labelled by values of type 'a TheimplementationusesdeBruijnindices,sobindingcapture isavoidedbytheliftoperator(seeexamplebelow).
Notethatitdiffersfromstandardregulartreesbyaccepting vectorsofvectorsinnodes,whichisusefulforencoding disjunctive-conjunctiverecursivetreessuchasinductivetypes. Standardregulartreescanhowevereasilybesimulatedbyusing
singletons of vectors *) type'a t
(** Building trees *)
(** Build a node given a label and a vector of vectors of sons *) val mk_node : 'a -> 'a t array array -> 'a t
Anotherexample:nestedrecursivetreesrecY=b(recX=a(X,Y),Y,Y) let[|vy|]=mk_rec_calls1in let[|vx|]=mk_rec_calls1in let[|x|]=mk_rec[|mk_nodea[|[|vx;lift1vy|]|]|] let[|y|]=mk_rec[|mk_nodeb[|[|x;vy;vy|]|]|] (notetheliftsothatYlinkstothe"recY"skippingthe"recX")
*) val mk_rec_calls : int -> 'a t array val mk_rec : 'a t array -> 'a t array
(** [lift k t] increases of [k] the free parameters of [t]. Needed
to avoid captures when a tree appears under [mk_rec] *) val lift : int -> 'a t -> 'a t
val is_node : 'a t -> bool
(** Destructors (recursive calls are expanded) *) val dest_node : 'a t -> 'a * 'a t array array
(** First projection of {!dest_node} *) val dest_head : 'a t -> 'a
(** dest_var is not needed for closed trees (i.e. with no free variable) *) val dest_var : 'a t -> int * int
(** Tells if a tree has an infinite branch. The first arg is a comparison
used to detect already seen elements, hence loops *) val is_infinite : ('a -> 'a -> bool) -> 'a t -> bool
(** [Rtree.equiv eq eqlab t1 t2] compares t1 t2 (top-down). Ift1andt2arebothnodes,[eqlab]iscalledontheirlabels, incaseofsuccessdeepernodesareexamined. Incaseofloop(detectedviastructuralequalityparametrized
by [eq]), then the comparison is successful. *) val equiv :
('a -> 'a -> bool) -> ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
(** [Rtree.equal eq t1 t2] compares t1 and t2, first via physical equality,thenbystructuralequality(using[eq]onelements),
then by logical equivalence [Rtree.equiv eq eq] *) val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val inter : ('a -> 'a -> bool) -> ('a -> 'a -> 'a option) -> 'a -> 'a t -> 'a t -> 'a t
val incl : ('a -> 'a -> bool) -> ('a -> 'a -> 'a option) -> 'a -> 'a t -> 'a t -> bool
(** Iterators *)
(** See also [Smart.map] *) valmap : ('a -> 'b) -> 'a t -> 'b t
(** Pretty-printer *) val pr_tree : ('a -> Pp.t) -> 'a t -> Pp.t
module Smart : sig
(** [(Smart.map f t) == t] if [(f a) ==a ] for all nodes *) valmap : ('a -> 'a) -> 'a t -> 'a t
end
module Kind : sig
type'a rtree = 'a t type'a t type'a kind = Var of int * int | Node of 'a * 'a t array array
val make : 'a rtree -> 'a t val kind : 'a t -> 'a kind val repr : 'a t -> 'a rtree
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.