bitset: fix Empty __contains__ to return True - #1
Open
macabeus wants to merge 1 commit into
Open
Conversation
`__contains__` should returns `True` because the statement Vacuous Truth. https://en.wikipedia.org/wiki/Vacuous_truth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O projeto
bitsettem duas classes que representam conjuntos de números: aNaturale aEmpty.Nessas classes temos alguns métodos para poder trabalhar com elas, dentre eles, o método
__contains__, que é usado para perguntar "nesse conjunto há esse número?".Porém, na classe
Empty(que representa um conjunto vazio), o método__contains__está retornandoFalse, o que contraria o afirmação Verdade por Vacuidade, da qual diz que um conjunto vazio sempre contém todos os elementos.Afinal, se não podemos provar que determinado conjunto não tem certo elemento, então quer dizer ele tem. Em uma mesa vazio há algum celular ligado? Como não podemos provar que não há, então há. Em um conjunto vazio há o número 4? Como não podemos provar que não há, então há.
O que acha dessa sugestão? 😄