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 \sigma = \pm 1}

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

Semantic latex: \sigma = \pm 1

Confidence: 0

Mathematica

Translation: \[Sigma] == \[PlusMinus]1

Information

Sub Equations

  • \[Sigma] = + 1
  • \[Sigma] = - 1

Free variables

  • \[Sigma]

Symbol info

  • was translated to: \[PlusMinus]

Tests

Symbolic

Test expression: (\[Sigma])-(+ 1)

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}

Test expression: (\[Sigma])-(- 1)

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) An unknown or missing element occurred: Cannot translate operation \pm

Tests

Symbolic
Numeric

Maple

Translation: sigma = &+- 1

Information

Sub Equations

  • sigma = + 1
  • sigma = - 1

Free variables

  • sigma

Symbol info

  • was translated to: &+-

Tests

Symbolic
Numeric

Dependency Graph Information

Description

  • TeX Source
  • Formula
  • Gold ID
  • link
  • pm
  • sigma

Complete translation information:

{
  "id" : "FORMULA_f694135eafc20195a9d96ca3ce8af674",
  "formula" : "\\sigma = \\pm 1",
  "semanticFormula" : "\\sigma = \\pm 1",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[Sigma] == \\[PlusMinus]1",
      "translationInformation" : {
        "subEquations" : [ "\\[Sigma] = + 1", "\\[Sigma] = - 1" ],
        "freeVariables" : [ "\\[Sigma]" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: \\[PlusMinus]"
        }
      },
      "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" : "\\[Sigma]",
          "rhs" : "+ 1",
          "testExpression" : "(\\[Sigma])-(+ 1)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "\\[Sigma]",
          "rhs" : "- 1",
          "testExpression" : "(\\[Sigma])-(- 1)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) An unknown or missing element occurred: Cannot translate operation \\pm"
        }
      }
    },
    "Maple" : {
      "translation" : "sigma = &+- 1",
      "translationInformation" : {
        "subEquations" : [ "sigma = + 1", "sigma = - 1" ],
        "freeVariables" : [ "sigma" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: &+-"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 1,
    "sentence" : 0,
    "word" : 8
  } ],
  "includes" : [ ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "TeX Source",
    "score" : 0.722
  }, {
    "definition" : "Formula",
    "score" : 0.7125985104912714
  }, {
    "definition" : "Gold ID",
    "score" : 0.6859086196238077
  }, {
    "definition" : "link",
    "score" : 0.6460746792928004
  }, {
    "definition" : "pm",
    "score" : 0.6460746792928004
  }, {
    "definition" : "sigma",
    "score" : 0.5988174995334326
  } ]
}

Specify your own input