def compileADF(expr, psets):
 adfdict = {}
 func = None
 for (pset, subexpr) in reversed(zip(psets, expr)):
  pset.context.update(adfdict)
  func = compile(subexpr, pset)
  adfdict.update({pset.name: func})
 return func

def compileADF ( expr , psets ) : adfdict = { } func = None for ( pset , subexpr ) in reversed ( zip ( psets , expr ) ) : pset . context . update ( adfdict ) func = compile ( subexpr , pset ) adfdict . update ( { pset . name : func } ) return func
compile the expression represented by a list of trees .