mock :: Model Symbolic -> Command Symbolic -> GenSym (Response Symbolic)
mock (Model m) cmd = return $ case cmd of
  NewBook New _ _ _ -> Inserted
  NewBook Exist _ _ _ -> UniqueError
  AddCopy Invalid _ -> NotFound
  AddCopy Exist _ -> Updated
  Borrow  Invalid _ -> NotFound
  Borrow  Avail _ -> Updated
  Borrow  Unavail _ -> NotFound
  Return  Invalid _ -> NotFound
  Return  Taken _ -> Updated
  Return  Full _ -> NotFound
  FindByTitle Exist x -> Rows $ filter (isInfixOf x . title) (codomain m)
  FindByAuthor Exist x -> Rows $ filter (isInfixOf x . author) (codomain m)
  FindByIsbn Exist key -> Rows [fromJust (lookup key m)]
  FindByTitle Invalid _ -> Rows []
  FindByIsbn Invalid _ -> Rows []
  FindByAuthor Invalid _ -> Rows []
  _ -> error $ (show cmd) ++ " should not happen"

-- Property
mock :: Model Symbolic -> Command Symbolic -> GenSym (Response Symbolic)
mock (Model m) cmd = return $ case cmd of
  NewBook New _ _ _ -> Inserted
  NewBook Exist _ _ _ -> UniqueError
  AddCopy Invalid _ -> NotFound
  AddCopy Exist _ -> Updated
  Borrow  Invalid _ -> NotFound
  Borrow  Avail _ -> Updated
  Borrow  Unavail _ -> NotFound
  Return  Invalid _ -> NotFound
  Return  Taken _ -> Updated
  Return  Full _ -> NotFound
  FindByTitle Exist x -> Rows $ filter (isInfixOf x . title) (codomain m)
  FindByAuthor Exist x -> Rows $ filter (isInfixOf x . author) (codomain m)
  FindByIsbn Exist key -> Rows [fromJust (lookup key m)]
  FindByTitle Invalid _ -> Rows []
  FindByIsbn Invalid _ -> Rows []
  FindByAuthor Invalid _ -> Rows []
  _ -> error $ (show cmd) ++ " should not happen"

-- Property
mock (Model m) cmd = return $ case cmd of
  NewBook New _ _ _ -> Inserted
  NewBook Exist _ _ _ -> UniqueError
  AddCopy Invalid _ -> NotFound
  AddCopy Exist _ -> Updated
  Borrow  Invalid _ -> NotFound
  Borrow  Avail _ -> Updated
  Borrow  Unavail _ -> NotFound
  Return  Invalid _ -> NotFound
  Return  Taken _ -> Updated
  Return  Full _ -> NotFound
  FindByTitle Exist x -> Rows $ filter (isInfixOf x . title) (codomain m)
  FindByAuthor Exist x -> Rows $ filter (isInfixOf x . author) (codomain m)
  FindByIsbn Exist key -> Rows [fromJust (lookup key m)]
  FindByTitle Invalid _ -> Rows []
  FindByIsbn Invalid _ -> Rows []
  FindByAuthor Invalid _ -> Rows []
  _ -> error $ (show cmd) ++ " should not happen"

-- Property