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

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

Semantic latex: x = \pm 1

Confidence: 0

Mathematica

Translation: x == \[PlusMinus]1

Information

Sub Equations

  • x = + 1
  • x = - 1

Free variables

  • x

Symbol info

  • was translated to: \[PlusMinus]

Tests

Symbolic

Test expression: (x)-(+ 1)

ERROR:

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

Test expression: (x)-(- 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: x = &+- 1

Information

Sub Equations

  • x = + 1
  • x = - 1

Free variables

  • x

Symbol info

  • was translated to: &+-

Tests

Symbolic
Numeric

Dependency Graph Information

Description

  • solution

Complete translation information:

{
  "id" : "FORMULA_06f9b7b1d3f141742ad1c582b55056ba",
  "formula" : "x = \\pm 1",
  "semanticFormula" : "x = \\pm 1",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "x == \\[PlusMinus]1",
      "translationInformation" : {
        "subEquations" : [ "x = + 1", "x = - 1" ],
        "freeVariables" : [ "x" ],
        "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" : "x",
          "rhs" : "+ 1",
          "testExpression" : "(x)-(+ 1)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "x",
          "rhs" : "- 1",
          "testExpression" : "(x)-(- 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" : "x = &+- 1",
      "translationInformation" : {
        "subEquations" : [ "x = + 1", "x = - 1" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: &+-"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 3,
    "sentence" : 1,
    "word" : 11
  } ],
  "includes" : [ ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "solution",
    "score" : 0.6859086196238077
  } ]
}

Specify your own input