Logic calculator