% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % File: dfsa4b.dtr % % Purpose: DFSA solving wolf/goat/cabbage problem % % (straightforward version of the automaton) % % Author: Geoffrey K. Pullum, 12 October 1994 % % Email: gkp@ling.ucsc.edu % % Address: Stevenson College, UCSC, Santa Cruz, CA 95064, USA % % Related files: dfsa4a.dtr % % Documentation: see reference given in dfsa4a.dtr % % % % Copyright (c) UC Santa Cruz 1994. All rights reserved. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % The problem the automaton solves is how a man can get a wolf, a goat, and % a box of cabbages safely across a river in a tiny boat that can hold the % man together with just one of the three items. Note that because of % natural food preferences, the wolf cannot be left alone on either bank % with the goat, and the goat must never be left alone with the cabbages % (though the wolf can be safely left with the cabbages). % This is a variation on the straightforward approach in dfsa4a.dtr that is % intended to illustrate more of DATR's inheritance capabilities -- but one % of the things it illustrates is that things can be harder to follow when % efficient use is made of inheritance and higher nodes. The nodes named % Node1 to Node 6 are simply grouping nodes, whose only point is to simplify % the description. The other nodes correspond to the states of the automaton % in dfsa4a.dtr (e.g. Lmg_wcR is the state where the man and the goat are on % the left bank and the wolf and the cabbages are on the right); but these % are now more compactly stated in many cases. However, the actual number % of equations eliminated is quite small because of the small number of % attributes per node in this example, so crude size comparisons between % dfsa4a.dtr and dfsa4b.dtr are not very instructive. Solution: <> == Lmwgc_R. Node1: == impossible move <> == task incomplete. Node2: <> == Node1 == double disaster == goat eats cabbages == wolf eats goat. Node3: <> == Node1 == Node1:. Node4: <> == Node1 == Node1:. Node5: <> == Node3 == Node2:. Node6: <> == Node1 == Node2:. Lmwgc_R: <> == Node2 == Lwc_mgR:<>. Lwc_mgR: <> == Node3 == Lmwc_gR:<> == Lmwgc_R:<>. Lmwc_gR: <> == Node4 == Lwc_mgR:<> == Lc_mwgR:<> == Lw_mgcR:<>. Lc_mwgR: <> == Node6 == Lmwc_gR:<> == Lmgc_wR:<>. Lw_mgcR: <> == Node5 == Lmwc_gR:<> == Lmwg_cR:<>. Lmgc_wR: <> == Node5 == Lc_mwgR:<> == Lg_mwcR:<>. Lmwg_cR: <> == Node6 == Lw_mgcR:<> == Lg_mwcR:<>. Lg_mwcR: <> == Node4 == Lmg_wcR:<> == Lmgc_wR:<> == Lmwg_cR:<>. Lmg_wcR: <> == Node3 == Lg_mwcR:<> == L_mwgcR:<>. L_mwgcR: <> == succeeded == Node2 == Node2 == Node2 == Lmg_wcR:<>. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % Some example theorems: % % Solution: % = goat eats cabbages % = wolf eats goat % = wolf eats goat % = goat eats cabbages % = task incomplete % = succeeded % = task incomplete % = succeeded % = wolf eats goat % = succeeded. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % # hide Node1 Node2 Node3 Node4 Node5 Node6 Lmwgc_R Lwc_mgR Lmwc_gR Lc_mwgR Lw_mgcR Lmgc_wR Lmwg_cR Lg_mwcR Lmg_wcR L_mwgcR. # show . % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % The next line is the Revision Control System Archive Id: do not delete it. % $Id: archive.dtr,v 1.1 1997/04/09 20:40:33 root Exp $