MONA - a decision procedure for monadic second-order logic on finite strings and trees