incgen: fix only exporting part of history expressions.
incgen: fix only exporting part of history expressions.

History expressions like 'sent(EVPAT)' are expanded into 'PAT in
sent(EVT)' by the parser. Previously, incgen only exported the right
hand side (sent/received) of the expression, leaving the bulk of the
query unoptimized. This fix exports the whole expression to the inc
module.

* da/compiler/incgen.py(QueryExtractor):

  - Update doc string.
  - (.visit_ComplexExpr): no need to find top-level query, pre-order
    traversal guarantees we always see top-level query first.
  - (.visit_HistoryExpr): new method, handles sent/received expressions.
  - (.visit_SentExpr, .visit_ReceivedExpr): link to 'visit_HistoryExpr'.

sghosh1991/distalgo,sghosh1991/distalgo