LaTeX to CAS translator

Jump to navigation Jump to search

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 \Re s > 0}

... is translated to the CAS output ...

Semantic latex: \realpart s > 0

Confidence: 0

Mathematica

Translation: Re[s] > 0

Information

Sub Equations

  • Re[s] > 0

Free variables

  • 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: Re[s]>0

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: Re(s) > 0

Information

Sub Equations

  • Re(s) > 0

Free variables

  • 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

Is part of

Complete translation information:

{
  "id" : "FORMULA_dae69c63cdd75f1b4e1815334bcf293e",
  "formula" : "\\realpart s > 0",
  "semanticFormula" : "\\realpart s > 0",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Re[s] > 0",
      "translationInformation" : {
        "subEquations" : [ "Re[s] > 0" ],
        "freeVariables" : [ "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" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "Re[s]",
          "rhs" : "0",
          "testExpression" : "Re[s]>0",
          "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" : "Re(s) > 0",
      "translationInformation" : {
        "subEquations" : [ "Re(s) > 0" ],
        "freeVariables" : [ "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" : [ "\\Re s > 0", "s" ],
  "isPartOf" : [ "\\Re s > 0" ],
  "definiens" : [ ]
}

Specify your own input