let start     -> 'Left',3,3.
let finish    -> 'Right',3,3.
let solution  -> [start]!(move^+ o done).
let move      -> try o add_plan.
let try       -> {Plan->(last(Plan)!ferry, Plan):last(Plan)\=finish}.
let ferry     -> suggest o (embark meet safe) o (disembark meet safe).
let suggest   -> {State->State,@load}.
let load      -> {0,1;0,2;1,1;2,0;1,0}.
let embark    -> {(Side,M,C),(A,B)->Side,M-A,C-B}.
let disembark -> {Side,M,C->Side!swap,3-M,3-C}.
let swap      -> {'Left'->'Right';'Right'->'Left'}.
let safe      -> {Any->Side,M,C:(M,C)?feasible omit eaten}. 
let feasible  -> {(M,C):M>=0 & C>=0}.
let eaten     -> {(M,C):0<M<C}.
let add_plan  -> {(State,Plan)->Plan&&[State]:new(Plan,State)}.
let new       -> {(Plan,State)-> State\?codom Plan}.
let done      -> {Plan->Plan:Plan!last=finish}.