Why do ¬, ∀ and ∃ have the same precedence? The Next CEO of Stack OverflowWhy do the sequent calculus NOT left and NOT right rules work?grammatical complexity of propositional and monadic predicate validities? (and grammars for recursive but not context-sensitive languages?)Operator precedence in propositional logicSemantic natural language processing - from texts to logical expressions? Universal knowledge base?Precedence of satisfiability operatorWhy does soundness imply consistency?Can proof by contradiction work without the law of excluded middle?SAT Solver Front-End: Strategy to order QuantifiersTrying to understand interpretation and denotation in FOLUnderstanding a Single Step in the Model Checking Algorithm

How can I run a deployer module after the commit?

How does a dynamic QR code work?

magento 2 Incompatible argument type: Required type: MagentoFrameworkRegistry

Obtaining database information and values in extended properties

Best way to load image from list python script

Mathematica command that allows it to read my intentions

Car headlights in a world without electricity

How seriously should I take size and weight limits of hand luggage?

How to use `glossaries` together with `ProvidesPackage`

Do Iron Man suits sport waste management systems?

Is it possible to create a QR code using text?

How to coordinate airplane tickets?

Horrendous Scope of Text

What is the difference between NTP and validity in Smith's "Logic: The Laws of Truth"?

That's an odd coin - I wonder why

Why do I get "Binary file matches" with grep -I?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

How to ignore Spotlight index for a volume contain another macOS

How to install cross-compiler on Ubuntu 18.04?

Avoiding the "not like other girls" trope?

Can compressed videos be decoded back to their uncompresed original format?

How badly should I try to prevent a user from XSSing themselves?

Does int main() need a declaration on C++?

Find the majority element, which appears more than half the time



Why do ¬, ∀ and ∃ have the same precedence?



The Next CEO of Stack OverflowWhy do the sequent calculus NOT left and NOT right rules work?grammatical complexity of propositional and monadic predicate validities? (and grammars for recursive but not context-sensitive languages?)Operator precedence in propositional logicSemantic natural language processing - from texts to logical expressions? Universal knowledge base?Precedence of satisfiability operatorWhy does soundness imply consistency?Can proof by contradiction work without the law of excluded middle?SAT Solver Front-End: Strategy to order QuantifiersTrying to understand interpretation and denotation in FOLUnderstanding a Single Step in the Model Checking Algorithm










5












$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary, but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀). This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?










share|cite|improve this question











$endgroup$







  • 27




    $begingroup$
    I would be very wary of ideas of precedence in first-order logic. Don't think you can write $forall x,Alor B$ or $Alor Bland C$ and have people understand what you mean.
    $endgroup$
    – David Richerby
    Mar 21 at 15:29






  • 7




    $begingroup$
    As far as I can see, precedence of logical connectives and quantifiers can vary from author to author. I tend to write $forall x. (p(x) implies q(x))$ without parentheses, like several others. Some instead write $(forall x. p(x)) implies q$ without parentheses, using the opposite precedence. I learned to never take precedence for granted, and sometimes to use a few redundant parentheses to be sure to be understood by everyone.
    $endgroup$
    – chi
    Mar 21 at 19:23






  • 4




    $begingroup$
    @Kevin: I hope that's a joke. Prenex normal forms are available only in classical logic, but more importantly, they make statements harder to understand.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:06






  • 4




    $begingroup$
    @Kevin "There's a formal definition", "there are explicit conventions", and "nobody will be confused" are three very different statements.
    $endgroup$
    – Raphael
    Mar 22 at 7:36






  • 1




    $begingroup$
    @chi And I read "$forall x,p(x)Rightarrow q(x)$" as "Oh, god, somebody who thinks there are precedence rules in first-order logic, so I'm going to have to reverse-engineer what they think those rules are."
    $endgroup$
    – David Richerby
    Mar 22 at 9:51















5












$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary, but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀). This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?










share|cite|improve this question











