test_AST.cc modified to do f1*f2+f1*f3+f2*f3+....