When to Give Legal Rights to AIs? When They Can Dream