non-recursive non-AC pattern matcher (work in progress)

not ready for review yet