586. Partial Intent
Shabbos 1:18
If a person performs a destructive act in order to facilitate a future constructive act, he is liable. For example, if one demolishes a house in order to later build a new one in its place, or if one erases a page in order to later write something else on it, or if one digs a pit in order to lay the foundations of a building in it. The same is true in all such cases. The minimum amount of destructive labor for which one would be liable is the same as that for the analogous constructive labor.
Shabbos 1:19
If a person performs an act of labor on Shabbos partly intentionally and partly unintentionally, he is not liable, regardless of whether he started intentionally and concluded unintentionally or vice versa. One is liable for kareis (spiritual excision) if he performs the entire minimum quantity of an act of labor intentionally from start to finish; if witnesses who issued a warning were present, he would be liable for the penalty of stoning. One is liable to bring a sin offering if he unintentionally performs the entire minimum quantity of an act of labor from start to finish.