$endgroup$







  • 27




    $begingroup$
    I would be very wary of ideas of precedence in first-order logic. Don't think you can write $forall x,Alor B$ or $Alor Bland C$ and have people understand what you mean.
    $endgroup$
    – David Richerby
    Mar 21 at 15:29






  • 7




    $begingroup$
    As far as I can see, precedence of logical connectives and quantifiers can vary from author to author. I tend to write $forall x. (p(x) implies q(x))$ without parentheses, like several others. Some instead write $(forall x. p(x)) implies q$ without parentheses, using the opposite precedence. I learned to never take precedence for granted, and sometimes to use a few redundant parentheses to be sure to be understood by everyone.
    $endgroup$
    – chi
    Mar 21 at 19:23






  • 4




    $begingroup$
    @Kevin: I hope that's a joke. Prenex normal forms are available only in classical logic, but more importantly, they make statements harder to understand.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:06






  • 4




    $begingroup$
    @Kevin "There's a formal definition", "there are explicit conventions", and "nobody will be confused" are three very different statements.
    $endgroup$
    – Raphael
    Mar 22 at 7:36






  • 1




    $begingroup$
    @chi And I read "$forall x,p(x)Rightarrow q(x)$" as "Oh, god, somebody who thinks there are precedence rules in first-order logic, so I'm going to have to reverse-engineer what they think those rules are."
    $endgroup$
    – David Richerby
    Mar 22 at 9:51













5












5








5


1



$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary, but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀). This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?










share|cite|improve this question











$endgroup$




I thought the order of precedence of operators and quantifiers was arbitrary, but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀). This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?







logic first-order-logic notation






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 22 at 7:35









Raphael

58k24143317




58k24143317










asked Mar 21 at 15:00









PhilPhil

284




284







  • 27




    $begingroup$
    I would be very wary of ideas of precedence in first-order logic. Don't think you can write $forall x,Alor B$ or $Alor Bland C$ and have people understand what you mean.
    $endgroup$
    – David Richerby
    Mar 21 at 15:29






  • 7




    $begingroup$
    As far as I can see, precedence of logical connectives and quantifiers can vary from author to author. I tend to write $forall x. (p(x) implies q(x))$ without parentheses, like several others. Some instead write $(forall x. p(x)) implies q$ without parentheses, using the opposite precedence. I learned to never take precedence for granted, and sometimes to use a few redundant parentheses to be sure to be understood by everyone.
    $endgroup$
    – chi
    Mar 21 at 19:23






  • 4




    $begingroup$
    @Kevin: I hope that's a joke. Prenex normal forms are available only in classical logic, but more importantly, they make statements harder to understand.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:06






  • 4




    $begingroup$
    @Kevin "There's a formal definition", "there are explicit conventions", and "nobody will be confused" are three very different statements.
    $endgroup$
    – Raphael
    Mar 22 at 7:36






  • 1




    $begingroup$
    @chi And I read "$forall x,p(x)Rightarrow q(x)$" as "Oh, god, somebody who thinks there are precedence rules in first-order logic, so I'm going to have to reverse-engineer what they think those rules are."
    $endgroup$
    – David Richerby
    Mar 22 at 9:51












  • 27




    $begingroup$
    I would be very wary of ideas of precedence in first-order logic. Don't think you can write $forall x,Alor B$ or $Alor Bland C$ and have people understand what you mean.
    $endgroup$
    – David Richerby
    Mar 21 at 15:29






  • 7




    $begingroup$
    As far as I can see, precedence of logical connectives and quantifiers can vary from author to author. I tend to write $forall x. (p(x) implies q(x))$ without parentheses, like several others. Some instead write $(forall x. p(x)) implies q$ without parentheses, using the opposite precedence. I learned to never take precedence for granted, and sometimes to use a few redundant parentheses to be sure to be understood by everyone.
    $endgroup$
    – chi
    Mar 21 at 19:23






  • 4




    $begingroup$
    @Kevin: I hope that's a joke. Prenex normal forms are available only in classical logic, but more importantly, they make statements harder to understand.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:06






  • 4




    $begingroup$
    @Kevin "There's a formal definition", "there are explicit conventions", and "nobody will be confused" are three very different statements.
    $endgroup$
    – Raphael
    Mar 22 at 7:36






  • 1




    $begingroup$
    @chi And I read "$forall x,p(x)Rightarrow q(x)$" as "Oh, god, somebody who thinks there are precedence rules in first-order logic, so I'm going to have to reverse-engineer what they think those rules are."
    $endgroup$
    – David Richerby
    Mar 22 at 9:51







