u**x 发帖数: 45 | 1 这种题机械的用状态转移图就完了。
Below, immediate backward transitions are neglected. State chain
terminates when it arrive visited states.
以下用河此岸状况和船的位置标记每个state. 划一次船为一个transition. 每个
legal transition, 应满足仅ABCa, 能划船的条件,和下一state legal 的条件。
state0. ABCabc+boat
step1. 三种可能。
s1.1 ABab S1.2BCbc S1.3 ABCc
step2.
s2.1 ABabC+boat S2.2 ABCbc+boat S2.3 ABCac+boat (same as S2.1 Terminate.)
Step3.
s3.1 ABC S3.2 No legal transition except immediate backwards. Terminate.
S4. ABCa+boat
S5. Aa
S6 AaBb+boat
S7.1 ab S7.2 Bb
S |
|