-
Notifications
You must be signed in to change notification settings - Fork 19
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
Rearrange Intent section #513
Conversation
You could make respec happier by deleting the
|
Since you mention it: I had thought to make two changes to the grammar, but didn't want to go too far mixing changes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the whole it looks good, there is one respec warning, and I added a suggestion at the point you indicated one was needed. (you can choose to add these or not to your PR using the "commit suggestion" button in the github UI.)
src/intent.html
Outdated
@@ -152,7 +143,7 @@ <h3 id="mixing_intent_grammar">The Grammar for <code class="attribue">intent</co | |||
<dt><dfn id="intent_property_list">self-property-list</dfn></dt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<dt><dfn id="intent_property_list">self-property-list</dfn></dt> | |
<dt>self-property-list</dt> |
src/intent.html
Outdated
<p>Note that future updates of the AT and [=Intent Concept Dictionary=] may | ||
include additional concepts, at which time those concepts may also receive special treatment.</p> | ||
|
||
<p><em>NEEDS CLARIFICATION: </em> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p><em>NEEDS CLARIFICATION: </em> | |
<p> |
src/intent.html
Outdated
the AT may be able to infer the relevant concept. fixity and arguments | ||
from the structure and content of the MathML. | ||
In such cases, it should proceed as above as if the inferred intent had been given explicitly. | ||
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</p> | |
For example an AT system might infer in intent of `power` given `<msup><mi>x</mi><mn>2</mn></msup>`, | |
resulting in a reading such as "x squared". An explicit intent property of `:literal` could be used to over-ride this inferred intent, and lead to a reading such as `x superscript 2`. | |
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, could add that. But there's also the case of "short-hand" intent (if that's the right term): I was also concerned with a case like
<mrow><mi>x</mi><mo intent="plus">foo</mo><mi>y</mi></mrow>
which could be inferred to be
<mrow intent="plus:infix($x,$y)">...
Should this be addressed here? (or is it addressed elsewhere already?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bruce: perhaps you could say that the two are equivalent (without inference)? But I think a more compelling example would be better -- an example where you would expect some inference. In general, an mrow
will read as is unless some inference overrides it E.g., <mo intent="xxx">|</mo>
, then I'm dubious AT would do a match that comes up with absolute-value -- MathCAT wouldn't.
One thought would be add more examples to the examples section and use them to illustrate some of the edge cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a very dubious section as a starting point for discussion.
I'm not sure. We ended up with that grammar after a rather tortuous iteration and it's managed to stay stable for some time now:-) The grammar would be simpler if we dropped As you say it's true that we could regard that as a grammar implementation detail and not make the description follow the grammar exactly but (at least in that section) I think it is clearer if it does, as it's describing the grammar rather than describing intent in general (I think....) |
On https://www.w3.org/TR/xml/#NT-S as the xml spec used S here But if people prefer to change that, then any name is OK |
ah yes I think we have so far avoided trying to specify how intents on operators are lifted up to have intents with arguments on inferred children (as infering the arguments proved tricky in general) perhaps you are right that just giving some examples as system specific inferred intents would be good. maybe a new section (before the intent error handling section) on inferring intent? |
Should I go ahead & create such a section, and add the suggestions we've discussed as a starting draft? |
I think so, this PR is "re-arrage intent section" not for any specific change so I think it makes sense to roll in other changes so people can see the section as a whole |
To avoid disrupting discussion here, I have posed my remaining feedback as an add-on PR to this one, visible at brucemiller/mathml#1. I am grateful for the changes in Bruce's commit 9902004 here, which gave me a foundation to build on. |
on f3f9fec it may be worth copying (or perhaps even referencing) some of the examples in the intent-examples collecttion eg https://w3c.github.io/mathml-docs/intent-examples/#id-1-1eff6f050a4d26222d07f68068e1014a which shows "n choose k" being inferred from nothing (unless you use the |
It may indeed be worth copying some examples, but it would help to have a better sense of where we're trying to go with this section before getting too deep. In writing the "use of" section, the case of OTOH, for the case where no intent is given, I suspect that we should say as little as possible about inferring intent to avoid limiting implementers from finding the best magic that they can. |
Yes, I think there are two possible models there.
yes although I suspect we can't say "how" without falling into old rabbit holes around which element siblings are likely arguments and which are just punctuation
yes I think though we should say it's allowed. One real problem I had making the intent examples was that mathcat often made a good reading of the original, no-intent version, and then I struggled to add intent in a way not to mess it up. We need to say I think that systems may infer intents either if there are no intents at all or if the intent markup is only partial with not all subterms annotated. The system SHOULD not do that if a |
Yeah, this is where my thinking was gradually headed, I think. I didn't find it addressed explicitly anywhere, but certainly implied in examples. Probably at the beginning of the Using section we need a bit of clarification along the lines that arity & fixity are only relevant if arguments are given explicitly in the If we can phrase this right, we probably don't need this new section at all.
The possibility of making the detailed intent completely explicit belongs with the possibility of inferring a intent from scratch: we'd want to allow it, but not get into any details. |
yes, so I suppose it's a choice of whether we assume anything not forbidden is allowed, and so not mention it or whether we want to give a note that it is allowed and possibly even a an example or two. |
… removed stub section on inference
Following the above discussion, I just added some clarification to the beginning of the Using section about matching intents which have no arguments, which (mostly) handles the common case of Consequently, I've removed the stub section on inference (we can add more later, if needed). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one trivial typo marked in line (si/is) but otherwise last round of changes look good
Co-authored-by: David Carlisle <[email protected]>
I think this is a very good rewrite. There is more work to do (e.g., add some text on |
SHA: 0c8e53b Reason: push, by NSoiffer Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@brucemiller @NSoiffer not sure why the pipeline is failing (the spec seems to have built and pushed to gh-pages) |
I'm not quite sure what it was saying, but the failure seems to be an artifact of the fork/PR. |
This PR is a first attempt at rearranging the intent section to collect the various parts of definitions, descriptions and behaviors into single places to make the specification easier to use. Mostly, it collects the description of known, unknown, the how properties are used into a new subsection "Using Intent Concepts and Properties".
There is a gh-pages view here: https://brucemiller.github.io/mathml/spec.html#mixing_intent, although the numbering is not correct.