Let no_move_left be the proposition you cannot move to the left
Let no_move_right be the proposition you cannot move to the right
Let can_move_left be the proposition you can move left
Let can_move_right be the proposition you can move right
':=' means 'abbreviates for'.
start := (no_move_left and can_move_left) same-as not(can_move_left)
end := (no_move_right and can_move_right) same-as not(can_move_right)
elsewhere := ((not(start) and not(end)) and can_move_left) or ((not(start) and not(end)) and can_move_right)
validLocation := (start or end or elsewhere)
If validLocation is true, then movement is possible to the left xor right.
noMove := (start and end)
If noMove is true, then no movement is possible in either direction.