module Robot_spr where

newtype Odlist a = ODList [a] deriving (Eq, Ord, Show)
newtype Mapping a b = Mapping [(a, b)] deriving Show
data Trie a b = Trie (Maybe b) [(a, Trie a b)] deriving Show

data AlgState_ext a b c = AlgState_ext a b c deriving Show
data BEState_ext a b c d = BEState_ext b (Odlist (a, c)) d deriving (Eq, Ord, Show)

data Digit = A | B | C | D | E | F deriving (Eq, Ord)

instance Show Digit where
  show A = "0"
  show B = "1"
  show C = "2"
  show D = "3"
  show E = "4"
  show F = "5"

data Agent = Robot deriving (Eq, Ord, Show)
data RobotAct = Nop | Halt deriving (Eq, Ord, Show)

mc_init = [((A,(A,False)),ODList [(A,(A,False))]),((A,(B,False)),ODList [(A,(B,False))])]
mc_dfs_output = AlgState_ext (Trie Nothing [((A,(A,False)),Trie (Just [Nop]) [((B,(A,False)),Trie (Just [Nop]) [])]),((B,(C,False)),Trie (Just [Nop]) [((C,(C,False)),Trie (Just [Nop]) [((D,(C,False)),Trie (Just [Nop]) [])])]),((C,(D,False)),Trie (Just [Halt]) [((D,(D,False)),Trie (Just [Halt]) [((E,(D,False)),Trie (Just [Halt]) [])])]),((C,(D,True)),Trie (Just [Halt]) [((D,(D,True)),Trie (Just [Halt]) [((E,(D,True)),Trie (Just [Halt]) [])])]),((C,(C,True)),Trie (Just [Halt]) [((D,(C,True)),Trie (Just [Halt]) [])]),((C,(B,True)),Trie (Just [Halt]) []),((D,(E,False)),Trie (Just [Halt]) [((E,(E,False)),Trie (Just [Halt]) [])]),((D,(E,True)),Trie (Just [Halt]) [((E,(E,True)),Trie (Just [Halt]) [])]),((D,(D,True)),Trie (Just [Halt]) [((E,(D,True)),Trie (Just [Halt]) [])]),((D,(C,True)),Trie (Just [Halt]) []),((E,(F,False)),Trie (Just [Halt]) []),((E,(F,True)),Trie (Just [Halt]) []),((E,(E,True)),Trie (Just [Halt]) []),((E,(D,True)),Trie (Just [Halt]) []),((B,(B,False)),Trie Nothing [((C,(B,False)),Trie (Just [Nop]) [])]),((B,(A,False)),Trie (Just [Nop]) []),((A,(B,False)),Trie (Just [Nop]) [((B,(B,False)),Trie (Just [Nop]) [((C,(B,False)),Trie (Just [Nop]) [])])])]) (Trie Nothing [((A,(A,False)),Trie (Just (Mapping [(A,ODList [(A,(A,False)),(B,(A,False))]),(B,ODList [(A,(B,False)),(B,(B,False))]),(C,ODList [(B,(C,False))])])) [((B,(A,False)),Trie (Just (Mapping [(A,ODList [(A,(A,False)),(B,(A,False))]),(B,ODList [(A,(B,False)),(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False))]),(D,ODList [(C,(D,False))])])) [])]),((B,(C,False)),Trie (Just (Mapping [(A,ODList [(B,(A,False))]),(B,ODList [(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False))]),(D,ODList [(C,(D,False))])])) [((C,(C,False)),Trie (Just (Mapping [(A,ODList [(B,(A,False))]),(B,ODList [(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False)),(D,(C,False))]),(D,ODList [(C,(D,False)),(D,(D,False))]),(E,ODList [(D,(E,False))])])) [((D,(C,False)),Trie (Just (Mapping [(A,ODList [(B,(A,False))]),(B,ODList [(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False)),(D,(C,False))]),(D,ODList [(C,(D,False)),(D,(D,False)),(E,(D,False))]),(E,ODList [(D,(E,False)),(E,(E,False))]),(F,ODList [(E,(F,False))])])) [])])]),((C,(D,False)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True))]),(D,ODList [(C,(D,True))])])) [((D,(D,False)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True)),(D,(C,True))]),(D,ODList [(C,(D,True)),(D,(D,True))]),(E,ODList [(D,(E,True))])])) [((E,(D,False)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True)),(D,(C,True))]),(D,ODList [(C,(D,True)),(D,(D,True)),(E,(D,True))]),(E,ODList [(D,(E,True)),(E,(E,True))]),(F,ODList [(E,(F,True))])])) [])])]),((C,(D,True)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True))]),(D,ODList [(C,(D,True))])])) [((D,(D,True)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True)),(D,(C,True))]),(D,ODList [(C,(D,True)),(D,(D,True))]),(E,ODList [(D,(E,True))])])) [((E,(D,True)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True)),(D,(C,True))]),(D,ODList [(C,(D,True)),(D,(D,True)),(E,(D,True))]),(E,ODList [(D,(E,True)),(E,(E,True))]),(F,ODList [(E,(F,True))])])) [])])]),((C,(C,True)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True))]),(D,ODList [(C,(D,True))])])) [((D,(C,True)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True)),(D,(C,True))]),(D,ODList [(C,(D,True)),(D,(D,True))]),(E,ODList [(D,(E,True))])])) [])]),((C,(B,True)),Trie (Just (Mapping [(B,ODList [(C,(B,True))]),(C,ODList [(C,(C,True))]),(D,ODList [(C,(D,True))])])) []),((D,(E,False)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True))]),(E,ODList [(D,(E,True))])])) [((E,(E,False)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True)),(E,(D,True))]),(E,ODList [(D,(E,True)),(E,(E,True))]),(F,ODList [(E,(F,True))])])) [])]),((D,(E,True)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True))]),(E,ODList [(D,(E,True))])])) [((E,(E,True)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True)),(E,(D,True))]),(E,ODList [(D,(E,True)),(E,(E,True))]),(F,ODList [(E,(F,True))])])) [])]),((D,(D,True)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True))]),(E,ODList [(D,(E,True))])])) [((E,(D,True)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True)),(E,(D,True))]),(E,ODList [(D,(E,True)),(E,(E,True))]),(F,ODList [(E,(F,True))])])) [])]),((D,(C,True)),Trie (Just (Mapping [(C,ODList [(D,(C,True))]),(D,ODList [(D,(D,True))]),(E,ODList [(D,(E,True))])])) []),((E,(F,False)),Trie (Just (Mapping [(D,ODList [(E,(D,True))]),(E,ODList [(E,(E,True))]),(F,ODList [(E,(F,True))])])) []),((E,(F,True)),Trie (Just (Mapping [(D,ODList [(E,(D,True))]),(E,ODList [(E,(E,True))]),(F,ODList [(E,(F,True))])])) []),((E,(E,True)),Trie (Just (Mapping [(D,ODList [(E,(D,True))]),(E,ODList [(E,(E,True))]),(F,ODList [(E,(F,True))])])) []),((E,(D,True)),Trie (Just (Mapping [(D,ODList [(E,(D,True))]),(E,ODList [(E,(E,True))]),(F,ODList [(E,(F,True))])])) []),((B,(B,False)),Trie Nothing [((C,(B,False)),Trie (Just (Mapping [(A,ODList [(B,(A,False))]),(B,ODList [(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False)),(D,(C,False))]),(D,ODList [(C,(D,False)),(D,(D,False))]),(E,ODList [(D,(E,False))])])) [])]),((B,(A,False)),Trie (Just (Mapping [(A,ODList [(B,(A,False))]),(B,ODList [(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False))]),(D,ODList [(C,(D,False))])])) []),((A,(B,False)),Trie (Just (Mapping [(A,ODList [(A,(A,False)),(B,(A,False))]),(B,ODList [(A,(B,False)),(B,(B,False))]),(C,ODList [(B,(C,False))])])) [((B,(B,False)),Trie (Just (Mapping [(A,ODList [(A,(A,False)),(B,(A,False))]),(B,ODList [(A,(B,False)),(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False))]),(D,ODList [(C,(D,False))])])) [((C,(B,False)),Trie (Just (Mapping [(A,ODList [(A,(A,False)),(B,(A,False))]),(B,ODList [(A,(B,False)),(B,(B,False)),(C,(B,False))]),(C,ODList [(B,(C,False)),(C,(C,False)),(D,(C,False))]),(D,ODList [(C,(D,False)),(D,(D,False))]),(E,ODList [(D,(E,False))])])) [])])])]) ()
