Simplify with C++11 loop style
Improve comment of PAI::addAction (add hypergraph structure)