LaTeX to CAS translator
This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.
The demo-application converts LaTeX functions which directly translate to CAS counterparts.
Functions without explicit CAS support are available for translation via a DRMF package (under development).
The following LaTeX input ...
{\displaystyle x = \operatorname{sn}(u,k)}
... is translated to the CAS output ...
Semantic latex: x = \Jacobiellsnk@{u}{k}
Confidence: 0.5914375
Mathematica
Translation: x == JacobiSN[u, (k)^2]
Information
Sub Equations
- x = JacobiSN[u, (k)^2]
Free variables
- k
- u
- x
Symbol info
- Jacobian elliptic function; Example: \Jacobiellsnk@@{z}{k}
Will be translated to: JacobiSN[$0, ($1)^2] Relevant links to definitions: DLMF: http://dlmf.nist.gov/22.2#E4 Mathematica: https://reference.wolfram.com/language/ref/JacobiSN.html
Tests
Symbolic
Test expression: (x)-(JacobiSN[u, (k)^2])
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Numeric
SymPy
Translation:
Information
Symbol info
- (LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \Jacobiellsnk [\Jacobiellsnk]
Tests
Symbolic
Numeric
Maple
Translation: x = JacobiSN(u, k)
Information
Sub Equations
- x = JacobiSN(u, k)
Free variables
- k
- u
- x
Symbol info
- Jacobian elliptic function; Example: \Jacobiellsnk@@{z}{k}
Will be translated to: JacobiSN($0, $1) Relevant links to definitions: DLMF: http://dlmf.nist.gov/22.2#E4 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiSN
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- connection
- additional dependency in the dependency graph
- part of an equation
- multi-equation
- extra moi
Complete translation information:
{
"id" : "FORMULA_a5b302e73670bfa8e65927cfad0f60f0",
"formula" : "x = \\operatorname{sn}(u,k)",
"semanticFormula" : "x = \\Jacobiellsnk@{u}{k}",
"confidence" : 0.5914375000000001,
"translations" : {
"Mathematica" : {
"translation" : "x == JacobiSN[u, (k)^2]",
"translationInformation" : {
"subEquations" : [ "x = JacobiSN[u, (k)^2]" ],
"freeVariables" : [ "k", "u", "x" ],
"tokenTranslations" : {
"\\Jacobiellsnk" : "Jacobian elliptic function; Example: \\Jacobiellsnk@@{z}{k}\nWill be translated to: JacobiSN[$0, ($1)^2]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/22.2#E4\nMathematica: https://reference.wolfram.com/language/ref/JacobiSN.html"
}
},
"numericResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"wasAborted" : false,
"crashed" : false,
"testCalculationsGroups" : [ ]
},
"symbolicResults" : {
"overallResult" : "ERROR",
"numberOfTests" : 1,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 1,
"crashed" : false,
"testCalculationsGroup" : [ {
"lhs" : "x",
"rhs" : "JacobiSN[u, (k)^2]",
"testExpression" : "(x)-(JacobiSN[u, (k)^2])",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
} ]
}
},
"SymPy" : {
"translation" : "",
"translationInformation" : {
"tokenTranslations" : {
"Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\Jacobiellsnk [\\Jacobiellsnk]"
}
}
},
"Maple" : {
"translation" : "x = JacobiSN(u, k)",
"translationInformation" : {
"subEquations" : [ "x = JacobiSN(u, k)" ],
"freeVariables" : [ "k", "u", "x" ],
"tokenTranslations" : {
"\\Jacobiellsnk" : "Jacobian elliptic function; Example: \\Jacobiellsnk@@{z}{k}\nWill be translated to: JacobiSN($0, $1)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/22.2#E4\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiSN"
}
}
}
},
"positions" : [ {
"section" : 8,
"sentence" : 10,
"word" : 28
} ],
"includes" : [ "\\operatorname{sn}(u,k)", "=", "x" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "connection",
"score" : 0.7125985104912714
}, {
"definition" : "additional dependency in the dependency graph",
"score" : 0.6859086196238077
}, {
"definition" : "part of an equation",
"score" : 0.5988174995334326
}, {
"definition" : "multi-equation",
"score" : 0.5500952380952381
}, {
"definition" : "extra moi",
"score" : 0.5049074255814494
} ]
}