Commits

Anonymous committed 3a35c2b

Sub-module 'Ext' externalized as a stand-alone module for sharing.

Comments (0)

Files changed (2)

     type t  (** Abstract type of formulas. *)
     val top : unit -> t  (** Most general formula. *)
     val entails : t -> t -> bool  (** Entailment relation {e is more specific than} of the logic. *)
-    val gen : t -> t -> t list -> t list  (** Dichotomic operator for generating new features. *)
     val parse : Syntax.t_stream -> t  (** Parsing of formulas from token streams. *)
     val print : t -> Syntax.t_list  (** Printing of formulas to token lists. *)
+    val gen : t -> t -> t list -> t list  (** Dichotomic operator for generating new features. *)
     val simpl : t -> t Stream.t  (** Simplifications of a formula. *)
   end
 
     val top : nid
     (** Id of the most general node. *)
 
+(*
     (** Module for the representation of extents (sets of objects). *)
     module Ext :
       sig
         val fold_right : (nid -> 'a -> 'a) -> t -> 'a -> 'a
           (** Folding on an extent from high ids to low ids (see List.fold_right). *)
       end
+*)
 
     type node
     (** Abstract type of nodes.
     let some_log = match Param.log_file with None -> false | Some _ -> true
     let log_fmt = match Param.log_file with None -> Format.err_formatter | Some name -> formatter_of_out_channel (open_out name)
 
-
     type nid = int
 
-    module Ext =
-      struct
-        type t = int * nid LSet.t
-        let empty = 0, LSet.empty ()
-        let is_empty (s,_) = s=0
-        let cardinal (s,_) = s
-        let mem nid (_,l) = LSet.mem nid l
-        let contains (_,l1) (_,l2) = LSet.contains l1 l2
-        let add nid (_,l) = let l' = LSet.add nid l in LSet.cardinal l', l'
-        let remove nid (_,l) = let l' = LSet.remove nid l in LSet.cardinal l', l'
-        let union (_,l1) (_,l2) = let l' = LSet.union l1 l2 in LSet.cardinal l', l'
-        let union_r exts = let l' = LSet.union_r (List.map snd exts) in LSet.cardinal l', l'
-        let inter (_,l1) (_,l2) = let l' = LSet.inter l1 l2 in LSet.cardinal l', l'
-        let inter_r exts = let l' = LSet.inter_r (List.map snd exts) in LSet.cardinal l', l'
-        let subtract (_,l1) (_,l2) = let l' = LSet.subtract l1 l2 in LSet.cardinal l', l'
-        let inter_difsym (_,l1) (_,l2) =
-          LSet.fold
-            (fun ((s1,l1), (s2,l2), (s3,l3)) (w,x) ->
-               match w with
-               | LSet.Infst -> (s1+1,LSet.add x l1), (s2,l2), (s3,l3)
-               | LSet.Inboth -> (s1,l1), (s2+1,LSet.add x l2), (s3,l3)
-               | LSet.Insnd -> (s1,l1), (s2,l2), (s3+1,LSet.add x l3))
-            ((0,LSet.empty ()) , (0,LSet.empty ()), (0,LSet.empty ()))
-            l1 l2
-        let iter f (_,l) = List.iter f l
-        let fold_left f e (_,l) = List.fold_left f e l
-        let fold_right f (_,l) e = List.fold_right f l e
-      end
-
     module Nval =
       struct
         type t = float
     type t  (** Abstract type of formulas. *)
     val top : unit -> t  (** Most general formula. *)
     val entails : t -> t -> bool  (** Entailment relation {e is more specific than} of the logic. *)
-    val gen : t -> t -> t list -> t list  (** Dichotomic operator for generating new features. *)
     val parse : Syntax.t_stream -> t  (** Parsing of formulas from token streams. *)
     val print : t -> Syntax.t_list  (** Printing of formulas to token lists. *)
+    val gen : t -> t -> t list -> t list  (** Dichotomic operator for generating new features. *)
     val simpl : t -> t Stream.t  (** Simplifications of a formula. *)
   end
 
     val top : nid
     (** Id of the most general node. *)
 
-    (** Module for the representation of extents (sets of objects). *)
-    module Ext :
-      sig
-        type t  (** Abstract type of extents. *)
-        val empty : t  (** The empty extent. *)
-        val is_empty : t -> bool  (** [is_empty ext] tests whether [ext] is empty. *)
-        val cardinal : t -> int  (** [cardinal ext] returns the size of the extent [ext]. *)
-        val mem : nid -> t -> bool  (** [mem o ext] tests whether [o] belongs to [ext]. *)
-        val contains : t -> t -> bool  (** [contains ext1 ext2] tests whether [ext1] contains [ext2]. *)
-        val add : nid -> t -> t  (** [add o ext] returns the addition of [o] to [ext]. *)
-        val remove : nid -> t -> t  (** [remove o ext] returns the removal of [o] from [ext]. *)
-        val union : t -> t -> t  (** [union ext1 ext2] returns the set union of [ext1] and [ext2]. *)
-        val union_r : t list -> t  (** [union_r exts] returns the union of all extents in [exts]. *)
-        val inter : t -> t -> t  (** [inter ext1 ext2] returns the set intersection of [ext1] and [ext2]. *)
-        val inter_r : t list -> t  (** [inter_r exts] returns the intersection of all extents in [exts].
-                                       @raise Invalid_argument if [exts] is the empty list. *)
-        val subtract : t -> t -> t  (** [subtract ext1 ext2] returns the set subtraction of [ext1] and [ext2]. *)
-        val inter_difsym : t -> t -> t * t * t
-          (** [inter_difsym ext1 ext2] returns the extent triplet [(subtract ext1 ext2, inter ext1 ext2, subtract ext2 ext1)]. *)
-        val iter : (nid -> unit) -> t -> unit
-          (** Iteration on the objects of an extent (see [List.iter]). Objects visited from low ids to high ids. *)
-        val fold_left : ('a -> nid -> 'a) -> 'a -> t -> 'a
-          (** Folding on an extent from low ids to high ids (see List.fold_left). *)
-        val fold_right : (nid -> 'a -> 'a) -> t -> 'a -> 'a
-          (** Folding on an extent from high ids to low ids (see List.fold_right). *)
-      end
-
     type node
     (** Abstract type of nodes.