Skip to content

Section documentation for STACK-Maxima /expressions/extraction

Functions for extracting parts from expressions, i.e., trees of operations.


extract_matching_parts(predicate,expression)

Given a predicate, returns a list of all the subtrees of the expression matching that predicate. Including subtrees inside previously matched subtrees.

Note this is largely the same as Maximas format packages matching_parts.

Argument name type description
predicate lamda/function a single argument predicate function
expression expression an expression that may contain parts matching that predicate
Return type description
list the matching subtrees in arbitrary order, could be empty