27




27




$begingroup$
I would be very wary of ideas of precedence in first-order logic. Don't think you can write $forall x,Alor B$ or $Alor Bland C$ and have people understand what you mean.
$endgroup$
– David Richerby
Mar 21 at 15:29




$begingroup$
I would be very wary of ideas of precedence in first-order logic. Don't think you can write $forall x,Alor B$ or $Alor Bland C$ and have people understand what you mean.
$endgroup$
– David Richerby
Mar 21 at 15:29




7




7




$begingroup$
As far as I can see, precedence of logical connectives and quantifiers can vary from author to author. I tend to write $forall x. (p(x) implies q(x))$ without parentheses, like several others. Some instead write $(forall x. p(x)) implies q$ without parentheses, using the opposite precedence. I learned to never take precedence for granted, and sometimes to use a few redundant parentheses to be sure to be understood by everyone.
$endgroup$
– chi
Mar 21 at 19:23




$begingroup$
As far as I can see, precedence of logical connectives and quantifiers can vary from author to author. I tend to write $forall x. (p(x) implies q(x))$ without parentheses, like several others. Some instead write $(forall x. p(x)) implies q$ without parentheses, using the opposite precedence. I learned to never take precedence for granted, and sometimes to use a few redundant parentheses to be sure to be understood by everyone.
$endgroup$
– chi
Mar 21 at 19:23




4




4




$begingroup$
@Kevin: I hope that's a joke. Prenex normal forms are available only in classical logic, but more importantly, they make statements harder to understand.
$endgroup$
– Andrej Bauer
Mar 22 at 7:06




$begingroup$
@Kevin: I hope that's a joke. Prenex normal forms are available only in classical logic, but more importantly, they make statements harder to understand.
$endgroup$
– Andrej Bauer
Mar 22 at 7:06




4




4




$begingroup$
@Kevin "There's a formal definition", "there are explicit conventions", and "nobody will be confused" are three very different statements.
$endgroup$
– Raphael
Mar 22 at 7:36




$begingroup$
@Kevin "There's a formal definition", "there are explicit conventions", and "nobody will be confused" are three very different statements.
$endgroup$
– Raphael
Mar 22 at 7:36




1




1




$begingroup$
@chi And I read "$forall x,p(x)Rightarrow q(x)$" as "Oh, god, somebody who thinks there are precedence rules in first-order logic, so I'm going to have to reverse-engineer what they think those rules are."
$endgroup$
– David Richerby
Mar 22 at 9:51




$begingroup$
@chi And I read "$forall x,p(x)Rightarrow q(x)$" as "Oh, god, somebody who thinks there are precedence rules in first-order logic, so I'm going to have to reverse-engineer what they think those rules are."
$endgroup$
– David Richerby
Mar 22 at 9:51










2 Answers
2






active

oldest

votes


















3












$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary




Certainly the rules of precedence could be set up in different ways, but some ways are more helpful and convenient than others, and there are principled reasons for this.




but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀).




Assuming you mean "strength" as a synonym for "precedence," the reason these three have the same precedence is that these operators are all prefix operators: as you said, their arguments are the next expressions to the right. ¬ takes the next expression as its single argument, and ∀ and ∃ each take the next two expressions. As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments: There is only one possible answer to "What's the argument of $neg$ in $neg forall x forall y P(x, y)$?" As such, precedence rules between these prefix operators would be unnecessary.



