Heterogeneous knowledge representation using a finite automaton and first order logic: a case study in electromyography