[semidet]foldsubterms(:Goal3,
+Term1, +State0, -State)
[semidet]foldsubterms(:Goal4,
+Term1, ?Term2, +State0, -State)The predicate foldsubterms/5
calls call(Goal4, SubTerm1, SubTerm2, StateIn, StateOut)
for each subterm, including variables, in Term1. If this call
fails, StateIn and StateOut are the same. This
predicate may be used to map subterms in a term while collecting state
about the mapped subterms. The foldsubterms/4
variant does not map the term.
- Introduced in 8.5.7 (👉3d3eb3c) foldsubterms/5 and use this to bootstrap foldsubterms/4, mapsubterms/3 and mapsubterms_var/3.