On the other hand, when you introduce infix operators such as ∧ (or mix in postfix operators), parsing becomes ambiguous without precedence rules or parentheses. For example, $neg A land B$ would be ambiguous because $neg$ is a prefix operator and $land$ is an infix operator. To fix this, we could just use parentheses, but in a complex expression this becomes cumbersome. Precedence rules, if agreed upon, allow us to be unambiguous with less notation. By following the rule "¬ will have precedence over ∧", we can write and read "$neg A land B$" and agree on what it means.




This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?




I think the chain of "leading" here is backwards. Because these three are prefix operators (their arguments are the next 1 or 2 expressions to the right), there's no ambiguity between them and thus no need for precedence rules.






share|cite|improve this answer











$endgroup$








  • 1




    $begingroup$
    Thank you, I understand it now!
    $endgroup$
    – Phil
    Mar 22 at 10:26






  • 1




    $begingroup$
    As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
    $endgroup$
    – sgf
    Mar 22 at 11:48


















17












$begingroup$

Order of precedence is simply a notional convenience. There is no notion of strength here, just notation. All three operators are unary operators with notation "$circ cdot$", where $circ$ denotes the operator symbol $exists, forall,neg$ and $cdot$ the operand. There can never be any ambiguity in which order to apply these operators: the operator to the right must always be applied to the operand first.



Hence, they have the same precedence among eachother if we consider only those three operators. (Note that there can be ambiguity if the unary operators have different position, e.g. $-x^2$, this could mean either $(-x)^2$ or $-(x^2)$ if there was no precendence between $^2$ and $-$.)






share|cite|improve this answer











$endgroup$












  • $begingroup$
    The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
    $endgroup$
    – Kevin
    Mar 21 at 23:11










  • $begingroup$
    Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
    $endgroup$
    – LarsH
    Mar 22 at 4:55











  • $begingroup$
    See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
    $endgroup$
    – LarsH
    Mar 22 at 5:22






  • 1




    $begingroup$
    @LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
    $endgroup$
    – Discrete lizard
    Mar 22 at 6:44







  • 4




    $begingroup$
    $forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:07











Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "419"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f105880%2fwhy-do-%25c2%25ac-%25e2%2588%2580-and-%25e2%2588%2583-have-the-same-precedence%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









3












$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary




Certainly the rules of precedence could be set up in different ways, but some ways are more helpful and convenient than others, and there are principled reasons for this.




but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀).




Assuming you mean "strength" as a synonym for "precedence," the reason these three have the same precedence is that these operators are all prefix operators: as you said, their arguments are the next expressions to the right. ¬ takes the next expression as its single argument, and ∀ and ∃ each take the next two expressions. As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments: There is only one possible answer to "What's the argument of $neg$ in $neg forall x forall y P(x, y)$?" As such, precedence rules between these prefix operators would be unnecessary.



On the other hand, when you introduce infix operators such as ∧ (or mix in postfix operators), parsing becomes ambiguous without precedence rules or parentheses. For example, $neg A land B$ would be ambiguous because $neg$ is a prefix operator and $land$ is an infix operator. To fix this, we could just use parentheses, but in a complex expression this becomes cumbersome. Precedence rules, if agreed upon, allow us to be unambiguous with less notation. By following the rule "¬ will have precedence over ∧", we can write and read "$neg A land B$" and agree on what it means.




This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?




I think the chain of "leading" here is backwards. Because these three are prefix operators (their arguments are the next 1 or 2 expressions to the right), there's no ambiguity between them and thus no need for precedence rules.






share|cite|improve this answer











$endgroup$








  • 1




    $begingroup$
    Thank you, I understand it now!
    $endgroup$
    – Phil
    Mar 22 at 10:26






  • 1




    $begingroup$
    As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
    $endgroup$
    – sgf
    Mar 22 at 11:48















3












$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary




Certainly the rules of precedence could be set up in different ways, but some ways are more helpful and convenient than others, and there are principled reasons for this.




but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀).




