bot algo for halt, sos and initial state