From Semantic Graphs to Logic Formulae