kdrag.utils.all_calls

kdrag.utils.all_calls(decl: FuncDeclRef, t: ExprRef) list[ExprRef]

Find subterms that are calls of decl in t.

>>> f = smt.Function("f", smt.IntSort(), smt.IntSort())
>>> all_calls(f, f(f(4*f(3)) + 2))
[f(f(4*f(3)) + 2), f(4*f(3)), f(3)]
Parameters:
  • decl (FuncDeclRef)

  • t (ExprRef)

Return type:

list[ExprRef]