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 |a|<1;\Re(s)<0.}
... is translated to the CAS output ...
Semantic latex: |a|<1;\realpart(s)<0
Confidence: 0
Mathematica
Translation: Abs[a] < 1 Re[(s) ] < 0
Information
Free variables
- a
- s
Symbol info
- Real part of a complex number; Example: \realpart@@{z}
Will be translated to: Re[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.9#E2 Mathematica: https://reference.wolfram.com/language/ref/Re.html
Tests
Symbolic
Test expression: Abs[a]
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Test expression: 1 Re[(s) ]
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: \realpart [\realpart]
Tests
Symbolic
Numeric
Maple
Translation: abs(a) < 1; Re((s) ) < 0
Information
Free variables
- a
- s
Symbol info
- Real part of a complex number; Example: \realpart@@{z}
Will be translated to: Re($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.9#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Re
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Complete translation information:
{
"id" : "FORMULA_496699b1a71d03c6a6602574dfc257ea",
"formula" : "|a|<1;\\realpart(s)<0",
"semanticFormula" : "|a|<1;\\realpart(s)<0",
"confidence" : 0.0,
"translations" : {
"Mathematica" : {
"translation" : "Abs[a] < 1\n Re[(s) ] < 0",
"translationInformation" : {
"freeVariables" : [ "a", "s" ],
"tokenTranslations" : {
"\\realpart" : "Real part of a complex number; Example: \\realpart@@{z}\nWill be translated to: Re[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.9#E2\nMathematica: https://reference.wolfram.com/language/ref/Re.html"
}
},
"numericResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"wasAborted" : false,
"crashed" : false,
"testCalculationsGroups" : [ ]
},
"symbolicResults" : {
"overallResult" : "ERROR",
"numberOfTests" : 2,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 2,
"crashed" : false,
"testCalculationsGroup" : [ {
"lhs" : "Abs[a]",
"rhs" : "",
"testExpression" : "Abs[a]",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
}, {
"lhs" : "1\n Re[(s) ]",
"rhs" : "",
"testExpression" : "1\n Re[(s) ]",
"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: \\realpart [\\realpart]"
}
}
},
"Maple" : {
"translation" : "abs(a) < 1; Re((s) ) < 0",
"translationInformation" : {
"freeVariables" : [ "a", "s" ],
"tokenTranslations" : {
"\\realpart" : "Real part of a complex number; Example: \\realpart@@{z}\nWill be translated to: Re($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.9#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Re"
}
}
}
},
"positions" : [ ],
"includes" : [ "a", "s" ],
"isPartOf" : [ ],
"definiens" : [ ]
}