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

Precedence UpTee RoundImplies #101

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Nov 30, 2024

This PR fixes the values for the precedence of UpTee and RoundImplies operators. To arrive at these values, I tested how WMA parses expressions like

a\[UpTee]b\[RoundImplies]c

which produces the FullForm expression RoundImplies[UpTee[a,b],c]. Also, I try to check what are the InputForm and OutputForm of this expression, but RoundImplies is not formatted as an infix operator.
UpTee[a, RoundImplies[b, c]] // InputForm
results in a \[UpTee] RoundImplies[b, c]

@rocky
Copy link
Member

rocky commented Nov 30, 2024

which produces the FullForm expression RoundImplies[UpTee[a,b],c]. Also, I try to check what are the InputForm and OutputForm of this expression, but RoundImplies is not formatted as an infix operator.

Perhaps then, RoundTreeImplies is not an infix operator. It is also not listed as Built-in Symbol nor is it listed under Operators

Just because the Precedence[] function returns an integer value for whatever input symbol you give it, does not seem to mean the Symbol is an operator. Precedence[Foo] and Precedence[5] seem to return integer values.

@mmatera
Copy link
Contributor Author

mmatera commented Nov 30, 2024

Ok, but it is parsed as it was an infix operator. It is simply an inconsistency of the behavior in WMA.

@mmatera mmatera force-pushed the precedence_UpTee_RoundImplies branch from 5c7cf2f to aa90806 Compare November 30, 2024 12:50
@rocky
Copy link
Member

rocky commented Nov 30, 2024

Ok, but it is parsed as it was an infix operator. It is simply an inconsistency of the behavior in WMA.

Good point. Looking again at https://reference.wolfram.com/language/ref/character/RoundImplies.html the fact that there is a link to Operators and given the fact there is a specification that this groups right, suggests that this is an operator, but not one were there is an output boxing rule associated with it.

We could remove the format/boxing rule here, but if it seems like a WMA misfeature I am not sure it is worth the bother.

The main thing though here is to jot down what the situation is inside YAML comments.

@mmatera
Copy link
Contributor Author

mmatera commented Nov 30, 2024

Ok, but it is parsed as it was an infix operator. It is simply an inconsistency of the behavior in WMA.

Good point. Looking again at https://reference.wolfram.com/language/ref/character/RoundImplies.html the fact that there is a link to Operators and given the fact there is a specification that this groups right, suggests that this is an operator, but not one were there is an output boxing rule associated with it.

We could remove the boxing rule here, but if it seems like a WMA misfeature I am not sure it is worth the bother.

The main thing though here is to jot down what the situation is inside YAML comments.

Regarding the values, it would be interesting to see what @rljacobson has to say about.

@@ -97,7 +97,7 @@
# RoundImplies[a,UpTee[b,c]],
# But in Mathics as
# UpTee[RoundImplies[a, b], c]
# "RoundImplies", # WMA->240, Mathics->200, Must be ~193
"RoundImplies", # WMA->240, Mathics->200, Must be ~193
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why must it be ~193? Please write an isolated test that demonstrates this. Thanks.

@@ -6919,7 +6919,8 @@ UpSetDelayed:
# comments:

UpTee:
precedence: 190
precedence: 197
Precedence-Function: 190
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An operational test demonstrates and ensures this, please?

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