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

Fails to bring into canoical form #10

Open
8 tasks
stefnotch opened this issue Jun 22, 2021 · 3 comments
Open
8 tasks

Fails to bring into canoical form #10

stefnotch opened this issue Jun 22, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@stefnotch
Copy link
Contributor

stefnotch commented Jun 22, 2021

The following test cases fail to be turned into a canoical form. Some of them are pretty silly, others are somewhat sensible and should probably work. To reproduce any of them, select the text and paste it into https://cortexjs.io/compute-engine/demo/

  • \displaystyle \left(\sin^{-1}\mleft(x\mright)\right)^{\prime}
    image
    turns into "" syntax-error, probably because of the \displaystyle

  • \begin{equation*} 1^{\sin(x)} \end{equation*}
    image
    turns into null

  • \begin{equation*} 3\text{hello}6 \end{equation*}
    image
    turns into [ "Multiply", 3, 6, ["\\text", ["Multiply", "ExponentialE", "h", "l", "l", "o"]]]

  • \color{red}3
    image
    turns into ["\\textcolor", ["Multiply", "ExponentialE", "d", "r"], 3]

  • \begin{equation*} \ln(3) \end{equation*}
    image
    turns into ["Multiply", 3, "\\ln"]

  • \begin{equation*} f:[a,b]\to\R \end{equation*}
    image
    turns into "f" syntax-error

  • \begin{equation*} \lim_{n\to\infin}3 \end{equation*}
    image
    turns into ["Multiply", 3, ["Subscript", "\\lim", ["To", "n", "\\infin"]]]

  • \begin{cases} 3 & x < 5 \\ 7 & else \end{cases}
    image
    turns into [ "Piecewise", [ "list", ["list", 3, ["Less", "x", ["Multiply", 5, 7, "\\\\"]]] ]]

Tested with https://cortexjs.io/compute-engine/demo/

@stefnotch
Copy link
Contributor Author

Ah, nevermind, they do work. I tested them out on the compute engine demo page until I realized that the compute engine first tries to bring them into a canonical form

@stefnotch stefnotch changed the title Fails to serialize as MathJson Fails to bring into canoical form Jun 22, 2021
@stefnotch stefnotch reopened this Jun 22, 2021
@arnog arnog self-assigned this Jun 22, 2021
@arnog arnog added the bug Something isn't working label Jun 22, 2021
@arnog
Copy link
Member

arnog commented Jun 22, 2021

Great examples! Thank you.

For some of them, I'm going to have to think a bit about what the proper MathJSON should be, unless you have some suggestions (f:[a,b]\to\R for example... would that be considered a function signature?)

@stefnotch
Copy link
Contributor Author

stefnotch commented Jun 23, 2021

@arnog Yes, I think that f:[a,b]\to\R was a function signature. A function f that maps from a closed interval [a,b] to the real numbers

A little suggestion regarding cosmetic things \color{red}3 would be to have some (optional) canonical form where all the cosmetics get stripped out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants