Symex offers a few standard predicates to use as conditions in traversals like decision
, precaution
, and loop
, usable via a convenient syntax.
(at root)
— Are we (i.e. is the cursor) at the root node? Any toplevel form in the source file is considered to be a root node.
(at first)
— Are we at the first node at the present level / on the current branch of the tree?
(at last)
— Are we at the last node at the present level / on the current branch of the tree?
(at initial)
— Are we at the first root-level node in the entire file?
(at final)
— Are we at the last root-level node in the entire file?
In addition to supporting the above syntax, the conditions in traversals like decision
, precaution
, and loop
, are simply traversals themselves, so you may use any traversal as a predicate, including, in particular, any lambda (See Lambdas).
The modifier not
can be used to negate any of the above predicates (or the result of arbitrary lambdas). E.g. (not (at root))
returns true if cursor is not at the root node of the tree.
and
and or
form the conjunction and disjunction of predicates (including lambdas), e.g., (and (not (at root)) (not (at first)))
.