First-order logic representation in Scala