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
.
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.
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.