speed up checking states
support unit productions
rewrite to support unit productions
add ptb_train.py