Assuming you mean "strength" as a synonym for "precedence," the reason these three have the same precedence is that these operators are all prefix operators: as you said, their arguments are the next expressions to the right. ¬ takes the next expression as its single argument, and ∀ and ∃ each take the next two expressions. As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments: There is only one possible answer to "What's the argument of $neg$ in $neg forall x forall y P(x, y)$?" As such, precedence rules between these prefix operators would be unnecessary.



On the other hand, when you introduce infix operators such as ∧ (or mix in postfix operators), parsing becomes ambiguous without precedence rules or parentheses. For example, $neg A land B$ would be ambiguous because $neg$ is a prefix operator and $land$ is an infix operator. To fix this, we could just use parentheses, but in a complex expression this becomes cumbersome. Precedence rules, if agreed upon, allow us to be unambiguous with less notation. By following the rule "¬ will have precedence over ∧", we can write and read "$neg A land B$" and agree on what it means.




This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?




I think the chain of "leading" here is backwards. Because these three are prefix operators (their arguments are the next 1 or 2 expressions to the right), there's no ambiguity between them and thus no need for precedence rules.






share|cite|improve this answer











$endgroup$








  • 1




    $begingroup$
    Thank you, I understand it now!
    $endgroup$
    – Phil
    Mar 22 at 10:26






  • 1




    $begingroup$
    As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
    $endgroup$
    – sgf
    Mar 22 at 11:48













3












3








3





$begingroup$


I thought the order of precedence of operators and quantifiers was arbitrary




Certainly the rules of precedence could be set up in different ways, but some ways are more helpful and convenient than others, and there are principled reasons for this.




but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀).




Assuming you mean "strength" as a synonym for "precedence," the reason these three have the same precedence is that these operators are all prefix operators: as you said, their arguments are the next expressions to the right. ¬ takes the next expression as its single argument, and ∀ and ∃ each take the next two expressions. As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments: There is only one possible answer to "What's the argument of $neg$ in $neg forall x forall y P(x, y)$?" As such, precedence rules between these prefix operators would be unnecessary.



On the other hand, when you introduce infix operators such as ∧ (or mix in postfix operators), parsing becomes ambiguous without precedence rules or parentheses. For example, $neg A land B$ would be ambiguous because $neg$ is a prefix operator and $land$ is an infix operator. To fix this, we could just use parentheses, but in a complex expression this becomes cumbersome. Precedence rules, if agreed upon, allow us to be unambiguous with less notation. By following the rule "¬ will have precedence over ∧", we can write and read "$neg A land B$" and agree on what it means.




This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?




I think the chain of "leading" here is backwards. Because these three are prefix operators (their arguments are the next 1 or 2 expressions to the right), there's no ambiguity between them and thus no need for precedence rules.






share|cite|improve this answer











$endgroup$




I thought the order of precedence of operators and quantifiers was arbitrary




Certainly the rules of precedence could be set up in different ways, but some ways are more helpful and convenient than others, and there are principled reasons for this.




but I don't really understand why those three have the same "strength" in relation to other operators (e.g., ¬ will have precedence over ∧, but not over ∀).




Assuming you mean "strength" as a synonym for "precedence," the reason these three have the same precedence is that these operators are all prefix operators: as you said, their arguments are the next expressions to the right. ¬ takes the next expression as its single argument, and ∀ and ∃ each take the next two expressions. As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments: There is only one possible answer to "What's the argument of $neg$ in $neg forall x forall y P(x, y)$?" As such, precedence rules between these prefix operators would be unnecessary.



On the other hand, when you introduce infix operators such as ∧ (or mix in postfix operators), parsing becomes ambiguous without precedence rules or parentheses. For example, $neg A land B$ would be ambiguous because $neg$ is a prefix operator and $land$ is an infix operator. To fix this, we could just use parentheses, but in a complex expression this becomes cumbersome. Precedence rules, if agreed upon, allow us to be unambiguous with less notation. By following the rule "¬ will have precedence over ∧", we can write and read "$neg A land B$" and agree on what it means.




