Module Term.KB

val map : ('a, 'b) cls -> 'a t -> f:('b t -> 'b t Bap_knowledge.knowledge) -> 'a t Bap_knowledge.knowledge

map t p ~f returns term p with all subterms of type t mapped with function f.

  • since 2.6.0
val filter_map : ('a, 'b) cls -> 'a t -> f:('b t -> 'b t option Bap_knowledge.knowledge) -> 'a t Bap_knowledge.knowledge

filter_map t p ~f returns term p with all subterms of type t filter_mapped with function f, i.e., all terms for which function f returned Some thing are substituted by the thing, otherwise they're removed from the parent term.

  • since 2.6.0
val filter : ('a, 'b) cls -> 'a t -> f:('b t -> bool Bap_knowledge.knowledge) -> 'a t Bap_knowledge.knowledge

filter t p ~f returns a term p with subterms c for which f c = false removed.

  • since 2.6.0