## Semantic Enrichment

SnuggleTeX 1.1.0 introduced experimental and limited support for generating “semantically richer” outputs than its usual display-oriented Presentation MathML that some users might find interesting to play around with. This notion is often referred to as “semantic enrichment”. (SnuggleTeX usually calls it “up-conversion” which has connotations of “swimming against the tide”, which is quite difficult, whereas “down-conversion” is much easier!)

These features were added as part of SnuggleTeX’s involvement in the JISC-funded MathAssess project which was concerned with enhancing existing computer-based assessment tools aimed at the educational sector for “service level” mathematics teaching up to early undergraduate level in the United Kingdom.

As of SnuggleTeX 1.2.0, these features are still to be considered experimental but might be interesting to some people and feedback/contact about this is most welcome.

### The `snuggletex-upconversion` module

The `snuggletex-upconversion` module, which is part of the
full SnuggleTeX distribution makes it possible to:

- Generate semantically richer Presentation MathML (from certain LaTeX inputs)
- Convert LaTeX to Content MathML (for certain LaTeX inputs)
- Convert LaTeX to Maxima notation (for certain LaTeX inputs)
- Generate the above forms from certain ASCIIMathML inputs

It is important to qualify all of the above with phrases like “limited” and “experimental” as it is of course generally not possible to derive meaning from arbitrary LaTeX math inputs or arbitrary Presentation MathML expressions. This is not difficult to demonstrate. For example, written mathematical notations tend to be reused for different purposes and their correct interpretation relies on an understanding of the underlying context. A simple example of this is the symbol e might refer to the exponential number in some cases whereas, it could also be the identity in a group or have a number of other meanings. Similarly, the expression f(x+1) could well represent the application of the function f to x+1, whereas it could also be the product of f and x+1. A related difficulty is that mathematical notations and conventions are often localised, with different countries favouring particular notations and symbolic conventions over others.

### Supported Input Forms

The SnuggleTeX up-conversion processes are aimed at the LaTeX expressions using:

- “Traditional” UK notation and conventions
- Numbers and identifiers
- Familiar symbols for basic arithmetic operators
- Basic unary trigonometric, hyperbolic, logarithmic and exponential functions
- Some basic n-ary functions like
`min`,`max`,`gcd`etc. - Implicit products and function arguments
- Factorials
- Basic set theory and logic operators
- Basic relation operators
- Greek letters
- Basic symbols (e.g. infinity)
- A certain amount of configurable “assumptions” (e.g. treat f as a a function, treat e as the exponential number…)