This leads to the rule being that ¬, ∀ and ∃ will bind to the closest predicate on their right (if I understood correctly). Why is this?




I think the chain of "leading" here is backwards. Because these three are prefix operators (their arguments are the next 1 or 2 expressions to the right), there's no ambiguity between them and thus no need for precedence rules.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Mar 22 at 6:13

























answered Mar 22 at 5:15









LarsHLarsH

1627




1627







  • 1




    $begingroup$
    Thank you, I understand it now!
    $endgroup$
    – Phil
    Mar 22 at 10:26






  • 1




    $begingroup$
    As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
    $endgroup$
    – sgf
    Mar 22 at 11:48












  • 1




    $begingroup$
    Thank you, I understand it now!
    $endgroup$
    – Phil
    Mar 22 at 10:26






  • 1




    $begingroup$
    As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
    $endgroup$
    – sgf
    Mar 22 at 11:48







1




1




$begingroup$
Thank you, I understand it now!
$endgroup$
– Phil
Mar 22 at 10:26




$begingroup$
Thank you, I understand it now!
$endgroup$
– Phil
Mar 22 at 10:26




1




1




$begingroup$
As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
$endgroup$
– sgf
Mar 22 at 11:48




$begingroup$
As long as you use only prefix operators, there is never ambiguity as to which operators govern which arguments And that's the beauty of Polish notation.
$endgroup$
– sgf
Mar 22 at 11:48











17












$begingroup$

Order of precedence is simply a notional convenience. There is no notion of strength here, just notation. All three operators are unary operators with notation "$circ cdot$", where $circ$ denotes the operator symbol $exists, forall,neg$ and $cdot$ the operand. There can never be any ambiguity in which order to apply these operators: the operator to the right must always be applied to the operand first.



Hence, they have the same precedence among eachother if we consider only those three operators. (Note that there can be ambiguity if the unary operators have different position, e.g. $-x^2$, this could mean either $(-x)^2$ or $-(x^2)$ if there was no precendence between $^2$ and $-$.)






share|cite|improve this answer











$endgroup$












  • $begingroup$
    The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
    $endgroup$
    – Kevin
    Mar 21 at 23:11










  • $begingroup$
    Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
    $endgroup$
    – LarsH
    Mar 22 at 4:55











  • $begingroup$
    See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
    $endgroup$
    – LarsH
    Mar 22 at 5:22






  • 1




    $begingroup$
    @LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
    $endgroup$
    – Discrete lizard
    Mar 22 at 6:44







  • 4




    $begingroup$
    $forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:07















17












$begingroup$

Order of precedence is simply a notional convenience. There is no notion of strength here, just notation. All three operators are unary operators with notation "$circ cdot$", where $circ$ denotes the operator symbol $exists, forall,neg$ and $cdot$ the operand. There can never be any ambiguity in which order to apply these operators: the operator to the right must always be applied to the operand first.



Hence, they have the same precedence among eachother if we consider only those three operators. (Note that there can be ambiguity if the unary operators have different position, e.g. $-x^2$, this could mean either $(-x)^2$ or $-(x^2)$ if there was no precendence between $^2$ and $-$.)






share|cite|improve this answer











$endgroup$












  • $begingroup$
    The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
    $endgroup$
    – Kevin
    Mar 21 at 23:11










  • $begingroup$
    Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
    $endgroup$
    – LarsH
    Mar 22 at 4:55











  • $begingroup$
    See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
    $endgroup$
    – LarsH
    Mar 22 at 5:22






  • 1




    $begingroup$
    @LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
    $endgroup$
    – Discrete lizard
    Mar 22 at 6:44







  • 4




    $begingroup$
    $forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:07













17












17








17





$begingroup$

Order of precedence is simply a notional convenience. There is no notion of strength here, just notation. All three operators are unary operators with notation "$circ cdot$", where $circ$ denotes the operator symbol $exists, forall,neg$ and $cdot$ the operand. There can never be any ambiguity in which order to apply these operators: the operator to the right must always be applied to the operand first.



