Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type MaybeFace = Int
- type SubIndex = Int
- type DInt = Int8
- data Projection x a0 as a = Projection {}
- type Projection' m a = Projection Cube (MoveTag m [RawMove a]) (RawMove a) (RawCoord a)
- type SymProjection m sym a = Projection Cube (MoveTag m [SymMove sym a]) (SymMove sym a) (SymCoord sym a)
- newtype Distance m a = Distance {}
- (|*|) :: (TupleCons b0, TupleCons bs, TupleCons b) => Projection x a0 as a -> Projection x b0 bs b -> Projection x (a0 :| b0) (as :| bs) (a :| b)
- (|.|) :: forall x a0 as a b0 bs b. Projection x a0 as a -> Projection x b0 bs b -> Projection x (a0, b0) (as, bs) (a, b)
- (>$<) :: forall m a b. (b -> a) -> Distance m a -> Distance m b
- maxDistance :: forall f m a. Foldable f => f (Distance m a) -> Distance m a
- solveWith :: Eq a => MoveTag m [ElemMove] -> a0 -> Projection Cube a0 as a -> Distance m a -> Cube -> Move
- type Tag a = (Int, a)
- tag :: a -> Tag a
- rawProjection :: (FromCube a, RawEncodable a) => Projection' m a
- symProjection :: (FromCube a, RawEncodable a) => (a -> SymCoord sym a) -> SymProjection m sym a
- symmetricProj :: Eq c => Symmetry sym -> Projection Cube (MoveTag m [b]) as c -> Projection Cube (MoveTag m [b]) as c
- distanceWith2 :: (RawEncodable a, RawEncodable b) => Vector DInt -> Distance m (RawCoord a, RawCoord b)
Documentation
data Projection x a0 as a Source
type Projection' m a = Projection Cube (MoveTag m [RawMove a]) (RawMove a) (RawCoord a) Source
type SymProjection m sym a = Projection Cube (MoveTag m [SymMove sym a]) (SymMove sym a) (SymCoord sym a) Source
(|*|) :: (TupleCons b0, TupleCons bs, TupleCons b) => Projection x a0 as a -> Projection x b0 bs b -> Projection x (a0 :| b0) (as :| bs) (a :| b) infixr 4 Source
(|.|) :: forall x a0 as a b0 bs b. Projection x a0 as a -> Projection x b0 bs b -> Projection x (a0, b0) (as, bs) (a, b) infixr 4 Source
maxDistance :: forall f m a. Foldable f => f (Distance m a) -> Distance m a Source
solveWith :: Eq a => MoveTag m [ElemMove] -> a0 -> Projection Cube a0 as a -> Distance m a -> Cube -> Move Source
Branching reduction
The Int
projection keeps track of the latest move (== 6
for the starting point).
18 moves
We can indeed reduce the branching factor from 18 to 15 by considering that successive moves on the same face can and will be shortened as a single move.
Furthermore, since moves on opposite faces commute, we may force them to be in an arbitrary order, reducing the branching factor to 12 after half of the moves (U, L, F).
10 moves
Instead of a factor 10, we have factors
- 9 after R, B;
- 8 after L, F;
- 7 after D;
- 4 after U.
rawProjection :: (FromCube a, RawEncodable a) => Projection' m a Source
symProjection :: (FromCube a, RawEncodable a) => (a -> SymCoord sym a) -> SymProjection m sym a Source
symmetricProj :: Eq c => Symmetry sym -> Projection Cube (MoveTag m [b]) as c -> Projection Cube (MoveTag m [b]) as c Source
distanceWith2 :: (RawEncodable a, RawEncodable b) => Vector DInt -> Distance m (RawCoord a, RawCoord b) Source