Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the rule of resolution using boolean logic #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

konstin
Copy link
Member

@konstin konstin commented Dec 8, 2023

I tried to make it clear that a CDNL terms is a conjunction of negations of conjunctions by desugaring them into boolean expressions.

image

@mpizenberg
Copy link
Member

The notation is introduced in the previous page: https://pubgrub-rs-guide.netlify.app/internals/terms#definition

@konstin
Copy link
Member Author

konstin commented Dec 8, 2023

I've moved the rust translation over to terms#definition. I think explicitly stating the $\neg A$ is the same as $\overline{A}$ will be easier to follow for most programmers.

@mpizenberg
Copy link
Member

mpizenberg commented Dec 8, 2023

Remark that I took the symbol "¬" from the literature, https://en.wikipedia.org/wiki/Literal_(mathematical_logic).
In general, that symbol corresponds to a proposition. Something like "x is inside set A", or "x is not inside set A". On the other hand the hat is the complement operator on sets, and not something that operates on propositions.

So I've been abusing a bit the notation. Because saying "x is not inside set A" is linked to saying "x is inside the complement of A". But maybe I should not have mixed the two notations. I'm not sure what is the most correct way to say all of this.

@mpizenberg
Copy link
Member

I think "¬" should not appear except for literal definition.
Now that I re-read what I wrote, it is correct. I did not use "¬" for anything else than literals and what you propose is not correct.

@konstin
Copy link
Member Author

konstin commented Dec 8, 2023

I have to admit that i only got the mathematics-for-computer-scientist version, where $\overline{A}$ was treated as a convenience for $\neg A$. I'll definitely remove the part if it's not correct for the kind of logic we're using.

I tried to make it clear that a CDNL terms is a conjunction of negations of conjunctions by desugaring them into boolean expressions.

I'm having trouble making what's going on sufficiently clear since we need to write the negations out to apply transformation rules to them, but then they are not incompatibilities anymore but constraints that must be satisfied.
@mpizenberg
Copy link
Member

Yeah it's not correct to use that symbol when dealing with the terms, and not at the literal level. However, if it isn't clear enough for the programming side of the brain, we might need to make it clearer indeed.

konstin added a commit to konstin/pubgrub-guide that referenced this pull request Dec 8, 2023
Split out of pubgrub-rs#8 for separate
discussion, I tried to make it clearer what the operations means for
someone who knows rust but doesn't have an academic math education
otherwise.
@konstin
Copy link
Member Author

konstin commented Dec 8, 2023

I've split the PRs, this is now only about using the full boolean expression

@mpizenberg
Copy link
Member

mpizenberg commented Dec 8, 2023

Actually, I might have got it backwards. While forcing set notation on terms, which intrinsically are propositions. So maybe it should be "¬" all the way. And complements should never appear, except when explaining the equivalence between terms and ranges sets, and how we use that equivalence to evaluate terms intersection (conjunction).
Sorry about that.

@konstin
Copy link
Member Author

konstin commented Jan 5, 2024

I'd like to re-up this for review, i've moved the contentious part to #9, this PR itself should be easy to merge.

@mpizenberg
Copy link
Member

Right sorry forgot about this. I remember wanting to change a thing. I'll be back on sunday and can provide more context for what I had in mind then.

@konstin konstin changed the title Make terms clearer using boolean expressions Explain the rule of resolution using boolean logic Apr 9, 2024
@konstin
Copy link
Member Author

konstin commented Apr 9, 2024

I've updated the explanation and added a reference, i hope i didn't mix up the symbols again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants