Monday, February 3, 2020

example Latex expressions to parse

valid math latex in order of increasing complexity

a = b

\sin x

\sin x \in f

f \in g

invalid math latex in order of increasing complexity

a = b +              operator with no input

\sin x \left(        unpaired "("

\sin x \sum       operator with no input

valid ambiguous latex in order of increasing complexity

1/2\pi = (1/2) \pi  OR 1/(2 \pi); source: https://www.ntg.nl/maps/26/16.pdf

\sin x / y = (\sin x)/y  OR \sin (x/y); source: https://www.ntg.nl/maps/26/16.pdf

\sin x + 2 = (\sin x) + 2  OR \sin (x + 2)

https://math.stackexchange.com/a/1025217
https://math.stackexchange.com/a/1026483

valid ambiguous latex in a step in which the ambiguity can be resolved

input expression: \sin x / y = g
inf rule: multiply both sides by y
output expression: \sin x = g y

Here the input expression is ambiguous -- it isn't clear whether "\sin x / y" = (\sin x)/y  OR \sin (x/y)
The output expression implies that (\sin x)/y was the user's intention.


input expression: \sin x + 2 = g
inf rule: subtract "2" from both sides
output expression: \sin x = g - 2

Here the input expression is ambiguous -- it isn't clear whether "\sin x + 2" = (\sin x) + 2  OR \sin (x + 2)
The output expression implies that (\sin x) + 2 was the user's intention.

valid ambiguous latex in a step in which the ambiguity cannot be resolved

a = b

No comments:

Post a Comment