Hence, they have the same precedence among eachother if we consider only those three operators. (Note that there can be ambiguity if the unary operators have different position, e.g. $-x^2$, this could mean either $(-x)^2$ or $-(x^2)$ if there was no precendence between $^2$ and $-$.)






share|cite|improve this answer











$endgroup$



Order of precedence is simply a notional convenience. There is no notion of strength here, just notation. All three operators are unary operators with notation "$circ cdot$", where $circ$ denotes the operator symbol $exists, forall,neg$ and $cdot$ the operand. There can never be any ambiguity in which order to apply these operators: the operator to the right must always be applied to the operand first.



Hence, they have the same precedence among eachother if we consider only those three operators. (Note that there can be ambiguity if the unary operators have different position, e.g. $-x^2$, this could mean either $(-x)^2$ or $-(x^2)$ if there was no precendence between $^2$ and $-$.)







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Mar 21 at 17:49

























answered Mar 21 at 15:14









Discrete lizardDiscrete lizard

4,44011537




4,44011537











  • $begingroup$
    The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
    $endgroup$
    – Kevin
    Mar 21 at 23:11










  • $begingroup$
    Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
    $endgroup$
    – LarsH
    Mar 22 at 4:55











  • $begingroup$
    See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
    $endgroup$
    – LarsH
    Mar 22 at 5:22






  • 1




    $begingroup$
    @LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
    $endgroup$
    – Discrete lizard
    Mar 22 at 6:44







  • 4




    $begingroup$
    $forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:07
















  • $begingroup$
    The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
    $endgroup$
    – Kevin
    Mar 21 at 23:11










  • $begingroup$
    Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
    $endgroup$
    – LarsH
    Mar 22 at 4:55











  • $begingroup$
    See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
    $endgroup$
    – LarsH
    Mar 22 at 5:22






  • 1




    $begingroup$
    @LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
    $endgroup$
    – Discrete lizard
    Mar 22 at 6:44







  • 4




    $begingroup$
    $forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
    $endgroup$
    – Andrej Bauer
    Mar 22 at 7:07















$begingroup$
The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
$endgroup$
– Kevin
Mar 21 at 23:11




$begingroup$
The real question is why you would want the quantifiers to bind so tightly, assuming that most statements will be in prenex normal form and therefore need parentheses.
$endgroup$
– Kevin
Mar 21 at 23:11












$begingroup$
Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
$endgroup$
– LarsH
Mar 22 at 4:55





$begingroup$
Certainly ¬ is unary, but I don't understand why you say that ∃ and ∀ are unary operators. For example, wouldn't you say that $∀x P(x)$ is an expression, but $∀x$ is not? Maybe you just meant to say that they're all prefix operators, and that's why there's no need for precedence rules between them.
$endgroup$
– LarsH
Mar 22 at 4:55













$begingroup$
See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
$endgroup$
– LarsH
Mar 22 at 5:22




$begingroup$
See rule 5 at cs.odu.edu/~cs381/cs381content/logic/pred_logic/construction/…
$endgroup$
– LarsH
Mar 22 at 5:22




1




1




$begingroup$
@LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
$endgroup$
– Discrete lizard
Mar 22 at 6:44





$begingroup$
@LarsH Without domain specification, the quantifiers are unary. But even when we include the specification, this is usually in a subscript, e.g. $forall_x in X P(x)$. In that case, the operator remains unambiguous in this setting.
$endgroup$
– Discrete lizard
Mar 22 at 6:44





4




4




$begingroup$
$forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
$endgroup$
– Andrej Bauer
Mar 22 at 7:07




$begingroup$
$forall$ and $exists$ are not unary operators. They are binders, which is a feature of higher-order syntax.
$endgroup$
– Andrej Bauer
Mar 22 at 7:07

















draft saved

draft discarded
















































Thanks for contributing an answer to Computer Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f105880%2fwhy-do-%25c2%25ac-%25e2%2588%2580-and-%25e2%2588%2583-have-the-same-precedence%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum

He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029