moved shared parts of translate.ml and semantic.ml to a separated module named Semant