]> matita.cs.unibo.it Git - helm.git/commitdiff
This commit was manufactured by cvs2svn to create tag 'V6-2'. V6-2
authorno author <no.author@nowhere.it>
Fri, 1 Dec 2000 20:00:19 +0000 (20:00 +0000)
committerno author <no.author@nowhere.it>
Fri, 1 Dec 2000 20:00:19 +0000 (20:00 +0000)
110 files changed:
helm/dtd/annotations.dtd [new file with mode: 0644]
helm/dtd/cic.dtd [new file with mode: 0644]
helm/dtd/cicobject.dtd [new file with mode: 0644]
helm/dtd/cictypes.dtd [new file with mode: 0644]
helm/dtd/isoamsa.ent [new file with mode: 0644]
helm/dtd/isoamsb.ent [new file with mode: 0644]
helm/dtd/isoamsc.ent [new file with mode: 0644]
helm/dtd/isoamsn.ent [new file with mode: 0644]
helm/dtd/isoamso.ent [new file with mode: 0644]
helm/dtd/isoamsr.ent [new file with mode: 0644]
helm/dtd/isobox.ent [new file with mode: 0644]
helm/dtd/isocyr1.ent [new file with mode: 0644]
helm/dtd/isocyr2.ent [new file with mode: 0644]
helm/dtd/isodia.ent [new file with mode: 0644]
helm/dtd/isogrk3.ent [new file with mode: 0644]
helm/dtd/isolat1.ent [new file with mode: 0644]
helm/dtd/isolat2.ent [new file with mode: 0644]
helm/dtd/isomfrk.ent [new file with mode: 0644]
helm/dtd/isomopf.ent [new file with mode: 0644]
helm/dtd/isomscr.ent [new file with mode: 0644]
helm/dtd/isonum.ent [new file with mode: 0644]
helm/dtd/isopub.ent [new file with mode: 0644]
helm/dtd/isotech.ent [new file with mode: 0644]
helm/dtd/mathml2-qname-1.mod [new file with mode: 0644]
helm/dtd/mathml2.dtd [new file with mode: 0644]
helm/dtd/maththeory.dtd [new file with mode: 0644]
helm/dtd/mmlalias.ent [new file with mode: 0644]
helm/dtd/mmlextra.ent [new file with mode: 0644]
helm/dtd/provastruct.theory.xml [new file with mode: 0644]
helm/dtd/theoryobject.dtd [new file with mode: 0644]
helm/interface/.cvsignore [new file with mode: 0644]
helm/interface/.depend
helm/interface/ISTRUZIONI [deleted file]
helm/interface/Makefile
helm/interface/NON_VA [deleted file]
helm/interface/PER_FARLO_ANDARE [deleted file]
helm/interface/PER_FARLO_ANDARE_TCSH [deleted file]
helm/interface/PER_FARLO_ANDARE_TCSH_D01 [deleted file]
helm/interface/cadet
helm/interface/cicXPath.prima_degli_identificatori.ml [deleted file]
helm/interface/configuration.ml
helm/interface/getter.ml
helm/interface/gmon.out [deleted file]
helm/interface/http_getter/http_getter.pl [deleted file]
helm/interface/http_getter/http_getter.pl2 [deleted file]
helm/interface/isterix
helm/interface/javacore15005.txt [deleted file]
helm/interface/javacore15021.txt [deleted file]
helm/interface/latinize.pl [deleted file]
helm/interface/mkindex.sh [deleted file]
helm/interface/mml.dtd [deleted file]
helm/interface/mml.ml [deleted file]
helm/interface/mmlinterface.ml
helm/interface/mmlinterface.opt.saved [deleted file]
helm/interface/pxpUriResolver.ml
helm/interface/servers.txt [deleted file]
helm/interface/servers.txt.universita [deleted file]
helm/interface/t1.config [new file with mode: 0644]
helm/interface/uris_of_filenames.pl
helm/interface/urls_of_uris.db [deleted file]
helm/interface/xaland-cpp/xaland.cpp [deleted file]
helm/interface/xaland-java/rompi.class [deleted file]
helm/interface/xaland-java/rompi.java [deleted file]
helm/interface/xaland-java/sped.class [deleted file]
helm/interface/xaland-java/sped.java [deleted file]
helm/interface/xaland-java/xaland.class [deleted file]
helm/interface/xaland-java/xaland.java [deleted file]
helm/interface/xaland-java/xaland.java.prima_del_loro_baco [deleted file]
helm/interface/xaland-java/xaland.java.prima_del_loro_baco_ma_dopo_i_reset [deleted file]
helm/interface/xaland.class [deleted file]
helm/style/annotatedcont.xsl [new file with mode: 0644]
helm/style/annotatedpres.xsl [new file with mode: 0644]
helm/style/basic.xsl [new file with mode: 0644]
helm/style/content.xsl [new file with mode: 0644]
helm/style/content_to_html.xsl [new file with mode: 0644]
helm/style/html_init.xsl [new file with mode: 0644]
helm/style/html_reals.xsl [new file with mode: 0644]
helm/style/html_set.xsl [new file with mode: 0644]
helm/style/mml2mmlv1_0.xsl [new file with mode: 0644]
helm/style/mmlextension.xsl [new file with mode: 0644]
helm/style/objcontent.xsl [new file with mode: 0644]
helm/style/params.xsl [new file with mode: 0644]
helm/style/proofs.xsl [new file with mode: 0644]
helm/style/reals.xsl [new file with mode: 0644]
helm/style/ricerca.xsl [new file with mode: 0644]
helm/style/rootcontent.xsl [new file with mode: 0644]
helm/style/roottheory.xsl [new file with mode: 0644]
helm/style/set.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/annotatedcont.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/annotatedpres.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/basic.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/content.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/content_to_html.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/html_init.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/html_reals.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/html_set.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/mml2mmlv1_0.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/mml2mmlv1_0_original.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/mmlextension.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/objcontent.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/params.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/reals.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/ricerca.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/rootcontent.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/roottheory.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/set.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/theory_content.xsl [new file with mode: 0644]
helm/style/style_prima_del_linguaggio_naturale/theory_pres.xsl [new file with mode: 0644]
helm/style/theory_content.xsl [new file with mode: 0644]
helm/style/theory_pres.xsl [new file with mode: 0644]

diff --git a/helm/dtd/annotations.dtd b/helm/dtd/annotations.dtd
new file mode 100644 (file)
index 0000000..c7d3799
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR ANNOTATED OBJECTS:                                      -->
+<!--  First draft: June 2000, Claudio Sacerdoti Coen                 -->
+<!--*****************************************************************-->
+
+<!ENTITY % annotation '(#PCDATA|node|attribute)*'>
+
+<!ELEMENT Annotations (Annotation)*>
+<!ATTLIST Annotations
+          of CDATA #REQUIRED>
+
+<!ELEMENT Annotation %annotation;>
+<!ATTLIST Annotation
+          of CDATA #REQUIRED>
+
+<!-- Annotations: -->
+
+<!ELEMENT attribute EMPTY>
+<!ATTLIST attribute
+          name       NMTOKEN #REQUIRED
+          id         NMTOKEN #REQUIRED
+          child      NMTOKEN #IMPLIED
+          grandchild NMTOKEN #IMPLIED>
+
+<!ELEMENT node EMPTY>
+<!ATTLIST node
+          id NMTOKEN #REQUIRED>
diff --git a/helm/dtd/cic.dtd b/helm/dtd/cic.dtd
new file mode 100644 (file)
index 0000000..e16b102
--- /dev/null
@@ -0,0 +1,176 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR CIC OBJECTS:                                            -->
+<!--  First draft: September 1999, Claudio Sacerdoti Coen            -->
+<!--  Revised: February 3 2000, Claudio Sacerdoti Coen, Irene Schena -->
+<!--  Last Revision: April 4 2000, Claudio Sacerdoti Coen            -->
+<!--  Last Revision: June 19 2000, Claudio Sacerdoti Coen            -->
+<!--  Last Revision: June 20 2000, Claudio Sacerdoti Coen            -->
+<!--*****************************************************************-->
+
+<!-- CIC term declaration -->
+
+<!ENTITY % term '(LAMBDA|CAST|PROD|REL|SORT|APPLY|VAR|META|IMPLICIT|CONST|
+                  ABST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX)'>
+
+<!-- CIC objects: -->
+
+<!ELEMENT Definition (body, type)>
+<!ATTLIST Definition
+          name       CDATA      #REQUIRED
+          params     CDATA      #REQUIRED
+          paramMode  (POSSIBLE) #IMPLIED
+          id         ID         #REQUIRED>
+
+<!ELEMENT Axiom (type)>
+<!ATTLIST Axiom
+          name   CDATA #REQUIRED
+          params CDATA #REQUIRED
+          id     ID    #REQUIRED>
+
+<!ELEMENT CurrentProof (Conjecture*,body,type)>
+<!ATTLIST CurrentProof
+          name CDATA #REQUIRED
+          id   ID    #REQUIRED>
+
+<!ELEMENT InductiveDefinition (InductiveType+)>
+<!ATTLIST InductiveDefinition
+          noParams NMTOKEN #REQUIRED
+          params   CDATA   #REQUIRED
+          id       ID      #REQUIRED>
+
+<!ELEMENT Variable (type)>
+<!ATTLIST Variable
+          name CDATA #REQUIRED
+          id   ID    #REQUIRED>
+
+<!-- Elements used in CIC objects, which are not terms: -->
+
+<!ELEMENT InductiveType (arity,Constructor*)>
+<!ATTLIST InductiveType
+          name      CDATA        #REQUIRED
+          inductive (true|false) #REQUIRED>
+
+<!ELEMENT Conjecture %term;>
+<!ATTLIST Conjecture
+          no NMTOKEN #REQUIRED>
+
+<!ELEMENT Constructor %term;>
+<!ATTLIST Constructor
+          name CDATA #REQUIRED>
+
+<!-- CIC terms: -->
+
+<!ELEMENT LAMBDA (source,target)>
+<!ATTLIST LAMBDA
+          id ID #REQUIRED>
+
+<!ELEMENT PROD (source,target)>
+<!ATTLIST PROD
+          id ID #REQUIRED>
+
+<!ELEMENT CAST (term,type)>
+<!ATTLIST CAST
+          id ID #REQUIRED>
+
+<!ELEMENT REL EMPTY>
+<!ATTLIST REL
+          value  NMTOKEN #REQUIRED
+          binder CDATA   #REQUIRED
+          id     ID      #REQUIRED>
+
+<!ELEMENT SORT EMPTY>
+<!ATTLIST SORT
+          value CDATA #REQUIRED
+          id    ID    #REQUIRED>
+
+<!ELEMENT APPLY (%term;)+>
+<!ATTLIST APPLY
+          id ID #REQUIRED>
+
+<!ELEMENT VAR EMPTY>
+<!ATTLIST VAR
+          relUri CDATA #REQUIRED
+          id     ID    #REQUIRED>
+
+<!ELEMENT META EMPTY>
+<!ATTLIST META
+          no NMTOKEN #REQUIRED
+          id ID      #REQUIRED>
+
+<!ELEMENT IMPLICIT EMPTY>
+<!ATTLIST IMPLICIT
+          id ID #REQUIRED>
+
+<!ELEMENT CONST EMPTY>
+<!ATTLIST CONST
+          uri CDATA #REQUIRED
+          id  ID    #REQUIRED>
+
+<!ELEMENT ABST EMPTY>
+<!ATTLIST ABST
+          uri CDATA #REQUIRED
+          id  ID    #REQUIRED>
+
+<!ELEMENT MUTIND EMPTY>
+<!ATTLIST MUTIND
+          uri    CDATA   #REQUIRED
+          noType NMTOKEN #REQUIRED
+          id     ID      #REQUIRED>
+
+<!ELEMENT MUTCONSTRUCT EMPTY>
+<!ATTLIST MUTCONSTRUCT
+          uri      CDATA   #REQUIRED
+          noType   NMTOKEN #REQUIRED
+          noConstr NMTOKEN #REQUIRED
+          id       ID      #REQUIRED>
+
+<!ELEMENT MUTCASE (patternsType,inductiveTerm,pattern*)>
+<!ATTLIST MUTCASE
+          uriType CDATA   #REQUIRED
+          noType  NMTOKEN #REQUIRED
+          id      ID      #REQUIRED>
+
+<!ELEMENT FIX (FixFunction+)>
+<!ATTLIST FIX
+          noFun NMTOKEN #REQUIRED
+          id    ID      #REQUIRED>
+
+<!ELEMENT COFIX (CofixFunction+)>
+<!ATTLIST COFIX
+          noFun NMTOKEN #REQUIRED
+          id    ID      #REQUIRED>
+
+<!-- Elements used in CIC terms: -->
+
+<!ELEMENT FixFunction (type,body)>
+<!ATTLIST FixFunction
+          name     CDATA   #REQUIRED
+          recIndex NMTOKEN #REQUIRED>
+
+<!ELEMENT CofixFunction (type,body)>
+<!ATTLIST CofixFunction
+          name     CDATA   #REQUIRED>
+
+<!-- Sintactic sugar for CIC terms and for CIC objects: -->
+
+<!ELEMENT source %term;>
+
+<!ELEMENT target %term;>
+<!ATTLIST target
+          binder CDATA #IMPLIED>
+
+<!ELEMENT term %term;>
+
+<!ELEMENT type  %term;>
+
+<!ELEMENT arity %term;>
+
+<!ELEMENT patternsType  %term;>
+
+<!ELEMENT inductiveTerm  %term;>
+
+<!ELEMENT pattern  %term;>
+
+<!ELEMENT body  %term;>
diff --git a/helm/dtd/cicobject.dtd b/helm/dtd/cicobject.dtd
new file mode 100644 (file)
index 0000000..1d9917b
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR CIC OBJECTS AT LEVEL OF MATHML CONTENT:                 -->
+<!--  First draft: March 21, Claudio Sacerdoti Coen, Irene Schena    -->
+<!--*****************************************************************-->
+
+<!ENTITY % mathml SYSTEM "mathml2.dtd">
+
+%mathml;
+
+<!ENTITY % term '(annotation|%math.qname;)'>
+
+<!-- Terms: -->
+
+<!ELEMENT annotation (#PCDATA|annotation|%math.qname;)*>
+<!ATTLIST annotation
+          xmlns:m    CDATA #REQUIRED>
+
+<!-- CIC objects: -->
+
+<!ELEMENT Definition (Params,body,type)>
+<!ATTLIST Definition
+          name       CDATA      #REQUIRED
+          xmlns:m    CDATA      #REQUIRED>
+
+<!ELEMENT Axiom (Params,type)>
+<!ATTLIST Axiom
+          name   CDATA #REQUIRED
+          xmlns:m    CDATA      #REQUIRED>
+
+<!ELEMENT CurrentProof (Conjecture*,body,type)>
+<!ATTLIST CurrentProof
+          name CDATA #REQUIRED
+          xmlns:m    CDATA      #REQUIRED>
+
+<!ELEMENT InductiveDefinition (Params,Param*,InductiveType+)>
+<!ATTLIST InductiveDefinition
+          xmlns:m    CDATA      #REQUIRED>
+
+<!ELEMENT Variable (type)>
+<!ATTLIST Variable
+          name CDATA #REQUIRED
+          xmlns:m    CDATA      #REQUIRED>
+
+<!-- Elements used in CIC objects, which are not terms: -->
+
+<!ELEMENT InductiveType (arity,Constructor*)>
+<!ATTLIST InductiveType
+          name      CDATA        #REQUIRED
+          inductive (true|false) #REQUIRED>
+
+<!ELEMENT Conjecture %term;>
+<!ATTLIST Conjecture
+          no NMTOKEN #REQUIRED>
+
+<!ELEMENT Constructor %term;>
+<!ATTLIST Constructor
+          name CDATA #REQUIRED>
+
+<!ELEMENT Param %term;>
+<!ATTLIST Param
+          name CDATA #REQUIRED>
+
+<!ELEMENT Params (#PCDATA)*>
+
+<!-- Sintactic sugar for CIC objects: -->
+
+<!ELEMENT type  %term;>
+
+<!ELEMENT arity %term;>
+
+<!ELEMENT body  %term;>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/helm/dtd/cictypes.dtd b/helm/dtd/cictypes.dtd
new file mode 100644 (file)
index 0000000..73d4592
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR INNER TYPES:                                            -->
+<!--  First draft: November 11 2000, Claudio Sacerdoti Coen         -->
+<!--*****************************************************************-->
+
+<!ENTITY % cicdtd SYSTEM "cic.dtd">
+
+%cicdtd;
+
+<!ELEMENT ALLTYPES (TYPE*)>
+
+<!ELEMENT TYPE (%term;)>
+<!ATTLIST TYPE
+          id  NMTOKEN #REQUIRED>
diff --git a/helm/dtd/isoamsa.ent b/helm/dtd/isoamsa.ent
new file mode 100644 (file)
index 0000000..5ecf4db
--- /dev/null
@@ -0,0 +1,173 @@
+
+<!--
+     File isoamsa.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY angzarr          "&#x0237C;" ><!--angle with down zig-zag arrow -->
+<!ENTITY cirmid           "&#x02AEF;" ><!--circle, mid below -->
+<!ENTITY cudarrl          "&#x02938;" ><!--left, curved, down arrow -->
+<!ENTITY cudarrr          "&#x02935;" ><!--right, curved, down arrow -->
+<!ENTITY cularr           "&#x021B6;" ><!--/curvearrowleft A: left curved arrow -->
+<!ENTITY cularrp          "&#x0293D;" ><!--curved left arrow with plus -->
+<!ENTITY curarr           "&#x021B7;" ><!--/curvearrowright A: rt curved arrow -->
+<!ENTITY curarrm          "&#x0293C;" ><!--curved right arrow with minus -->
+<!ENTITY dArr             "&#x021D3;" ><!--/Downarrow A: down dbl arrow -->
+<!ENTITY Darr             "&#x021A1;" ><!--down two-headed arrow -->
+<!ENTITY ddarr            "&#x021CA;" ><!--/downdownarrows A: two down arrows -->
+<!ENTITY DDotrahd         "&#x02911;" ><!--right arrow with dotted stem -->
+<!ENTITY dfisht           "&#x0297F;" ><!--down fish tail -->
+<!ENTITY dHar             "&#x02965;" ><!--down harpoon-left, down harpoon-right -->
+<!ENTITY dharl            "&#x021C3;" ><!--/downharpoonleft A: dn harpoon-left -->
+<!ENTITY dharr            "&#x021C2;" ><!--/downharpoonright A: down harpoon-rt -->
+<!ENTITY duarr            "&#x021F5;" ><!--down arrow, up arrow -->
+<!ENTITY duhar            "&#x0296F;" ><!--down harp, up harp -->
+<!ENTITY dzigrarr         "&#x021DD;" ><!--right long zig-zag arrow -->
+<!ENTITY erarr            "&#x02971;" ><!--equal, right arrow below -->
+<!ENTITY harr             "&#x02194;" ><!--/leftrightarrow A: l&r arrow -->
+<!ENTITY hArr             "&#x021D4;" ><!--/Leftrightarrow A: l&r dbl arrow -->
+<!ENTITY harrcir          "&#x02948;" ><!--left and right arrow with a circle -->
+<!ENTITY harrw            "&#x021AD;" ><!--/leftrightsquigarrow A: l&r arr-wavy -->
+<!ENTITY hoarr            "&#x021FF;" ><!--horizontal open arrow -->
+<!ENTITY imof             "&#x022B7;" ><!--image of -->
+<!ENTITY lAarr            "&#x021DA;" ><!--/Lleftarrow A: left triple arrow -->
+<!ENTITY Larr             "&#x0219E;" ><!--/twoheadleftarrow A: -->
+<!ENTITY larrbfs          "&#x0291F;" ><!--left arrow-bar, filled square -->
+<!ENTITY larrfs           "&#x0291D;" ><!--left arrow, filled square -->
+<!ENTITY larrhk           "&#x021A9;" ><!--/hookleftarrow A: left arrow-hooked -->
+<!ENTITY larrlp           "&#x021AB;" ><!--/looparrowleft A: left arrow-looped -->
+<!ENTITY larrpl           "&#x02939;" ><!--left arrow, plus -->
+<!ENTITY larrsim          "&#x02973;" ><!--left arrow, similar -->
+<!ENTITY larrtl           "&#x021A2;" ><!--/leftarrowtail A: left arrow-tailed -->
+<!ENTITY latail           "&#x02919;" ><!--left arrow-tail -->
+<!ENTITY lAtail           "&#x0291B;" ><!--left double arrow-tail -->
+<!ENTITY lbarr            "&#x0290C;" ><!--left broken arrow -->
+<!ENTITY lBarr            "&#x0290E;" ><!--left doubly broken arrow -->
+<!ENTITY ldca             "&#x02936;" ><!--left down curved arrow -->
+<!ENTITY ldrdhar          "&#x02967;" ><!--left harpoon-down over right harpoon-down -->
+<!ENTITY ldrushar         "&#x0294B;" ><!--left-down-right-up harpoon -->
+<!ENTITY ldsh             "&#x021B2;" ><!--left down angled arrow -->
+<!ENTITY lfisht           "&#x0297C;" ><!--left fish tail -->
+<!ENTITY lHar             "&#x02962;" ><!--left harpoon-up over left harpoon-down -->
+<!ENTITY lhard            "&#x021BD;" ><!--/leftharpoondown A: l harpoon-down -->
+<!ENTITY lharu            "&#x021BC;" ><!--/leftharpoonup A: left harpoon-up -->
+<!ENTITY lharul           "&#x0296A;" ><!--left harpoon-up over long dash -->
+<!ENTITY llarr            "&#x021C7;" ><!--/leftleftarrows A: two left arrows -->
+<!ENTITY llhard           "&#x0296B;" ><!--left harpoon-down below long dash -->
+<!ENTITY loarr            "&#x021FD;" ><!--left open arrow -->
+<!ENTITY lrarr            "&#x021C6;" ><!--/leftrightarrows A: l arr over r arr -->
+<!ENTITY lrhar            "&#x021CB;" ><!--/leftrightharpoons A: l harp over r -->
+<!ENTITY lrhard           "&#x0296D;" ><!--right harpoon-down below long dash -->
+<!ENTITY lsh              "&#x021B0;" ><!--/Lsh A: -->
+<!ENTITY lurdshar         "&#x0294A;" ><!--left-up-right-down harpoon -->
+<!ENTITY luruhar          "&#x02966;" ><!--left harpoon-up over right harpoon-up -->
+<!ENTITY map              "&#x021A6;" ><!--/mapsto A: -->
+<!ENTITY Map              "&#x02905;" ><!--twoheaded mapsto -->
+<!ENTITY midcir           "&#x02AF0;" ><!--mid, circle below  -->
+<!ENTITY mumap            "&#x022B8;" ><!--/multimap A: -->
+<!ENTITY nearhk           "&#x02924;" ><!--NE arrow-hooked -->
+<!ENTITY nearr            "&#x02197;" ><!--/nearrow A: NE pointing arrow -->
+<!ENTITY neArr            "&#x021D7;" ><!--NE pointing dbl arrow -->
+<!ENTITY nesear           "&#x02928;" ><!--/toea A: NE & SE arrows -->
+<!ENTITY nharr            "&#x021AE;" ><!--/nleftrightarrow A: not l&r arrow -->
+<!ENTITY nhArr            "&#x021CE;" ><!--/nLeftrightarrow A: not l&r dbl arr -->
+<!ENTITY nlarr            "&#x0219A;" ><!--/nleftarrow A: not left arrow -->
+<!ENTITY nlArr            "&#x021CD;" ><!--/nLeftarrow A: not implied by -->
+<!ENTITY nrarr            "&#x0219B;" ><!--/nrightarrow A: not right arrow -->
+<!ENTITY nrArr            "&#x021CF;" ><!--/nRightarrow A: not implies -->
+<!ENTITY nrarrc           "&#x02933;&#x00338;" ><!--not right arrow-curved -->
+<!ENTITY nrarrw           "&#x0219D;&#x00338;" ><!--not right arrow-wavy -->
+<!ENTITY nvHarr           "&#x021CE;" ><!--not, vert, left and right double arrow  -->
+<!ENTITY nvlArr           "&#x021CD;" ><!--not, vert, left double arrow -->
+<!ENTITY nvrArr           "&#x021CF;" ><!--not, vert, right double arrow -->
+<!ENTITY nwarhk           "&#x02923;" ><!--NW arrow-hooked -->
+<!ENTITY nwarr            "&#x02196;" ><!--/nwarrow A: NW pointing arrow -->
+<!ENTITY nwArr            "&#x021D6;" ><!--NW pointing dbl arrow -->
+<!ENTITY nwnear           "&#x02927;" ><!--NW & NE arrows -->
+<!ENTITY olarr            "&#x021BA;" ><!--/circlearrowleft A: l arr in circle -->
+<!ENTITY orarr            "&#x021BB;" ><!--/circlearrowright A: r arr in circle -->
+<!ENTITY origof           "&#x022B6;" ><!--original of -->
+<!ENTITY rAarr            "&#x021DB;" ><!--/Rrightarrow A: right triple arrow -->
+<!ENTITY Rarr             "&#x021A0;" ><!--/twoheadrightarrow A: -->
+<!ENTITY rarrap           "&#x02975;" ><!--approximate, right arrow above -->
+<!ENTITY rarrbfs          "&#x02920;" ><!--right arrow-bar, filled square -->
+<!ENTITY rarrc            "&#x02933;" ><!--right arrow-curved -->
+<!ENTITY rarrfs           "&#x0291E;" ><!--right arrow, filled square -->
+<!ENTITY rarrhk           "&#x021AA;" ><!--/hookrightarrow A: rt arrow-hooked -->
+<!ENTITY rarrlp           "&#x021AC;" ><!--/looparrowright A: rt arrow-looped -->
+<!ENTITY rarrpl           "&#x02945;" ><!--right arrow, plus -->
+<!ENTITY rarrsim          "&#x02974;" ><!--right arrow, similar -->
+<!ENTITY rarrtl           "&#x021A3;" ><!--/rightarrowtail A: rt arrow-tailed -->
+<!ENTITY Rarrtl           "&#x02916;" ><!--right two-headed arrow with tail -->
+<!ENTITY rarrw            "&#x021DD;" ><!--/rightsquigarrow A: rt arrow-wavy -->
+<!ENTITY ratail           "&#x021A3;" ><!--right arrow-tail -->
+<!ENTITY rAtail           "&#x0291C;" ><!--right double arrow-tail -->
+<!ENTITY rbarr            "&#x0290D;" ><!--/bkarow A: right broken arrow -->
+<!ENTITY rBarr            "&#x0290F;" ><!--/dbkarow A: right doubly broken arrow -->
+<!ENTITY RBarr            "&#x02910;" ><!--/drbkarow A: twoheaded right broken arrow -->
+<!ENTITY rdca             "&#x02937;" ><!--right down curved arrow -->
+<!ENTITY rdldhar          "&#x02969;" ><!--right harpoon-down over left harpoon-down -->
+<!ENTITY rdsh             "&#x021B3;" ><!--right down angled arrow -->
+<!ENTITY rfisht           "&#x0297D;" ><!--right fish tail -->
+<!ENTITY rHar             "&#x02964;" ><!--right harpoon-up over right harpoon-down -->
+<!ENTITY rhard            "&#x021C1;" ><!--/rightharpoondown A: rt harpoon-down -->
+<!ENTITY rharu            "&#x021C0;" ><!--/rightharpoonup A: rt harpoon-up -->
+<!ENTITY rharul           "&#x0296C;" ><!--right harpoon-up over long dash -->
+<!ENTITY rlarr            "&#x021C4;" ><!--/rightleftarrows A: r arr over l arr -->
+<!ENTITY rlhar            "&#x021CC;" ><!--/rightleftharpoons A: r harp over l -->
+<!ENTITY roarr            "&#x021FE;" ><!--right open arrow -->
+<!ENTITY rrarr            "&#x021C9;" ><!--/rightrightarrows A: two rt arrows -->
+<!ENTITY rsh              "&#x021B1;" ><!--/Rsh A: -->
+<!ENTITY ruluhar          "&#x02968;" ><!--right harpoon-up over left harpoon-up -->
+<!ENTITY searhk           "&#x02925;" ><!--/hksearow A: SE arrow-hooken -->
+<!ENTITY searr            "&#x02198;" ><!--/searrow A: SE pointing arrow -->
+<!ENTITY seArr            "&#x021D8;" ><!--SE pointing dbl arrow -->
+<!ENTITY seswar           "&#x02929;" ><!--/tosa A: SE & SW arrows -->
+<!ENTITY simrarr          "&#x02972;" ><!--similar, right arrow below -->
+<!ENTITY slarr            "&#x02190;&#x02063;" ><!--short left arrow -->
+<!ENTITY srarr            "&#x02192;&#x02063;" ><!--short right arrow -->
+<!ENTITY swarhk           "&#x02926;" ><!--/hkswarow A: SW arrow-hooked -->
+<!ENTITY swarr            "&#x02199;" ><!--/swarrow A: SW pointing arrow -->
+<!ENTITY swArr            "&#x021D9;" ><!--SW pointing dbl arrow -->
+<!ENTITY swnwar           "&#x0292A;" ><!--SW & NW arrows -->
+<!ENTITY uArr             "&#x021D1;" ><!--/Uparrow A: up dbl arrow -->
+<!ENTITY Uarr             "&#x0219F;" ><!--up two-headed arrow -->
+<!ENTITY Uarrocir         "&#x02949;" ><!--up two-headed arrow above circle -->
+<!ENTITY udarr            "&#x021C5;" ><!--up arrow, down arrow -->
+<!ENTITY udhar            "&#x0296E;" ><!--up harp, down harp -->
+<!ENTITY ufisht           "&#x0297E;" ><!--up fish tail -->
+<!ENTITY uHar             "&#x02963;" ><!--up harpoon-left, up harpoon-right -->
+<!ENTITY uharl            "&#x021BF;" ><!--/upharpoonleft A: up harpoon-left -->
+<!ENTITY uharr            "&#x021BE;" ><!--/upharpoonright /restriction A: up harp-r -->
+<!ENTITY uuarr            "&#x021C8;" ><!--/upuparrows A: two up arrows -->
+<!ENTITY varr             "&#x02195;" ><!--/updownarrow A: up&down arrow -->
+<!ENTITY vArr             "&#x021D5;" ><!--/Updownarrow A: up&down dbl arrow -->
+<!ENTITY xharr            "&#x02194;" ><!--/longleftrightarrow A: long l&r arr -->
+<!ENTITY xhArr            "&#x021D4;" ><!--/Longleftrightarrow A: long l&r dbl arr -->
+<!ENTITY xlarr            "&#x02190;" ><!--/longleftarrow A: long left arrow -->
+<!ENTITY xlArr            "&#x021D0;" ><!--/Longleftarrow A: long l dbl arrow -->
+<!ENTITY xmap             "&#x021A6;" ><!--/longmapsto A: -->
+<!ENTITY xrarr            "&#x02192;" ><!--/longrightarrow A: long right arrow -->
+<!ENTITY xrArr            "&#x021D2;" ><!--/Longrightarrow A: long rt dbl arr -->
+<!ENTITY zigrarr          "&#x021DD;" ><!--right zig-zag arrow -->
diff --git a/helm/dtd/isoamsb.ent b/helm/dtd/isoamsb.ent
new file mode 100644 (file)
index 0000000..08e646c
--- /dev/null
@@ -0,0 +1,146 @@
+
+<!--
+     File isoamsb.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY ac               "&#x0290F;" ><!--most positive -->
+<!ENTITY acE              "&#x029DB;" ><!--most positive, two lines below -->
+<!ENTITY amalg            "&#x02A3F;" ><!--/amalg B: amalgamation or coproduct -->
+<!ENTITY barvee           "&#x022BD;" ><!--bar, vee -->
+<!ENTITY barwed           "&#x022BC;" ><!--/barwedge B: logical and, bar above -->
+<!ENTITY Barwed           "&#x02306;" ><!--/doublebarwedge B: log and, dbl bar above -->
+<!ENTITY bsolb            "&#x029C5;" ><!--reverse solidus in square -->
+<!ENTITY Cap              "&#x022D2;" ><!--/Cap /doublecap B: dbl intersection -->
+<!ENTITY capand           "&#x02A44;" ><!--intersection, and -->
+<!ENTITY capbrcup         "&#x02A49;" ><!--intersection, bar, union -->
+<!ENTITY capcap           "&#x02A4B;" ><!--intersection, intersection, joined -->
+<!ENTITY capcup           "&#x02A47;" ><!--intersection above union -->
+<!ENTITY capdot           "&#x02A40;" ><!--intersection, with dot -->
+<!ENTITY caps             "&#x02229;&#x02063;" ><!--intersection, serifs -->
+<!ENTITY ccaps            "&#x02A4D;" ><!--closed intersection, serifs -->
+<!ENTITY ccups            "&#x02A4C;" ><!--closed union, serifs -->
+<!ENTITY ccupssm          "&#x02A50;" ><!--closed union, serifs, smash product -->
+<!ENTITY coprod           "&#x02210;" ><!--/coprod L: coproduct operator -->
+<!ENTITY Cup              "&#x022D3;" ><!--/Cup /doublecup B: dbl union -->
+<!ENTITY cupbrcap         "&#x02A48;" ><!--union, bar, intersection -->
+<!ENTITY cupcap           "&#x02A46;" ><!--union above intersection -->
+<!ENTITY cupcup           "&#x02A4A;" ><!--union, union, joined -->
+<!ENTITY cupdot           "&#x0228D;" ><!--union, with dot -->
+<!ENTITY cupor            "&#x02A45;" ><!--union, or -->
+<!ENTITY cups             "&#x0222A;&#x02063;" ><!--union, serifs -->
+<!ENTITY cuvee            "&#x022CE;" ><!--/curlyvee B: curly logical or -->
+<!ENTITY cuwed            "&#x022CF;" ><!--/curlywedge B: curly logical and -->
+<!ENTITY dagger           "&#x02020;" ><!--/dagger B: dagger relation -->
+<!ENTITY Dagger           "&#x02021;" ><!--/ddagger B: double dagger relation -->
+<!ENTITY diam             "&#x022C4;" ><!--/diamond B: open diamond -->
+<!ENTITY divonx           "&#x022C7;" ><!--/divideontimes B: division on times -->
+<!ENTITY eplus            "&#x02A71;" ><!--equal, plus -->
+<!ENTITY hercon           "&#x022B9;" ><!--hermitian conjugate matrix -->
+<!ENTITY intcal           "&#x022BA;" ><!--/intercal B: intercal -->
+<!ENTITY iprod            "&#x02A3C;" ><!--/intprod -->
+<!ENTITY loplus           "&#x02A2D;" ><!--plus sign in left half circle -->
+<!ENTITY lotimes          "&#x02A34;" ><!--multiply sign in left half circle  -->
+<!ENTITY lthree           "&#x022CB;" ><!--/leftthreetimes B: -->
+<!ENTITY ltimes           "&#x022C9;" ><!--/ltimes B: times sign, left closed -->
+<!ENTITY midast           "&#x0002A;" ><!--/ast B: asterisk -->
+<!ENTITY minusb           "&#x0229F;" ><!--/boxminus B: minus sign in box -->
+<!ENTITY minusd           "&#x02238;" ><!--/dotminus B: minus sign, dot above -->
+<!ENTITY minusdu          "&#x02A2A;" ><!--minus sign, dot below -->
+<!ENTITY ncap             "&#x02A43;" ><!--bar, intersection -->
+<!ENTITY ncup             "&#x02A42;" ><!--bar, union -->
+<!ENTITY oast             "&#x0229B;" ><!--/circledast B: asterisk in circle -->
+<!ENTITY ocir             "&#x0229A;" ><!--/circledcirc B: small circle in circle -->
+<!ENTITY odash            "&#x0229D;" ><!--/circleddash B: hyphen in circle -->
+<!ENTITY odiv             "&#x02A38;" ><!--divide in circle -->
+<!ENTITY odot             "&#x02299;" ><!--/odot B: middle dot in circle -->
+<!ENTITY odsold           "&#x029BC;" ><!--dot, solidus, dot in circle -->
+<!ENTITY ofcir            "&#x029BF;" ><!--filled circle in circle -->
+<!ENTITY ogt              "&#x029C1;" ><!--greater-than in circle -->
+<!ENTITY ohbar            "&#x029B5;" ><!--circle with horizontal bar -->
+<!ENTITY olcir            "&#x029BE;" ><!--large circle in circle -->
+<!ENTITY olt              "&#x029C0;" ><!--less-than in circle -->
+<!ENTITY omid             "&#x029B6;" ><!--vertical bar in circle -->
+<!ENTITY ominus           "&#x02296;" ><!--/ominus B: minus sign in circle -->
+<!ENTITY opar             "&#x029B7;" ><!--parallel in circle -->
+<!ENTITY operp            "&#x029B9;" ><!--perpendicular in circle -->
+<!ENTITY oplus            "&#x02295;" ><!--/oplus B: plus sign in circle -->
+<!ENTITY osol             "&#x02298;" ><!--/oslash B: solidus in circle -->
+<!ENTITY otimes           "&#x02297;" ><!--/otimes B: multiply sign in circle -->
+<!ENTITY Otimes           "&#x02A37;" ><!--multiply sign in double circle -->
+<!ENTITY otimesas         "&#x02A36;" ><!--multiply sign in circle, circumflex accent -->
+<!ENTITY ovbar            "&#x0233D;" ><!--circle with vertical bar -->
+<!ENTITY plusacir         "&#x02A23;" ><!--plus, circumflex accent above -->
+<!ENTITY plusb            "&#x0229E;" ><!--/boxplus B: plus sign in box -->
+<!ENTITY pluscir          "&#x02A22;" ><!--plus, small circle above -->
+<!ENTITY plusdo           "&#x02214;" ><!--/dotplus B: plus sign, dot above -->
+<!ENTITY plusdu           "&#x02A25;" ><!--plus sign, dot below -->
+<!ENTITY pluse            "&#x02A72;" ><!--plus, equals -->
+<!ENTITY plussim          "&#x02A26;" ><!--plus, similar below -->
+<!ENTITY plustwo          "&#x02A27;" ><!--plus, two; Nim-addition -->
+<!ENTITY prod             "&#x0220F;" ><!--/prod L: product operator -->
+<!ENTITY race             "&#x029DA;" ><!--reverse most positive, line below -->
+<!ENTITY roplus           "&#x02A2E;" ><!--plus sign in right half circle -->
+<!ENTITY rotimes          "&#x02A35;" ><!--multiply sign in right half circle -->
+<!ENTITY rthree           "&#x022CC;" ><!--/rightthreetimes B: -->
+<!ENTITY rtimes           "&#x022CA;" ><!--/rtimes B: times sign, right closed -->
+<!ENTITY sdot             "&#x022C5;" ><!--/cdot B: small middle dot -->
+<!ENTITY sdotb            "&#x022A1;" ><!--/dotsquare /boxdot B: small dot in box -->
+<!ENTITY setmn            "&#x02216;" ><!--/setminus B: reverse solidus -->
+<!ENTITY simplus          "&#x02A24;" ><!--plus, similar above -->
+<!ENTITY smashp           "&#x02A33;" ><!--smash product -->
+<!ENTITY solb             "&#x029C4;" ><!--solidus in square -->
+<!ENTITY sqcap            "&#x02293;" ><!--/sqcap B: square intersection -->
+<!ENTITY sqcaps           "&#x02293;&#x02063;" ><!--square intersection, serifs -->
+<!ENTITY sqcup            "&#x02294;" ><!--/sqcup B: square union -->
+<!ENTITY sqcups           "&#x02294;&#x02063;" ><!--square union, serifs -->
+<!ENTITY ssetmn           "&#x02216;" ><!--/smallsetminus B: sm reverse solidus -->
+<!ENTITY sstarf           "&#x022C6;" ><!--/star B: small star, filled -->
+<!ENTITY subdot           "&#x02ABD;" ><!--subset, with dot -->
+<!ENTITY sum              "&#x02211;" ><!--/sum L: summation operator -->
+<!ENTITY supdot           "&#x02ABE;" ><!--superset, with dot -->
+<!ENTITY timesb           "&#x022A0;" ><!--/boxtimes B: multiply sign in box -->
+<!ENTITY timesbar         "&#x02A31;" ><!--multiply sign, bar below -->
+<!ENTITY timesd           "&#x02A30;" ><!--times, dot -->
+<!ENTITY tridot           "&#x025EC;" ><!--dot in triangle -->
+<!ENTITY triminus         "&#x02A3A;" ><!--minus in triangle -->
+<!ENTITY triplus          "&#x02A39;" ><!--plus in triangle -->
+<!ENTITY trisb            "&#x029CD;" ><!--triangle, serifs at bottom -->
+<!ENTITY tritime          "&#x02A3B;" ><!--multiply in triangle -->
+<!ENTITY uplus            "&#x0228E;" ><!--/uplus B: plus sign in union -->
+<!ENTITY veebar           "&#x022BB;" ><!--/veebar B: logical or, bar below -->
+<!ENTITY wedbar           "&#x02A5F;" ><!--wedge, bar below -->
+<!ENTITY wreath           "&#x02240;" ><!--/wr B: wreath product -->
+<!ENTITY xcap             "&#x022C2;" ><!--/bigcap L: intersection operator -->
+<!ENTITY xcirc            "&#x025EF;" ><!--/bigcirc B: large circle -->
+<!ENTITY xcup             "&#x022C3;" ><!--/bigcup L: union operator -->
+<!ENTITY xdtri            "&#x025BD;" ><!--/bigtriangledown B: big dn tri, open -->
+<!ENTITY xodot            "&#x02299;" ><!--/bigodot L: circle dot operator -->
+<!ENTITY xoplus           "&#x02295;" ><!--/bigoplus L: circle plus operator -->
+<!ENTITY xotime           "&#x02297;" ><!--/bigotimes L: circle times operator -->
+<!ENTITY xsqcup           "&#x02294;" ><!--/bigsqcup L: square union operator -->
+<!ENTITY xuplus           "&#x0228E;" ><!--/biguplus L: -->
+<!ENTITY xutri            "&#x025B3;" ><!--/bigtriangleup B: big up tri, open -->
+<!ENTITY xvee             "&#x022C1;" ><!--/bigvee L: logical and operator -->
+<!ENTITY xwedge           "&#x022C0;" ><!--/bigwedge L: logical or operator -->
diff --git a/helm/dtd/isoamsc.ent b/helm/dtd/isoamsc.ent
new file mode 100644 (file)
index 0000000..cce399c
--- /dev/null
@@ -0,0 +1,49 @@
+
+<!--
+     File isoamsc.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY dlcorn           "&#x0231E;" ><!--/llcorner O: lower left corner -->
+<!ENTITY drcorn           "&#x0231F;" ><!--/lrcorner C: lower right corner -->
+<!ENTITY gtlPar           "&#x02995;" ><!--dbl left parenthesis, greater -->
+<!ENTITY langd            "&#x02991;" ><!--left angle, dot -->
+<!ENTITY lbrke            "&#x0298B;" ><!--left bracket, equal -->
+<!ENTITY lbrksld          "&#x0298F;" ><!--left bracket, solidus bottom corner -->
+<!ENTITY lbrkslu          "&#x0298D;" ><!--left bracket, solidus top corner -->
+<!ENTITY lceil            "&#x02308;" ><!--/lceil O: left ceiling -->
+<!ENTITY lfloor           "&#x0230A;" ><!--/lfloor O: left floor -->
+<!ENTITY lmoust           "&#x02998;" ><!--/lmoustache -->
+<!ENTITY lparlt           "&#x02993;" ><!--O: left parenthesis, lt -->
+<!ENTITY ltrPar           "&#x02996;" ><!--dbl right parenthesis, less -->
+<!ENTITY rangd            "&#x02992;" ><!--right angle, dot -->
+<!ENTITY rbrke            "&#x0298C;" ><!--right bracket, equal -->
+<!ENTITY rbrksld          "&#x0298E;" ><!--right bracket, solidus bottom corner -->
+<!ENTITY rbrkslu          "&#x02990;" ><!--right bracket, solidus top corner -->
+<!ENTITY rceil            "&#x02309;" ><!--/rceil C: right ceiling -->
+<!ENTITY rfloor           "&#x0230B;" ><!--/rfloor C: right floor -->
+<!ENTITY rmoust           "&#x02997;" ><!--/rmoustache -->
+<!ENTITY rpargt           "&#x02994;" ><!--C: right paren, gt -->
+<!ENTITY ulcorn           "&#x0231C;" ><!--/ulcorner O: upper left corner -->
+<!ENTITY urcorn           "&#x0231D;" ><!--/urcorner C: upper right corner -->
diff --git a/helm/dtd/isoamsn.ent b/helm/dtd/isoamsn.ent
new file mode 100644 (file)
index 0000000..cddeba0
--- /dev/null
@@ -0,0 +1,117 @@
+
+<!--
+     File isoamsn.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY gnap             "&#x02A8A;" ><!--/gnapprox N: greater, not approximate -->
+<!ENTITY gne              "&#x02269;" ><!--/gneq N: greater, not equals -->
+<!ENTITY gnE              "&#x02269;" ><!--/gneqq N: greater, not dbl equals -->
+<!ENTITY gnsim            "&#x022E7;" ><!--/gnsim N: greater, not similar -->
+<!ENTITY gvnE             "&#x02269;&#x00338;" ><!--/gvertneqq N: gt, vert, not dbl eq -->
+<!ENTITY lnap             "&#x02A89;" ><!--/lnapprox N: less, not approximate -->
+<!ENTITY lne              "&#x02268;" ><!--/lneq N: less, not equals -->
+<!ENTITY lnE              "&#x02268;" ><!--/lneqq N: less, not double equals -->
+<!ENTITY lnsim            "&#x022E6;" ><!--/lnsim N: less, not similar -->
+<!ENTITY lvnE             "&#x02268;&#x00338;" ><!--/lvertneqq N: less, vert, not dbl eq -->
+<!ENTITY nap              "&#x02249;" ><!--/napprox N: not approximate -->
+<!ENTITY napE             "&#x02A70;&#x00338;" ><!--not approximately equal or equal to -->
+<!ENTITY napid            "&#x0224B;&#x00338;" ><!--not approximately identical to -->
+<!ENTITY ncong            "&#x02247;" ><!--/ncong N: not congruent with -->
+<!ENTITY ncongdot         "&#x02A6D;&#x00338;" ><!--not congruent, dot -->
+<!ENTITY nequiv           "&#x02262;" ><!--/nequiv N: not identical with -->
+<!ENTITY nge              "&#x02271;&#x020E5;" ><!--/ngeq N: not greater-than-or-equal -->
+<!ENTITY ngE              "&#x02271;" ><!--/ngeqq N: not greater, dbl equals -->
+<!ENTITY nges             "&#x02271;" ><!--/ngeqslant N: not gt-or-eq, slanted -->
+<!ENTITY nGg              "&#x022D9;&#x00338;" ><!--not triple greater than -->
+<!ENTITY ngsim            "&#x02275;" ><!--not greater, similar -->
+<!ENTITY ngt              "&#x0226F;" ><!--/ngtr N: not greater-than -->
+<!ENTITY nGt              "&#x0226B;&#x00338;" ><!--not, vert, much greater than -->
+<!ENTITY nGtv             "&#x0226B;&#x00338;&#x02063;" ><!--not much greater than, variant -->
+<!ENTITY nle              "&#x02270;&#x020E5;" ><!--/nleq N: not less-than-or-equal -->
+<!ENTITY nlE              "&#x02270;" ><!--/nleqq N: not less, dbl equals -->
+<!ENTITY nles             "&#x02270;" ><!--/nleqslant N: not less-or-eq, slant -->
+<!ENTITY nLl              "&#x022D8;&#x00338;" ><!--not triple less than -->
+<!ENTITY nlsim            "&#x02274;" ><!--not less, similar -->
+<!ENTITY nlt              "&#x0226E;" ><!--/nless N: not less-than -->
+<!ENTITY nLt              "&#x0226A;&#x00338;" ><!--not, vert, much less than -->
+<!ENTITY nltri            "&#x022EA;" ><!--/ntriangleleft N: not left triangle -->
+<!ENTITY nltrie           "&#x022EC;" ><!--/ntrianglelefteq N: not l tri, eq -->
+<!ENTITY nLtv             "&#x0226A;&#x00338;&#x02063;" ><!--not much less than, variant -->
+<!ENTITY nmid             "&#x02224;" ><!--/nmid -->
+<!ENTITY npar             "&#x02226;" ><!--/nparallel N: not parallel -->
+<!ENTITY npr              "&#x02280;" ><!--/nprec N: not precedes -->
+<!ENTITY nprcue           "&#x022E0;" ><!--not curly precedes, eq -->
+<!ENTITY npre             "&#x02AAF;&#x00338;" ><!--/npreceq N: not precedes, equals -->
+<!ENTITY nrtri            "&#x022EB;" ><!--/ntriangleright N: not rt triangle -->
+<!ENTITY nrtrie           "&#x022ED;" ><!--/ntrianglerighteq N: not r tri, eq -->
+<!ENTITY nsc              "&#x02281;" ><!--/nsucc N: not succeeds -->
+<!ENTITY nsccue           "&#x022E1;" ><!--not succeeds, curly eq -->
+<!ENTITY nsce             "&#x02AB0;&#x00338;" ><!--/nsucceq N: not succeeds, equals -->
+<!ENTITY nsim             "&#x02241;" ><!--/nsim N: not similar -->
+<!ENTITY nsime            "&#x02244;" ><!--/nsimeq N: not similar, equals -->
+<!ENTITY nsmid            "&#x02224;&#x02063;" ><!--/nshortmid -->
+<!ENTITY nspar            "&#x02226;&#x02063;" ><!--/nshortparallel N: not short par -->
+<!ENTITY nsqsube          "&#x022E2;" ><!--not, square subset, equals -->
+<!ENTITY nsqsupe          "&#x022E3;" ><!--not, square superset, equals -->
+<!ENTITY nsub             "&#x02284;" ><!--not subset -->
+<!ENTITY nsube            "&#x02288;" ><!--/nsubseteq N: not subset, equals -->
+<!ENTITY nsubE            "&#x02288;" ><!--/nsubseteqq N: not subset, dbl eq -->
+<!ENTITY nsup             "&#x02285;" ><!--not superset -->
+<!ENTITY nsupe            "&#x02289;" ><!--/nsupseteq N: not superset, equals -->
+<!ENTITY nsupE            "&#x02289;" ><!--/nsupseteqq N: not superset, dbl eq -->
+<!ENTITY ntgl             "&#x02279;" ><!--not greater, less -->
+<!ENTITY ntlg             "&#x02278;" ><!--not less, greater -->
+<!ENTITY nvap             "&#x02249;&#x00338;" ><!--not, vert, approximate -->
+<!ENTITY nvdash           "&#x022AC;" ><!--/nvdash N: not vertical, dash -->
+<!ENTITY nvDash           "&#x022AD;" ><!--/nvDash N: not vertical, dbl dash -->
+<!ENTITY nVdash           "&#x022AE;" ><!--/nVdash N: not dbl vertical, dash -->
+<!ENTITY nVDash           "&#x022AF;" ><!--/nVDash N: not dbl vert, dbl dash -->
+<!ENTITY nvge             "&#x02271;" ><!--not, vert, greater-than-or-equal -->
+<!ENTITY nvgt             "&#x0226F;" ><!--not, vert, greater-than -->
+<!ENTITY nvle             "&#x02270;" ><!--not, vert, less-than-or-equal -->
+<!ENTITY nvlt             "&#x0226E;" ><!--not, vert, less-than -->
+<!ENTITY nvltrie          "&#x022EC;&#x00338;" ><!--not, vert, left triangle, equals -->
+<!ENTITY nvrtrie          "&#x022ED;&#x00338;" ><!--not, vert, right triangle, equals -->
+<!ENTITY nvsim            "&#x02241;&#x00338;" ><!--not, vert, similar -->
+<!ENTITY parsim           "&#x02AF3;" ><!--parallel, similar -->
+<!ENTITY prnap            "&#x022E8;" ><!--/precnapprox N: precedes, not approx -->
+<!ENTITY prnE             "&#x02AB5;" ><!--/precneqq N: precedes, not dbl eq -->
+<!ENTITY prnsim           "&#x022E8;" ><!--/precnsim N: precedes, not similar -->
+<!ENTITY rnmid            "&#x02AEE;" ><!--reverse /nmid -->
+<!ENTITY scnap            "&#x022E9;" ><!--/succnapprox N: succeeds, not approx -->
+<!ENTITY scnE             "&#x02AB6;" ><!--/succneqq N: succeeds, not dbl eq -->
+<!ENTITY scnsim           "&#x022E9;" ><!--/succnsim N: succeeds, not similar -->
+<!ENTITY simne            "&#x02246;" ><!--similar, not equals -->
+<!ENTITY solbar           "&#x0233F;" ><!--solidus, bar through -->
+<!ENTITY subne            "&#x0228A;" ><!--/subsetneq N: subset, not equals -->
+<!ENTITY subnE            "&#x0228A;" ><!--/subsetneqq N: subset, not dbl eq -->
+<!ENTITY supne            "&#x0228B;" ><!--/supsetneq N: superset, not equals -->
+<!ENTITY supnE            "&#x0228B;" ><!--/supsetneqq N: superset, not dbl eq -->
+<!ENTITY vnsub            "&#x02284;" ><!--/nsubset N: not subset, var -->
+<!ENTITY vnsup            "&#x02285;" ><!--/nsupset N: not superset, var -->
+<!ENTITY vsubne           "&#x0228A;&#x02063;" ><!--/varsubsetneq N: subset, not eq, var -->
+<!ENTITY vsubnE           "&#x0228A;&#x02063;" ><!--/varsubsetneqq N: subset not dbl eq, var -->
+<!ENTITY vsupne           "&#x0228B;&#x02063;" ><!--/varsupsetneq N: superset, not eq, var -->
+<!ENTITY vsupnE           "&#x0228B;&#x02063;" ><!--/varsupsetneqq N: super not dbl eq, var -->
diff --git a/helm/dtd/isoamso.ent b/helm/dtd/isoamso.ent
new file mode 100644 (file)
index 0000000..8ac4bdb
--- /dev/null
@@ -0,0 +1,77 @@
+
+<!--
+     File isoamso.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY ang              "&#x02220;" ><!--/angle - angle -->
+<!ENTITY ange             "&#x029A4;" ><!--angle, equal -->
+<!ENTITY angmsd           "&#x02221;" ><!--/measuredangle - angle-measured -->
+<!ENTITY angmsdaa         "&#x029A8;" ><!--angle-measured, arrow, up, right -->
+<!ENTITY angmsdab         "&#x029A9;" ><!--angle-measured, arrow, up, left -->
+<!ENTITY angmsdac         "&#x029AA;" ><!--angle-measured, arrow, down, right -->
+<!ENTITY angmsdad         "&#x029AB;" ><!--angle-measured, arrow, down, left -->
+<!ENTITY angmsdae         "&#x029AC;" ><!--angle-measured, arrow, right, up -->
+<!ENTITY angmsdaf         "&#x029AD;" ><!--angle-measured, arrow, left, up -->
+<!ENTITY angmsdag         "&#x029AE;" ><!--angle-measured, arrow, right, down -->
+<!ENTITY angmsdah         "&#x029AF;" ><!--angle-measured, arrow, left, down -->
+<!ENTITY angrtvb          "&#x0299D;&#x02063;" ><!--right angle-measured -->
+<!ENTITY angrtvbd         "&#x0299D;" ><!--right angle-measured, dot -->
+<!ENTITY bbrk             "&#x023B5;" ><!--bottom square bracket -->
+<!ENTITY bemptyv          "&#x029B0;" ><!--reversed circle, slash -->
+<!ENTITY beth             "&#x02136;" ><!--/beth - beth, Hebrew -->
+<!ENTITY boxbox           "&#x029C9;" ><!--two joined squares -->
+<!ENTITY bprime           "&#x02035;" ><!--/backprime - reverse prime -->
+<!ENTITY bsemi            "&#x0204F;" ><!--reverse semi-colon -->
+<!ENTITY cemptyv          "&#x029B2;" ><!--circle, slash, small circle above -->
+<!ENTITY cirE             "&#x029C3;" ><!--circle, two horizontal stroked to the right -->
+<!ENTITY cirscir          "&#x029C2;" ><!--circle, small circle to the right -->
+<!ENTITY comp             "&#x02201;" ><!--/complement - complement sign -->
+<!ENTITY daleth           "&#x02138;" ><!--/daleth - daleth, Hebrew -->
+<!ENTITY demptyv          "&#x029B1;" ><!--circle, slash, bar above -->
+<!ENTITY ell              "&#x02113;" ><!--/ell - cursive small l -->
+<!ENTITY empty            "&#x02205;&#x02063;" ><!--/emptyset - zero, slash -->
+<!ENTITY emptyv           "&#x02205;" ><!--/varnothing - circle, slash -->
+<!ENTITY gimel            "&#x02137;" ><!--/gimel - gimel, Hebrew -->
+<!ENTITY iiota            "&#x02129;" ><!--inverted iota -->
+<!ENTITY image            "&#x02111;" ><!--/Im - imaginary   -->
+<!ENTITY imath            "&#x00131;" ><!--/imath - small i, no dot -->
+<!ENTITY jmath            "&#x0006A;&#x02063;" ><!--/jmath - small j, no dot -->
+<!ENTITY laemptyv         "&#x029B4;" ><!--circle, slash, left arrow above -->
+<!ENTITY lltri            "&#x025FA;" ><!--lower left triangle -->
+<!ENTITY lrtri            "&#x022BF;" ><!--lower right triangle -->
+<!ENTITY mho              "&#x02127;" ><!--/mho - conductance -->
+<!ENTITY nang             "&#x02220;&#x00338;" ><!--not, vert, angle -->
+<!ENTITY nexist           "&#x02204;" ><!--/nexists - negated exists -->
+<!ENTITY oS               "&#x024C8;" ><!--/circledS - capital S in circle -->
+<!ENTITY plank            "&#x0210F;" ><!--/hbar - Planck's over 2pi -->
+<!ENTITY plankv           "&#x0210F;" ><!--/hslash - variant Planck's over 2pi -->
+<!ENTITY raemptyv         "&#x029B3;" ><!--circle, slash, right arrow above -->
+<!ENTITY range            "&#x029A5;" ><!--reverse angle, equal -->
+<!ENTITY real             "&#x0211C;" ><!--/Re - real -->
+<!ENTITY tbrk             "&#x023B4;" ><!--top square bracket -->
+<!ENTITY ultri            "&#x025F8;" ><!--upper left triangle -->
+<!ENTITY urtri            "&#x025F9;" ><!--upper right triangle -->
+<!ENTITY vzigzag          "&#x0299A;" ><!--vertical zig-zag line -->
+<!ENTITY weierp           "&#x02118;" ><!--/wp - Weierstrass p -->
diff --git a/helm/dtd/isoamsr.ent b/helm/dtd/isoamsr.ent
new file mode 100644 (file)
index 0000000..7fec582
--- /dev/null
@@ -0,0 +1,205 @@
+
+<!--
+     File isoamsr.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY ape              "&#x0224A;" ><!--/approxeq R: approximate, equals -->
+<!ENTITY apE              "&#x0224A;" ><!--approximately equal or equal to -->
+<!ENTITY apid             "&#x0224B;" ><!--approximately identical to -->
+<!ENTITY asymp            "&#x0224D;" ><!--/asymp R: asymptotically equal to -->
+<!ENTITY Barv             "&#x02AE7;" ><!--vert, dbl bar (over) -->
+<!ENTITY bcong            "&#x0224C;" ><!--/backcong R: reverse congruent -->
+<!ENTITY bepsi            "&#x0213C;" ><!--/backepsilon R: such that -->
+<!ENTITY bowtie           "&#x022C8;" ><!--/bowtie R: -->
+<!ENTITY bsim             "&#x0223D;" ><!--/backsim R: reverse similar -->
+<!ENTITY bsime            "&#x022CD;" ><!--/backsimeq R: reverse similar, eq -->
+<!ENTITY bsolhsub         "&#x0005C;&#x02282;" ><!--reverse solidus, subset -->
+<!ENTITY bump             "&#x0224E;" ><!--/Bumpeq R: bumpy equals -->
+<!ENTITY bumpe            "&#x0224F;" ><!--/bumpeq R: bumpy equals, equals -->
+<!ENTITY bumpE            "&#x02AAE;" ><!--bump, equals -->
+<!ENTITY cire             "&#x02257;" ><!--/circeq R: circle, equals -->
+<!ENTITY Colon            "&#x02237;" ><!--/Colon, two colons -->
+<!ENTITY colone           "&#x02254;" ><!--/coloneq R: colon, equals -->
+<!ENTITY Colone           "&#x02A74;" ><!--double colon, equals -->
+<!ENTITY congdot          "&#x02A6D;" ><!--congruent, dot -->
+<!ENTITY csub             "&#x02ACF;" ><!--subset, closed -->
+<!ENTITY csube            "&#x02AD1;" ><!--subset, closed, equals -->
+<!ENTITY csup             "&#x02AD0;" ><!--superset, closed -->
+<!ENTITY csupe            "&#x02AD2;" ><!--superset, closed, equals -->
+<!ENTITY cuepr            "&#x022DE;" ><!--/curlyeqprec R: curly eq, precedes -->
+<!ENTITY cuesc            "&#x022DF;" ><!--/curlyeqsucc R: curly eq, succeeds -->
+<!ENTITY dashv            "&#x022A3;" ><!--/dashv R: dash, vertical -->
+<!ENTITY Dashv            "&#x02AE4;" ><!--dbl dash, vertical -->
+<!ENTITY easter           "&#x0225B;" ><!--equal, asterisk above -->
+<!ENTITY ecir             "&#x02256;" ><!--/eqcirc R: circle on equals sign -->
+<!ENTITY ecolon           "&#x02255;" ><!--/eqcolon R: equals, colon -->
+<!ENTITY eDDot            "&#x02A77;" ><!--/ddotseq R: equal with four dots -->
+<!ENTITY eDot             "&#x02251;" ><!--/doteqdot /Doteq R: eq, even dots -->
+<!ENTITY efDot            "&#x02252;" ><!--/fallingdotseq R: eq, falling dots -->
+<!ENTITY eg               "&#x02A9A;" ><!--equal-or-greater -->
+<!ENTITY egs              "&#x022DD;" ><!--/eqslantgtr R: equal-or-gtr, slanted -->
+<!ENTITY egsdot           "&#x02A98;" ><!--equal-or-greater, slanted, dot inside -->
+<!ENTITY el               "&#x02A99;" ><!--equal-or-less -->
+<!ENTITY els              "&#x022DC;" ><!--/eqslantless R: eq-or-less, slanted -->
+<!ENTITY elsdot           "&#x02A97;" ><!--equal-or-less, slanted, dot inside -->
+<!ENTITY equest           "&#x0225F;" ><!--/questeq R: equal with questionmark -->
+<!ENTITY equivDD          "&#x02A78;" ><!--equivalent, four dots above -->
+<!ENTITY erDot            "&#x02253;" ><!--/risingdotseq R: eq, rising dots -->
+<!ENTITY esdot            "&#x02250;" ><!--/doteq R: equals, single dot above -->
+<!ENTITY esim             "&#x02242;" ><!--/esim R: equals, similar -->
+<!ENTITY Esim             "&#x02A73;" ><!--equal, similar -->
+<!ENTITY fork             "&#x022D4;" ><!--/pitchfork R: pitchfork -->
+<!ENTITY forkv            "&#x02AD9;" ><!--fork, variant -->
+<!ENTITY frown            "&#x02322;" ><!--/frown R: down curve -->
+<!ENTITY gap              "&#x02273;" ><!--/gtrapprox R: greater, approximate -->
+<!ENTITY gE               "&#x02267;" ><!--/geqq R: greater, double equals -->
+<!ENTITY gel              "&#x022DB;" ><!--/gtreqless R: greater, equals, less -->
+<!ENTITY gEl              "&#x022DB;" ><!--/gtreqqless R: gt, dbl equals, less -->
+<!ENTITY ges              "&#x02A7E;" ><!--/geqslant R: gt-or-equal, slanted -->
+<!ENTITY gescc            "&#x02AA9;" ><!--greater than, closed by curve, equal, slanted -->
+<!ENTITY gesdot           "&#x02A80;" ><!--greater-than-or-equal, slanted, dot inside -->
+<!ENTITY gesdoto          "&#x02A82;" ><!--greater-than-or-equal, slanted, dot above -->
+<!ENTITY gesdotol         "&#x02A84;" ><!--greater-than-or-equal, slanted, dot above left -->
+<!ENTITY gesl             "&#x022DB;&#x02063;" ><!--greater, equal, slanted, less -->
+<!ENTITY gesles           "&#x02A94;" ><!--greater, equal, slanted, less, equal, slanted -->
+<!ENTITY Gg               "&#x022D9;" ><!--/ggg /Gg /gggtr R: triple gtr-than -->
+<!ENTITY gl               "&#x02277;" ><!--/gtrless R: greater, less -->
+<!ENTITY gla              "&#x02AA5;" ><!--greater, less, apart -->
+<!ENTITY glE              "&#x02A92;" ><!--greater, less, equal -->
+<!ENTITY glj              "&#x02AA4;" ><!--greater, less, overlapping -->
+<!ENTITY gsim             "&#x02273;" ><!--/gtrsim R: greater, similar -->
+<!ENTITY gsime            "&#x02A8E;" ><!--greater, similar, equal -->
+<!ENTITY gsiml            "&#x02A90;" ><!--greater, similar, less -->
+<!ENTITY Gt               "&#x0226B;" ><!--/gg R: dbl greater-than sign -->
+<!ENTITY gtcc             "&#x02AA7;" ><!--greater than, closed by curve -->
+<!ENTITY gtcir            "&#x02A7A;" ><!--greater than, circle inside -->
+<!ENTITY gtdot            "&#x022D7;" ><!--/gtrdot R: greater than, with dot -->
+<!ENTITY gtquest          "&#x02A7C;" ><!--greater than, questionmark above -->
+<!ENTITY gtrarr           "&#x02978;" ><!--greater than, right arrow -->
+<!ENTITY homtht           "&#x0223B;" ><!--homothetic -->
+<!ENTITY lap              "&#x02272;" ><!--/lessapprox R: less, approximate -->
+<!ENTITY lat              "&#x02AAB;" ><!--larger than -->
+<!ENTITY late             "&#x02AAD;" ><!--larger than or equal -->
+<!ENTITY lates            "&#x02AAD;&#x02063;" ><!--larger than or equal, slanted -->
+<!ENTITY lE               "&#x02266;" ><!--/leqq R: less, double equals -->
+<!ENTITY leg              "&#x022DA;" ><!--/lesseqgtr R: less, eq, greater -->
+<!ENTITY lEg              "&#x022DA;" ><!--/lesseqqgtr R: less, dbl eq, greater -->
+<!ENTITY les              "&#x02A7D;" ><!--/leqslant R: less-than-or-eq, slant -->
+<!ENTITY lescc            "&#x02AA8;" ><!--less than, closed by curve, equal, slanted -->
+<!ENTITY lesdot           "&#x02A7F;" ><!--less-than-or-equal, slanted, dot inside -->
+<!ENTITY lesdoto          "&#x02A81;" ><!--less-than-or-equal, slanted, dot above -->
+<!ENTITY lesdotor         "&#x02A83;" ><!--less-than-or-equal, slanted, dot above right -->
+<!ENTITY lesg             "&#x022DA;&#x02063;" ><!--less, equal, slanted, greater -->
+<!ENTITY lesges           "&#x02A93;" ><!--less, equal, slanted, greater, equal, slanted -->
+<!ENTITY lg               "&#x02276;" ><!--/lessgtr R: less, greater -->
+<!ENTITY lgE              "&#x02A91;" ><!--less, greater, equal -->
+<!ENTITY Ll               "&#x022D8;" ><!--/Ll /lll /llless R: triple less-than -->
+<!ENTITY lsim             "&#x02272;" ><!--/lesssim R: less, similar -->
+<!ENTITY lsime            "&#x02A8D;" ><!--less, similar, equal -->
+<!ENTITY lsimg            "&#x02A8F;" ><!--less, similar, greater -->
+<!ENTITY Lt               "&#x0226A;" ><!--/ll R: double less-than sign -->
+<!ENTITY ltcc             "&#x02AA6;" ><!--less than, closed by curve -->
+<!ENTITY ltcir            "&#x02A79;" ><!--less than, circle inside -->
+<!ENTITY ltdot            "&#x022D6;" ><!--/lessdot R: less than, with dot -->
+<!ENTITY ltlarr           "&#x02976;" ><!--less than, left arrow -->
+<!ENTITY ltquest          "&#x02A7B;" ><!--less than, questionmark above -->
+<!ENTITY ltrie            "&#x022B4;" ><!--/trianglelefteq R: left triangle, eq -->
+<!ENTITY mcomma           "&#x02A29;" ><!--minus, comma above -->
+<!ENTITY mDDot            "&#x0223A;" ><!--minus with four dots, geometric properties -->
+<!ENTITY mid              "&#x02223;" ><!--/mid R: -->
+<!ENTITY mlcp             "&#x02ADB;" ><!--/mlcp -->
+<!ENTITY models           "&#x022A7;" ><!--/models R: -->
+<!ENTITY mstpos           "&#x0223E;" ><!--most positive -->
+<!ENTITY pr               "&#x0227A;" ><!--/prec R: precedes -->
+<!ENTITY Pr               "&#x02ABB;" ><!--dbl precedes -->
+<!ENTITY prap             "&#x0227E;" ><!--/precapprox R: precedes, approximate -->
+<!ENTITY prcue            "&#x0227C;" ><!--/preccurlyeq R: precedes, curly eq -->
+<!ENTITY pre              "&#x02AAF;" ><!--/preceq R: precedes, equals -->
+<!ENTITY prE              "&#x02AAF;" ><!--precedes, dbl equals -->
+<!ENTITY prsim            "&#x0227E;" ><!--/precsim R: precedes, similar -->
+<!ENTITY prurel           "&#x022B0;" ><!--element precedes under relation -->
+<!ENTITY ratio            "&#x02236;" ><!--/ratio -->
+<!ENTITY rtrie            "&#x022B5;" ><!--/trianglerighteq R: right tri, eq -->
+<!ENTITY rtriltri         "&#x029CE;" ><!--right triangle above left triangle -->
+<!ENTITY sc               "&#x0227B;" ><!--/succ R: succeeds -->
+<!ENTITY Sc               "&#x02ABC;" ><!--dbl succeeds -->
+<!ENTITY scap             "&#x0227F;" ><!--/succapprox R: succeeds, approximate -->
+<!ENTITY sccue            "&#x0227D;" ><!--/succcurlyeq R: succeeds, curly eq -->
+<!ENTITY sce              "&#x0227D;" ><!--/succeq R: succeeds, equals -->
+<!ENTITY scE              "&#x0227E;" ><!--succeeds, dbl equals -->
+<!ENTITY scsim            "&#x0227F;" ><!--/succsim R: succeeds, similar -->
+<!ENTITY sdote            "&#x02A66;" ><!--equal, dot below -->
+<!ENTITY simg             "&#x02A9E;" ><!--similar, greater -->
+<!ENTITY simgE            "&#x02AA0;" ><!--similar, greater, equal -->
+<!ENTITY siml             "&#x02A9D;" ><!--similar, less -->
+<!ENTITY simlE            "&#x02A9F;" ><!--similar, less, equal -->
+<!ENTITY smid             "&#x02223;&#x02063;" ><!--/shortmid R: -->
+<!ENTITY smile            "&#x02323;" ><!--/smile R: up curve -->
+<!ENTITY smt              "&#x02AAA;" ><!--smaller than -->
+<!ENTITY smte             "&#x02AAC;" ><!--smaller than or equal -->
+<!ENTITY smtes            "&#x02AAC;&#x02063;" ><!--smaller than or equal, slanted -->
+<!ENTITY spar             "&#x02225;&#x02063;" ><!--/shortparallel R: short parallel -->
+<!ENTITY sqsub            "&#x0228F;" ><!--/sqsubset R: square subset -->
+<!ENTITY sqsube           "&#x02291;" ><!--/sqsubseteq R: square subset, equals -->
+<!ENTITY sqsup            "&#x02290;" ><!--/sqsupset R: square superset -->
+<!ENTITY sqsupe           "&#x02292;" ><!--/sqsupseteq R: square superset, eq -->
+<!ENTITY Sub              "&#x022D0;" ><!--/Subset R: double subset -->
+<!ENTITY subE             "&#x02286;" ><!--/subseteqq R: subset, dbl equals -->
+<!ENTITY subedot          "&#x02AC3;" ><!--subset, equals, dot -->
+<!ENTITY submult          "&#x02AC1;" ><!--subset, multiply -->
+<!ENTITY subplus          "&#x02ABF;" ><!--subset, plus -->
+<!ENTITY subrarr          "&#x02979;" ><!--subset, right arrow -->
+<!ENTITY subsim           "&#x02AC7;" ><!--subset, similar -->
+<!ENTITY subsub           "&#x02AD5;" ><!--subset above subset -->
+<!ENTITY subsup           "&#x02AD3;" ><!--subset above superset -->
+<!ENTITY Sup              "&#x022D1;" ><!--/Supset R: dbl superset -->
+<!ENTITY supdsub          "&#x02AD8;" ><!--superset, subset, dash joining them -->
+<!ENTITY supE             "&#x02287;" ><!--/supseteqq R: superset, dbl equals -->
+<!ENTITY supedot          "&#x02AC4;" ><!--superset, equals, dot -->
+<!ENTITY suphsol          "&#x02283;&#x0002F;" ><!--superset, solidus -->
+<!ENTITY suphsub          "&#x02AD7;" ><!--superset, subset -->
+<!ENTITY suplarr          "&#x0297B;" ><!--superset, left arrow -->
+<!ENTITY supmult          "&#x02AC2;" ><!--superset, multiply -->
+<!ENTITY supplus          "&#x02AC0;" ><!--superset, plus -->
+<!ENTITY supsim           "&#x02AC8;" ><!--superset, similar -->
+<!ENTITY supsub           "&#x02AD4;" ><!--superset above subset -->
+<!ENTITY supsup           "&#x02AD6;" ><!--superset above superset -->
+<!ENTITY thkap            "&#x02248;&#x02063;" ><!--/thickapprox R: thick approximate -->
+<!ENTITY thksim           "&#x0223C;" ><!--/thicksim R: thick similar -->
+<!ENTITY topfork          "&#x02ADA;" ><!--fork with top -->
+<!ENTITY trie             "&#x0225C;" ><!--/triangleq R: triangle, equals -->
+<!ENTITY twixt            "&#x0226C;" ><!--/between R: between -->
+<!ENTITY vBar             "&#x02AE8;" ><!--vert, dbl bar (under) -->
+<!ENTITY Vbar             "&#x02AEB;" ><!--dbl vert, bar (under) -->
+<!ENTITY vBarv            "&#x02AE9;" ><!--dbl bar, vert over and under -->
+<!ENTITY vdash            "&#x022A2;" ><!--/vdash R: vertical, dash -->
+<!ENTITY vDash            "&#x022A8;" ><!--/vDash R: vertical, dbl dash -->
+<!ENTITY Vdash            "&#x022A9;" ><!--/Vdash R: dbl vertical, dash -->
+<!ENTITY VDash            "&#x022AB;" ><!--dbl vert, dbl dash -->
+<!ENTITY Vdashl           "&#x02AE6;" ><!--vertical, dash (long) -->
+<!ENTITY vltri            "&#x022B2;" ><!--/vartriangleleft R: l tri, open, var -->
+<!ENTITY vprop            "&#x0221D;" ><!--/varpropto R: proportional, variant -->
+<!ENTITY vrtri            "&#x022B3;" ><!--/vartriangleright R: r tri, open, var -->
+<!ENTITY Vvdash           "&#x022AA;" ><!--/Vvdash R: triple vertical, dash -->
diff --git a/helm/dtd/isobox.ent b/helm/dtd/isobox.ent
new file mode 100644 (file)
index 0000000..630edc5
--- /dev/null
@@ -0,0 +1,67 @@
+
+<!--
+     File isobox.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY boxdl            "&#x02510;" ><!--lower left quadrant -->
+<!ENTITY boxdL            "&#x02555;" ><!--lower left quadrant -->
+<!ENTITY boxDl            "&#x02556;" ><!--lower left quadrant -->
+<!ENTITY boxDL            "&#x02557;" ><!--lower left quadrant -->
+<!ENTITY boxdr            "&#x0250C;" ><!--lower right quadrant -->
+<!ENTITY boxdR            "&#x02552;" ><!--lower right quadrant -->
+<!ENTITY boxDr            "&#x02553;" ><!--lower right quadrant -->
+<!ENTITY boxDR            "&#x02554;" ><!--lower right quadrant -->
+<!ENTITY boxh             "&#x02500;" ><!--horizontal line  -->
+<!ENTITY boxH             "&#x02550;" ><!--horizontal line -->
+<!ENTITY boxhd            "&#x0252C;" ><!--lower left and right quadrants -->
+<!ENTITY boxhD            "&#x02565;" ><!--lower left and right quadrants -->
+<!ENTITY boxHd            "&#x02564;" ><!--lower left and right quadrants -->
+<!ENTITY boxHD            "&#x02566;" ><!--lower left and right quadrants -->
+<!ENTITY boxhu            "&#x02534;" ><!--upper left and right quadrants -->
+<!ENTITY boxhU            "&#x02568;" ><!--upper left and right quadrants -->
+<!ENTITY boxHu            "&#x02567;" ><!--upper left and right quadrants -->
+<!ENTITY boxHU            "&#x02569;" ><!--upper left and right quadrants -->
+<!ENTITY boxul            "&#x02518;" ><!--upper left quadrant -->
+<!ENTITY boxuL            "&#x0255B;" ><!--upper left quadrant -->
+<!ENTITY boxUl            "&#x0255C;" ><!--upper left quadrant -->
+<!ENTITY boxUL            "&#x0255D;" ><!--upper left quadrant -->
+<!ENTITY boxur            "&#x02514;" ><!--upper right quadrant -->
+<!ENTITY boxuR            "&#x02558;" ><!--upper right quadrant -->
+<!ENTITY boxUr            "&#x02559;" ><!--upper right quadrant -->
+<!ENTITY boxUR            "&#x0255A;" ><!--upper right quadrant -->
+<!ENTITY boxv             "&#x02502;" ><!--vertical line -->
+<!ENTITY boxV             "&#x02551;" ><!--vertical line -->
+<!ENTITY boxvh            "&#x0253C;" ><!--all four quadrants -->
+<!ENTITY boxvH            "&#x0256A;" ><!--all four quadrants -->
+<!ENTITY boxVh            "&#x0256B;" ><!--all four quadrants -->
+<!ENTITY boxVH            "&#x0256C;" ><!--all four quadrants -->
+<!ENTITY boxvl            "&#x02524;" ><!--upper and lower left quadrants -->
+<!ENTITY boxvL            "&#x02561;" ><!--upper and lower left quadrants -->
+<!ENTITY boxVl            "&#x02562;" ><!--upper and lower left quadrants -->
+<!ENTITY boxVL            "&#x02563;" ><!--upper and lower left quadrants -->
+<!ENTITY boxvr            "&#x0251C;" ><!--upper and lower right quadrants -->
+<!ENTITY boxvR            "&#x0255E;" ><!--upper and lower right quadrants -->
+<!ENTITY boxVr            "&#x0255F;" ><!--upper and lower right quadrants -->
+<!ENTITY boxVR            "&#x02560;" ><!--upper and lower right quadrants -->
diff --git a/helm/dtd/isocyr1.ent b/helm/dtd/isocyr1.ent
new file mode 100644 (file)
index 0000000..4bcc9e4
--- /dev/null
@@ -0,0 +1,94 @@
+
+<!--
+     File isocyr1.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY acy              "&#x00430;" ><!--=small a, Cyrillic -->
+<!ENTITY Acy              "&#x00410;" ><!--=capital A, Cyrillic -->
+<!ENTITY bcy              "&#x00431;" ><!--=small be, Cyrillic -->
+<!ENTITY Bcy              "&#x00411;" ><!--=capital BE, Cyrillic -->
+<!ENTITY chcy             "&#x00447;" ><!--=small che, Cyrillic -->
+<!ENTITY CHcy             "&#x00427;" ><!--=capital CHE, Cyrillic -->
+<!ENTITY dcy              "&#x00434;" ><!--=small de, Cyrillic -->
+<!ENTITY Dcy              "&#x00414;" ><!--=capital DE, Cyrillic -->
+<!ENTITY ecy              "&#x0044D;" ><!--=small e, Cyrillic -->
+<!ENTITY Ecy              "&#x0042D;" ><!--=capital E, Cyrillic -->
+<!ENTITY fcy              "&#x00444;" ><!--=small ef, Cyrillic -->
+<!ENTITY Fcy              "&#x00424;" ><!--=capital EF, Cyrillic -->
+<!ENTITY gcy              "&#x00433;" ><!--=small ghe, Cyrillic -->
+<!ENTITY Gcy              "&#x00413;" ><!--=capital GHE, Cyrillic -->
+<!ENTITY hardcy           "&#x0044A;" ><!--=small hard sign, Cyrillic -->
+<!ENTITY HARDcy           "&#x0042A;" ><!--=capital HARD sign, Cyrillic -->
+<!ENTITY icy              "&#x00438;" ><!--=small i, Cyrillic -->
+<!ENTITY Icy              "&#x00418;" ><!--=capital I, Cyrillic -->
+<!ENTITY iecy             "&#x00435;" ><!--=small ie, Cyrillic -->
+<!ENTITY IEcy             "&#x00415;" ><!--=capital IE, Cyrillic -->
+<!ENTITY iocy             "&#x00451;" ><!--=small io, Russian -->
+<!ENTITY IOcy             "&#x00401;" ><!--=capital IO, Russian -->
+<!ENTITY jcy              "&#x00439;" ><!--=small short i, Cyrillic -->
+<!ENTITY Jcy              "&#x00419;" ><!--=capital short I, Cyrillic -->
+<!ENTITY kcy              "&#x0043A;" ><!--=small ka, Cyrillic -->
+<!ENTITY Kcy              "&#x0041A;" ><!--=capital KA, Cyrillic -->
+<!ENTITY khcy             "&#x00445;" ><!--=small ha, Cyrillic -->
+<!ENTITY KHcy             "&#x00425;" ><!--=capital HA, Cyrillic -->
+<!ENTITY lcy              "&#x0043B;" ><!--=small el, Cyrillic -->
+<!ENTITY Lcy              "&#x0041B;" ><!--=capital EL, Cyrillic -->
+<!ENTITY mcy              "&#x0043C;" ><!--=small em, Cyrillic -->
+<!ENTITY Mcy              "&#x0041C;" ><!--=capital EM, Cyrillic -->
+<!ENTITY ncy              "&#x0043D;" ><!--=small en, Cyrillic -->
+<!ENTITY Ncy              "&#x0041D;" ><!--=capital EN, Cyrillic -->
+<!ENTITY numero           "&#x02116;" ><!--=numero sign -->
+<!ENTITY ocy              "&#x0043E;" ><!--=small o, Cyrillic -->
+<!ENTITY Ocy              "&#x0041E;" ><!--=capital O, Cyrillic -->
+<!ENTITY pcy              "&#x0043F;" ><!--=small pe, Cyrillic -->
+<!ENTITY Pcy              "&#x0041F;" ><!--=capital PE, Cyrillic -->
+<!ENTITY rcy              "&#x00440;" ><!--=small er, Cyrillic -->
+<!ENTITY Rcy              "&#x00420;" ><!--=capital ER, Cyrillic -->
+<!ENTITY scy              "&#x00441;" ><!--=small es, Cyrillic -->
+<!ENTITY Scy              "&#x00421;" ><!--=capital ES, Cyrillic -->
+<!ENTITY shchcy           "&#x00449;" ><!--=small shcha, Cyrillic -->
+<!ENTITY SHCHcy           "&#x00429;" ><!--=capital SHCHA, Cyrillic -->
+<!ENTITY shcy             "&#x00448;" ><!--=small sha, Cyrillic -->
+<!ENTITY SHcy             "&#x00428;" ><!--=capital SHA, Cyrillic -->
+<!ENTITY softcy           "&#x0044C;" ><!--=small soft sign, Cyrillic -->
+<!ENTITY SOFTcy           "&#x0042C;" ><!--=capital SOFT sign, Cyrillic -->
+<!ENTITY tcy              "&#x00442;" ><!--=small te, Cyrillic -->
+<!ENTITY Tcy              "&#x00422;" ><!--=capital TE, Cyrillic -->
+<!ENTITY tscy             "&#x00446;" ><!--=small tse, Cyrillic -->
+<!ENTITY TScy             "&#x00426;" ><!--=capital TSE, Cyrillic -->
+<!ENTITY ucy              "&#x00443;" ><!--=small u, Cyrillic -->
+<!ENTITY Ucy              "&#x00423;" ><!--=capital U, Cyrillic -->
+<!ENTITY vcy              "&#x00432;" ><!--=small ve, Cyrillic -->
+<!ENTITY Vcy              "&#x00412;" ><!--=capital VE, Cyrillic -->
+<!ENTITY yacy             "&#x0044F;" ><!--=small ya, Cyrillic -->
+<!ENTITY YAcy             "&#x0042F;" ><!--=capital YA, Cyrillic -->
+<!ENTITY ycy              "&#x0044B;" ><!--=small yeru, Cyrillic -->
+<!ENTITY Ycy              "&#x0042B;" ><!--=capital YERU, Cyrillic -->
+<!ENTITY yucy             "&#x0044E;" ><!--=small yu, Cyrillic -->
+<!ENTITY YUcy             "&#x0042E;" ><!--=capital YU, Cyrillic -->
+<!ENTITY zcy              "&#x00437;" ><!--=small ze, Cyrillic -->
+<!ENTITY Zcy              "&#x00417;" ><!--=capital ZE, Cyrillic -->
+<!ENTITY zhcy             "&#x00436;" ><!--=small zhe, Cyrillic -->
+<!ENTITY ZHcy             "&#x00416;" ><!--=capital ZHE, Cyrillic -->
diff --git a/helm/dtd/isocyr2.ent b/helm/dtd/isocyr2.ent
new file mode 100644 (file)
index 0000000..67c477b
--- /dev/null
@@ -0,0 +1,53 @@
+
+<!--
+     File isocyr2.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY djcy             "&#x00452;" ><!--=small dje, Serbian -->
+<!ENTITY DJcy             "&#x00402;" ><!--=capital DJE, Serbian -->
+<!ENTITY dscy             "&#x00455;" ><!--=small dse, Macedonian -->
+<!ENTITY DScy             "&#x00405;" ><!--=capital DSE, Macedonian -->
+<!ENTITY dzcy             "&#x0045F;" ><!--=small dze, Serbian -->
+<!ENTITY DZcy             "&#x0040F;" ><!--=capital dze, Serbian -->
+<!ENTITY gjcy             "&#x00453;" ><!--=small gje, Macedonian -->
+<!ENTITY GJcy             "&#x00403;" ><!--=capital GJE Macedonian -->
+<!ENTITY iukcy            "&#x00456;" ><!--=small i, Ukrainian -->
+<!ENTITY Iukcy            "&#x00406;" ><!--=capital I, Ukrainian -->
+<!ENTITY jsercy           "&#x00458;" ><!--=small je, Serbian -->
+<!ENTITY Jsercy           "&#x00408;" ><!--=capital JE, Serbian -->
+<!ENTITY jukcy            "&#x00454;" ><!--=small je, Ukrainian -->
+<!ENTITY Jukcy            "&#x00404;" ><!--=capital JE, Ukrainian -->
+<!ENTITY kjcy             "&#x0045C;" ><!--=small kje Macedonian -->
+<!ENTITY KJcy             "&#x0040C;" ><!--=capital KJE, Macedonian -->
+<!ENTITY ljcy             "&#x00459;" ><!--=small lje, Serbian -->
+<!ENTITY LJcy             "&#x00409;" ><!--=capital LJE, Serbian -->
+<!ENTITY njcy             "&#x0045A;" ><!--=small nje, Serbian -->
+<!ENTITY NJcy             "&#x0040A;" ><!--=capital NJE, Serbian -->
+<!ENTITY tshcy            "&#x0045B;" ><!--=small tshe, Serbian -->
+<!ENTITY TSHcy            "&#x0040B;" ><!--=capital TSHE, Serbian -->
+<!ENTITY ubrcy            "&#x0045E;" ><!--=small u, Byelorussian -->
+<!ENTITY Ubrcy            "&#x0040E;" ><!--=capital U, Byelorussian -->
+<!ENTITY yicy             "&#x00457;" ><!--=small yi, Ukrainian -->
+<!ENTITY YIcy             "&#x00407;" ><!--=capital YI, Ukrainian -->
diff --git a/helm/dtd/isodia.ent b/helm/dtd/isodia.ent
new file mode 100644 (file)
index 0000000..ba64963
--- /dev/null
@@ -0,0 +1,41 @@
+
+<!--
+     File isodia.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY acute            "&#x000B4;" ><!--=acute accent -->
+<!ENTITY breve            "&#x002D8;" ><!--=breve -->
+<!ENTITY caron            "&#x002C7;" ><!--=caron -->
+<!ENTITY cedil            "&#x000B8;" ><!--=cedilla -->
+<!ENTITY circ             "&#x0005E;" ><!--circumflex accent -->
+<!ENTITY dblac            "&#x002DD;" ><!--=double acute accent -->
+<!ENTITY die              "&#x000A8;" ><!--=dieresis -->
+<!ENTITY dot              "&#x002D9;" ><!--=dot above -->
+<!ENTITY grave            "&#x00060;" ><!--=grave accent -->
+<!ENTITY macr             "&#x000AF;" ><!--=macron -->
+<!ENTITY ogon             "&#x002DB;" ><!--=ogonek -->
+<!ENTITY ring             "&#x002DA;" ><!--=ring -->
+<!ENTITY tilde            "&#x002DC;" ><!--=tilde -->
+<!ENTITY uml              "&#x000A8;" ><!--=umlaut mark -->
diff --git a/helm/dtd/isogrk3.ent b/helm/dtd/isogrk3.ent
new file mode 100644 (file)
index 0000000..fa03355
--- /dev/null
@@ -0,0 +1,70 @@
+
+<!--
+     File isogrk3.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY alpha            "&#x003B1;" ><!--/alpha small alpha, Greek -->
+<!ENTITY beta             "&#x003B2;" ><!--/beta small beta, Greek -->
+<!ENTITY chi              "&#x003C7;" ><!--/chi small chi, Greek -->
+<!ENTITY delta            "&#x003B4;" ><!--/delta small delta, Greek -->
+<!ENTITY Delta            "&#x00394;" ><!--/Delta capital Delta, Greek -->
+<!ENTITY epsi             "&#x003B5;" ><!--/straightepsilon, small epsilon, Greek -->
+<!ENTITY epsiv            "&#x0025B;" ><!--/varepsilon -->
+<!ENTITY eta              "&#x003B7;" ><!--/eta small eta, Greek -->
+<!ENTITY gamma            "&#x003B3;" ><!--/gamma small gamma, Greek -->
+<!ENTITY Gamma            "&#x00393;" ><!--/Gamma capital Gamma, Greek -->
+<!ENTITY gammad           "&#x003DC;" ><!--/digamma -->
+<!ENTITY Gammad           "&#x003DC;" ><!--capital digamma -->
+<!ENTITY iota             "&#x003B9;" ><!--/iota small iota, Greek -->
+<!ENTITY kappa            "&#x003BA;" ><!--/kappa small kappa, Greek -->
+<!ENTITY kappav           "&#x003F0;" ><!--/varkappa -->
+<!ENTITY lambda           "&#x003BB;" ><!--/lambda small lambda, Greek -->
+<!ENTITY Lambda           "&#x0039B;" ><!--/Lambda capital Lambda, Greek -->
+<!ENTITY mu               "&#x003BC;" ><!--/mu small mu, Greek -->
+<!ENTITY nu               "&#x003BD;" ><!--/nu small nu, Greek -->
+<!ENTITY omega            "&#x003C9;" ><!--/omega small omega, Greek -->
+<!ENTITY Omega            "&#x003A9;" ><!--/Omega capital Omega, Greek -->
+<!ENTITY phi              "&#x003C6;" ><!--/straightphi - small phi, Greek -->
+<!ENTITY Phi              "&#x003A6;" ><!--/Phi capital Phi, Greek -->
+<!ENTITY phiv             "&#x003D5;" ><!--/varphi - curly or open phi -->
+<!ENTITY pi               "&#x003C0;" ><!--/pi small pi, Greek -->
+<!ENTITY Pi               "&#x003A0;" ><!--/Pi capital Pi, Greek -->
+<!ENTITY piv              "&#x003D6;" ><!--/varpi -->
+<!ENTITY psi              "&#x003C8;" ><!--/psi small psi, Greek -->
+<!ENTITY Psi              "&#x003A8;" ><!--/Psi capital Psi, Greek -->
+<!ENTITY rho              "&#x003C1;" ><!--/rho small rho, Greek -->
+<!ENTITY rhov             "&#x003F1;" ><!--/varrho -->
+<!ENTITY sigma            "&#x003C3;" ><!--/sigma small sigma, Greek -->
+<!ENTITY Sigma            "&#x003A3;" ><!--/Sigma capital Sigma, Greek -->
+<!ENTITY sigmav           "&#x003C2;" ><!--/varsigma -->
+<!ENTITY tau              "&#x003C4;" ><!--/tau small tau, Greek -->
+<!ENTITY theta            "&#x003B8;" ><!--/theta straight theta, small theta, Greek -->
+<!ENTITY Theta            "&#x00398;" ><!--/Theta capital Theta, Greek -->
+<!ENTITY thetav           "&#x003D1;" ><!--/vartheta - curly or open theta -->
+<!ENTITY upsi             "&#x003C5;" ><!--/upsilon small upsilon, Greek -->
+<!ENTITY Upsi             "&#x003D2;" ><!--/Upsilon capital Upsilon, Greek -->
+<!ENTITY xi               "&#x003BE;" ><!--/xi small xi, Greek -->
+<!ENTITY Xi               "&#x0039E;" ><!--/Xi capital Xi, Greek -->
+<!ENTITY zeta             "&#x003B6;" ><!--/zeta small zeta, Greek -->
diff --git a/helm/dtd/isolat1.ent b/helm/dtd/isolat1.ent
new file mode 100644 (file)
index 0000000..849d360
--- /dev/null
@@ -0,0 +1,89 @@
+
+<!--
+     File isolat1.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY aacute           "&#x000E1;" ><!--=small a, acute accent -->
+<!ENTITY Aacute           "&#x000C1;" ><!--=capital A, acute accent -->
+<!ENTITY acirc            "&#x000E2;" ><!--=small a, circumflex accent -->
+<!ENTITY Acirc            "&#x000C2;" ><!--=capital A, circumflex accent -->
+<!ENTITY aelig            "&#x000E6;" ><!--=small ae diphthong (ligature) -->
+<!ENTITY AElig            "&#x000C6;" ><!--=capital AE diphthong (ligature) -->
+<!ENTITY agrave           "&#x000E0;" ><!--=small a, grave accent -->
+<!ENTITY Agrave           "&#x000C0;" ><!--=capital A, grave accent -->
+<!ENTITY aring            "&#x000E5;" ><!--=small a, ring -->
+<!ENTITY Aring            "&#x000C5;" ><!--=capital A, ring -->
+<!ENTITY atilde           "&#x000E3;" ><!--=small a, tilde -->
+<!ENTITY Atilde           "&#x000C3;" ><!--=capital A, tilde -->
+<!ENTITY auml             "&#x000E4;" ><!--=small a, dieresis or umlaut mark -->
+<!ENTITY Auml             "&#x000C4;" ><!--=capital A, dieresis or umlaut mark -->
+<!ENTITY ccedil           "&#x000E7;" ><!--=small c, cedilla -->
+<!ENTITY Ccedil           "&#x000C7;" ><!--=capital C, cedilla -->
+<!ENTITY eacute           "&#x000E9;" ><!--=small e, acute accent -->
+<!ENTITY Eacute           "&#x000C9;" ><!--=capital E, acute accent -->
+<!ENTITY ecirc            "&#x000EA;" ><!--=small e, circumflex accent -->
+<!ENTITY Ecirc            "&#x000CA;" ><!--=capital E, circumflex accent -->
+<!ENTITY egrave           "&#x000E8;" ><!--=small e, grave accent -->
+<!ENTITY Egrave           "&#x000C8;" ><!--=capital E, grave accent -->
+<!ENTITY eth              "&#x000F0;" ><!--=small eth, Icelandic -->
+<!ENTITY ETH              "&#x000D0;" ><!--=capital Eth, Icelandic -->
+<!ENTITY euml             "&#x000EB;" ><!--=small e, dieresis or umlaut mark -->
+<!ENTITY Euml             "&#x000CB;" ><!--=capital E, dieresis or umlaut mark -->
+<!ENTITY iacute           "&#x000ED;" ><!--=small i, acute accent -->
+<!ENTITY Iacute           "&#x000CD;" ><!--=capital I, acute accent -->
+<!ENTITY icirc            "&#x000EE;" ><!--=small i, circumflex accent -->
+<!ENTITY Icirc            "&#x000CE;" ><!--=capital I, circumflex accent -->
+<!ENTITY igrave           "&#x000EC;" ><!--=small i, grave accent -->
+<!ENTITY Igrave           "&#x000CC;" ><!--=capital I, grave accent -->
+<!ENTITY iuml             "&#x000EF;" ><!--=small i, dieresis or umlaut mark -->
+<!ENTITY Iuml             "&#x000CF;" ><!--=capital I, dieresis or umlaut mark -->
+<!ENTITY ntilde           "&#x000F1;" ><!--=small n, tilde -->
+<!ENTITY Ntilde           "&#x000D1;" ><!--=capital N, tilde -->
+<!ENTITY oacute           "&#x000F3;" ><!--=small o, acute accent -->
+<!ENTITY Oacute           "&#x000D3;" ><!--=capital O, acute accent -->
+<!ENTITY ocirc            "&#x000F4;" ><!--=small o, circumflex accent -->
+<!ENTITY Ocirc            "&#x000D4;" ><!--=capital O, circumflex accent -->
+<!ENTITY ograve           "&#x000F2;" ><!--=small o, grave accent -->
+<!ENTITY Ograve           "&#x000D2;" ><!--=capital O, grave accent -->
+<!ENTITY oslash           "&#x000F8;" ><!--latin small letter o with stroke -->
+<!ENTITY Oslash           "&#x000D8;" ><!--=capital O, slash -->
+<!ENTITY otilde           "&#x000F5;" ><!--=small o, tilde -->
+<!ENTITY Otilde           "&#x000D5;" ><!--=capital O, tilde -->
+<!ENTITY ouml             "&#x000F6;" ><!--=small o, dieresis or umlaut mark -->
+<!ENTITY Ouml             "&#x000D6;" ><!--=capital O, dieresis or umlaut mark -->
+<!ENTITY szlig            "&#x000DF;" ><!--=small sharp s, German (sz ligature) -->
+<!ENTITY thorn            "&#x000FE;" ><!--=small thorn, Icelandic -->
+<!ENTITY THORN            "&#x000DE;" ><!--=capital THORN, Icelandic -->
+<!ENTITY uacute           "&#x000FA;" ><!--=small u, acute accent -->
+<!ENTITY Uacute           "&#x000DA;" ><!--=capital U, acute accent -->
+<!ENTITY ucirc            "&#x000FB;" ><!--=small u, circumflex accent -->
+<!ENTITY Ucirc            "&#x000DB;" ><!--=capital U, circumflex accent -->
+<!ENTITY ugrave           "&#x000F9;" ><!--=small u, grave accent -->
+<!ENTITY Ugrave           "&#x000D9;" ><!--=capital U, grave accent -->
+<!ENTITY uuml             "&#x000FC;" ><!--=small u, dieresis or umlaut mark -->
+<!ENTITY Uuml             "&#x000DC;" ><!--=capital U, dieresis or umlaut mark -->
+<!ENTITY yacute           "&#x000FD;" ><!--=small y, acute accent -->
+<!ENTITY Yacute           "&#x000DD;" ><!--=capital Y, acute accent -->
+<!ENTITY yuml             "&#x000FF;" ><!--=small y, dieresis or umlaut mark -->
diff --git a/helm/dtd/isolat2.ent b/helm/dtd/isolat2.ent
new file mode 100644 (file)
index 0000000..3049be7
--- /dev/null
@@ -0,0 +1,148 @@
+
+<!--
+     File isolat2.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY abreve           "&#x00103;" ><!--=small a, breve -->
+<!ENTITY Abreve           "&#x00102;" ><!--=capital A, breve -->
+<!ENTITY amacr            "&#x00101;" ><!--=small a, macron -->
+<!ENTITY Amacr            "&#x00100;" ><!--=capital A, macron -->
+<!ENTITY aogon            "&#x00105;" ><!--=small a, ogonek -->
+<!ENTITY Aogon            "&#x00104;" ><!--=capital A, ogonek -->
+<!ENTITY cacute           "&#x00107;" ><!--=small c, acute accent -->
+<!ENTITY Cacute           "&#x00106;" ><!--=capital C, acute accent -->
+<!ENTITY ccaron           "&#x0010D;" ><!--=small c, caron -->
+<!ENTITY Ccaron           "&#x0010C;" ><!--=capital C, caron -->
+<!ENTITY ccirc            "&#x00109;" ><!--=small c, circumflex accent -->
+<!ENTITY Ccirc            "&#x00108;" ><!--=capital C, circumflex accent -->
+<!ENTITY cdot             "&#x0010B;" ><!--=small c, dot above -->
+<!ENTITY Cdot             "&#x0010A;" ><!--=capital C, dot above -->
+<!ENTITY dcaron           "&#x0010F;" ><!--=small d, caron -->
+<!ENTITY Dcaron           "&#x0010E;" ><!--=capital D, caron -->
+<!ENTITY dstrok           "&#x00111;" ><!--=small d, stroke -->
+<!ENTITY Dstrok           "&#x00110;" ><!--=capital D, stroke -->
+<!ENTITY ecaron           "&#x0011B;" ><!--=small e, caron -->
+<!ENTITY Ecaron           "&#x0011A;" ><!--=capital E, caron -->
+<!ENTITY edot             "&#x00117;" ><!--=small e, dot above -->
+<!ENTITY Edot             "&#x00116;" ><!--=capital E, dot above -->
+<!ENTITY emacr            "&#x00113;" ><!--=small e, macron -->
+<!ENTITY Emacr            "&#x00112;" ><!--=capital E, macron -->
+<!ENTITY eng              "&#x0014B;" ><!--=small eng, Lapp -->
+<!ENTITY ENG              "&#x0014A;" ><!--=capital ENG, Lapp -->
+<!ENTITY eogon            "&#x00119;" ><!--=small e, ogonek -->
+<!ENTITY Eogon            "&#x00118;" ><!--=capital E, ogonek -->
+<!ENTITY gacute           "&#x001F5;" ><!--=small g, acute accent -->
+<!ENTITY gbreve           "&#x0011F;" ><!--=small g, breve -->
+<!ENTITY Gbreve           "&#x0011E;" ><!--=capital G, breve -->
+<!ENTITY Gcedil           "&#x00122;" ><!--=capital G, cedilla -->
+<!ENTITY gcirc            "&#x0011D;" ><!--=small g, circumflex accent -->
+<!ENTITY Gcirc            "&#x0011C;" ><!--=capital G, circumflex accent -->
+<!ENTITY gdot             "&#x00121;" ><!--=small g, dot above -->
+<!ENTITY Gdot             "&#x00120;" ><!--=capital G, dot above -->
+<!ENTITY hcirc            "&#x00125;" ><!--=small h, circumflex accent -->
+<!ENTITY Hcirc            "&#x00124;" ><!--=capital H, circumflex accent -->
+<!ENTITY hstrok           "&#x00127;" ><!--=small h, stroke -->
+<!ENTITY Hstrok           "&#x00126;" ><!--=capital H, stroke -->
+<!ENTITY Idot             "&#x00130;" ><!--=capital I, dot above -->
+<!ENTITY ijlig            "&#x00133;" ><!--=small ij ligature -->
+<!ENTITY IJlig            "&#x00132;" ><!--=capital IJ ligature -->
+<!ENTITY imacr            "&#x0012B;" ><!--=small i, macron -->
+<!ENTITY Imacr            "&#x0012A;" ><!--=capital I, macron -->
+<!ENTITY inodot           "&#x00131;" ><!--=small i without dot -->
+<!ENTITY iogon            "&#x0012F;" ><!--=small i, ogonek -->
+<!ENTITY Iogon            "&#x0012E;" ><!--=capital I, ogonek -->
+<!ENTITY itilde           "&#x00129;" ><!--=small i, tilde -->
+<!ENTITY Itilde           "&#x00128;" ><!--=capital I, tilde -->
+<!ENTITY jcirc            "&#x00135;" ><!--=small j, circumflex accent -->
+<!ENTITY Jcirc            "&#x00134;" ><!--=capital J, circumflex accent -->
+<!ENTITY kcedil           "&#x00137;" ><!--=small k, cedilla -->
+<!ENTITY Kcedil           "&#x00136;" ><!--=capital K, cedilla -->
+<!ENTITY kgreen           "&#x00138;" ><!--=small k, Greenlandic -->
+<!ENTITY lacute           "&#x0013A;" ><!--=small l, acute accent -->
+<!ENTITY Lacute           "&#x00139;" ><!--=capital L, acute accent -->
+<!ENTITY lcaron           "&#x0013E;" ><!--=small l, caron -->
+<!ENTITY Lcaron           "&#x0013D;" ><!--=capital L, caron -->
+<!ENTITY lcedil           "&#x0013C;" ><!--=small l, cedilla -->
+<!ENTITY Lcedil           "&#x0013B;" ><!--=capital L, cedilla -->
+<!ENTITY lmidot           "&#x00140;" ><!--=small l, middle dot -->
+<!ENTITY Lmidot           "&#x0013F;" ><!--=capital L, middle dot -->
+<!ENTITY lstrok           "&#x00142;" ><!--=small l, stroke -->
+<!ENTITY Lstrok           "&#x00141;" ><!--=capital L, stroke -->
+<!ENTITY nacute           "&#x00144;" ><!--=small n, acute accent -->
+<!ENTITY Nacute           "&#x00143;" ><!--=capital N, acute accent -->
+<!ENTITY napos            "&#x00149;" ><!--=small n, apostrophe -->
+<!ENTITY ncaron           "&#x00148;" ><!--=small n, caron -->
+<!ENTITY Ncaron           "&#x00147;" ><!--=capital N, caron -->
+<!ENTITY ncedil           "&#x00146;" ><!--=small n, cedilla -->
+<!ENTITY Ncedil           "&#x00145;" ><!--=capital N, cedilla -->
+<!ENTITY odblac           "&#x00151;" ><!--=small o, double acute accent -->
+<!ENTITY Odblac           "&#x00150;" ><!--=capital O, double acute accent -->
+<!ENTITY oelig            "&#x00153;" ><!--=small oe ligature -->
+<!ENTITY OElig            "&#x00152;" ><!--=capital OE ligature -->
+<!ENTITY omacr            "&#x0014D;" ><!--=small o, macron -->
+<!ENTITY Omacr            "&#x0014C;" ><!--=capital O, macron -->
+<!ENTITY racute           "&#x00155;" ><!--=small r, acute accent -->
+<!ENTITY Racute           "&#x00154;" ><!--=capital R, acute accent -->
+<!ENTITY rcaron           "&#x00159;" ><!--=small r, caron -->
+<!ENTITY Rcaron           "&#x00158;" ><!--=capital R, caron -->
+<!ENTITY rcedil           "&#x00157;" ><!--=small r, cedilla -->
+<!ENTITY Rcedil           "&#x00156;" ><!--=capital R, cedilla -->
+<!ENTITY sacute           "&#x0015B;" ><!--=small s, acute accent -->
+<!ENTITY Sacute           "&#x0015A;" ><!--=capital S, acute accent -->
+<!ENTITY scaron           "&#x00161;" ><!--=small s, caron -->
+<!ENTITY Scaron           "&#x00160;" ><!--=capital S, caron -->
+<!ENTITY scedil           "&#x0015F;" ><!--=small s, cedilla -->
+<!ENTITY Scedil           "&#x0015E;" ><!--=capital S, cedilla -->
+<!ENTITY scirc            "&#x0015D;" ><!--=small s, circumflex accent -->
+<!ENTITY Scirc            "&#x0015C;" ><!--=capital S, circumflex accent -->
+<!ENTITY tcaron           "&#x00165;" ><!--=small t, caron -->
+<!ENTITY Tcaron           "&#x00164;" ><!--=capital T, caron -->
+<!ENTITY tcedil           "&#x00163;" ><!--=small t, cedilla -->
+<!ENTITY Tcedil           "&#x00162;" ><!--=capital T, cedilla -->
+<!ENTITY tstrok           "&#x00167;" ><!--=small t, stroke -->
+<!ENTITY Tstrok           "&#x00166;" ><!--=capital T, stroke -->
+<!ENTITY ubreve           "&#x0016D;" ><!--=small u, breve -->
+<!ENTITY Ubreve           "&#x0016C;" ><!--=capital U, breve -->
+<!ENTITY udblac           "&#x00171;" ><!--=small u, double acute accent -->
+<!ENTITY Udblac           "&#x00170;" ><!--=capital U, double acute accent -->
+<!ENTITY umacr            "&#x0016B;" ><!--=small u, macron -->
+<!ENTITY Umacr            "&#x0016A;" ><!--=capital U, macron -->
+<!ENTITY uogon            "&#x00173;" ><!--=small u, ogonek -->
+<!ENTITY Uogon            "&#x00172;" ><!--=capital U, ogonek -->
+<!ENTITY uring            "&#x0016F;" ><!--=small u, ring -->
+<!ENTITY Uring            "&#x0016E;" ><!--=capital U, ring -->
+<!ENTITY utilde           "&#x00169;" ><!--=small u, tilde -->
+<!ENTITY Utilde           "&#x00168;" ><!--=capital U, tilde -->
+<!ENTITY wcirc            "&#x00175;" ><!--=small w, circumflex accent -->
+<!ENTITY Wcirc            "&#x00174;" ><!--=capital W, circumflex accent -->
+<!ENTITY ycirc            "&#x00177;" ><!--=small y, circumflex accent -->
+<!ENTITY Ycirc            "&#x00176;" ><!--=capital Y, circumflex accent -->
+<!ENTITY Yuml             "&#x00178;" ><!--=capital Y, dieresis or umlaut mark -->
+<!ENTITY zacute           "&#x0017A;" ><!--=small z, acute accent -->
+<!ENTITY Zacute           "&#x00179;" ><!--=capital Z, acute accent -->
+<!ENTITY zcaron           "&#x0017E;" ><!--=small z, caron -->
+<!ENTITY Zcaron           "&#x0017D;" ><!--=capital Z, caron -->
+<!ENTITY zdot             "&#x0017C;" ><!--=small z, dot above -->
+<!ENTITY Zdot             "&#x0017B;" ><!--=capital Z, dot above -->
diff --git a/helm/dtd/isomfrk.ent b/helm/dtd/isomfrk.ent
new file mode 100644 (file)
index 0000000..d3d92aa
--- /dev/null
@@ -0,0 +1,79 @@
+
+<!--
+     File isomfrk.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY afr "<%mchar.qname; name='afr'/>" ><!--(1D51E)/frak a, lower case a -->
+<!ENTITY Afr "<%mchar.qname; name='Afr'/>" ><!--(1D504)/frak A, upper case a -->
+<!ENTITY bfr "<%mchar.qname; name='bfr'/>" ><!--(1D51F)/frak b, lower case b -->
+<!ENTITY Bfr "<%mchar.qname; name='Bfr'/>" ><!--(1D505)/frak B, upper case b -->
+<!ENTITY cfr "<%mchar.qname; name='cfr'/>" ><!--(1D520)/frak c, lower case c -->
+<!ENTITY Cfr "<%mchar.qname; name='Cfr'/>" ><!--(1D506)/frak C, upper case c -->
+<!ENTITY dfr "<%mchar.qname; name='dfr'/>" ><!--(1D521)/frak d, lower case d -->
+<!ENTITY Dfr "<%mchar.qname; name='Dfr'/>" ><!--(1D507)/frak D, upper case d -->
+<!ENTITY efr "<%mchar.qname; name='efr'/>" ><!--(1D522)/frak e, lower case e -->
+<!ENTITY Efr "<%mchar.qname; name='Efr'/>" ><!--(1D508)/frak E, upper case e -->
+<!ENTITY ffr "<%mchar.qname; name='ffr'/>" ><!--(1D523)/frak f, lower case f -->
+<!ENTITY Ffr "<%mchar.qname; name='Ffr'/>" ><!--(1D509)/frak F, upper case f -->
+<!ENTITY gfr "<%mchar.qname; name='gfr'/>" ><!--(1D524)/frak g, lower case g -->
+<!ENTITY Gfr "<%mchar.qname; name='Gfr'/>" ><!--(1D50A)/frak G, upper case g -->
+<!ENTITY hfr "<%mchar.qname; name='hfr'/>" ><!--(1D525)/frak h, lower case h -->
+<!ENTITY Hfr "<%mchar.qname; name='Hfr'/>" ><!--(1D50B)/frak H, upper case h -->
+<!ENTITY ifr "<%mchar.qname; name='ifr'/>" ><!--(1D526)/frak i, lower case i -->
+<!ENTITY Ifr "<%mchar.qname; name='Ifr'/>" ><!--(1D50C)/frak I, upper case i -->
+<!ENTITY jfr "<%mchar.qname; name='jfr'/>" ><!--(1D527)/frak j, lower case j -->
+<!ENTITY Jfr "<%mchar.qname; name='Jfr'/>" ><!--(1D50D)/frak J, upper case j -->
+<!ENTITY kfr "<%mchar.qname; name='kfr'/>" ><!--(1D528)/frak k, lower case k -->
+<!ENTITY Kfr "<%mchar.qname; name='Kfr'/>" ><!--(1D50E)/frak K, upper case k -->
+<!ENTITY lfr "<%mchar.qname; name='lfr'/>" ><!--(1D529)/frak l, lower case l -->
+<!ENTITY Lfr "<%mchar.qname; name='Lfr'/>" ><!--(1D50F)/frak L, upper case l -->
+<!ENTITY mfr "<%mchar.qname; name='mfr'/>" ><!--(1D52A)/frak m, lower case m -->
+<!ENTITY Mfr "<%mchar.qname; name='Mfr'/>" ><!--(1D510)/frak M, upper case m -->
+<!ENTITY nfr "<%mchar.qname; name='nfr'/>" ><!--(1D52B)/frak n, lower case n -->
+<!ENTITY Nfr "<%mchar.qname; name='Nfr'/>" ><!--(1D511)/frak N, upper case n -->
+<!ENTITY ofr "<%mchar.qname; name='ofr'/>" ><!--(1D52C)/frak o, lower case o -->
+<!ENTITY Ofr "<%mchar.qname; name='Ofr'/>" ><!--(1D512)/frak O, upper case o -->
+<!ENTITY pfr "<%mchar.qname; name='pfr'/>" ><!--(1D52D)/frak p, lower case p -->
+<!ENTITY Pfr "<%mchar.qname; name='Pfr'/>" ><!--(1D513)/frak P, upper case p -->
+<!ENTITY qfr "<%mchar.qname; name='qfr'/>" ><!--(1D52E)/frak q, lower case q -->
+<!ENTITY Qfr "<%mchar.qname; name='Qfr'/>" ><!--(1D514)/frak Q, upper case q -->
+<!ENTITY rfr "<%mchar.qname; name='rfr'/>" ><!--(1D52F)/frak r, lower case r -->
+<!ENTITY Rfr "<%mchar.qname; name='Rfr'/>" ><!--(1D515)/frak R, upper case r -->
+<!ENTITY sfr "<%mchar.qname; name='sfr'/>" ><!--(1D530)/frak s, lower case s -->
+<!ENTITY Sfr "<%mchar.qname; name='Sfr'/>" ><!--(1D516)/frak S, upper case s -->
+<!ENTITY tfr "<%mchar.qname; name='tfr'/>" ><!--(1D531)/frak t, lower case t -->
+<!ENTITY Tfr "<%mchar.qname; name='Tfr'/>" ><!--(1D517)/frak T, upper case t -->
+<!ENTITY ufr "<%mchar.qname; name='ufr'/>" ><!--(1D532)/frak u, lower case u -->
+<!ENTITY Ufr "<%mchar.qname; name='Ufr'/>" ><!--(1D518)/frak U, upper case u -->
+<!ENTITY vfr "<%mchar.qname; name='vfr'/>" ><!--(1D533)/frak v, lower case v -->
+<!ENTITY Vfr "<%mchar.qname; name='Vfr'/>" ><!--(1D519)/frak V, upper case v -->
+<!ENTITY wfr "<%mchar.qname; name='wfr'/>" ><!--(1D534)/frak w, lower case w -->
+<!ENTITY Wfr "<%mchar.qname; name='Wfr'/>" ><!--(1D51A)/frak W, upper case w -->
+<!ENTITY xfr "<%mchar.qname; name='xfr'/>" ><!--(1D535)/frak x, lower case x -->
+<!ENTITY Xfr "<%mchar.qname; name='Xfr'/>" ><!--(1D51B)/frak X, upper case x -->
+<!ENTITY yfr "<%mchar.qname; name='yfr'/>" ><!--(1D536)/frak y, lower case y -->
+<!ENTITY Yfr "<%mchar.qname; name='Yfr'/>" ><!--(1D51C)/frak Y, upper case y -->
+<!ENTITY zfr "<%mchar.qname; name='zfr'/>" ><!--(1D537)/frak z, lower case z -->
+<!ENTITY Zfr "<%mchar.qname; name='Zfr'/>" ><!--(1D51D)/frak Z, upper case z  -->
diff --git a/helm/dtd/isomopf.ent b/helm/dtd/isomopf.ent
new file mode 100644 (file)
index 0000000..6b5e01f
--- /dev/null
@@ -0,0 +1,53 @@
+
+<!--
+     File isomopf.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY Aopf "<%mchar.qname; name='Aopf'/>" ><!--(1D538)/Bbb A, open face A -->
+<!ENTITY Bopf "<%mchar.qname; name='Bopf'/>" ><!--(1D539)/Bbb B, open face B -->
+<!ENTITY Copf "<%mchar.qname; name='Copf'/>" ><!--(1D53A)/Bbb C, open face C -->
+<!ENTITY Dopf "<%mchar.qname; name='Dopf'/>" ><!--(1D53B)/Bbb D, open face D -->
+<!ENTITY Eopf "<%mchar.qname; name='Eopf'/>" ><!--(1D53C)/Bbb E, open face E -->
+<!ENTITY Fopf "<%mchar.qname; name='Fopf'/>" ><!--(1D53D)/Bbb F, open face F -->
+<!ENTITY Gopf "<%mchar.qname; name='Gopf'/>" ><!--(1D53E)/Bbb G, open face G -->
+<!ENTITY Hopf "<%mchar.qname; name='Hopf'/>" ><!--(1D53F)/Bbb H, open face H -->
+<!ENTITY Iopf "<%mchar.qname; name='Iopf'/>" ><!--(1D540)/Bbb I, open face I -->
+<!ENTITY Jopf "<%mchar.qname; name='Jopf'/>" ><!--(1D541)/Bbb J, open face J -->
+<!ENTITY Kopf "<%mchar.qname; name='Kopf'/>" ><!--(1D542)/Bbb K, open face K  -->
+<!ENTITY Lopf "<%mchar.qname; name='Lopf'/>" ><!--(1D543)/Bbb L, open face L  -->
+<!ENTITY Mopf "<%mchar.qname; name='Mopf'/>" ><!--(1D544)/Bbb M, open face M  -->
+<!ENTITY Nopf "<%mchar.qname; name='Nopf'/>" ><!--(1D545)/Bbb N, open face N -->
+<!ENTITY Oopf "<%mchar.qname; name='Oopf'/>" ><!--(1D546)/Bbb O, open face O -->
+<!ENTITY Popf "<%mchar.qname; name='Popf'/>" ><!--(1D547)/Bbb P, open face P -->
+<!ENTITY Qopf "<%mchar.qname; name='Qopf'/>" ><!--(1D548)/Bbb Q, open face Q -->
+<!ENTITY Ropf "<%mchar.qname; name='Ropf'/>" ><!--(1D549)/Bbb R, open face R -->
+<!ENTITY Sopf "<%mchar.qname; name='Sopf'/>" ><!--(1D54A)/Bbb S, open face S -->
+<!ENTITY Topf "<%mchar.qname; name='Topf'/>" ><!--(1D54B)/Bbb T, open face T -->
+<!ENTITY Uopf "<%mchar.qname; name='Uopf'/>" ><!--(1D54C)/Bbb U, open face U -->
+<!ENTITY Vopf "<%mchar.qname; name='Vopf'/>" ><!--(1D54D)/Bbb V, open face V -->
+<!ENTITY Wopf "<%mchar.qname; name='Wopf'/>" ><!--(1D54E)/Bbb W, open face W -->
+<!ENTITY Xopf "<%mchar.qname; name='Xopf'/>" ><!--(1D54F)/Bbb X, open face X -->
+<!ENTITY Yopf "<%mchar.qname; name='Yopf'/>" ><!--(1D550)/Bbb Y, open face Y -->
+<!ENTITY Zopf "<%mchar.qname; name='Zopf'/>" ><!--(1D551)/Bbb Z, open face Z -->
diff --git a/helm/dtd/isomscr.ent b/helm/dtd/isomscr.ent
new file mode 100644 (file)
index 0000000..75d3bc5
--- /dev/null
@@ -0,0 +1,79 @@
+
+<!--
+     File isomscr.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY ascr "<%mchar.qname; name='ascr'/>" ><!--(1D4B6)/scr a, script letter a -->
+<!ENTITY Ascr "<%mchar.qname; name='Ascr'/>" ><!--(1D49C)/scr A, script letter A -->
+<!ENTITY bscr "<%mchar.qname; name='bscr'/>" ><!--(1D4B7)/scr b, script letter b -->
+<!ENTITY Bscr "<%mchar.qname; name='Bscr'/>" ><!--(1D49D)/scr B, script letter B -->
+<!ENTITY cscr "<%mchar.qname; name='cscr'/>" ><!--(1D4B8)/scr c, script letter c -->
+<!ENTITY Cscr "<%mchar.qname; name='Cscr'/>" ><!--(1D49E)/scr C, script letter C -->
+<!ENTITY dscr "<%mchar.qname; name='dscr'/>" ><!--(1D4B9)/scr d, script letter d -->
+<!ENTITY Dscr "<%mchar.qname; name='Dscr'/>" ><!--(1D49F)/scr D, script letter D -->
+<!ENTITY escr "<%mchar.qname; name='escr'/>" ><!--(1D4BA)/scr e, script letter e -->
+<!ENTITY Escr "<%mchar.qname; name='Escr'/>" ><!--(1D4A0)/scr E, script letter E -->
+<!ENTITY fscr "<%mchar.qname; name='fscr'/>" ><!--(1D4BB)/scr f, script letter f -->
+<!ENTITY Fscr "<%mchar.qname; name='Fscr'/>" ><!--(1D4A1)/scr F, script letter F -->
+<!ENTITY gscr "<%mchar.qname; name='gscr'/>" ><!--(1D4BC)/scr g, script letter g -->
+<!ENTITY Gscr "<%mchar.qname; name='Gscr'/>" ><!--(1D4A2)/scr G, script letter G -->
+<!ENTITY hscr "<%mchar.qname; name='hscr'/>" ><!--(1D4BD)/scr h, script letter h -->
+<!ENTITY Hscr "<%mchar.qname; name='Hscr'/>" ><!--(1D4A3)/scr H, script letter H -->
+<!ENTITY iscr "<%mchar.qname; name='iscr'/>" ><!--(1D4BE)/scr i, script letter i -->
+<!ENTITY Iscr "<%mchar.qname; name='Iscr'/>" ><!--(1D4A4)/scr I, script letter I -->
+<!ENTITY jscr "<%mchar.qname; name='jscr'/>" ><!--(1D4BF)/scr j, script letter j -->
+<!ENTITY Jscr "<%mchar.qname; name='Jscr'/>" ><!--(1D4A5)/scr J, script letter J -->
+<!ENTITY kscr "<%mchar.qname; name='kscr'/>" ><!--(1D4C0)/scr k, script letter k -->
+<!ENTITY Kscr "<%mchar.qname; name='Kscr'/>" ><!--(1D4A6)/scr K, script letter K -->
+<!ENTITY lscr "<%mchar.qname; name='lscr'/>" ><!--(1D4C1)/scr l, script letter l -->
+<!ENTITY Lscr "<%mchar.qname; name='Lscr'/>" ><!--(1D4A7)/scr L, script letter L -->
+<!ENTITY mscr "<%mchar.qname; name='mscr'/>" ><!--(1D4C2)/scr m, script letter m -->
+<!ENTITY Mscr "<%mchar.qname; name='Mscr'/>" ><!--(1D4A8)/scr M, script letter M -->
+<!ENTITY nscr "<%mchar.qname; name='nscr'/>" ><!--(1D4C3)/scr n, script letter n -->
+<!ENTITY Nscr "<%mchar.qname; name='Nscr'/>" ><!--(1D4A9)/scr N, script letter N -->
+<!ENTITY oscr "<%mchar.qname; name='oscr'/>" ><!--(1D4C4)/scr o, script letter o -->
+<!ENTITY Oscr "<%mchar.qname; name='Oscr'/>" ><!--(1D4AA)/scr O, script letter O -->
+<!ENTITY pscr "<%mchar.qname; name='pscr'/>" ><!--(1D4C5)/scr p, script letter p -->
+<!ENTITY Pscr "<%mchar.qname; name='Pscr'/>" ><!--(1D4AB)/scr P, script letter P -->
+<!ENTITY qscr "<%mchar.qname; name='qscr'/>" ><!--(1D4C6)/scr q, script letter q -->
+<!ENTITY Qscr "<%mchar.qname; name='Qscr'/>" ><!--(1D4AC)/scr Q, script letter Q -->
+<!ENTITY rscr "<%mchar.qname; name='rscr'/>" ><!--(1D4C7)/scr r, script letter r -->
+<!ENTITY Rscr "<%mchar.qname; name='Rscr'/>" ><!--(1D4AD)/scr R, script letter R -->
+<!ENTITY sscr "<%mchar.qname; name='sscr'/>" ><!--(1D4C8)/scr s, script letter s -->
+<!ENTITY Sscr "<%mchar.qname; name='Sscr'/>" ><!--(1D4AE)/scr S, script letter S -->
+<!ENTITY tscr "<%mchar.qname; name='tscr'/>" ><!--(1D4C9)/scr t, script letter t -->
+<!ENTITY Tscr "<%mchar.qname; name='Tscr'/>" ><!--(1D4AF)/scr T, script letter T -->
+<!ENTITY uscr "<%mchar.qname; name='uscr'/>" ><!--(1D4CA)/scr u, script letter u -->
+<!ENTITY Uscr "<%mchar.qname; name='Uscr'/>" ><!--(1D4B0)/scr U, script letter U -->
+<!ENTITY vscr "<%mchar.qname; name='vscr'/>" ><!--(1D4CB)/scr v, script letter v -->
+<!ENTITY Vscr "<%mchar.qname; name='Vscr'/>" ><!--(1D4B1)/scr V, script letter V -->
+<!ENTITY wscr "<%mchar.qname; name='wscr'/>" ><!--(1D4CC)/scr w, script letter w -->
+<!ENTITY Wscr "<%mchar.qname; name='Wscr'/>" ><!--(1D4B2)/scr W, script letter W -->
+<!ENTITY xscr "<%mchar.qname; name='xscr'/>" ><!--(1D4CD)/scr x, script letter x -->
+<!ENTITY Xscr "<%mchar.qname; name='Xscr'/>" ><!--(1D4B3)/scr X, script letter X -->
+<!ENTITY yscr "<%mchar.qname; name='yscr'/>" ><!--(1D4CE)/scr y, script letter y -->
+<!ENTITY Yscr "<%mchar.qname; name='Yscr'/>" ><!--(1D4B4)/scr Y, script letter Y -->
+<!ENTITY zscr "<%mchar.qname; name='zscr'/>" ><!--(1D4CF)/scr z, script letter z -->
+<!ENTITY Zscr "<%mchar.qname; name='Zscr'/>" ><!--(1D4B5)/scr Z, script letter Z -->
diff --git a/helm/dtd/isonum.ent b/helm/dtd/isonum.ent
new file mode 100644 (file)
index 0000000..d6d3461
--- /dev/null
@@ -0,0 +1,106 @@
+
+<!--
+     File isonum.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+<!--HELM: deleted the central &: 
+<!ENTITY amp              "&#x26;&#x00026;" >-->
+<!ENTITY amp              "&#x26;#x00026;" ><!--=ampersand -->
+<!ENTITY apos             "&#x00027;" ><!--=apostrophe -->
+<!ENTITY ast              "&#x0002A;" ><!--/ast B: =asterisk -->
+<!ENTITY brvbar           "&#x000A6;" ><!--=broken (vertical) bar -->
+<!ENTITY bsol             "&#x0005C;" ><!--/backslash =reverse solidus -->
+<!ENTITY cent             "&#x000A2;" ><!--=cent sign -->
+<!ENTITY colon            "&#x0003A;" ><!--/colon P: -->
+<!ENTITY comma            "&#x0002C;" ><!--P: =comma -->
+<!ENTITY commat           "&#x00040;" ><!--=commercial at -->
+<!ENTITY copy             "&#x000A9;" ><!--=copyright sign -->
+<!ENTITY curren           "&#x000A4;" ><!--=general currency sign -->
+<!ENTITY darr             "&#x02193;" ><!--/downarrow A: =downward arrow -->
+<!ENTITY deg              "&#x000B0;" ><!--=degree sign -->
+<!ENTITY divide           "&#x000F7;" ><!--/div B: =divide sign -->
+<!ENTITY dollar           "&#x00024;" ><!--=dollar sign -->
+<!ENTITY equals           "&#x0003D;" ><!--=equals sign R: -->
+<!ENTITY excl             "&#x00021;" ><!--=exclamation mark -->
+<!ENTITY frac12           "&#x000BD;" ><!--=fraction one-half -->
+<!ENTITY frac14           "&#x000BC;" ><!--=fraction one-quarter -->
+<!ENTITY frac18           "&#x0215B;" ><!--=fraction one-eighth -->
+<!ENTITY frac34           "&#x000BE;" ><!--=fraction three-quarters -->
+<!ENTITY frac38           "&#x0215C;" ><!--=fraction three-eighths -->
+<!ENTITY frac58           "&#x0215D;" ><!--=fraction five-eighths -->
+<!ENTITY frac78           "&#x0215E;" ><!--=fraction seven-eighths -->
+<!ENTITY gt               "&#x0003E;" ><!--=greater-than sign R: -->
+<!ENTITY half             "&#x000BD;" ><!--=fraction one-half -->
+<!ENTITY horbar           "&#x02015;" ><!--=horizontal bar -->
+<!ENTITY hyphen           "&#x02010;" ><!--=hyphen -->
+<!ENTITY iexcl            "&#x000A1;" ><!--=inverted exclamation mark -->
+<!ENTITY iquest           "&#x000BF;" ><!--=inverted question mark -->
+<!ENTITY laquo            "&#x000AB;" ><!--=angle quotation mark, left -->
+<!ENTITY larr             "&#x02190;" ><!--/leftarrow /gets A: =leftward arrow -->
+<!ENTITY lcub             "&#x0007B;" ><!--/lbrace O: =left curly bracket -->
+<!ENTITY ldquo            "&#x0201C;" ><!--=double quotation mark, left -->
+<!ENTITY lowbar           "&#x0005F;" ><!--=low line -->
+<!ENTITY lpar             "&#x00028;" ><!--O: =left parenthesis -->
+<!ENTITY lsqb             "&#x0005B;" ><!--/lbrack O: =left square bracket -->
+<!ENTITY lsquo            "&#x02018;" ><!--=single quotation mark, left -->
+<!--HELM: deleted the central &: 
+<!ENTITY lt               "&#x26;&#x0003C;" >-->
+<!ENTITY lt               "&#x26;#x0003C;" ><!--=less-than sign R: -->
+<!ENTITY micro            "&#x000B5;" ><!--=micro sign -->
+<!ENTITY middot           "&#x000B7;" ><!--/centerdot B: =middle dot -->
+<!ENTITY nbsp             "&#x000A0;" ><!--=no break (required) space -->
+<!ENTITY not              "&#x000AC;" ><!--/neg /lnot =not sign -->
+<!ENTITY num              "&#x00023;" ><!--=number sign -->
+<!ENTITY ohm              "&#x02126;" ><!--=ohm sign -->
+<!ENTITY ordf             "&#x000AA;" ><!--=ordinal indicator, feminine -->
+<!ENTITY ordm             "&#x000BA;" ><!--=ordinal indicator, masculine -->
+<!ENTITY para             "&#x000B6;" ><!--=pilcrow (paragraph sign) -->
+<!ENTITY percnt           "&#x00025;" ><!--=percent sign -->
+<!ENTITY period           "&#x0002E;" ><!--=full stop, period -->
+<!ENTITY plus             "&#x0002B;" ><!--=plus sign B: -->
+<!ENTITY plusmn           "&#x000B1;" ><!--/pm B: =plus-or-minus sign -->
+<!ENTITY pound            "&#x000A3;" ><!--=pound sign -->
+<!ENTITY quest            "&#x0003F;" ><!--=question mark -->
+<!ENTITY quot             "&#x00022;" ><!--=quotation mark -->
+<!ENTITY raquo            "&#x000BB;" ><!--=angle quotation mark, right -->
+<!ENTITY rarr             "&#x02192;" ><!--/rightarrow /to A: =rightward arrow -->
+<!ENTITY rcub             "&#x0007D;" ><!--/rbrace C: =right curly bracket -->
+<!ENTITY rdquo            "&#x0201D;" ><!--=double quotation mark, right -->
+<!ENTITY reg              "&#x000AE;" ><!--/circledR =registered sign -->
+<!ENTITY rpar             "&#x00029;" ><!--C: =right parenthesis -->
+<!ENTITY rsqb             "&#x0005D;" ><!--/rbrack C: =right square bracket -->
+<!ENTITY rsquo            "&#x02019;" ><!--=single quotation mark, right -->
+<!ENTITY sect             "&#x000A7;" ><!--=section sign -->
+<!ENTITY semi             "&#x0003B;" ><!--=semicolon P: -->
+<!ENTITY shy              "&#x000AD;" ><!--=soft hyphen -->
+<!ENTITY sol              "&#x0002F;" ><!--=solidus -->
+<!ENTITY sung             "&#x0266A;" ><!--=music note (sung text sign) -->
+<!ENTITY sup1             "&#x000B9;" ><!--=superscript one -->
+<!ENTITY sup2             "&#x000B2;" ><!--=superscript two -->
+<!ENTITY sup3             "&#x000B3;" ><!--=superscript three -->
+<!ENTITY times            "&#x000D7;" ><!--/times B: =multiply sign -->
+<!ENTITY trade            "&#x02122;" ><!--=trade mark sign -->
+<!ENTITY uarr             "&#x02191;" ><!--/uparrow A: =upward arrow -->
+<!ENTITY verbar           "&#x0007C;" ><!--/vert =vertical bar -->
+<!ENTITY yen              "&#x000A5;" ><!--/yen =yen sign -->
diff --git a/helm/dtd/isopub.ent b/helm/dtd/isopub.ent
new file mode 100644 (file)
index 0000000..5591fc3
--- /dev/null
@@ -0,0 +1,111 @@
+
+<!--
+     File isopub.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1986
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY blank            "&#x02423;" ><!--=significant blank symbol -->
+<!ENTITY blk12            "&#x02592;" ><!--=50% shaded block -->
+<!ENTITY blk14            "&#x02591;" ><!--=25% shaded block -->
+<!ENTITY blk34            "&#x02593;" ><!--=75% shaded block -->
+<!ENTITY block            "&#x02588;" ><!--=full block -->
+<!ENTITY bull             "&#x02022;" ><!--/bullet B: =round bullet, filled -->
+<!ENTITY caret            "&#x02041;" ><!--=caret (insertion mark) -->
+<!ENTITY check            "&#x02713;" ><!--/checkmark =tick, check mark -->
+<!ENTITY cir              "&#x025CB;" ><!--/circ B: =circle, open -->
+<!ENTITY clubs            "&#x02663;" ><!--/clubsuit =club suit symbol  -->
+<!ENTITY copysr           "&#x02117;" ><!--=sound recording copyright sign -->
+<!ENTITY cross            "&#x02717;" ><!--=ballot cross -->
+<!ENTITY dagger           "&#x02020;" ><!--/dagger B: =dagger -->
+<!ENTITY Dagger           "&#x02021;" ><!--/ddagger B: =double dagger -->
+<!ENTITY dash             "&#x02010;" ><!--=hyphen (true graphic) -->
+<!ENTITY diams            "&#x02666;" ><!--/diamondsuit =diamond suit symbol  -->
+<!ENTITY dlcrop           "&#x0230D;" ><!--downward left crop mark  -->
+<!ENTITY drcrop           "&#x0230C;" ><!--downward right crop mark  -->
+<!ENTITY dtri             "&#x025BF;" ><!--/triangledown =down triangle, open -->
+<!ENTITY dtrif            "&#x025BE;" ><!--/blacktriangledown =dn tri, filled -->
+<!ENTITY emsp             "&#x02003;" ><!--=em space -->
+<!ENTITY emsp13           "&#x02004;" ><!--=1/3-em space -->
+<!ENTITY emsp14           "&#x02005;" ><!--=1/4-em space -->
+<!ENTITY ensp             "&#x02002;" ><!--=en space (1/2-em) -->
+<!ENTITY female           "&#x02640;" ><!--=female symbol -->
+<!ENTITY ffilig           "&#x0FB03;" ><!--small ffi ligature -->
+<!ENTITY fflig            "&#x0FB00;" ><!--small ff ligature -->
+<!ENTITY ffllig           "&#x0FB04;" ><!--small ffl ligature -->
+<!ENTITY filig            "&#x0FB01;" ><!--small fi ligature -->
+<!ENTITY flat             "&#x0266D;" ><!--/flat =musical flat -->
+<!ENTITY fllig            "&#x0FB02;" ><!--small fl ligature -->
+<!ENTITY frac13           "&#x02153;" ><!--=fraction one-third -->
+<!ENTITY frac15           "&#x02155;" ><!--=fraction one-fifth -->
+<!ENTITY frac16           "&#x02159;" ><!--=fraction one-sixth -->
+<!ENTITY frac23           "&#x02154;" ><!--=fraction two-thirds -->
+<!ENTITY frac25           "&#x02156;" ><!--=fraction two-fifths -->
+<!ENTITY frac35           "&#x02157;" ><!--=fraction three-fifths -->
+<!ENTITY frac45           "&#x02158;" ><!--=fraction four-fifths -->
+<!ENTITY frac56           "&#x0215A;" ><!--=fraction five-sixths -->
+<!ENTITY hairsp           "&#x0200A;" ><!--=hair space -->
+<!ENTITY hearts           "&#x02661;" ><!--/heartsuit =heart suit symbol  -->
+<!ENTITY hellip           "&#x02026;" ><!--=ellipsis (horizontal) -->
+<!ENTITY hybull           "&#x02043;" ><!--rectangle, filled (hyphen bullet) -->
+<!ENTITY incare           "&#x02105;" ><!--=in-care-of symbol -->
+<!ENTITY ldquor           "&#x0201E;" ><!--=rising dbl quote, left (low) -->
+<!ENTITY lhblk            "&#x02584;" ><!--=lower half block -->
+<!ENTITY loz              "&#x025CA;" ><!--/lozenge - lozenge or total mark -->
+<!ENTITY lozf             "&#x029EB;" ><!--/blacklozenge - lozenge, filled -->
+<!ENTITY lsquor           "&#x0201A;" ><!--=rising single quote, left (low) -->
+<!ENTITY ltri             "&#x025C3;" ><!--/triangleleft B: l triangle, open -->
+<!ENTITY ltrif            "&#x025C2;" ><!--/blacktriangleleft R: =l tri, filled -->
+<!ENTITY male             "&#x02642;" ><!--=male symbol -->
+<!ENTITY malt             "&#x02720;" ><!--/maltese =maltese cross -->
+<!ENTITY marker           "&#x025AE;" ><!--=histogram marker -->
+<!ENTITY mdash            "&#x02014;" ><!--=em dash  -->
+<!ENTITY mldr             "&#x02026;" ><!--em leader -->
+<!ENTITY natur            "&#x0266E;" ><!--/natural - music natural -->
+<!ENTITY ndash            "&#x02013;" ><!--=en dash -->
+<!ENTITY nldr             "&#x02025;" ><!--=double baseline dot (en leader) -->
+<!ENTITY numsp            "&#x02007;" ><!--=digit space (width of a number) -->
+<!ENTITY phone            "&#x0260E;" ><!--=telephone symbol  -->
+<!ENTITY puncsp           "&#x02008;" ><!--=punctuation space (width of comma) -->
+<!ENTITY rdquor           "&#x0201D;" ><!--rising dbl quote, right (high) -->
+<!ENTITY rect             "&#x025AD;" ><!--=rectangle, open -->
+<!ENTITY rsquor           "&#x02019;" ><!--rising single quote, right (high) -->
+<!ENTITY rtri             "&#x025B9;" ><!--/triangleright B: r triangle, open -->
+<!ENTITY rtrif            "&#x025B8;" ><!--/blacktriangleright R: =r tri, filled -->
+<!ENTITY rx               "&#x0211E;" ><!--pharmaceutical prescription (Rx) -->
+<!ENTITY sext             "&#x02736;" ><!--sextile (6-pointed star) -->
+<!ENTITY sharp            "&#x0266F;" ><!--/sharp =musical sharp -->
+<!ENTITY spades           "&#x02660;" ><!--/spadesuit =spades suit symbol  -->
+<!ENTITY squ              "&#x025A1;" ><!--=square, open -->
+<!ENTITY squf             "&#x025AA;" ><!--/blacksquare =sq bullet, filled -->
+<!ENTITY star             "&#x022C6;" ><!--=star, open -->
+<!ENTITY starf            "&#x02605;" ><!--/bigstar - star, filled  -->
+<!ENTITY target           "&#x02316;" ><!--register mark or target -->
+<!ENTITY telrec           "&#x02315;" ><!--=telephone recorder symbol -->
+<!ENTITY thinsp           "&#x02009;" ><!--=thin space (1/6-em) -->
+<!ENTITY uhblk            "&#x02580;" ><!--=upper half block -->
+<!ENTITY ulcrop           "&#x0230F;" ><!--upward left crop mark  -->
+<!ENTITY urcrop           "&#x0230E;" ><!--upward right crop mark  -->
+<!ENTITY utri             "&#x025B5;" ><!--/triangle =up triangle, open -->
+<!ENTITY utrif            "&#x025B4;" ><!--/blacktriangle =up tri, filled -->
+<!ENTITY vellip           "&#x022EE;" ><!--vertical ellipsis -->
diff --git a/helm/dtd/isotech.ent b/helm/dtd/isotech.ent
new file mode 100644 (file)
index 0000000..8b30af8
--- /dev/null
@@ -0,0 +1,183 @@
+
+<!--
+     File isotech.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+     Entity names in this file are derived from files carrying the
+     following notice:
+
+     (C) International Organization for Standardization 1991
+     Permission to copy in any form is granted for use with
+     conforming SGML systems and applications as defined in
+     ISO 8879, provided this notice is included in all copies.
+
+-->
+
+<!ENTITY acd              "&#x0223F;" ><!--ac current -->
+<!ENTITY aleph            "&#x02135;" ><!--/aleph aleph, Hebrew -->
+<!ENTITY and              "&#x02227;" ><!--/wedge /land B: logical and -->
+<!ENTITY And              "&#x02A53;" ><!--dbl logical and -->
+<!ENTITY andand           "&#x02A55;" ><!--two logical and -->
+<!ENTITY andd             "&#x02A5C;" ><!--and, horizontal dash -->
+<!ENTITY andslope         "&#x02A58;" ><!--sloping large and -->
+<!ENTITY andv             "&#x02A5A;" ><!--and with middle stem -->
+<!ENTITY angrt            "&#x0221F;" ><!--right (90 degree) angle -->
+<!ENTITY angsph           "&#x02222;" ><!--/sphericalangle angle-spherical -->
+<!ENTITY angst            "&#x0212B;" ><!--Angstrom capital A, ring -->
+<!ENTITY ap               "&#x02248;" ><!--/approx R: approximate -->
+<!ENTITY apacir           "&#x02A6F;" ><!--approximate, circumflex accent -->
+<!ENTITY awconint         "&#x02233;" ><!--contour integral, anti-clockwise -->
+<!ENTITY awint            "&#x02A11;" ><!--anti clock-wise integration -->
+<!ENTITY becaus           "&#x02235;" ><!--/because R: because -->
+<!ENTITY bernou           "&#x0212C;" ><!--Bernoulli function (script capital B)  -->
+<!ENTITY bne              "&#x0003D;&#x020E5;" ><!--reverse not equal -->
+<!ENTITY bnequiv          "&#x02261;&#x020E5;" ><!--reverse not equivalent -->
+<!ENTITY bnot             "&#x02310;" ><!--reverse not -->
+<!ENTITY bNot             "&#x02AED;" ><!--reverse not with two horizontal strokes -->
+<!ENTITY bottom           "&#x022A5;" ><!--/bot bottom -->
+<!ENTITY cap              "&#x02229;" ><!--/cap B: intersection -->
+<!ENTITY Cconint          "&#x02230;" ><!--triple contour integral operator -->
+<!ENTITY cirfnint         "&#x02A10;" ><!--circulation function -->
+<!ENTITY compfn           "&#x02218;" ><!--/circ B: composite function (small circle) -->
+<!ENTITY cong             "&#x02245;" ><!--/cong R: congruent with -->
+<!ENTITY conint           "&#x0222E;" ><!--/oint L: contour integral operator -->
+<!ENTITY Conint           "&#x0222F;" ><!--double contour integral operator -->
+<!ENTITY ctdot            "&#x022EF;" ><!--/cdots, three dots, centered -->
+<!ENTITY cup              "&#x0222A;" ><!--/cup B: union or logical sum -->
+<!ENTITY cwconint         "&#x02232;" ><!--contour integral, clockwise -->
+<!ENTITY cwint            "&#x02231;" ><!--clockwise integral -->
+<!ENTITY cylcty           "&#x0232D;" ><!--cylindricity -->
+<!ENTITY disin            "&#x022F2;" ><!--set membership, long horizontal stroke -->
+<!ENTITY Dot              "&#x000A8;" ><!--dieresis or umlaut mark -->
+<!ENTITY DotDot           "&#x020DC;" ><!--four dots above -->
+<!ENTITY dsol             "&#x02052;" ><!--solidus, bar above -->
+<!ENTITY dtdot            "&#x022F1;" ><!--/ddots, three dots, descending -->
+<!ENTITY dwangle          "&#x029A6;" ><!--large downward pointing angle -->
+<!ENTITY epar             "&#x022D5;" ><!--parallel, equal; equal or parallel -->
+<!ENTITY eparsl           "&#x029E3;" ><!--parallel, slanted, equal; homothetically congruent to -->
+<!ENTITY equiv            "&#x02261;" ><!--/equiv R: identical with -->
+<!ENTITY eqvparsl         "&#x029E5;" ><!--equivalent, equal; congruent and parallel -->
+<!ENTITY exist            "&#x02203;" ><!--/exists at least one exists -->
+<!ENTITY fnof             "&#x00192;" ><!--function of (italic small f) -->
+<!ENTITY forall           "&#x02200;" ><!--/forall for all -->
+<!ENTITY fpartint         "&#x02A0D;" ><!--finite part integral -->
+<!ENTITY ge               "&#x02265;" ><!--/geq /ge R: greater-than-or-equal -->
+<!ENTITY hamilt           "&#x0210B;" ><!--Hamiltonian (script capital H)  -->
+<!ENTITY iff              "&#x021D4;" ><!--/iff if and only if  -->
+<!ENTITY iinfin           "&#x029DC;" ><!--infinity sign, incomplete -->
+<!ENTITY imped "<%mchar.qname; name='imped'/>" ><!--(1D543)impedance -->
+<!ENTITY infin            "&#x0221E;" ><!--/infty infinity -->
+<!ENTITY int              "&#x0222B;" ><!--/int L: integral operator -->
+<!ENTITY Int              "&#x0222C;" ><!--double integral operator -->
+<!ENTITY intlarhk         "&#x02A17;" ><!--integral, left arrow with hook -->
+<!ENTITY isin             "&#x02208;" ><!--/in R: set membership  -->
+<!ENTITY isindot          "&#x022F5;" ><!--set membership, dot above -->
+<!ENTITY isinE            "&#x022F9;" ><!--set membership, two horizontal strokes -->
+<!ENTITY isins            "&#x022F4;" ><!--set membership, vertical bar on horizontal stroke -->
+<!ENTITY isinsv           "&#x022F3;" ><!--large set membership, vertical bar on horizontal stroke -->
+<!ENTITY isinv            "&#x02208;" ><!--set membership, variant -->
+<!ENTITY lagran           "&#x02112;" ><!--Lagrangian (script capital L)  -->
+<!ENTITY lang             "&#x03008;" ><!--/langle O: left angle bracket -->
+<!ENTITY Lang             "&#x0300A;" ><!--left angle bracket, double -->
+<!ENTITY lArr             "&#x021D0;" ><!--/Leftarrow A: is implied by -->
+<!ENTITY lbbrk            "&#x03014;" ><!--left broken bracket -->
+<!ENTITY le               "&#x02264;" ><!--/leq /le R: less-than-or-equal -->
+<!ENTITY loang            "&#x03018;" ><!--left open angular bracket -->
+<!ENTITY lobrk            "&#x0301A;" ><!--left open bracket -->
+<!ENTITY lopar            "&#x02985;" ><!--left open parenthesis -->
+<!ENTITY lowast           "&#x02217;" ><!--low asterisk -->
+<!ENTITY minus            "&#x02212;" ><!--B: minus sign -->
+<!ENTITY mnplus           "&#x02213;" ><!--/mp B: minus-or-plus sign -->
+<!ENTITY nabla            "&#x02207;" ><!--/nabla del, Hamilton operator -->
+<!ENTITY ne               "&#x02260;" ><!--/ne /neq R: not equal -->
+<!ENTITY nedot            "&#x02260;&#x02063;" ><!--not equal, dot -->
+<!ENTITY nhpar            "&#x02AF2;" ><!--not, horizontal, parallel -->
+<!ENTITY ni               "&#x0220B;" ><!--/ni /owns R: contains -->
+<!ENTITY nis              "&#x022FC;" ><!--contains, vertical bar on horizontal stroke -->
+<!ENTITY nisd             "&#x022FA;" ><!--contains, long horizontal stroke -->
+<!ENTITY niv              "&#x0220B;" ><!--contains, variant -->
+<!ENTITY Not              "&#x02AEC;" ><!--not with two horizontal strokes -->
+<!ENTITY notin            "&#x02209;" ><!--/notin N: negated set membership -->
+<!ENTITY notindot         "&#x022F6;&#x02063;" ><!--negated set membership, dot above -->
+<!ENTITY notinva          "&#x02209;&#x00338;" ><!--negated set membership, variant -->
+<!ENTITY notinvb          "&#x022F7;" ><!--negated set membership, variant -->
+<!ENTITY notinvc          "&#x022F6;" ><!--negated set membership, variant -->
+<!ENTITY notni            "&#x0220C;" ><!--negated contains -->
+<!ENTITY notniva          "&#x0220C;" ><!--negated contains, variant -->
+<!ENTITY notnivb          "&#x022FE;" ><!--contains, variant -->
+<!ENTITY notnivc          "&#x022FD;" ><!--contains, variant -->
+<!ENTITY nparsl           "&#x02225;&#x02063;&#x020E5;" ><!--not parallel, slanted -->
+<!ENTITY npart            "&#x02202;&#x00338;" ><!--not partial differential -->
+<!ENTITY npolint          "&#x02A14;" ><!--line integration, not including the pole -->
+<!ENTITY nvinfin          "&#x029DE;" ><!--not, vert, infinity -->
+<!ENTITY olcross          "&#x029BB;" ><!--circle, cross -->
+<!ENTITY or               "&#x02228;" ><!--/vee /lor B: logical or -->
+<!ENTITY Or               "&#x02A54;" ><!--dbl logical or -->
+<!ENTITY ord              "&#x02A5D;" ><!--or, horizontal dash -->
+<!ENTITY order            "&#x02134;" ><!--order of (script small o)  -->
+<!ENTITY oror             "&#x02A56;" ><!--two logical or -->
+<!ENTITY orslope          "&#x02A57;" ><!--sloping large or -->
+<!ENTITY orv              "&#x02A5B;" ><!--or with middle stem -->
+<!ENTITY par              "&#x02225;" ><!--/parallel R: parallel -->
+<!ENTITY parsl            "&#x02225;&#x02063;" ><!--parallel, slanted -->
+<!ENTITY part             "&#x02202;" ><!--/partial partial differential -->
+<!ENTITY permil           "&#x02030;" ><!--per thousand -->
+<!ENTITY perp             "&#x022A5;" ><!--/perp R: perpendicular -->
+<!ENTITY pertenk          "&#x02031;" ><!--per 10 thousand -->
+<!ENTITY phmmat           "&#x02133;" ><!--physics M-matrix (script capital M)  -->
+<!ENTITY pointint         "&#x02A15;" ><!--integral around a point operator -->
+<!ENTITY prime            "&#x02032;" ><!--/prime prime or minute -->
+<!ENTITY Prime            "&#x02033;" ><!--double prime or second -->
+<!ENTITY profalar         "&#x0232E;" ><!--all-around profile -->
+<!ENTITY profline         "&#x02312;" ><!--profile of a line -->
+<!ENTITY profsurf         "&#x02313;" ><!--profile of a surface -->
+<!ENTITY prop             "&#x0221D;" ><!--/propto R: is proportional to -->
+<!ENTITY qint             "&#x02A0C;" ><!--/iiiint quadruple integral operator -->
+<!ENTITY qprime           "&#x02057;" ><!--quadruple prime -->
+<!ENTITY quatint          "&#x02A16;" ><!--quaternion integral operator -->
+<!ENTITY radic            "&#x0221A;" ><!--/surd radical -->
+<!ENTITY rang             "&#x03009;" ><!--/rangle C: right angle bracket -->
+<!ENTITY Rang             "&#x0300B;" ><!--right angle bracket, double -->
+<!ENTITY rArr             "&#x021D2;" ><!--/Rightarrow A: implies -->
+<!ENTITY rbbrk            "&#x03015;" ><!--right broken bracket -->
+<!ENTITY roang            "&#x03019;" ><!--right open angular bracket -->
+<!ENTITY robrk            "&#x0301B;" ><!--right open bracket -->
+<!ENTITY ropar            "&#x02986;" ><!--right open parenthesis -->
+<!ENTITY rppolint         "&#x02A12;" ><!--line integration, rectangular path around pole -->
+<!ENTITY scpolint         "&#x02A13;" ><!--line integration, semi-circular path around pole -->
+<!ENTITY sim              "&#x0223C;" ><!--/sim R: similar -->
+<!ENTITY simdot           "&#x02A6A;" ><!--similar, dot -->
+<!ENTITY sime             "&#x02243;" ><!--/simeq R: similar, equals -->
+<!ENTITY smeparsl         "&#x029E4;" ><!--similar, parallel, slanted, equal -->
+<!ENTITY square           "&#x025A1;" ><!--/square, square -->
+<!ENTITY squarf           "&#x025AA;" ><!--/blacksquare, square, filled  -->
+<!ENTITY sub              "&#x02282;" ><!--/subset R: subset or is implied by -->
+<!ENTITY sube             "&#x02286;" ><!--/subseteq R: subset, equals -->
+<!ENTITY sup              "&#x02283;" ><!--/supset R: superset or implies -->
+<!ENTITY supe             "&#x02287;" ><!--/supseteq R: superset, equals -->
+<!ENTITY tdot             "&#x020DB;" ><!--three dots above -->
+<!ENTITY there4           "&#x02234;" ><!--/therefore R: therefore -->
+<!ENTITY tint             "&#x0222D;" ><!--/iiint triple integral operator -->
+<!ENTITY top              "&#x022A4;" ><!--/top top -->
+<!ENTITY topbot           "&#x02336;" ><!--top and bottom -->
+<!ENTITY topcir           "&#x02AF1;" ><!--top, circle below -->
+<!ENTITY tprime           "&#x02034;" ><!--triple prime -->
+<!ENTITY utdot            "&#x022F0;" ><!--three dots, ascending -->
+<!ENTITY uwangle          "&#x029A7;" ><!--large upward pointing angle -->
+<!ENTITY vangrt           "&#x022BE;" ><!--right angle, variant -->
+<!ENTITY veeeq            "&#x0225A;" ><!--logical or, equals -->
+<!ENTITY Verbar           "&#x02016;" ><!--/Vert dbl vertical bar -->
+<!ENTITY wedgeq           "&#x02259;" ><!--/wedgeq R: corresponds to (wedge, equals) -->
+<!ENTITY xnis             "&#x022FB;" ><!--large contains, vertical bar on horizontal stroke -->
diff --git a/helm/dtd/mathml2-qname-1.mod b/helm/dtd/mathml2-qname-1.mod
new file mode 100644 (file)
index 0000000..4dea63a
--- /dev/null
@@ -0,0 +1,268 @@
+<!-- ....................................................................... -->
+<!-- MathML Qualified Names Module  ........................................ -->
+<!-- file: mathml2-qname-1.mod
+
+     This is the Mathematical Markup Language (MathML) 2.0, an XML 
+     application for describing mathematical notation and capturing 
+     both its structure and content.
+
+     Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
+     Revision: $Id$ 
+
+     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//ENTITIES MathML 2.0 Qualified Names 1.0//EN"
+       SYSTEM "mathml2-qname-1.mod"
+
+     Revisions:
+     (none)
+     ....................................................................... -->
+
+<!-- MathML Qualified Names
+
+     This module is contained in two parts, labeled Section 'A' and 'B':
+
+       Section A declares parameter entities to support namespace-
+       qualified names, namespace declarations, and name prefixing 
+       for MathML.
+    
+       Section B declares parameter entities used to provide
+       namespace-qualified names for all MathML element types.
+
+     This module is derived from the XHTML Qualified Names Template module.
+-->
+
+<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->
+
+<!-- HELM: mathml namespace activated: 
+<!ENTITY % NS.prefixed     "IGNORE" >-->
+
+<!ENTITY % NS.prefixed     "INCLUDE" >
+<!ENTITY % MATHML.prefixed "%NS.prefixed;" >
+
+<!-- XLink ............... -->
+
+<!ENTITY % XLINK.xmlns "http://www.w3.org/1999/xlink" >
+<!ENTITY % XLINK.xmlns.attrib
+     "xmlns:xlink  CDATA           #FIXED '%XLINK.xmlns;'"
+>
+
+<!-- MathML .............. -->
+
+<!ENTITY % MATHML.xmlns    "http://www.w3.org/1998/Math/MathML" >
+<!ENTITY % MATHML.prefix   "m" >
+<![%MATHML.prefixed;[
+<!ENTITY % MATHML.xmlns.extra.attrib  "" >
+]]>
+<!ENTITY % MATHML.xmlns.extra.attrib 
+     "%XLINK.xmlns.attrib;" >
+
+<![%MATHML.prefixed;[
+<!ENTITY % MATHML.pfx  "%MATHML.prefix;:" >
+<!ENTITY % MATHML.xmlns.attrib
+     "xmlns:%MATHML.prefix;  CDATA   #FIXED '%MATHML.xmlns;'
+      %MATHML.xmlns.extra.attrib;"
+>
+]]>
+<!ENTITY % MATHML.pfx  "" >
+<!ENTITY % MATHML.xmlns.attrib
+     "xmlns        CDATA           #FIXED '%MATHML.xmlns;'
+      %MATHML.xmlns.extra.attrib;"
+>
+
+<![%NS.prefixed;[
+<!ENTITY % XHTML.xmlns.extra.attrib 
+     "%MATHML.xmlns.attrib;" >
+]]>
+<!ENTITY % XHTML.xmlns.extra.attrib
+     "%XLINK.xmlns.attrib;"
+>
+
+<!-- Section B: MathML Qualified Names ::::::::::::::::::::::::::::: -->
+
+<!-- 9. This section declares parameter entities used to provide
+        namespace-qualified names for all MathML element types.
+-->
+
+<!ENTITY % mspace.qname         "%MATHML.pfx;mspace" >
+<!ENTITY % mprescripts.qname    "%MATHML.pfx;mprescripts" >
+<!ENTITY % none.qname           "%MATHML.pfx;none" >
+<!ENTITY % malignmark.qname     "%MATHML.pfx;malignmark" >
+<!ENTITY % maligngroup.qname    "%MATHML.pfx;maligngroup" >
+<!ENTITY % mchar.qname          "%MATHML.pfx;mchar" >
+<!ENTITY % mglyph.qname         "%MATHML.pfx;mglyph" >
+<!ENTITY % integers.qname       "%MATHML.pfx;integers" >
+<!ENTITY % reals.qname          "%MATHML.pfx;reals" >
+<!ENTITY % rationals.qname      "%MATHML.pfx;rationals" >
+<!ENTITY % naturalnumbers.qname "%MATHML.pfx;naturalnumbers" >
+<!ENTITY % complexes.qname      "%MATHML.pfx;complexes" >
+<!ENTITY % primes.qname         "%MATHML.pfx;primes" >
+<!ENTITY % exponentiale.qname   "%MATHML.pfx;exponentiale" >
+<!ENTITY % imaginaryi.qname     "%MATHML.pfx;imaginaryi" >
+<!ENTITY % notanumber.qname     "%MATHML.pfx;notanumber" >
+<!ENTITY % true.qname           "%MATHML.pfx;true" >
+<!ENTITY % false.qname          "%MATHML.pfx;false" >
+<!ENTITY % emptyset.qname       "%MATHML.pfx;emptyset" >
+<!ENTITY % pi.qname             "%MATHML.pfx;pi" >
+<!ENTITY % eulergamma.qname     "%MATHML.pfx;eulergamma" >
+<!ENTITY % infinity.qname       "%MATHML.pfx;infinity" >
+<!ENTITY % sep.qname            "%MATHML.pfx;sep" >
+<!ENTITY % inverse.qname        "%MATHML.pfx;inverse" >
+<!ENTITY % ident.qname          "%MATHML.pfx;ident" >
+<!ENTITY % compose.qname        "%MATHML.pfx;compose" >
+<!ENTITY % exp.qname            "%MATHML.pfx;exp" >
+<!ENTITY % abs.qname            "%MATHML.pfx;abs" >
+<!ENTITY % arg.qname            "%MATHML.pfx;arg" >
+<!ENTITY % real.qname           "%MATHML.pfx;real" >
+<!ENTITY % imaginary.qname      "%MATHML.pfx;imaginary" >
+<!ENTITY % conjugate.qname      "%MATHML.pfx;conjugate" >
+<!ENTITY % factorial.qname      "%MATHML.pfx;factorial" >
+<!ENTITY % minus.qname          "%MATHML.pfx;minus" >
+<!ENTITY % quotient.qname       "%MATHML.pfx;quotient" >
+<!ENTITY % divide.qname         "%MATHML.pfx;divide" >
+<!ENTITY % power.qname          "%MATHML.pfx;power" >
+<!ENTITY % rem.qname            "%MATHML.pfx;rem" >
+<!ENTITY % plus.qname           "%MATHML.pfx;plus" >
+<!ENTITY % max.qname            "%MATHML.pfx;max" >
+<!ENTITY % min.qname            "%MATHML.pfx;min" >
+<!ENTITY % times.qname          "%MATHML.pfx;times" >
+<!ENTITY % gcd.qname            "%MATHML.pfx;gcd" >
+<!ENTITY % lcm.qname            "%MATHML.pfx;lcm" >
+<!ENTITY % root.qname           "%MATHML.pfx;root" >
+<!ENTITY % exists.qname         "%MATHML.pfx;exists" >
+<!ENTITY % forall.qname         "%MATHML.pfx;forall" >
+<!ENTITY % and.qname            "%MATHML.pfx;and" >
+<!ENTITY % or.qname             "%MATHML.pfx;or" >
+<!ENTITY % xor.qname            "%MATHML.pfx;xor" >
+<!ENTITY % not.qname            "%MATHML.pfx;not" >
+<!ENTITY % implies.qname        "%MATHML.pfx;implies" >
+<!ENTITY % divergence.qname     "%MATHML.pfx;divergence" >
+<!ENTITY % grad.qname           "%MATHML.pfx;grad" >
+<!ENTITY % curl.qname           "%MATHML.pfx;curl" >
+<!ENTITY % laplacian.qname      "%MATHML.pfx;laplacian" >
+<!ENTITY % log.qname            "%MATHML.pfx;log" >
+<!ENTITY % int.qname            "%MATHML.pfx;int" >
+<!ENTITY % diff.qname           "%MATHML.pfx;diff" >
+<!ENTITY % partialdiff.qname    "%MATHML.pfx;partialdiff" >
+<!ENTITY % ln.qname             "%MATHML.pfx;ln" >
+<!ENTITY % card.qname           "%MATHML.pfx;card" >
+<!ENTITY % setdiff.qname        "%MATHML.pfx;setdiff" >
+<!ENTITY % union.qname          "%MATHML.pfx;union" >
+<!ENTITY % intersect.qname      "%MATHML.pfx;intersect" >
+<!ENTITY % sum.qname            "%MATHML.pfx;sum" >
+<!ENTITY % product.qname        "%MATHML.pfx;product" >
+<!ENTITY % limit.qname          "%MATHML.pfx;limit" >
+<!ENTITY % sin.qname            "%MATHML.pfx;sin" >
+<!ENTITY % cos.qname            "%MATHML.pfx;cos" >
+<!ENTITY % tan.qname            "%MATHML.pfx;tan" >
+<!ENTITY % sec.qname            "%MATHML.pfx;sec" >
+<!ENTITY % csc.qname            "%MATHML.pfx;csc" >
+<!ENTITY % cot.qname            "%MATHML.pfx;cot" >
+<!ENTITY % sinh.qname           "%MATHML.pfx;sinh" >
+<!ENTITY % cosh.qname           "%MATHML.pfx;cosh" >
+<!ENTITY % tanh.qname           "%MATHML.pfx;tanh" >
+<!ENTITY % sech.qname           "%MATHML.pfx;sech" >
+<!ENTITY % csch.qname           "%MATHML.pfx;csch" >
+<!ENTITY % coth.qname           "%MATHML.pfx;coth" >
+<!ENTITY % arcsin.qname         "%MATHML.pfx;arcsin" >
+<!ENTITY % arccos.qname         "%MATHML.pfx;arccos" >
+<!ENTITY % arctan.qname         "%MATHML.pfx;arctan" >
+<!ENTITY % arccosh.qname        "%MATHML.pfx;arccosh" >
+<!ENTITY % arccot.qname         "%MATHML.pfx;arccot" >
+<!ENTITY % arccoth.qname        "%MATHML.pfx;arccoth" >
+<!ENTITY % arccsc.qname         "%MATHML.pfx;arccsc" >
+<!ENTITY % arccsch.qname        "%MATHML.pfx;arccsch" >
+<!ENTITY % arcsec.qname         "%MATHML.pfx;arcsec" >
+<!ENTITY % arcsech.qname        "%MATHML.pfx;arcsech" >
+<!ENTITY % arcsinh.qname        "%MATHML.pfx;arcsinh" >
+<!ENTITY % arctanh.qname        "%MATHML.pfx;arctanh" >
+<!ENTITY % arccosh.qname        "%MATHML.pfx;arccosh" >
+<!ENTITY % mean.qname           "%MATHML.pfx;mean" >
+<!ENTITY % sdev.qname           "%MATHML.pfx;sdev" >
+<!ENTITY % variance.qname       "%MATHML.pfx;variance" >
+<!ENTITY % median.qname         "%MATHML.pfx;median" >
+<!ENTITY % mode.qname           "%MATHML.pfx;mode" >
+<!ENTITY % moment.qname         "%MATHML.pfx;moment" >
+<!ENTITY % determinant.qname    "%MATHML.pfx;determinant" >
+<!ENTITY % transpose.qname      "%MATHML.pfx;transpose" >
+<!ENTITY % vectorproduct.qname  "%MATHML.pfx;vectorproduct" >
+<!ENTITY % scalarproduct.qname  "%MATHML.pfx;scalarproduct" >
+<!ENTITY % outerproduct.qname   "%MATHML.pfx;outerproduct" >
+<!ENTITY % selector.qname       "%MATHML.pfx;selector" >
+<!ENTITY % neq.qname            "%MATHML.pfx;neq" >
+<!ENTITY % eq.qname             "%MATHML.pfx;eq" >
+<!ENTITY % equivalent.qname     "%MATHML.pfx;equivalent" >
+<!ENTITY % approx.qname         "%MATHML.pfx;approx" >
+<!ENTITY % gt.qname             "%MATHML.pfx;gt" >
+<!ENTITY % lt.qname             "%MATHML.pfx;lt" >
+<!ENTITY % geq.qname            "%MATHML.pfx;geq" >
+<!ENTITY % leq.qname            "%MATHML.pfx;leq" >
+<!ENTITY % in.qname             "%MATHML.pfx;in" >
+<!ENTITY % notin.qname          "%MATHML.pfx;notin" >
+<!ENTITY % notsubset.qname      "%MATHML.pfx;notsubset" >
+<!ENTITY % notprsubset.qname    "%MATHML.pfx;notprsubset" >
+<!ENTITY % subset.qname         "%MATHML.pfx;subset" >
+<!ENTITY % prsubset.qname       "%MATHML.pfx;prsubset" >
+<!ENTITY % tendsto.qname        "%MATHML.pfx;tendsto" >
+<!ENTITY % ci.qname             "%MATHML.pfx;ci" >
+<!ENTITY % csymbol.qname        "%MATHML.pfx;csymbol" >
+<!ENTITY % cn.qname             "%MATHML.pfx;cn" >
+<!ENTITY % apply.qname          "%MATHML.pfx;apply" >
+<!ENTITY % reln.qname           "%MATHML.pfx;reln" >
+<!ENTITY % lambda.qname         "%MATHML.pfx;lambda" >
+<!ENTITY % condition.qname      "%MATHML.pfx;condition" >
+<!ENTITY % declare.qname        "%MATHML.pfx;declare" >
+<!ENTITY % type.qname           "%MATHML.pfx;type" >
+<!ENTITY % semantics.qname      "%MATHML.pfx;semantics" >
+<!ENTITY % annotation.qname     "%MATHML.pfx;annotation" >
+<!ENTITY % annotation-xml.qname "%MATHML.pfx;annotation-xml" >
+<!ENTITY % interval.qname       "%MATHML.pfx;interval" >
+<!ENTITY % set.qname            "%MATHML.pfx;set" >
+<!ENTITY % list.qname           "%MATHML.pfx;list" >
+<!ENTITY % vector.qname         "%MATHML.pfx;vector" >
+<!ENTITY % matrix.qname         "%MATHML.pfx;matrix" >
+<!ENTITY % matrixrow.qname      "%MATHML.pfx;matrixrow" >
+<!ENTITY % fn.qname             "%MATHML.pfx;fn" >
+<!ENTITY % lowlimit.qname       "%MATHML.pfx;lowlimit" >
+<!ENTITY % uplimit.qname        "%MATHML.pfx;uplimit" >
+<!ENTITY % bvar.qname           "%MATHML.pfx;bvar" >
+<!ENTITY % degree.qname         "%MATHML.pfx;degree" >
+<!ENTITY % logbase.qname        "%MATHML.pfx;logbase" >
+<!ENTITY % mstyle.qname         "%MATHML.pfx;mstyle" >
+<!ENTITY % merror.qname         "%MATHML.pfx;merror" >
+<!ENTITY % mphantom.qname       "%MATHML.pfx;mphantom" >
+<!ENTITY % mrow.qname           "%MATHML.pfx;mrow" >
+<!ENTITY % mfrac.qname          "%MATHML.pfx;mfrac" >
+<!ENTITY % msqrt.qname          "%MATHML.pfx;msqrt" >
+<!ENTITY % menclose.qname       "%MATHML.pfx;menclose" >
+<!ENTITY % mroot.qname          "%MATHML.pfx;mroot" >
+<!ENTITY % msub.qname           "%MATHML.pfx;msub" >
+<!ENTITY % msup.qname           "%MATHML.pfx;msup" >
+<!ENTITY % msubsup.qname        "%MATHML.pfx;msubsup" >
+<!ENTITY % mmultiscripts.qname  "%MATHML.pfx;mmultiscripts" >
+<!ENTITY % munder.qname         "%MATHML.pfx;munder" >
+<!ENTITY % mover.qname          "%MATHML.pfx;mover" >
+<!ENTITY % munderover.qname     "%MATHML.pfx;munderover" >
+<!ENTITY % mtable.qname         "%MATHML.pfx;mtable" >
+<!ENTITY % mtr.qname            "%MATHML.pfx;mtr" >
+<!ENTITY % mlabeledtr.qname     "%MATHML.pfx;mlabeledtr" >
+<!ENTITY % mtd.qname            "%MATHML.pfx;mtd" >
+<!ENTITY % maction.qname        "%MATHML.pfx;maction" >
+<!ENTITY % mfenced.qname        "%MATHML.pfx;mfenced" >
+<!ENTITY % mpadded.qname        "%MATHML.pfx;mpadded" >
+<!ENTITY % mi.qname             "%MATHML.pfx;mi" >
+<!ENTITY % mn.qname             "%MATHML.pfx;mn" >
+<!ENTITY % mo.qname             "%MATHML.pfx;mo" >
+<!ENTITY % mtext.qname          "%MATHML.pfx;mtext" >
+<!ENTITY % ms.qname             "%MATHML.pfx;ms" >
+<!ENTITY % math.qname           "%MATHML.pfx;math" >
+
+
+<!-- ignores subsequent instantiation of this module when
+     used as external subset rather than module fragment.
+     NOTE: Do not modify this parameter entity, otherwise
+     a recursive parsing situation may result.
+-->
+<!ENTITY % mathml-qname.module "IGNORE" >
+
+<!-- end of template-qname-1.mod -->
diff --git a/helm/dtd/mathml2.dtd b/helm/dtd/mathml2.dtd
new file mode 100644 (file)
index 0000000..a9b7bf1
--- /dev/null
@@ -0,0 +1,1948 @@
+<!-- MathML 2.0 DTD  ....................................................... -->
+<!-- file: mathml2.dtd
+-->
+
+<!-- MathML 2.0 DTD
+
+     This is the Mathematical Markup Language (MathML) 2.0, an XML
+     application for describing mathematical notation and capturing
+     both its structure and content.
+
+     Copyright 1998-2000 World Wide Web Consortium
+        (Massachusetts Institute of Technology, Institut National de
+         Recherche en Informatique et en Automatique, Keio University).
+         All Rights Reserved.
+
+     Permission to use, copy, modify and distribute the XHTML 1.1 DTD and
+     its accompanying documentation for any purpose and without fee is
+     hereby granted in perpetuity, provided that the above copyright notice
+     and this paragraph appear in all copies.  The copyright holders make
+     no representation about the suitability of the DTD for any purpose.
+
+     It is provided "as is" without expressed or implied warranty.
+
+        Revision:   $Id$
+
+     This entity may be identified by the PUBLIC and SYSTEM identifiers:
+
+       PUBLIC "-//W3C//DTD MathML 2.0//EN"
+       SYSTEM "mathml2.dtd"
+
+     Revisions: editor and revision history at EOF
+-->
+
+
+<!-- MathML Qualified Names module ............................... -->
+<!ENTITY % mathml-qname.module "INCLUDE" >
+<![%mathml-qname.module;[
+<!ENTITY % mathml-qname.mod
+     PUBLIC "-//W3C//ENTITIES MathML 2.0 Qualified Names 1.0//EN"
+            "mathml2-qname-1.mod" >
+%mathml-qname.mod;]]>
+
+<!-- if %NS.prefixed; is INCLUDE, include all NS attributes, 
+     otherwise just those associated with MathML
+-->
+<![%NS.prefixed;[
+<!-- HELM: %NamespaceDecl.attrib; not declared !! ENTITY substituted
+<!ENTITY % MATHML.NamespaceDecl.attrib 
+     "%NamespaceDecl.attrib;"
+>-->
+<!ENTITY % MATHML.NamespaceDecl.attrib 
+     "%MATHML.xmlns.attrib;"
+>
+]]>
+<!ENTITY % MATHML.NamespaceDecl.attrib 
+     "%MATHML.xmlns.attrib;"
+>
+
+<!-- Attributes shared by all elements  .......................... -->
+
+<!ENTITY % MATHML.Common.attrib
+     "%MATHML.NamespaceDecl.attrib;
+      xlink:href   CDATA                    #IMPLIED
+      class        CDATA                    #IMPLIED
+      style        CDATA                    #IMPLIED
+      id           ID                       #IMPLIED
+      xref         IDREF                    #IMPLIED
+      other        CDATA                    #IMPLIED"
+>
+
+<!-- Presentation element set  ................................... -->
+
+<!-- Attribute definitions -->
+
+<!ENTITY % att-fontsize
+     "fontsize     CDATA                    #IMPLIED" >
+<!ENTITY % att-fontweight
+     "fontweight   ( normal | bold )        #IMPLIED" >
+<!ENTITY % att-fontstyle
+     "fontstyle    ( normal | italic )      #IMPLIED" >
+<!ENTITY % att-fontfamily
+     "fontfamily   CDATA                    #IMPLIED" >
+<!ENTITY % att-color
+     "color        CDATA                    #IMPLIED" >
+
+<!ENTITY % att-fontinfo
+     "%att-fontsize;
+      %att-fontweight;
+      %att-fontstyle;
+      %att-fontfamily;
+      %att-color;"
+>
+
+<!ENTITY % att-form
+     "form         ( prefix | infix | postfix )  #IMPLIED" >
+<!ENTITY % att-fence
+     "fence        ( true | false )         #IMPLIED" >
+<!ENTITY % att-separator
+     "separator    ( true | false )         #IMPLIED" >
+<!ENTITY % att-lspace
+     "lspace       CDATA                    #IMPLIED" >
+<!ENTITY % att-rspace
+     "rspace       CDATA                    #IMPLIED" >
+<!ENTITY % att-stretchy
+     "stretchy     ( true | false )         #IMPLIED" >
+<!ENTITY % att-symmetric
+     "symmetric    ( true | false )         #IMPLIED" >
+<!ENTITY % att-maxsize
+     "maxsize      CDATA                    #IMPLIED" >
+<!ENTITY % att-minsize
+     "minsize      CDATA                    #IMPLIED" >
+<!ENTITY % att-largeop
+     "largeop      ( true | false)          #IMPLIED" >
+<!ENTITY % att-movablelimits
+     "movablelimits ( true | false )        #IMPLIED" >
+<!ENTITY % att-accent
+     "accent       ( true | false )         #IMPLIED" >
+
+<!ENTITY % att-opinfo
+     "%att-form;
+      %att-fence;
+      %att-separator;
+      %att-lspace;
+      %att-rspace;
+      %att-stretchy;
+      %att-symmetric;
+      %att-maxsize;
+      %att-minsize;
+      %att-largeop;
+      %att-movablelimits;
+      %att-accent;"
+>
+<!ENTITY % att-width
+     "width        CDATA                    #IMPLIED" >
+<!ENTITY % att-height
+     "height       CDATA                    #IMPLIED" >
+<!ENTITY % att-depth
+     "depth        CDATA                    #IMPLIED" >
+<!ENTITY % att-linebreak
+     "linebreak    CDATA                    #IMPLIED" >
+<!ENTITY % att-sizeinfo
+     "%att-width;
+      %att-height;
+      %att-depth;"
+>
+<!ENTITY % att-lquote               
+     "lquote       CDATA                    #IMPLIED" >
+<!ENTITY % att-rquote               
+     "rquote       CDATA                    #IMPLIED" >
+<!ENTITY % att-linethickness        
+     "linethickness CDATA                   #IMPLIED" >
+<!ENTITY % att-scriptlevel          
+     "scriptlevel  CDATA                    #IMPLIED" >
+<!ENTITY % att-displaystyle         
+     "displaystyle ( true | false )         #IMPLIED" >
+<!ENTITY % att-scriptsizemultiplier 
+     "scriptsizemultiplier CDATA            #IMPLIED" >
+<!ENTITY % att-scriptminsize        
+     "scriptminsize CDATA                   #IMPLIED" >
+<!ENTITY % att-background           
+     "background   CDATA                    #IMPLIED" >
+<!ENTITY % att-open                 
+     "open         CDATA                    #IMPLIED" >
+<!ENTITY % att-close                
+     "close        CDATA                    #IMPLIED" >
+<!ENTITY % att-separators          
+     "separators   CDATA                    #IMPLIED" >
+<!ENTITY % att-subscriptshift       
+     "subscriptshift CDATA                  #IMPLIED" >
+<!ENTITY % att-superscriptshift     
+     "superscriptshift CDATA                #IMPLIED" >
+<!ENTITY % att-accentunder          
+     "accentunder  ( true | false )         #IMPLIED" >
+<!ENTITY % att-align       
+     "align        CDATA                    #IMPLIED" >
+<!ENTITY % att-rowalign      
+     "rowalign     CDATA                    #IMPLIED" >
+<!ENTITY % att-columnalign     
+     "columnalign  CDATA                    #IMPLIED" >
+<!ENTITY % att-columnwidth   
+     "columnwidth  CDATA                    #IMPLIED" >
+<!ENTITY % att-groupalign      
+     "groupalign   CDATA                    #IMPLIED" >
+<!ENTITY % att-alignmentscope 
+     "alignmentscope CDATA                  #IMPLIED" >
+<!ENTITY % att-rowspacing           
+     "rowspacing   CDATA                    #IMPLIED" >
+<!ENTITY % att-columnspacing      
+     "columnspacing CDATA                   #IMPLIED" >
+<!ENTITY % att-rowlines            
+     "rowlines     CDATA                    #IMPLIED" >
+<!ENTITY % att-columnlines        
+     "columnlines  CDATA                    #IMPLIED" >
+<!ENTITY % att-frame            
+     "frame       ( none | solid | dashed ) #IMPLIED" >
+<!ENTITY % att-framespacing         
+     "framespacing CDATA                    #IMPLIED" >
+<!ENTITY % att-equalrows        
+     "equalrows    CDATA                    #IMPLIED" >
+<!ENTITY % att-equalcolumns         
+     "equalcolumns CDATA                    #IMPLIED" >
+
+<!ENTITY % att-tableinfo            
+     "%att-align;
+      %att-rowalign;
+      %att-columnalign;
+      %att-columnwidth;
+      %att-groupalign;
+      %att-alignmentscope;
+      %att-rowspacing;
+      %att-columnspacing;
+      %att-rowlines;
+      %att-columnlines;
+      %att-frame;
+      %att-framespacing;
+      %att-equalrows;
+      %att-equalcolumns;
+      %att-displaystyle;" 
+>
+
+<!ENTITY % att-rowspan              
+     "rowspan      CDATA                    #IMPLIED" >
+<!ENTITY % att-columnspan           
+     "columnspan   CDATA                    #IMPLIED" >
+<!ENTITY % att-edge        
+     "edge         ( left | right )         #IMPLIED" >
+<!ENTITY % att-actiontype          
+     "actiontype   CDATA                    #IMPLIED" >
+<!ENTITY % att-selection       
+     "selection    CDATA                    #IMPLIED" >
+
+<!ENTITY % att-name                 
+     "name         CDATA                    #IMPLIED" >
+<!ENTITY % att-alt              
+     "alt          CDATA                    #IMPLIED" >
+<!ENTITY % att-index           
+     "index        CDATA                    #IMPLIED" >
+
+<!ENTITY % att-bevelled       
+     "bevelled      CDATA                    #IMPLIED" >
+
+<!-- Presentation schemata with content -->
+
+<!ENTITY % ptoken                   
+     "%mi.qname; | %mn.qname; | %mo.qname;
+      | %mtext.qname; | %ms.qname;" >
+
+<!ATTLIST %mi.qname;
+      %MATHML.Common.attrib;
+      %att-fontinfo;
+>
+
+<!ATTLIST %mn.qname;      
+      %MATHML.Common.attrib; 
+      %att-fontinfo;
+>
+
+<!ATTLIST %mo.qname;     
+      %MATHML.Common.attrib; 
+      %att-fontinfo;
+      %att-opinfo;
+>
+
+<!ATTLIST %mtext.qname;  
+      %MATHML.Common.attrib;
+      %att-fontinfo;
+>
+
+<!ATTLIST %ms.qname;     
+      %MATHML.Common.attrib;
+      %att-fontinfo;
+      %att-lquote;
+      %att-rquote;
+>
+
+<!-- Empty presentation schemata -->
+
+<!ENTITY % petoken                  
+     "%mspace.qname;" >
+<!ELEMENT %mspace.qname;  EMPTY >
+
+<!ATTLIST %mspace.qname; 
+      %att-sizeinfo;
+      %att-linebreak;
+      %MATHML.Common.attrib;
+>
+
+<!-- Presentation: general layout schemata -->
+
+<!ENTITY % pgenschema               
+     "%mrow.qname; | %mfrac.qname; | %msqrt.qname; | %mroot.qname; 
+      | %menclose.qname; | %mstyle.qname; | %merror.qname; 
+      | %mpadded.qname; | %mphantom.qname; | %mfenced.qname;" >
+
+<!ATTLIST %mrow.qname;        
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %mfrac.qname;     
+      %MATHML.Common.attrib;
+      %att-bevelled;
+      %att-linethickness;
+>
+
+<!ATTLIST %msqrt.qname;     
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %menclose.qname;  
+      %MATHML.Common.attrib;
+      notation CDATA 'longdiv' >
+
+<!ATTLIST %mroot.qname;    
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %mstyle.qname;  
+      %MATHML.Common.attrib;
+      %att-fontinfo;
+      %att-opinfo;
+      %att-lquote;
+      %att-rquote;
+      %att-linethickness;
+      %att-scriptlevel;
+      %att-scriptsizemultiplier;
+      %att-scriptminsize;
+      %att-background;
+      %att-open;
+      %att-close;
+      %att-separators;
+      %att-subscriptshift;
+      %att-superscriptshift;
+      %att-accentunder;
+      %att-tableinfo;
+      %att-rowspan;
+      %att-columnspan;
+      %att-edge;
+      %att-actiontype;
+      %att-selection;
+>
+
+<!ATTLIST %merror.qname;   
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %mpadded.qname;     
+      %MATHML.Common.attrib;
+      %att-sizeinfo;
+      %att-lspace;
+>
+
+<!ATTLIST %mphantom.qname;      
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %mfenced.qname;     
+      %MATHML.Common.attrib;
+      %att-open;
+      %att-close;
+      %att-separators;
+>
+
+<!-- Presentation layout schemata: scripts and limits -->
+
+<!ENTITY % pscrschema               
+     "%msub.qname; | %msup.qname; | %msubsup.qname; | %munder.qname; 
+      | %mover.qname; | %munderover.qname; | %mmultiscripts.qname;" >
+
+<!ATTLIST %msub.qname;      
+      %MATHML.Common.attrib;
+      %att-subscriptshift;
+>
+
+<!ATTLIST %msup.qname;         
+      %MATHML.Common.attrib;
+      %att-superscriptshift;
+>
+
+<!ATTLIST %msubsup.qname;    
+      %MATHML.Common.attrib;
+      %att-subscriptshift;
+      %att-superscriptshift;
+>
+
+<!ATTLIST %munder.qname;   
+      %MATHML.Common.attrib;
+      %att-accentunder;
+>
+
+<!ATTLIST %mover.qname;   
+      %MATHML.Common.attrib;
+      %att-accent;
+>
+
+<!ATTLIST %munderover.qname;   
+      %MATHML.Common.attrib;
+      %att-accent;
+      %att-accentunder;
+>
+
+<!ATTLIST %mmultiscripts.qname;   
+      %MATHML.Common.attrib;
+      %att-subscriptshift;
+      %att-superscriptshift;
+>
+
+<!-- Presentation layout schemata: empty elements for scripts -->
+
+<!ENTITY % pscreschema              
+     "%mprescripts.qname; | %none.qname;" >
+
+<!ELEMENT %mprescripts.qname;  EMPTY >
+<!ATTLIST %mprescripts.qname;   
+      %MATHML.xmlns.attrib; >
+
+<!ELEMENT %none.qname;  EMPTY >
+<!ATTLIST %none.qname;    
+      %MATHML.xmlns.attrib; >
+
+<!-- Presentation layout schemata: tables -->
+
+<!ENTITY % ptabschema               
+     "%mtable.qname; | %mtr.qname; | %mlabeledtr.qname; | %mtd.qname;" >
+
+<!ATTLIST %mtable.qname;
+      %MATHML.Common.attrib;
+      %att-tableinfo;
+>
+
+<!ATTLIST %mtr.qname;    
+      %MATHML.Common.attrib;
+      %att-rowalign;
+      %att-columnalign;
+      %att-groupalign;
+>
+
+<!ATTLIST %mlabeledtr.qname;  
+      %MATHML.Common.attrib;
+      %att-rowalign;
+      %att-columnalign;
+      %att-groupalign;
+>
+
+<!ATTLIST %mtd.qname;   
+      %MATHML.Common.attrib;
+      %att-rowalign;
+      %att-columnalign;
+      %att-groupalign;
+      %att-rowspan;
+      %att-columnspan;
+>
+
+<!ENTITY % plschema                 
+     "%pgenschema; | %pscrschema; | %ptabschema;" >
+
+<!-- Empty presentation layout schemata -->
+
+<!ENTITY % peschema                 
+     "%maligngroup.qname; | %malignmark.qname;" >
+
+<!ELEMENT %malignmark.qname;  EMPTY >
+
+<!ATTLIST %malignmark.qname;  
+      %att-edge; >
+
+<!ELEMENT %maligngroup.qname;  EMPTY >
+<!ATTLIST %maligngroup.qname;  
+      %MATHML.Common.attrib;
+      %att-groupalign;
+>
+
+<!ELEMENT %mchar.qname;  EMPTY >
+<!ATTLIST %mchar.qname;    
+      %att-name; >
+
+<!ELEMENT %mglyph.qname;  EMPTY >
+<!ATTLIST %mglyph.qname;    
+      %att-alt;
+      %att-fontfamily;
+      %att-index; >
+
+<!-- Presentation action schemata -->
+
+<!ENTITY % pactions                 
+     "%maction.qname;" >
+<!ATTLIST %maction.qname;    
+      %MATHML.Common.attrib;
+      %att-actiontype;
+      %att-selection;
+>
+
+<!-- The following entity for substitution into
+     content constructs excludes elements that
+     are not valid as expressions.
+-->
+
+<!ENTITY % PresInCont               
+     "%ptoken; | %petoken; |
+      %plschema; | %peschema; | %pactions;" >
+
+<!-- Presentation entity: all presentation constructs -->
+
+<!ENTITY % Presentation             
+     "%ptoken; | %petoken; | %pscreschema; |
+      %plschema; | %peschema; | %pactions;">
+
+<!-- Content element set  ........................................ -->
+
+<!-- Attribute definitions -->
+
+<!ENTITY % att-base                 
+     "base         CDATA                    '10'" >
+<!ENTITY % att-closure              
+     "closure      CDATA                    'closed'" >
+<!ENTITY % att-definition           
+     "definitionURL CDATA                   ''" >
+<!ENTITY % att-encoding             
+     "encoding     CDATA                    ''" >
+<!ENTITY % att-nargs             
+     "nargs        CDATA                    '1'" >
+<!ENTITY % att-occurrence           
+     "occurrence   CDATA                    'function-model'" >
+<!ENTITY % att-order   
+     "order        CDATA                    'numeric'" >
+<!ENTITY % att-scope                
+     "scope        CDATA                    'local'" >
+<!ENTITY % att-type                 
+     "type         CDATA                    #IMPLIED" >
+
+<!-- Content elements: leaf nodes -->
+
+<!ENTITY % ctoken               
+     "%csymbol.qname; | %ci.qname; | %cn.qname;" >
+
+<!ATTLIST %ci.qname;     
+      %MATHML.Common.attrib;
+      %att-type;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ATTLIST %csymbol.qname;   
+      %MATHML.Common.attrib;
+      %att-encoding;
+      %att-type;
+      %att-definition;
+>
+
+<!ATTLIST %cn.qname;    
+      %MATHML.Common.attrib;
+      %att-type;
+      %att-base;
+      %att-definition;
+      %att-encoding;
+>
+
+<!-- Content elements: specials -->
+
+<!ENTITY % cspecial                 
+     "%apply.qname; | %reln.qname; |
+      %lambda.qname;" >
+
+<!ATTLIST %apply.qname;   
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %reln.qname;   
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %lambda.qname;      
+      %MATHML.Common.attrib;
+>
+
+<!-- Content elements: others -->
+<!-- HELM: added the content element type to cother-->
+<!ENTITY % cother                   
+     "%condition.qname; | %declare.qname; | %sep.qname; | %type.qname;" >
+
+<!ATTLIST %condition.qname;     
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %declare.qname;    
+      %MATHML.Common.attrib;
+      %att-type;
+      %att-scope;
+      %att-nargs;
+      %att-occurrence;
+      %att-definition;
+      %att-encoding;
+>
+
+<!-- HELM: added attributes to the type element -->
+<!ATTLIST %type.qname;            %MATHML.Common.attrib; >
+
+<!ELEMENT %sep.qname;  EMPTY >
+<!ATTLIST %sep.qname;         
+      %MATHML.xmlns.attrib; >
+
+<!-- Content elements: semantic mapping -->
+
+<!ENTITY % csemantics               
+     "%semantics.qname; | %annotation.qname; |
+      %annotation-xml.qname;" >
+
+<!ATTLIST %semantics.qname;  
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ATTLIST %annotation.qname;  
+      %MATHML.Common.attrib;
+      %att-encoding;
+>
+
+<!ATTLIST %annotation-xml.qname; 
+      %MATHML.Common.attrib;
+      %att-encoding;
+>
+
+<!-- Content elements: constructors -->
+
+<!ENTITY % cconstructor             
+     "%interval.qname; | %list.qname; | %matrix.qname; 
+      | %matrixrow.qname; | %set.qname; | %vector.qname;" >
+
+<!ATTLIST %interval.qname;   
+      %MATHML.Common.attrib;
+      %att-closure;
+>
+
+<!ATTLIST %set.qname;        
+      %MATHML.Common.attrib;
+      %att-type;
+>
+
+<!ATTLIST %list.qname;          
+      %MATHML.Common.attrib;
+      %att-order;
+>
+
+<!ATTLIST %vector.qname;    
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %matrix.qname;    
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %matrixrow.qname;     
+      %MATHML.Common.attrib;
+>
+
+<!-- Content elements: symbols -->
+
+<!ENTITY % c0ary              
+    "%integers.qname; |
+     %reals.qname; |
+     %rationals.qname; |
+     %naturalnumbers.qname; |
+     %complexes.qname; |
+     %primes.qname; |
+     %exponentiale.qname; |
+     %imaginaryi.qname; |
+     %notanumber.qname; |
+     %true.qname; |
+     %false.qname; |
+     %emptyset.qname; |
+     %pi.qname; |
+     %eulergamma.qname; |
+     %infinity.qname;" >
+
+<!ELEMENT %integers.qname;  EMPTY >
+<!ATTLIST %integers.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %reals.qname;  EMPTY >
+<!ATTLIST %reals.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %rationals.qname;  EMPTY >
+<!ATTLIST %rationals.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %naturalnumbers.qname;  EMPTY >
+<!ATTLIST %naturalnumbers.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %complexes.qname;  EMPTY >
+<!ATTLIST %complexes.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %primes.qname;  EMPTY >
+<!ATTLIST %primes.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %exponentiale.qname;  EMPTY >
+<!ATTLIST %exponentiale.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %imaginaryi.qname;  EMPTY >
+<!ATTLIST %imaginaryi.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %notanumber.qname;  EMPTY >
+<!ATTLIST %notanumber.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %true.qname;  EMPTY >
+<!ATTLIST %true.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %false.qname;  EMPTY >
+<!ATTLIST %false.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %emptyset.qname;  EMPTY >
+<!ATTLIST %emptyset.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %pi.qname;  EMPTY >
+<!ATTLIST %pi.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %eulergamma.qname;  EMPTY >
+<!ATTLIST %eulergamma.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %infinity.qname;  EMPTY >
+<!ATTLIST %infinity.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!-- Content elements: operators -->
+
+<!ENTITY % cfuncop1ary              
+     "%inverse.qname; | %ident.qname;" >
+
+<!ELEMENT %inverse.qname;  EMPTY >
+<!ATTLIST %inverse.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % cfuncopnary              
+     "%fn.qname; | %compose.qname;" >
+
+<!ATTLIST %fn.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %ident.qname;  EMPTY >
+<!ATTLIST %ident.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %compose.qname;  EMPTY >
+<!ATTLIST %compose.qname;  
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % carithop1ary             
+     "%abs.qname; | %conjugate.qname; | %exp.qname; | %factorial.qname; |
+      %arg.qname; | %real.qname; | %imaginary.qname;" >
+
+<!ELEMENT %exp.qname;  EMPTY >
+<!ATTLIST %exp.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %abs.qname;  EMPTY >
+<!ATTLIST %abs.qname;        
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arg.qname;  EMPTY >
+<!ATTLIST %arg.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %real.qname;  EMPTY >
+<!ATTLIST %real.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %imaginary.qname;  EMPTY >
+<!ATTLIST %imaginary.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %conjugate.qname;  EMPTY >
+<!ATTLIST %conjugate.qname;  
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %factorial.qname;  EMPTY >
+<!ATTLIST %factorial.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % carithop1or2ary          
+     "%minus.qname;" >
+
+<!ELEMENT %minus.qname;  EMPTY >
+<!ATTLIST %minus.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % carithop2ary             
+     "%quotient.qname; | %divide.qname; | %power.qname; | %rem.qname;" >
+
+<!ELEMENT %quotient.qname;  EMPTY >
+<!ATTLIST %quotient.qname;       
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %divide.qname;  EMPTY >
+<!ATTLIST %divide.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %power.qname;  EMPTY >
+<!ATTLIST %power.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %rem.qname;  EMPTY >
+<!ATTLIST %rem.qname;       
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % carithopnary             
+     "%plus.qname; | %times.qname; | %max.qname; 
+      | %min.qname; | %gcd.qname; | %lcm.qname;" >
+
+<!ELEMENT %plus.qname;  EMPTY >
+<!ATTLIST %plus.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %max.qname;  EMPTY >
+<!ATTLIST %max.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %min.qname;  EMPTY >
+<!ATTLIST %min.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %times.qname;  EMPTY >
+<!ATTLIST %times.qname;      
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %gcd.qname;  EMPTY >
+<!ATTLIST %gcd.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %lcm.qname;  EMPTY >
+<!ATTLIST %lcm.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % carithoproot             
+     "%root.qname;" >
+
+<!ELEMENT %root.qname;  EMPTY >
+<!ATTLIST %root.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clogicopquant            
+     "%exists.qname; | %forall.qname;" >
+
+<!ELEMENT %exists.qname;  EMPTY >
+<!ATTLIST %exists.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %forall.qname;  EMPTY >
+<!ATTLIST %forall.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clogicopnary             
+     "%and.qname; | %or.qname; | %xor.qname;" >
+
+<!ELEMENT %and.qname;  EMPTY >
+<!ATTLIST %and.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %or.qname;  EMPTY >
+<!ATTLIST %or.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %xor.qname;  EMPTY >
+<!ATTLIST %xor.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clogicop1ary             
+     "%not.qname;" >
+
+<!ELEMENT %not.qname;  EMPTY >
+<!ATTLIST %not.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clogicop2ary             
+     "%implies.qname;" >
+
+<!ELEMENT %implies.qname;  EMPTY >
+<!ATTLIST %implies.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % ccalcop                  
+     "%log.qname; | %int.qname; | %diff.qname; | %partialdiff.qname; |
+      %divergence.qname; | %grad.qname; | %curl.qname; | %laplacian.qname;" >
+
+<!ELEMENT %divergence.qname;  EMPTY >
+<!ATTLIST %divergence.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %grad.qname;  EMPTY >
+<!ATTLIST %grad.qname;  
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %curl.qname;  EMPTY >
+<!ATTLIST %curl.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %laplacian.qname;  EMPTY >
+<!ATTLIST %laplacian.qname;     
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %log.qname;  EMPTY >
+<!ATTLIST %log.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %int.qname;  EMPTY >
+<!ATTLIST %int.qname;    
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %diff.qname;  EMPTY >
+<!ATTLIST %diff.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %partialdiff.qname;  EMPTY >
+<!ATTLIST %partialdiff.qname;  
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % ccalcop1ary              
+     "%ln.qname;" >
+
+<!ELEMENT %ln.qname;  EMPTY >
+<!ATTLIST %ln.qname;   
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % csetop1ary               
+     "%card.qname;" >
+
+<!ELEMENT %card.qname;  EMPTY >
+<!ATTLIST %card.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % csetop2ary               
+     "%setdiff.qname;" >
+
+<!ELEMENT %setdiff.qname;  EMPTY >
+<!ATTLIST %setdiff.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % csetopnary               
+     "%union.qname; | %intersect.qname;" >
+
+<!ELEMENT %union.qname;  EMPTY >
+<!ATTLIST %union.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %intersect.qname;  EMPTY >
+<!ATTLIST %intersect.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % cseqop                   
+     "%sum.qname; | %product.qname; | %limit.qname;" >
+
+<!ELEMENT %sum.qname;  EMPTY >
+<!ATTLIST %sum.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %product.qname;  EMPTY >
+<!ATTLIST %product.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %limit.qname;  EMPTY >
+<!ATTLIST %limit.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % ctrigop                  
+     "%sin.qname; | %cos.qname; | %tan.qname; 
+      | %sec.qname; | %csc.qname; | %cot.qname; 
+      | %sinh.qname; | %cosh.qname; | %tanh.qname; 
+      | %sech.qname; | %csch.qname; | %coth.qname; 
+      | %arcsin.qname; | %arccos.qname; | %arctan.qname;
+      | %arccosh.qname; | %arccot.qname; | %arccoth.qname;
+      | %arccsc.qname; | %arccsch.qname; | %arcsec.qname;
+      | %arcsech.qname; | %arcsinh.qname; | %arctanh.qname;
+      " >
+
+<!ELEMENT %sin.qname;  EMPTY >
+<!ATTLIST %sin.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %cos.qname;  EMPTY >
+<!ATTLIST %cos.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %tan.qname;  EMPTY >
+<!ATTLIST %tan.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %sec.qname;  EMPTY >
+<!ATTLIST %sec.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %csc.qname;  EMPTY >
+<!ATTLIST %csc.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %cot.qname;  EMPTY >
+<!ATTLIST %cot.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %sinh.qname;  EMPTY >
+<!ATTLIST %sinh.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %cosh.qname;  EMPTY >
+<!ATTLIST %cosh.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %tanh.qname;  EMPTY >
+<!ATTLIST %tanh.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %sech.qname;  EMPTY >
+<!ATTLIST %sech.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %csch.qname;  EMPTY >
+<!ATTLIST %csch.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %coth.qname;  EMPTY >
+<!ATTLIST %coth.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arcsin.qname;  EMPTY >
+<!ATTLIST %arcsin.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arccos.qname;  EMPTY >
+<!ATTLIST %arccos.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arctan.qname;  EMPTY >
+<!ATTLIST %arctan.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arccosh.qname;  EMPTY >
+<!ATTLIST %arccosh.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+
+<!ELEMENT %arccot.qname;  EMPTY >
+<!ATTLIST %arccot.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arccoth.qname;  EMPTY >
+<!ATTLIST %arccoth.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+
+<!ELEMENT %arccsc.qname;  EMPTY >
+<!ATTLIST %arccsc.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arccsch.qname;  EMPTY >
+<!ATTLIST %arccsch.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arcsec.qname;  EMPTY >
+<!ATTLIST %arcsec.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arcsech.qname;  EMPTY >
+<!ATTLIST %arcsech.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arcsinh.qname;  EMPTY >
+<!ATTLIST %arcsinh.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %arctanh.qname;  EMPTY >
+<!ATTLIST %arctanh.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+
+
+<!ENTITY % cstatopnary              
+     "%mean.qname; | %sdev.qname; |
+      %variance.qname; | %median.qname; |
+      %mode.qname;" >
+
+<!ELEMENT %mean.qname;  EMPTY >
+<!ATTLIST %mean.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %sdev.qname;  EMPTY >
+<!ATTLIST %sdev.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %variance.qname;  EMPTY >
+<!ATTLIST %variance.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %median.qname;  EMPTY >
+<!ATTLIST %median.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %mode.qname;  EMPTY >
+<!ATTLIST %mode.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % cstatopmoment            
+     "%moment.qname;" >
+
+<!ELEMENT %moment.qname;  EMPTY >
+<!ATTLIST %moment.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clalgop1ary              
+     "%determinant.qname; |
+      %transpose.qname;" >
+
+<!ELEMENT %determinant.qname;  EMPTY >
+<!ATTLIST %determinant.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %transpose.qname;  EMPTY >
+<!ATTLIST %transpose.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clalgop2ary              
+     "%vectorproduct.qname; 
+      | %scalarproduct.qname; 
+      | %outerproduct.qname;" >
+
+<!ELEMENT %vectorproduct.qname;  EMPTY >
+<!ATTLIST %vectorproduct.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %scalarproduct.qname;  EMPTY >
+<!ATTLIST %scalarproduct.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %outerproduct.qname;  EMPTY >
+<!ATTLIST %outerproduct.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % clalgopnary              
+     "%selector.qname;" >
+
+<!ELEMENT %selector.qname;  EMPTY >
+<!ATTLIST %selector.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!-- Content elements: relations -->
+
+<!ENTITY % cgenrel2ary             
+     "%neq.qname;" >
+
+<!ELEMENT %neq.qname;  EMPTY >
+<!ATTLIST %neq.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % cgenrelnary              
+     "%eq.qname; | %leq.qname; | %lt.qname; | %geq.qname; 
+      | %gt.qname;| %equivalent.qname; | %approx.qname;" >
+
+<!ELEMENT %eq.qname;  EMPTY >
+<!ATTLIST %eq.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %equivalent.qname;  EMPTY >
+<!ATTLIST %equivalent.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %approx.qname;  EMPTY >
+<!ATTLIST %approx.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %gt.qname;  EMPTY >
+<!ATTLIST %gt.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %lt.qname;  EMPTY >
+<!ATTLIST %lt.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %geq.qname;  EMPTY >
+<!ATTLIST %geq.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %leq.qname;  EMPTY >
+<!ATTLIST %leq.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % csetrel2ary              
+     "%in.qname; | %notin.qname; | %notsubset.qname; | %notprsubset.qname;" >
+
+<!ELEMENT %in.qname;  EMPTY >
+<!ATTLIST %in.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %notin.qname;  EMPTY >
+<!ATTLIST %notin.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %notsubset.qname;  EMPTY >
+<!ATTLIST %notsubset.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %notprsubset.qname;  EMPTY >
+<!ATTLIST %notprsubset.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % csetrelnary       
+     "%subset.qname; | %prsubset.qname;" >
+
+<!ELEMENT %subset.qname;  EMPTY >
+<!ATTLIST %subset.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ELEMENT %prsubset.qname;  EMPTY >
+<!ATTLIST %prsubset.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+>
+
+<!ENTITY % cseqrel2ary              
+     "%tendsto.qname;" >
+
+<!ELEMENT %tendsto.qname;  EMPTY >
+<!ATTLIST %tendsto.qname;
+      %MATHML.Common.attrib;
+      %att-definition;
+      %att-encoding;
+      %att-type;
+>
+
+<!-- Content elements: quantifiers -->
+
+<!ENTITY % cquantifier            
+     "%lowlimit.qname; | %uplimit.qname; | %bvar.qname; 
+      | %degree.qname; | %logbase.qname;" >
+
+<!ATTLIST %lowlimit.qname;
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %uplimit.qname;
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %bvar.qname;
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %degree.qname;
+      %MATHML.Common.attrib;
+>
+
+<!ATTLIST %logbase.qname;
+      %MATHML.Common.attrib;
+>
+
+<!-- Operator groups -->
+
+<!ENTITY % cop1ary                  
+     "%cfuncop1ary; | %carithop1ary; | %clogicop1ary; |
+      %ccalcop1ary; | %ctrigop; | %clalgop1ary; |
+      %csetop1ary;" >
+
+<!ENTITY % cop2ary                  
+     "%carithop2ary; | %clogicop2ary;| %clalgop2ary; | %csetop2ary;" >
+
+<!ENTITY % copnary                  
+     "%cfuncopnary; | %carithopnary; | %clogicopnary; |
+      %csetopnary; | %cstatopnary; | %clalgopnary;" >
+
+<!ENTITY % copmisc                  
+     "%carithoproot; | %carithop1or2ary; | %ccalcop; |
+      %cseqop; | %cstatopmoment; | %clogicopquant;" >
+
+<!-- Relation groups -->
+
+<!ENTITY % crel2ary                 
+     "%cgenrel2ary; | %csetrel2ary; | %cseqrel2ary;" >
+
+<!ENTITY % crelnary                 
+     "%cgenrelnary; | %csetrelnary;" >
+
+<!-- Content constructs: all -->
+
+<!ENTITY % Content                  
+     "%ctoken; | %cspecial; | %cother; | %csemantics; | %c0ary;
+      | %cconstructor; | %cquantifier; | %cop1ary; | %cop2ary; 
+      | %copnary; |%copmisc; | %crel2ary; | %crelnary;" >
+
+<!-- Content constructs for substitution in presentation structures -->
+
+<!ENTITY % ContInPres               
+     "%ci.qname; |%csymbol.qname;| %cn.qname;|
+      %apply.qname; | %fn.qname; |
+      %lambda.qname; | %reln.qname; |
+      %interval.qname; | %list.qname; |
+      %matrix.qname; | %matrixrow.qname; |
+      %set.qname; | %vector.qname; |
+      %semantics.qname; |%declare.qname;" >
+
+<!-- ............................................................. -->
+<!-- Recursive definition for content of expressions. Include
+     presentation constructs at lowest level so presentation
+     layout schemata hold presentation or content elements.
+     Include content constructs at lowest level so content
+     elements hold PCDATA or presentation elements at leaf
+     level (for permitted substitutable elements in context)
+-->
+
+<!ENTITY % ContentExpression        
+     "(%Content; | %PresInCont;)*" >
+<!ENTITY % PresExpression      
+     "(%Presentation; | %ContInPres;)*" >
+<!ENTITY % MathExpression           
+     "(%PresInCont; | %ContInPres;)*" >
+
+<!-- PCDATA or MathML character elements -->
+<!ENTITY % MathMLCharacters         
+     "#PCDATA | %mchar.qname; | %mglyph.qname; " >
+
+<!-- Content elements: tokens                       -->
+<!-- (may contain embedded presentation constructs) -->
+
+<!ELEMENT %ci.qname;                 (%MathMLCharacters; | %PresInCont;)* >
+<!ELEMENT %csymbol.qname;            (%MathMLCharacters; | %PresInCont;)* >
+<!ELEMENT %cn.qname;                 (%MathMLCharacters; | %sep.qname; | %PresInCont;)* >
+
+<!-- Content elements: special -->
+
+<!ELEMENT %apply.qname;              (%ContentExpression;) >
+<!ELEMENT %reln.qname;               (%ContentExpression;) >
+<!ELEMENT %lambda.qname;             (%ContentExpression;) >
+
+<!-- Content elements: other -->
+
+<!ELEMENT %condition.qname;          (%ContentExpression;) >
+<!ELEMENT %declare.qname;            (%ContentExpression;) >
+<!-- HELM: added the content element type --> 
+<!ELEMENT %type.qname;               (%ContentExpression;) >
+
+<!-- Content elements: semantics -->
+
+<!ELEMENT %semantics.qname;          (%ContentExpression;) >
+<!ENTITY % Annotation.content  "( #PCDATA )" >
+<!ELEMENT %annotation.qname;         %Annotation.content; >
+
+<!ENTITY % Annotation-xml.content "ANY" >
+<!ELEMENT %annotation-xml.qname;     %Annotation-xml.content; >
+
+<!-- Content elements: constructors -->
+
+<!ELEMENT %interval.qname;           (%ContentExpression;) >
+<!ELEMENT %set.qname;                (%ContentExpression;) >
+<!ELEMENT %list.qname;               (%ContentExpression;) >
+<!ELEMENT %vector.qname;             (%ContentExpression;) >
+<!ELEMENT %matrix.qname;             (%ContentExpression;) >
+<!ELEMENT %matrixrow.qname;          (%ContentExpression;) >
+
+<!-- Content elements: operator (user-defined) -->
+
+<!ELEMENT %fn.qname;                 (%ContentExpression;) >
+
+<!-- Content elements: quantifiers -->
+
+<!ELEMENT %lowlimit.qname;           (%ContentExpression;) >
+<!ELEMENT %uplimit.qname;            (%ContentExpression;) >
+<!ELEMENT %bvar.qname;               (%ContentExpression;) >
+<!ELEMENT %degree.qname;             (%ContentExpression;) >
+<!ELEMENT %logbase.qname;            (%ContentExpression;) >
+
+<!-- ............................................................. -->
+<!-- Presentation layout schemata contain tokens,
+     layout and content schemata.
+-->
+
+<!ELEMENT %mstyle.qname;             (%PresExpression;) >
+<!ELEMENT %merror.qname;             (%PresExpression;) >
+<!ELEMENT %mphantom.qname;           (%PresExpression;) >
+<!ELEMENT %mrow.qname;               (%PresExpression;) >
+<!ELEMENT %mfrac.qname;              (%PresExpression;) >
+<!ELEMENT %msqrt.qname;              (%PresExpression;) >
+<!ELEMENT %menclose.qname;           (%PresExpression;) >
+<!ELEMENT %mroot.qname;              (%PresExpression;) >
+<!ELEMENT %msub.qname;               (%PresExpression;) >
+<!ELEMENT %msup.qname;               (%PresExpression;) >
+<!ELEMENT %msubsup.qname;            (%PresExpression;) >
+<!ELEMENT %mmultiscripts.qname;      (%PresExpression;) >
+<!ELEMENT %munder.qname;             (%PresExpression;) >
+<!ELEMENT %mover.qname;              (%PresExpression;) >
+<!ELEMENT %munderover.qname;         (%PresExpression;) >
+<!ELEMENT %mtable.qname;             (%PresExpression;) >
+<!ELEMENT %mtr.qname;                (%PresExpression;) >
+<!ELEMENT %mlabeledtr.qname;         (%PresExpression;) >
+<!ELEMENT %mtd.qname;                (%PresExpression;) >
+<!ELEMENT %maction.qname;            (%PresExpression;) >
+<!ELEMENT %mfenced.qname;            (%PresExpression;) >
+<!ELEMENT %mpadded.qname;            (%PresExpression;) >
+
+<!-- Presentation elements contain PCDATA or malignmark constructs. -->
+
+<!ELEMENT %mi.qname;                 (%MathMLCharacters; |
+      %malignmark.qname;)* >
+<!ELEMENT %mn.qname;                 (%MathMLCharacters; |
+      %malignmark.qname;)* >
+<!ELEMENT %mo.qname;                 (%MathMLCharacters; |
+      %malignmark.qname;)* >
+<!ELEMENT %mtext.qname;              (%MathMLCharacters; |
+      %malignmark.qname;)* >
+<!ELEMENT %ms.qname;                 (%MathMLCharacters; |
+      %malignmark.qname;)* >
+
+<!-- Browser interface definition  ............................... -->
+
+<!-- Attributes for top-level element "math" -->
+
+<!ENTITY % att-macros               
+     "macros       CDATA                    #IMPLIED" >
+<!ENTITY % att-mode                 
+     "mode         CDATA                    #IMPLIED" >
+<!ENTITY % att-display                
+     "display      CDATA                    #IMPLIED" >
+
+<!ENTITY % att-topinfo          
+     "%MATHML.Common.attrib;
+      %att-macros;
+      %att-mode;
+      %att-display;" >
+
+<!-- Attributes for browser interface element -->
+
+<!ENTITY % att-baseline             
+     "baseline     CDATA                    #IMPLIED" >
+<!ENTITY % att-overflow            
+     "overflow  ( scroll | elide | truncate | scale ) 'scroll'" >
+<!ENTITY % att-altimg               
+     "altimg       CDATA                    #IMPLIED" >
+<!ENTITY % att-alttext           
+     "alttext      CDATA                    #IMPLIED" >
+
+<!ENTITY % att-browif           
+     "%att-type;
+      %att-name;
+      %att-height;
+      %att-width;
+      %att-baseline;
+      %att-overflow;
+      %att-altimg;
+      %att-alttext;" >
+
+<!-- ............................................................. -->
+<!-- The top-level element "math" contains MathML encoded
+     mathematics. The "math" element has the browser info
+     attributes iff it is also the browser interface element.
+-->
+
+<!ELEMENT %math.qname;               (%MathExpression;) >
+
+<!ATTLIST %math.qname;
+      %att-topinfo;
+      %att-browif; >
+
+<!-- MathML Character Entities .............................................. -->
+<!ENTITY % mathml-charent.module "INCLUDE" >
+<![%mathml-charent.module;[
+<!-- Entity sets from ISO Technical Report 9573-13 ..... -->
+
+<!ENTITY % ent-isoamsa
+      PUBLIC "-//W3C//ENTITIES Added Math Symbols: Arrow Relations for MathML 2.0//EN"
+             "isoamsa.ent" >
+%ent-isoamsa;
+
+<!ENTITY % ent-isoamsb
+      PUBLIC "-//W3C//ENTITIES Added Math Symbols: Binary Operators for MathML 2.0//EN"
+             "isoamsb.ent" >
+%ent-isoamsb;
+
+<!ENTITY % ent-isoamsc
+      PUBLIC "-//W3C//ENTITIES Added Math Symbols: Delimiters for MathML 2.0//EN"
+             "isoamsc.ent" >
+%ent-isoamsc;
+
+<!ENTITY % ent-isoamsn
+      PUBLIC "-//W3C//ENTITIES Added Math Symbols: Negated Relations for MathML 2.0//EN"
+             "isoamsn.ent" >
+%ent-isoamsn;
+
+<!ENTITY % ent-isoamso
+      PUBLIC "-//W3C//ENTITIES Added Math Symbols: Ordinary for MathML 2.0//EN"
+             "isoamso.ent" >
+%ent-isoamso;
+
+<!ENTITY % ent-isoamsr
+      PUBLIC "-//W3C//ENTITIES Added Math Symbols: Relations for MathML 2.0//EN"
+             "isoamsr.ent" >
+%ent-isoamsr;
+
+<!ENTITY % ent-isogrk3
+      PUBLIC "-//W3C//ENTITIES Greek Symbols for MathML 2.0//EN"
+             "isogrk3.ent" >
+%ent-isogrk3;
+
+<!ENTITY % ent-isomfrk
+      PUBLIC "-//W3C//ENTITIES Math Alphabets: Fraktur for MathML 2.0//EN"
+             "isomfrk.ent" >
+%ent-isomfrk;
+
+<!ENTITY % ent-isomopf
+      PUBLIC "-//W3C//ENTITIES Math Alphabets: Open Face for MathML 2.0//EN"
+             "isomopf.ent" >
+%ent-isomopf;
+
+<!ENTITY % ent-isomscr
+      PUBLIC "-//W3C//ENTITIES Math Alphabets: Script for MathML 2.0//EN"
+             "isomscr.ent" >
+%ent-isomscr;
+
+<!ENTITY % ent-isotech
+      PUBLIC "-//W3C//ENTITIES General Technical for MathML 2.0//EN"
+             "isotech.ent" >
+%ent-isotech;
+
+<!-- Entity sets from informative annex to ISO 8879:1986 (SGML) ....... -->
+
+<!ENTITY % ent-isobox
+      PUBLIC "-//W3C//ENTITIES Box and Line Drawing for MathML 2.0//EN"
+             "isobox.ent" >
+%ent-isobox;
+
+<!ENTITY % ent-isocyr1
+      PUBLIC "-//W3C//ENTITIES Russian Cyrillic for MathML 2.0//EN"
+             "isocyr1.ent" >
+%ent-isocyr1;
+
+<!ENTITY % ent-isocyr2
+      PUBLIC "-//W3C//ENTITIES Non-Russian Cyrillic for MathML 2.0//EN"
+             "isocyr2.ent" >
+%ent-isocyr2;
+
+<!ENTITY % ent-isodia
+      PUBLIC "-//W3C//ENTITIES Diacritical Marks for MathML 2.0//EN"
+             "isodia.ent" >
+%ent-isodia;
+
+<!ENTITY % ent-isolat1
+      PUBLIC "-//W3C//ENTITIES Added Latin 1 for MathML 2.0//EN"
+             "isolat1.ent" >
+%ent-isolat1;
+
+<!ENTITY % ent-isolat2
+      PUBLIC "-//W3C//ENTITIES Added Latin 2 for MathML 2.0//EN"
+             "isolat2.ent" >
+%ent-isolat2;
+
+<!ENTITY % ent-isonum
+      PUBLIC "-//W3C//ENTITIES Numeric and Special Graphic for MathML 2.0//EN"
+             "isonum.ent" >
+%ent-isonum;
+
+<!ENTITY % ent-isopub
+      PUBLIC "-//W3C//ENTITIES Publishing for MathML 2.0//EN"
+             "isopub.ent" >
+%ent-isopub;
+
+<!-- New characters defined by MathML ............................ -->
+
+<!ENTITY % ent-mmlextra
+      PUBLIC "-//W3C//ENTITIES Extra for MathML 2.0//EN"
+             "mmlextra.ent" >
+%ent-mmlextra;
+
+<!-- MathML aliases for characters defined above ................. -->
+
+<!ENTITY % ent-mmlalias
+      PUBLIC "-//W3C//ENTITIES Aiases for MathML 2.0//EN"
+             "mmlalias.ent" >
+%ent-mmlalias;
+
+<!-- end of MathML Character Entity section -->]]>
+
+<!-- Revision History:
+
+       Initial draft (syntax = XML) 1997-05-09
+          Stephen Buswell
+       Revised 1997-05-14
+          Robert Miner
+       Revised 1997-06-29 and 1997-07-02
+          Stephen Buswell
+       Revised 1997-12-15
+          Stephen Buswell
+       Revised 1998-02-08
+          Stephen Buswell
+       Revised 1998-04-04
+          Stephen Buswell
+       Entities and small revisions 1999-02-21
+          David Carlisle
+       Added attribute definitionURL to ci and cn 1999-10-11
+          Nico Poppelier
+       Additions for MathML 2  1999-12-16
+          David Carlisle
+       Namespace support 2000-01-14
+          David Carlisle
+       XHTML Compatibility 2000-02-23
+          Murray Altheim
+       New content elements 2000-03-26
+          David Carlisle
+
+-->
+
+<!-- end of MathML 2.0 DTD  ................................................ -->
+<!-- ....................................................................... -->
+
diff --git a/helm/dtd/maththeory.dtd b/helm/dtd/maththeory.dtd
new file mode 100644 (file)
index 0000000..85469b6
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR THEORY OBJECTS AT LEVEL OF CIC XML FILES:               -->
+<!-- First draft: May 10 2000, Claudio Sacerdoti Coen, Irene Schena  -->
+<!--*****************************************************************-->
+
+<!-- manca il semplice enunciato -->
+<!-- mancano i link ad altre teorie? (corrispondenti a Require?) -->
+<!-- una teoria "vuota" e' una teoria? -->
+<!ENTITY % mathstructure '(THEOREM|LEMMA|COROLLARY|AXIOM|FACT|DEFINITION|
+                           VARIABLE|SECTION)*'>
+
+<!ELEMENT Theory (%mathstructure;)>
+<!ATTLIST Theory
+          uri CDATA #REQUIRED>
+
+<!ELEMENT THEOREM EMPTY>
+<!ATTLIST THEOREM
+          id  IDREF #REQUIRED
+          uri CDATA #REQUIRED>
+
+<!ELEMENT LEMMA EMPTY>
+<!ATTLIST LEMMA
+          id     IDREF #REQUIRED
+          uri    CDATA #REQUIRED 
+          target IDREF #REQUIRED>
+
+<!ELEMENT COROLLARY EMPTY>
+<!ATTLIST COROLLARY
+          id     IDREF #REQUIRED
+          uri    CDATA #REQUIRED 
+          target IDREF #REQUIRED>
+
+<!ELEMENT AXIOM EMPTY>
+<!ATTLIST AXIOM
+          id  IDREF #REQUIRED
+          uri CDATA #REQUIRED>
+
+<!ELEMENT FACT EMPTY>
+<!ATTLIST FACT
+          id  IDREF #REQUIRED
+          uri CDATA #REQUIRED>
+
+<!ELEMENT DEFINITION EMPTY>
+<!ATTLIST DEFINITION
+          uri CDATA #REQUIRED>
+
+<!ELEMENT VARIABLE EMPTY>
+<!ATTLIST VARIABLE
+          uri CDATA #REQUIRED>
+
+<!ELEMENT SECTION (%mathstructure;)>
+<!ATTLIST SECTION
+          uri CDATA #REQUIRED>
+
+<!--
+ VINCOLI DI VALIDITA' NON ESPRIMIBILI NEL DTD:
+  Siano V una variabile e T,T' due fatti/definizioni/teoremi/lemmi/corollari
+
+   - per visualizzare T dipendente da T' dove T' e T sono definiti nella stessa
+     (da definirsi) teoria/sezione, debbo visualizzare anche T'? 
+   - per visualizzare T dipendente da T' dove anche T' e' visualizzato, debbo
+     visualizzare T necessariamente dopo T'?
+   + consistenza fra la dipendenza dei lemmi e dei corollari dal loro target
+     e quella effettiva data dal livello degli oggetti
+   + tutte le URI debbono essere relative e discendenti (= non contenti "..")
+   +? ogni lemma deve precedere (strettamente?) il suo target
+   +? ogni corollario deve seguire (strettamente?) il suo target
+   + se T/V dipende da V, allora V deve essere visualizzata 
+   + se T/V dipende da V, allora V deve essere visualizzata prima di T
+    PROBLEMA: NON ABBIAMO INFORMAZIONI SULLA DIPENDENZA DI V DA V!!!
+-->
diff --git a/helm/dtd/mmlalias.ent b/helm/dtd/mmlalias.ent
new file mode 100644 (file)
index 0000000..f5901b3
--- /dev/null
@@ -0,0 +1,529 @@
+
+<!--
+     File mmlalias.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+-->
+
+<!ENTITY angle            "&#x02220;" ><!--alias ISOAMSO ang -->
+<!ENTITY approx           "&#x02248;" ><!--alias ISOTECH ap -->
+<!ENTITY approxeq         "&#x0224A;" ><!--alias ISOAMSR ape -->
+<!ENTITY backcong         "&#x0224C;" ><!--alias ISOAMSR bcong -->
+<!ENTITY backepsilon      "&#x0213C;" ><!--alias ISOAMSR bepsi -->
+<!ENTITY backprime        "&#x02035;" ><!--alias ISOAMSO bprime -->
+<!ENTITY backsim          "&#x0223D;" ><!--alias ISOAMSR bsim -->
+<!ENTITY backsimeq        "&#x022CD;" ><!--alias ISOAMSR bsime -->
+<!ENTITY Backslash        "&#x02216;" ><!--alias ISOAMSB setmn -->
+<!ENTITY barwedge         "&#x022BC;" ><!--alias ISOAMSB barwed -->
+<!ENTITY because          "&#x02235;" ><!--alias ISOTECH becaus -->
+<!ENTITY Because          "&#x02235;" ><!--alias ISOTECH becaus -->
+<!ENTITY Bernoullis       "&#x0212C;" ><!--alias ISOTECH bernou -->
+<!ENTITY between          "&#x0226C;" ><!--alias ISOAMSR twixt -->
+<!ENTITY bigcap           "&#x022C2;" ><!--alias ISOAMSB xcap -->
+<!ENTITY bigcirc          "&#x025EF;" ><!--alias ISOAMSB xcirc -->
+<!ENTITY bigcup           "&#x022C3;" ><!--alias ISOAMSB xcup -->
+<!ENTITY bigodot          "&#x02299;" ><!--alias ISOAMSB xodot -->
+<!ENTITY bigoplus         "&#x02295;" ><!--alias ISOAMSB xoplus -->
+<!ENTITY bigotimes        "&#x02297;" ><!--alias ISOAMSB xotime -->
+<!ENTITY bigsqcup         "&#x02294;" ><!--alias ISOAMSB xsqcup -->
+<!ENTITY bigstar          "&#x02605;" ><!--ISOPUB    starf  -->
+<!ENTITY bigtriangledown  "&#x025BD;" ><!--alias ISOAMSB xdtri -->
+<!ENTITY bigtriangleup    "&#x025B3;" ><!--alias ISOAMSB xutri -->
+<!ENTITY biguplus         "&#x0228E;" ><!--alias ISOAMSB xuplus -->
+<!ENTITY bigvee           "&#x022C1;" ><!--alias ISOAMSB xvee -->
+<!ENTITY bigwedge         "&#x022C0;" ><!--alias ISOAMSB xwedge -->
+<!ENTITY bkarow           "&#x0290D;" ><!--alias ISOAMSA rbarr -->
+<!ENTITY blacklozenge     "&#x029EB;" ><!--alias ISOPUB lozf -->
+<!ENTITY blacksquare      "&#x025AA;" ><!--ISOTECH  squarf  -->
+<!ENTITY blacktriangle    "&#x025B4;" ><!--alias ISOPUB utrif -->
+<!ENTITY blacktriangledown "&#x025BE;" ><!--alias ISOPUB dtrif -->
+<!ENTITY blacktriangleleft "&#x025C2;" ><!--alias ISOPUB ltrif -->
+<!ENTITY blacktriangleright "&#x025B8;" ><!--alias ISOPUB rtrif -->
+<!ENTITY bot              "&#x022A5;" ><!--alias ISOTECH bottom -->
+<!ENTITY boxminus         "&#x0229F;" ><!--alias ISOAMSB minusb -->
+<!ENTITY boxplus          "&#x0229E;" ><!--alias ISOAMSB plusb -->
+<!ENTITY boxtimes         "&#x022A0;" ><!--alias ISOAMSB timesb -->
+<!ENTITY Breve            "&#x002D8;" ><!--alias ISODIA breve -->
+<!ENTITY bullet           "&#x02022;" ><!--alias ISOPUB bull -->
+<!ENTITY bumpeq           "&#x0224F;" ><!--alias ISOAMSR bumpe -->
+<!ENTITY Bumpeq           "&#x0224E;" ><!--alias ISOAMSR bump -->
+<!ENTITY Cedilla          "&#x000B8;" ><!--alias ISODIA cedil -->
+<!ENTITY centerdot        "&#x000B7;" ><!--alias ISONUM middot -->
+<!ENTITY CenterDot        "&#x000B7;" ><!--alias ISONUM middot -->
+<!ENTITY checkmark        "&#x02713;" ><!--alias ISOPUB check -->
+<!ENTITY circeq           "&#x02257;" ><!--alias ISOAMSR cire -->
+<!ENTITY circlearrowleft  "&#x021BA;" ><!--alias ISOAMSA olarr -->
+<!ENTITY circlearrowright "&#x021BB;" ><!--alias ISOAMSA orarr -->
+<!ENTITY circledast       "&#x0229B;" ><!--alias ISOAMSB oast -->
+<!ENTITY circledcirc      "&#x0229A;" ><!--alias ISOAMSB ocir -->
+<!ENTITY circleddash      "&#x0229D;" ><!--alias ISOAMSB odash -->
+<!ENTITY CircleDot        "&#x02299;" ><!--alias ISOAMSB odot -->
+<!ENTITY circledR         "&#x000AE;" ><!--alias ISONUM reg -->
+<!ENTITY circledS         "&#x024C8;" ><!--alias ISOAMSO oS -->
+<!ENTITY CircleMinus      "&#x02296;" ><!--alias ISOAMSB ominus -->
+<!ENTITY CirclePlus       "&#x02295;" ><!--alias ISOAMSB oplus -->
+<!ENTITY CircleTimes      "&#x02297;" ><!--alias ISOAMSB otimes -->
+<!ENTITY ClockwiseContourIntegral "&#x02232;" ><!--alias ISOTECH cwconint -->
+<!ENTITY CloseCurlyDoubleQuote "&#x0201D;" ><!--alias ISONUM rdquo -->
+<!ENTITY CloseCurlyQuote  "&#x02019;" ><!--alias ISONUM rsquo -->
+<!ENTITY clubsuit         "&#x02663;" ><!--ISOPUB    clubs  -->
+<!ENTITY coloneq          "&#x02254;" ><!--alias ISOAMSR colone -->
+<!ENTITY complement       "&#x02201;" ><!--alias ISOAMSO comp -->
+<!ENTITY Congruent        "&#x02261;" ><!--alias ISOTECH equiv -->
+<!ENTITY ContourIntegral  "&#x0222E;" ><!--alias ISOTECH conint -->
+<!ENTITY Coproduct        "&#x02210;" ><!--alias ISOAMSB coprod -->
+<!ENTITY CounterClockwiseContourIntegral "&#x02233;" ><!--alias ISOTECH awconint -->
+<!ENTITY CupCap           "&#x0224D;" ><!--alias ISOAMSR asymp -->
+<!ENTITY curlyeqprec      "&#x022DE;" ><!--alias ISOAMSR cuepr -->
+<!ENTITY curlyeqsucc      "&#x022DF;" ><!--alias ISOAMSR cuesc -->
+<!ENTITY curlyvee         "&#x022CE;" ><!--alias ISOAMSB cuvee -->
+<!ENTITY curlywedge       "&#x022CF;" ><!--alias ISOAMSB cuwed -->
+<!ENTITY curvearrowleft   "&#x021B6;" ><!--alias ISOAMSA cularr -->
+<!ENTITY curvearrowright  "&#x021B7;" ><!--alias ISOAMSA curarr -->
+<!ENTITY dbkarow          "&#x0290F;" ><!--alias ISOAMSA rBarr -->
+<!ENTITY ddagger          "&#x02021;" ><!--alias ISOPUB Dagger -->
+<!ENTITY ddotseq          "&#x02A77;" ><!--alias ISOAMSR eDDot -->
+<!ENTITY Del              "&#x02207;" ><!--alias ISOTECH nabla -->
+<!ENTITY DiacriticalAcute "&#x000B4;" ><!--alias ISODIA acute -->
+<!ENTITY DiacriticalDot   "&#x002D9;" ><!--alias ISODIA dot -->
+<!ENTITY DiacriticalDoubleAcute "&#x002DD;" ><!--alias ISODIA dblac -->
+<!ENTITY DiacriticalGrave "&#x00060;" ><!--alias ISODIA grave -->
+<!ENTITY DiacriticalTilde "&#x002DC;" ><!--alias ISODIA tilde -->
+<!ENTITY diamond          "&#x022C4;" ><!--alias ISOAMSB diam -->
+<!ENTITY Diamond          "&#x022C4;" ><!--alias ISOAMSB diam -->
+<!ENTITY diamondsuit      "&#x02666;" ><!--ISOPUB    diams  -->
+<!ENTITY digamma          "&#x003DC;" ><!--alias ISOGRK3 gammad -->
+<!ENTITY div              "&#x000F7;" ><!--alias ISONUM divide -->
+<!ENTITY divideontimes    "&#x022C7;" ><!--alias ISOAMSB divonx -->
+<!ENTITY doteq            "&#x02250;" ><!--alias ISOAMSR esdot -->
+<!ENTITY doteqdot         "&#x02251;" ><!--alias ISOAMSR eDot -->
+<!ENTITY DotEqual         "&#x02250;" ><!--alias ISOAMSR esdot -->
+<!ENTITY dotminus         "&#x02238;" ><!--alias ISOAMSB minusd -->
+<!ENTITY dotplus          "&#x02214;" ><!--alias ISOAMSB plusdo -->
+<!ENTITY dotsquare        "&#x022A1;" ><!--alias ISOAMSB sdotb -->
+<!ENTITY doublebarwedge   "&#x02306;" ><!--alias ISOAMSB Barwed -->
+<!ENTITY DoubleContourIntegral "&#x0222F;" ><!--alias ISOTECH Conint -->
+<!ENTITY DoubleDot        "&#x000A8;" ><!--alias ISODIA die -->
+<!ENTITY DoubleDownArrow  "&#x021D3;" ><!--alias ISOAMSA dArr -->
+<!ENTITY DoubleLeftArrow  "&#x021D0;" ><!--alias ISOTECH lArr -->
+<!ENTITY DoubleLeftRightArrow "&#x021D4;" ><!--alias ISOAMSA hArr -->
+<!ENTITY DoubleLeftTee    "&#x02AE4;" ><!--alias for  &Dashv;  -->
+<!ENTITY DoubleLongLeftArrow "&#x021D0;" ><!--alias ISOAMSA xlArr -->
+<!ENTITY DoubleLongLeftRightArrow "&#x021D4;" ><!--alias ISOAMSA xhArr -->
+<!ENTITY DoubleLongRightArrow "&#x021D2;" ><!--alias ISOAMSA xrArr -->
+<!ENTITY DoubleRightArrow "&#x021D2;" ><!--alias ISOTECH rArr -->
+<!ENTITY DoubleRightTee   "&#x022A8;" ><!--alias ISOAMSR vDash -->
+<!ENTITY DoubleUpArrow    "&#x021D1;" ><!--alias ISOAMSA uArr -->
+<!ENTITY DoubleUpDownArrow "&#x021D5;" ><!--alias ISOAMSA vArr -->
+<!ENTITY DoubleVerticalBar "&#x02225;" ><!--alias ISOTECH par -->
+<!ENTITY downarrow        "&#x02193;" ><!--alias ISONUM darr -->
+<!ENTITY Downarrow        "&#x021D3;" ><!--alias ISOAMSA dArr -->
+<!ENTITY DownArrow        "&#x02193;" ><!--alias ISONUM darr -->
+<!ENTITY DownArrowUpArrow "&#x021F5;" ><!--alias ISOAMSA duarr -->
+<!ENTITY downdownarrows   "&#x021CA;" ><!--alias ISOAMSA ddarr -->
+<!ENTITY downharpoonleft  "&#x021C3;" ><!--alias ISOAMSA dharl -->
+<!ENTITY downharpoonright "&#x021C2;" ><!--alias ISOAMSA dharr -->
+<!ENTITY DownLeftVector   "&#x021BD;" ><!--alias ISOAMSA lhard -->
+<!ENTITY DownRightVector  "&#x021C1;" ><!--alias ISOAMSA rhard -->
+<!ENTITY DownTee          "&#x022A4;" ><!--alias ISOTECH top -->
+<!ENTITY drbkarow         "&#x02910;" ><!--alias ISOAMSA RBarr -->
+<!ENTITY Element          "&#x02208;" ><!--alias ISOTECH isinv -->
+<!ENTITY emptyset         "&#x02205;&#x02063;" ><!--alias ISOAMSO empty -->
+<!ENTITY eqcirc           "&#x02256;" ><!--alias ISOAMSR ecir -->
+<!ENTITY eqcolon          "&#x02255;" ><!--alias ISOAMSR ecolon -->
+<!ENTITY eqsim            "&#x02242;" ><!--alias ISOAMSR esim -->
+<!ENTITY eqslantgtr       "&#x022DD;" ><!--alias ISOAMSR egs -->
+<!ENTITY eqslantless      "&#x022DC;" ><!--alias ISOAMSR els -->
+<!ENTITY EqualTilde       "&#x02242;" ><!--alias ISOAMSR esim -->
+<!ENTITY Equilibrium      "&#x021CC;" ><!--alias ISOAMSA rlhar -->
+<!ENTITY Exists           "&#x02203;" ><!--alias ISOTECH exist -->
+<!ENTITY fallingdotseq    "&#x02252;" ><!--alias ISOAMSR efDot -->
+<!ENTITY ForAll           "&#x02200;" ><!--alias ISOTECH forall -->
+<!ENTITY geq              "&#x02265;" ><!--alias ISOTECH ge -->
+<!ENTITY geqq             "&#x02267;" ><!--alias ISOAMSR gE -->
+<!ENTITY geqslant         "&#x02A7E;" ><!--alias ISOAMSR ges -->
+<!ENTITY gg               "&#x0226B;" ><!--alias ISOAMSR Gt -->
+<!ENTITY ggg              "&#x022D9;" ><!--alias ISOAMSR Gg -->
+<!ENTITY gnapprox         "&#x02A8A;" ><!--alias ISOAMSN gnap -->
+<!ENTITY gneq             "&#x02269;" ><!--alias ISOAMSN gne -->
+<!ENTITY gneqq            "&#x02269;" ><!--alias ISOAMSN gnE -->
+<!ENTITY GreaterEqual     "&#x02265;" ><!--alias ISOTECH ge -->
+<!ENTITY GreaterEqualLess "&#x022DB;" ><!--alias ISOAMSR gel -->
+<!ENTITY GreaterFullEqual "&#x02267;" ><!--alias ISOAMSR gE -->
+<!ENTITY GreaterLess      "&#x02277;" ><!--alias ISOAMSR gl -->
+<!ENTITY GreaterSlantEqual "&#x02A7E;" ><!--alias ISOAMSR ges -->
+<!ENTITY GreaterTilde     "&#x02273;" ><!--alias ISOAMSR gsim -->
+<!ENTITY gtrapprox        "&#x02273;" ><!--alias ISOAMSR gap -->
+<!ENTITY gtrdot           "&#x022D7;" ><!--alias ISOAMSR gtdot -->
+<!ENTITY gtreqless        "&#x022DB;" ><!--alias ISOAMSR gel -->
+<!ENTITY gtreqqless       "&#x022DB;" ><!--alias ISOAMSR gEl -->
+<!ENTITY gtrless          "&#x02277;" ><!--alias ISOAMSR gl -->
+<!ENTITY gtrsim           "&#x02273;" ><!--alias ISOAMSR gsim -->
+<!ENTITY gvertneqq        "&#x02269;&#x00338;" ><!--alias ISOAMSN gvnE -->
+<!ENTITY Hacek            "&#x002C7;" ><!--alias ISODIA caron -->
+<!ENTITY Hat              "&#x00302;" ><!--circumflex accent (circ in ISODIA) -->
+<!ENTITY hbar             "&#x0210F;" ><!--alias ISOAMSO plank -->
+<!ENTITY heartsuit        "&#x02661;" ><!--ISOPUB    hearts  -->
+<!ENTITY hksearow         "&#x02925;" ><!--alias ISOAMSA searhk -->
+<!ENTITY hkswarow         "&#x02926;" ><!--alias ISOAMSA swarhk -->
+<!ENTITY hookleftarrow    "&#x021A9;" ><!--alias ISOAMSA larrhk -->
+<!ENTITY hookrightarrow   "&#x021AA;" ><!--alias ISOAMSA rarrhk -->
+<!ENTITY hslash           "&#x0210F;" ><!--alias ISOAMSO plankv -->
+<!ENTITY HumpDownHump     "&#x0224E;" ><!--alias ISOAMSR bump -->
+<!ENTITY HumpEqual        "&#x0224F;" ><!--alias ISOAMSR bumpe -->
+<!ENTITY iiiint           "&#x02A0C;" ><!--alias ISOTECH qint -->
+<!ENTITY iiint            "&#x0222D;" ><!--alias ISOTECH tint -->
+<!ENTITY Im               "&#x02111;" ><!--alias ISOAMSO image -->
+<!ENTITY imagpart         "&#x02111;" ><!--alias ISOAMSO image -->
+<!ENTITY Implies          "&#x021D2;" ><!--alias ISOTECH rArr -->
+<!ENTITY in               "&#x02208;" ><!--ISOTECH   isin  -->
+<!ENTITY Integral         "&#x0222B;" ><!--alias ISOTECH int -->
+<!ENTITY intercal         "&#x022BA;" ><!--alias ISOAMSB intcal -->
+<!ENTITY Intersection     "&#x022C2;" ><!--alias ISOAMSB xcap -->
+<!ENTITY intprod          "&#x02A3C;" ><!--alias ISOAMSB iprod -->
+<!ENTITY langle           "&#x03008;" ><!--alias ISOTECH lang -->
+<!ENTITY lbrace           "&#x0007B;" ><!--alias ISONUM lcub -->
+<!ENTITY lbrack           "&#x0005B;" ><!--alias ISONUM lsqb -->
+<!ENTITY LeftAngleBracket "&#x03008;" ><!--alias ISOTECH lang -->
+<!ENTITY leftarrow        "&#x02190;" ><!--alias ISONUM larr -->
+<!ENTITY Leftarrow        "&#x021D0;" ><!--alias ISOTECH lArr -->
+<!ENTITY LeftArrow        "&#x02190;" ><!--alias ISONUM larr -->
+<!ENTITY LeftArrowRightArrow "&#x021C6;" ><!--alias ISOAMSA lrarr -->
+<!ENTITY leftarrowtail    "&#x021A2;" ><!--alias ISOAMSA larrtl -->
+<!ENTITY LeftCeiling      "&#x02308;" ><!--alias ISOAMSC lceil -->
+<!ENTITY LeftDoubleBracket "&#x0301A;" ><!--left double bracket delimiter -->
+<!ENTITY LeftDownVector   "&#x021C3;" ><!--alias ISOAMSA dharl -->
+<!ENTITY LeftFloor        "&#x0230A;" ><!--alias ISOAMSC lfloor -->
+<!ENTITY leftharpoondown  "&#x021BD;" ><!--alias ISOAMSA lhard -->
+<!ENTITY leftharpoonup    "&#x021BC;" ><!--alias ISOAMSA lharu -->
+<!ENTITY leftleftarrows   "&#x021C7;" ><!--alias ISOAMSA llarr -->
+<!ENTITY leftrightarrow   "&#x02194;" ><!--alias ISOAMSA harr -->
+<!ENTITY Leftrightarrow   "&#x021D4;" ><!--alias ISOAMSA hArr -->
+<!ENTITY LeftRightArrow   "&#x02194;" ><!--alias ISOAMSA harr -->
+<!ENTITY leftrightarrows  "&#x021C6;" ><!--alias ISOAMSA lrarr -->
+<!ENTITY leftrightharpoons "&#x021CB;" ><!--alias ISOAMSA lrhar -->
+<!ENTITY leftrightsquigarrow "&#x021AD;" ><!--alias ISOAMSA harrw -->
+<!ENTITY LeftTee          "&#x022A3;" ><!--alias ISOAMSR dashv -->
+<!ENTITY leftthreetimes   "&#x022CB;" ><!--alias ISOAMSB lthree -->
+<!ENTITY LeftTriangle     "&#x022B2;" ><!--alias ISOAMSR vltri -->
+<!ENTITY LeftTriangleEqual "&#x022B4;" ><!--alias ISOAMSR ltrie -->
+<!ENTITY LeftUpVector     "&#x021BF;" ><!--alias ISOAMSA uharl -->
+<!ENTITY LeftVector       "&#x021BC;" ><!--alias ISOAMSA lharu -->
+<!ENTITY leq              "&#x02264;" ><!--alias ISOTECH le -->
+<!ENTITY leqq             "&#x02266;" ><!--alias ISOAMSR lE -->
+<!ENTITY leqslant         "&#x02A7D;" ><!--alias ISOAMSR les -->
+<!ENTITY lessapprox       "&#x02272;" ><!--alias ISOAMSR lap -->
+<!ENTITY lessdot          "&#x022D6;" ><!--alias ISOAMSR ltdot -->
+<!ENTITY lesseqgtr        "&#x022DA;" ><!--alias ISOAMSR leg -->
+<!ENTITY lesseqqgtr       "&#x022DA;" ><!--alias ISOAMSR lEg -->
+<!ENTITY LessEqualGreater "&#x022DA;" ><!--alias ISOAMSR leg -->
+<!ENTITY LessFullEqual    "&#x02266;" ><!--alias ISOAMSR lE -->
+<!ENTITY LessGreater      "&#x02276;" ><!--alias ISOAMSR lg -->
+<!ENTITY lessgtr          "&#x02276;" ><!--alias ISOAMSR lg -->
+<!ENTITY lesssim          "&#x02272;" ><!--alias ISOAMSR lsim -->
+<!ENTITY LessSlantEqual   "&#x02A7D;" ><!--alias ISOAMSR les -->
+<!ENTITY LessTilde        "&#x02272;" ><!--alias ISOAMSR lsim -->
+<!ENTITY ll               "&#x0226A;" ><!--alias ISOAMSR Lt -->
+<!ENTITY llcorner         "&#x0231E;" ><!--alias ISOAMSC dlcorn -->
+<!ENTITY Lleftarrow       "&#x021DA;" ><!--alias ISOAMSA lAarr -->
+<!ENTITY lmoustache       "&#x02998;" ><!--alias ISOAMSC lmoust -->
+<!ENTITY lnapprox         "&#x02A89;" ><!--alias ISOAMSN lnap -->
+<!ENTITY lneq             "&#x02268;" ><!--alias ISOAMSN lne -->
+<!ENTITY lneqq            "&#x02268;" ><!--alias ISOAMSN lnE -->
+<!ENTITY longleftarrow    "&#x02190;" ><!--alias ISOAMSA xlarr -->
+<!ENTITY Longleftarrow    "&#x021D0;" ><!--alias ISOAMSA xlArr -->
+<!ENTITY LongLeftArrow    "&#x02190;" ><!--alias ISOAMSA xlarr -->
+<!ENTITY longleftrightarrow "&#x02194;" ><!--alias ISOAMSA xharr -->
+<!ENTITY Longleftrightarrow "&#x021D4;" ><!--alias ISOAMSA xhArr -->
+<!ENTITY LongLeftRightArrow "&#x02194;" ><!--alias ISOAMSA xharr -->
+<!ENTITY longmapsto       "&#x021A6;" ><!--alias ISOAMSA xmap -->
+<!ENTITY longrightarrow   "&#x02192;" ><!--alias ISOAMSA xrarr -->
+<!ENTITY Longrightarrow   "&#x021D2;" ><!--alias ISOAMSA xrArr -->
+<!ENTITY LongRightArrow   "&#x02192;" ><!--alias ISOAMSA xrarr -->
+<!ENTITY looparrowleft    "&#x021AB;" ><!--alias ISOAMSA larrlp -->
+<!ENTITY looparrowright   "&#x021AC;" ><!--alias ISOAMSA rarrlp -->
+<!ENTITY LowerLeftArrow   "&#x02199;" ><!--alias ISOAMSA swarr -->
+<!ENTITY LowerRightArrow  "&#x02198;" ><!--alias ISOAMSA searr -->
+<!ENTITY lozenge          "&#x025CA;" ><!--alias ISOPUB loz -->
+<!ENTITY lrcorner         "&#x0231F;" ><!--alias ISOAMSC drcorn -->
+<!ENTITY Lsh              "&#x021B0;" ><!--alias ISOAMSA lsh -->
+<!ENTITY lvertneqq        "&#x02268;&#x00338;" ><!--alias ISOAMSN lvnE -->
+<!ENTITY maltese          "&#x02720;" ><!--alias ISOPUB malt -->
+<!ENTITY mapsto           "&#x021A6;" ><!--alias ISOAMSA map -->
+<!ENTITY measuredangle    "&#x02221;" ><!--alias ISOAMSO angmsd -->
+<!ENTITY MinusPlus        "&#x02213;" ><!--alias ISOTECH mnplus -->
+<!ENTITY mp               "&#x02213;" ><!--alias ISOTECH mnplus -->
+<!ENTITY multimap         "&#x022B8;" ><!--alias ISOAMSA mumap -->
+<!ENTITY napprox          "&#x02249;" ><!--alias ISOAMSN nap -->
+<!ENTITY natural          "&#x0266E;" ><!--alias ISOPUB natur -->
+<!ENTITY nearrow          "&#x02197;" ><!--alias ISOAMSA nearr -->
+<!ENTITY NestedGreaterGreater "&#x0226B;" ><!--alias ISOAMSR Gt -->
+<!ENTITY NestedLessLess   "&#x0226A;" ><!--alias ISOAMSR Lt -->
+<!ENTITY nexists          "&#x02204;" ><!--alias ISOAMSO nexist -->
+<!ENTITY ngeq             "&#x02271;&#x020E5;" ><!--alias ISOAMSN nge -->
+<!ENTITY ngeqq            "&#x02271;" ><!--alias ISOAMSN ngE -->
+<!ENTITY ngeqslant        "&#x02271;" ><!--alias ISOAMSN nges -->
+<!ENTITY ngtr             "&#x0226F;" ><!--alias ISOAMSN ngt -->
+<!ENTITY nleftarrow       "&#x0219A;" ><!--alias ISOAMSA nlarr -->
+<!ENTITY nLeftarrow       "&#x021CD;" ><!--alias ISOAMSA nlArr -->
+<!ENTITY nleftrightarrow  "&#x021AE;" ><!--alias ISOAMSA nharr -->
+<!ENTITY nLeftrightarrow  "&#x021CE;" ><!--alias ISOAMSA nhArr -->
+<!ENTITY nleq             "&#x02270;&#x020E5;" ><!--alias ISOAMSN nle -->
+<!ENTITY nleqq            "&#x02270;" ><!--alias ISOAMSN nlE -->
+<!ENTITY nleqslant        "&#x02270;" ><!--alias ISOAMSN nles -->
+<!ENTITY nless            "&#x0226E;" ><!--alias ISOAMSN nlt -->
+<!ENTITY NotCongruent     "&#x02262;" ><!--alias ISOAMSN nequiv -->
+<!ENTITY NotDoubleVerticalBar "&#x02226;" ><!--alias ISOAMSN npar -->
+<!ENTITY NotElement       "&#x02209;" ><!--alias ISOTECH notin -->
+<!ENTITY NotEqual         "&#x02260;" ><!--alias ISOTECH ne -->
+<!ENTITY NotExists        "&#x02204;" ><!--alias ISOAMSO nexist -->
+<!ENTITY NotGreater       "&#x0226F;" ><!--alias ISOAMSN ngt -->
+<!ENTITY NotGreaterEqual  "&#x02271;&#x020E5;" ><!--alias ISOAMSN nge -->
+<!ENTITY NotGreaterFullEqual "&#x02270;" ><!--alias ISOAMSN nlE -->
+<!ENTITY NotGreaterGreater "&#x0226B;&#x00338;&#x02063;" ><!--alias ISOAMSN nGtv -->
+<!ENTITY NotGreaterLess   "&#x02279;" ><!--alias ISOAMSN ntvgl -->
+<!ENTITY NotGreaterSlantEqual "&#x02271;" ><!--alias ISOAMSN nges -->
+<!ENTITY NotGreaterTilde  "&#x02275;" ><!--alias ISOAMSN ngsim -->
+<!ENTITY NotLeftTriangle  "&#x022EA;" ><!--alias ISOAMSN nltri -->
+<!ENTITY NotLeftTriangleEqual "&#x022EC;" ><!--alias ISOAMSN nltrie -->
+<!ENTITY NotLess          "&#x0226E;" ><!--alias ISOAMSN nlt -->
+<!ENTITY NotLessEqual     "&#x02270;&#x020E5;" ><!--alias ISOAMSN nle -->
+<!ENTITY NotLessGreater   "&#x02278;" ><!--alias ISOAMSN ntvlg -->
+<!ENTITY NotLessLess      "&#x0226A;&#x00338;&#x02063;" ><!--alias ISOAMSN nLtv -->
+<!ENTITY NotLessSlantEqual "&#x02270;" ><!--alias ISOAMSN nles -->
+<!ENTITY NotLessTilde     "&#x02274;" ><!--alias ISOAMSN nlsim -->
+<!ENTITY NotPrecedes      "&#x02280;" ><!--alias ISOAMSN npr -->
+<!ENTITY NotPrecedesEqual "&#x02AAF;&#x00338;" ><!--alias ISOAMSN npre -->
+<!ENTITY NotPrecedesSlantEqual "&#x022E0;" ><!--alias ISOAMSN nprcue -->
+<!ENTITY NotReverseElement "&#x0220C;" ><!--alias ISOTECH notniva -->
+<!ENTITY NotRightTriangle "&#x022EB;" ><!--alias ISOAMSN nrtri -->
+<!ENTITY NotRightTriangleEqual "&#x022ED;" ><!--alias ISOAMSN nrtrie -->
+<!ENTITY NotSquareSubsetEqual "&#x022E2;" ><!--alias ISOAMSN nsqsube -->
+<!ENTITY NotSquareSupersetEqual "&#x022E3;" ><!--alias ISOAMSN nsqsupe -->
+<!ENTITY NotSubset        "&#x02284;" ><!--alias ISOAMSN vnsub -->
+<!ENTITY NotSubsetEqual   "&#x02288;" ><!--alias ISOAMSN nsube -->
+<!ENTITY NotSucceeds      "&#x02281;" ><!--alias ISOAMSN nsc -->
+<!ENTITY NotSucceedsEqual "&#x02AB0;&#x00338;" ><!--alias ISOAMSN nsce -->
+<!ENTITY NotSucceedsSlantEqual "&#x022E1;" ><!--alias ISOAMSN nsccue -->
+<!ENTITY NotSuperset      "&#x02285;" ><!--alias ISOAMSN vnsup -->
+<!ENTITY NotSupersetEqual "&#x02289;" ><!--alias ISOAMSN nsupe -->
+<!ENTITY NotTilde         "&#x02241;" ><!--alias ISOAMSN nsim -->
+<!ENTITY NotTildeEqual    "&#x02244;" ><!--alias ISOAMSN nsime -->
+<!ENTITY NotTildeFullEqual "&#x02247;" ><!--alias ISOAMSN ncong -->
+<!ENTITY NotTildeTilde    "&#x02249;" ><!--alias ISOAMSN nap -->
+<!ENTITY NotVerticalBar   "&#x02224;" ><!--alias ISOAMSN nmid -->
+<!ENTITY nparallel        "&#x02226;" ><!--alias ISOAMSN npar -->
+<!ENTITY nprec            "&#x02280;" ><!--alias ISOAMSN npr -->
+<!ENTITY npreceq          "&#x02AAF;&#x00338;" ><!--alias ISOAMSN npre -->
+<!ENTITY nrightarrow      "&#x0219B;" ><!--alias ISOAMSA nrarr -->
+<!ENTITY nRightarrow      "&#x021CF;" ><!--alias ISOAMSA nrArr -->
+<!ENTITY nshortmid        "&#x02224;&#x02063;" ><!--alias ISOAMSN nsmid -->
+<!ENTITY nshortparallel   "&#x02226;&#x02063;" ><!--alias ISOAMSN nspar -->
+<!ENTITY nsimeq           "&#x02244;" ><!--alias ISOAMSN nsime -->
+<!ENTITY nsubset          "&#x02284;" ><!--alias ISOAMSN vnsub -->
+<!ENTITY nsubseteq        "&#x02288;" ><!--alias ISOAMSN nsube -->
+<!ENTITY nsubseteqq       "&#x02288;" ><!--alias ISOAMSN nsubE -->
+<!ENTITY nsucc            "&#x02281;" ><!--alias ISOAMSN nsc -->
+<!ENTITY nsucceq          "&#x02AB0;&#x00338;" ><!--alias ISOAMSN nsce -->
+<!ENTITY nsupset          "&#x02285;" ><!--alias ISOAMSN vnsup -->
+<!ENTITY nsupseteq        "&#x02289;" ><!--alias ISOAMSN nsupe -->
+<!ENTITY nsupseteqq       "&#x02289;" ><!--alias ISOAMSN nsupE -->
+<!ENTITY ntriangleleft    "&#x022EA;" ><!--alias ISOAMSN nltri -->
+<!ENTITY ntrianglelefteq  "&#x022EC;" ><!--alias ISOAMSN nltrie -->
+<!ENTITY ntriangleright   "&#x022EB;" ><!--alias ISOAMSN nrtri -->
+<!ENTITY ntrianglerighteq "&#x022ED;" ><!--alias ISOAMSN nrtrie -->
+<!ENTITY nwarrow          "&#x02196;" ><!--alias ISOAMSA nwarr -->
+<!ENTITY oint             "&#x0222E;" ><!--alias ISOTECH conint -->
+<!ENTITY OpenCurlyDoubleQuote "&#x0201C;" ><!--alias ISONUM ldquo -->
+<!ENTITY OpenCurlyQuote   "&#x02018;" ><!--alias ISONUM lsquo -->
+<!ENTITY orderof          "&#x02134;" ><!--alias ISOTECH order -->
+<!ENTITY parallel         "&#x02225;" ><!--alias ISOTECH par -->
+<!ENTITY PartialD         "&#x02202;" ><!--alias ISOTECH part -->
+<!ENTITY pitchfork        "&#x022D4;" ><!--alias ISOAMSR fork -->
+<!ENTITY PlusMinus        "&#x000B1;" ><!--alias ISONUM plusmn -->
+<!ENTITY pm               "&#x000B1;" ><!--alias ISONUM plusmn -->
+<!ENTITY prec             "&#x0227A;" ><!--alias ISOAMSR pr -->
+<!ENTITY precapprox       "&#x0227E;" ><!--alias ISOAMSR prap -->
+<!ENTITY preccurlyeq      "&#x0227C;" ><!--alias ISOAMSR prcue -->
+<!ENTITY Precedes         "&#x0227A;" ><!--alias ISOAMSR pr -->
+<!ENTITY PrecedesEqual    "&#x02AAF;" ><!--alias ISOAMSR pre -->
+<!ENTITY PrecedesSlantEqual "&#x0227C;" ><!--alias ISOAMSR prcue -->
+<!ENTITY PrecedesTilde    "&#x0227E;" ><!--alias ISOAMSR prsim -->
+<!ENTITY preceq           "&#x02AAF;" ><!--alias ISOAMSR pre -->
+<!ENTITY precnapprox      "&#x022E8;" ><!--alias ISOAMSN prnap -->
+<!ENTITY precneqq         "&#x02AB5;" ><!--alias ISOAMSN prnE -->
+<!ENTITY precnsim         "&#x022E8;" ><!--alias ISOAMSN prnsim -->
+<!ENTITY precsim          "&#x0227E;" ><!--alias ISOAMSR prsim -->
+<!ENTITY Proportion       "&#x02237;" ><!--alias ISOAMSR Colon -->
+<!ENTITY Proportional     "&#x0221D;" ><!--alias ISOTECH prop -->
+<!ENTITY propto           "&#x0221D;" ><!--alias ISOTECH prop -->
+<!ENTITY questeq          "&#x0225F;" ><!--alias ISOAMSR equest -->
+<!ENTITY rangle           "&#x03009;" ><!--alias ISOTECH rang -->
+<!ENTITY rbrace           "&#x0007D;" ><!--alias ISONUM rcub -->
+<!ENTITY rbrack           "&#x0005D;" ><!--alias ISONUM rsqb -->
+<!ENTITY Re               "&#x0211C;" ><!--alias ISOAMSO real -->
+<!ENTITY realpart         "&#x0211C;" ><!--alias ISOAMSO real -->
+<!ENTITY ReverseElement   "&#x0220B;" ><!--alias ISOTECH niv -->
+<!ENTITY ReverseEquilibrium "&#x021CB;" ><!--alias ISOAMSA lrhar -->
+<!ENTITY ReverseUpEquilibrium "&#x0296F;" ><!--alias ISOAMSA duhar -->
+<!ENTITY RightAngleBracket "&#x03009;" ><!--alias ISOTECH rang -->
+<!ENTITY rightarrow       "&#x02192;" ><!--alias ISONUM rarr -->
+<!ENTITY Rightarrow       "&#x021D2;" ><!--alias ISOTECH rArr -->
+<!ENTITY RightArrow       "&#x02192;" ><!--alias ISONUM rarr -->
+<!ENTITY RightArrowLeftArrow "&#x021C4;" ><!--alias ISOAMSA rlarr -->
+<!ENTITY rightarrowtail   "&#x021A3;" ><!--alias ISOAMSA rarrtl -->
+<!ENTITY RightCeiling     "&#x02309;" ><!--alias ISOAMSC rceil -->
+<!ENTITY RightDoubleBracket "&#x0301B;" ><!--right double bracket delimiter -->
+<!ENTITY RightDownVector  "&#x021C2;" ><!--alias ISOAMSA dharr -->
+<!ENTITY RightFloor       "&#x0230B;" ><!--alias ISOAMSC rfloor -->
+<!ENTITY rightharpoondown "&#x021C1;" ><!--alias ISOAMSA rhard -->
+<!ENTITY rightharpoonup   "&#x021C0;" ><!--alias ISOAMSA rharu -->
+<!ENTITY rightleftarrows  "&#x021C4;" ><!--alias ISOAMSA rlarr -->
+<!ENTITY rightleftharpoons "&#x021CC;" ><!--alias ISOAMSA rlhar -->
+<!ENTITY rightrightarrows "&#x021C9;" ><!--alias ISOAMSA rrarr -->
+<!ENTITY rightsquigarrow  "&#x021DD;" ><!--alias ISOAMSA rarrw -->
+<!ENTITY RightTee         "&#x022A2;" ><!--alias ISOAMSR vdash -->
+<!ENTITY RightTeeArrow    "&#x021A6;" ><!--alias ISOAMSA map -->
+<!ENTITY rightthreetimes  "&#x022CC;" ><!--alias ISOAMSB rthree -->
+<!ENTITY RightTriangle    "&#x022B3;" ><!--alias ISOAMSR vrtri -->
+<!ENTITY RightTriangleEqual "&#x022B5;" ><!--alias ISOAMSR rtrie -->
+<!ENTITY RightUpVector    "&#x021BE;" ><!--alias ISOAMSA uharr -->
+<!ENTITY RightVector      "&#x021C0;" ><!--alias ISOAMSA rharu -->
+<!ENTITY risingdotseq     "&#x02253;" ><!--alias ISOAMSR erDot -->
+<!ENTITY rmoustache       "&#x02997;" ><!--alias ISOAMSC rmoust -->
+<!ENTITY Rrightarrow      "&#x021DB;" ><!--alias ISOAMSA rAarr -->
+<!ENTITY Rsh              "&#x021B1;" ><!--alias ISOAMSA rsh -->
+<!ENTITY searrow          "&#x02198;" ><!--alias ISOAMSA searr -->
+<!ENTITY setminus         "&#x02216;" ><!--alias ISOAMSB setmn -->
+<!ENTITY ShortLeftArrow   "&#x02190;&#x02063;" ><!--alias ISOAMSA slarr -->
+<!ENTITY shortmid         "&#x02223;&#x02063;" ><!--alias ISOAMSR smid -->
+<!ENTITY shortparallel    "&#x02225;&#x02063;" ><!--alias ISOAMSR spar -->
+<!ENTITY ShortRightArrow  "&#x02192;&#x02063;" ><!--alias ISOAMSA srarr -->
+<!ENTITY simeq            "&#x02243;" ><!--alias ISOTECH sime -->
+<!ENTITY SmallCircle      "&#x02218;" ><!--alias ISOTECH compfn -->
+<!ENTITY smallsetminus    "&#x02216;" ><!--alias ISOAMSB ssetmn -->
+<!ENTITY spadesuit        "&#x02660;" ><!--ISOPUB    spades  -->
+<!ENTITY Sqrt             "&#x0221A;" ><!--alias ISOTECH radic -->
+<!ENTITY sqsubset         "&#x0228F;" ><!--alias ISOAMSR sqsub -->
+<!ENTITY sqsubseteq       "&#x02291;" ><!--alias ISOAMSR sqsube -->
+<!ENTITY sqsupset         "&#x02290;" ><!--alias ISOAMSR sqsup -->
+<!ENTITY sqsupseteq       "&#x02292;" ><!--alias ISOAMSR sqsupe -->
+<!ENTITY Square           "&#x025A1;" ><!--alias for square -->
+<!ENTITY SquareIntersection "&#x02293;" ><!--alias ISOAMSB sqcap -->
+<!ENTITY SquareSubset     "&#x0228F;" ><!--alias ISOAMSR sqsub -->
+<!ENTITY SquareSubsetEqual "&#x02291;" ><!--alias ISOAMSR sqsube -->
+<!ENTITY SquareSuperset   "&#x02290;" ><!--alias ISOAMSR sqsup -->
+<!ENTITY SquareSupersetEqual "&#x02292;" ><!--alias ISOAMSR sqsupe -->
+<!ENTITY SquareUnion      "&#x02294;" ><!--alias ISOAMSB sqcup -->
+<!ENTITY Star             "&#x022C6;" ><!--alias ISOAMSB sstarf -->
+<!ENTITY straightepsilon  "&#x003B5;" ><!--alias ISOGRK3 epsi -->
+<!ENTITY straightphi      "&#x003C6;" ><!--alias ISOGRK3 phi -->
+<!ENTITY subset           "&#x02282;" ><!--alias ISOTECH sub -->
+<!ENTITY Subset           "&#x022D0;" ><!--alias ISOAMSR Sub -->
+<!ENTITY subseteq         "&#x02286;" ><!--alias ISOTECH sube -->
+<!ENTITY subseteqq        "&#x02286;" ><!--alias ISOAMSR subE -->
+<!ENTITY SubsetEqual      "&#x02286;" ><!--alias ISOTECH sube -->
+<!ENTITY subsetneq        "&#x0228A;" ><!--alias ISOAMSN subne -->
+<!ENTITY subsetneqq       "&#x0228A;" ><!--alias ISOAMSN subnE -->
+<!ENTITY succ             "&#x0227B;" ><!--alias ISOAMSR sc -->
+<!ENTITY succapprox       "&#x0227F;" ><!--alias ISOAMSR scap -->
+<!ENTITY succcurlyeq      "&#x0227D;" ><!--alias ISOAMSR sccue -->
+<!ENTITY Succeeds         "&#x0227B;" ><!--alias ISOAMSR sc -->
+<!ENTITY SucceedsEqual    "&#x0227D;" ><!--alias ISOAMSR sce -->
+<!ENTITY SucceedsSlantEqual "&#x0227D;" ><!--alias ISOAMSR sccue -->
+<!ENTITY SucceedsTilde    "&#x0227F;" ><!--alias ISOAMSR scsim -->
+<!ENTITY succeq           "&#x0227D;" ><!--alias ISOAMSR sce -->
+<!ENTITY succnapprox      "&#x022E9;" ><!--alias ISOAMSN scnap -->
+<!ENTITY succneqq         "&#x02AB6;" ><!--alias ISOAMSN scnE -->
+<!ENTITY succnsim         "&#x022E9;" ><!--alias ISOAMSN scnsim -->
+<!ENTITY succsim          "&#x0227F;" ><!--alias ISOAMSR scsim -->
+<!ENTITY SuchThat         "&#x0220B;" ><!--ISOTECH  ni -->
+<!ENTITY Sum              "&#x02211;" ><!--alias ISOAMSB sum -->
+<!ENTITY Superset         "&#x02283;" ><!--alias ISOTECH sup -->
+<!ENTITY SupersetEqual    "&#x02287;" ><!--alias ISOTECH supe -->
+<!ENTITY supset           "&#x02283;" ><!--alias ISOTECH sup -->
+<!ENTITY Supset           "&#x022D1;" ><!--alias ISOAMSR Sup -->
+<!ENTITY supseteq         "&#x02287;" ><!--alias ISOTECH supe -->
+<!ENTITY supseteqq        "&#x02287;" ><!--alias ISOAMSR supE -->
+<!ENTITY supsetneq        "&#x0228B;" ><!--alias ISOAMSN supne -->
+<!ENTITY supsetneqq       "&#x0228B;" ><!--alias ISOAMSN supnE -->
+<!ENTITY swarrow          "&#x02199;" ><!--alias ISOAMSA swarr -->
+<!ENTITY therefore        "&#x02234;" ><!--alias ISOTECH there4 -->
+<!ENTITY Therefore        "&#x02234;" ><!--alias ISOTECH there4 -->
+<!ENTITY thickapprox      "&#x02248;&#x02063;" ><!--ISOAMSR   thkap  -->
+<!ENTITY thicksim         "&#x0223C;" ><!--ISOAMSR   thksim -->
+<!ENTITY ThinSpace        "&#x02009;" ><!--space of width 3/18 em alias ISOPUB thinsp -->
+<!ENTITY Tilde            "&#x0223C;" ><!--alias ISOTECH sim -->
+<!ENTITY TildeEqual       "&#x02243;" ><!--alias ISOTECH sime -->
+<!ENTITY TildeFullEqual   "&#x02245;" ><!--alias ISOTECH cong -->
+<!ENTITY TildeTilde       "&#x02248;" ><!--alias ISOTECH ap -->
+<!ENTITY toea             "&#x02928;" ><!--alias ISOAMSA nesear -->
+<!ENTITY tosa             "&#x02929;" ><!--alias ISOAMSA seswar -->
+<!ENTITY triangle         "&#x025B5;" ><!--alias ISOPUB utri -->
+<!ENTITY triangledown     "&#x025BF;" ><!--alias ISOPUB dtri -->
+<!ENTITY triangleleft     "&#x025C3;" ><!--alias ISOPUB ltri -->
+<!ENTITY trianglelefteq   "&#x022B4;" ><!--alias ISOAMSR ltrie -->
+<!ENTITY triangleq        "&#x0225C;" ><!--alias ISOAMSR trie -->
+<!ENTITY triangleright    "&#x025B9;" ><!--alias ISOPUB rtri -->
+<!ENTITY trianglerighteq  "&#x022B5;" ><!--alias ISOAMSR rtrie -->
+<!ENTITY TripleDot        "&#x020DB;" ><!--alias ISOTECH tdot -->
+<!ENTITY twoheadleftarrow "&#x0219E;" ><!--alias ISOAMSA Larr -->
+<!ENTITY twoheadrightarrow "&#x021A0;" ><!--alias ISOAMSA Rarr -->
+<!ENTITY ulcorner         "&#x0231C;" ><!--alias ISOAMSC ulcorn -->
+<!ENTITY Union            "&#x022C3;" ><!--alias ISOAMSB xcup -->
+<!ENTITY UnionPlus        "&#x0228E;" ><!--alias ISOAMSB uplus -->
+<!ENTITY uparrow          "&#x02191;" ><!--alias ISONUM uarr -->
+<!ENTITY Uparrow          "&#x021D1;" ><!--alias ISOAMSA uArr -->
+<!ENTITY UpArrow          "&#x02191;" ><!--alias ISONUM uarr -->
+<!ENTITY UpArrowDownArrow "&#x021C5;" ><!--alias ISOAMSA udarr -->
+<!ENTITY updownarrow      "&#x02195;" ><!--alias ISOAMSA varr -->
+<!ENTITY Updownarrow      "&#x021D5;" ><!--alias ISOAMSA vArr -->
+<!ENTITY UpDownArrow      "&#x02195;" ><!--alias ISOAMSA varr -->
+<!ENTITY UpEquilibrium    "&#x0296E;" ><!--alias ISOAMSA udhar -->
+<!ENTITY upharpoonleft    "&#x021BF;" ><!--alias ISOAMSA uharl -->
+<!ENTITY upharpoonright   "&#x021BE;" ><!--alias ISOAMSA uharr -->
+<!ENTITY UpperLeftArrow   "&#x02196;" ><!--alias ISOAMSA nwarr -->
+<!ENTITY UpperRightArrow  "&#x02197;" ><!--alias ISOAMSA nearr -->
+<!ENTITY upsilon          "&#x003C5;" ><!--alias ISOGRK3 upsi -->
+<!ENTITY Upsilon          "&#x003D2;" ><!--alias ISOGRK3 Upsi -->
+<!ENTITY UpTee            "&#x022A5;" ><!--alias ISOTECH perp -->
+<!ENTITY upuparrows       "&#x021C8;" ><!--alias ISOAMSA uuarr -->
+<!ENTITY urcorner         "&#x0231D;" ><!--alias ISOAMSC urcorn -->
+<!ENTITY varepsilon       "&#x0025B;" ><!--alias ISOGRK3 epsiv -->
+<!ENTITY varkappa         "&#x003F0;" ><!--alias ISOGRK3 kappav -->
+<!ENTITY varnothing       "&#x02205;" ><!--alias ISOAMSO emptyv -->
+<!ENTITY varphi           "&#x003D5;" ><!--alias ISOGRK3 phiv -->
+<!ENTITY varpi            "&#x003D6;" ><!--alias ISOGRK3 piv -->
+<!ENTITY varpropto        "&#x0221D;" ><!--alias ISOAMSR vprop -->
+<!ENTITY varrho           "&#x003F1;" ><!--alias ISOGRK3 rhov -->
+<!ENTITY varsigma         "&#x003C2;" ><!--alias ISOGRK3 sigmav -->
+<!ENTITY varsubsetneq     "&#x0228A;&#x02063;" ><!--alias ISOAMSN vsubne -->
+<!ENTITY varsubsetneqq    "&#x0228A;&#x02063;" ><!--alias ISOAMSN vsubnE -->
+<!ENTITY varsupsetneq     "&#x0228B;&#x02063;" ><!--alias ISOAMSN vsupne -->
+<!ENTITY varsupsetneqq    "&#x0228B;&#x02063;" ><!--alias ISOAMSN vsupnE -->
+<!ENTITY vartheta         "&#x003D1;" ><!--alias ISOGRK3 thetav -->
+<!ENTITY vartriangleleft  "&#x022B2;" ><!--alias ISOAMSR vltri -->
+<!ENTITY vartriangleright "&#x022B3;" ><!--alias ISOAMSR vrtri -->
+<!ENTITY vee              "&#x02228;" ><!--alias ISOTECH or -->
+<!ENTITY Vee              "&#x022C1;" ><!--alias ISOAMSB xvee -->
+<!ENTITY vert             "&#x0007C;" ><!--alias ISONUM verbar -->
+<!ENTITY Vert             "&#x02016;" ><!--alias ISOTECH Verbar -->
+<!ENTITY VerticalBar      "&#x02223;" ><!--alias ISOAMSR mid -->
+<!ENTITY VerticalTilde    "&#x02240;" ><!--alias ISOAMSB wreath -->
+<!ENTITY VeryThinSpace    "&#x0200A;" ><!--space of width 1/18 em alias ISOPUB hairsp -->
+<!ENTITY wedge            "&#x02227;" ><!--alias ISOTECH and -->
+<!ENTITY Wedge            "&#x022C0;" ><!--alias ISOAMSB xwedge -->
+<!ENTITY wp               "&#x02118;" ><!--alias ISOAMSO weierp -->
+<!ENTITY wr               "&#x02240;" ><!--alias ISOAMSB wreath -->
diff --git a/helm/dtd/mmlextra.ent b/helm/dtd/mmlextra.ent
new file mode 100644 (file)
index 0000000..e76de44
--- /dev/null
@@ -0,0 +1,134 @@
+
+<!--
+     File mmlextra.ent produced by the XSL script mmldtd.xsl
+     from input data in unicode.xml.
+
+     Please report any errors to 
+     David Carlisle <davidc@nag.co.uk>.
+
+     The numeric character values assigned to each entity
+     (should) match either official Unicode assignments
+     or assignments provisionally allocated by the
+     Unicode Consortium based on the characters in the `STIX'
+     propsal for mathematics. Note that these assignments
+     have not been ratified by the corresponding ISO
+     committee and thus should be considered liable to
+     change.
+
+-->
+
+<!ENTITY af               "&#x02061;" ><!--short form of &ApplyFunction; -->
+<!ENTITY ApplyFunction    "&#x02061;" ><!--character showing function application in presentation tagging -->
+<!ENTITY Assign           "&#x02254;" ><!--assignment operator -->
+<!ENTITY CapitalDifferentialD "&#x02145;" ><!--D for use in differentials, e.g., within integrals -->
+<!ENTITY Cayleys          "&#x0212D;" ><!--the non-associative ring of octonions or Cayley numbers -->
+<!ENTITY complexes        "&#x02102;" ><!--the field of complex numbers -->
+<!ENTITY Cross            "&#x02A2F;" ><!--cross or vector product -->
+<!ENTITY dd               "&#x02146;" ><!--short form of &DifferentialD; -->
+<!ENTITY DD               "&#x02145;" ><!--short form of CapitalDifferentialD -->
+<!ENTITY DifferentialD    "&#x02146;" ><!--d for use in differentials, e.g., within integrals -->
+<!ENTITY DownArrowBar     "&#x02913;" ><!--down arrow to bar -->
+<!ENTITY DownBreve        "&#x00311;" ><!--breve, inverted (non-spacing) -->
+<!ENTITY DownLeftRightVector "&#x02950;" ><!--left-down-right-down harpoon -->
+<!ENTITY DownLeftTeeVector "&#x0295E;" ><!--left-down harpoon from bar -->
+<!ENTITY DownLeftVectorBar "&#x02956;" ><!--left-down harpoon to bar -->
+<!ENTITY DownRightTeeVector "&#x0295F;" ><!--right-down harpoon from bar -->
+<!ENTITY DownRightVectorBar "&#x02957;" ><!--right-down harpoon to bar -->
+<!ENTITY DownTeeArrow     "&#x021A7;" ><!--alias for mapstodown -->
+<!ENTITY ee               "&#x02147;" ><!--short form of &ExponentialE; -->
+<!ENTITY EmptySmallSquare "&#x025FD;" ><!--empty small square -->
+<!ENTITY EmptyVerySmallSquare "&#x025FD;" ><!--empty small square -->
+<!ENTITY Equal            "&#x02A75;" ><!--two consecutive equal signs -->
+<!ENTITY expectation      "&#x02130;" ><!--expectation (operator) -->
+<!ENTITY exponentiale     "&#x0212F;" ><!--base of the Napierian logarithms -->
+<!ENTITY ExponentialE     "&#x02147;" ><!--e use for the exponential base of the natural logarithms -->
+<!ENTITY FilledSmallSquare "&#x025FE;" ><!--filled small square -->
+<!ENTITY FilledVerySmallSquare "&#x025FE;" ><!--filled very small square -->
+<!ENTITY Fouriertrf       "&#x02131;" ><!--Fourier transform -->
+<!ENTITY GreaterGreater   "&#x02AA2;" ><!--alias for GT -->
+<!ENTITY HilbertSpace     "&#x0210B;" ><!--Hilbert space -->
+<!ENTITY HorizontalLine   "&#x02500;" ><!--short horizontal line  -->
+<!ENTITY ic               "&#x0200B;" ><!--short form of  &InvisibleComma; -->
+<!ENTITY ii               "&#x02148;" ><!--short form of &ImaginaryI; -->
+<!ENTITY ImaginaryI       "&#x02148;" ><!--i for use as a square root of -1 -->
+<!ENTITY imagline         "&#x02110;" ><!--the geometric imaginary line -->
+<!ENTITY integers         "&#x02124;" ><!--the ring of integers -->
+<!ENTITY InvisibleComma   "&#x0200B;" ><!--used as a separator, e.g., in indices -->
+<!ENTITY InvisibleTimes   "&#x02062;" ><!--marks multiplication when it is understood without a mark -->
+<!ENTITY it               "&#x02062;" ><!--short form of &InvisibleTimes; -->
+<!ENTITY Laplacetrf       "&#x02112;" ><!--Laplace transform -->
+<!ENTITY larrb            "&#x021E4;" ><!--leftwards arrow to bar -->
+<!ENTITY LeftArrowBar     "&#x021E4;" ><!--alias for larrb -->
+<!ENTITY LeftDownTeeVector "&#x02961;" ><!--down-left harpoon from bar -->
+<!ENTITY LeftDownVectorBar "&#x02959;" ><!--down-left harpoon to bar -->
+<!ENTITY LeftRightVector  "&#x0294E;" ><!--left-up-right-up harpoon -->
+<!ENTITY LeftTeeArrow     "&#x021A4;" ><!--alias for mapstoleft -->
+<!ENTITY LeftTeeVector    "&#x0295A;" ><!--left-up harpoon from bar -->
+<!ENTITY LeftTriangleBar  "&#x029CF;" ><!--not left triangle, vertical bar -->
+<!ENTITY LeftUpDownVector "&#x02951;" ><!--up-left-down-left harpoon -->
+<!ENTITY LeftUpTeeVector  "&#x02960;" ><!--up-left harpoon from bar -->
+<!ENTITY LeftUpVectorBar  "&#x02958;" ><!--up-left harpoon to bar -->
+<!ENTITY LeftVectorBar    "&#x02952;" ><!--left-up harpoon to bar -->
+<!ENTITY LessLess         "&#x02AA1;" ><!--alias for Lt -->
+<!ENTITY mapstodown       "&#x021A7;" ><!--downwards arrow from bar -->
+<!ENTITY mapstoleft       "&#x021A4;" ><!--leftwards arrow from bar -->
+<!ENTITY mapstoup         "&#x021A5;" ><!--upwards arrow from bar -->
+<!ENTITY Mellintrf        "&#x02133;" ><!--Mellin transform -->
+<!ENTITY naturals         "&#x02115;" ><!--the semi-ring of natural numbers -->
+<!ENTITY nbump            "&#x0224E;&#x00338;" ><!--not bumpy equals -->
+<!ENTITY nbumpe           "&#x0224F;&#x00338;" ><!--not bumpy single equals -->
+<!ENTITY NegativeMediumSpace "&#x0205F;&#x02063;" ><!--space of width -4/18 em -->
+<!ENTITY NegativeThickSpace "&#x02005;&#x02063;" ><!--space of width -5/18 em -->
+<!ENTITY NegativeThinSpace "&#x02009;&#x02063;" ><!--space of width -3/18 em -->
+<!ENTITY NegativeVeryThinSpace "&#x0200A;&#x02063;" ><!--space of width -1/18 em -->
+<!ENTITY nesim            "&#x02242;&#x00338;" ><!--not equal or similar -->
+<!ENTITY NewLine          "&#x0000A;" ><!--force a line break; line feed -->
+<!ENTITY NoBreak          "&#x0FEFF;" ><!--never break line here -->
+<!ENTITY NotCupCap        "&#x0226D;" ><!--alias for &nasymp; -->
+<!ENTITY NotEqualTilde    "&#x02242;&#x00338;" ><!--alias for  &nesim; -->
+<!ENTITY NotHumpDownHump  "&#x0224E;&#x00338;" ><!--alias for &nbump; -->
+<!ENTITY NotHumpEqual     "&#x0224F;&#x00338;" ><!--alias for &nbumpe; -->
+<!ENTITY NotLeftTriangleBar "&#x029CF;&#x00338;" ><!--not left triangle, vertical bar -->
+<!ENTITY NotNestedGreaterGreater "&#x024A2;&#x00338;" ><!--not double greater-than sign -->
+<!ENTITY NotNestedLessLess "&#x024A1;&#x00338;" ><!--not double less-than sign -->
+<!ENTITY NotRightTriangleBar "&#x029D0;&#x00338;" ><!--not vertical bar, right triangle -->
+<!ENTITY NotSquareSubset  "&#x0228F;&#x00338;" ><!--square not subset -->
+<!ENTITY NotSquareSuperset "&#x02290;&#x00338;" ><!--negated set-like partial order operator -->
+<!ENTITY NotSucceedsTilde "&#x0227F;&#x00338;" ><!--not succeeds or similar -->
+<!ENTITY OverBar          "&#x000AF;" ><!--over bar -->
+<!ENTITY OverBrace        "&#x0FE37;" ><!--over brace  -->
+<!ENTITY OverBracket      "&#x023B4;" ><!--over bracket -->
+<!ENTITY OverParenthesis  "&#x0FE35;" ><!--over parenthesis -->
+<!ENTITY planckh          "&#x0210E;" ><!--the ring (skew field) of quaternions -->
+<!ENTITY Poincareplane    "&#x0210C;" ><!--the Poincare upper half-plane -->
+<!ENTITY primes           "&#x02119;" ><!--the prime natural numbers -->
+<!ENTITY Product          "&#x0220F;" ><!--alias for &prod -->
+<!ENTITY quaternions      "&#x0210D;" ><!--the ring (skew field) of quaternions -->
+<!ENTITY rarrb            "&#x021E5;" ><!--leftwards arrow to bar -->
+<!ENTITY rationals        "&#x0211A;" ><!--the field of rational numbers -->
+<!ENTITY realine          "&#x0211B;" ><!--the geometric real line -->
+<!ENTITY reals            "&#x0211D;" ><!--the field of real numbers -->
+<!ENTITY RightArrowBar    "&#x021E5;" ><!--alias for rarrb -->
+<!ENTITY RightDownTeeVector "&#x0295D;" ><!--down-right harpoon from bar -->
+<!ENTITY RightDownVectorBar "&#x02955;" ><!--down-right harpoon to bar -->
+<!ENTITY RightTeeVector   "&#x0295B;" ><!--right-up harpoon from bar -->
+<!ENTITY RightTriangleBar "&#x029D0;" ><!--vertical bar, right triangle -->
+<!ENTITY RightUpDownVector "&#x0294F;" ><!--up-right-down-right harpoon -->
+<!ENTITY RightUpTeeVector "&#x0295C;" ><!--up-right harpoon from bar -->
+<!ENTITY RightUpVectorBar "&#x02954;" ><!--up-right harpoon to bar -->
+<!ENTITY RightVectorBar   "&#x02953;" ><!--up-right harpoon to bar -->
+<!ENTITY RoundImplies     "&#x02970;" ><!--round implies -->
+<!ENTITY RuleDelayed      "&#x029F4;" ><!--rule-delayed (colon right arrow) -->
+<!ENTITY ShortDownArrow   "&#x02304;&#x02063;" ><!--short down arrow -->
+<!ENTITY ShortUpArrow     "&#x02303;&#x02063;" ><!--short up arrow  -->
+<!ENTITY Tab              "&#x00009;" ><!--tabulator stop; horizontal tabulation -->
+<!ENTITY ThickSpace       "&#x02005;" ><!--space of width 5/18 em -->
+<!ENTITY UnderBar         "&#x00332;" ><!--combining low line -->
+<!ENTITY UnderBrace       "&#x0FE38;" ><!--under brace  -->
+<!ENTITY UnderBracket     "&#x023B5;" ><!--under bracket -->
+<!ENTITY UpArrowBar       "&#x02912;" ><!--up arrow to bar -->
+<!ENTITY UpTeeArrow       "&#x021A5;" ><!--Alias mapstoup -->
+<!ENTITY VerticalLine     "&#x02758;" ><!--short vertical line  -->
+<!ENTITY VerticalSeparator "&#x02758;" ><!--vertical separating operator -->
+<!ENTITY zeetrf           "&#x02128;" ><!--zee transform -->
+<!ENTITY ZeroWidthSpace   "&#x0200B;" ><!--zero width space -->
diff --git a/helm/dtd/provastruct.theory.xml b/helm/dtd/provastruct.theory.xml
new file mode 100644 (file)
index 0000000..23c8f7c
--- /dev/null
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE SECTION SYSTEM "theoryobject.dtd">
+
+<SECTION>
+ <SECTION>
+  <Variable name="A" xmlns:m="http://www.w3.org/1998/Math/MathML"><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      
+      
+        <m:apply><m:csymbol>Type</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Variable>
+  <SECTION>
+   <Variable name="B" xmlns:m="http://www.w3.org/1998/Math/MathML"><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      
+      
+        <m:apply><m:csymbol>Type</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Variable>
+   <Axiom name="axiom" xmlns:m="http://www.w3.org/1998/Math/MathML"><Params>1: A 0: B</Params><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>arrow</m:csymbol>
+            <m:ci>A</m:ci>
+          
+            <m:apply><m:csymbol>arrow</m:csymbol>
+                <m:apply><m:csymbol>arrow</m:csymbol>
+                    <m:ci>A</m:ci>
+                  
+                    <m:ci>B</m:ci>
+                  </m:apply>
+              
+                <m:ci>B</m:ci>
+              </m:apply>
+          </m:apply>
+      
+      
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Axiom>
+   <Definition name="th1" xmlns:m="http://www.w3.org/1998/Math/MathML"><Params>1: A 0: B</Params><body>
+    <m:math><m:lambda><m:bvar><m:ci>A0</m:ci><m:type>
+        <m:ci>A</m:ci>
+      </m:type></m:bvar>
+        <m:lambda><m:bvar><m:ci>H</m:ci><m:type>
+            <m:apply><m:csymbol>arrow</m:csymbol>
+                <m:ci>A</m:ci>
+              
+                <m:ci>B</m:ci>
+              </m:apply>
+          </m:type></m:bvar>
+            <m:apply><m:csymbol>app</m:csymbol>
+              <m:ci definitionURL="cic:/coq/INIT/Logic/Conjunction/and.ind">conj</m:ci>
+              <m:ci>A</m:ci>
+              <m:ci>B</m:ci>
+              <m:ci>A0</m:ci>
+              <m:apply><m:csymbol>app</m:csymbol>
+                <m:ci definitionURL="cic:/prove/provastruct/a/b1/axiom.con">axiom</m:ci>
+                <m:ci>A0</m:ci>
+                <m:ci>H</m:ci>
+              </m:apply>
+            </m:apply>
+          </m:lambda>
+      </m:lambda></m:math>
+  </body><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>arrow</m:csymbol>
+            <m:ci>A</m:ci>
+          
+            <m:apply><m:csymbol>arrow</m:csymbol>
+                <m:apply><m:csymbol>arrow</m:csymbol>
+                    <m:ci>A</m:ci>
+                  
+                    <m:ci>B</m:ci>
+                  </m:apply>
+              
+                <m:apply><m:and definitionURL="cic:/coq/INIT/Logic/Conjunction/and.ind"/><m:ci>A</m:ci><m:ci>B</m:ci></m:apply>
+              </m:apply>
+          </m:apply>
+      
+      
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Definition>
+  </SECTION>
+  <SECTION>
+   <Variable name="B" xmlns:m="http://www.w3.org/1998/Math/MathML"><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>Set</m:csymbol></m:apply>
+      
+      
+        <m:apply><m:csymbol>Type</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Variable>
+   <Axiom name="axiom&apos;" xmlns:m="http://www.w3.org/1998/Math/MathML"><Params>1: A</Params><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>prod</m:csymbol><m:bvar><m:ci>A</m:ci><m:type>
+            <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+          </m:type></m:bvar>
+            <m:apply><m:csymbol>arrow</m:csymbol>
+                <m:ci>A</m:ci>
+              
+                <m:ci>A</m:ci>
+              </m:apply>
+          </m:apply>
+      
+      
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Axiom>
+  </SECTION>
+  <Definition name="th1&apos;" xmlns:m="http://www.w3.org/1998/Math/MathML"><Params>0: A</Params><body>
+    <m:math><m:lambda><m:bvar><m:ci>A0</m:ci><m:type>
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      </m:type></m:bvar>
+        <m:lambda><m:bvar><m:ci>H</m:ci><m:type>
+            <m:ci>A0</m:ci>
+          </m:type></m:bvar>
+            <m:ci>H</m:ci>
+          </m:lambda>
+      </m:lambda></m:math>
+  </body><type>
+    <m:math><m:apply><m:csymbol>cast</m:csymbol>
+      
+        <m:apply><m:csymbol>prod</m:csymbol><m:bvar><m:ci>A</m:ci><m:type>
+            <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+          </m:type></m:bvar>
+            <m:apply><m:csymbol>arrow</m:csymbol>
+                <m:ci>A</m:ci>
+              
+                <m:ci>A</m:ci>
+              </m:apply>
+          </m:apply>
+      
+      
+        <m:apply><m:csymbol>Prop</m:csymbol></m:apply>
+      
+    </m:apply></m:math>
+  </type></Definition>
+ </SECTION>
+</SECTION>
+
+<!-- This page was served in 4037 milliseconds by Cocoon 1.7.3 -->
diff --git a/helm/dtd/theoryobject.dtd b/helm/dtd/theoryobject.dtd
new file mode 100644 (file)
index 0000000..8ff26cf
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR THEORY OBJECTS AT LEVEL OF MATHML CONTENT:              -->
+<!-- First draft: May 9 2000, Irene Schena                           -->
+<!--*****************************************************************-->
+
+<!ENTITY % cicobj SYSTEM "cicobject.dtd">
+
+%cicobj;
+
+<!-- THEORY section: -->
+
+<!ELEMENT SECTION (SECTION|Definition|Axiom|InductiveDefinition|Variable)*>
diff --git a/helm/interface/.cvsignore b/helm/interface/.cvsignore
new file mode 100644 (file)
index 0000000..3a68425
--- /dev/null
@@ -0,0 +1,15 @@
+*.cmo
+*.cmx
+*.cmi
+
+experiment
+experiment.opt
+fix_params
+fix_params.opt
+mmlinterface
+mmlinterface.opt
+reduction
+reduction.opt
+t1lib.log
+output.ps
+output2.ps
index a495dfeabe522060659d9b116781f8842c619264..6402ae55b38660205eeab97dda6bbd52198d4bab 100644 (file)
@@ -82,6 +82,8 @@ deannotate.cmo: cic.cmo
 deannotate.cmx: cic.cmx 
 cicXPath.cmo: cic.cmo 
 cicXPath.cmx: cic.cmx 
+pxpUriResolver.cmo: configuration.cmo 
+pxpUriResolver.cmx: configuration.cmx 
 annotationParser.cmo: annotationParser2.cmo pxpUriResolver.cmo 
 annotationParser.cmx: annotationParser2.cmx pxpUriResolver.cmx 
 annotationParser2.cmo: cic.cmo 
diff --git a/helm/interface/ISTRUZIONI b/helm/interface/ISTRUZIONI
deleted file mode 100644 (file)
index fe6c09e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-==============================
-ISTRUZIONI PER CHI USA LA TCSH
-==============================
-
-Lanciare:
-
- source PER_FARLO_ANDARE_TCSH
-
-Poi far partire altri due xterm.
-Nel primo lanciare:
-
- make start-xaland3
-
-Nel secondo lanciare:
-
- make start-http-getter
-
-Se non funziona significa che ce ne e' gia' uno attivo.
-
-Infini lanciare, dall'ultima shell,
-
- ./mmlinterface.opt.saved
index 2b892e2d9fc9bfd6a794c19a0bf1b093df8c1e8c..d2fddf453bf4c6751910f1d402dc31f1217794a0 100644 (file)
@@ -1,9 +1,10 @@
 LABLGTK_DIR = /usr/lib/ocaml/lablgtk
 LABLGTK_MATHVIEW_DIR = /usr/lib/ocaml/lablgtk/mathview
+MINIDOM_DIR = /usr/lib/ocaml/minidom
 PXP_DIR = /usr/lib/ocaml/site-lib/pxp
 NETSTRING_DIR = /usr/lib/ocaml/site-lib/netstring
-OCAMLC = ocamlc -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) -I $(PXP_DIR) -I $(NETSTRING_DIR) -I mlmathview
-OCAMLOPT = ocamlopt -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) -I mlgtk_devel -I $(PXP_DIR) -I $(NETSTRING_DIR) -I mlmathview
+OCAMLC = ocamlc -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) -I $(PXP_DIR) -I $(NETSTRING_DIR) -I $(MINIDOM_DIR) -I mlmathview
+OCAMLOPT = ocamlopt -I $(LABLGTK_DIR) -I $(LABLGTK_MATHVIEW_DIR) -I mlgtk_devel -I $(PXP_DIR) -I $(NETSTRING_DIR) -I $(MINIDOM_DIR) -I mlmathview
 OCAMLDEP = ocamldep
 
 all: experiment reduction fix_params mmlinterface
@@ -28,7 +29,7 @@ DEPOBJS = experiment.ml cicCache.ml cicCache.mli cicPp.ml cicPp.mli \
           theoryParser.ml theoryParser2.ml theoryPp.ml theoryTypeChecker.ml \
           cicCooking.ml cicCooking.mli cicFindParameters.ml theoryCache.ml \
           fix_params.ml cic2Xml.ml xml.ml uriManager.ml uriManager.mli \
-          cicSubstitution.ml cicSubstitution.mli mml.ml \
+          cicSubstitution.ml cicSubstitution.mli \
           mmlinterface.ml configuration.ml \
           xsltProcessor.ml deannotate.ml cicXPath.ml pxpUriResolver.ml \
           annotationParser.ml annotationParser2.ml annotation2Xml.ml \
@@ -39,7 +40,7 @@ MMLINTERFACEOBJS = configuration.cmo uriManager.cmo getter.cmo cic.cmo \
                    cicParser3.cmo cicParser2.cmo cicParser.cmo deannotate.cmo \
                    cicSubstitution.cmo annotationParser2.cmo \
                    annotationParser.cmo cicCache.cmo cicCooking.cmo cicPp.cmo \
-                   cicReduction.cmo cicTypeChecker.cmo mml.cmo \
+                   cicReduction.cmo cicTypeChecker.cmo \
                    xml.cmo \
                    xsltProcessor.cmo cic2Xml.cmo annotation2Xml.cmo \
                    cicXPath.cmo theory.cmo theoryParser2.cmo theoryParser.cmo \
@@ -52,7 +53,7 @@ MMLINTERFACEOPTOBJS = configuration.cmx uriManager.cmx getter.cmx cic.cmx \
                       deannotate.cmx cicSubstitution.cmx annotationParser2.cmx \
                       annotationParser.cmx cicCache.cmx \
                       cicCooking.cmx cicPp.cmx cicReduction.cmx \
-                      cicTypeChecker.cmx mml.cmx \
+                      cicTypeChecker.cmx \
                       xml.cmx xsltProcessor.cmx \
                       cic2Xml.cmx annotation2Xml.cmx cicXPath.cmx \
                       theory.cmx theoryParser2.cmx theoryParser.cmx \
@@ -105,23 +106,29 @@ depend:
 mmlinterface: $(MMLINTERFACEOBJS)
        $(OCAMLC) -custom -o mmlinterface str.cma unix.cma $(PXPLIBS) dbm.cma \
                   lablgtk.cma gtkInit.cmo \
+                  $(MINIDOM_DIR)/minidom.cmo \
+                  $(MINIDOM_DIR)/ominidom.cmo \
                   $(LABLGTK_MATHVIEW_DIR)/lablgtkmathview.cma \
                   $(MMLINTERFACEOBJS) \
                   -cclib "-lstr -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \
                   -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm \
-                  -lunix -L/usr/local/lib/gtkmathview -lgtkmathview \
-                  $(LABLGTK_MATHVIEW_DIR)/ml_gtk_mathview.o" \
+                  -lunix `gtkmathview-config --libs` \
+                  $(LABLGTK_MATHVIEW_DIR)/ml_gtk_mathview.o \
+                  $(MINIDOM_DIR)/ml_minidom.o" \
                   -cclib -lmldbm -cclib -lndbm
 
 mmlinterface.opt: $(MMLINTERFACEOPTOBJS)
        $(OCAMLOPT) -o mmlinterface.opt str.cmxa $(PXPLIBSOPT) unix.cmxa \
                     dbm.cmxa lablgtk.cmxa gtkInit.cmx \
+                    $(MINIDOM_DIR)/minidom.cmx \
+                    $(MINIDOM_DIR)/ominidom.cmx \
                     $(LABLGTK_MATHVIEW_DIR)/lablgtkmathview.cmxa \
                     $(MMLINTERFACEOPTOBJS) \
                     -cclib "-lstr -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \
                     -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm \
-                    -lunix -L/usr/local/lib/gtkmathview -lgtkmathview \
-                    $(LABLGTK_MATHVIEW_DIR)/ml_gtk_mathview.o" \
+                    -lunix `gtkmathview-config --libs` \
+                    $(LABLGTK_MATHVIEW_DIR)/ml_gtk_mathview.o \
+                    $(MINIDOM_DIR)/ml_minidom.o" \
                     -cclib -lmldbm -cclib -lndbm
 
 fix_params: $(FIX_PARAMSOBJS)
@@ -164,17 +171,4 @@ clean:
            reduction.opt fix_params fix_params.opt mmlinterface \
            mmlinterface.opt mmlinterface2 mmlinterface2.opt
 
-start-xaland:
-       java xaland 12345 12346 examples/style/rootcontent.xsl \
-           examples/style/annotatedpres.xsl examples/style/theory_content.xsl \
-           examples/style/theory_pres.xsl
-
-start-xaland3:
-       java xaland 12347 12348 examples/style/rootcontent.xsl \
-           examples/style/annotatedpres.xsl examples/style/theory_content.xsl \
-           examples/style/theory_pres.xsl
-
-start-http-getter:
-       http_getter/http_getter.pl
-
 include .depend
diff --git a/helm/interface/NON_VA b/helm/interface/NON_VA
deleted file mode 100644 (file)
index 3754471..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
- ***********************************************************************
-
-                         A T T E N Z I O N E ! ! !
-
- Quando si usa fix_params.opt, scrivere
-
-       find /really_very_local/helm/PARSER/examples
-
- invece di examples
-
- ***********************************************************************
-
- PROBLEMA NON FIXATO CON fix_params
-
- LA SOLUZIONE E'
-
-
-
-Correggere:
-
- examples/coq/SETS/Powerset_facts/Sets_as_an_algebra/setcover_intro.con.xml
-
-aggiungendo paramMode="POSSIBLE"
-
-Un esempio che altrimenti non funziona e':
-
-examples/coq/SETS/Powerset_Classical_facts/Sets_as_an_algebra/Add_covers.con.xml
-
diff --git a/helm/interface/PER_FARLO_ANDARE b/helm/interface/PER_FARLO_ANDARE
deleted file mode 100644 (file)
index 20fb52a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-export LD_LIBRARY_PATH=.:/really_very_local/helm/proveluca/mml-browser/
-export no_proxy=cs.unibo.it
diff --git a/helm/interface/PER_FARLO_ANDARE_TCSH b/helm/interface/PER_FARLO_ANDARE_TCSH
deleted file mode 100644 (file)
index b527fab..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-setenv PATH "/home/projects/java/jdk1.2.2/bin:$PATH"
-setenv CLASSPATH "/really_very_local/helm/java/xalan_1_1/xalan.jar:/really_very_local/helm/java/xalan_1_1/xerces.jar:."
-setenv CLASSPATH "/really_very_local/helm/java/saxon-5.3.2/saxon.jar:$CLASSPATH"
-setenv LD_LIBRARY_PATH ".:/really_very_local/helm/proveluca/mml-browser/"
diff --git a/helm/interface/PER_FARLO_ANDARE_TCSH_D01 b/helm/interface/PER_FARLO_ANDARE_TCSH_D01
deleted file mode 100644 (file)
index 208f00a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-setenv PATH "/home/projects/java/jdk1.2.2/bin:$PATH"
-setenv CLASSPATH "/really_very_local/helm/java/xalan_1_2_D01/xalan.jar:/really_very_local/helm/java/xalan_1_2_D01/xerces.jar:."
-setenv CLASSPATH "/really_very_local/helm/java/saxon-5.3.2/saxon.jar:$CLASSPATH"
-setenv LD_LIBRARY_PATH ".:/really_very_local/helm/proveluca/mml-browser/"
index f674925b369cd28001f0d7bd4a6d71b7ac4972e1..c9762da761572d8e497cdc7527d741c9352a0f7d 100755 (executable)
@@ -1,13 +1,19 @@
 #! /bin/sh
 
-export PATH=/home/cadet/sacerdot/jdk118/bin:$PATH
+# Per (my)Coq 6.3.0
+export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
 
-export CLASSPATH=/home/cadet/sacerdot/xalan-j_1_2/xalan.jar:/home/cadet/sacerdot/xalan-j_1_2/xerces.jar:.
+# WARNING!!! No "//" in the middle of the path, nor a "/" at the end!!!!
 
-#export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/xalan_1_1/xalan.jar
-#export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/xalan_1_1/xerces.jar
-#export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/saxon-5.3.2/saxon.jar
+#V6.2
+#export HELM_CONFIGURATION_PREFIX=~/HELM/installation
 
-# Per (my)Coq 6.3.0
-#export LD_LIBRARY_PATH=/home/lpadovan/helm/usr/lib/:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=/usr/local/lib/gtkmathview:$LD_LIBRARY_PATH
+#V7
+export HELM_CONFIGURATION_PREFIX=/home/cadet/sacerdot
+
+export T1LIB_CONFIG=./t1.config
+
+# Stix font
+xset fp
+xset fp+ ~/HELM/installation/fonts/
+xset fp rehash
diff --git a/helm/interface/cicXPath.prima_degli_identificatori.ml b/helm/interface/cicXPath.prima_degli_identificatori.ml
deleted file mode 100644 (file)
index 8a69d1a..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-(******************************************************************************)
-(*                                                                            *)
-(*                               PROJECT HELM                                 *)
-(*                                                                            *)
-(*                Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>               *)
-(*                                 11/04/2000                                 *)
-(*                                                                            *)
-(*                                                                            *)
-(******************************************************************************)
-
-(* functions to parse an XPath to retrieve the annotation *)
-
-exception WrongXPath of string;;
-
-let rec get_annotation_of_inductiveFun f xpath =
- let module C = Cic in
-  match (xpath,f) with
-     1::tl,(_,_,ty,_) -> get_annotation_of_term ty tl
-   | 2::tl,(_,_,_,te) -> get_annotation_of_term te tl
-   | l,_ ->
-      raise (WrongXPath (List.fold_right (fun n i -> string_of_int n ^ i) l ""))
-
-and get_annotation_of_coinductiveFun f xpath =
- let module C = Cic in
-  match (xpath,f) with
-     1::tl,(_,ty,_) -> get_annotation_of_term ty tl
-   | 2::tl,(_,_,te) -> get_annotation_of_term te tl
-   | l,_ ->
-      raise (WrongXPath (List.fold_right (fun n i -> string_of_int n ^ i) l ""))
-
-and get_annotation_of_inductiveType ty xpath =
- let module C = Cic in
-  match (xpath,ty) with
-     1::tl,(_,_,arity,_) -> get_annotation_of_term arity tl
-   | n::tl,(_,_,_,cons) when n <= List.length cons + 1 ->
-      let (_,ty,_) = List.nth cons (n-2) in
-       get_annotation_of_term ty tl
-   | l,_ ->
-      raise (WrongXPath (List.fold_right (fun n i -> string_of_int n ^ i) l ""))
-
-and get_annotation_of_term term xpath =
- let module C = Cic in
-  match (xpath,term) with
-     [],C.ARel (_,ann,_,_) -> ann
-   | [],C.AVar (_,ann,_) -> ann
-   | [],C.AMeta (_,ann,_) -> ann
-   | [],C.ASort (_,ann,_) -> ann
-   | [],C.AImplicit (_,ann) -> ann
-   | [],C.ACast (_,ann,_,_) -> ann
-   | 1::tl,C.ACast (_,_,te,_) -> get_annotation_of_term te tl
-   | 2::tl,C.ACast (_,_,_,ty) -> get_annotation_of_term ty tl
-   | [],C.AProd (_,ann,_,_,_) -> ann
-   | 1::tl,C.AProd (_,_,_,so,_) -> get_annotation_of_term so tl
-   | 2::tl,C.AProd (_,_,_,_,ta) -> get_annotation_of_term ta tl
-   | [],C.ALambda (_,ann,_,_,_) -> ann
-   | 1::tl,C.ALambda (_,_,_,so,_) -> get_annotation_of_term so tl
-   | 2::tl,C.ALambda (_,_,_,_,ta) -> get_annotation_of_term ta tl
-   | [],C.AAppl (_,ann,_) -> ann
-   | n::tl,C.AAppl (_,_,l) when n <= List.length l ->
-      get_annotation_of_term (List.nth l (n-1)) tl
-   | [],C.AConst (_,ann,_,_) -> ann
-   | [],C.AAbst (_,ann,_) -> ann
-   | [],C.AMutInd (_,ann,_,_,_) -> ann
-   | [],C.AMutConstruct (_,ann,_,_,_,_) -> ann
-   | [],C.AMutCase (_,ann,_,_,_,_,_,_) -> ann
-   | 1::tl,C.AMutCase (_,_,_,_,_,outt,_,_) -> get_annotation_of_term outt tl
-   | 2::tl,C.AMutCase (_,_,_,_,_,_,te,_) -> get_annotation_of_term te tl
-   | n::tl,C.AMutCase (_,_,_,_,_,_,_,pl) when n <= List.length pl ->
-      get_annotation_of_term (List.nth pl (n-1)) tl
-   | [],C.AFix (_,ann,_,_) -> ann
-   | n::tl,C.AFix (_,_,_,fl) when n <= List.length fl ->
-      get_annotation_of_inductiveFun (List.nth fl (n-1)) tl
-   | [],C.ACoFix (_,ann,_,_) -> ann
-   | n::tl,C.ACoFix (_,_,_,fl) when n <= List.length fl ->
-      get_annotation_of_coinductiveFun (List.nth fl (n-1)) tl
-   | l,_ ->
-      raise (WrongXPath (List.fold_right (fun n i -> string_of_int n ^ i) l ""))
-;;
-
-let get_annotation (annobj,_) xpath =
- let module C = Cic in
-  match (xpath,annobj) with
-     [],C.ADefinition (_,ann,_,_,_,_) -> ann
-   | 1::tl,C.ADefinition (_,_,_,bo,_,_) -> get_annotation_of_term bo tl
-   | 2::tl,C.ADefinition (_,_,_,_,ty,_) -> get_annotation_of_term ty tl
-   | [],C.AAxiom (_,ann,_,_,_) -> ann
-   | 1::tl,C.AAxiom (_,_,_,ty,_) -> get_annotation_of_term ty tl
-   | [],C.AVariable (_,ann,_,_) -> ann
-   | 1::tl,C.AVariable (_,_,_,ty) -> get_annotation_of_term ty tl
-   | [],C.ACurrentProof (_,ann,_,_,_,_) -> ann
-   | n::tl,C.ACurrentProof (_,ann,_,conjs,_,_) when n <= List.length conjs ->
-      get_annotation_of_term (snd (List.nth conjs (n-1))) tl
-   | n::tl,C.ACurrentProof (_,ann,_,conjs,bo,_) when n = List.length conjs + 1 ->
-      get_annotation_of_term bo tl
-   | n::tl,C.ACurrentProof (_,ann,_,conjs,_,ty) when n = List.length conjs + 2 ->
-      get_annotation_of_term ty tl
-   | [],C.AInductiveDefinition (_,ann,_,_,_) -> ann
-   | n::tl,C.AInductiveDefinition (_,_,tys,_,_) when n <= List.length tys ->
-      get_annotation_of_inductiveType (List.nth tys (n-1)) tl
-   | l,_ ->
-      raise (WrongXPath (List.fold_right (fun n i -> string_of_int n ^ i) l ""))
-;;
index 6b0facf3398d3df21855657a19da923b7d8e7d99..9a36cb37dc52e1de0ddcbadbff4a76bae2e884b3 100644 (file)
 (******************************************************************************)
 
 (* this should be the only hard coded constant *)
-let filename = "/home/cadet/sacerdot/local/etc/helm/configuration.xml";;
+let filename =
+ let prefix =
+  try
+   Sys.getenv "HELM_CONFIGURATION_PREFIX"
+  with
+   Not_found -> ""
+ in
+  prefix ^ "/local/etc/helm/configuration.xml";;
 
 exception Warnings;;
 
index 21c1901a183722c4b2ac040964827f7353c4e06f..d79409c8933f8181e432f1b1d5b6ff73d84a2f71 100644 (file)
@@ -56,6 +56,8 @@ let rec mk_urls_of_uris =
          uris map
 ;;
 
+exception PerlGetterNotResponding;;
+
 let update () =
  let module C = Configuration in
   let fd = open_in C.servers_file in
@@ -72,7 +74,11 @@ let update () =
        Dbm.opendbm C.uris_dbm [Dbm.Dbm_wronly ; Dbm.Dbm_create] 0o660
       in
        MapOfStrings.iter (fun uri url -> Dbm.add dbm uri url) urls_of_uris ;
-       Dbm.close dbm
+       Dbm.close dbm ;
+       (* Inform also the Perl-getter *)
+       if Sys.command ("wget -O /dev/null http://localhost:8081/update") <> 0
+       then
+        raise PerlGetterNotResponding ;
 ;;
 
 (* url_of_uri : uri -> url *)
@@ -115,8 +121,8 @@ let get uri =
  let module U = UriManager in
   get_file
    (U.uri_of_string
-    (Str.replace_first (Str.regexp "\.ann$") ""
-     (Str.replace_first (Str.regexp "\.types$") "" (U.string_of_uri uri))))
+    (Str.replace_first (Str.regexp "\.types$") ""
+     (Str.replace_first (Str.regexp "\.ann$") "" (U.string_of_uri uri))))
 ;;
 
 (* get_ann : uri -> filename *)
diff --git a/helm/interface/gmon.out b/helm/interface/gmon.out
deleted file mode 100644 (file)
index c48b840..0000000
Binary files a/helm/interface/gmon.out and /dev/null differ
diff --git a/helm/interface/http_getter/http_getter.pl b/helm/interface/http_getter/http_getter.pl
deleted file mode 100755 (executable)
index 4ad3584..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-#!/usr/bin/perl
-
-# next require defines: $helm_dir, $html_link
-# LUCA - 12 sep 2000
-# require "/usr/lib/helm/configuration.pl";
-require "/home/cadet/sacerdot/local/lib/helm/configuration.pl";
-use HTTP::Daemon;
-use HTTP::Status;
-use HTTP::Request;
-use LWP::UserAgent;
-use DB_File;
-
-my $cont = "";
-my $d = new HTTP::Daemon LocalPort => 8081;
-tie(%map, 'DB_File', 'urls_of_uris.db', O_RDONLY, 0664);
-print "Please contact me at: <URL:", $d->url, ">\n";
-print "helm_dir: $helm_dir\n";
-$SIG{CHLD} = "IGNORE"; # do not accumulate defunct processes
-while (my $c = $d->accept) {
- if (fork() == 0) {
-    while (my $r = $c->get_request) {
-        #CSC: mancano i controlli di sicurezza
-        
-        $cont = "";
-        my $cicuri = $r->url; 
-        $cicuri =~ s/^[^?]*\?url=(.*)/$1/;
-        print "*".$r->url."\n";
-        my $http_method = $r->method;
-        my $http_path = $r->url->path;
-        if ($http_method eq 'GET' and $http_path eq "/get") {
-            my $filename = $cicuri;
-            $filename =~ s/cic:(.*)/$1/;
-            $filename =~ s/theory:(.*)/$1/;
-            $filename = $helm_dir.$filename.".xml";
-            my $resolved = $map{$cicuri};
-            print "$cicuri ==> $resolved ($filename)\n";
-            if (stat($filename)) {
-               print "Using local copy\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-               my $res = new HTTP::Response;
-               $res->content($cont);
-               $c->send_response($res);
-            } else {
-               print "Downloading\n";
-               $ua = LWP::UserAgent->new;
-               $request = HTTP::Request->new(GET => "$resolved");
-               $response = $ua->request($request, \&callback);
-               
-               print "Storing file\n";
-               open(FD, $filename);
-               print FD $cont;
-               close(FD);
-
-               my $res = new HTTP::Response;
-               $res->content($cont);
-               $c->send_response($res);
-            }
-        } elsif ($http_method eq 'GET' and $http_path eq "/annotate") {
-            my $do_annotate = ($cicuri =~ /\.ann$/);
-            my $target_to_annotate = $cicuri;
-            $target_to_annotate =~ s/(.*)\.ann$/$1/ if $do_annotate;
-            my $filename = $cicuri;
-            $filename =~ s/cic:(.*)/$1/;
-            $filename =~ s/theory:(.*)/$1/;
-            my $filename_target = $helm_dir.$filename if $do_annotate;
-            $filename = $helm_dir.$filename.".xml";
-            $filename_target =~ s/(.*)\.ann$/$1.xml/ if $do_annotate;
-            my $resolved = $map{$cicuri};
-            my $resolved_target = $map{$target_to_annotate} if $do_annotate;
-            if ($do_annotate) {
-               print "($cicuri, $target_to_annotate) ==> ($resolved + $resolved_target) ($filename)\n";
-            } else {
-               print "$cicuri ==> $resolved ($filename)\n";
-            }
-
-            # Retrieves the annotation
-
-            if (stat($filename)) {
-               print "Using local copy for the annotation\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-            } else {
-               print "Downloading the annotation\n";
-               $ua = LWP::UserAgent->new;
-               $request = HTTP::Request->new(GET => "$resolved");
-               $response = $ua->request($request, \&callback);
-               
-               print "Storing file for the annotation\n";
-               open(FD, $filename);
-               print FD $cont;
-               close(FD);
-            }
-            my $annotation = $cont;
-
-            # Retrieves the target to annotate
-
-            $cont = "";
-            if ($do_annotate) {
-               if (stat($filename_target)) {
-                  print "Using local copy for the file to annotate\n";
-                  open(FD, $filename_target);
-                  while(<FD>) { $cont .= $_; }
-                  close(FD);
-               } else {
-                  print "Downloading the file to annotate\n";
-                  $ua = LWP::UserAgent->new;
-                  $request = HTTP::Request->new(GET => "$resolved_target");
-                  $response = $ua->request($request, \&callback);
-               
-                  print "Storing file for the file to annotate\n";
-                  open(FD, $filename_target);
-                  print FD $cont;
-                  close(FD);
-               }
-            }
-            my $target = $cont;
-
-            # Merging the annotation and the target
-
-            $target =~ s/<\?xml [^?]*\?>//sg;
-            $target =~ s/<!DOCTYPE [^>]*>//sg;
-            $annotation =~ s/<\?xml [^?]*\?>//sg;
-            $annotation =~ s/<!DOCTYPE [^>]*>//sg;
-            my $merged = <<EOT;
-<?xml version="1.0" encoding="UTF-8"?>
-<cicxml uri="$target_to_annotate">
-$target
-$annotation
-</cicxml>
-EOT
-
-            # Answering the client
-
-            my $res = new HTTP::Response;
-            $res->content($merged);
-            $c->send_response($res);
-        } elsif ($http_method eq 'GET' and $http_path eq "/getwithtypes") {
-            my $do_annotate = ($cicuri =~ /\.types$/);
-            my $target_to_annotate = $cicuri;
-            $target_to_annotate =~ s/(.*)\.types$/$1/ if $do_annotate;
-            my $filename = $cicuri;
-            $filename =~ s/cic:(.*)/$1/;
-            $filename =~ s/theory:(.*)/$1/;
-            my $filename_target = $helm_dir.$filename if $do_annotate;
-            $filename = $helm_dir.$filename.".xml";
-            $filename_target =~ s/(.*)\.types$/$1.xml/ if $do_annotate;
-            my $resolved = $map{$cicuri};
-            my $resolved_target = $map{$target_to_annotate} if $do_annotate;
-            if ($do_annotate) {
-               print "GETWITHTYPES!!\n";
-               print "($cicuri, $target_to_annotate) ==> ($resolved + $resolved_target) ($filename)\n";
-             } else {
-               print "$cicuri ==> $resolved ($filename)\n";
-            }
-
-            # Retrieves the annotation
-
-            if (stat($filename)) {
-               print "Using local copy for the types\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-            } else {
-               print "Downloading the types\n";
-               $ua = LWP::UserAgent->new;
-               $request = HTTP::Request->new(GET => "$resolved");
-               $response = $ua->request($request, \&callback);
-               
-               print "Storing file for the types\n";
-               open(FD, $filename);
-               print FD $cont;
-               close(FD);
-            }
-            my $annotation = $cont;
-
-            # Retrieves the target to annotate
-
-            $cont = "";
-            my $target;
-            if ($do_annotate) {
-               if (stat($filename_target)) {
-                  print "Using local copy for the file to type\n";
-                  open(FD, $filename_target);
-                  while(<FD>) { $cont .= $_; }
-                  close(FD);
-               } else {
-                  print "Downloading the file to type\n";
-                  $ua = LWP::UserAgent->new;
-                  $request = HTTP::Request->new(GET => "$resolved_target");
-                  $response = $ua->request($request, \&callback);
-               
-                  print "Storing file for the file to type\n";
-                  open(FD, $filename_target);
-                  print FD $cont;
-                  close(FD);
-               }
-               $target = $cont;
-            } else {
-               $target = $annotation;
-               $annotation = "";
-            }
-
-            # Merging the annotation and the target
-
-            $target =~ s/<\?xml [^?]*\?>//sg;
-            $target =~ s/<!DOCTYPE [^>]*>//sg;
-            $annotation =~ s/<\?xml [^?]*\?>//sg;
-            $annotation =~ s/<!DOCTYPE [^>]*>//sg;
-            my $merged = <<EOT;
-<?xml version="1.0" encoding="UTF-8"?>
-<cicxml uri="$target_to_annotate">
-$target
-<ALLTYPES>
-$annotation
-</ALLTYPES>
-</cicxml>
-EOT
-
-            # Answering the client
-
-            my $res = new HTTP::Response;
-            $res->content($merged);
-            $c->send_response($res);
-         } elsif ($http_method eq 'GET' and $http_path eq "/getdtd") {
-            my $filename = $cicuri;
-            $filename = $helm_dir."/dtd/".$filename;
-            print "DTD: $cicuri ==> ($filename)\n";
-            if (stat($filename)) {
-               print "Using local copy\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-               my $res = new HTTP::Response;
-               $res->content($cont);
-               $c->send_response($res);
-            } else {
-               die "Could not find DTD!";
-            }
-        } elsif ($http_method eq 'GET' and $http_path eq "/conf") {
-            my $quoted_html_link = $html_link;
-            $quoted_html_link =~ s/&/&amp;/g;
-            $quoted_html_link =~ s/</&lt;/g;
-            $quoted_html_link =~ s/>/&gt;/g;
-            $quoted_html_link =~ s/'/&apos;/g;
-            $quoted_html_link =~ s/"/&quot;/g;
-            print "Configuration requested, returned #$quoted_html_link#\n";
-           $cont = "<?xml version=\"1.0\"?><html_link>$quoted_html_link</html_link>";
-            my $res = new HTTP::Response;
-            $res->content($cont);
-            $c->send_response($res);
-        } else {
-            print "INVALID REQUEST!!!!!\n";
-            $c->send_error(RC_FORBIDDEN)
-        }
-    }
-    $c->close;
-    undef($c);
-    print "\nCONNECTION CLOSED\n\n";
-    exit;
-  } # fork
-}
-
-#================================
-
-sub callback
-{
- my ($data) = @_;
- $cont .= $data;
-}
diff --git a/helm/interface/http_getter/http_getter.pl2 b/helm/interface/http_getter/http_getter.pl2
deleted file mode 100755 (executable)
index 3adfa2b..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-#!/usr/bin/perl
-
-# next require defines: $helm_dir, $html_link
-require "/usr/lib/helm/configuration.pl";
-use HTTP::Daemon;
-use HTTP::Status;
-use HTTP::Request;
-use LWP::UserAgent;
-use DB_File;
-
-my $cont = "";
-my $d = new HTTP::Daemon LocalPort => 8081;
-tie(%map, 'DB_File', 'urls_of_uris.db', O_RDONLY, 0664);
-print "Please contact me at: <URL:", $d->url, ">\n";
-print "helm_dir: $helm_dir\n";
-$SIG{CHLD} = "IGNORE"; # do not accumulate defunct processes
-while (my $c = $d->accept) {
- if (fork() == 0) {
-    while (my $r = $c->get_request) {
-        #CSC: mancano i controlli di sicurezza
-        
-        $cont = "";
-        my $cicuri = $r->url; 
-        $cicuri =~ s/^[^?]*\?url=(.*)/$1/;
-        print "*".$r->url."\n";
-        my $http_method = $r->method;
-        my $http_path = $r->url->path;
-        if ($http_method eq 'GET' and $http_path eq "/get") {
-            my $filename = $cicuri;
-            $filename =~ s/cic:(.*)/$1/;
-            $filename =~ s/theory:(.*)/$1/;
-            $filename = $helm_dir.$filename.".xml";
-            my $resolved = $map{$cicuri};
-            print "$cicuri ==> $resolved ($filename)\n";
-            if (stat($filename)) {
-               print "Using local copy\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-               my $res = new HTTP::Response;
-               $res->content($cont);
-               $c->send_response($res);
-            } else {
-               print "Downloading\n";
-               $ua = LWP::UserAgent->new;
-               $request = HTTP::Request->new(GET => "$resolved");
-               $response = $ua->request($request, \&callback);
-               
-               print "Storing file\n";
-               open(FD, $filename);
-               print FD $cont;
-               close(FD);
-
-               my $res = new HTTP::Response;
-               $res->content($cont);
-               $c->send_response($res);
-            }
-        } elsif ($http_method eq 'GET' and $http_path eq "/annotate") {
-            my $do_annotate = ($cicuri =~ /\.ann$/);
-            my $target_to_annotate = $cicuri;
-            $target_to_annotate =~ s/(.*)\.ann$/$1/ if $do_annotate;
-            my $filename = $cicuri;
-            $filename =~ s/cic:(.*)/$1/;
-            $filename =~ s/theory:(.*)/$1/;
-            my $filename_target = $helm_dir.$filename if $do_annotate;
-            $filename = $helm_dir.$filename.".xml";
-            $filename_target =~ s/(.*)\.ann$/$1.xml/ if $do_annotate;
-            my $resolved = $map{$cicuri};
-            my $resolved_target = $map{$target_to_annotate} if $do_annotate;
-            if ($do_annotate) {
-               print "($cicuri, $target_to_annotate) ==> ($resolved + $resolved_target) ($filename)\n";
-        } elsif ($http_method eq 'GET' and $http_path eq "/getwithtypes") {
-            my $do_annotate = ($cicuri =~ /\.types$/);
-            my $target_to_annotate = $cicuri;
-            $target_to_annotate =~ s/(.*)\.types$/$1/ if $do_annotate;
-            my $filename = $cicuri;
-            $filename =~ s/cic:(.*)/$1/;
-            $filename =~ s/theory:(.*)/$1/;
-            my $filename_target = $helm_dir.$filename if $do_annotate;
-            $filename = $helm_dir.$filename.".xml";
-            $filename_target =~ s/(.*)\.types$/$1.xml/ if $do_annotate;
-            my $resolved = $map{$cicuri};
-            my $resolved_target = $map{$target_to_annotate} if $do_annotate;
-            if ($do_annotate) {
-               print "($cicuri, $target_to_annotate) ==> ($resolved + $resolved_target) ($filename)\n";
-             } else {
-               print "$cicuri ==> $resolved ($filename)\n";
-            }
-
-            # Retrieves the annotation
-
-            if (stat($filename)) {
-               print "Using local copy for the types\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-            } else {
-               print "Downloading the types\n";
-               $ua = LWP::UserAgent->new;
-               $request = HTTP::Request->new(GET => "$resolved");
-               $response = $ua->request($request, \&callback);
-               
-               print "Storing file for the types\n";
-               open(FD, $filename);
-               print FD $cont;
-               close(FD);
-            }
-            my $annotation = $cont;
-
-            # Retrieves the target to annotate
-
-            $cont = "";
-            if ($do_annotate) {
-               if (stat($filename_target)) {
-                  print "Using local copy for the file to type\n";
-                  open(FD, $filename_target);
-                  while(<FD>) { $cont .= $_; }
-                  close(FD);
-               } else {
-                  print "Downloading the file to type\n";
-                  $ua = LWP::UserAgent->new;
-                  $request = HTTP::Request->new(GET => "$resolved_target");
-                  $response = $ua->request($request, \&callback);
-               
-                  print "Storing file for the file to type\n";
-                  open(FD, $filename_target);
-                  print FD $cont;
-                  close(FD);
-               }
-            }
-            my $target = $cont;
-
-            # Merging the annotation and the target
-
-            $target =~ s/<\?xml [^?]*\?>//sg;
-            $target =~ s/<!DOCTYPE [^>]*>//sg;
-            $annotation =~ s/<\?xml [^?]*\?>//sg;
-            $annotation =~ s/<!DOCTYPE [^>]*>//sg;
-            my $merged = <<EOT;
-<?xml version="1.0" encoding="UTF-8"?>
-<cicxml uri="$target_to_annotate">
-$target
-<ALLTYPES>
-$annotation
-</ALLTYPES>
-</cicxml>
-EOT
-
-            # Answering the client
-
-            my $res = new HTTP::Response;
-            $res->content($merged);
-            $c->send_response($res);
-        } elsif ($http_method eq 'GET' and $http_path eq "/getdtd") {
-            my $filename = $cicuri;
-            $filename = $helm_dir."/dtd/".$filename;
-            print "DTD: $cicuri ==> ($filename)\n";
-            if (stat($filename)) {
-               print "Using local copy\n";
-               open(FD, $filename);
-               while(<FD>) { $cont .= $_; }
-               close(FD);
-               my $res = new HTTP::Response;
-               $res->content($cont);
-               $c->send_response($res);
-            } else {
-               die "Could not find DTD!";
-            }
-        } elsif ($http_method eq 'GET' and $http_path eq "/conf") {
-            my $quoted_html_link = $html_link;
-            $quoted_html_link =~ s/&/&amp;/g;
-            $quoted_html_link =~ s/</&lt;/g;
-            $quoted_html_link =~ s/>/&gt;/g;
-            $quoted_html_link =~ s/'/&apos;/g;
-            $quoted_html_link =~ s/"/&quot;/g;
-            print "Configuration requested, returned #$quoted_html_link#\n";
-           $cont = "<?xml version=\"1.0\"?><html_link>$quoted_html_link</html_link>";
-            my $res = new HTTP::Response;
-            $res->content($cont);
-            $c->send_response($res);
-        } else {
-            print "INVALID REQUEST!!!!!\n";
-            $c->send_error(RC_FORBIDDEN)
-        }
-    }
-    $c->close;
-    undef($c);
-    print "\nCONNECTION CLOSED\n\n";
-    exit;
-  } # fork
-}
-
-#================================
-
-sub callback
-{
- my ($data) = @_;
- $cont .= $data;
-}
index a1f696a3b53d5a376a2935f107c4ae637ef89317..a7d6c4d3e4ce87ecd7c928321b0716e66c8437e5 100755 (executable)
@@ -1,12 +1,16 @@
 #! /bin/sh
 
-export PATH=$PATH:/opt/java/jdk118/bin/
+# WARNING!!! No "//" in the middle of the path, nor a "/" at the end!!!!
 
-export CLASSPATH=.
-export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/xalan_1_1/xalan.jar
-export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/xalan_1_1/xerces.jar
-export CLASSPATH=$CLASSPATH:/home/lpadovan/helm/java/saxon-5.3.2/saxon.jar
+#V6.2
 
 # Per (my)Coq 6.3.0
 export LD_LIBRARY_PATH=/home/lpadovan/helm/usr/lib/:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=/usr/local/lib/gtkmathview:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
+
+#export T1LIB_CONFIG=./t1.config
+
+# Stix font
+#xset fp
+#xset fp+ ~/HELM/installation/fonts/
+#xset fp rehash
diff --git a/helm/interface/javacore15005.txt b/helm/interface/javacore15005.txt
deleted file mode 100644 (file)
index 9920964..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-SIGSEGV received at bfffeacc in /home/cadet/sacerdot/jdk118/lib/linux/native_threads/libjitc.so. Processing terminated
-java full version "JDK 1.1.8 IBM build l118-19991013 (JIT enabled: jitc)"
-args: /home/cadet/sacerdot/jdk118/bin/linux/native_threads/java xaland 12345 12346 examples/style/annotatedcont.xsl examples/style/annotatedpres.xsl examples/style/theory_content.xsl examples/style/theory_pres.xsl
-
-Operating Environment
----------------------
-Host           : cadet.
-OS Level       : 2.2.14-5.0smp.#1 SMP Tue Mar 7 21:01:40 EST 2000
-glibc Version  : 2.1.3
-No. of Procs   : 1
-Memory Info:
-        total:    used:    free:  shared: buffers:  cached:
-Mem:  64503808 55078912  9424896 36126720  1527808 18075648
-Swap: 133885952  7442432 126443520
-MemTotal:     62992 kB
-MemFree:       9204 kB
-MemShared:    35280 kB
-Buffers:       1492 kB
-Cached:       17652 kB
-BigTotal:         0 kB
-BigFree:          0 kB
-SwapTotal:   130748 kB
-SwapFree:    123480 kB
-
-Application Environment
------------------------
-Signal Handlers -
-       SIGQUIT         : ignored
-       SIGILL          : sysThreadIDump (libjava.so)
-       SIGABRT         : sysThreadIDump (libjava.so)
-       SIGFPE          : sysThreadIDump (libjava.so)
-       SIGBUS          : sysThreadIDump (libjava.so)
-       SIGSEGV         : sysThreadIDump (libjava.so)
-       SIGPIPE         : ignored
-       SIGUSR1         : doSuspendLoop (libjava.so)
-
-Environment Variables -
-       LESSOPEN=|/usr/bin/lesspipe.sh %s
-       SAL_DO_NOT_USE_INVERT50=true
-       HISTSIZE=1000
-       HOSTNAME=cadet
-       LOGNAME=sacerdot
-       VISUAL=/usr/bin/emacs
-       LD_LIBRARY_PATH=/home/cadet/sacerdot/jdk118/lib/linux/native_threads:/usr/local/lib/gtkmathview:/home/pauillac/coq3/sacerdot/rvplayer5.0
-       MAIL=/var/spool/mail/sacerdot
-       PAGER=less
-       CLASSPATH=.:/usr/share/java/bsf.jar:/usr/share/java/xalan.jar:/usr/share/java/xerces.jar:/home/cadet/sacerdot/jdk118/classes:/home/cadet/sacerdot/jdk118/lib/classes.jar:/home/cadet/sacerdot/jdk118/lib/rt.jar:/home/cadet/sacerdot/jdk118/lib/i18n.jar:/home/cadet/sacerdot/jdk118/lib/classes.zip
-       LESSCHARDEF=8bcccbcc18b95.33b.
-       ARCH=i586
-       PROMPT=cad: 
-       TERM=xterm
-       HOSTTYPE=i386
-       PATH=/home/cadet/sacerdot/jdk118/bin:/home/pauillac/coq3/sacerdot/bin/i586:/home/pauillac/coq3/sacerdot/bin:/usr/bin/X11:/usr/bin:/usr/local/bin:/usr/ucb:/usr/bin:/bin:/usr/sbin:/sbin:/usr/games:.
-       PRINTER=hp11rv
-       HOME=/home/pauillac/coq3/sacerdot
-       SHELL=/bin/sh
-       ELANLIB=/home/pauillac/coq3/sacerdot/elan-dist.3.00/elanlib
-       PILOTPORT=/dev/ttyS1
-       TEXINPUTS=:.:/home/pauillac/coq3/sacerdot/lib/latex/inputs:/usr/local/lib/tex/inputs3
-       USER=sacerdot
-       ENSCRIPT=-Php11rvl -2 -r -B -L66 -k -h
-       MANPATH=/usr/man/preformat:/usr/man:/usr/X11/man:/usr/local/man:/home/pauillac/coq3/sacerdot/man
-       LESS=-m -e -q -d
-       JAVA_HOME=/home/cadet/sacerdot/jdk118
-       DISPLAY=:0.0
-       MAKEFLAGS=
-       HOST=cadet
-       OSTYPE=Linux
-       NNTPSERVER=news-rocq.inria.fr
-       WINDOWID=54525966
-       SHLVL=4
-       MAKELEVEL=1
-       LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
-       EDITOR=/usr/bin/emacs
-       MFLAGS=
-       CVSROOT=/net/pauillac/constr/ARCHIVE
-
-
-Current Thread Details
-----------------------
-    "main" (TID:0x402e62d8, sys_thread_t:0x804abe0)
-    Native Thread State: ThreadID: 00000400 Reuse: 1 USER PRIMORDIAL RUNNING
-    Native Stack Data  : base: bffff47c pointer bffbf96c used(260880) free(-13072)
-       ----- Monitors held -----
-       ----- Native stack -----
-       
-       
-       
-       
-       
-       
-       
-       
-       ??
-       ??
-       ??
-       
-       java_lang_Compiler_start
-       
-       __irem_trap6
-       ------ Java stack ------        () prio=5 *current thread*
-       org.apache.xalan.xslt.XSLTEngineImpl.createStylesheetRoot(XSLTEngineImpl.java:715)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       xaland.main(Compiled Code)
-----------------------------------------------------------------------
-
-
-Total Thread Count:    3
-Active Thread Count:   3
-JNI Thread Count:      0
-
-Full thread dump:
-    "Async Garbage Collector" (TID:0x402e6238, sys_thread_t:0x8091f50)
-    Native Thread State: ThreadID: 00000803 Reuse: 1 DAEMON  MONITOR WAIT
-    Native Stack Data  : base: bf5ffd84 pointer bf5ffb78 used(524) free(247284)
-       ----- Monitors held -----
-       ----- Native stack -----
-       sysMonitorWait
-       sysThreadSleep
-       threadSleep
-       SetOrigArgs
-       sysThread_shell
-       pthread_detach
-       __clone
-       ------ Java stack ------        () prio=1
-----------------------------------------------------------------------
-
-    "Finalizer thread" (TID:0x402e6288, sys_thread_t:0x8091cd0)
-    Native Thread State: ThreadID: 00000402 Reuse: 1 DAEMON  MONITOR WAIT
-    Native Stack Data  : base: bf7ffd84 pointer bf7ffbec used(408) free(247400)
-       ----- Monitors held -----
-       ----- Native stack -----
-       sysMonitorWait - waiting on Finalize me queue lock
-       finalizeOnExit
-       sysThread_shell
-       pthread_detach
-       __clone
-       ------ Java stack ------        () prio=1
-----------------------------------------------------------------------
-
-    "main" (TID:0x402e62d8, sys_thread_t:0x804abe0)
-    Native Thread State: ThreadID: 00000400 Reuse: 1 USER PRIMORDIAL RUNNING
-    Native Stack Data  : base: bffff47c pointer bffbf960 used(260892) free(-13084)
-       ----- Monitors held -----
-       ----- Native stack -----
-       
-       
-       
-       
-       
-       
-       
-       
-       ??
-       ??
-       ??
-       
-       java_lang_Compiler_start
-       
-       __irem_trap6
-       ------ Java stack ------        () prio=5 *current thread*
-       org.apache.xalan.xslt.XSLTEngineImpl.createStylesheetRoot(XSLTEngineImpl.java:715)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       xaland.main(Compiled Code)
-----------------------------------------------------------------------
-
-
-System Monitor Status
----------------------
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    Thread queue lock:     unowned.
-    Name and type hash table lock:     unowned.
-    String intern lock:     unowned.
-    JNI pinning lock:     unowned.
-    JNI global reference lock:     unowned.
-    Zip lock:     unowned.
-    BinClass lock:     unowned.
-    Class loading lock:     unowned.
-    Java stack lock:     unowned.
-    Code rewrite lock:     unowned.
-    Heap Lock:     unowned.
-    Has finalization queue lock:     unowned.
-    Finalize me queue lock:     unowned.
-    Integer lock access-lock:     unowned.
-    Monitor cache lock:     unowned.
-    Monitor registry:     unowned.
-
-Object Monitor Status
----------------------
diff --git a/helm/interface/javacore15021.txt b/helm/interface/javacore15021.txt
deleted file mode 100644 (file)
index bac0b8a..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-SIGSEGV received at bfffeacc in /home/cadet/sacerdot/jdk118/lib/linux/native_threads/libjitc.so. Processing terminated
-java full version "JDK 1.1.8 IBM build l118-19991013 (JIT enabled: jitc)"
-args: /home/cadet/sacerdot/jdk118/bin/linux/native_threads/java xaland 12345 12346 examples/style/annotatedcont.xsl examples/style/annotatedpres.xsl examples/style/theory_content.xsl examples/style/theory_pres.xsl
-
-Operating Environment
----------------------
-Host           : cadet.
-OS Level       : 2.2.14-5.0smp.#1 SMP Tue Mar 7 21:01:40 EST 2000
-glibc Version  : 2.1.3
-No. of Procs   : 1
-Memory Info:
-        total:    used:    free:  shared: buffers:  cached:
-Mem:  64503808 55672832  8830976 36130816  1536000 18612224
-Swap: 133885952  7442432 126443520
-MemTotal:     62992 kB
-MemFree:       8624 kB
-MemShared:    35284 kB
-Buffers:       1500 kB
-Cached:       18176 kB
-BigTotal:         0 kB
-BigFree:          0 kB
-SwapTotal:   130748 kB
-SwapFree:    123480 kB
-
-Application Environment
------------------------
-Signal Handlers -
-       SIGQUIT         : ignored
-       SIGILL          : sysThreadIDump (libjava.so)
-       SIGABRT         : sysThreadIDump (libjava.so)
-       SIGFPE          : sysThreadIDump (libjava.so)
-       SIGBUS          : sysThreadIDump (libjava.so)
-       SIGSEGV         : sysThreadIDump (libjava.so)
-       SIGPIPE         : ignored
-       SIGUSR1         : doSuspendLoop (libjava.so)
-
-Environment Variables -
-       LESSOPEN=|/usr/bin/lesspipe.sh %s
-       SAL_DO_NOT_USE_INVERT50=true
-       HISTSIZE=1000
-       HOSTNAME=cadet
-       LOGNAME=sacerdot
-       VISUAL=/usr/bin/emacs
-       LD_LIBRARY_PATH=/home/cadet/sacerdot/jdk118/lib/linux/native_threads:/usr/local/lib/gtkmathview:/home/pauillac/coq3/sacerdot/rvplayer5.0
-       MAIL=/var/spool/mail/sacerdot
-       PAGER=less
-       CLASSPATH=.:/usr/share/java/bsf.jar:/usr/share/java/xalan.jar:/usr/share/java/xerces.jar:/home/cadet/sacerdot/jdk118/classes:/home/cadet/sacerdot/jdk118/lib/classes.jar:/home/cadet/sacerdot/jdk118/lib/rt.jar:/home/cadet/sacerdot/jdk118/lib/i18n.jar:/home/cadet/sacerdot/jdk118/lib/classes.zip
-       LESSCHARDEF=8bcccbcc18b95.33b.
-       ARCH=i586
-       PROMPT=cad: 
-       TERM=xterm
-       HOSTTYPE=i386
-       PATH=/home/cadet/sacerdot/jdk118/bin:/home/pauillac/coq3/sacerdot/bin/i586:/home/pauillac/coq3/sacerdot/bin:/usr/bin/X11:/usr/bin:/usr/local/bin:/usr/ucb:/usr/bin:/bin:/usr/sbin:/sbin:/usr/games:.
-       PRINTER=hp11rv
-       HOME=/home/pauillac/coq3/sacerdot
-       SHELL=/bin/sh
-       ELANLIB=/home/pauillac/coq3/sacerdot/elan-dist.3.00/elanlib
-       PILOTPORT=/dev/ttyS1
-       TEXINPUTS=:.:/home/pauillac/coq3/sacerdot/lib/latex/inputs:/usr/local/lib/tex/inputs3
-       USER=sacerdot
-       ENSCRIPT=-Php11rvl -2 -r -B -L66 -k -h
-       MANPATH=/usr/man/preformat:/usr/man:/usr/X11/man:/usr/local/man:/home/pauillac/coq3/sacerdot/man
-       LESS=-m -e -q -d
-       JAVA_HOME=/home/cadet/sacerdot/jdk118
-       DISPLAY=:0.0
-       MAKEFLAGS=
-       HOST=cadet
-       OSTYPE=Linux
-       NNTPSERVER=news-rocq.inria.fr
-       WINDOWID=54525966
-       SHLVL=4
-       MAKELEVEL=1
-       LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
-       EDITOR=/usr/bin/emacs
-       MFLAGS=
-       CVSROOT=/net/pauillac/constr/ARCHIVE
-
-
-Current Thread Details
-----------------------
-    "main" (TID:0x402e62d8, sys_thread_t:0x804abe0)
-    Native Thread State: ThreadID: 00000400 Reuse: 1 USER PRIMORDIAL RUNNING
-    Native Stack Data  : base: bffff47c pointer bffbf96c used(260880) free(-13072)
-       ----- Monitors held -----
-       ----- Native stack -----
-       
-       
-       
-       
-       
-       
-       
-       
-       ??
-       ??
-       ??
-       
-       java_lang_Compiler_start
-       
-       __irem_trap6
-       ------ Java stack ------        () prio=5 *current thread*
-       org.apache.xalan.xslt.XSLTEngineImpl.createStylesheetRoot(XSLTEngineImpl.java:715)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       xaland.main(Compiled Code)
-----------------------------------------------------------------------
-
-
-Total Thread Count:    3
-Active Thread Count:   3
-JNI Thread Count:      0
-
-Full thread dump:
-    "Async Garbage Collector" (TID:0x402e6238, sys_thread_t:0x8091f50)
-    Native Thread State: ThreadID: 00000803 Reuse: 1 DAEMON  MONITOR WAIT
-    Native Stack Data  : base: bf5ffd84 pointer bf5ffb78 used(524) free(247284)
-       ----- Monitors held -----
-       ----- Native stack -----
-       sysMonitorWait
-       sysThreadSleep
-       threadSleep
-       SetOrigArgs
-       sysThread_shell
-       pthread_detach
-       __clone
-       ------ Java stack ------        () prio=1
-----------------------------------------------------------------------
-
-    "Finalizer thread" (TID:0x402e6288, sys_thread_t:0x8091cd0)
-    Native Thread State: ThreadID: 00000402 Reuse: 1 DAEMON  MONITOR WAIT
-    Native Stack Data  : base: bf7ffd84 pointer bf7ffbec used(408) free(247400)
-       ----- Monitors held -----
-       ----- Native stack -----
-       sysMonitorWait - waiting on Finalize me queue lock
-       finalizeOnExit
-       sysThread_shell
-       pthread_detach
-       __clone
-       ------ Java stack ------        () prio=1
-----------------------------------------------------------------------
-
-    "main" (TID:0x402e62d8, sys_thread_t:0x804abe0)
-    Native Thread State: ThreadID: 00000400 Reuse: 1 USER PRIMORDIAL RUNNING
-    Native Stack Data  : base: bffff47c pointer bffbf960 used(260892) free(-13084)
-       ----- Monitors held -----
-       ----- Native stack -----
-       
-       
-       
-       
-       
-       
-       
-       
-       ??
-       ??
-       ??
-       
-       java_lang_Compiler_start
-       
-       __irem_trap6
-       ------ Java stack ------        () prio=5 *current thread*
-       org.apache.xalan.xslt.XSLTEngineImpl.createStylesheetRoot(XSLTEngineImpl.java:715)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(Compiled Code)
-       xaland.main(Compiled Code)
-----------------------------------------------------------------------
-
-
-System Monitor Status
----------------------
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    JIT monitor:     unowned.
-    Thread queue lock:     unowned.
-    Name and type hash table lock:     unowned.
-    String intern lock:     unowned.
-    JNI pinning lock:     unowned.
-    JNI global reference lock:     unowned.
-    Zip lock:     unowned.
-    BinClass lock:     unowned.
-    Class loading lock:     unowned.
-    Java stack lock:     unowned.
-    Code rewrite lock:     unowned.
-    Heap Lock:     unowned.
-    Has finalization queue lock:     unowned.
-    Finalize me queue lock:     unowned.
-    Integer lock access-lock:     unowned.
-    Monitor cache lock:     unowned.
-    Monitor registry:     unowned.
-
-Object Monitor Status
----------------------
diff --git a/helm/interface/latinize.pl b/helm/interface/latinize.pl
deleted file mode 100755 (executable)
index 7fa6787..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/perl
-
-while(<STDIN>)
-{
-  s/&#8594;/->/g;
-  s/&#8658;/=>/g;
-  s/&#955;/\\/g;
-  s/&#928;/||/g;
-  print;
-}
diff --git a/helm/interface/mkindex.sh b/helm/interface/mkindex.sh
deleted file mode 100755 (executable)
index b47864f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-echo `find . -name "*.xml"` | /really_very_local/helm/PARSER/coq_like_pretty_printer/uris_of_filenames.pl > index.txt
diff --git a/helm/interface/mml.dtd b/helm/interface/mml.dtd
deleted file mode 100644 (file)
index 10ce5cb..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml encoding="ISO-8859-1"?>
-
-<!-- CSC: mio DTD semplificatissimo per la parte presentation di MML -->
-
-<!-- I seguenti presentation elements sono stati tralasciati ;-)
-mspace
-ms
-<mchar>
-<ms>
-mfrac
-msqrt
-mroot
-mstyle
-merror
-mpadded
-mphantom
-msub
-msup
-msubsup
-munder
-mover
-munderover
-mmultiscripts
-mtable
-mtr
-mtd
-maligngroup
-malignmark
-maction
--->
-
-<!-- Dei seguenti elementi, invece, vengono tralasciati quasi tutti gli
-     attributi
-&ApplyFunction;
--->
-
-<!ENTITY % Presentation '(mi|mo|mn|mtext|mrow|mfenced)*'>
-
-<!ELEMENT math %Presentation;>
-
-<!ELEMENT mi (#PCDATA)>
-
-<!ELEMENT mo (#PCDATA)>
-
-<!ELEMENT mn (#PCDATA)>
-
-<!ELEMENT mtext (#PCDATA)>
-
-<!ELEMENT mrow %Presentation;>
-
-<!ELEMENT mfenced %Presentation;>
-<!ATTLIST mfenced
-          open       CDATA #IMPLIED
-          close      CDATA #IMPLIED
-          separators CDATA #IMPLIED>
diff --git a/helm/interface/mml.ml b/helm/interface/mml.ml
deleted file mode 100644 (file)
index 88c2813..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-type expr =
-   Null
- | Mi of string
- | Mo of string
- | Mn of string
- | Mtext of string
- | Mrow of expr list
- | Mfenced of string * string * string * expr list (* open, close, separators *)
-type fragment =
- Math of expr list
-;;
index 76f6e5a78940b291aefc4d8905bf5f6aa8ff19b9..5cd0faf0c999460cb0b7f67b0578758b46c4d80c 100755 (executable)
@@ -109,7 +109,6 @@ let to_visit_uris = ref [];;
 
 exception NoCurrentUri;;
 exception NoNextOrPrevUri;;
-exception GtkInterfaceInternalError;;
 
 let theory_get_current_uri () =
  match !theory_visited_uris with
@@ -205,19 +204,32 @@ let prev rendering_window () =
 ;;
 
 (* called when an hyperlink is clicked *)
-let jump rendering_window s =
- let uri = UriManager.uri_of_string s in
-  rendering_window#show () ;
-  rendering_window#prevb#misc#set_sensitive true ;
-  rendering_window#nextb#misc#set_sensitive false ;
-  visited_uris := uri::!visited_uris ;
-  to_visit_uris := [] ;
-  annotated_obj := None ;
-  update_output rendering_window uri
+let jump rendering_window (node : Ominidom.o_mDOMNode) =
+ let module O = Ominidom in
+  match (node#get_attribute (O.o_mDOMString_of_string "href")) with
+    Some str ->
+     let s = str#get_string in
+     let uri = UriManager.uri_of_string s in
+      rendering_window#show () ;
+      rendering_window#prevb#misc#set_sensitive true ;
+      rendering_window#nextb#misc#set_sensitive false ;
+      visited_uris := uri::!visited_uris ;
+      to_visit_uris := [] ;
+      annotated_obj := None ;
+      update_output rendering_window uri
+  | None -> assert false
 ;;
 
-let changefont rendering_window () =
- rendering_window#output#set_font_size rendering_window#spinb#value_as_int
+let choose_selection rendering_window (node : Ominidom.o_mDOMNode option) =
+ let module O = Ominidom in
+  let rec aux node =
+   match node#get_attribute (O.o_mDOMString_of_string "xref") with
+     Some _ -> rendering_window#output#set_selection (Some node)
+   | None   -> aux (node#get_parent)
+  in
+   match node with
+     Some x -> aux x
+   | None   -> rendering_window#output#set_selection None
 ;;
 
 
@@ -313,16 +325,17 @@ let check rendering_window () =
 ;;
 
 let annotateb_pressed rendering_window annotation_window () =
- let xpath = (rendering_window#output#get_selection : string option) in
-  match xpath with
-     None -> (rendering_window#errors : GEdit.text)#insert "\nNo selection!\n"
+ let module O = Ominidom in
+ match rendering_window#output#get_selection with
+ | Some node ->
+  begin
+   match (node#get_attribute (O.o_mDOMString_of_string "xref")) with
    | Some xpath ->
-    try
      let annobj = get_annotated_obj ()
      (* next "cast" can't got rid of, but I don't know why *)
      and annotation = (annotation_window#annotation : GEdit.text) in
-      ann := CicXPath.get_annotation annobj xpath ;
-      CicAnnotationHinter.create_hints annotation_window annobj xpath ;
+      ann := CicXPath.get_annotation annobj (xpath#get_string) ;
+      CicAnnotationHinter.create_hints annotation_window annobj (xpath#get_string) ;
       annotation#delete_text 0 annotation#length ;
       begin
        match !(!ann) with
@@ -338,11 +351,12 @@ let annotateb_pressed rendering_window annotation_window () =
       end ;
       GMain.Grab.add (annotation_window#window_to_annotate#coerce) ;
       annotation_window#show () ;
-    with
-      e ->
+   | None ->
        (* next "cast" can't got rid of, but I don't know why *)
        let errors = (rendering_window#errors : GEdit.text) in
-        errors#insert ("\n" ^ Printexc.to_string e ^ "\n")
+        errors#insert ("\nNo xref found\n")
+  end
+ | None -> (rendering_window#errors : GEdit.text)#insert "\nNo selection!\n"
 ;;
 
 (* called when the annotation is confirmed *)
@@ -352,7 +366,7 @@ let save_annotation annotation =
  else
   !ann := None ;
  match !annotated_obj with
-    None -> raise GtkInterfaceInternalError
+    None -> assert false
   | Some (annobj,_) ->
      let uri = get_current_uri () in
       let annxml = Annotation2Xml.pp_annotation annobj uri in
@@ -385,12 +399,121 @@ let mktree selection_changed rendering_window =
              ignore(treeitem2#connect#select
               (selection_changed rendering_window uri)) ;
              aux treeitem2 ti
-         ) !content
+         ) (List.sort compare !content)
    | _ -> ()
  in
   aux 
 ;;
 
+(* Stuff for the widget settings *)
+
+let export_to_postscript (output : GMathView.math_view) () =
+ output#export_to_postscript ~filename:"output.ps" ();
+;;
+
+let activate_t1 output button_set_anti_aliasing button_set_kerning 
+ button_export_to_postscript button_t1 ()
+=
+ let is_set = button_t1#active in
+  output#set_font_manager_type
+   (if is_set then `font_manager_t1 else `font_manager_gtk) ;
+  if is_set then
+   begin
+    button_set_anti_aliasing#misc#set_sensitive true ;
+    button_set_kerning#misc#set_sensitive true ;
+    button_export_to_postscript#misc#set_sensitive true ;
+   end
+  else
+   begin
+    button_set_anti_aliasing#misc#set_sensitive false ;
+    button_set_kerning#misc#set_sensitive false ;
+    button_export_to_postscript#misc#set_sensitive false ;
+   end
+;;
+
+let set_anti_aliasing output button_set_anti_aliasing () =
+ output#set_anti_aliasing button_set_anti_aliasing#active
+;;
+
+let set_kerning output button_set_kerning () =
+ output#set_kerning button_set_kerning#active
+;;
+
+let changefont output font_size_spinb () =
+ output#set_font_size font_size_spinb#value_as_int
+;;
+
+let set_log_verbosity output log_verbosity_spinb () =
+ output#set_log_verbosity log_verbosity_spinb#value_as_int
+;;
+
+class settings_window output sw button_export_to_postscript jump_callback
+ selection_changed_callback
+=
+ let settings_window = GWindow.window ~title:"GtkMathView settings" () in
+ let vbox =
+  GPack.vbox ~packing:settings_window#add () in
+ let table =
+  GPack.table
+   ~rows:1 ~columns:3 ~homogeneous:false ~row_spacings:5 ~col_spacings:5
+   ~border_width:5 ~packing:vbox#add () in
+ let button_t1 =
+  GButton.toggle_button ~label:"activate t1 fonts"
+   ~packing:(table#attach ~left:0 ~top:0) () in
+ let button_set_anti_aliasing =
+  GButton.toggle_button ~label:"set_anti_aliasing"
+   ~packing:(table#attach ~left:1 ~top:0) () in
+ let button_set_kerning =
+  GButton.toggle_button ~label:"set_kerning"
+   ~packing:(table#attach ~left:2 ~top:0) () in
+ let table =
+  GPack.table
+   ~rows:2 ~columns:2 ~homogeneous:false ~row_spacings:5 ~col_spacings:5
+   ~border_width:5 ~packing:vbox#add () in
+ let font_size_label =
+  GMisc.label ~text:"font size:"
+   ~packing:(table#attach ~left:0 ~top:0 ~expand:`NONE) () in
+ let font_size_spinb =
+  let sadj =
+   GData.adjustment ~value:14.0 ~lower:5.0 ~upper:50.0 ~step_incr:1.0 ()
+  in
+   GEdit.spin_button 
+    ~adjustment:sadj ~packing:(table#attach ~left:1 ~top:0 ~fill:`NONE) () in
+ let log_verbosity_label =
+  GMisc.label ~text:"log verbosity:"
+   ~packing:(table#attach ~left:0 ~top:1) () in
+ let log_verbosity_spinb =
+  let sadj =
+   GData.adjustment ~value:0.0 ~lower:0.0 ~upper:3.0 ~step_incr:1.0 ()
+  in
+   GEdit.spin_button 
+    ~adjustment:sadj ~packing:(table#attach ~left:1 ~top:1) () in
+ let hbox =
+  GPack.hbox ~packing:(vbox#pack ~expand:false ~fill:false ~padding:5) () in
+ let closeb =
+  GButton.button ~label:"Close"
+   ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
+object(self)
+ method show = settings_window#show
+ initializer
+  button_set_anti_aliasing#misc#set_sensitive false ;
+  button_set_kerning#misc#set_sensitive false ;
+  (* Signals connection *)
+  ignore(button_t1#connect#clicked
+   (activate_t1 output button_set_anti_aliasing button_set_kerning
+    button_export_to_postscript button_t1)) ;
+  ignore(font_size_spinb#connect#changed (changefont output font_size_spinb)) ;
+  ignore(button_set_anti_aliasing#connect#toggled
+   (set_anti_aliasing output button_set_anti_aliasing));
+  ignore(button_set_kerning#connect#toggled
+   (set_kerning output button_set_kerning)) ;
+  ignore(log_verbosity_spinb#connect#changed
+   (set_log_verbosity output log_verbosity_spinb)) ;
+  ignore(closeb#connect#clicked settings_window#misc#hide)
+end;;
+
+(* Main windows *)
+
 class annotation_window output label =
  let window_to_annotate =
   GWindow.window ~title:"Annotating environment" ~border_width:2 () in
@@ -450,7 +573,8 @@ object (self)
      in
       visited_uris := new_current_uri::(List.tl !visited_uris) ;
        label#set_text (UriManager.string_of_uri new_current_uri) ;
-       output#load (parse_no_cache new_current_uri)
+       let mmlfile = parse_no_cache new_current_uri in
+        output#load mmlfile
    )) ;
   ignore (abortb#connect#clicked
    (fun () ->
@@ -473,7 +597,7 @@ class rendering_window annotation_window output (label : GMisc.label) =
   GPack.vbox ~packing:window#add () in
  let _ = vbox#pack ~expand:false ~fill:false ~padding:5 label#coerce in
  let paned =
-  GPack.paned `HORIZONTAL ~packing:(vbox#pack ~padding:5) () in
+  GPack.paned `HORIZONTAL ~packing:(vbox#pack ~expand:true ~padding:5) () in
  let scrolled_window0 =
   GBin.scrolled_window ~border_width:10 ~packing:paned#add1 () in
  let _ = scrolled_window0#add output#coerce in
@@ -495,13 +619,12 @@ class rendering_window annotation_window output (label : GMisc.label) =
  let annotateb =
   GButton.button ~label:"Annotate"
    ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let spinb =
-  let sadj =
-   GData.adjustment ~value:14.0 ~lower:5.0 ~upper:50.0 ~step_incr:1.0 ()
-  in
-   GEdit.spin_button 
-    ~adjustment:sadj ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5)
-    () in
+ let settingsb =
+  GButton.button ~label:"Settings"
+   ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
+ let button_export_to_postscript =
+  GButton.button ~label:"export_to_postscript"
+  ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
  let closeb =
   GButton.button ~label:"Close"
    ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
@@ -509,22 +632,26 @@ object(self)
  method nextb = nextb
  method prevb = prevb
  method label = label
- method spinb = spinb
  method output = (output : GMathView.math_view)
  method errors = errors
  method show () = window#show ()
  initializer
   nextb#misc#set_sensitive false ;
   prevb#misc#set_sensitive false ;
+  button_export_to_postscript#misc#set_sensitive false ;
 
   (* signal handlers here *)
   ignore(output#connect#jump (jump self)) ;
+  ignore(output#connect#selection_changed (choose_selection self)) ;
   ignore(nextb#connect#clicked (next self)) ;
   ignore(prevb#connect#clicked (prev self)) ;
   ignore(checkb#connect#clicked (check self)) ;
-  ignore(spinb#connect#changed (changefont self)) ;
   ignore(closeb#connect#clicked window#misc#hide) ;
   ignore(annotateb#connect#clicked (annotateb_pressed self annotation_window)) ;
+  let settings_window = new settings_window output scrolled_window0
+   button_export_to_postscript (jump self) (choose_selection self) in
+  ignore(settingsb#connect#clicked settings_window#show) ;
+  ignore(button_export_to_postscript#connect#clicked (export_to_postscript output)) ;
   ignore(window#event#connect#delete (fun _ -> window#misc#hide () ; true ))
 end;;
 
@@ -537,7 +664,7 @@ class theory_rendering_window rendering_window =
   GMisc.label ~text:"???"
    ~packing:(vbox#pack ~expand:false ~fill:false ~padding:5) () in
  let paned =
-  GPack.paned `HORIZONTAL ~packing:(vbox#pack ~padding:5) () in
+  GPack.paned `HORIZONTAL ~packing:(vbox#pack ~expand:true ~padding:5) () in
  let scrolled_window0 =
   GBin.scrolled_window ~border_width:10 ~packing:paned#add1 () in
  let output =
@@ -557,13 +684,12 @@ class theory_rendering_window rendering_window =
  let checkb =
   GButton.button ~label:"Check"
    ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let spinb =
-  let sadj =
-   GData.adjustment ~value:14.0 ~lower:5.0 ~upper:50.0 ~step_incr:1.0 ()
-  in
-   GEdit.spin_button 
-    ~adjustment:sadj ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5)
-    () in
+ let settingsb =
+  GButton.button ~label:"Settings"
+   ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
+ let button_export_to_postscript =
+  GButton.button ~label:"export_to_postscript"
+  ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
  let closeb =
   GButton.button ~label:"Close"
    ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
@@ -573,18 +699,22 @@ object(self)
  method label = label
  method output = (output : GMathView.math_view)
  method errors = errors
- method spinb = spinb
  method show () = window#show ()
  initializer
   nextb#misc#set_sensitive false ;
   prevb#misc#set_sensitive false ;
+  button_export_to_postscript#misc#set_sensitive false ;
 
   (* signal handlers here *)
   ignore(output#connect#jump (jump rendering_window)) ;
+  ignore(output#connect#selection_changed (choose_selection self)) ;
   ignore(nextb#connect#clicked (theory_next self)) ;
   ignore(prevb#connect#clicked (theory_prev self)) ;
   ignore(checkb#connect#clicked (theory_check self)) ;
-  ignore(spinb#connect#changed (changefont self)) ;
+  let settings_window = new settings_window output scrolled_window0
+   button_export_to_postscript (jump rendering_window)(choose_selection self) in
+  ignore(settingsb#connect#clicked settings_window#show) ;
+  ignore(button_export_to_postscript#connect#clicked (export_to_postscript output)) ;
   ignore(closeb#connect#clicked window#misc#hide) ;
   ignore(window#event#connect#delete (fun _ -> window#misc#hide () ; true ))
 end;;
diff --git a/helm/interface/mmlinterface.opt.saved b/helm/interface/mmlinterface.opt.saved
deleted file mode 100755 (executable)
index cb5708a..0000000
Binary files a/helm/interface/mmlinterface.opt.saved and /dev/null differ
index b5b37f3985c4459d11637c404ee94b6f2567ded4..ad8713cf371031a911c5cbc88795fc5651e78e4c 100644 (file)
 
 let resolve =
  function
-    "http://localhost:8081/getdtd?url=cic.dtd" ->
-     "/home/pauillac/coq3/sacerdot/HELM/INTERFACE/examples/dtd/cic.dtd"
-  | "http://localhost:8081/getdtd?url=maththeory.dtd" ->
-     "/home/pauillac/coq3/sacerdot/HELM/INTERFACE/examples/dtd/maththeory.dtd"
-  | "http://localhost:8081/getdtd?url=annotations.dtd" ->
-     "/home/pauillac/coq3/sacerdot/HELM/INTERFACE/examples/dtd/annotations.dtd"
+    "http://localhost:8081/getdtd?uri=cic.dtd" ->
+     Configuration.dtd_dir ^ "/cic.dtd"
+  | "http://localhost:8081/getdtd?uri=maththeory.dtd" ->
+     Configuration.dtd_dir ^ "/maththeory.dtd"
+  | "http://localhost:8081/getdtd?uri=annotations.dtd" ->
+     Configuration.dtd_dir ^ "/annotations.dtd"
   | s  -> s
 ;;
 
diff --git a/helm/interface/servers.txt b/helm/interface/servers.txt
deleted file mode 100644 (file)
index b91a715..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-http://caristudenti.students.cs.unibo.it/~sacerdot/helm
-http://pagadebit.students.cs.unibo.it/really_very_local/helm/PARSER/examples
diff --git a/helm/interface/servers.txt.universita b/helm/interface/servers.txt.universita
deleted file mode 100755 (executable)
index c24a58c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-http://phd.cs.unibo.it/helm/PARSER/examples
-http://caristudenti.students.cs.unibo.it/~sacerdot/helm
diff --git a/helm/interface/t1.config b/helm/interface/t1.config
new file mode 100644 (file)
index 0000000..afb669e
--- /dev/null
@@ -0,0 +1,3 @@
+ENCODING=.
+AFM=/usr/share/texmf/fonts/afm/
+TYPE1=/usr/share/texmf/fonts/type1/bluesky/cm/:/usr/X11R6/lib/X11/fonts/Type1/:.
index d738f51b746e379b0c597244f17a1904e45a0ec2..e06ac822a0eb50a1a29c3802efb99752022d0954 100755 (executable)
@@ -4,7 +4,7 @@ while(<STDIN>) {
    chomp;
    split / /;
    for (@_) {
-      if (/.*\.(con|var|ind)\.xml/)
+      if (/.*\.(con|var|ind)(\.types)?\.xml/)
        { s/\./cic:/; }
       elsif (/.*\.theory\.xml/)
        { s/\./theory:/; }
diff --git a/helm/interface/urls_of_uris.db b/helm/interface/urls_of_uris.db
deleted file mode 100644 (file)
index ef6b46a..0000000
Binary files a/helm/interface/urls_of_uris.db and /dev/null differ
diff --git a/helm/interface/xaland-cpp/xaland.cpp b/helm/interface/xaland-cpp/xaland.cpp
deleted file mode 100644 (file)
index e221402..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-// Base header file.  Must be first.
-#include <Include/PlatformDefinitions.hpp>
-
-#include <iostream>
-#include <fstream>
-
-#include <util/PlatformUtils.hpp>
-
-#include <PlatformSupport/DOMStringHelper.hpp>
-
-#include <DOMSupport/DOMSupportDefault.hpp>
-
-#include <XPath/XObjectFactoryDefault.hpp>
-#include <XPath/XPathSupportDefault.hpp>
-#include <XPath/XPathFactoryDefault.hpp>
-
-#include <XSLT/StylesheetConstructionContextDefault.hpp>
-#include <XSLT/StylesheetExecutionContextDefault.hpp>
-#include <XSLT/XSLTEngineImpl.hpp>
-#include <XSLT/XSLTInit.hpp>
-#include <XSLT/XSLTInputSource.hpp>
-#include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
-#include <XSLT/XSLTResultTarget.hpp>
-
-#include <XercesParserLiaison/XercesDOMSupport.hpp>
-#include <XercesParserLiaison/XercesParserLiaison.hpp>
-
-int main(int argc, const char* [])
-{
-#if !defined(XALAN_NO_NAMESPACES)
-   using std::cerr;
-   using std::endl;
-   using std::ofstream;
-#endif
-
-   if (argc != 1) {
-      cerr << "Usage: SimpleTransform"
-           << endl
-           << endl;
-   } else {
-      try {
-         // Call the static initializer for Xerces...
-         XMLPlatformUtils::Initialize();
-
-         {
-            // Initialize the Xalan XSLT subsystem...
-            XSLTInit theInit;
-
-            // Create the support objects that are necessary for
-            // running the processor...
-            XercesDOMSupport theDOMSupport;
-            XercesParserLiaison        theParserLiaison(theDOMSupport);
-            XPathSupportDefault        theXPathSupport(theDOMSupport);
-            XSLTProcessorEnvSupportDefault theXSLTProcessorEnvSupport;
-            XObjectFactoryDefault theXObjectFactory;
-            XPathFactoryDefault        theXPathFactory;
-
-            // Create a processor...
-            XSLTEngineImpl theProcessor(
-               theParserLiaison,
-               theXPathSupport,
-               theXSLTProcessorEnvSupport,
-               theDOMSupport,
-               theXObjectFactory,
-               theXPathFactory);
-
-            // Connect the processor to the support object...
-           theXSLTProcessorEnvSupport.setProcessor(&theProcessor);
-
-           // Create a stylesheet construction context, and a stylesheet
-           // execution context...
-           StylesheetConstructionContextDefault theConstructionContext(
-              theProcessor,
-              theXSLTProcessorEnvSupport,
-              theXPathFactory);
-
-           StylesheetExecutionContextDefault theExecutionContext(
-              theProcessor,
-              theXSLTProcessorEnvSupport,
-              theXPathSupport,
-              theXObjectFactory);
-
-           // Our input files...The assumption is that the executable will be
-           // run from same directory as the input files.
-           const XalanDOMString        theXMLFileName("foo.xml");
-           const XalanDOMString        theXSLFileName("foo.xsl");
-
-           // Our input sources...
-           XSLTInputSource theInputSource(c_wstr(theXMLFileName));
-           XSLTInputSource theStylesheetSource(c_wstr(theXSLFileName));
-
-           // Our output target...
-           const XalanDOMString theOutputFileName("foo.out");
-           XSLTResultTarget theResultTarget(theOutputFileName);
-
-           theProcessor.process(
-              theInputSource,
-              theStylesheetSource,
-              theResultTarget,
-              theConstructionContext,
-              theExecutionContext);
-
-         }
-
-         // Call the static terminator for Xerces...
-         XMLPlatformUtils::Terminate();
-      }
-      catch(...) {
-         cerr << "Exception caught!!!"
-              << endl
-              << endl;
-      }
-   }
-
-   return 0;
-}
-
-/**************************************************/
-/*
-
-public class xaland {
-   public static void Transform(StylesheetRoot style, String xmlSourceURL, String OutputURL) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      XSLTInputSource xmlSource = new XSLTInputSource (xmlSourceURL);
-      XSLTResultTarget xmlResult = new XSLTResultTarget (OutputURL);
-      style.process(xmlSource, xmlResult);
-   }
-
-   public static void main(String argv[]) throws  java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      int port    = Integer.parseInt(argv[0]);
-      int port2   = Integer.parseInt(argv[1]);
-      String xsl1 = argv[2];
-      String xsl2 = argv[3];
-      String theory_xsl1 = argv[4];
-      String theory_xsl2 = argv[5];
-
-      XSLTProcessor theory_processor =
-       XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison());
-      StylesheetRoot theory_style1 =
-         theory_processor.processStylesheet(theory_xsl1);
-      theory_processor.reset();
-      StylesheetRoot theory_style2 =
-         theory_processor.processStylesheet(theory_xsl2);
-      theory_processor.setStylesheet(theory_style2);
-
-      XSLTProcessor processor =
-       XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison());
-      StylesheetRoot style1 = processor.processStylesheet(xsl1);
-      processor.reset();
-      StylesheetRoot style2 = processor.processStylesheet(xsl2);
-      processor.setStylesheet(style2);
-
-      DatagramSocket socket = new DatagramSocket(port);
-
-      System.out.println("Demon activated on input port " + port +
-       " and output port " + port2);
-      while(true) {
-         System.out.print("Ready...");
-
-         /* Warning: the packet must be a fresh one! * /
-         DatagramPacket packet = new DatagramPacket(new byte[1024],1024);
-         socket.receive(packet);
-         byte data[] = packet.getData();
-         int datalen = packet.getLength();
-         String received = new String(data,0,datalen);
-
-         int first = received.indexOf(' ');
-         int last  = received.lastIndexOf(' ');
-         String mode = received.substring(0,first);
-         String input = received.substring(first+1,last);
-         String output = received.substring(last+1);
-
-         System.out.println("request received! Parameters are");
-         System.out.println("Mode: " + mode + " ");
-         System.out.println("Input file: \"" + input + "\"");
-         System.out.println("Output file: \"" + output  + "\"\n");
-
-         if ((new File(output)).exists()) {
-            System.out.println("Using cached version\n");
-         } else {
-            FileOutputStream fout = new FileOutputStream(output);
-            if (mode.equals("cic")) {
-               processor.setDocumentHandler(style2.getSAXSerializer(fout));
-               XSLTResultTarget content = new XSLTResultTarget(processor);
-               style1.process(new XSLTInputSource(input), content);
-            } else if (mode.equals("theory")) {
-               theory_processor.setDocumentHandler(
-                  theory_style2.getSAXSerializer(fout));
-               XSLTResultTarget content =
-                  new XSLTResultTarget(theory_processor);
-               theory_style1.process(new XSLTInputSource(input), content);
-            }
-         }
-
-         InetAddress address = InetAddress.getLocalHost();
-         DatagramSocket socket2 = new DatagramSocket();
-
-         byte buf[] = new byte[0];
-         DatagramPacket packet2 = new DatagramPacket(buf,0,address,port2);
-
-         socket2.send(packet2);
-      }
-   }
-}
-
-*/
diff --git a/helm/interface/xaland-java/rompi.class b/helm/interface/xaland-java/rompi.class
deleted file mode 100644 (file)
index 4abfe38..0000000
Binary files a/helm/interface/xaland-java/rompi.class and /dev/null differ
diff --git a/helm/interface/xaland-java/rompi.java b/helm/interface/xaland-java/rompi.java
deleted file mode 100644 (file)
index 6a633db..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-import java.net.*;
-
-public class rompi {
-   public static void main(String argv[]) throws java.io.IOException, java.net.MalformedURLException
-   {
-      /* Wait forever ;-) */
-      DatagramSocket socket2 = new DatagramSocket(12346);
-      DatagramPacket packet2 = new DatagramPacket(new byte[1],1);
-      System.out.println("Ho preso il socket e non lo lascio piu', caro pu, caro pu");
-      socket2.receive(packet2);
-   }
-}
diff --git a/helm/interface/xaland-java/sped.class b/helm/interface/xaland-java/sped.class
deleted file mode 100644 (file)
index cc6f53d..0000000
Binary files a/helm/interface/xaland-java/sped.class and /dev/null differ
diff --git a/helm/interface/xaland-java/sped.java b/helm/interface/xaland-java/sped.java
deleted file mode 100644 (file)
index 9d96610..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-import java.net.*;
-
-public class sped {
-   public static void main(String argv[]) throws java.io.IOException, java.net.MalformedURLException
-   {
-      String input = argv[0];
-      String out1  = argv[1];
-      String out2  = argv[2];
-
-      String sent = input + " " + out1 + " " + out2;
-      
-      InetAddress address = InetAddress.getLocalHost();
-      DatagramSocket socket = new DatagramSocket();
-
-      int strlen = sent.length();
-      byte buf[] = new byte[strlen];
-      sent.getBytes(0,strlen,buf,0);
-      DatagramPacket packet = new DatagramPacket(buf,strlen,address,12345);
-
-      socket.send(packet);
-
-
-      /* Wait for answer (or forever ;-) */
-      DatagramSocket socket2 = new DatagramSocket(12346);
-      DatagramPacket packet2 = new DatagramPacket(new byte[1],1);
-      socket2.receive(packet2);
-   }
-}
diff --git a/helm/interface/xaland-java/xaland.class b/helm/interface/xaland-java/xaland.class
deleted file mode 100644 (file)
index 6871fda..0000000
Binary files a/helm/interface/xaland-java/xaland.class and /dev/null differ
diff --git a/helm/interface/xaland-java/xaland.java b/helm/interface/xaland-java/xaland.java
deleted file mode 100644 (file)
index 9eda831..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-import org.apache.xalan.xslt.*;
-import java.net.*;
-import java.io.*;
-
-public class xaland {
-   public static void Transform(StylesheetRoot style, String xmlSourceURL, String OutputURL) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      XSLTInputSource xmlSource = new XSLTInputSource (xmlSourceURL);
-      XSLTResultTarget xmlResult = new XSLTResultTarget (OutputURL);
-      style.process(xmlSource, xmlResult);
-   }
-
-   public static void main(String argv[]) throws  java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      int port    = Integer.parseInt(argv[0]);
-      int port2   = Integer.parseInt(argv[1]);
-      String xsl1 = argv[2];
-      String xsl2 = argv[3];
-      String theory_xsl1 = argv[4];
-      String theory_xsl2 = argv[5];
-
-      XSLTProcessor theory_processor =
-       XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison());
-      StylesheetRoot theory_style1 =
-         theory_processor.processStylesheet(theory_xsl1);
-      theory_processor.reset();
-      StylesheetRoot theory_style2 =
-         theory_processor.processStylesheet(theory_xsl2);
-      theory_processor.setStylesheet(theory_style2);
-
-      XSLTProcessor processor =
-       XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison());
-      StylesheetRoot style1 = processor.processStylesheet(xsl1);
-      processor.reset();
-      StylesheetRoot style2 = processor.processStylesheet(xsl2);
-      processor.setStylesheet(style2);
-
-      DatagramSocket socket = new DatagramSocket(port);
-
-      System.out.println("Demon activated on input port " + port +
-       " and output port " + port2);
-      while(true) {
-         System.out.print("Ready...");
-
-         /* Warning: the packet must be a fresh one! */
-         DatagramPacket packet = new DatagramPacket(new byte[1024],1024);
-         socket.receive(packet);
-         byte data[] = packet.getData();
-         int datalen = packet.getLength();
-         String received = new String(data,0,datalen);
-
-         int first = received.indexOf(' ');
-         int last  = received.lastIndexOf(' ');
-         String mode = received.substring(0,first);
-         String input = received.substring(first+1,last);
-         String output = received.substring(last+1);
-
-         System.out.println("request received! Parameters are");
-         System.out.println("Mode: " + mode + " ");
-         System.out.println("Input file: \"" + input + "\"");
-         System.out.println("Output file: \"" + output  + "\"\n");
-
-         if ((new File(output)).exists()) {
-            System.out.println("Using cached version\n");
-         } else {
-            FileOutputStream fout = new FileOutputStream(output);
-            if (mode.equals("cic")) {
-               processor.setDocumentHandler(style2.getSAXSerializer(fout));
-               XSLTResultTarget content = new XSLTResultTarget(processor);
-               style1.process(new XSLTInputSource(input), content);
-            } else if (mode.equals("theory")) {
-               theory_processor.setDocumentHandler(
-                  theory_style2.getSAXSerializer(fout));
-               XSLTResultTarget content =
-                  new XSLTResultTarget(theory_processor);
-               theory_style1.process(new XSLTInputSource(input), content);
-            }
-         }
-
-         InetAddress address = InetAddress.getLocalHost();
-         DatagramSocket socket2 = new DatagramSocket();
-
-         byte buf[] = new byte[0];
-         DatagramPacket packet2 = new DatagramPacket(buf,0,address,port2);
-
-         socket2.send(packet2);
-      }
-   }
-}
diff --git a/helm/interface/xaland-java/xaland.java.prima_del_loro_baco b/helm/interface/xaland-java/xaland.java.prima_del_loro_baco
deleted file mode 100644 (file)
index b46ffa6..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-import org.apache.xalan.xslt.*;
-import java.net.*;
-import java.io.*;
-
-public class xaland {
-   public static void Transform(StylesheetRoot style, String xmlSourceURL, String OutputURL) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      XSLTInputSource xmlSource = new XSLTInputSource (xmlSourceURL);
-      XSLTResultTarget xmlResult = new XSLTResultTarget (OutputURL);
-      style.process(xmlSource, xmlResult);
-   }
-
-   public static void main(String argv[]) throws  java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      int port    = Integer.parseInt(argv[0]);
-      int port2   = Integer.parseInt(argv[1]);
-      String xsl1 = argv[2];
-      String xsl2 = argv[3];
-      String theory_xsl1 = argv[4];
-      String theory_xsl2 = argv[5];
-
-      XSLTProcessor theory_processor = XSLTProcessorFactory.getProcessor();
-      StylesheetRoot theory_style1 =
-         theory_processor.processStylesheet(theory_xsl1);
-      StylesheetRoot theory_style2 =
-         theory_processor.processStylesheet(theory_xsl2);
-      theory_processor.setStylesheet(theory_style2);
-
-      XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
-      StylesheetRoot style1 = processor.processStylesheet(xsl1);
-      StylesheetRoot style2 = processor.processStylesheet(xsl2);
-      processor.setStylesheet(style2);
-
-      DatagramSocket socket = new DatagramSocket(port);
-
-      System.out.println("Demon activated on input port " + port +
-       " and output port " + port2);
-      while(true) {
-         System.out.print("Ready...");
-
-         /* Warning: the packet must be a fresh one! */
-         DatagramPacket packet = new DatagramPacket(new byte[1024],1024);
-         socket.receive(packet);
-         byte data[] = packet.getData();
-         int datalen = packet.getLength();
-         String received = new String(data,0,datalen);
-
-         int first = received.indexOf(' ');
-         int last  = received.lastIndexOf(' ');
-         String mode = received.substring(0,first);
-         String input = received.substring(first+1,last);
-         String output = received.substring(last+1);
-
-         System.out.println("request received! Parameters are");
-         System.out.println("Mode: " + mode + " ");
-         System.out.println("Input file: \"" + input + "\"");
-         System.out.println("Output file: \"" + output  + "\"\n");
-
-         if ((new File(output)).exists()) {
-            System.out.println("Using cached version\n");
-         } else {
-            FileOutputStream fout = new FileOutputStream(output);
-            if (mode.equals("cic")) {
-               processor.setDocumentHandler(style2.getSAXSerializer(fout));
-               XSLTResultTarget content = new XSLTResultTarget(processor);
-               style1.process(new XSLTInputSource(input), content);
-            } else if (mode.equals("theory")) {
-               theory_processor.setDocumentHandler(
-                  theory_style2.getSAXSerializer(fout));
-               XSLTResultTarget content =
-                  new XSLTResultTarget(theory_processor);
-               theory_style1.process(new XSLTInputSource(input), content);
-            }
-         }
-
-         InetAddress address = InetAddress.getLocalHost();
-         DatagramSocket socket2 = new DatagramSocket();
-
-         byte buf[] = new byte[0];
-         DatagramPacket packet2 = new DatagramPacket(buf,0,address,port2);
-
-         socket2.send(packet2);
-      }
-   }
-}
diff --git a/helm/interface/xaland-java/xaland.java.prima_del_loro_baco_ma_dopo_i_reset b/helm/interface/xaland-java/xaland.java.prima_del_loro_baco_ma_dopo_i_reset
deleted file mode 100644 (file)
index 1467cdd..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-import org.apache.xalan.xslt.*;
-import java.net.*;
-import java.io.*;
-
-public class xaland {
-   public static void Transform(StylesheetRoot style, String xmlSourceURL, String OutputURL) throws java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      XSLTInputSource xmlSource = new XSLTInputSource (xmlSourceURL);
-      XSLTResultTarget xmlResult = new XSLTResultTarget (OutputURL);
-      style.process(xmlSource, xmlResult);
-   }
-
-   public static void main(String argv[]) throws  java.io.IOException, java.net.MalformedURLException, org.xml.sax.SAXException
-   {
-      int port    = Integer.parseInt(argv[0]);
-      int port2   = Integer.parseInt(argv[1]);
-      String xsl1 = argv[2];
-      String xsl2 = argv[3];
-      String theory_xsl1 = argv[4];
-      String theory_xsl2 = argv[5];
-
-      XSLTProcessor theory_processor = XSLTProcessorFactory.getProcessor();
-      StylesheetRoot theory_style1 =
-         theory_processor.processStylesheet(theory_xsl1);
-      theory_processor.reset();
-      StylesheetRoot theory_style2 =
-         theory_processor.processStylesheet(theory_xsl2);
-      theory_processor.setStylesheet(theory_style2);
-
-      XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
-      StylesheetRoot style1 = processor.processStylesheet(xsl1);
-      processor.reset();
-      StylesheetRoot style2 = processor.processStylesheet(xsl2);
-      processor.setStylesheet(style2);
-
-      DatagramSocket socket = new DatagramSocket(port);
-
-      System.out.println("Demon activated on input port " + port +
-       " and output port " + port2);
-      while(true) {
-         System.out.print("Ready...");
-
-         /* Warning: the packet must be a fresh one! */
-         DatagramPacket packet = new DatagramPacket(new byte[1024],1024);
-         socket.receive(packet);
-         byte data[] = packet.getData();
-         int datalen = packet.getLength();
-         String received = new String(data,0,datalen);
-
-         int first = received.indexOf(' ');
-         int last  = received.lastIndexOf(' ');
-         String mode = received.substring(0,first);
-         String input = received.substring(first+1,last);
-         String output = received.substring(last+1);
-
-         System.out.println("request received! Parameters are");
-         System.out.println("Mode: " + mode + " ");
-         System.out.println("Input file: \"" + input + "\"");
-         System.out.println("Output file: \"" + output  + "\"\n");
-
-         if ((new File(output)).exists()) {
-            System.out.println("Using cached version\n");
-         } else {
-            FileOutputStream fout = new FileOutputStream(output);
-            if (mode.equals("cic")) {
-               processor.setDocumentHandler(style2.getSAXSerializer(fout));
-               XSLTResultTarget content = new XSLTResultTarget(processor);
-               style1.process(new XSLTInputSource(input), content);
-            } else if (mode.equals("theory")) {
-               theory_processor.setDocumentHandler(
-                  theory_style2.getSAXSerializer(fout));
-               XSLTResultTarget content =
-                  new XSLTResultTarget(theory_processor);
-               theory_style1.process(new XSLTInputSource(input), content);
-            }
-         }
-
-         InetAddress address = InetAddress.getLocalHost();
-         DatagramSocket socket2 = new DatagramSocket();
-
-         byte buf[] = new byte[0];
-         DatagramPacket packet2 = new DatagramPacket(buf,0,address,port2);
-
-         socket2.send(packet2);
-      }
-   }
-}
diff --git a/helm/interface/xaland.class b/helm/interface/xaland.class
deleted file mode 100644 (file)
index 6871fda..0000000
Binary files a/helm/interface/xaland.class and /dev/null differ
diff --git a/helm/style/annotatedcont.xsl b/helm/style/annotatedcont.xsl
new file mode 100644 (file)
index 0000000..e97d08f
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of annotated MathML content to MathML presentation:  -->
+<!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene Schena      -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="objcontent.xsl"/>
+
+<xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
+
+<xsl:key name="annid" use="@of" match="Annotation"/>
+
+<xsl:template match="Definition|Axiom|CurrentProof|InductiveDefinition|Variable">
+    <xsl:choose>
+    <xsl:when test="key('annid',@id)">
+     <annotation helm:xref="{@id}">
+      <xsl:apply-templates select="key('annid',@id)"/>
+     </annotation>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates select="." mode="noannot"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX">
+    <xsl:choose>
+    <xsl:when test="key('annid',@id)">
+     <annotation helm:xref="{@id}">
+      <xsl:apply-templates select="key('annid',@id)"/>
+     </annotation>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:math>
+      <xsl:apply-templates select="." mode="noannot"/>
+     </m:math>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="node">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:apply-templates select="key('id',$id)"/>
+</xsl:template>
+
+<xsl:template match="attribute">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="child" select="@child"/>
+ <xsl:variable name="grandchild" select="@grandchild"/>
+ <xsl:choose>
+  <xsl:when test="$child">
+   <xsl:choose>
+    <xsl:when test="$grandchild">
+     <xsl:value-of select="key('id',$id)/*[position() = $child]/*[position() = $grandchild]/attribute::*[name() = $name]"/>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="key('id',$id)/*[position() = $child]/attribute::*[name() = $name]"/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="key('id',$id)/attribute::*[name() = $name]"/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/annotatedpres.xsl b/helm/style/annotatedpres.xsl
new file mode 100644 (file)
index 0000000..511f915
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of annotated MathML content to MathML presentation:  -->
+<!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene Schena      -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="mmlextension.xsl"/>
+
+<!-- ANNOTATION -->
+
+<xsl:template match="annotation">
+    <xsl:choose>
+    <xsl:when test=". = /">
+      <m:math><m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow></m:math>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="text()">
+ <xsl:variable name="text" select="normalize-space(.)"/>
+ <xsl:if test="$text != ''">
+  <m:mtext><xsl:value-of select="$text"/></m:mtext>
+ </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet> 
diff --git a/helm/style/basic.xsl b/helm/style/basic.xsl
new file mode 100644 (file)
index 0000000..148912a
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Basic Logic                                                      -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+<!-- AND -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Conjunction/and.ind'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:and definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- OR -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Disjunction/or.ind'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:or definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- NOT -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con'] and (count(child::*) = 2)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:not definitionURL="{CONST/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- IFF -->
+<!--
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/Equivalence/iff.ind'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:iff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+-->
+
+<!-- EXISTS -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/First_order_quantifiers/ex.ind' or attribute::uri='cic:/coq/INIT/Logic_Type/exT.ind'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+     <m:exists definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:choose>
+      <xsl:when test="name(*[3]) = 'LAMBDA'">
+       <m:bvar>
+        <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
+       </m:bvar>
+       <xsl:apply-templates select="LAMBDA/target" mode="noannot"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:bvar>
+        <m:ci>$x</m:ci>
+       </m:bvar>
+       <m:apply>
+        <m:csymbol>app</m:csymbol>
+        <xsl:apply-templates select="*[3]" mode="noannot"/>
+        <m:ci>$x</m:ci>
+       </m:apply>
+      </xsl:otherwise>
+     </xsl:choose>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/First_order_quantifiers/ex2.ind' or attribute::uri='cic:/coq/INIT/Logic_Type/exT2.ind'] and (count(child::*) = 4)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:exists definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:choose>
+      <xsl:when test="name(*[3]) = 'LAMBDA'">
+       <xsl:variable name="bvarname" select="*[3]/target/@binder"/>
+       <m:bvar>
+        <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
+       </m:bvar>
+       <m:condition>
+        <xsl:apply-templates select="LAMBDA[1]/target" mode="noannot"/>
+       </m:condition>
+       <xsl:choose>
+        <xsl:when test="(name(*[4]) = 'LAMBDA') and 
+           ($bvarname = *[4]/target/@binder)">
+         <xsl:apply-templates select="LAMBDA[2]/target" mode="noannot"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:apply>
+          <m:csymbol>app</m:csymbol>
+          <xsl:apply-templates select="*[4]" mode="noannot"/>
+          <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:choose>
+        <xsl:when test="name(*[4]) = 'LAMBDA'">
+         <xsl:variable name="bvarname" select="*[4]/target/@binder"/>
+         <m:bvar>
+          <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
+         </m:bvar>
+         <m:condition>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[3]" mode="noannot"/>
+           <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="$bvarname"/></xsl:with-param></xsl:call-template></m:ci>
+          </m:apply>
+         </m:condition>
+         <xsl:apply-templates select="*[4]/target" mode="noannot"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:bvar>
+          <m:ci>x</m:ci>
+         </m:bvar>
+         <m:condition>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[3]" mode="noannot"/>
+           <m:ci>x</m:ci>
+          </m:apply>
+         </m:condition>
+         <m:apply>
+          <m:csymbol>app</m:csymbol>
+          <xsl:apply-templates select="*[4]" mode="noannot"/>
+          <m:ci>x</m:ci>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:otherwise>
+     </xsl:choose>
+    </m:apply>
+</xsl:template>
+
+<!-- EQUALITY -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Equality/eq.ind'] and (count(child::*) = 4)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:eq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+     <xsl:apply-templates select="*[4]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+
+<!-- TYPE EQUALITY -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic_Type/eqT.ind'] and (count(child::*) = 4)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:eq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+     <xsl:apply-templates select="*[4]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- NOT-EQ -->
+<!-- NOT and EQ have no parameters -->
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con']
+and (count(child::*) = 2) and APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Equality/eq.ind']]]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(APPLY/child::*) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:neq/>
+       <xsl:apply-templates select="*[2]/*[3]" mode="noannot"/>
+       <xsl:apply-templates select="*[2]/*[4]" mode="set"/>  
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- NOT-EQT -->
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con']
+and (count(child::*) = 2) and APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic_Type/eqT.ind']]]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(APPLY/child::*) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:neq/>
+       <xsl:apply-templates select="*[2]/*[3]" mode="noannot"/>
+       <xsl:apply-templates select="*[2]/*[4]" mode="set"/>  
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- ************************ DATATYPES ******************************* -->
+
+<!-- no datatypes in MathML content -->
+
+
+<!-- *************************** PEANO ********************************* -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Peano/le.ind'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:leq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Peano/lt.con'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:lt definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Peano/ge.con'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:geq definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Peano/gt.con'] and (count(child::*) = 3)]" mode="pure">
+    <m:apply helm:xref="{@id}">
+    <m:gt definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+</xsl:stylesheet>
+
+
+
+
+
+
diff --git a/helm/style/content.xsl b/helm/style/content.xsl
new file mode 100644 (file)
index 0000000..486c0a4
--- /dev/null
@@ -0,0 +1,277 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- XSLT version 0.1 of CIC objects to MathML content:               -->
+<!-- First draft: February 14 2000, Andrea Asperti, Irene Schena      -->
+<!-- Revised: March 3 2000, Irene Schena                              -->
+<!-- Revised: March 10 2000, Irene Schena                             -->
+<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena     -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:include href="params.xsl"/>
+
+<!--<xsl:output
+           method="xml" 
+           version="1.0" 
+           encoding="ISO-8859-1" 
+           omit-xml-declaration="no"
+           standalone="no" 
+           doctype-public="http://www.w3.org/TR/REC-MathML" 
+           indent="yes"
+           media-type="text/mathml" /> -->
+
+<!-- DA FARE: 
+1)risolvere nella fase di pre-processing le uri relative delle var, settando 
+l'attributo
+definitionURL dell'oggetto corrispondente (alcuni punteranno a nulla! -quelli 
+che non hanno il file di definizione corrispondente-); [le uri assolute hanno
+la forma cic:/.../ in definitionURL e questo schema di uri verra' risolto da
+Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
+-->
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- CIC TERMS -->
+
+<xsl:template match="LAMBDA" mode="pure">
+    <m:lambda helm:xref="{@id}">
+     <m:bvar>
+      <m:ci>
+       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
+      </m:ci>
+      <m:type>
+       <xsl:apply-templates select="source/*[1]" mode="noannot"/>
+      </m:type>
+     </m:bvar>
+     <xsl:apply-templates select="target/*[1]" mode="noannot"/>
+    </m:lambda>
+</xsl:template>
+
+<xsl:template match="PROD" mode="pure">
+    <m:apply helm:xref="{@id}">
+     <xsl:choose>
+     <xsl:when test="string(target/@binder)= &quot;&quot;">
+      <m:csymbol>arrow</m:csymbol>
+      <xsl:apply-templates select="source/*[1]" mode="noannot"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <m:csymbol>prod</m:csymbol>
+       <m:bvar>
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+        <m:type>
+         <xsl:apply-templates select="source/*[1]" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+     </xsl:otherwise>
+     </xsl:choose>
+     <xsl:apply-templates select="target/*[1]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="CAST" mode="pure">
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>cast</m:csymbol>
+     <xsl:apply-templates mode="noannot" select="*/*"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="REL" mode="pure">
+    <m:ci helm:xref="{@id}">
+     <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@binder"/></xsl:with-param></xsl:call-template>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="SORT" mode="pure">
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>
+      <xsl:value-of select="@value"/>
+     </m:csymbol>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY" mode="pure">
+   <xsl:choose>
+    <!-- <xsl:when test="//ALLTYPES and boolean(key('typeid',*/@id))"> -->
+    <!-- start looking for subproofs -->
+    <xsl:when test="((*/@id) = (//ALLTYPES/TYPE/@id))"> 
+     <m:apply helm:xref="{@id}">
+      <m:csymbol>letin</m:csymbol>
+      <!-- <xsl:for-each select="*[boolean(key('typeid',@id))]"> -->
+      <!-- first process all subproofs (let-in) -->
+      <xsl:for-each select="*[@id = (//ALLTYPES/TYPE/@id)]">
+       <m:apply>
+        <m:csymbol>let</m:csymbol>
+        <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',position())"/></xsl:with-param></xsl:call-template></m:ci>
+        <xsl:apply-templates mode="noannot" select="."/>
+       </m:apply>
+      </xsl:for-each>
+      <!-- now re-process the application in mode appflat -->
+      <xsl:apply-templates mode="appflat" select="."/> 
+     </m:apply>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates mode="appflat" select="."/>
+    </xsl:otherwise>
+   </xsl:choose>
+</xsl:template>
+
+<xsl:template match="APPLY" mode="appflat">
+      <m:apply helm:xref="{@id}">
+       <m:csymbol>app</m:csymbol>
+       <!-- mode flat looks for siblings: call with the first child -->
+       <xsl:apply-templates mode="flat" select="*[1]"/>
+      </m:apply>
+</xsl:template>
+
+<xsl:template match="*" mode="flat">
+ <xsl:param name="n" select="1"/>
+ <xsl:choose>
+  <xsl:when test="@id">
+   <xsl:variable name="id" select="@id"/>
+   <xsl:choose>
+    <!-- <xsl:when test="key('typeid',@id)"> -->
+    <xsl:when test="//ALLTYPES/TYPE[@id=$id]">
+     <m:ci>
+      <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="concat('h',$n)"/></xsl:with-param></xsl:call-template>
+     </m:ci>
+     <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
+      <xsl:with-param name="n" select="$n+1"/>
+     </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates mode="pure" select="."/>
+     <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
+      <xsl:with-param name="n" select="$n"/>
+     </xsl:apply-templates>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-templates mode="pure" select="."/>
+   <xsl:apply-templates mode="flat" select="following-sibling::*[1]">
+    <xsl:with-param name="n" select="$n"/>
+   </xsl:apply-templates>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="VAR" mode="pure">
+    <m:ci helm:xref="{@id}">
+     <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="substring-after(@relUri,&quot;,&quot;)"/></xsl:with-param></xsl:call-template>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="META" mode="pure">
+    <m:ci helm:xref="{@id}">
+     <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@no"/></xsl:with-param></xsl:call-template>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="CONST" mode="pure">
+    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
+     <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:call-template name="name_of_uri">
+      <xsl:with-param name="uri" select="@uri"/>
+     </xsl:call-template></xsl:with-param></xsl:call-template>
+     <!-- <xsl:value-of select="document(concat(string($absPath),@uri))/*/@name"/> -->
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="MUTIND" mode="pure">
+    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
+     <xsl:variable name="index"><xsl:value-of select="@noType"/></xsl:variable>
+     <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="document(concat(string($absPath),@uri))/InductiveDefinition/InductiveType[position()=number($index)+1]/@name"/></xsl:with-param></xsl:call-template>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="MUTCONSTRUCT" mode="pure">
+    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
+     <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
+     <xsl:variable name="Cindex"><xsl:value-of select="@noConstr"/></xsl:variable>
+     <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="document(concat(string($absPath),@uri))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($Cindex)]/@name"/></xsl:with-param></xsl:call-template>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="MUTCASE" mode="pure">
+    <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
+    <xsl:variable name="Turi"><xsl:value-of select="@uriType"/></xsl:variable>
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>mutcase</m:csymbol>
+     <xsl:apply-templates select="patternsType/*[1]" mode="noannot"/>
+     <xsl:apply-templates select="inductiveTerm/*[1]" mode="noannot"/>
+     <xsl:variable name="nop"><xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/@noParams"/></xsl:variable>
+     <xsl:for-each select="pattern">
+      <xsl:variable name="pos" select="position()"/>
+      <xsl:variable name="nopar"><xsl:apply-templates select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/*[1]" mode="counting"><xsl:with-param name="noparams" select="$nop"/></xsl:apply-templates></xsl:variable>
+      <xsl:choose>
+      <xsl:when test="$nopar = 0">
+       <m:ci>
+        <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/@name"/></xsl:with-param></xsl:call-template>
+       </m:ci>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:apply>
+        <m:csymbol>app</m:csymbol>
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/@name"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+        <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
+        </m:apply>
+       </xsl:otherwise>
+       </xsl:choose>
+      <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="target" select="1"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
+     </xsl:for-each> 
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="FIX" mode="pure">
+    <m:apply helm:xref="{@id}">
+     <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
+     <m:csymbol>fix</m:csymbol>
+     <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="FixFunction[position()=number($findex)+1]/@name"/></xsl:with-param></xsl:call-template></m:ci>
+     <xsl:apply-templates mode="pure" select="*"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="COFIX" mode="pure">
+   <m:apply helm:xref="{@id}">
+     <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
+     <m:csymbol>cofix</m:csymbol>
+     <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="CofixFunction[position()=number($findex)+1]/@name"/></xsl:with-param></xsl:call-template></m:ci>
+     <xsl:apply-templates mode="pure" select="*"/>
+    </m:apply>
+</xsl:template>
+
+<!-- ELEMENTS OF CIC TERMS -->
+
+<xsl:template match="FixFunction" mode="pure">
+    <m:bvar>
+     <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></m:ci>
+     <m:type><xsl:apply-templates select="type/*[1]" mode="noannot"/></m:type>
+    </m:bvar> 
+    <xsl:apply-templates select="body/*[1]" mode="noannot"/>
+</xsl:template>
+
+<xsl:template match="CofixFunction" mode="pure">
+    <m:bvar>
+     <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></m:ci>
+     <m:type><xsl:apply-templates select="type/*[1]" mode="noannot"/></m:type>
+    </m:bvar> 
+    <xsl:apply-templates select="body/*[1]" mode="noannot"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
+
+
+
+
diff --git a/helm/style/content_to_html.xsl b/helm/style/content_to_html.xsl
new file mode 100644 (file)
index 0000000..f2d6182
--- /dev/null
@@ -0,0 +1,657 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- From MathML content to HTML                                           -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+
+<xsl:include href="html_init.xsl"/>
+<xsl:include href="html_set.xsl"/>
+<xsl:include href="html_reals.xsl"/>
+
+
+<!-- <xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>-->
+<xsl:variable name="header" select="document('http://localhost:8081/conf')/html_link"/>
+
+<xsl:variable name="showcast" select="0"/>
+
+
+<!--***********************************************************************-->
+<!-- HTML Head and Body                                                    -->
+<!--***********************************************************************-->
+
+<xsl:output method="html"/>
+
+<xsl:variable name="framewidth" select="36"/>
+
+<xsl:template match="/">
+ <xsl:param name="current_indent" select="0"/>
+               <html> 
+                <head></head>
+                <body>
+                <xsl:apply-templates>
+                 <xsl:with-param name="current_indent" select="0"/>
+                </xsl:apply-templates>
+                </body>
+               </html>
+</xsl:template>
+
+<!--***********************************************************************-->
+<!-- Indentation                                                          -->
+<!--***********************************************************************-->
+
+<xsl:template name="make_indent">
+ <xsl:param name="current_indent" select="0"/>
+  <xsl:if test="$current_indent > 0">
+   <xsl:text>&#x00A0;</xsl:text>
+   <xsl:call-template name="make_indent">
+    <xsl:with-param name="current_indent" select="$current_indent - 1"/> 
+   </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<!-- Syntactic Sugar -->
+
+<xsl:template match="m:type">
+<xsl:param name="current_indent" select="0"/> 
+<xsl:apply-templates>
+ <xsl:with-param name="current_indent" 
+           select="$current_indent"/>
+</xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="m:condition">
+<xsl:param name="current_indent" select="0"/> 
+<xsl:apply-templates>
+ <xsl:with-param name="current_indent" 
+           select="$current_indent"/>
+</xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="m:math">
+<xsl:param name="current_indent" select="0"/> 
+<xsl:apply-templates>
+ <xsl:with-param name="current_indent" 
+           select="$current_indent"/>
+</xsl:apply-templates>
+</xsl:template>
+
+<!-- CSYMBOL -->
+
+<xsl:template match="m:apply[m:csymbol]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/> 
+  <xsl:variable name="name">
+   <xsl:value-of select="m:csymbol"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:csymbol" mode="charcount"/>
+  </xsl:variable>
+     <!-- <xsl:value-of select="$current_indent"/> -->
+     <!-- <xsl:value-of select="$charlength"/> -->
+     <xsl:choose>
+      <xsl:when test="$name='prod'">
+       <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+         <!-- &#x03a0; -->
+         <FONT FACE="symbol" SIZE="+2" color="blue">&#80;</FONT>
+         <xsl:apply-templates select="m:bvar/m:ci"/>
+         <xsl:text>:</xsl:text>
+         <xsl:apply-templates select="m:bvar/m:type">
+          <xsl:with-param name="current_indent" 
+           select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
+         </xsl:apply-templates><BR/> 
+         <xsl:call-template name="make_indent">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+         </xsl:call-template>
+         <xsl:text>.</xsl:text>
+         <xsl:apply-templates select="*[position()=3]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+         </xsl:apply-templates>
+       </xsl:when>
+       <xsl:otherwise>
+        <!-- &#x03a0; -->
+        <FONT FACE="symbol" SIZE="+2" color="blue">&#80;</FONT>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <xsl:text>:</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:type"/>
+        <xsl:text>.</xsl:text>
+        <xsl:apply-templates select="*[position()=3]"/>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='arrow'">
+       <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+       <xsl:text>(</xsl:text>
+       <xsl:apply-templates select="*[position()=2]">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+       </xsl:apply-templates>
+       <BR/>
+       <xsl:call-template name="make_indent">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+       </xsl:call-template>
+       <!-- -> -->
+       <FONT FACE="symbol" SIZE="+2" color="blue">&#174;</FONT>
+       <xsl:apply-templates select="*[position()=3]">
+        <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+       </xsl:apply-templates>
+       <xsl:text>)</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>(</xsl:text>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <!-- -> -->
+        <FONT FACE="symbol" SIZE="+2" color="blue">&#174;</FONT>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <xsl:text>)</xsl:text>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='app'">
+       <xsl:choose>
+       <xsl:when test="$charlength  > $framewidth">
+        <xsl:text>(</xsl:text>
+        <xsl:apply-templates select="*[position()=2]">
+         <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+        </xsl:apply-templates>
+         <xsl:for-each select="*[position()>2]">
+          <BR/>
+           <xsl:call-template name="make_indent">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>         
+           </xsl:call-template>
+            <xsl:apply-templates select=".">
+             <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+            </xsl:apply-templates>
+         </xsl:for-each>
+         <xsl:text>)</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>(</xsl:text>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:for-each select="*[position()>2]">
+         <xsl:text>&#x00A0;</xsl:text>
+         <xsl:apply-templates select="."/>
+        </xsl:for-each>
+        <xsl:text>)</xsl:text>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='cast'">
+       <xsl:choose>
+        <xsl:when test="$showcast = 1">
+         <xsl:choose>
+          <xsl:when test="$charlength > $framewidth">
+           <xsl:text>(</xsl:text>
+           <xsl:apply-templates select="*[position()=2]">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+           </xsl:apply-templates><BR/>
+           <xsl:call-template name="make_indent">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>          </xsl:call-template>
+           <xsl:text>:></xsl:text>
+           <xsl:apply-templates select="*[position()=3]">
+            <xsl:with-param name="current_indent" select="$current_indent + 3"/>
+           </xsl:apply-templates>
+           <xsl:text>)</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+           <xsl:text>(</xsl:text>
+           <xsl:apply-templates select="*[position()=2]"/>
+           <xsl:text>:></xsl:text>
+           <xsl:apply-templates select="*[position()=3]"/>
+           <xsl:text>)</xsl:text>
+          </xsl:otherwise>
+         </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="*[position()=2]">
+          <xsl:with-param name="current_indent" select="$current_indent"/>
+         </xsl:apply-templates>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='Prop'">
+       <xsl:text>Prop</xsl:text>
+      </xsl:when>
+      <xsl:when test="$name='Set'">
+       <xsl:text>Set</xsl:text>
+      </xsl:when>
+      <xsl:when test="$name='Type'">
+       <xsl:text>Type</xsl:text>
+      </xsl:when>
+      <xsl:when test="$name='mutcase'">
+       <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+         <xsl:text>&lt;</xsl:text>
+         <xsl:apply-templates select="*[position()=2]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+         </xsl:apply-templates>
+         <xsl:text>&gt; </xsl:text>
+         <xsl:text>CASE </xsl:text>
+         <xsl:apply-templates select="*[position()=3]">
+          <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+         </xsl:apply-templates>
+         <xsl:text> OF </xsl:text> 
+         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <BR/>
+         <xsl:call-template name="make_indent">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>  
+         </xsl:call-template> 
+            <xsl:choose>
+            <xsl:when test="position() = 1">
+             <xsl:text>&#x00A0;&#x00A0;</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+             <xsl:text>| </xsl:text>
+            </xsl:otherwise>
+            </xsl:choose>
+            <xsl:apply-templates select="."/>
+            <FONT FACE="symbol" SIZE="+2" color="green">&#222;</FONT>
+            <xsl:apply-templates select="following-sibling::*[position()= 1]">
+             <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
+            </xsl:apply-templates>
+         </xsl:for-each>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>&lt;</xsl:text> 
+        <xsl:apply-templates select="*[position()=2]"/> 
+        <xsl:text>&gt; </xsl:text>
+        <xsl:text>CASE </xsl:text>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <xsl:text> OF </xsl:text>
+        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:choose>
+         <xsl:when test="not(position() = 1)">
+          <xsl:text> | </xsl:text> 
+         </xsl:when> 
+         </xsl:choose>
+         <xsl:apply-templates select="."/>
+         <FONT FACE="symbol" SIZE="+2" color="green">&#222;</FONT>
+         <xsl:apply-templates select="following-sibling::*[position()= 1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2 + string-length()"/>
+         </xsl:apply-templates>
+        </xsl:for-each>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='fix'">
+       <xsl:choose>
+       <xsl:when test="$charlength  > $framewidth">
+            <xsl:text>FIX</xsl:text>
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>{</xsl:text> 
+            <xsl:for-each select="m:bvar"> 
+              <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>  
+              </xsl:call-template>
+              <xsl:value-of select="m:ci"/>
+              <xsl:text>:</xsl:text>
+              <xsl:apply-templates select="m:type">
+               <xsl:with-param name="current_indent" 
+                    select="$current_indent + 5 + string-length(m:ci)"/>
+               </xsl:apply-templates>
+              <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+              </xsl:call-template>
+              <xsl:text>:=</xsl:text> 
+              <xsl:apply-templates select="following-sibling::*[position() = 1]">
+               <xsl:with-param name="current_indent" select="$current_indent +2"/>
+              </xsl:apply-templates>
+            </xsl:for-each>
+             <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+              </xsl:call-template> 
+           <xsl:text>}</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>FIX</xsl:text>
+        <xsl:value-of select="m:ci"/>
+        <xsl:text>{</xsl:text>
+        <xsl:for-each select="m:bvar"> 
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>:</xsl:text>
+            <xsl:apply-templates select="m:type"/>
+            <xsl:text>:=</xsl:text>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:choose>
+             <xsl:when test="position()=last()">
+             <xsl:text>}</xsl:text>
+             </xsl:when>
+             <xsl:otherwise>
+             <xsl:text>;</xsl:text>
+             </xsl:otherwise>
+            </xsl:choose>
+         </xsl:for-each>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when> 
+      <xsl:when test="$name='cofix'">
+       <xsl:choose>
+       <xsl:when test="($charlength + 10) > $framewidth">
+            <xsl:text>COFIX</xsl:text>
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>{</xsl:text>
+            <BR/>
+            <xsl:call-template name="make_indent">
+             <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+            </xsl:call-template>
+            <xsl:for-each select="m:bvar"> 
+                <xsl:value-of select="m:ci"/>
+                <xsl:text>:</xsl:text>
+                <xsl:apply-templates select="m:type">
+                 <xsl:with-param name="current_indent" 
+                    select="$current_indent + 5 + string-length(m:ci)"/>
+                </xsl:apply-templates>
+                <BR/> 
+                <xsl:call-template name="make_indent">
+                 <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+                </xsl:call-template>
+                <xsl:text>:=</xsl:text>
+                <xsl:apply-templates select="following-sibling::*[position() = 1]">
+                 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
+                </xsl:apply-templates>
+            </xsl:for-each>
+            <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+              </xsl:call-template>
+            <xsl:text>}</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>COFIX</xsl:text>
+        <xsl:value-of select="m:ci"/>
+        <xsl:text>{</xsl:text>
+        <xsl:for-each select="m:bvar"> 
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>:</xsl:text>
+            <xsl:apply-templates select="m:type"/>
+            <xsl:text>:=</xsl:text>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:choose>
+             <xsl:when test="position()=last()">
+             <xsl:text>}</xsl:text>
+             </xsl:when>
+             <xsl:otherwise>
+             <xsl:text>;</xsl:text>
+             </xsl:otherwise>
+            </xsl:choose>
+         </xsl:for-each>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      </xsl:choose>
+    <!--  </m:mrow> -->
+</xsl:template>
+
+<!-- LAMBDA -->
+
+<xsl:template match="m:lambda">
+<xsl:param name="current_indent" select="0"/>
+    <xsl:variable name="charlength">
+     <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
+     <!-- <xsl:apply-templates select="." mode="charcount"/> -->
+    </xsl:variable>
+    <!-- <xsl:value-of select="$charlength"/> -->
+     <xsl:choose>
+     <xsl:when test="$charlength > $framewidth">
+       <!-- &#x03bb; -->
+       <FONT FACE="symbol" SIZE="+2" color="red">&#108;</FONT>
+       <xsl:apply-templates select="m:bvar/m:ci"/>
+       <xsl:text>:</xsl:text>
+       <xsl:apply-templates select="m:bvar/m:type">
+        <xsl:with-param name="current_indent" 
+           select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
+       </xsl:apply-templates><BR/> 
+       <xsl:call-template name="make_indent">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+       </xsl:call-template>
+       <xsl:text>.</xsl:text>
+       <xsl:apply-templates select="*[position()=2]">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+       </xsl:apply-templates>
+     </xsl:when>
+     <xsl:otherwise>
+      <!-- &#x03bb; -->
+      <FONT FACE="symbol" SIZE="+2" color="red">&#108;</FONT>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <xsl:text>:</xsl:text>
+      <xsl:apply-templates select="m:bvar/m:type"/>
+      <xsl:text>.</xsl:text>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </xsl:otherwise>
+     </xsl:choose>
+</xsl:template>
+
+<!-- href -->
+<xsl:template match="m:ci">
+ <xsl:choose>
+  <xsl:when test="boolean(@definitionURL)">
+<!-- CSC: non bisogna piu' utilizzare la url, bensi' la uri -->
+<!--   <xsl:variable name="url">
+    <xsl:value-of select="concat(string($absPath),
+     @definitionURL)"/>
+   </xsl:variable>-->
+   <a>
+   <xsl:attribute name="href">
+    <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
+   </xsl:attribute>
+   <xsl:apply-templates/>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="."/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- COUNTING -->
+
+<xsl:template match="m:ci|m:csymbol" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+<xsl:template match="*" mode="charcount">
+ <xsl:param name="incurrent_length" select="0"/>
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <xsl:value-of select="$incurrent_length"/>
+  </xsl:when>
+  <xsl:otherwise>
+    <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/></xsl:apply-templates></xsl:variable>
+    <xsl:choose>
+     <xsl:when test="$framewidth >= number($childlength)">
+      <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$childlength"/></xsl:apply-templates></xsl:variable>
+      <xsl:choose>
+       <xsl:when test="string($siblength) = &quot;&quot;">
+        <xsl:value-of select="number($childlength)"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:value-of select="number($siblength)"/>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($childlength)"/>
+     </xsl:otherwise>
+    </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--***********************************************************************-->
+<!-- OBJECTS                                                               -->
+<!--***********************************************************************-->
+
+<!-- DEFINITION -->
+
+<xsl:template match="Definition">
+<xsl:param name="current_indent" select="0"/>
+<p>
+DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)<BR/>
+TYPE =<BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 7"/> 
+      </xsl:call-template>
+       <xsl:apply-templates select="type/*[1]">
+        <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates><BR/>
+BODY =<BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 7"/> 
+      </xsl:call-template>
+       <xsl:apply-templates select="body/*[1]">
+        <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!-- AXIOM -->
+
+<xsl:template match="Axiom">
+<xsl:param name="current_indent" select="0"/>
+<p>
+AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)<BR/>
+TYPE = <xsl:apply-templates select="type/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!-- UNFINISHED PROOF -->
+
+<xsl:template match="CurrentProof">
+<xsl:param name="current_indent" select="0"/>
+<p>
+UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)<BR/>
+THESIS:  <xsl:apply-templates select="type/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+         </xsl:apply-templates><BR/>
+CONJECTURES: 
+      <xsl:for-each select="Conjecture">
+      <BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 8"/> 
+      </xsl:call-template>
+      <xsl:value-of select="./@no"/> : 
+      <xsl:apply-templates select="./*[1]">
+       <xsl:with-param name="current_indent" select="$current_indent + 11"/>
+      </xsl:apply-templates>
+      </xsl:for-each> 
+      <BR/>
+PROOF:
+      <xsl:apply-templates select="body/*[1]">
+        <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+      </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!-- MUTUAL INDUCTIVE DEFINITION -->
+
+<xsl:template match="InductiveDefinition">
+<xsl:param name="current_indent" select="0"/>
+<p>
+     <xsl:for-each select="InductiveType">
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+          <xsl:choose>
+          <xsl:when test="string(./@inductive) = &quot;true&quot;">
+          INDUCTIVE DEFINITION 
+          </xsl:when>
+          <xsl:otherwise>
+          COINDUCTIVE DEFINITION 
+          </xsl:otherwise>
+          </xsl:choose>  
+         </xsl:when>
+         <xsl:otherwise>
+          AND 
+         </xsl:otherwise>
+         </xsl:choose>
+         <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != &quot;&quot;"><xsl:value-of select="../Params"/></xsl:if>)
+         [
+          <xsl:if test="string(../Param) != &quot;&quot;">         
+           <xsl:for-each select="../Param">
+            <xsl:value-of select="./@name"/>
+            :
+            <xsl:apply-templates select="*"/>
+           </xsl:for-each>
+          </xsl:if>
+         ] <BR/>
+         OF ARITY 
+         <xsl:apply-templates select="./arity/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 9"/>
+         </xsl:apply-templates> <BR/>
+         BUILT FROM:
+      <xsl:for-each select="./Constructor">
+      <BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 3"/> 
+      </xsl:call-template>
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+         <xsl:text>&#x00A0;&#x00A0;</xsl:text>
+         </xsl:when>
+         <xsl:otherwise>
+         <xsl:text>| </xsl:text>
+         </xsl:otherwise>
+         </xsl:choose>
+         <xsl:value-of select="./@name"/> 
+         <xsl:text>: </xsl:text>
+         <xsl:apply-templates select="./*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + string-length(./@name) + 4"/>
+         </xsl:apply-templates>
+      </xsl:for-each>
+     </xsl:for-each>
+</p>
+</xsl:template>
+
+<!-- VARIABLE -->
+
+<xsl:template match="Variable">
+<xsl:param name="current_indent" select="0"/>
+<p>
+VARIABLE <xsl:value-of select="@name"/><BR/>
+TYPE = <xsl:apply-templates select="type/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!--***********************************************************************-->
+<!-- SECTIONS                                                              -->
+<!--***********************************************************************-->
+
+<!-- SECTION -->
+
+<xsl:template match="SECTION">
+<xsl:param name="current_indent" select="0"/>
+ <h1>BEGIN OF SECTION</h1>
+  <xsl:apply-templates/>
+ <h1>END OF SECTION</h1>
+</xsl:template>
+
+</xsl:stylesheet> 
diff --git a/helm/style/html_init.xsl b/helm/style/html_init.xsl
new file mode 100644 (file)
index 0000000..44d75fd
--- /dev/null
@@ -0,0 +1,259 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- INIT style for HTML                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+
+<!-- BASIC OPERATORS -->
+
+ <xsl:template match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
+       |m:geq|m:gt|m:plus|m:times]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="*[1]" mode="charcount"/>
+  </xsl:variable>
+  <xsl:variable name="symbol">
+   <xsl:choose>
+    <xsl:when test="m:and">
+     <xsl:value-of select="'&#217;'"/>
+    </xsl:when>
+    <xsl:when test="m:or">
+     <xsl:value-of select="'&#218;'"/>
+    </xsl:when>
+    <xsl:when test="m:eq">
+     <xsl:value-of select="'&#61;'"/>
+    </xsl:when>
+    <xsl:when test="m:neq">
+     <xsl:value-of select="'&#185;'"/>
+    </xsl:when>
+    <xsl:when test="m:leq">
+     <xsl:value-of select="'&#163;'"/>
+    </xsl:when>
+    <xsl:when test="m:lt">
+     <xsl:value-of select="'&#60;'"/>
+    </xsl:when>
+    <xsl:when test="m:geq">
+     <xsl:value-of select="'&#179;'"/>
+    </xsl:when>
+    <xsl:when test="m:gt">
+     <xsl:value-of select="'&#62;'"/>
+    </xsl:when>
+    <xsl:when test="m:plus">
+     <xsl:value-of select="'&#43;'"/>
+    </xsl:when>
+    <xsl:when test="m:times">
+     <xsl:value-of select="'&#42;'"/>
+    </xsl:when>
+   </xsl:choose>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">
+      <xsl:value-of select="$symbol"/>
+     </FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">
+     <xsl:value-of select="$symbol"/>
+     </FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- MINUS (can be unary!) -->
+
+<xsl:template match="m:apply[m:minus]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="count(child::*)=2">
+    <a>
+    <xsl:attribute name="href">
+     <xsl:value-of select="concat(string($header),string($uri))"/>
+    </xsl:attribute>
+    <xsl:text>-</xsl:text>
+    </a>
+    <xsl:apply-templates select="*[2]">
+     <xsl:with-param name="current_indent" select="$current_indent + 1"/>
+    </xsl:apply-templates>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="charlength">
+     <xsl:apply-templates select="*[1]" mode="charcount"/>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="$charlength > $framewidth">
+      <xsl:text>(</xsl:text>
+      <xsl:apply-templates select="*[2]">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+      </xsl:apply-templates>
+      <BR/> 
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+      </xsl:call-template>
+      <a>
+      <xsl:attribute name="href">
+       <xsl:value-of select="concat(string($header),string($uri))"/>
+      </xsl:attribute>
+      <xsl:text>-</xsl:text>
+      </a>
+      <xsl:apply-templates select="*[3]">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+      </xsl:apply-templates>
+      <xsl:text>)</xsl:text>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:text>(</xsl:text>
+      <xsl:apply-templates select="*[2]"/>
+      <a>
+      <xsl:attribute name="href">
+       <xsl:value-of select="concat(string($header),string($uri))"/>
+      </xsl:attribute>
+      <xsl:text>-</xsl:text>
+      </a>
+      <xsl:apply-templates select="*[3]"/>
+      <xsl:text>)</xsl:text>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+<!-- NOT -->
+
+ <xsl:template match="m:apply[m:not]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:not/@definitionURL"/>
+  </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">&#216;</FONT>
+     </a>
+     <xsl:apply-templates select="*[2]"/>
+ </xsl:template>
+
+<!-- EXISTS -->
+
+ <xsl:template match="m:apply[m:exists]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:exists/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:exists" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">&#36;</FONT>
+     </a>
+     <xsl:apply-templates select="m:bvar/m:ci"/>
+     <xsl:text>:</xsl:text>
+     <xsl:apply-templates select="m:condition">
+      <xsl:with-param name="current_indent" select="$current_indent + 2 +
+                                string-length(bvar/ci)"/> 
+     </xsl:apply-templates>
+     <BR/> 
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+      </xsl:call-template>
+     <xsl:text>.</xsl:text>
+      <xsl:apply-templates select="*[last()]">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">&#36;</FONT>
+     </a>
+     <xsl:apply-templates select="m:bvar/m:ci"/>
+     <xsl:text>:</xsl:text>
+     <xsl:apply-templates select="m:condition"/>
+     <xsl:text>.</xsl:text>
+     <xsl:apply-templates select="*[last()]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+
+
+
+<!-- COUNTING -->
+
+<xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:neq
+   |m:lt|m:leq|m:gt|m:geq|m:plus|m:minus|m:times" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+</xsl:stylesheet> 
+
+
diff --git a/helm/style/html_reals.xsl b/helm/style/html_reals.xsl
new file mode 100644 (file)
index 0000000..1f1750b
--- /dev/null
@@ -0,0 +1,234 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- INIT style for HTML                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- LIMIT -->
+
+<xsl:template match="m:apply[m:limit]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:limit/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:limit" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>lim</xsl:text>
+     </a>
+     <SUB>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <FONT FACE="symbol" color="blue">&#174;</FONT>
+      <xsl:apply-templates select="m:lowlimit"/>
+     </SUB>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/> 
+     </xsl:call-template>
+     <xsl:apply-templates select="*[4]">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+     </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>lim</xsl:text>
+     </a>
+     <SUB>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <FONT FACE="symbol" color="blue">&#174;</FONT>
+      <xsl:apply-templates select="m:lowlimit"/>
+     </SUB>
+     <xsl:apply-templates select="*[4]">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+     </xsl:apply-templates>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- DIFFERENTIATION -->
+
+<xsl:template match="m:apply[m:diff]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:diff/@definitionURL"/>
+  </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <SUP>d</SUP>
+      <xsl:text>/</xsl:text>
+     <SUB>
+      <xsl:text>d</xsl:text>
+      <xsl:value-of select="m:bvar/m:ci"/>
+     </SUB>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+     </xsl:apply-templates>
+ </xsl:template>
+
+<!-- ABSOLUTE VALUE -->
+<xsl:template match="m:apply[m:abs]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>|</xsl:text>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+  </xsl:apply-templates>
+  <xsl:text>|</xsl:text>
+ </xsl:template>
+
+<!-- FACTORIAL -->
+
+<xsl:template match="m:apply[m:fact]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+  </xsl:apply-templates>
+  <xsl:text>!</xsl:text>
+ </xsl:template>
+
+<!-- SQUARE ROOT -->
+
+<xsl:template match="m:apply[m:root]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>(sqr</xsl:text>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+  </xsl:apply-templates>
+  <xsl:text>)</xsl:text>
+ </xsl:template>
+
+<!-- POWER -->
+
+<xsl:template match="m:apply[m:power]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:power/@definitionURL"/>
+  </xsl:variable>
+  <xsl:apply-templates select="*[2]"/>
+  <SUP>
+  <xsl:apply-templates select="*[3]"/>
+  </SUP>
+ </xsl:template>
+
+<!-- MIN and MAX (binari: estendere) -->
+
+ <xsl:template match="m:apply[m:min|m:max]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="*[1]" mode="charcount"/>
+  </xsl:variable>
+  <xsl:variable name="symbol">
+   <xsl:choose>
+    <xsl:when test="m:min">
+     <xsl:value-of select="'min'"/>
+    </xsl:when>
+    <xsl:when test="m:max">
+     <xsl:value-of select="'max'"/>
+    </xsl:when>
+   </xsl:choose>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:value-of select="$symbol"/>
+     </a>
+     <xsl:text>{</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>,</xsl:text>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/> 
+     </xsl:call-template>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>}</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:value-of select="$symbol"/>
+     </a>
+     <xsl:text>{</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <xsl:text>, </xsl:text>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>}</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- COUNTING -->
+
+<xsl:template match="m:abs|m:fact|m:root
+           |m:limit|m:diff|m:min|m:max" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+</xsl:stylesheet> 
+
+
+
+
+
+
+
diff --git a/helm/style/html_set.xsl b/helm/style/html_set.xsl
new file mode 100644 (file)
index 0000000..ca38298
--- /dev/null
@@ -0,0 +1,463 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- INIT style for HTML                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- IN -->
+
+ <xsl:template match="m:apply[m:in]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:in/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:in" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#206;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#206;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- NOTIN -->
+
+ <xsl:template match="m:apply[m:notin]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:notin/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:notin" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#207;</FONT>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#207;</FONT>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- SET -->
+
+ <xsl:template match="m:set">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="count(child::*) = 0">
+    <FONT FACE="symbol" color="blue">&#198;</FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="charlength">
+     <xsl:apply-templates select="." mode="charcount"/>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="name(*[1]) = 'm:bvar'">
+      <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+        <xsl:text>{</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <xsl:text>:</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:type">
+         <xsl:with-param name="current_indent" 
+           select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
+        </xsl:apply-templates><BR/>
+        <xsl:call-template name="make_indent">
+         <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+        </xsl:call-template>
+        <xsl:text>|</xsl:text>
+        <xsl:apply-templates select="m:condition">
+         <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+        </xsl:apply-templates>
+        <xsl:text>}</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>{</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <xsl:text>:</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:type"/>
+        <xsl:text>|</xsl:text>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:text>}</xsl:text>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+        <xsl:text>{</xsl:text>
+         <xsl:apply-templates select="*[position()=1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+         </xsl:apply-templates>
+         <xsl:for-each select="*[position()>1]">
+          <xsl:text>,</xsl:text>
+          <BR/>
+          <xsl:call-template name="make_indent">
+           <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+          </xsl:call-template>
+          <xsl:apply-templates select=".">
+           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+          </xsl:apply-templates>
+         </xsl:for-each>
+         <xsl:text>}</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+        <xsl:text>{</xsl:text>
+         <xsl:for-each select="*">
+          <xsl:apply-templates select="."/>
+          <xsl:choose>
+           <xsl:when test="position() = last()">
+            <xsl:text>}</xsl:text>
+           </xsl:when>
+           <xsl:otherwise>
+            <xsl:text>,</xsl:text>
+           </xsl:otherwise>
+          </xsl:choose>
+         </xsl:for-each>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+
+<!-- INTERSECTION -->
+
+<xsl:template match="m:apply[m:intersect]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:intersect/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:intersect" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#199;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#199;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- UNION -->
+
+<xsl:template match="m:apply[m:union]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:union/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:union" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#200;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#200;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- SUBSET -->
+<xsl:template match="m:apply[m:subset]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:subset/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:subset" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#205;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#205;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- PRSUBSET -->
+<xsl:template match="m:apply[m:prsubset]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:prsubset/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:prsubset" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#204;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#204;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+
+<!-- SETDIFF -->
+
+<xsl:template match="m:apply[m:setdiff]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:setdiff/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:setdiff" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>/</xsl:text>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>/</xsl:text>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- CARD -->
+<xsl:template match="m:apply[m:card]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:card/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>|</xsl:text>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+  </xsl:apply-templates>
+  <xsl:text>|</xsl:text>
+ </xsl:template>
+
+<!-- COUNTING -->
+
+<xsl:template match="m:in|m:notin|m:intersect|m:union
+           |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+</xsl:stylesheet> 
+
+
+
+
+
+
+
diff --git a/helm/style/mml2mmlv1_0.xsl b/helm/style/mml2mmlv1_0.xsl
new file mode 100644 (file)
index 0000000..063bfb8
--- /dev/null
@@ -0,0 +1,2011 @@
+<?xml version="1.0"?>
+
+<!-- ====================================================== -->
+<!-- XSL Transform of MathML content to MathML presentation -->
+<!--    By Igor Rodionov, Computer Science Department of    -->
+<!--   the University of Western Ontario, London, Canada    -->
+<!--  Complies with the W3C Working Draft from Dec.3, 1999  -->
+<!--             Version x.xx from Feb. 18, 2000            -->
+<!--              Comments to:  igor@csd.uwo.ca             -->
+<!--                                                        -->
+<!-- (C) Copyright 1999, 2000 Symbolic Computation          -->
+<!--     Laboratory, University of Western Ontario.         -->
+<!-- ====================================================== -->
+
+<!-- ====================================================== -->
+<!--  May 11, 2000 - HELM group:                            -->
+<!--  Added the namespace prefix to all the output elements -->
+<!--  Changed the mml prefix into m                         -->
+<!--  Swapped math element out of the semantic element      -->
+<!--  Added the declaration of the xlink namespace          --> 
+<!-- ====================================================== -->
+
+<!-- ====================================================== -->
+<!--  June, 2000 - HELM group:                              -->
+<!--  Added auxiliary function to insert:                    -->
+<!--  1) backwards pointers: helm:xref                      -->
+<!--  2) references to definitions: xlink:href              -->
+<!--  Added call-templates to the functions:                -->
+<!--  insert_xref, insert, insert1, insert2                 -->
+<!-- ====================================================== -->
+
+
+<!-- HELM: namespace helm added -->
+<xsl:stylesheet id="mml2mml"
+                version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:m="http://www.w3.org/1998/Math/MathML"
+                xmlns:xlink="http://www.w3.org/1999/xlink"
+                xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:output method="xml" indent="yes" encoding="iso-8859-1"/>
+
+<!-- ***************************************************** -->
+<!--  Parameters affectin' stylesheet's run-time behavior  -->
+<!-- ***************************************************** -->
+
+<!-- SEM_SW: -1 - strip off all semantics
+             0  - pass semantics "as is" (default)
+             1  - add semantics at top level only
+             2  - add semantics at all levels
+             3  - semantics at top level with cross-references
+-->
+<!-- HELM: SEM_SW was 0 -->
+<xsl:param name="SEM_SW" select="1"/>
+
+<!-- Miscellaneous Variable Definitions -->
+
+<xsl:variable name="NO" select="0"/>
+<xsl:variable name="YES" select="1"/>
+<xsl:variable name="PAR_NO" select="-7"/>
+<xsl:variable name="PAR_YES" select="-5"/>
+<xsl:variable name="PAR_SAME" select="-3"/>
+<xsl:variable name="NO_PARAM" select="-1"/>
+
+<!-- Operator Precedence Definitions -->
+
+<xsl:variable name="NO_PREC" select="0"/>
+<xsl:variable name="UNION_PREC" select="1"/>
+<xsl:variable name="SETDIFF_PREC" select="1"/>
+<xsl:variable name="INTERSECT_PREC" select="3"/>
+<xsl:variable name="OR_PREC" select="5"/>
+<xsl:variable name="XOR_PREC" select="5"/>
+<xsl:variable name="AND_PREC" select="7"/>
+<xsl:variable name="PLUS_PREC" select="9"/>
+<xsl:variable name="MINUS_PREC" select="9"/>
+<xsl:variable name="MUL_PREC" select="11"/>
+<xsl:variable name="DIV_PREC" select="11"/>
+<xsl:variable name="NEG_PREC" select="13"/>
+<xsl:variable name="FUNCTION_PREC" select="99"/>
+
+<!-- HELM: auxiliary functions for backwards pointers and refs -->
+
+<xsl:template name = "insert_xref">
+ <xsl:if test="@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template name = "insert">
+ <xsl:if test="@definitionURL">
+  <xsl:attribute name="xlink:href">
+   <xsl:value-of select="@definitionURL"/>
+  </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<!-- HELM: for use inside m:apply -->
+<xsl:template name = "insert1">
+ <xsl:if test="*[1]/@definitionURL">
+  <xsl:attribute name="xlink:href">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="*[1]/@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="*[1]/@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<!-- HELM: for use inside "for-each" -->
+<xsl:template name = "insert2">
+ <xsl:if test="../*[1]/@definitionURL">
+  <xsl:attribute name="xlink:href">
+   <xsl:value-of select="../*[1]/@definitionURL"/>
+  </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="../*[1]/@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="../*[1]/@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<!-- THE TOPMOST ELEMENT: MATH -->
+
+<xsl:template match = "m:math">
+  <xsl:choose>
+    <xsl:when test="$SEM_SW>0">
+<!-- HELM: deleted math (we have already inserted at object level) -->
+     <!--<m:math>-->
+      <m:semantics>
+          <xsl:apply-templates mode = "semantics"/>
+       <m:annotation-xml encoding="MathML">
+          <xsl:copy-of select = "*"/>
+       </m:annotation-xml>
+      </m:semantics>
+     <!--</m:math>-->
+    </xsl:when>
+    <xsl:otherwise>
+      <!--<m:math>-->
+        <xsl:apply-templates mode = "semantics"/>
+      <!--</m:math>-->  
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- SEMANTICS -->
+
+<xsl:template match = "m:*" mode = "semantics">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$SEM_SW=-1 and self::m:semantics">
+      <xsl:apply-templates select="*[1]">
+        <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=0 and self::m:semantics">
+      <m:semantics>
+        <xsl:apply-templates select="*[1]">
+          <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+        <xsl:copy-of select="m:annotation-xml"/>
+      </m:semantics>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=2">
+      <m:semantics>
+        <xsl:choose>
+          <xsl:when test="self::m:semantics">
+            <xsl:apply-templates select="*[1]">
+              <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+              <xsl:with-param name="PARAM" select="$PARAM"/>
+              <xsl:with-param name="PAREN" select="$PAREN"/>
+              <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+            </xsl:apply-templates>
+            <xsl:copy-of select="m:annotation-xml"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select=".">
+              <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+              <xsl:with-param name="PARAM" select="$PARAM"/>
+              <xsl:with-param name="PAREN" select="$PAREN"/>
+              <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+            </xsl:apply-templates>
+            <m:annotation-xml encoding="MathML">
+              <xsl:copy-of select="."/>
+            </m:annotation-xml>
+          </xsl:otherwise>
+        </xsl:choose>
+      </m:semantics>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=3 and @id">
+      <m:mrow idref="{@id}">
+        <xsl:apply-templates select=".">
+          <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select=".">
+        <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:semantics">
+  <xsl:apply-templates select="*[1]" mode = "semantics"/>
+</xsl:template>
+
+
+<!-- BASIC ELEMENTS -->
+
+<!-- HELM: cn could not contain MAthMl presentation -->
+<xsl:template match = "m:cn">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+<!-- HELM: added -->
+<xsl:choose>
+  <xsl:when test="child::text()">
+<!-- HELM -->
+  <xsl:choose>
+    <xsl:when test=". &lt; 0 and $IN_PREC &gt; 0 and $PAREN=$PAR_NO and $PAR_NO_IGNORE=$NO">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="cn"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="cn"/>
+    </xsl:otherwise>
+  </xsl:choose>
+<!-- HELM: added -->
+</xsl:when>
+  <xsl:otherwise>
+   <xsl:copy-of select="*"/> 
+  </xsl:otherwise>
+ </xsl:choose>
+<!-- HELM -->
+</xsl:template>
+
+<xsl:template match = "m:cn" mode="cn">
+  <xsl:choose>
+    <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
+      <m:msub>
+        <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
+      <m:mfenced separators="">
+        <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+        <xsl:if test="text()[2] &lt; 0">
+          <m:mo>-</m:mo>
+          <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
+        </xsl:if>
+        <xsl:if test="not(text()[2] &lt; 0)">
+          <m:mo>+</m:mo>
+          <xsl:apply-templates select="text()[2]" mode = "semantics"/>
+        </xsl:if>
+        <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+        <m:mo>i</m:mo>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@type='complex' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mfenced separators="">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <xsl:if test="text()[2] &lt; 0">
+            <m:mo>-</m:mo>
+            <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
+          </xsl:if>
+          <xsl:if test="not(text()[2] &lt; 0)">
+            <m:mo>+</m:mo>
+            <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+          </xsl:if>
+          <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+          <m:mo>i</m:mo>
+        </m:mfenced>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
+      <m:mrow>
+        <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+        <m:mo>/</m:mo>
+        <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+      </m:mrow>
+    </xsl:when>
+    <xsl:when test="@type='rational' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mfenced separators="">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <m:mo>/</m:mo>
+          <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+        </m:mfenced>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
+      <m:mrow>
+        <m:mo>Polar</m:mo>
+        <m:mfenced separators=",">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+        </m:mfenced>
+      </m:mrow>
+    </xsl:when>
+    <xsl:when test="@type='polar' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mrow>
+          <m:mo>Polar</m:mo>
+          <m:mfenced separators=",">
+            <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+            <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+          </m:mfenced>
+        </m:mrow>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+   </xsl:when>
+    <xsl:otherwise>
+      <m:mn> 
+       <xsl:call-template name="insert"/>
+       <xsl:apply-templates mode = "semantics"/> 
+      </m:mn>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:ci">
+  <xsl:choose>
+    <xsl:when test="@type='vector' or @type=matrix or @type=set">
+      <m:mi fontweight="bold"> <xsl:apply-templates mode = "semantics"/> </m:mi>
+    </xsl:when>
+    <xsl:otherwise>
+<!-- HELM: ci could not contain MathML presentation 
+     <m:mi> 
+      <xsl:call-template name="insert"/>
+      <xsl:apply-templates mode = "semantics"/> 
+     </m:mi>
+-->
+ <xsl:choose>
+  <!-- HELM: or the opposite test <xsl:when test="*[1]"> -->
+  <xsl:when test="child::text()">
+   <m:mi> 
+    <xsl:call-template name="insert"/>
+    <xsl:apply-templates mode = "semantics"/> 
+   </m:mi>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:copy-of select="*"/>
+  </xsl:otherwise>
+ </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match = "m:csymbol">
+   <xsl:choose>
+    <xsl:when test="*[1]">
+     <xsl:copy-of select = "*"/>
+    </xsl:when>
+   <xsl:otherwise>
+    <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- BASIC CONTENT ELEMENTS -->
+
+<xsl:template match = "m:apply[m:fn[1]]">
+  <m:mrow>
+    <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:fn">
+  <xsl:apply-templates select = "*[1]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:interval">
+  <xsl:choose>
+    <xsl:when test="@closure='closed'">
+      <m:mfenced open="[" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='open'">
+      <m:mfenced separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='open-closed'">
+      <m:mfenced open="(" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='closed-open'">
+      <m:mfenced open="[" close=")" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mfenced open="[" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+ </m:mrow>
+</xsl:template>
+
+<!-- HELM: these "semantical" Transformations are REALLY questionable.
+     Andrea -->
+
+<xsl:template match = "m:apply[*[1][self::m:inverse]]">
+  <xsl:choose>
+    <xsl:when test="*[2]=m:exp">
+      <m:mo>ln</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:ln | m:log">
+      <m:mo>exp</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sin">
+      <m:mo>arcsin</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cos">
+      <m:mo>arccos</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:tan">
+      <m:mo>arctan</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sec">
+      <m:mo>arcsec</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:csc">
+      <m:mo>arccsc</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cot">
+      <m:mo>arccot</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sinh">
+      <m:mo>arcsinh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cosh">
+      <m:mo>arccosh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:tanh">
+      <m:mo>arctanh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sech">
+      <m:mo>arcsech</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:csch">
+      <m:mo>arccsch</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:coth">
+      <m:mo>arccoth</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arcsin">
+      <m:mo>sin</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arccos">
+      <m:mo>cos</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arctan">
+      <m:mo>tan</m:mo>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:msup>
+        <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+        <m:mfenced>
+          <m:mn>-1</m:mn>
+        </m:mfenced>
+      </m:msup>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:sep"/>
+
+<xsl:template match = "m:condition">
+  <xsl:choose>
+    <xsl:when test="parent::m:apply[m:forall[1]]"/>
+    <xsl:otherwise>
+      <xsl:if test="not(*[2])">
+        <xsl:apply-templates mode = "semantics"/>
+      </xsl:if>
+      <xsl:if test="*[2]">
+        <m:mrow>
+          <xsl:apply-templates mode = "semantics"/>
+        </m:mrow>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:declare"/>
+
+<xsl:template match = "m:lambda">
+  <m:mrow>
+    <m:mo> &#x039b; </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*">
+        <xsl:choose>
+          <xsl:when test="self::m:ci or self::m:cn">
+            <xsl:apply-templates select = "." mode="semantics"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <m:mrow>
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </m:mrow>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:*[1][self::m:apply[m:compose[1]]]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+ </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:compose]]">
+  <m:mfenced separators="">
+    <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] | self::m:fn]" mode="semantics"/>
+    <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] | self::m:fn]">
+      <m:mo> <xsl:call-template name="insert2"/> <mchar name="SmallCircle"/> </m:mo>
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:ident">
+  <m:mo>id</m:mo>
+</xsl:template>
+
+
+<!-- ARITHMETIC, ALGEBRA & LOGIC -->
+
+<xsl:template match = "m:apply[m:quotient[1]]">
+  <m:mfenced open="&#x230a;" close="&#x230b;" separators="">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+    <m:mo><xsl:call-template name="insert1"/>/</m:mo>
+    <xsl:apply-templates select="*[3]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:exp]]">
+  <m:msup>
+    <m:mo>e</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:msup>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:factorial[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+    <m:mo><xsl:call-template name="insert1"/>!</m:mo>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:max[1] | m:min[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[2]=m:bvar">
+      <m:munder>
+        <xsl:if test="*[1]=m:max">
+          <m:mo><xsl:call-template name="insert1"/>max</m:mo>
+        </xsl:if>
+        <xsl:if test="*[1]=m:min">
+          <m:mo>min</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:munder>
+      <xsl:if test="*[3]=m:condition">
+        <m:mfenced open="{{" close="}}" separators="">
+          <m:mfenced open="" close="" separators=",">
+            <xsl:for-each select = "*[position()>3]">
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </xsl:for-each>
+          </m:mfenced>
+          <m:mo>|</m:mo>
+          <xsl:apply-templates select="*[3]" mode = "semantics"/>
+        </m:mfenced>
+      </xsl:if>
+      <xsl:if test="not(*[3]=m:condition)">
+        <m:mfenced open="{{" close="}}" separators=",">
+          <xsl:for-each select = "*[position()>2]">
+            <xsl:apply-templates select = "." mode="semantics"/>
+          </xsl:for-each>
+        </m:mfenced>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="*[2]=m:condition">
+      <xsl:if test="*[1]=m:max">
+        <m:mo>max</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:min">
+        <m:mo>min</m:mo>
+      </xsl:if>
+      <m:mfenced open="{{" close="}}" separators="">
+        <xsl:if test="*[3]">
+          <m:mfenced open="" close="" separators=",">
+            <xsl:for-each select = "*[position()>2]">
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </xsl:for-each>
+          </m:mfenced>
+          <m:mo>|</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:mfenced>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
+      <xsl:if test="*[1]=m:max">
+        <m:mo>max</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:min">
+        <m:mo><xsl:call-template name="insert1"/>min</m:mo>
+      </xsl:if>
+      <m:mfenced open="{{" close="}}" separators=",">
+        <xsl:for-each select = "*[position()>1]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:minus[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $MINUS_PREC or $IN_PREC=$MINUS_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="minus">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="minus">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="minus">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:minus[1]]" mode="minus">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:if test="not(*[3])">
+    <m:mo><xsl:call-template name="insert1"/>-</m:mo>
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:if>
+  <xsl:if test="*[3]">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+    </xsl:apply-templates>
+    <m:mo><xsl:call-template name="insert1"/>-</m:mo>
+    <xsl:apply-templates select="*[3]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:plus[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $PLUS_PREC or $IN_PREC=$PLUS_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="plus">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="plus">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="plus">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:plus[1]]" mode="plus">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:if test="*[2]">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+    </xsl:apply-templates>
+    <xsl:for-each select = "*[position()>2]">
+      <xsl:choose>
+        <xsl:when test=". &lt; 0">
+          <m:mo>-</m:mo>
+          <m:mn> <xsl:value-of select="-."/> </m:mn>
+        </xsl:when>
+        <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
+          <xsl:apply-templates select="." mode = "semantics">
+            <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+            <xsl:with-param name="PAREN" select="$PAREN"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <m:mo><xsl:call-template name="insert2"/>+</m:mo>
+          <xsl:apply-templates select="." mode = "semantics">
+            <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+            <xsl:with-param name="PAREN" select="$PAREN"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:power[1]]">
+  <xsl:choose>
+    <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] | m:gcd[1] | m:sin[1] | m:cos[1] | m:tan[1] | m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] | m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] | m:coth[1] | m:arcsin[1] | m:arccos[1] | m:arctan[1]]">
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:msup>
+        <xsl:apply-templates select = "*[2]" mode = "semantics">
+          <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+        </xsl:apply-templates>
+        <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $DIV_PREC or $IN_PREC=$DIV_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="remdiv">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="remdiv">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="remdiv">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:if test="m:rem">
+    <m:mo><xsl:call-template name="insert1"/>%</m:mo>
+  </xsl:if>
+  <xsl:if test="m:divide">
+    <m:mo><xsl:call-template name="insert1"/>/</m:mo>
+  </xsl:if>
+  <xsl:apply-templates select = "*[3]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
+    <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:times[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $MUL_PREC or $IN_PREC=$MUL_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="times">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="times">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+         <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="times">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:times[1]]" mode="times">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:if test="*[3]">
+    <xsl:for-each select = "*[position()>2]">
+<!-- HELM: to distinguish between * and the application -->
+<!--      <m:mo><xsl:call-template name="insert2"/>
+                <mchar name="InvisibleTimes"/> </m:mo> -->
+      <m:mo><xsl:call-template name="insert2"/>*</m:mo>
+      <xsl:apply-templates select="." mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+      </xsl:apply-templates>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+
+
+<xsl:template match = "m:apply[m:root[1]]">
+  <m:msqrt>
+    <xsl:call-template name="insert1"/>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[2]=m:degree">
+      <xsl:apply-templates select="*[3]" mode = "semantics"/>
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:degree)">
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      <m:mn>2</m:mn>
+    </xsl:if>
+  </m:msqrt>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:gcd[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="not(parent::m:apply[m:power[1]])">
+      <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
+    </xsl:if>
+    <xsl:if test="parent::m:apply[m:power[1]]">
+      <m:msup>
+        <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
+        <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:and[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $AND_PREC">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="and">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="and">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="and">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:and[1]]" mode="and">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="wedge"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:or[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $OR_PREC">
+      <m:mfenced separators="">
+         <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="or">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="or">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="or">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:or[1]]" mode="or">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="vee"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:xor[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $XOR_PREC">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="xor">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="xor">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="xor">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:xor[1]]" mode="xor">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="xor"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:not[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>not</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:forall[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>for all</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "m:bvar">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+    <xsl:if test="m:condition">
+      <m:mo>:</m:mo>
+      <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
+      <m:mo>,</m:mo>
+    </xsl:if>
+    <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:exists[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/> <mchar name="Exists"/> </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "m:bvar">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+    <xsl:if test="m:condition">
+      <m:mo>,</m:mo>
+      <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
+    </xsl:if>
+    <m:mo>:</m:mo>
+    <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:abs[1]]">
+  <xsl:if test="not(parent::m:apply[m:power[1]])">
+    <m:mfenced open="|" close="|" separators="">
+      <xsl:call-template name="insert_xref"/>
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+  </xsl:if>
+  <xsl:if test="parent::m:apply[m:power[1]]">
+    <m:msup>
+      <m:mfenced open="|" close="|" separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+      </m:mfenced>
+      <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+    </m:msup>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:conjugate[1]]">
+  <m:mover>
+    <m:mrow>
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mrow>
+    <m:mo><xsl:call-template name="insert1"/> <mchar name="UnderBar"/> </m:mo>
+  </m:mover>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="m:arg">
+        <m:mo><xsl:call-template name="insert1"/>arg</m:mo>
+      </xsl:when>
+      <xsl:when test="m:real">
+        <m:mo><xsl:call-template name="insert1"/>Real</m:mo>
+      </xsl:when>
+      <xsl:when test="m:imaginary">
+        <m:mo><xsl:call-template name="insert1"/>Imaginary</m:mo>
+      </xsl:when>
+    </xsl:choose>
+    <m:mfenced separators="">
+      <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- RELATIONS -->
+
+<xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies | m:in | m:notin | m:notsubset | m:notprsubset | m:subset | m:prsubset | m:eq | m:gt | m:lt | m:geq | m:leq | m:equivalent]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:tendsto or *[1]=m:implies or *[1]=m:in or *[1]=m:notin or *[1]=m:notsubset or *[1]=m:notprsubset">
+      <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+      <xsl:if test="*[1]=m:neq">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="NotEqual"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:approx">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="approxeq"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:tendsto">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="RightArrow"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:implies">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="DoubleRightArrow"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:in">
+        <m:mo><xsl:call-template name="insert1"/>
+        <mchar name="Element"/> 
+       </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notin">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="NotElement"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notsubset">
+        <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubset"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notprsubset">
+        <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubsetEqual"/> </m:mo>
+      </xsl:if>
+      <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+      <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
+        <m:mo><xsl:call-template name="insert1"/>-</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
+        <m:mo><xsl:call-template name="insert1"/>+</m:mo>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
+      <xsl:apply-templates select = "*[2]" mode="semantics"/>
+      <xsl:for-each select = "*[position()>2]">
+        <xsl:if test="../*[self::m:subset][1]">
+          <m:mo> <xsl:call-template name="insert2"/> <mchar name="SubsetEqual"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:prsubset][1]">
+          <m:mo> <xsl:call-template name="insert2"/><mchar name="subset"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:eq][1]">
+          <m:mo><xsl:call-template name="insert2"/>=</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:gt][1]">
+          <m:mo><xsl:call-template name="insert2"/>&gt;</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:lt][1]">
+          <m:mo><xsl:call-template name="insert2"/>&lt;</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:geq][1]">
+          <m:mo><xsl:call-template name="insert2"/> <mchar name="geq"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:leq][1]">
+          <m:mo><xsl:call-template name="insert2"/> <mchar name="leq"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:equivalent][1]">
+          <m:mo><xsl:call-template name="insert2"/> <mchar name="Congruent"/> </m:mo>
+        </xsl:if>
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- CALCULUS -->
+
+<xsl:template match = "m:apply[*[1][self::m:ln]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="parent::m:apply[m:power[1]]">
+        <m:msup>
+          <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
+          <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+        </m:msup>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:log[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="parent::m:apply[m:power[1]]">
+        <xsl:if test="not(*[2]=m:logbase)">
+          <m:msup>
+            <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+            <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+          </m:msup>
+        </xsl:if>
+        <xsl:if test="*[2]=m:logbase">
+          <m:msubsup>
+            <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+            <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+            <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
+          </m:msubsup>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:if test="not(*[2]=m:logbase)">
+          <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+        </xsl:if>
+        <xsl:if test="*[2]=m:logbase">
+          <m:msub>
+            <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+            <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
+          </m:msub>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="*[2]=m:logbase">
+      <xsl:apply-templates select = "*[3]" mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      </xsl:apply-templates>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:logbase)">
+      <xsl:apply-templates select = "*[2]" mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:diff[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
+      <m:mfrac><xsl:call-template name="insert1"/>
+        <m:msup>
+          <m:mo>d</m:mo>
+          <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
+        </m:msup>
+        <m:mrow>
+          <m:mo>d</m:mo>
+          <m:msup>
+            <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
+            <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
+          </m:msup>
+        </m:mrow>
+      </m:mfrac>
+    </xsl:if>
+    <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
+      <m:mfrac><xsl:call-template name="insert1"/>
+        <m:mo>d</m:mo>
+        <m:mrow>
+          <m:mo>d</m:mo>
+          <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
+        </m:mrow>
+      </m:mfrac>
+    </xsl:if>
+    <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:partialdiff[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:for-each select = "m:bvar">
+      <xsl:if test="*[last()]=m:degree">
+        <m:mfrac><xsl:call-template name="insert1"/>
+          <m:msup>
+             <m:mo>d</m:mo>
+             <xsl:apply-templates select = "m:degree" mode = "semantics"/>
+          </m:msup>
+          <m:mrow>
+            <m:mo>d</m:mo>
+            <m:msup>
+              <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+              <xsl:apply-templates select = "m:degree" mode = "semantics"/>
+            </m:msup>
+          </m:mrow>
+        </m:mfrac>
+      </xsl:if>
+      <xsl:if test="not(*[last()]=m:degree)">
+        <m:mfrac><xsl:call-template name="insert1"/>
+          <m:mo>d</m:mo>
+          <m:mrow>
+            <m:mo>d</m:mo>
+            <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+          </m:mrow>
+        </m:mfrac>
+      </xsl:if>
+    </xsl:for-each>
+    <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
+  <xsl:apply-templates mode = "semantics"/>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[1]=m:divergence">
+      <m:mo><xsl:call-template name="insert1"/>div</m:mo>
+    </xsl:if>
+    <xsl:if test="*[1]=m:grad">
+    <m:mo><xsl:call-template name="insert1"/>grad</m:mo>
+    </xsl:if>
+    <xsl:if test="*[1]=m:curl">
+    <m:mo><xsl:call-template name="insert1"/>curl</m:mo>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="*[2]=m:ci">
+        <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mfenced separators="">
+          <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+        </m:mfenced>
+      </xsl:otherwise>
+    </xsl:choose>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:laplacian[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:msup><xsl:call-template name="insert1"/>
+      <m:mo> &#x0394; </m:mo>
+      <m:mn>2</m:mn>
+    </m:msup>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- SET THEORY -->
+
+<xsl:template match = "m:set | m:list">
+  <m:mfenced open="{{" close="}}" separators="">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
+      <xsl:apply-templates select="m:bvar" mode = "semantics"/>
+      <m:mo>|</m:mo>
+      <xsl:apply-templates select="m:condition" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
+      <m:mfenced open="" close="" separators=",">
+        <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+      <m:mo>|</m:mo>
+      <xsl:apply-templates select="m:condition" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
+      <m:mfenced open="" close="" separators=",">
+        <xsl:for-each select = "*">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+    </xsl:if>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:union[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $UNION_PREC or $IN_PREC=$UNION_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="" helm:xref="{@helm:xref}">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="union">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="union">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="union">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:union[1]]" mode="union">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode="semantics">
+    <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="Union"/> </m:mo>
+    <xsl:apply-templates select = "." mode="semantics">
+      <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:intersect[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $INTERSECT_PREC">
+      <m:mfenced separators="" helm:xref="{@helm:xref}">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="intersect">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="intersect">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="intersect">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode="semantics">
+    <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="Intersection"/> </m:mo>
+    <xsl:apply-templates select = "." mode="semantics">
+      <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:setdiff[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="setdiff">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="setdiff">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="setdiff">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <m:mo><xsl:call-template name="insert1"/>\</m:mo>
+  <xsl:apply-templates select = "*[3]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
+    <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:card[1]]">
+  <m:mfenced open="|" close="|" separators=",">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:for-each select = "*[position()>1]">
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+
+<!-- SEQUENCES AND SERIES -->
+
+<xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
+        <m:munderover>
+          <xsl:if test="*[1]=m:sum">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
+          </xsl:if>
+          <xsl:if test="*[1]=m:product">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
+          </xsl:if>
+          <m:mrow>
+            <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+            <m:mo>=</m:mo>
+            <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
+          </m:mrow>
+          <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
+        </m:munderover>
+        <xsl:apply-templates select = "*[5]" mode = "semantics"/>
+      </xsl:when>
+      <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
+        <m:munder>
+          <xsl:if test="*[1]=m:sum">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
+          </xsl:if>
+          <xsl:if test="*[1]=m:product">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
+          </xsl:if>
+          <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </m:munder>
+        <xsl:apply-templates select = "*[4]" mode = "semantics"/>
+      </xsl:when>
+    </xsl:choose>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:limit[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:munder>
+      <m:mo><xsl:call-template name="insert1"/>lim</m:mo>
+      <m:mrow>
+        <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
+            <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+            <m:mo> <mchar name="RightArrow"/> </m:mo>
+            <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </xsl:if>
+        <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
+          <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </xsl:if>
+      </m:mrow>
+    </m:munder>
+    <xsl:apply-templates select = "*[4]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- TRIGONOMETRY -->
+
+<xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos | self::m:tan | self::m:sec | self::m:csc | self::m:cot | self::m:sinh | self::m:cosh | self::m:tanh | self::m:sech | self::m:csch | self::m:coth | self::m:arcsin | self::m:arccos | self::m:arctan]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="not(parent::m:apply[m:power[1]])">
+      <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
+    </xsl:if>
+    <xsl:if test="parent::m:apply[m:power[1]]">
+      <m:msup>
+        <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
+        <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:*" mode = "trigonometry">
+    <xsl:choose>
+      <xsl:when test="self::m:sin">
+        <m:mo>sin</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cos">
+        <m:mo>cos</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:tan">
+        <m:mo>tan</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sec">
+        <m:mo>sec</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:csc">
+        <m:mo>csc</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cot">
+        <m:mo>cot</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sinh">
+        <m:mo>sinh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cosh">
+        <m:mo>cosh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:tanh">
+        <m:mo>tanh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sech">
+        <m:mo>sech</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:csch">
+        <m:mo>csch</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:coth">
+        <m:mo>coth</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arcsin">
+        <m:mo>arcsin</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arccos">
+        <m:mo>arccos</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arctan">
+        <m:mo>arctan</m:mo>
+      </xsl:when>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- STATISTICS -->
+
+<xsl:template match = "m:apply[m:mean[1]]">
+  <m:mfenced open="&lt;" close="&gt;" separators=",">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:for-each select = "*[position()>1]">
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:sdev[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/> &#x03c3; </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:variance[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/> &#x03c3; </m:mo>
+    <m:msup>
+      <m:mfenced separators=",">
+        <xsl:for-each select = "*[position()>1]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+      <m:mn>2</m:mn>
+    </m:msup>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:median[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>median</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:mode[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>mode</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:moment[1]]">
+  <xsl:call-template name="insert_xref"/>
+  <m:mfenced open="&lt;" close="&gt;" separators="">
+    <xsl:if test="*[2]=m:degree">
+      <m:msup>
+        <xsl:apply-templates select="*[3]" mode = "semantics"/>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:degree)">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </xsl:if>
+  </m:mfenced>
+</xsl:template>
+
+
+<!-- LINEAR ALGEBRA -->
+
+<xsl:template match="m:vector">
+  <m:mfenced separators="">
+    <m:mtable>
+      <xsl:for-each select="*">
+        <m:mtd>
+          <xsl:apply-templates select="." mode = "semantics"/>
+        </m:mtd>
+      </xsl:for-each>
+    </m:mtable>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:matrix">
+  <m:mfenced separators="">
+    <m:mtable>
+      <xsl:apply-templates mode = "semantics"/>
+    </m:mtable>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:matrixrow">
+  <m:mtr>
+    <xsl:for-each select="*">
+      <m:mtd>
+        <xsl:apply-templates select="." mode = "semantics"/>
+      </m:mtd>
+    </xsl:for-each>
+  </m:mtr>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:determinant[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>det</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:transpose[1]]">
+  <m:msup>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+    <m:mo>T</m:mo>
+  </m:msup>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:selector[1]]">
+  <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
+      <xsl:variable name="m" select = "*[3]"/>
+      <xsl:choose>
+        <xsl:when test="*[4]=m:cn">
+          <xsl:variable name="n" select = "*[4]"/>
+          <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
+        </xsl:otherwise>
+      </xsl:choose>
+  </xsl:if>
+  <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
+    <xsl:variable name="m" select = "*[3]"/>
+    <xsl:copy-of select = "*[2]/*[position()=$m]"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:vectorproduct[1] | m:scalarproduct[1] | m:outerproduct[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    <xsl:choose>
+      <xsl:when test="m:vectorproduct[1]">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="Cross"/> </m:mo>
+      </xsl:when>
+      <xsl:when test="m:scalarproduct[1] | m:outerproduct[1]">
+        <m:mo><xsl:call-template name="insert1"/>.</m:mo>
+      </xsl:when>
+    </xsl:choose>
+    <xsl:apply-templates select="*[3]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+</xsl:stylesheet>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/helm/style/mmlextension.xsl b/helm/style/mmlextension.xsl
new file mode 100644 (file)
index 0000000..0a11b49
--- /dev/null
@@ -0,0 +1,1389 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- Extension to the XSLT version 0.07 of MathML content to presentation: -->
+<!-- First draft: February 19 2000, Andrea Asperti, Irene Schena           -->
+<!-- Revised: March 3 2000, Irene Schena                                   -->
+<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena          -->
+<!-- Revised: March 21 2000, Irene Schena                                  -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="mml2mmlv1_0.xsl"/>
+
+<!--***********************************************************************-->
+<!-- Parameter affecting line-breaking                                     -->
+<!--***********************************************************************-->
+
+<xsl:variable name="framewidth" select="35"/>
+
+<!--***********************************************************************-->
+<!-- Gli oggetti sono stampati come mtext all'interno di una marca toplevel-->
+<!-- math ma al di fuori di semantics. Ora vi sono tanti semantics quanti  -->
+<!-- sono i termini: la presentation per un termine e' generata come primo -->
+<!-- figlio di un semantics e l'originario content viene inserito nel      -->
+<!-- nel secondo figlio di semantics, annotation-xml                       -->
+<!--***********************************************************************-->
+
+<!--**********************-->
+<!--        OBJECTS       -->
+<!--**********************-->
+
+<xsl:template match="/">
+ <xsl:processing-instruction name="cocoon-format">type="text/xhtml"</xsl:processing-instruction>
+ <xsl:apply-templates select="*"/>
+</xsl:template>
+
+<!-- DEFINITION -->
+
+<xsl:template match="Definition">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>AS</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="body/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- AXIOM -->
+
+<xsl:template match="Axiom">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- UNFINISHED PROOF -->
+
+<xsl:template match="CurrentProof">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>THESIS:</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>CONJECTURES:</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <xsl:for-each select="Conjecture">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <m:mtext><xsl:value-of select="./@no"/>:</m:mtext>
+         <xsl:apply-templates select="./*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      </xsl:for-each>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>CORRESPONDING PROOF:</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="body/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- MUTUAL INDUCTIVE DEFINITION -->
+
+<xsl:template match="InductiveDefinition">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+     <xsl:for-each select="InductiveType">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+          <xsl:choose>
+          <xsl:when test="string(./@inductive) = &quot;true&quot;">
+           <m:mtext>INDUCTIVE DEFINITION</m:mtext>
+          </xsl:when>
+          <xsl:otherwise>
+           <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
+          </xsl:otherwise>
+          </xsl:choose>  
+         </xsl:when>
+         <xsl:otherwise>
+          <m:mtext>AND</m:mtext>
+         </xsl:otherwise>
+         </xsl:choose>
+         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != &quot;&quot;"><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow> 
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <m:mtext>[</m:mtext>
+         <xsl:choose>
+         <xsl:when test="string(../Param) != &quot;&quot;">         
+          <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+           <xsl:for-each select="../Param">
+            <m:mtr>
+             <m:mtd>
+              <m:mrow>   
+               <m:mi><xsl:value-of select="./@name"/></m:mi>
+               <m:mo>:</m:mo>
+               <xsl:apply-templates select="*"/>
+              </m:mrow>
+             </m:mtd>
+            </m:mtr>
+           </xsl:for-each>
+            <m:mtr>
+             <m:mtd>
+              <m:mrow>
+               <m:mtext>]</m:mtext>
+              </m:mrow>
+             </m:mtd>
+            </m:mtr>
+          </m:mtable>
+         </xsl:when>
+         <xsl:otherwise>
+          <m:mtext>]</m:mtext>
+         </xsl:otherwise>
+         </xsl:choose>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>OF ARITY</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="./arity/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>BUILT FROM</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <xsl:for-each select="./Constructor">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+          <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         </xsl:when>
+         <xsl:otherwise>
+          <m:mtext>|</m:mtext>
+          <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         </xsl:otherwise>
+         </xsl:choose>
+         <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
+         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         <xsl:apply-templates select="./*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      </xsl:for-each>
+     </xsl:for-each>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- VARIABLE -->
+
+<xsl:template match="Variable">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!--**********************-->
+<!--        TERMS         -->
+<!--**********************-->
+
+<xsl:template match="m:bvar">
+ <xsl:choose>
+  <xsl:when test="m:type">
+   <xsl:variable name="charlength">
+    <xsl:apply-templates select="m:ci" mode="charcount"/>
+   </xsl:variable>
+   <xsl:choose>
+    <xsl:when test="$charlength >= $framewidth">
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+      <m:mtr>
+       <m:mtd>
+        <xsl:apply-templates select="m:ci"/>
+        <m:mo>:</m:mo>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+         <xsl:apply-templates select="m:type"/>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates select="m:ci"/>
+     <m:mo>:</m:mo>
+     <xsl:apply-templates select="m:type"/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-templates select="m:ci"/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!-- CSYMBOL -->
+
+<xsl:template match="m:apply[m:csymbol]">
+    <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
+    <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
+    <m:mrow>
+     <xsl:if test="@helm:xref">
+      <xsl:attribute name="helm:xref"><xsl:value-of select="@helm:xref"/></xsl:attribute>
+     </xsl:if>
+     <xsl:choose>
+      <xsl:when test="$name='prod'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+            <m:mo color="Blue">&#x03a0;</m:mo>
+            <xsl:apply-templates select="m:bvar"/>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>.</m:mo>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo color="Blue">&#x03a0;</m:mo>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <m:mo>:</m:mo>
+        <xsl:apply-templates select="m:bvar/m:type"/>
+        <m:mo>.</m:mo>
+        <xsl:apply-templates select="*[position()=3]"/>
+       </xsl:otherwise>
+       </xsl:choose> 
+      </xsl:when>
+      <xsl:when test="$name='arrow'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">(</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo color="Blue">&#x2192;</m:mo>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">)</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo stretchy="false">(</m:mo>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <m:mo color="Blue">&#x2192;</m:mo>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <m:mo stretchy="false">)</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='app'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">(</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:for-each select="*[position()>2]">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">)</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo stretchy="false">(</m:mo>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:for-each select="*[position()>2]">
+         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         <xsl:apply-templates select="."/>
+        </xsl:for-each>
+        <m:mo stretchy="false">)</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='cast'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">(</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo color="Maroon">:></m:mo>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">)</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo stretchy="false">(</m:mo>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <m:mo color="Maroon">:></m:mo>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <m:mo stretchy="false">)</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='Prop'">
+       <m:mo>Prop</m:mo>
+      </xsl:when>
+      <xsl:when test="$name='Set'">
+       <m:mo>Set</m:mo>
+      </xsl:when>
+      <xsl:when test="$name='Type'">
+       <m:mo>Type</m:mo>
+      </xsl:when>
+      <xsl:when test="$name='mutcase'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>&lt;</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+            <xsl:if test="$framewidth > $charlength">
+             <m:mo>&gt;</m:mo>
+             <m:mo>CASES</m:mo>
+             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+             <xsl:apply-templates select="*[position()=3]"/>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:if test="$charlength >= $framewidth">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>&gt;</m:mo>
+            <m:mo>CASES</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:if>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>OF</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:choose>
+            <xsl:when test="position() = 1">
+              <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
+            </xsl:when>
+            <xsl:otherwise>
+             <m:mo stretchy="false">|</m:mo>
+            </xsl:otherwise>
+            </xsl:choose>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+            <xsl:if test="$framewidth > $charlength">
+             <m:mo color="Green">&#x21d2;</m:mo>
+             <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:if test="$charlength >= $framewidth">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>  
+            <m:mo color="Green">&#x21d2;</m:mo>
+            <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:if>
+        </xsl:for-each>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>END</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo>&lt;</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>&gt;</m:mo>
+        <m:mo>CASES</m:mo>
+        <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+        <m:mo>OF</m:mo>
+        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:choose>
+         <xsl:when test="position() != 1">
+          <m:mo stretchy="false">|</m:mo>
+         </xsl:when> 
+         </xsl:choose>
+         <xsl:apply-templates select="."/>
+         <m:mo color="Green">&#x21d2;</m:mo>
+         <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+        </xsl:for-each>
+        <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+        <m:mo>END</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='fix'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>FIX</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo stretchy="false">{</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+            <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+            <xsl:for-each select="m:bvar"> 
+             <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mi><xsl:value-of select="m:ci"/></m:mi>
+                <m:mo>:</m:mo>
+                <xsl:if test="$framewidth > $charlength">
+                 <xsl:apply-templates select="m:type"/>
+                </xsl:if>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr> 
+             <xsl:if test="$charlength >= $framewidth">
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
+                <xsl:apply-templates select="m:type"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr>
+             </xsl:if>
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mo>:=</m:mo>
+                <xsl:apply-templates select="following-sibling::*[position()=1]"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr> 
+            </xsl:for-each>
+            </m:mtable>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">}</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo>FIX</m:mo>
+        <m:mi><xsl:value-of select="m:ci"/></m:mi>
+        <m:mo stretchy="false">{</m:mo>
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <xsl:for-each select="m:bvar"> 
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo>:</m:mo>
+            <xsl:apply-templates select="m:type"/>
+            <m:mo>:=</m:mo>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:if test="position()=last()">
+             <m:mo stretchy="false">}</m:mo>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+        </m:mtable>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='cofix'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>COFIX</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo stretchy="false">{</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+            <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+            <xsl:for-each select="m:bvar">
+             <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable> 
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mi><xsl:value-of select="m:ci"/></m:mi>
+                <m:mo>:</m:mo>
+                <xsl:if test="$framewidth > $charlength">
+                 <xsl:apply-templates select="m:type"/>
+                </xsl:if>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr> 
+             <xsl:if test="$charlength >= $framewidth">
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
+                <xsl:apply-templates select="m:type"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr>
+             </xsl:if>
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mo>:=</m:mo>
+                <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr>
+            </xsl:for-each>
+            </m:mtable>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">}</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo>COFIX</m:mo>
+        <m:mi><xsl:value-of select="m:ci"/></m:mi>
+        <m:mo stretchy="false">{</m:mo>
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">  
+        <xsl:for-each select="m:bvar"> 
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo>:</m:mo>
+            <xsl:apply-templates select="m:type"/>
+            <m:mo>:=</m:mo>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:if test="position()=last()">
+             <m:mo stretchy="false">}</m:mo>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+        </m:mtable>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <!-- ***************************************** -->
+      <!-- *********** PROOF ELEMENTS ************** -->
+      <!-- ***************************************** -->
+      <xsl:when test="$name='proof'">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext color="Maroon">we proved </m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+      </xsl:when>
+      <xsl:when test="$name='letin'">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <!-- <xsl:for-each select="APPLY[m:csymbol and (string(m:csymbol)='let')]"> -->
+        <xsl:for-each select="*[(last() > position()) and (position()>1)]">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:apply-templates select="."/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:apply-templates select="*[position()=last()]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+      </xsl:when>
+      <xsl:when test="$name='let'">
+       <m:mtext>(</m:mtext>
+       <xsl:apply-templates select="m:ci"/>
+       <m:mtext>) </m:mtext>
+       <xsl:apply-templates select="*[3]"/>
+      </xsl:when>
+      <xsl:when test="$name='thread'">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:choose>
+             <xsl:when test="name(*[last()])='m:apply'">
+              <xsl:apply-templates select="*[last()]"/>
+             </xsl:when>
+             <xsl:otherwise>
+              <m:mtext>Consider </m:mtext>
+              <xsl:apply-templates select="*[last()]"/>
+             </xsl:otherwise>
+            </xsl:choose>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        <xsl:apply-templates mode="thread" select="*[(last()-2)]"/> 
+        </m:mtable>
+      </xsl:when> 
+      <xsl:when test="$name='rewrite_and_apply'">
+        <m:mtable>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext>Rewrite</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[2]/*[2]"/>
+           <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+           <m:mtext>with</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[2]/*[3]"/>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mtext>by</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[2]/*[4]"/>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mtext>in</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[3]"/>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mtext>and apply to</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[position()>3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+       </m:mtable>
+      </xsl:when> 
+      <xsl:when test="$name='and_ind'">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:choose>
+             <xsl:when test="name(*[2])='m:apply'">
+              <xsl:apply-templates select="*[2]"/>
+             </xsl:when>
+             <xsl:otherwise>
+              <m:mtext>Consider </m:mtext>
+              <xsl:apply-templates select="*[2]"/>
+             </xsl:otherwise>
+            </xsl:choose>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mtext>In particular, we have</m:mtext>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext>(</m:mtext>
+            <xsl:apply-templates select="*[3]"/>
+            <m:mtext>)</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[4]"/>
+            </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext>(</m:mtext>
+            <xsl:apply-templates select="*[5]"/>
+            <m:mtext>)</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[6]"/>
+            </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:apply-templates select="*[7]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+      </xsl:when>
+      <xsl:when test="$name='or_ind'">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:choose>
+             <xsl:when test="name(*[2])='m:apply'">
+              <xsl:apply-templates select="*[2]"/>
+             </xsl:when>
+             <xsl:otherwise>
+              <m:mtext>Consider</m:mtext>
+              <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+              <xsl:apply-templates select="*[2]"/>
+             </xsl:otherwise>
+            </xsl:choose>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mtext>We prove</m:mtext>
+           <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+           <xsl:apply-templates select="*[3]"/>
+           <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+           <m:mtext>by cases:</m:mtext>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext>*</m:mtext>
+            <xsl:apply-templates select="*[4]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext>*</m:mtext>
+            <xsl:apply-templates select="*[5]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:ci>ERROR</m:ci>
+      </xsl:otherwise>
+     </xsl:choose>
+    </m:mrow>
+</xsl:template>
+
+<xsl:template match="*" mode="thread">
+ <xsl:variable name="name"><xsl:value-of select="following-sibling::*[position()=1]/m:csymbol"/></xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$name='rw_step'">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext>Rewrite</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="following-sibling::*[position()=1]/*[2]"/>
+           <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+           <m:mtext>with</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="following-sibling::*[position()=1]/*[3]"/>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mtext>by</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="following-sibling::*[position()=1]/*[4]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext color="Maroon">we get</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+   </xsl:when>
+   <xsl:otherwise>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:apply-templates select="following-sibling::*[position()=1]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mtext color="Maroon">we get</m:mtext>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+    </xsl:otherwise>
+   </xsl:choose>
+         <xsl:apply-templates mode="thread" select="preceding-sibling::*[position()=2]"/>
+</xsl:template>
+
+
+<!-- LAMBDA -->
+
+<xsl:template match="m:lambda">
+    <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
+    <m:mrow helm:xref="{@helm:xref}">
+     <xsl:choose>
+     <xsl:when test="$charlength >= $framewidth">
+      <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+          <m:mtd>
+            <m:mo color="Red">&#x03bb;</m:mo>
+            <xsl:apply-templates select="m:bvar"/>
+          </m:mtd>
+         </m:mtr>
+       <m:mtr>
+        <m:mtd>
+         <m:mrow>
+          <m:mo>.</m:mo>
+          <xsl:apply-templates select="*[position()=2]"/>
+         </m:mrow>
+        </m:mtd>
+       </m:mtr>
+      </m:mtable>
+     </xsl:when>
+     <xsl:otherwise>
+      <m:mo color="Red">&#x03bb;</m:mo>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <m:mo>:</m:mo>
+      <xsl:apply-templates select="m:bvar/m:type"/>
+      <m:mo>.</m:mo>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </m:mrow>
+</xsl:template>
+
+<!-- *********************************** -->
+<!-- BASE SET OF MATHML CONTENT ELEMENTS -->
+<!-- *********************************** -->
+
+<!-- Logic -->
+
+<xsl:template match = "m:apply[m:eq[1]]">
+ <xsl:variable name="charlength">
+  <xsl:apply-templates select="*[1]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$charlength >= $framewidth">
+   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+    <xsl:if test="@helm:xref">
+     <xsl:attribute name="helm:xref">
+      <xsl:value-of select="@helm:xref"/>
+     </xsl:attribute>
+    </xsl:if>    
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">(</m:mo>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </m:mtd>
+    </m:mtr>
+    <xsl:for-each select = "*[position()>2]">
+     <m:mtr>
+      <m:mtd>
+       <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+       <m:mo helm:xref="m:in/@helm:xref"> 
+        =
+       </m:mo>
+       <xsl:apply-templates select="."/>
+      </m:mtd>
+     </m:mtr>
+    </xsl:for-each>
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">)</m:mo>
+     </m:mtd>
+    </m:mtr>
+   </m:mtable>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match = "m:apply[m:and[1]|m:or[1]
+          |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
+          |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
+          |m:prsubset|m:setdiff[1]]">
+ <xsl:variable name="symbol">
+  <xsl:choose>
+   <xsl:when test="m:and[1]">
+    <xsl:value-of select="'wedge'"/>
+   </xsl:when>
+   <xsl:when test="m:or[1]">
+    <xsl:value-of select="'vee'"/>
+   </xsl:when>
+   <xsl:when test="m:geq[1]">
+    <xsl:value-of select="'geq'"/>
+   </xsl:when>
+   <xsl:when test="m:leq[1]">
+    <xsl:value-of select="'leq'"/>
+   </xsl:when>
+   <xsl:when test="m:gt[1]">
+    <xsl:value-of select="'gt'"/>
+   </xsl:when>
+   <xsl:when test="m:lt[1]">
+    <xsl:value-of select="'lt'"/>
+   </xsl:when>
+   <xsl:when test="m:eq[1]">
+    <xsl:value-of select="'Equal'"/>
+   </xsl:when>
+   <xsl:when test="m:in[1]">
+    <xsl:value-of select="'Element'"/>
+   </xsl:when>
+   <xsl:when test="m:subset[1]">
+    <xsl:value-of select="'SubsetEqual'"/>
+   </xsl:when>
+   <xsl:when test="m:prsubset[1]">
+    <xsl:value-of select="'subset'"/>
+   </xsl:when>
+   <xsl:when test="m:intersect[1]">
+    <xsl:value-of select="'Intersection'"/>
+   </xsl:when>
+   <xsl:when test="m:union[1]">
+    <xsl:value-of select="'Union'"/>
+   </xsl:when>
+   <xsl:when test="m:setdiff[1]">
+    <xsl:value-of select="'Backslash'"/>
+   </xsl:when>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="charlength">
+  <xsl:apply-templates select="*[1]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$charlength >= $framewidth">
+   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+    <xsl:if test="@helm:xref">
+     <xsl:attribute name="helm:xref">
+      <xsl:value-of select="@helm:xref"/>
+     </xsl:attribute>
+    </xsl:if>    
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">(</m:mo>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </m:mtd>
+    </m:mtr>
+    <xsl:for-each select = "*[position()>2]">
+     <m:mtr>
+      <m:mtd>
+       <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+       <m:mo helm:xref="{*[1]/@helm:xref}"> 
+        <m:mchar name="{$symbol}"/>
+       </m:mo>
+       <xsl:apply-templates select="."/>
+      </m:mtd>
+     </m:mtr>
+    </xsl:for-each>
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">)</m:mo>
+     </m:mtd>
+    </m:mtr>
+   </m:mtable>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:set">
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <m:mi> 
+    <m:mchar name="emptyset"/>
+   </m:mi>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:variable name="charlength">
+    <xsl:apply-templates select="*[1]" mode="charcount"/>
+   </xsl:variable>
+   <xsl:choose>
+    <xsl:when test="$charlength >= $framewidth">
+     <xsl:choose>
+      <xsl:when test="name(*[1]) = 'm:bvar'">
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">{</m:mo>
+          <xsl:apply-templates select="*[position()=1]"/>
+         </m:mtd>
+        </m:mtr>
+        <m:mtr>
+         <m:mtd>
+          <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
+          <m:mo stretchy="false">|</m:mo>
+          <xsl:apply-templates select="m:condition/*[1]"/>
+         </m:mtd>
+        </m:mtr>
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">}</m:mo>
+         </m:mtd>
+        </m:mtr>
+       </m:mtable>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">{</m:mo>
+          <xsl:apply-templates select="*[position()=1]"/>
+          <xsl:if test="position() != last()">
+           <mo>,</mo>
+          </xsl:if>
+         </m:mtd>
+        </m:mtr>
+        <xsl:for-each select = "*[position()>2]">
+         <m:mtr>
+          <m:mtd>
+           <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
+           <xsl:apply-templates select="."/>
+           <xsl:if test="position() != last()">
+            <mo>,</mo>
+           </xsl:if>
+          </m:mtd>
+         </m:mtr>
+        </xsl:for-each>
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">}</m:mo>
+         </m:mtd>
+        </m:mtr>
+       </m:mtable>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-imports/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>      
+
+<xsl:template match = "m:apply[m:card[1]]">
+ <m:mo stretchy="false">|</m:mo>
+  <xsl:apply-templates select="*[2]"/>
+ <m:mo stretchy="false">|</m:mo>
+</xsl:template>
+
+<!-- *********************************** -->
+<!--          PROOF ELEMENTS             -->
+<!-- *********************************** -->
+
+
+
+<!--**********************-->
+<!--       COUNTING       -->
+<!--**********************-->
+
+<xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
+ |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff
+ |m:plus|m:minus|m:times" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
+     <xsl:variable name="siblength">
+      <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
+       <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
+      </xsl:apply-templates>
+     </xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="m:ci|m:csymbol" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+<xsl:param name="nosibling" select="0"/>
+    <xsl:choose>
+    <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+<xsl:template match="*" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/>
+<xsl:param name="nosibling" select="0"/>
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <xsl:value-of select="$incurrent_length"/>
+  </xsl:when>
+  <xsl:otherwise>
+    <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/><xsl:with-param name="nosibling" select="0"/></xsl:apply-templates></xsl:variable>
+    <xsl:choose>
+    <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$childlength"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="number($childlength)"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="number($childlength)"/>
+    </xsl:otherwise>
+    </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet> 
+
diff --git a/helm/style/objcontent.xsl b/helm/style/objcontent.xsl
new file mode 100644 (file)
index 0000000..112e73a
--- /dev/null
@@ -0,0 +1,232 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- XSLT version 0.1 of CIC objects to objects and MathML content:   -->
+<!-- First draft: March 21 2000, Irene Schena                         -->
+<!--******************************************************************-->
+
+<!--******************************************************************-->
+<!-- MANCA: gestione annotation e linking                             -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="content.xsl"/>
+
+<!-- ROOT -->
+
+<xsl:template match="cicxml">
+    <xsl:variable name="url"><xsl:value-of select="@baseurl"/></xsl:variable>
+    <xsl:variable name="stylesheet"><xsl:value-of select="@stylesheet"/></xsl:variable>
+    <xsl:processing-instruction name="cocoon-format">type="text/xml"</xsl:processing-instruction>
+    <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select='concat($url,$stylesheet)'/>" type="text/xsl"</xsl:processing-instruction>
+    <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
+    <xsl:apply-templates select="*[1]"/>
+</xsl:template>
+
+<!-- CIC OBJECTS -->
+
+<xsl:template match="Definition" mode="noannot">
+    <Definition name="{@name}" helm:xref="{@id}">  
+     <xsl:if test="string(@params) != &quot;&quot;">
+      <Params>
+       <xsl:value-of select="@params"/>
+      </Params>
+     </xsl:if>
+<!--     <xsl:choose>
+      <xsl:when test="$showproof=0">
+       <body>
+        <m:mi>Here</m:mi>
+       </body>
+      </xsl:when>
+      <xsl:otherwise>
+       <body>
+        <xsl:apply-templates select="body"/>
+       </body>
+      </xsl:otherwise>
+     </xsl:choose> -->
+     <body>
+      <xsl:apply-templates select="body"/>
+     </body>
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </Definition> 
+</xsl:template>
+
+<xsl:template match="Axiom" mode="noannot"> 
+    <Axiom name="{@name}" helm:xref="{@id}">
+     <xsl:if test="string(@params) != &quot;&quot;">
+      <Params>
+       <xsl:value-of select="@params"/>
+      </Params>
+     </xsl:if>
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </Axiom> 
+</xsl:template>
+
+<xsl:template match="CurrentProof" mode="noannot">
+    <CurrentProof name="{@name}" helm:xref="{@id}">
+     <xsl:for-each select="Conjecture">
+      <Conjecture no="./{@no}">
+        <xsl:apply-templates select="."/>
+      </Conjecture>
+     </xsl:for-each>
+     <body>
+       <xsl:apply-templates select="body"/>
+     </body>
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </CurrentProof> 
+</xsl:template>
+
+<xsl:template match="InductiveDefinition" mode="noannot">
+    <InductiveDefinition helm:xref="{@id}">
+     <xsl:if test="string(@params) != &quot;&quot;">
+      <Params>
+       <xsl:value-of select="@params"/>
+      </Params>
+     </xsl:if> 
+     <xsl:if test="string(@noParams) != 0"> 
+      <xsl:apply-templates select="InductiveType/arity/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="@noParams"/>
+      </xsl:apply-templates>
+     </xsl:if>
+     <xsl:for-each select="InductiveType">
+      <InductiveType name="{./@name}" inductive="{./@inductive}">
+       <arity>
+         <xsl:apply-templates select="./arity/*[1]" mode="abstparams">
+          <xsl:with-param name="noparams" select="../@noParams"/>
+          <xsl:with-param name="target" select="1"/>
+         </xsl:apply-templates>
+       </arity>
+       <xsl:for-each select="./Constructor">
+        <Constructor name="{./@name}">
+          <xsl:apply-templates select="./*[1]" mode="abstparams">
+           <xsl:with-param name="noparams" select="../../@noParams"/>
+           <xsl:with-param name="target" select="1"/>
+          </xsl:apply-templates>
+        </Constructor>
+       </xsl:for-each>
+      </InductiveType>
+     </xsl:for-each> 
+    </InductiveDefinition>       
+</xsl:template>
+
+<xsl:template match="Variable" mode="noannot"> 
+    <Variable name="{@name}" helm:xref="{@id}">
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </Variable> 
+</xsl:template>
+
+<!--*******************************************-->
+<!--    ABSTRACTING PARAMETERS AND COUNTING    -->
+<!--*******************************************-->
+<!-- Si dimentica i CAST dei termini che astrae. Nel caso dell'astrazione -->
+<!-- dei lambda dei pattern del CASE, qualora i lambda non si trovino     -->
+<!-- nella forma weak-head, astrae solo i lambda che trova e restituisce  -->
+<!-- un corpo depurato da tutti i primi cast che precedono il termine     -->
+<!-- restituito.                                                          -->
+
+<xsl:template match="*" mode="abstparams">
+<xsl:param name="noparams" select="0"/>
+<xsl:param name="target" select="0"/>
+<xsl:param name="binder">PROD</xsl:param>
+    <xsl:choose>
+    <xsl:when test="($noparams != 0) and ((name(.)=string($binder)) or (name(.)=&quot;CAST&quot;))">
+     <xsl:choose>
+     <xsl:when test="name(.) = string($binder)">
+      <xsl:if test="$target = 0">
+       <xsl:choose>
+       <xsl:when test="string($binder) = &quot;LAMBDA&quot;">
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+       </xsl:when>
+       <xsl:otherwise> 
+        <Param name="{target/@binder}">
+         <xsl:apply-templates select="source" mode="noannot"/>
+        </Param>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:if>
+      <xsl:apply-templates select="target/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="$noparams - 1"/>
+       <xsl:with-param name="target" select="$target"/>
+       <xsl:with-param name="binder" select="$binder"/>
+      </xsl:apply-templates>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="term/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="$noparams"/>
+       <xsl:with-param name="target" select="$target"/>
+       <xsl:with-param name="binder" select="$binder"/>
+      </xsl:apply-templates>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise> 
+     <xsl:choose>
+     <xsl:when test="($target = 1) and ($noparams != 0)">
+      <m:apply>
+      <m:csymbol>app</m:csymbol>
+      <xsl:apply-templates select="." mode="noannot"/>
+      <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:choose>
+      <xsl:when test="$noparams != 0">
+      <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:if test="$target = 1">
+        <xsl:apply-templates select="." mode="noannot"/>
+       </xsl:if>
+      </xsl:otherwise>
+      </xsl:choose>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template name="printparam">
+<xsl:param name="noleft" select="0"/>
+<xsl:param name="number" select="1"/>
+    <xsl:if test="$noleft != 0">
+     <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value">$<xsl:value-of select="$number"/></xsl:with-param></xsl:call-template></m:ci>
+     <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noleft - 1"/><xsl:with-param name="number" select="$number + 1"/></xsl:call-template>  
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="*" mode="counting">
+<xsl:param name="noparams" select="0"/>
+<xsl:param name="count" select="0"/>
+ <xsl:choose>
+ <xsl:when test="name(.) = &quot;PROD&quot;">
+  <xsl:apply-templates select="target/*[1]" mode="counting">
+   <xsl:with-param name="noparams" select="$noparams"/>
+   <xsl:with-param name="count" select="$count + 1"/>
+  </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="name(.) = &quot;CAST&quot;">
+  <xsl:apply-templates select="term/*[1]" mode="counting">
+   <xsl:with-param name="noparams" select="$noparams"/>
+   <xsl:with-param name="count" select="$count"/> 
+  </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+  <xsl:value-of select="$count - $noparams"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/params.xsl b/helm/style/params.xsl
new file mode 100644 (file)
index 0000000..dc59df1
--- /dev/null
@@ -0,0 +1,243 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- auxiliary functions                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<!--***********************************************************************-->
+<!-- get the name from a URI                                               -->
+<!--***********************************************************************-->
+
+<!-- CSC: PROBLEMA: URI CHE NON CONTENGONO / ED INIZIANO CON cic: -->
+<xsl:template name="name_of_uri">
+ <xsl:param name="uri" select="&quot;&quot;"/>
+ <xsl:variable name="suffix" select="substring-after($uri, &quot;/&quot;)"/>
+ <xsl:choose>
+  <xsl:when test="$suffix = &quot;&quot;">
+   <!-- CSC: PROBLEMA: .con PUO' APPARIRE ALL'INTERNO DELLE URI ===>
+     SCRIVERE UNA FUNZIONE RICORSIVA CHE RISOLVA -->
+   <xsl:value-of select="substring-before($uri,&quot;.con&quot;)"/>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="name_of_uri">
+    <xsl:with-param name="uri" select="$suffix"/>
+   </xsl:call-template>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!--***********************************************************************-->
+<!-- erase common prefix from two uris                                     -->
+<!--***********************************************************************-->
+
+<xsl:template name="common_prefix">
+ <xsl:param name="first_uri" select="&quot;&quot;"/>
+ <xsl:param name="second_uri" select="&quot;&quot;"/>
+ <xsl:choose>
+  <xsl:when test="(substring-before($first_uri,&quot;/&quot;) = 
+                substring-before($second_uri,&quot;/&quot;) and 
+                substring-after($second_uri,&quot;/&quot;) != &quot;&quot;)">
+   <xsl:call-template name="common_prefix">
+    <xsl:with-param 
+        name="first_uri" select="substring-after($first_uri,&quot;/&quot;)"/>
+    <xsl:with-param 
+        name="second_uri" select="substring-after($second_uri,&quot;/&quot;)"/>    </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="slash_counting">
+    <xsl:with-param name="uri" select="$second_uri"/>
+    <xsl:with-param name="counter" select="0"/>
+   </xsl:call-template>
+  </xsl:otherwise>   
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="slash_counting">
+ <xsl:param name="uri" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="(substring-after($uri,&quot;/&quot;) != &quot;&quot;)">
+   <xsl:call-template name="slash_counting">
+    <xsl:with-param 
+        name="uri" select="substring-after($uri,&quot;/&quot;)"/>
+    <xsl:with-param
+        name="counter" select="$counter +1"/> 
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$counter"/>
+  </xsl:otherwise>
+ </xsl:choose>   
+</xsl:template>
+
+<xsl:template name="blank_counting">
+ <xsl:param name="string" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="(substring-after($string,&quot; &quot;) != &quot;&quot;)">
+   <xsl:call-template name="blank_counting">
+    <xsl:with-param 
+        name="string" select="substring-after($string,&quot; &quot;)"/>
+    <xsl:with-param 
+        name="counter" select="$counter +1"/> 
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$counter + 1"/>
+  </xsl:otherwise> 
+ </xsl:choose>  
+</xsl:template>
+
+<xsl:template name="double_point_counting">
+ <xsl:param name="string" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="(substring-after($string,&quot;:&quot;) != &quot;&quot;)">
+   <xsl:call-template name="double_point_counting">
+    <xsl:with-param 
+        name="string" select="substring-after($string,&quot;:&quot;)"/>
+    <xsl:with-param 
+        name="counter" select="$counter +1"/> 
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$counter"/>
+  </xsl:otherwise> 
+ </xsl:choose>  
+</xsl:template>
+
+<xsl:template name="min">
+ <xsl:param name="string" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="contains($string,concat($counter,&quot;:&quot;))
+         or (0 > $counter)">
+  <xsl:value-of select="$counter"/>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="min">
+    <xsl:with-param 
+        name="string" select="$string"/>
+    <xsl:with-param 
+        name="counter" select="$counter -1"/> 
+   </xsl:call-template>
+  </xsl:otherwise>
+ </xsl:choose>  
+</xsl:template>
+
+<xsl:template name="get_no_params">
+    <xsl:param name="first_uri" select="&quot;&quot;"/>
+    <xsl:param name="second_uri" select="&quot;&quot;"/>
+     <xsl:variable name="offset">
+      <xsl:call-template name="common_prefix">
+       <xsl:with-param name="first_uri" select="$first_uri"/>
+       <xsl:with-param name="second_uri" select="$second_uri"/>
+      </xsl:call-template>
+     </xsl:variable>
+     <xsl:choose>
+      <xsl:when test="$offset > 0">
+       <xsl:variable name="params"> 
+        <xsl:value-of 
+            select="document(concat(string($absPath),$second_uri))/*/@params"/>
+       </xsl:variable>
+       <xsl:variable name="minimum">
+        <xsl:call-template name="min">
+         <xsl:with-param name="string" select="$params"/>
+         <xsl:with-param name="counter" select="$offset - 1"/>
+        </xsl:call-template>
+       </xsl:variable>
+       <xsl:choose>
+        <xsl:when test="0 > $minimum">
+         0
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:variable name="relevant_params">
+          <!-- the blank after : in the next line is essential -->
+          <xsl:value-of 
+            select="substring-after($params,concat($minimum,&quot;: &quot;))"/>
+         </xsl:variable>
+         <xsl:variable name="tokens">
+          <xsl:call-template name="blank_counting">
+           <xsl:with-param name="string" select="$relevant_params"/>
+           <xsl:with-param name="counter" select="0"/>
+          </xsl:call-template>
+         </xsl:variable>
+         <xsl:variable name="separators">
+          <xsl:call-template name="double_point_counting">
+           <xsl:with-param name="string" select="$relevant_params"/>
+           <xsl:with-param name="counter" select="0"/>
+          </xsl:call-template>
+         </xsl:variable>
+         <xsl:value-of select="$tokens - $separators"/>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+      0
+      </xsl:otherwise>
+     </xsl:choose>
+</xsl:template>
+
+
+<!--***********************************************************************-->
+<!--  Insert a subscript if there is a number at the end of a ci element   -->
+<!--***********************************************************************-->
+
+<xsl:template name="insert_subscript">
+<xsl:param name="node_value" select="&quot;&quot;"/>
+<xsl:param name="current_pos" select="1"/>
+<xsl:param name="start_pos" select="0"/>
+    <xsl:choose>
+    <xsl:when test="$current_pos &lt;= string-length(string($node_value))">
+    <xsl:variable name="current_char"><xsl:value-of select="substring(string($node_value),$current_pos,1)"/></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="(string($current_char) != &quot;0&quot;) and (string($current_char) != &quot;1&quot;) and (string($current_char) != &quot;2&quot;) and (string($current_char) != &quot;3&quot;) and (string($current_char) != &quot;4&quot;) and (string($current_char) != &quot;5&quot;) and (string($current_char) != &quot;6&quot;) and (string($current_char) !=  &quot;7&quot;) and (string($current_char) != &quot;8&quot;) and (string($current_char) != &quot;9&quot;)">
+      <xsl:choose> 
+      <xsl:when test="$start_pos != 0">
+       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="0"/></xsl:call-template>
+      </xsl:when> 
+      <xsl:otherwise>
+       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="$start_pos"/></xsl:call-template>
+      </xsl:otherwise>
+      </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>  
+      <xsl:choose>
+      <xsl:when test="$start_pos = 0">
+       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="$current_pos"/></xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value" select="$node_value"/><xsl:with-param name="current_pos" select="$current_pos + 1"/><xsl:with-param name="start_pos" select="$start_pos"/></xsl:call-template>
+      </xsl:otherwise>
+      </xsl:choose>      
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:choose>
+     <xsl:when test="$start_pos != 0">
+      <m:msub>
+       <m:mi><xsl:value-of select="substring(string($node_value),1,$start_pos -1)"/></m:mi>
+       <m:mn><xsl:value-of select="substring(string($node_value),$start_pos)"/></m:mn>
+       </m:msub>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="$node_value"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:otherwise>    
+    </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet> 
+
+
+
+
+
+
diff --git a/helm/style/proofs.xsl b/helm/style/proofs.xsl
new file mode 100644 (file)
index 0000000..cd75930
--- /dev/null
@@ -0,0 +1,255 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Basic Logic                                                      -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+<!-- Proof objects -->
+
+<!-- <xsl:key name="typeid" use="@id" match="TYPE"/> -->
+
+<xsl:template match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX" mode="noannot">
+  <xsl:choose> 
+   <xsl:when test="@id">
+    <xsl:variable name="id" select="@id"/>
+    <xsl:choose>
+     <!-- <xsl:when test="//ALLTYPES and key('typeid',@id)"> -->
+     <xsl:when test="//ALLTYPES/TYPE[@id=$id]">
+     <xsl:choose>
+      <xsl:when test="name()= 'APPLY' and CONST[
+ attribute::uri='cic:/coq/INIT/Logic_Type/eqT_ind.con' or
+ attribute::uri='cic:/coq/ZARITH/auxiliary/eqT_ind_r.con'] and count(child::*) = 7">
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>thread</m:csymbol>
+        <xsl:apply-templates mode="pure" select="//ALLTYPES/TYPE[@id=$id]"/>
+        <m:apply>
+         <m:csymbol>rw_step</m:csymbol>
+         <xsl:apply-templates mode="pure" select="*[3]"/>
+         <xsl:apply-templates mode="pure" select="*[6]"/>
+         <xsl:apply-templates mode="pure" select="*[7]"/>
+        </m:apply>
+        <xsl:apply-templates mode="thread" select="*[5]"/>
+       </m:apply>
+      </xsl:when>
+      <!-- aggiungere la verifica dell'esistenza dei lambda per and_ind -->
+      <xsl:when test="name()= 'APPLY' and CONST[
+ attribute::uri='cic:/coq/INIT/Logic/Conjunction/and_ind.con'] 
+ and count(child::*) = 6">
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>and_ind</m:csymbol>
+        <xsl:apply-templates mode="noannot" select="*[6]"/>
+        <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
+        <xsl:apply-templates mode="pure" select="*[5]/source/*"/>
+        <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="*[5]/target/LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
+        <xsl:apply-templates mode="pure" select="*[5]/target/LAMBDA/source/*"/>
+        <xsl:apply-templates mode="noannot" select="*[5]/target/LAMBDA/target/*"/>
+       </m:apply>
+      </xsl:when>
+      <xsl:when test="name()= 'APPLY' and CONST[
+ attribute::uri='cic:/coq/INIT/Logic/Disjunction/or_ind.con'] 
+ and count(child::*) = 7">
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>or_ind</m:csymbol>
+        <xsl:apply-templates mode="noannot" select="*[7]"/>
+        <xsl:apply-templates mode="pure" select="//ALLTYPES/TYPE[@id=$id]"/>
+        <xsl:apply-templates mode="pure" select="*[5]"/>
+        <xsl:apply-templates mode="pure" select="*[6]"/>
+       </m:apply>
+      </xsl:when>
+      <xsl:when test="count(*[@id = //ALLTYPES/TYPE/@id]) = 1">
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>thread</m:csymbol>
+        <xsl:apply-templates mode="pure" select="//ALLTYPES/TYPE[@id=$id]"/>
+        <m:apply>
+         <m:csymbol>app</m:csymbol>
+         <xsl:apply-templates mode="copy-of-no-prop" select="*[1]"/>
+        </m:apply>
+        <xsl:apply-templates mode="thread" select="*[@id = //ALLTYPES/TYPE/@id]"/>
+       </m:apply>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>proof</m:csymbol>
+        <xsl:apply-templates select="." mode="pure"/>
+        <!-- <xsl:apply-templates select="key('typeid',@id)" mode="pure"/> -->
+        <xsl:apply-templates select="//ALLTYPES/TYPE[@id=$id]" mode="pure"/>
+       </m:apply>
+      </xsl:otherwise>
+     </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="." mode="pure"/>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:apply-templates select="." mode="pure"/>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*" mode="copy-of-no-prop">
+ <xsl:choose>
+  <xsl:when test="@id = //ALLTYPES/TYPE/@id">
+   <m:ci>previous</m:ci>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-templates select="." mode="pure"/>
+  </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates mode="copy-of-no-prop" select="following-sibling::*[1]"/>
+</xsl:template>
+
+<xsl:template match="*" mode="thread">
+  <xsl:choose>
+   <xsl:when test="name()= 'APPLY' and CONST[
+ attribute::uri='cic:/coq/INIT/Logic_Type/eqT_ind.con' or
+ attribute::uri='cic:/coq/ZARITH/auxiliary/eqT_ind_r.con'] and count(child::*) = 7">
+    <xsl:variable name="id" select="@id"/>
+     <xsl:apply-templates mode="pure" select="//ALLTYPES/TYPE[@id=$id]"/>
+     <m:apply>
+      <m:csymbol>rw_step</m:csymbol>
+      <xsl:apply-templates mode="pure" select="*[3]"/>
+      <xsl:apply-templates mode="pure" select="*[6]"/>
+      <xsl:apply-templates mode="pure" select="*[7]"/>
+     </m:apply>
+     <xsl:apply-templates mode="thread" select="*[5]"/>
+   </xsl:when>
+<!--**** Patch temporanea, per il problema dei threads ***-->
+<xsl:when test="(name()= 'APPLY' and CONST[
+ attribute::uri='cic:/coq/INIT/Logic/Conjunction/and_ind.con'] 
+ and count(child::*) = 6) or
+(name()= 'APPLY' and CONST[
+ attribute::uri='cic:/coq/INIT/Logic/Disjunction/or_ind.con'] 
+ and count(child::*) = 7)">
+ <xsl:apply-templates mode="noannot" select="."/>
+</xsl:when>
+<!--**** Fine Patch temporanea, per il problema dei threads ***-->
+   <xsl:when test="count(*[@id = //ALLTYPES/TYPE/@id]) = 1">
+       <xsl:variable name="id" select="@id"/>
+       <m:apply helm:xref="{@id}">
+        <m:csymbol>thread</m:csymbol>
+        <xsl:apply-templates mode="pure" select="//ALLTYPES/TYPE[@id=$id]"/>
+        <m:apply>
+         <m:csymbol>app</m:csymbol>
+         <xsl:apply-templates mode="copy-of-no-prop" select="*[1]"/>
+        </m:apply>
+        <xsl:apply-templates mode="thread" select="*[@id = //ALLTYPES/TYPE/@id]"/>
+       </m:apply>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:apply-templates mode="noannot" select="."/>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- Basic proof operators -->
+
+<!-- non del tutto soddisfacente, ma .... -->
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/INIT/Logic_Type/eqT_ind.con' or
+ attribute::uri='cic:/coq/ZARITH/auxiliary/eqT_ind_r.con']]" mode="appflat">
+    <xsl:choose>
+     <xsl:when test="count(child::*) > 7">
+      <xsl:variable name="id" select="@id"/>
+      <xsl:variable name="ideqp" select="*[7]/@id"/>
+      <xsl:variable name="idsubp" select="*[5]/@id"/>
+      <xsl:variable name="leteqp" select="boolean(//ALLTYPES/TYPE[@id=$ideqp])"/>
+      <xsl:variable name="letsubp" select="boolean(//ALLTYPES/TYPE[@id=$idsubp])"/>
+      <m:apply helm:xref="{@id}">
+       <m:csymbol>rewrite_and_apply</m:csymbol>
+       <m:apply>
+        <m:csymbol>rw_step</m:csymbol>
+        <xsl:apply-templates mode="pure" select="*[3]"/>
+        <xsl:apply-templates mode="pure" select="*[6]"/>
+        <xsl:choose>
+         <xsl:when test="$leteqp">
+          <xsl:choose>
+           <xsl:when test="$letsubp">
+            <m:ci>
+             <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="'h2'"/></xsl:with-param></xsl:call-template>
+            </m:ci>
+           </xsl:when>
+           <xsl:otherwise>
+            <m:ci>
+             <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="'h1'"/></xsl:with-param></xsl:call-template>
+            </m:ci>
+           </xsl:otherwise>
+          </xsl:choose>
+         </xsl:when>
+         <xsl:otherwise>
+          <xsl:apply-templates mode="pure" select="*[7]"/>
+         </xsl:otherwise>
+        </xsl:choose>
+       </m:apply>
+      <xsl:choose>
+       <xsl:when test="$letsubp">
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="'h1'"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:apply-templates mode="pure" select="*[5]"/>
+       </xsl:otherwise>
+      </xsl:choose>
+      <xsl:apply-templates mode="flat" select="*[8]">
+       <xsl:with-param name="n">
+        <xsl:value-of select="1+$letsubp+$leteqp"/>
+       </xsl:with-param>
+      </xsl:apply-templates>
+     </m:apply>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:apply helm:xref="{@id}">
+      <m:csymbol>app</m:csymbol>
+      <xsl:apply-templates mode="flat" select="*[1]"/>
+     </m:apply>
+    </xsl:otherwise>
+   </xsl:choose>
+</xsl:template> 
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/INIT/Logic/Conjunction/and_ind.con']]" mode="appflat">
+    <xsl:choose>
+     <xsl:when test="count(child::*) > 4">
+      <m:apply helm:xref="{@id}">
+       <m:csymbol>app</m:csymbol>
+       <xsl:apply-templates mode="pure" select="*[1]"/>
+       <m:ci>*</m:ci>
+       <m:ci>*</m:ci>
+       <m:ci>*</m:ci>
+       <xsl:apply-templates mode="flat" select="*[5]"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <m:apply helm:xref="{@id}">
+       <m:csymbol>app</m:csymbol>
+       <xsl:apply-templates mode="flat" select="*[1]"/>
+      </m:apply>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+
+</xsl:stylesheet>
+
+
+
+
+
+
diff --git a/helm/style/reals.xsl b/helm/style/reals.xsl
new file mode 100644 (file)
index 0000000..ff69f9a
--- /dev/null
@@ -0,0 +1,277 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Reals                                                            -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm"
+                              xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+<!-- REALS -->
+
+<!--
+<xsl:template match="CONST[attribute::uri='cic:/coq/REALS/Raxioms/R.con']" mode="pure">
+ <m:reals/>
+</xsl:template>
+-->
+
+<!-- 0 e 1 -->
+
+<xsl:template match="CONST[attribute::uri='cic:/coq/REALS/Raxioms/R0.con']" mode="pure">
+ <m:cn definitionURL="{@uri}" helm:xref="{@id}">0</m:cn>
+</xsl:template>
+
+<xsl:template match="CONST[attribute::uri='cic:/coq/REALS/Raxioms/R1.con']" mode="pure">
+ <m:cn definitionURL="{@uri}" helm:xref="{@id}">1</m:cn>
+</xsl:template>
+
+
+
+<!-- Unary Operations -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Raxioms/Ropp.con' or
+ attribute::uri='cic:/coq/REALS/Rbasic_fun/Rabsolu.con' or
+ attribute::uri='cic:/coq/REALS/Rfunctions/fact.con' or
+ attribute::uri='cic:/coq/REALS/Rbase/Rsqr.con']]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 2">
+      <xsl:variable name="elem">
+       <xsl:choose>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Ropp.con'">
+         <xsl:value-of select="'minus'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rbasic_fun/Rabsolu.con'">
+         <xsl:value-of select="'abs'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rfunctions/fact.con'">
+         <xsl:value-of select="'factorial'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rbase/Rsqr.con'">
+         <xsl:value-of select="'root'"/>
+        </xsl:when>
+       </xsl:choose>
+      </xsl:variable>
+      <m:apply helm:xref="{@id}">
+       <xsl:element name="{concat('m:',$elem)}">
+        <xsl:attribute name="definitionURL">
+         <xsl:value-of select="CONST/@uri"/> 
+        </xsl:attribute>
+        <xsl:attribute name="helm:xref">
+         <xsl:value-of select="CONST/@id"/>
+        </xsl:attribute>
+       </xsl:element>
+       <xsl:apply-templates select="*[2]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Raxioms/Rinv.con']]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 2">
+      <m:apply helm:xref="{@id}">
+       <m:power/>
+       <xsl:apply-templates select="*[2]" mode="noannot"/>
+       <m:apply>
+        <m:minus>
+         <xsl:attribute name="definitionURL">
+          <xsl:value-of select="CONST/@uri"/> 
+         </xsl:attribute>
+        </m:minus>
+        <xsl:attribute name="helm:xref">
+         <xsl:value-of select="CONST/@id"/>
+        </xsl:attribute>
+        <m:cn>1</m:cn>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- Binary Operations and Relations -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Raxioms/Rplus.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rminus.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rmult.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rle.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rlt.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rge.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rgt.con' or
+ attribute::uri='cic:/coq/REALS/Rbasic_fun/Rmin.con' or
+ attribute::uri='cic:/coq/REALS/Rfunctions/pow.con']]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 3">
+      <xsl:variable name="elem">
+       <xsl:choose>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rplus.con'">
+         <xsl:value-of select="'plus'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rminus.con'">
+         <xsl:value-of select="'minus'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rmult.con'">
+         <xsl:value-of select="'times'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rle.con'">
+         <xsl:value-of select="'leq'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rlt.con'">
+         <xsl:value-of select="'lt'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rge.con'">
+         <xsl:value-of select="'geq'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rgt.con'">
+         <xsl:value-of select="'gt'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rbasic_fun/Rmin.con'">
+         <xsl:value-of select="'min'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rfunctions/pow.con'">
+         <xsl:value-of select="'power'"/>
+        </xsl:when>
+       </xsl:choose>
+      </xsl:variable>
+      <m:apply helm:xref="{@id}">
+       <xsl:element name="{concat('m:',$elem)}">
+        <xsl:attribute name="definitionURL">
+         <xsl:value-of select="CONST/@uri"/> 
+        </xsl:attribute>
+        <xsl:attribute name="helm:xref">
+         <xsl:value-of select="CONST/@id"/>
+        </xsl:attribute>
+       </xsl:element>
+       <xsl:apply-templates select="*[2]" mode="noannot"/>
+       <xsl:apply-templates select="*[3]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- LIMIT -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Rlimit/limit1_in.con']]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 5">
+      <m:apply>
+       <m:eq/>
+       <xsl:choose>
+        <xsl:when test="name(*[2]) = 'LAMBDA'">
+         <m:apply helm:xref="{@id}">
+          <m:limit>
+           <xsl:attribute name="definitionURL">
+            <xsl:value-of select="CONST/@uri"/> 
+           </xsl:attribute>
+           <xsl:attribute name="helm:xref">
+            <xsl:value-of select="CONST/@id"/>
+           </xsl:attribute>
+          </m:limit>
+          <m:bvar>
+           <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
+          </m:bvar>
+          <m:lowlimit>
+           <xsl:apply-templates select="*[5]" mode="noannot"/>
+          </m:lowlimit>
+          <xsl:apply-templates select="*[2]/target" mode="noannot"/>
+         </m:apply>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:apply helm:xref="{@id}">
+          <m:limit/>
+          <m:bvar>
+           <m:ci>$x</m:ci>
+          </m:bvar>
+          <m:lowlimit>
+           <xsl:apply-templates select="*[5]" mode="noannot"/>
+          </m:lowlimit>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[2]" mode="noannot"/>
+           <m:ci>$x</m:ci>
+          </m:apply>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+       <xsl:apply-templates select="*[4]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- DIFFERENTIATION -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Rderiv/D_in.con']]" mode="pure">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 4">
+      <m:apply>
+       <m:eq/>
+       <xsl:choose>
+        <xsl:when test="name(*[2]) = 'LAMBDA'">
+         <m:apply helm:xref="{@id}">
+          <m:diff >
+           <xsl:attribute name="definitionURL">
+            <xsl:value-of select="CONST/@uri"/> 
+           </xsl:attribute>
+           <xsl:attribute name="helm:xref">
+            <xsl:value-of select="CONST/@id"/>
+           </xsl:attribute>
+          </m:diff>
+          <m:bvar>
+           <m:ci><xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="LAMBDA[1]/target/@binder"/></xsl:with-param></xsl:call-template></m:ci>
+          </m:bvar>
+          <xsl:apply-templates select="*[2]/target" mode="noannot"/>
+         </m:apply>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:apply helm:xref="{@id}">
+          <m:diff/>
+          <m:bvar>
+           <m:ci>$x</m:ci>
+          </m:bvar>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[2]" mode="noannot"/>
+           <m:ci>$x</m:ci>
+          </m:apply>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+       <xsl:apply-templates select="*[4]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/ricerca.xsl b/helm/style/ricerca.xsl
new file mode 100644 (file)
index 0000000..28e210d
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+
+
+<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="html"/>
+
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<xsl:template match="/">
+               <html> 
+                <head></head>
+                <body>
+                <xsl:apply-templates select="Theory"/>
+                </body>
+               </html>
+</xsl:template>
+
+
+<!-- CIC TERMS -->
+
+
+
+<xsl:template match="MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind']" mode="search" >
+<!-- <xsl:param name="current_uri" select=""/> -->
+<!-- <h1><xsl:value-of select="string(@uri)"/></h1> -->
+<!-- <xsl:if test="string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'"> -->
+  <xsl:value-of select="$current_uri"/><BR/>
+<!-- </xsl:if> -->
+</xsl:template>
+
+<!-- AGGIUNGERE cic: alle uri nei file Theory -->
+
+<xsl:template match="Theory">
+<!-- <xsl:param name="current_uri" select=""/> -->
+ <xsl:apply-templates>
+  <xsl:with-param name="current_uri" select="string(@uri)"/>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="VARIABLE">
+<!-- <xsl:param name="current_uri" select=""/> -->
+<xsl:variable name="found" 
+  select="boolean(document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))//MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'])"/>
+<xsl:if test="$found">
+  <xsl:value-of select="concat(string($current_uri),&quot;/&quot;,string(@uri),&quot;.xml&quot;)"/><BR/>
+</xsl:if>
+
+<!--   <xsl:with-param name="current_uri" select="concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates> -->
+</xsl:template>
+
+<xsl:template match="DEFINITION">
+<!-- <xsl:param name="current_uri" select=""/> -->
+<!-- <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))" mode="search">
+  <xsl:with-param name="current_uri" select="concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates> -->
+<xsl:variable name="found" 
+  select="boolean(document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))//MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'])"/>
+<xsl:if test="$found">
+  <xsl:value-of select="concat(string($current_uri),&quot;/&quot;,string(@uri),&quot;.xml&quot;)"/><BR/>
+</xsl:if>
+</xsl:template>
+
+<xsl:template match="THEOREM">
+<!-- <xsl:param name="current_uri" select=""/> -->
+<!-- <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))" mode="search">
+  <xsl:with-param name="current_uri" select="concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates> -->
+<xsl:variable name="found" 
+  select="boolean(document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))//MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'])"/>
+<xsl:if test="$found">
+  <xsl:value-of select="concat(string($current_uri),&quot;/&quot;,string(@uri),&quot;.xml&quot;)"/><BR/>
+</xsl:if>
+</xsl:template>
+
+
+<xsl:template match="SECTION">
+<!-- <xsl:param name="current_uri" select=""/> -->
+ <xsl:apply-templates>
+  <xsl:with-param name="current_uri" select="concat($current_uri,&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates>
+
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/rootcontent.xsl b/helm/style/rootcontent.xsl
new file mode 100644 (file)
index 0000000..e82a13d
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of the stylesheet to accomplish the right inclusion  -->
+<!-- of the content stylesheets:                                           -->
+<!-- First draft: May 26 2000, Claudio Sacerdoti Coen, Irene Schena        -->
+<!--***********************************************************************-->
+
+<!-- Schema of stylesheet precedences (from highest to lowest):          -->
+<!-- proofs.xsl-> reals.xsl-> set -> basic -> annotatedcont              -->
+<!-- because annotatedcont is imported and has lower precendence than    -->
+<!-- the templates of rootcontent (i.e. the templates of set and basic). -->
+<!-- annotatedcont -> objcontent -> content                              -->
+<!-- because annotatedcont generates an import precedence tree.          --> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+
+<xsl:import href="annotatedcont.xsl"/>
+<xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
+<xsl:include href="basic.xsl"/>
+<xsl:include href="set.xsl"/>
+<xsl:include href="reals.xsl"/>
+<xsl:include href="proofs.xsl"/>
+
+<xsl:variable name="showproof" select="0"/>
+</xsl:stylesheet>
+
+
+
diff --git a/helm/style/roottheory.xsl b/helm/style/roottheory.xsl
new file mode 100644 (file)
index 0000000..5ba277e
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of the stylesheet to accomplish the right inclusion  -->
+<!-- of the theory content stylesheets:                                    -->
+<!-- First draft: May 26 2000, Claudio Sacerdoti Coen, Irene Schena        -->
+<!--              November 15 2000, Irene Schena                           -->
+<!--***********************************************************************-->
+
+<!-- Schema of stylesheet precedences (from highest to lowest):          -->
+<!-- theory_content -> rootcontent.xsl                                   -->
+<!-- because theory_content is included and has higher precendence than  -->
+<!-- the templates of rootcontent which are imported.                    -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="rootcontent.xsl"/>
+<xsl:include href="theory_content.xsl"/>
+
+</xsl:stylesheet>
+
+
+
+
+
diff --git a/helm/style/set.xsl b/helm/style/set.xsl
new file mode 100644 (file)
index 0000000..916a92c
--- /dev/null
@@ -0,0 +1,472 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Basic Set Theory                                                 -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+
+
+<xsl:template match="*" mode="set">
+    <xsl:choose>
+     <xsl:when test="name() = 'LAMBDA'">
+      <m:set>
+       <m:bvar>
+        <m:ci>
+         <xsl:call-template name="insert_subscript"><xsl:with-param name="node_value"><xsl:value-of select="target/@binder"/></xsl:with-param></xsl:call-template>
+        </m:ci>
+        <m:type>
+         <xsl:apply-templates select="source" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+       <m:condition>
+        <xsl:apply-templates select="target" mode="noannot"/>
+       </m:condition>
+      </m:set>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="." mode="noannot"/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- IN -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/In.con']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       <!-- <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/> -->
+       <xsl:apply-templates select="*[2+$no_params]" mode="set" /> 
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- NOT-IN -->
+<!-- NOT ha no parameters -->
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con']
+and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/In.con']]]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="APPLY/CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(APPLY/child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:notin/>
+       <xsl:apply-templates select="*[2]/*[3+$no_params]" mode="noannot"/>
+  <!-- <xsl:apply-templates select="*[2]/*[2+$no_params]" mode="noannot"/> -->
+       <xsl:apply-templates select="*[2]/*[2+$no_params]" mode="set"/>  
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- EMPTY SET -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Empty_set.ind']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 1">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 2">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- SINGLETON -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Singleton.ind']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 2">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}">
+        <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- COUPLE -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Couple.ind']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}">
+        <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- TRIPLE -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Triple.ind'] and (count(child::*) = 5)]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 5">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[5+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}">
+        <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+        <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- INTERSECTION -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Intersection.ind']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:intersect definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:intersect definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- UNION -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Union.ind']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:union definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:union definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- INCLUDED -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Included.con']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:subset definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- STRICTLY INCLUDED -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Strict_Included.con']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:prsubset definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- SET-DIFF -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Setminus.con']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- ADD-ELEM -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Add.con']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:union definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <m:set>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:union definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <m:set>
+         <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+        </m:set>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- SUBTRACT-ELEM -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Subtract.con']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <m:set>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <m:set>
+         <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+        </m:set>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- CARD -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Finite_sets/Ensembles_finis/cardinal.ind']]" mode="pure">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:eq/>
+       <m:apply>
+        <m:card definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       </m:apply>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/annotatedcont.xsl b/helm/style/style_prima_del_linguaggio_naturale/annotatedcont.xsl
new file mode 100644 (file)
index 0000000..e97d08f
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of annotated MathML content to MathML presentation:  -->
+<!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene Schena      -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="objcontent.xsl"/>
+
+<xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
+
+<xsl:key name="annid" use="@of" match="Annotation"/>
+
+<xsl:template match="Definition|Axiom|CurrentProof|InductiveDefinition|Variable">
+    <xsl:choose>
+    <xsl:when test="key('annid',@id)">
+     <annotation helm:xref="{@id}">
+      <xsl:apply-templates select="key('annid',@id)"/>
+     </annotation>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates select="." mode="noannot"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX">
+    <xsl:choose>
+    <xsl:when test="key('annid',@id)">
+     <annotation helm:xref="{@id}">
+      <xsl:apply-templates select="key('annid',@id)"/>
+     </annotation>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:math>
+      <xsl:apply-templates select="." mode="noannot"/>
+     </m:math>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="node">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:apply-templates select="key('id',$id)"/>
+</xsl:template>
+
+<xsl:template match="attribute">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="child" select="@child"/>
+ <xsl:variable name="grandchild" select="@grandchild"/>
+ <xsl:choose>
+  <xsl:when test="$child">
+   <xsl:choose>
+    <xsl:when test="$grandchild">
+     <xsl:value-of select="key('id',$id)/*[position() = $child]/*[position() = $grandchild]/attribute::*[name() = $name]"/>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="key('id',$id)/*[position() = $child]/attribute::*[name() = $name]"/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="key('id',$id)/attribute::*[name() = $name]"/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/annotatedpres.xsl b/helm/style/style_prima_del_linguaggio_naturale/annotatedpres.xsl
new file mode 100644 (file)
index 0000000..511f915
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of annotated MathML content to MathML presentation:  -->
+<!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene Schena      -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="mmlextension.xsl"/>
+
+<!-- ANNOTATION -->
+
+<xsl:template match="annotation">
+    <xsl:choose>
+    <xsl:when test=". = /">
+      <m:math><m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow></m:math>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="text()">
+ <xsl:variable name="text" select="normalize-space(.)"/>
+ <xsl:if test="$text != ''">
+  <m:mtext><xsl:value-of select="$text"/></m:mtext>
+ </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet> 
diff --git a/helm/style/style_prima_del_linguaggio_naturale/basic.xsl b/helm/style/style_prima_del_linguaggio_naturale/basic.xsl
new file mode 100644 (file)
index 0000000..3f5422a
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Basic Logic                                                      -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+<!-- AND -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Conjunction/and.ind'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:and definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- OR -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Disjunction/or.ind'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:or definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- NOT -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con'] and (count(child::*) = 2)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:not definitionURL="{CONST/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- IFF -->
+<!--
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/Equivalence/iff.ind'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:iff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+-->
+
+<!-- EXISTS -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/First_order_quantifiers/ex.ind' or attribute::uri='cic:/coq/INIT/Logic_Type/exT.ind'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+     <m:exists definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:choose>
+      <xsl:when test="name(*[3]) = 'LAMBDA'">
+       <m:bvar>
+        <m:ci><xsl:value-of select="LAMBDA/target/@binder"/></m:ci>
+       </m:bvar>
+       <xsl:apply-templates select="LAMBDA/target" mode="noannot"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:bvar>
+        <m:ci>$x</m:ci>
+       </m:bvar>
+       <m:apply>
+        <m:csymbol>app</m:csymbol>
+        <xsl:apply-templates select="*[3]" mode="noannot"/>
+        <m:ci>$x</m:ci>
+       </m:apply>
+      </xsl:otherwise>
+     </xsl:choose>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/First_order_quantifiers/ex2.ind' or attribute::uri='cic:/coq/INIT/Logic_Type/exT2.ind'] and (count(child::*) = 4)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:exists definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:choose>
+      <xsl:when test="name(*[3]) = 'LAMBDA'">
+       <xsl:variable name="bvarname" select="*[3]/target/@binder"/>
+       <m:bvar>
+        <m:ci><xsl:value-of select="$bvarname"/></m:ci>
+       </m:bvar>
+       <m:condition>
+        <xsl:apply-templates select="LAMBDA[1]/target" mode="noannot"/>
+       </m:condition>
+       <xsl:choose>
+        <xsl:when test="(name(*[4]) = 'LAMBDA') and 
+           ($bvarname = *[4]/target/@binder)">
+         <xsl:apply-templates select="LAMBDA[2]/target" mode="noannot"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:apply>
+          <m:csymbol>app</m:csymbol>
+          <xsl:apply-templates select="*[4]" mode="noannot"/>
+          <m:ci><xsl:value-of select="$bvarname"/></m:ci>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:choose>
+        <xsl:when test="name(*[4]) = 'LAMBDA'">
+         <xsl:variable name="bvarname" select="*[4]/target/@binder"/>
+         <m:bvar>
+          <m:ci><xsl:value-of select="$bvarname"/></m:ci>
+         </m:bvar>
+         <m:condition>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[3]" mode="noannot"/>
+           <m:ci><xsl:value-of select="$bvarname"/></m:ci>
+          </m:apply>
+         </m:condition>
+         <xsl:apply-templates select="*[4]/target" mode="noannot"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:bvar>
+          <m:ci>x</m:ci>
+         </m:bvar>
+         <m:condition>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[3]" mode="noannot"/>
+           <m:ci>x</m:ci>
+          </m:apply>
+         </m:condition>
+         <m:apply>
+          <m:csymbol>app</m:csymbol>
+          <xsl:apply-templates select="*[4]" mode="noannot"/>
+          <m:ci>x</m:ci>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:otherwise>
+     </xsl:choose>
+    </m:apply>
+</xsl:template>
+
+<!-- EQUALITY -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Equality/eq.ind'] and (count(child::*) = 4)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:eq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+     <xsl:apply-templates select="*[4]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+
+<!-- TYPE EQUALITY -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic_Type/eqT.ind'] and (count(child::*) = 4)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:eq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+     <xsl:apply-templates select="*[4]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<!-- NOT-EQ -->
+<!-- NOT and EQ have no parameters -->
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con']
+and (count(child::*) = 2) and APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic/Equality/eq.ind']]]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(APPLY/child::*) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:neq/>
+       <xsl:apply-templates select="*[2]/*[3]" mode="noannot"/>
+       <xsl:apply-templates select="*[2]/*[4]" mode="set"/>  
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- NOT-EQT -->
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con']
+and (count(child::*) = 2) and APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Logic_Type/eqT.ind']]]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(APPLY/child::*) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:neq/>
+       <xsl:apply-templates select="*[2]/*[3]" mode="noannot"/>
+       <xsl:apply-templates select="*[2]/*[4]" mode="set"/>  
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- ************************ DATATYPES ******************************* -->
+
+<!-- no datatypes in MathML content -->
+
+
+<!-- *************************** PEANO ********************************* -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/INIT/Peano/le.ind'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:leq definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Peano/lt.con'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:lt definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Peano/ge.con'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:geq definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Peano/gt.con'] and (count(child::*) = 3)]" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:gt definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+     <xsl:apply-templates select="*[2]" mode="noannot"/>
+     <xsl:apply-templates select="*[3]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+</xsl:stylesheet>
+
+
+
+
+
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/content.xsl b/helm/style/style_prima_del_linguaggio_naturale/content.xsl
new file mode 100644 (file)
index 0000000..7de9987
--- /dev/null
@@ -0,0 +1,215 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- XSLT version 0.1 of CIC objects to MathML content:               -->
+<!-- First draft: February 14 2000, Andrea Asperti, Irene Schena      -->
+<!-- Revised: March 3 2000, Irene Schena                              -->
+<!-- Revised: March 10 2000, Irene Schena                             -->
+<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena     -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:include href="params.xsl"/>
+
+<!--<xsl:output
+           method="xml" 
+           version="1.0" 
+           encoding="ISO-8859-1" 
+           omit-xml-declaration="no"
+           standalone="no" 
+           doctype-public="http://www.w3.org/TR/REC-MathML" 
+           indent="yes"
+           media-type="text/mathml" /> -->
+
+<!-- DA FARE: 
+1)risolvere nella fase di pre-processing le uri relative, settando l'attributo
+definitionURL dell'oggetto corrispondente (alcuni punteranno a nulla! -quelli 
+che non hanno il file di definizione corrispondente-); [le uri assolute hanno
+la forma cic:/.../ in definitionURL e questo schema di uri verra' risolto da
+Amaya o da chi di dovere in /really_very_local/helm/PARSER/example/.../]
+2)aggiungere nei file xml gli ID, affinche' nello stylesheet si setti
+l'attributo xref di ogni oggetto per puntare (tramite ID) al suo corrispondente
+della rappresentazione interna. 
+-->
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- CIC TERMS -->
+
+<xsl:template match="LAMBDA" mode="noannot">
+    <m:lambda helm:xref="{@id}">
+     <m:bvar>
+      <m:ci>
+       <xsl:value-of select="target/@binder"/>
+      </m:ci>
+      <m:type>
+       <xsl:apply-templates select="source/*[1]" mode="noannot"/>
+      </m:type>
+     </m:bvar>
+     <xsl:apply-templates select="target/*[1]" mode="noannot"/>
+    </m:lambda>
+</xsl:template>
+
+<xsl:template match="PROD" mode="noannot">
+    <m:apply helm:xref="{@id}">
+     <xsl:choose>
+     <xsl:when test="string(target/@binder)= &quot;&quot;">
+      <m:csymbol>arrow</m:csymbol>
+      <xsl:apply-templates select="source/*[1]" mode="noannot"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <m:csymbol>prod</m:csymbol>
+       <m:bvar>
+        <m:ci>
+         <xsl:value-of select="target/@binder"/>
+        </m:ci>
+        <m:type>
+         <xsl:apply-templates select="source/*[1]" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+     </xsl:otherwise>
+     </xsl:choose>
+     <xsl:apply-templates select="target/*[1]" mode="noannot"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="CAST" mode="noannot">
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>cast</m:csymbol>
+     <xsl:apply-templates mode="noannot" select="*/*"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="REL" mode="noannot">
+    <m:ci helm:xref="{@id}">
+     <xsl:value-of select="@binder"/>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="SORT" mode="noannot">
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>
+      <xsl:value-of select="@value"/>
+     </m:csymbol>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="APPLY" mode="noannot">
+    <m:apply helm:xref="{@id}">
+    <m:csymbol>app</m:csymbol>
+     <xsl:apply-templates mode="noannot" select="*"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="VAR" mode="noannot">
+    <m:ci helm:xref="{@id}">
+     <xsl:value-of select="substring-after(@relUri,&quot;,&quot;)"/>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="META" mode="noannot">
+    <m:ci helm:xref="{@id}">
+     <xsl:value-of select="@no"/>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="CONST" mode="noannot">
+    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
+     <xsl:call-template name="name_of_uri">
+      <xsl:with-param name="uri" select="@uri"/>
+     </xsl:call-template>
+     <!-- <xsl:value-of select="document(concat(string($absPath),@uri))/*/@name"/> -->
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="MUTIND" mode="noannot">
+    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
+     <xsl:variable name="index"><xsl:value-of select="@noType"/></xsl:variable>
+     <xsl:value-of select="document(concat(string($absPath),@uri))/InductiveDefinition/InductiveType[position()=number($index)+1]/@name"/>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="MUTCONSTRUCT" mode="noannot">
+    <m:ci definitionURL="{@uri}" helm:xref="{@id}">
+     <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
+     <xsl:variable name="Cindex"><xsl:value-of select="@noConstr"/></xsl:variable>
+     <xsl:value-of select="document(concat(string($absPath),@uri))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($Cindex)]/@name"/>
+    </m:ci>
+</xsl:template>
+
+<xsl:template match="MUTCASE" mode="noannot">
+    <xsl:variable name="Tindex"><xsl:value-of select="@noType"/></xsl:variable>
+    <xsl:variable name="Turi"><xsl:value-of select="@uriType"/></xsl:variable>
+    <m:apply helm:xref="{@id}">
+     <m:csymbol>mutcase</m:csymbol>
+     <xsl:apply-templates select="patternsType/*[1]" mode="noannot"/>
+     <xsl:apply-templates select="inductiveTerm/*[1]" mode="noannot"/>
+     <xsl:variable name="nop"><xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/@noParams"/></xsl:variable>
+     <xsl:for-each select="pattern">
+      <xsl:variable name="pos" select="position()"/>
+      <xsl:variable name="nopar"><xsl:apply-templates select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/*[1]" mode="counting"><xsl:with-param name="noparams" select="$nop"/></xsl:apply-templates></xsl:variable>
+      <xsl:choose>
+      <xsl:when test="$nopar = 0">
+       <m:ci>
+        <xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/@name"/>
+       </m:ci>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:apply>
+        <m:csymbol>app</m:csymbol>
+        <m:ci>
+         <xsl:value-of select="document(concat(string($absPath),$Turi))/InductiveDefinition/InductiveType[position()=number($Tindex)+1]/Constructor[position()=number($pos)]/@name"/>
+        </m:ci>
+        <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
+        </m:apply>
+       </xsl:otherwise>
+       </xsl:choose>
+      <xsl:apply-templates select="./*[1]" mode="abstparams"><xsl:with-param name="noparams" select="$nopar"/><xsl:with-param name="target" select="1"/><xsl:with-param name="binder">LAMBDA</xsl:with-param></xsl:apply-templates>
+     </xsl:for-each> 
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="FIX" mode="noannot">
+    <m:apply helm:xref="{@id}">
+     <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
+     <m:csymbol>fix</m:csymbol>
+     <m:ci><xsl:value-of select="FixFunction[position()=number($findex)+1]/@name"/></m:ci>
+     <xsl:apply-templates mode="noannot" select="*"/>
+    </m:apply>
+</xsl:template>
+
+<xsl:template match="COFIX" mode="noannot">
+   <m:apply helm:xref="{@id}">
+     <xsl:variable name="findex"><xsl:value-of select="@noFun"/></xsl:variable>
+     <m:csymbol>cofix</m:csymbol>
+     <m:ci><xsl:value-of select="CofixFunction[position()=number($findex)+1]/@name"/></m:ci>
+     <xsl:apply-templates mode="noannot" select="*"/>
+    </m:apply>
+</xsl:template>
+
+<!-- ELEMENTS OF CIC TERMS -->
+
+<xsl:template match="FixFunction" mode="noannot">
+    <m:bvar>
+     <m:ci><xsl:value-of select="@name"/></m:ci>
+     <m:type><xsl:apply-templates select="type/*[1]" mode="noannot"/></m:type>
+    </m:bvar> 
+    <xsl:apply-templates select="body/*[1]" mode="noannot"/>
+</xsl:template>
+
+<xsl:template match="CofixFunction" mode="noannot">
+    <m:bvar>
+     <m:ci><xsl:value-of select="@name"/></m:ci>
+     <m:type><xsl:apply-templates select="type/*[1]" mode="noannot"/></m:type>
+    </m:bvar> 
+    <xsl:apply-templates select="body/*[1]" mode="noannot"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/content_to_html.xsl b/helm/style/style_prima_del_linguaggio_naturale/content_to_html.xsl
new file mode 100644 (file)
index 0000000..dd1c077
--- /dev/null
@@ -0,0 +1,657 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- From MathML content to HTML                                           -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+
+<xsl:include href="html_init.xsl"/>
+<xsl:include href="html_set.xsl"/>
+<xsl:include href="html_reals.xsl"/>
+
+
+<!-- <xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>-->
+<xsl:variable name="header" select="document('http://localhost:8081/conf')/html_link"/>
+
+<xsl:variable name="showcast" select="0"/>
+
+
+<!--***********************************************************************-->
+<!-- HTML Head and Body                                                    -->
+<!--***********************************************************************-->
+
+<xsl:output method="html"/>
+
+<xsl:variable name="framewidth" select="36"/>
+
+<xsl:template match="/">
+ <xsl:param name="current_indent" select="0"/>
+               <html> 
+                <head></head>
+                <body>
+                <xsl:apply-templates>
+                 <xsl:with-param name="current_indent" select="0"/>
+                </xsl:apply-templates>
+                </body>
+               </html>
+</xsl:template>
+
+<!--***********************************************************************-->
+<!-- Indentation                                                          -->
+<!--***********************************************************************-->
+
+<xsl:template name="make_indent">
+ <xsl:param name="current_indent" select="0"/>
+  <xsl:if test="$current_indent > 0">
+   <xsl:text>&#x00A0;</xsl:text>
+   <xsl:call-template name="make_indent">
+    <xsl:with-param name="current_indent" select="$current_indent - 1"/> 
+   </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<!-- Syntactic Sugar -->
+
+<xsl:template match="m:type">
+<xsl:param name="current_indent" select="0"/> 
+<xsl:apply-templates>
+ <xsl:with-param name="current_indent" 
+           select="$current_indent"/>
+</xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="m:condition">
+<xsl:param name="current_indent" select="0"/> 
+<xsl:apply-templates>
+ <xsl:with-param name="current_indent" 
+           select="$current_indent"/>
+</xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="m:math">
+<xsl:param name="current_indent" select="0"/> 
+<xsl:apply-templates>
+ <xsl:with-param name="current_indent" 
+           select="$current_indent"/>
+</xsl:apply-templates>
+</xsl:template>
+
+<!-- CSYMBOL -->
+
+<xsl:template match="m:apply[m:csymbol]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/> 
+  <xsl:variable name="name">
+   <xsl:value-of select="m:csymbol"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:csymbol" mode="charcount"/>
+  </xsl:variable>
+     <!-- <xsl:value-of select="$current_indent"/> -->
+     <!-- <xsl:value-of select="$charlength"/> -->
+     <xsl:choose>
+      <xsl:when test="$name='prod'">
+       <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+         <!-- &#x03a0; -->
+         <FONT FACE="symbol" SIZE="+2" color="blue">&#80;</FONT>
+         <xsl:apply-templates select="m:bvar/m:ci"/>
+         <xsl:text>:</xsl:text>
+         <xsl:apply-templates select="m:bvar/m:type">
+          <xsl:with-param name="current_indent" 
+           select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
+         </xsl:apply-templates><BR/> 
+         <xsl:call-template name="make_indent">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+         </xsl:call-template>
+         <xsl:text>.</xsl:text>
+         <xsl:apply-templates select="*[position()=3]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+         </xsl:apply-templates>
+       </xsl:when>
+       <xsl:otherwise>
+        <!-- &#x03a0; -->
+        <FONT FACE="symbol" SIZE="+2" color="blue">&#80;</FONT>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <xsl:text>:</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:type"/>
+        <xsl:text>.</xsl:text>
+        <xsl:apply-templates select="*[position()=3]"/>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='arrow'">
+       <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+       <xsl:text>(</xsl:text>
+       <xsl:apply-templates select="*[position()=2]">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+       </xsl:apply-templates>
+       <BR/>
+       <xsl:call-template name="make_indent">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+       </xsl:call-template>
+       <!-- -> -->
+       <FONT FACE="symbol" SIZE="+2" color="blue">&#174;</FONT>
+       <xsl:apply-templates select="*[position()=3]">
+        <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+       </xsl:apply-templates>
+       <xsl:text>)</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>(</xsl:text>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <!-- -> -->
+        <FONT FACE="symbol" SIZE="+2" color="blue">&#174;</FONT>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <xsl:text>)</xsl:text>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='app'">
+       <xsl:choose>
+       <xsl:when test="$charlength  > $framewidth">
+        <xsl:text>(</xsl:text>
+        <xsl:apply-templates select="*[position()=2]">
+         <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+        </xsl:apply-templates>
+         <xsl:for-each select="*[position()>2]">
+          <BR/>
+           <xsl:call-template name="make_indent">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>         
+           </xsl:call-template>
+            <xsl:apply-templates select=".">
+             <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+            </xsl:apply-templates>
+         </xsl:for-each>
+         <xsl:text>)</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>(</xsl:text>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:for-each select="*[position()>2]">
+         <xsl:text>&#x00A0;</xsl:text>
+         <xsl:apply-templates select="."/>
+        </xsl:for-each>
+        <xsl:text>)</xsl:text>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='cast'">
+       <xsl:choose>
+        <xsl:when test="$showcast = 1">
+         <xsl:choose>
+          <xsl:when test="$charlength > $framewidth">
+           <xsl:text>(</xsl:text>
+           <xsl:apply-templates select="*[position()=2]">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+           </xsl:apply-templates><BR/>
+           <xsl:call-template name="make_indent">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>          </xsl:call-template>
+           <xsl:text>:></xsl:text>
+           <xsl:apply-templates select="*[position()=3]">
+            <xsl:with-param name="current_indent" select="$current_indent + 3"/>
+           </xsl:apply-templates>
+           <xsl:text>)</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+           <xsl:text>(</xsl:text>
+           <xsl:apply-templates select="*[position()=2]"/>
+           <xsl:text>:></xsl:text>
+           <xsl:apply-templates select="*[position()=3]"/>
+           <xsl:text>)</xsl:text>
+          </xsl:otherwise>
+         </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="*[position()=2]">
+          <xsl:with-param name="current_indent" select="$current_indent"/>
+         </xsl:apply-templates>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='Prop'">
+       <xsl:text>Prop</xsl:text>
+      </xsl:when>
+      <xsl:when test="$name='Set'">
+       <xsl:text>Set</xsl:text>
+      </xsl:when>
+      <xsl:when test="$name='Type'">
+       <xsl:text>Type</xsl:text>
+      </xsl:when>
+      <xsl:when test="$name='mutcase'">
+       <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+         <xsl:text>&lt;</xsl:text>
+         <xsl:apply-templates select="*[position()=2]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+         </xsl:apply-templates>
+         <xsl:text>&gt; </xsl:text>
+         <xsl:text>CASE </xsl:text>
+         <xsl:apply-templates select="*[position()=3]">
+          <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+         </xsl:apply-templates>
+         <xsl:text> OF </xsl:text> 
+         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <BR/>
+         <xsl:call-template name="make_indent">
+            <xsl:with-param name="current_indent" select="$current_indent + 2"/>  
+         </xsl:call-template> 
+            <xsl:choose>
+            <xsl:when test="position() = 1">
+             <xsl:text>&#x00A0;&#x00A0;</xsl:text>
+            </xsl:when>
+            <xsl:otherwise>
+             <xsl:text>| </xsl:text>
+            </xsl:otherwise>
+            </xsl:choose>
+            <xsl:apply-templates select="."/>
+            <FONT FACE="symbol" SIZE="+2" color="green">&#222;</FONT>
+            <xsl:apply-templates select="following-sibling::*[position()= 1]">
+             <xsl:with-param name="current_indent" select="$current_indent + 4 + string-length()"/>
+            </xsl:apply-templates>
+         </xsl:for-each>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>&lt;</xsl:text> 
+        <xsl:apply-templates select="*[position()=2]"/> 
+        <xsl:text>&gt; </xsl:text>
+        <xsl:text>CASE </xsl:text>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <xsl:text> OF </xsl:text>
+        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:choose>
+         <xsl:when test="not(position() = 1)">
+          <xsl:text> | </xsl:text> 
+         </xsl:when> 
+         </xsl:choose>
+         <xsl:apply-templates select="."/>
+         <FONT FACE="symbol" SIZE="+2" color="green">&#222;</FONT>
+         <xsl:apply-templates select="following-sibling::*[position()= 1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2 + string-length()"/>
+         </xsl:apply-templates>
+        </xsl:for-each>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='fix'">
+       <xsl:choose>
+       <xsl:when test="$charlength  > $framewidth">
+            <xsl:text>FIX</xsl:text>
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>{</xsl:text> 
+            <xsl:for-each select="m:bvar"> 
+              <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>  
+              </xsl:call-template>
+              <xsl:value-of select="m:ci"/>
+              <xsl:text>:</xsl:text>
+              <xsl:apply-templates select="m:type">
+               <xsl:with-param name="current_indent" 
+                    select="$current_indent + 5 + string-length(m:ci)"/>
+               </xsl:apply-templates>
+              <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+              </xsl:call-template>
+              <xsl:text>:=</xsl:text> 
+              <xsl:apply-templates select="following-sibling::*[position() = 1]">
+               <xsl:with-param name="current_indent" select="$current_indent +2"/>
+              </xsl:apply-templates>
+            </xsl:for-each>
+             <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+              </xsl:call-template> 
+           <xsl:text>}</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>FIX</xsl:text>
+        <xsl:value-of select="m:ci"/>
+        <xsl:text>{</xsl:text>
+        <xsl:for-each select="m:bvar"> 
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>:</xsl:text>
+            <xsl:apply-templates select="m:type"/>
+            <xsl:text>:=</xsl:text>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:choose>
+             <xsl:when test="position()=last()">
+             <xsl:text>}</xsl:text>
+             </xsl:when>
+             <xsl:otherwise>
+             <xsl:text>;</xsl:text>
+             </xsl:otherwise>
+            </xsl:choose>
+         </xsl:for-each>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when> 
+      <xsl:when test="$name='cofix'">
+       <xsl:choose>
+       <xsl:when test="($charlength + 10) > $framewidth">
+            <xsl:text>COFIX</xsl:text>
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>{</xsl:text>
+            <BR/>
+            <xsl:call-template name="make_indent">
+             <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+            </xsl:call-template>
+            <xsl:for-each select="m:bvar"> 
+                <xsl:value-of select="m:ci"/>
+                <xsl:text>:</xsl:text>
+                <xsl:apply-templates select="m:type">
+                 <xsl:with-param name="current_indent" 
+                    select="$current_indent + 5 + string-length(m:ci)"/>
+                </xsl:apply-templates>
+                <BR/> 
+                <xsl:call-template name="make_indent">
+                 <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+                </xsl:call-template>
+                <xsl:text>:=</xsl:text>
+                <xsl:apply-templates select="following-sibling::*[position() = 1]">
+                 <xsl:with-param name="current_indent" select="$current_indent + 3"/>
+                </xsl:apply-templates>
+            </xsl:for-each>
+            <BR/>
+              <xsl:call-template name="make_indent">
+               <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+              </xsl:call-template>
+            <xsl:text>}</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>COFIX</xsl:text>
+        <xsl:value-of select="m:ci"/>
+        <xsl:text>{</xsl:text>
+        <xsl:for-each select="m:bvar"> 
+            <xsl:value-of select="m:ci"/>
+            <xsl:text>:</xsl:text>
+            <xsl:apply-templates select="m:type"/>
+            <xsl:text>:=</xsl:text>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:choose>
+             <xsl:when test="position()=last()">
+             <xsl:text>}</xsl:text>
+             </xsl:when>
+             <xsl:otherwise>
+             <xsl:text>;</xsl:text>
+             </xsl:otherwise>
+            </xsl:choose>
+         </xsl:for-each>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      </xsl:choose>
+    <!--  </m:mrow> -->
+</xsl:template>
+
+<!-- LAMBDA -->
+
+<xsl:template match="m:lambda">
+<xsl:param name="current_indent" select="0"/>
+    <xsl:variable name="charlength">
+     <xsl:apply-templates select="*[position()=1]" mode="charcount"/>
+     <!-- <xsl:apply-templates select="." mode="charcount"/> -->
+    </xsl:variable>
+    <!-- <xsl:value-of select="$charlength"/> -->
+     <xsl:choose>
+     <xsl:when test="$charlength > $framewidth">
+       <!-- &#x03bb; -->
+       <FONT FACE="symbol" SIZE="+2" color="red">&#108;</FONT>
+       <xsl:apply-templates select="m:bvar/m:ci"/>
+       <xsl:text>:</xsl:text>
+       <xsl:apply-templates select="m:bvar/m:type">
+        <xsl:with-param name="current_indent" 
+           select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
+       </xsl:apply-templates><BR/> 
+       <xsl:call-template name="make_indent">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/>       
+       </xsl:call-template>
+       <xsl:text>.</xsl:text>
+       <xsl:apply-templates select="*[position()=2]">
+        <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+       </xsl:apply-templates>
+     </xsl:when>
+     <xsl:otherwise>
+      <!-- &#x03bb; -->
+      <FONT FACE="symbol" SIZE="+2" color="red">&#108;</FONT>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <xsl:text>:</xsl:text>
+      <xsl:apply-templates select="m:bvar/m:type"/>
+      <xsl:text>.</xsl:text>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </xsl:otherwise>
+     </xsl:choose>
+</xsl:template>
+
+<!-- href -->
+<xsl:template match="m:ci">
+ <xsl:choose>
+  <xsl:when test="boolean(@definitionURL)">
+<!-- CSC: non bisogna piu' utilizzare la url, bensi' la uri -->
+<!--   <xsl:variable name="url">
+    <xsl:value-of select="concat(string($absPath),
+     @definitionURL)"/>
+   </xsl:variable>-->
+   <a>
+   <xsl:attribute name="href">
+    <xsl:value-of select="concat(string($header),string(@definitionURL))"/>
+   </xsl:attribute>
+   <xsl:apply-templates/>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="."/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!-- COUNTING -->
+
+<xsl:template match="m:ci|m:csymbol" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+<xsl:template match="*" mode="charcount">
+ <xsl:param name="incurrent_length" select="0"/>
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <xsl:value-of select="$incurrent_length"/>
+  </xsl:when>
+  <xsl:otherwise>
+    <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/></xsl:apply-templates></xsl:variable>
+    <xsl:choose>
+     <xsl:when test="$framewidth >= number($childlength)">
+      <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$childlength"/></xsl:apply-templates></xsl:variable>
+      <xsl:choose>
+       <xsl:when test="string($siblength) = &quot;&quot;">
+        <xsl:value-of select="number($childlength)"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:value-of select="number($siblength)"/>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($childlength)"/>
+     </xsl:otherwise>
+    </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--***********************************************************************-->
+<!-- OBJECTS                                                               -->
+<!--***********************************************************************-->
+
+<!-- DEFINITION -->
+
+<xsl:template match="Definition">
+<xsl:param name="current_indent" select="0"/>
+<p>
+DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)<BR/>
+TYPE =<BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 7"/> 
+      </xsl:call-template>
+       <xsl:apply-templates select="type/*[1]">
+        <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates><BR/>
+BODY =<BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 7"/> 
+      </xsl:call-template>
+       <xsl:apply-templates select="body/*[1]">
+        <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!-- AXIOM -->
+
+<xsl:template match="Axiom">
+<xsl:param name="current_indent" select="0"/>
+<p>
+AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)<BR/>
+TYPE = <xsl:apply-templates select="type/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!-- UNFINISHED PROOF -->
+
+<xsl:template match="CurrentProof">
+<xsl:param name="current_indent" select="0"/>
+<p>
+UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)<BR/>
+THESIS:  <xsl:apply-templates select="type/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+         </xsl:apply-templates><BR/>
+CONJECTURES: 
+      <xsl:for-each select="Conjecture">
+      <BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 8"/> 
+      </xsl:call-template>
+      <xsl:value-of select="./@no"/> : 
+      <xsl:apply-templates select="./*[1]">
+       <xsl:with-param name="current_indent" select="$current_indent + 11"/>
+      </xsl:apply-templates>
+      </xsl:for-each> 
+      <BR/>
+PROOF:
+      <xsl:apply-templates select="body/*[1]">
+        <xsl:with-param name="current_indent" select="$current_indent + 8"/>
+      </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!-- MUTUAL INDUCTIVE DEFINITION -->
+
+<xsl:template match="InductiveDefinition">
+<xsl:param name="current_indent" select="0"/>
+<p>
+     <xsl:for-each select="InductiveType">
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+          <xsl:choose>
+          <xsl:when test="string(./@inductive) = &quot;true&quot;">
+          INDUCTIVE DEFINITION 
+          </xsl:when>
+          <xsl:otherwise>
+          COINDUCTIVE DEFINITION 
+          </xsl:otherwise>
+          </xsl:choose>  
+         </xsl:when>
+         <xsl:otherwise>
+          AND 
+         </xsl:otherwise>
+         </xsl:choose>
+         <xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != &quot;&quot;"><xsl:value-of select="../Params"/></xsl:if>)
+         [
+          <xsl:if test="string(../Param) != &quot;&quot;">         
+           <xsl:for-each select="../Param">
+            <xsl:value-of select="./@name"/>
+            :
+            <xsl:apply-templates select="*"/>
+           </xsl:for-each>
+          </xsl:if>
+         ] <BR/>
+         OF ARITY 
+         <xsl:apply-templates select="./arity/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 9"/>
+         </xsl:apply-templates> <BR/>
+         BUILT FROM:
+      <xsl:for-each select="./Constructor">
+      <BR/>
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 3"/> 
+      </xsl:call-template>
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+         <xsl:text>&#x00A0;&#x00A0;</xsl:text>
+         </xsl:when>
+         <xsl:otherwise>
+         <xsl:text>| </xsl:text>
+         </xsl:otherwise>
+         </xsl:choose>
+         <xsl:value-of select="./@name"/> 
+         <xsl:text>: </xsl:text>
+         <xsl:apply-templates select="./*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + string-length(./@name) + 4"/>
+         </xsl:apply-templates>
+      </xsl:for-each>
+     </xsl:for-each>
+</p>
+</xsl:template>
+
+<!-- VARIABLE -->
+
+<xsl:template match="Variable">
+<xsl:param name="current_indent" select="0"/>
+<p>
+VARIABLE <xsl:value-of select="@name"/><BR/>
+TYPE = <xsl:apply-templates select="type/*[1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 7"/>
+       </xsl:apply-templates>
+</p>
+</xsl:template>
+
+<!--***********************************************************************-->
+<!-- SECTIONS                                                              -->
+<!--***********************************************************************-->
+
+<!-- SECTION -->
+
+<xsl:template match="SECTION">
+<xsl:param name="current_indent" select="0"/>
+ <h1>BEGIN OF SECTION</h1>
+  <xsl:apply-templates/>
+ <h1>END OF SECTION</h1>
+</xsl:template>
+
+</xsl:stylesheet> 
diff --git a/helm/style/style_prima_del_linguaggio_naturale/html_init.xsl b/helm/style/style_prima_del_linguaggio_naturale/html_init.xsl
new file mode 100644 (file)
index 0000000..9e81b16
--- /dev/null
@@ -0,0 +1,259 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- INIT style for HTML                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+
+<!-- BASIC OPERATORS -->
+
+ <xsl:template match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
+       |m:geq|m:gt|m:plus|m:times]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="*[1]" mode="charcount"/>
+  </xsl:variable>
+  <xsl:variable name="symbol">
+   <xsl:choose>
+    <xsl:when test="m:and">
+     <xsl:value-of select="'&#217;'"/>
+    </xsl:when>
+    <xsl:when test="m:or">
+     <xsl:value-of select="'&#218;'"/>
+    </xsl:when>
+    <xsl:when test="m:eq">
+     <xsl:value-of select="'&#61;'"/>
+    </xsl:when>
+    <xsl:when test="m:neq">
+     <xsl:value-of select="'&#185;'"/>
+    </xsl:when>
+    <xsl:when test="m:leq">
+     <xsl:value-of select="'&#163;'"/>
+    </xsl:when>
+    <xsl:when test="m:lt">
+     <xsl:value-of select="'&#60;'"/>
+    </xsl:when>
+    <xsl:when test="m:geq">
+     <xsl:value-of select="'&#179;'"/>
+    </xsl:when>
+    <xsl:when test="m:gt">
+     <xsl:value-of select="'&#62;'"/>
+    </xsl:when>
+    <xsl:when test="m:plus">
+     <xsl:value-of select="'&#43;'"/>
+    </xsl:when>
+    <xsl:when test="m:times">
+     <xsl:value-of select="'&#42;'"/>
+    </xsl:when>
+   </xsl:choose>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">
+      <xsl:value-of select="$symbol"/>
+     </FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">
+     <xsl:value-of select="$symbol"/>
+     </FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- MINUS (can be unary!) -->
+
+<xsl:template match="m:apply[m:minus]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="count(child::*)=2">
+    <a>
+    <xsl:attribute name="href">
+     <xsl:value-of select="concat(string($header),string($uri))"/>
+    </xsl:attribute>
+    <xsl:text>-</xsl:text>
+    </a>
+    <xsl:apply-templates select="*[2]">
+     <xsl:with-param name="current_indent" select="$current_indent + 1"/>
+    </xsl:apply-templates>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="charlength">
+     <xsl:apply-templates select="*[1]" mode="charcount"/>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="$charlength > $framewidth">
+      <xsl:text>(</xsl:text>
+      <xsl:apply-templates select="*[2]">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+      </xsl:apply-templates>
+      <BR/> 
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+      </xsl:call-template>
+      <a>
+      <xsl:attribute name="href">
+       <xsl:value-of select="concat(string($header),string($uri))"/>
+      </xsl:attribute>
+      <xsl:text>-</xsl:text>
+      </a>
+      <xsl:apply-templates select="*[3]">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+      </xsl:apply-templates>
+      <xsl:text>)</xsl:text>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:text>(</xsl:text>
+      <xsl:apply-templates select="*[2]"/>
+      <a>
+      <xsl:attribute name="href">
+       <xsl:value-of select="concat(string($header),string($uri))"/>
+      </xsl:attribute>
+      <xsl:text>-</xsl:text>
+      </a>
+      <xsl:apply-templates select="*[3]"/>
+      <xsl:text>)</xsl:text>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+<!-- NOT -->
+
+ <xsl:template match="m:apply[m:not]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:not/@definitionURL"/>
+  </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">&#216;</FONT>
+     </a>
+     <xsl:apply-templates select="*[2]"/>
+ </xsl:template>
+
+<!-- EXISTS -->
+
+ <xsl:template match="m:apply[m:exists]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:exists/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:exists" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">&#36;</FONT>
+     </a>
+     <xsl:apply-templates select="m:bvar/m:ci"/>
+     <xsl:text>:</xsl:text>
+     <xsl:apply-templates select="m:condition">
+      <xsl:with-param name="current_indent" select="$current_indent + 2 +
+                                string-length(bvar/ci)"/> 
+     </xsl:apply-templates>
+     <BR/> 
+      <xsl:call-template name="make_indent">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+      </xsl:call-template>
+     <xsl:text>.</xsl:text>
+      <xsl:apply-templates select="*[last()]">
+       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" color="blue">&#36;</FONT>
+     </a>
+     <xsl:apply-templates select="m:bvar/m:ci"/>
+     <xsl:text>:</xsl:text>
+     <xsl:apply-templates select="m:condition"/>
+     <xsl:text>.</xsl:text>
+     <xsl:apply-templates select="*[last()]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+
+
+
+<!-- COUNTING -->
+
+<xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:neq
+   |m:lt|m:leq|m:gt|m:geq|m:plus|m:minus|m:times" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+</xsl:stylesheet> 
+
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/html_reals.xsl b/helm/style/style_prima_del_linguaggio_naturale/html_reals.xsl
new file mode 100644 (file)
index 0000000..04ff478
--- /dev/null
@@ -0,0 +1,234 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- INIT style for HTML                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- LIMIT -->
+
+<xsl:template match="m:apply[m:limit]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:limit/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:limit" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>lim</xsl:text>
+     </a>
+     <SUB>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <FONT FACE="symbol" color="blue">&#174;</FONT>
+      <xsl:apply-templates select="m:lowlimit"/>
+     </SUB>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/> 
+     </xsl:call-template>
+     <xsl:apply-templates select="*[4]">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+     </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>lim</xsl:text>
+     </a>
+     <SUB>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <FONT FACE="symbol" color="blue">&#174;</FONT>
+      <xsl:apply-templates select="m:lowlimit"/>
+     </SUB>
+     <xsl:apply-templates select="*[4]">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+     </xsl:apply-templates>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- DIFFERENTIATION -->
+
+<xsl:template match="m:apply[m:diff]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:diff/@definitionURL"/>
+  </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <SUP>d</SUP>
+      <xsl:text>/</xsl:text>
+     <SUB>
+      <xsl:text>d</xsl:text>
+      <xsl:value-of select="m:bvar/m:ci"/>
+     </SUB>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+     </xsl:apply-templates>
+ </xsl:template>
+
+<!-- ABSOLUTE VALUE -->
+<xsl:template match="m:apply[m:abs]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>|</xsl:text>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+  </xsl:apply-templates>
+  <xsl:text>|</xsl:text>
+ </xsl:template>
+
+<!-- FACTORIAL -->
+
+<xsl:template match="m:apply[m:fact]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+  </xsl:apply-templates>
+  <xsl:text>!</xsl:text>
+ </xsl:template>
+
+<!-- SQUARE ROOT -->
+
+<xsl:template match="m:apply[m:root]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>(sqr</xsl:text>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 5"/>
+  </xsl:apply-templates>
+  <xsl:text>)</xsl:text>
+ </xsl:template>
+
+<!-- POWER -->
+
+<xsl:template match="m:apply[m:power]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:power/@definitionURL"/>
+  </xsl:variable>
+  <xsl:apply-templates select="*[2]"/>
+  <SUP>
+  <xsl:apply-templates select="*[3]"/>
+  </SUP>
+ </xsl:template>
+
+<!-- MIN and MAX (binari: estendere) -->
+
+ <xsl:template match="m:apply[m:min|m:max]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="*[1]" mode="charcount"/>
+  </xsl:variable>
+  <xsl:variable name="symbol">
+   <xsl:choose>
+    <xsl:when test="m:min">
+     <xsl:value-of select="'min'"/>
+    </xsl:when>
+    <xsl:when test="m:max">
+     <xsl:value-of select="'max'"/>
+    </xsl:when>
+   </xsl:choose>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:value-of select="$symbol"/>
+     </a>
+     <xsl:text>{</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>,</xsl:text>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 5"/> 
+     </xsl:call-template>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>}</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:value-of select="$symbol"/>
+     </a>
+     <xsl:text>{</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <xsl:text>, </xsl:text>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>}</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- COUNTING -->
+
+<xsl:template match="m:abs|m:fact|m:root
+           |m:limit|m:diff|m:min|m:max" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+</xsl:stylesheet> 
+
+
+
+
+
+
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/html_set.xsl b/helm/style/style_prima_del_linguaggio_naturale/html_set.xsl
new file mode 100644 (file)
index 0000000..6c7f66b
--- /dev/null
@@ -0,0 +1,463 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- INIT style for HTML                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- IN -->
+
+ <xsl:template match="m:apply[m:in]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:in/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:in" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#206;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#206;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- NOTIN -->
+
+ <xsl:template match="m:apply[m:notin]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:notin/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:notin" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#207;</FONT>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#207;</FONT>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- SET -->
+
+ <xsl:template match="m:set">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="count(child::*) = 0">
+    <FONT FACE="symbol" color="blue">&#198;</FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="charlength">
+     <xsl:apply-templates select="." mode="charcount"/>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="name(*[1]) = 'm:bvar'">
+      <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+        <xsl:text>{</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <xsl:text>:</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:type">
+         <xsl:with-param name="current_indent" 
+           select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
+        </xsl:apply-templates><BR/>
+        <xsl:call-template name="make_indent">
+         <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+        </xsl:call-template>
+        <xsl:text>|</xsl:text>
+        <xsl:apply-templates select="m:condition">
+         <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+        </xsl:apply-templates>
+        <xsl:text>}</xsl:text>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:text>{</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <xsl:text>:</xsl:text>
+        <xsl:apply-templates select="m:bvar/m:type"/>
+        <xsl:text>|</xsl:text>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:text>}</xsl:text>
+       </xsl:otherwise>
+      </xsl:choose>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:choose>
+       <xsl:when test="$charlength > $framewidth">
+        <xsl:text>{</xsl:text>
+         <xsl:apply-templates select="*[position()=1]">
+          <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+         </xsl:apply-templates>
+         <xsl:for-each select="*[position()>1]">
+          <xsl:text>,</xsl:text>
+          <BR/>
+          <xsl:call-template name="make_indent">
+           <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+          </xsl:call-template>
+          <xsl:apply-templates select=".">
+           <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+          </xsl:apply-templates>
+         </xsl:for-each>
+         <xsl:text>}</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+        <xsl:text>{</xsl:text>
+         <xsl:for-each select="*">
+          <xsl:apply-templates select="."/>
+          <xsl:choose>
+           <xsl:when test="position() = last()">
+            <xsl:text>}</xsl:text>
+           </xsl:when>
+           <xsl:otherwise>
+            <xsl:text>,</xsl:text>
+           </xsl:otherwise>
+          </xsl:choose>
+         </xsl:for-each>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+
+<!-- INTERSECTION -->
+
+<xsl:template match="m:apply[m:intersect]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:intersect/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:intersect" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#199;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#199;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- UNION -->
+
+<xsl:template match="m:apply[m:union]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:union/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:union" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#200;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#200;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- SUBSET -->
+<xsl:template match="m:apply[m:subset]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:subset/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:subset" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#205;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#205;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- PRSUBSET -->
+<xsl:template match="m:apply[m:prsubset]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:prsubset/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:prsubset" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#204;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" SIZE="+2" color="blue">&#204;</FONT>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+
+<!-- SETDIFF -->
+
+<xsl:template match="m:apply[m:setdiff]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:setdiff/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="charlength">
+   <xsl:apply-templates select="m:setdiff" mode="charcount"/>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$charlength > $framewidth">
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <BR/> 
+     <xsl:call-template name="make_indent">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
+     </xsl:call-template>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>/</xsl:text>
+     </a>
+     <xsl:apply-templates select="*[3]">
+      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+     </xsl:apply-templates>
+     <xsl:text>)</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:text>(</xsl:text>
+     <xsl:apply-templates select="*[2]"/>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>/</xsl:text>
+     </a>
+     <xsl:apply-templates select="*[3]"/>
+     <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+   </xsl:choose>
+ </xsl:template>
+
+<!-- CARD -->
+<xsl:template match="m:apply[m:card]">
+  <xsl:param name="current_indent" select="0"/> 
+  <xsl:param name="width" select="$framewidth"/>
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:card/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>|</xsl:text>
+  <xsl:apply-templates select="*[2]">
+   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
+  </xsl:apply-templates>
+  <xsl:text>|</xsl:text>
+ </xsl:template>
+
+<!-- COUNTING -->
+
+<xsl:template match="m:in|m:notin|m:intersect|m:union
+           |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+</xsl:stylesheet> 
+
+
+
+
+
+
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/mml2mmlv1_0.xsl b/helm/style/style_prima_del_linguaggio_naturale/mml2mmlv1_0.xsl
new file mode 100644 (file)
index 0000000..67e1acc
--- /dev/null
@@ -0,0 +1,1957 @@
+<?xml version="1.0"?>
+
+<!-- ====================================================== -->
+<!-- XSL Transform of MathML content to MathML presentation -->
+<!--    By Igor Rodionov, Computer Science Department of    -->
+<!--   the University of Western Ontario, London, Canada    -->
+<!--  Complies with the W3C Working Draft from Dec.3, 1999  -->
+<!--             Version x.xx from Feb. 18, 2000            -->
+<!--              Comments to:  igor@csd.uwo.ca             -->
+<!--                                                        -->
+<!-- (C) Copyright 1999, 2000 Symbolic Computation          -->
+<!--     Laboratory, University of Western Ontario.         -->
+<!-- ====================================================== -->
+
+<!-- ====================================================== -->
+<!--  May 11, 2000 - HELM group:                            -->
+<!--  Added the namespace prefix to all the output elements -->
+<!--  Changed the mml prefix into m                         -->
+<!--  Swapped math element out of the semantic element      -->
+<!--  Added the declaration of the xlink namespace          --> 
+<!-- ====================================================== -->
+
+<xsl:stylesheet id="mml2mml"
+                version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:m="http://www.w3.org/1998/Math/MathML"
+                xmlns:xlink="http://www.w3.org/1999/xlink"
+                xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:output method="xml" indent="yes" encoding="iso-8859-1"/>
+
+<!-- ***************************************************** -->
+<!--  Parameters affectin' stylesheet's run-time behavior  -->
+<!-- ***************************************************** -->
+
+<!-- SEM_SW: -1 - strip off all semantics
+             0  - pass semantics "as is" (default)
+             1  - add semantics at top level only
+             2  - add semantics at all levels
+             3  - semantics at top level with cross-references
+-->
+<!-- HELM: SEM_SW was 0 -->
+<xsl:param name="SEM_SW" select="1"/>
+
+<!-- Miscellaneous Variable Definitions -->
+
+<xsl:variable name="NO" select="0"/>
+<xsl:variable name="YES" select="1"/>
+<xsl:variable name="PAR_NO" select="-7"/>
+<xsl:variable name="PAR_YES" select="-5"/>
+<xsl:variable name="PAR_SAME" select="-3"/>
+<xsl:variable name="NO_PARAM" select="-1"/>
+
+<!-- Operator Precedence Definitions -->
+
+<xsl:variable name="NO_PREC" select="0"/>
+<xsl:variable name="UNION_PREC" select="1"/>
+<xsl:variable name="SETDIFF_PREC" select="1"/>
+<xsl:variable name="INTERSECT_PREC" select="3"/>
+<xsl:variable name="OR_PREC" select="5"/>
+<xsl:variable name="XOR_PREC" select="5"/>
+<xsl:variable name="AND_PREC" select="7"/>
+<xsl:variable name="PLUS_PREC" select="9"/>
+<xsl:variable name="MINUS_PREC" select="9"/>
+<xsl:variable name="MUL_PREC" select="11"/>
+<xsl:variable name="DIV_PREC" select="11"/>
+<xsl:variable name="NEG_PREC" select="13"/>
+<xsl:variable name="FUNCTION_PREC" select="99"/>
+
+<!-- AUXILIARY FUNCTIONS FOR BACKWARD POINTERS AND REFS (by andrea) -->
+
+<xsl:template name = "insert_xref">
+ <xsl:if test="@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template name = "insert">
+ <xsl:if test="@definitionURL">
+  <xsl:attribute name="xlink:href">
+   <xsl:value-of select="@definitionURL"/>
+  </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<!-- for use inside m:apply -->
+<xsl:template name = "insert1">
+ <xsl:if test="*[1]/@definitionURL">
+  <xsl:attribute name="xlink:href">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="*[1]/@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="*[1]/@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<!-- For use inside "for-each" -->
+<xsl:template name = "insert2">
+ <xsl:if test="../*[1]/@definitionURL">
+  <xsl:attribute name="xlink:href">
+   <xsl:value-of select="../*[1]/@definitionURL"/>
+  </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="../*[1]/@helm:xref">
+  <xsl:attribute name="helm:xref">
+   <xsl:value-of select="../*[1]/@helm:xref"/>
+  </xsl:attribute>
+ </xsl:if>
+</xsl:template>
+
+<!-- THE TOPMOST ELEMENT: MATH -->
+
+<xsl:template match = "m:math">
+  <xsl:choose>
+    <xsl:when test="$SEM_SW>0">
+<!-- HELM: deleted math (we have already inserted at object level) -->
+     <!--<m:math>-->
+      <m:semantics>
+          <xsl:apply-templates mode = "semantics"/>
+       <m:annotation-xml encoding="MathML">
+          <xsl:copy-of select = "*"/>
+       </m:annotation-xml>
+      </m:semantics>
+     <!--</m:math>-->
+    </xsl:when>
+    <xsl:otherwise>
+      <!--<m:math>-->
+        <xsl:apply-templates mode = "semantics"/>
+      <!--</m:math>-->  
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- SEMANTICS -->
+
+<xsl:template match = "m:*" mode = "semantics">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$SEM_SW=-1 and self::m:semantics">
+      <xsl:apply-templates select="*[1]">
+        <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=0 and self::m:semantics">
+      <m:semantics>
+        <xsl:apply-templates select="*[1]">
+          <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+        <xsl:copy-of select="m:annotation-xml"/>
+      </m:semantics>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=2">
+      <m:semantics>
+        <xsl:choose>
+          <xsl:when test="self::m:semantics">
+            <xsl:apply-templates select="*[1]">
+              <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+              <xsl:with-param name="PARAM" select="$PARAM"/>
+              <xsl:with-param name="PAREN" select="$PAREN"/>
+              <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+            </xsl:apply-templates>
+            <xsl:copy-of select="m:annotation-xml"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select=".">
+              <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+              <xsl:with-param name="PARAM" select="$PARAM"/>
+              <xsl:with-param name="PAREN" select="$PAREN"/>
+              <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+            </xsl:apply-templates>
+            <m:annotation-xml encoding="MathML">
+              <xsl:copy-of select="."/>
+            </m:annotation-xml>
+          </xsl:otherwise>
+        </xsl:choose>
+      </m:semantics>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=3 and @id">
+      <m:mrow idref="{@id}">
+        <xsl:apply-templates select=".">
+          <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select=".">
+        <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:semantics">
+  <xsl:apply-templates select="*[1]" mode = "semantics"/>
+</xsl:template>
+
+
+<!-- BASIC ELEMENTS -->
+
+<xsl:template match = "m:cn">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test=". &lt; 0 and $IN_PREC &gt; 0 and $PAREN=$PAR_NO and $PAR_NO_IGNORE=$NO">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="cn"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="cn"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:cn" mode="cn">
+  <xsl:choose>
+    <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
+      <m:msub>
+        <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
+      <m:mfenced separators="">
+        <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+        <xsl:if test="text()[2] &lt; 0">
+          <m:mo>-</m:mo>
+          <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
+        </xsl:if>
+        <xsl:if test="not(text()[2] &lt; 0)">
+          <m:mo>+</m:mo>
+          <xsl:apply-templates select="text()[2]" mode = "semantics"/>
+        </xsl:if>
+        <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+        <m:mo>i</m:mo>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@type='complex' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mfenced separators="">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <xsl:if test="text()[2] &lt; 0">
+            <m:mo>-</m:mo>
+            <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
+          </xsl:if>
+          <xsl:if test="not(text()[2] &lt; 0)">
+            <m:mo>+</m:mo>
+            <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+          </xsl:if>
+          <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+          <m:mo>i</m:mo>
+        </m:mfenced>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
+      <m:mrow>
+        <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+        <m:mo>/</m:mo>
+        <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+      </m:mrow>
+    </xsl:when>
+    <xsl:when test="@type='rational' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mfenced separators="">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <m:mo>/</m:mo>
+          <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+        </m:mfenced>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
+      <m:mrow>
+        <m:mo>Polar</m:mo>
+        <m:mfenced separators=",">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+        </m:mfenced>
+      </m:mrow>
+    </xsl:when>
+    <xsl:when test="@type='polar' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mrow>
+          <m:mo>Polar</m:mo>
+          <m:mfenced separators=",">
+            <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+            <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+          </m:mfenced>
+        </m:mrow>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+   </xsl:when>
+    <xsl:otherwise>
+      <m:mn> 
+       <xsl:call-template name="insert"/>
+       <xsl:apply-templates mode = "semantics"/> 
+      </m:mn>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:ci">
+  <xsl:choose>
+    <xsl:when test="@type='vector' or @type=matrix or @type=set">
+      <m:mi fontweight="bold"> <xsl:apply-templates mode = "semantics"/> </m:mi>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:mi> 
+      <xsl:call-template name="insert"/>
+      <xsl:apply-templates mode = "semantics"/> 
+     </m:mi>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:csymbol">
+  <xsl:choose>
+    <xsl:when test="*[1]">
+      <xsl:copy-of select = "*"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- BASIC CONTENT ELEMENTS -->
+
+<xsl:template match = "m:apply[m:fn[1]]">
+  <m:mrow>
+    <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:fn">
+  <xsl:apply-templates select = "*[1]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:interval">
+  <xsl:choose>
+    <xsl:when test="@closure='closed'">
+      <m:mfenced open="[" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='open'">
+      <m:mfenced separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='open-closed'">
+      <m:mfenced open="(" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='closed-open'">
+      <m:mfenced open="[" close=")" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mfenced open="[" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+ </m:mrow>
+</xsl:template>
+
+<!-- These "semantical" Transformations are REALLY questionable.
+     Andrea -->
+
+<xsl:template match = "m:apply[*[1][self::m:inverse]]">
+  <xsl:choose>
+    <xsl:when test="*[2]=m:exp">
+      <m:mo>ln</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:ln | m:log">
+      <m:mo>exp</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sin">
+      <m:mo>arcsin</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cos">
+      <m:mo>arccos</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:tan">
+      <m:mo>arctan</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sec">
+      <m:mo>arcsec</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:csc">
+      <m:mo>arccsc</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cot">
+      <m:mo>arccot</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sinh">
+      <m:mo>arcsinh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cosh">
+      <m:mo>arccosh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:tanh">
+      <m:mo>arctanh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sech">
+      <m:mo>arcsech</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:csch">
+      <m:mo>arccsch</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:coth">
+      <m:mo>arccoth</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arcsin">
+      <m:mo>sin</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arccos">
+      <m:mo>cos</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arctan">
+      <m:mo>tan</m:mo>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:msup>
+        <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+        <m:mfenced>
+          <m:mn>-1</m:mn>
+        </m:mfenced>
+      </m:msup>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:sep"/>
+
+<xsl:template match = "m:condition">
+  <xsl:choose>
+    <xsl:when test="parent::m:apply[m:forall[1]]"/>
+    <xsl:otherwise>
+      <xsl:if test="not(*[2])">
+        <xsl:apply-templates mode = "semantics"/>
+      </xsl:if>
+      <xsl:if test="*[2]">
+        <m:mrow>
+          <xsl:apply-templates mode = "semantics"/>
+        </m:mrow>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:declare"/>
+
+<xsl:template match = "m:lambda">
+  <m:mrow>
+    <m:mo> &#x039b; </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*">
+        <xsl:choose>
+          <xsl:when test="self::m:ci or self::m:cn">
+            <xsl:apply-templates select = "." mode="semantics"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <m:mrow>
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </m:mrow>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:*[1][self::m:apply[m:compose[1]]]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+ </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:compose]]">
+  <m:mfenced separators="">
+    <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] | self::m:fn]" mode="semantics"/>
+    <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] | self::m:fn]">
+      <m:mo> <xsl:call-template name="insert2"/> <mchar name="SmallCircle"/> </m:mo>
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:ident">
+  <m:mo>id</m:mo>
+</xsl:template>
+
+
+<!-- ARITHMETIC, ALGEBRA & LOGIC -->
+
+<xsl:template match = "m:apply[m:quotient[1]]">
+  <m:mfenced open="&#x230a;" close="&#x230b;" separators="">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+    <m:mo><xsl:call-template name="insert1"/>/</m:mo>
+    <xsl:apply-templates select="*[3]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:exp]]">
+  <m:msup>
+    <m:mo>e</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:msup>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:factorial[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+    <m:mo><xsl:call-template name="insert1"/>!</m:mo>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:max[1] | m:min[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[2]=m:bvar">
+      <m:munder>
+        <xsl:if test="*[1]=m:max">
+          <m:mo><xsl:call-template name="insert1"/>max</m:mo>
+        </xsl:if>
+        <xsl:if test="*[1]=m:min">
+          <m:mo>min</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:munder>
+      <xsl:if test="*[3]=m:condition">
+        <m:mfenced open="{{" close="}}" separators="">
+          <m:mfenced open="" close="" separators=",">
+            <xsl:for-each select = "*[position()>3]">
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </xsl:for-each>
+          </m:mfenced>
+          <m:mo>|</m:mo>
+          <xsl:apply-templates select="*[3]" mode = "semantics"/>
+        </m:mfenced>
+      </xsl:if>
+      <xsl:if test="not(*[3]=m:condition)">
+        <m:mfenced open="{{" close="}}" separators=",">
+          <xsl:for-each select = "*[position()>2]">
+            <xsl:apply-templates select = "." mode="semantics"/>
+          </xsl:for-each>
+        </m:mfenced>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="*[2]=m:condition">
+      <xsl:if test="*[1]=m:max">
+        <m:mo>max</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:min">
+        <m:mo>min</m:mo>
+      </xsl:if>
+      <m:mfenced open="{{" close="}}" separators="">
+        <xsl:if test="*[3]">
+          <m:mfenced open="" close="" separators=",">
+            <xsl:for-each select = "*[position()>2]">
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </xsl:for-each>
+          </m:mfenced>
+          <m:mo>|</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:mfenced>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
+      <xsl:if test="*[1]=m:max">
+        <m:mo>max</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:min">
+        <m:mo><xsl:call-template name="insert1"/>min</m:mo>
+      </xsl:if>
+      <m:mfenced open="{{" close="}}" separators=",">
+        <xsl:for-each select = "*[position()>1]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:minus[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $MINUS_PREC or $IN_PREC=$MINUS_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="minus">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="minus">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="minus">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:minus[1]]" mode="minus">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:if test="not(*[3])">
+    <m:mo><xsl:call-template name="insert1"/>-</m:mo>
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:if>
+  <xsl:if test="*[3]">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+    </xsl:apply-templates>
+    <m:mo><xsl:call-template name="insert1"/>-</m:mo>
+    <xsl:apply-templates select="*[3]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:plus[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $PLUS_PREC or $IN_PREC=$PLUS_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="plus">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="plus">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="plus">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:plus[1]]" mode="plus">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:if test="*[2]">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+    </xsl:apply-templates>
+    <xsl:for-each select = "*[position()>2]">
+      <xsl:choose>
+        <xsl:when test=". &lt; 0">
+          <m:mo>-</m:mo>
+          <m:mn> <xsl:value-of select="-."/> </m:mn>
+        </xsl:when>
+        <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
+          <xsl:apply-templates select="." mode = "semantics">
+            <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+            <xsl:with-param name="PAREN" select="$PAREN"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <m:mo><xsl:call-template name="insert2"/>+</m:mo>
+          <xsl:apply-templates select="." mode = "semantics">
+            <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+            <xsl:with-param name="PAREN" select="$PAREN"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:power[1]]">
+  <xsl:choose>
+    <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] | m:gcd[1] | m:sin[1] | m:cos[1] | m:tan[1] | m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] | m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] | m:coth[1] | m:arcsin[1] | m:arccos[1] | m:arctan[1]]">
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:msup>
+        <xsl:apply-templates select = "*[2]" mode = "semantics">
+          <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+        </xsl:apply-templates>
+        <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $DIV_PREC or $IN_PREC=$DIV_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="remdiv">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="remdiv">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="remdiv">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:if test="m:rem">
+    <m:mo><xsl:call-template name="insert1"/>%</m:mo>
+  </xsl:if>
+  <xsl:if test="m:divide">
+    <m:mo><xsl:call-template name="insert1"/>/</m:mo>
+  </xsl:if>
+  <xsl:apply-templates select = "*[3]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
+    <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:times[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $MUL_PREC or $IN_PREC=$MUL_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="times">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="times">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+         <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="times">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:times[1]]" mode="times">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:if test="*[3]">
+    <xsl:for-each select = "*[position()>2]">
+<!-- MODIFICA PROVVISORIA -->
+<!--      <m:mo><xsl:call-template name="insert2"/>
+                <mchar name="InvisibleTimes"/> </m:mo> -->
+      <m:mo><xsl:call-template name="insert2"/>*</m:mo>
+      <xsl:apply-templates select="." mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+      </xsl:apply-templates>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+
+<!-- COMMENTO : dove metto la uri della definizione di radice ???? -->
+
+<xsl:template match = "m:apply[m:root[1]]">
+  <m:msqrt>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[2]=m:degree">
+      <xsl:apply-templates select="*[3]" mode = "semantics"/>
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:degree)">
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      <m:mn>2</m:mn>
+    </xsl:if>
+  </m:msqrt>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:gcd[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="not(parent::m:apply[m:power[1]])">
+      <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
+    </xsl:if>
+    <xsl:if test="parent::m:apply[m:power[1]]">
+      <m:msup>
+        <m:mo><xsl:call-template name="insert1"/>gcd</m:mo>
+        <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:and[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $AND_PREC">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="and">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="and">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="and">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:and[1]]" mode="and">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="wedge"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:or[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $OR_PREC">
+      <m:mfenced separators="">
+         <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="or">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="or">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="or">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:or[1]]" mode="or">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="vee"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:xor[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $XOR_PREC">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="xor">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="xor">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="xor">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:xor[1]]" mode="xor">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="xor"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:not[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>not</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:forall[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>for all</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "m:bvar">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+    <xsl:if test="m:condition">
+      <m:mo>:</m:mo>
+      <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
+      <m:mo>,</m:mo>
+    </xsl:if>
+    <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:exists[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/> <mchar name="Exists"/> </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "m:bvar">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+    <xsl:if test="m:condition">
+      <m:mo>,</m:mo>
+      <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
+    </xsl:if>
+    <m:mo>:</m:mo>
+    <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:abs[1]]">
+  <xsl:if test="not(parent::m:apply[m:power[1]])">
+    <m:mfenced open="|" close="|" separators="">
+      <xsl:call-template name="insert_xref"/>
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+  </xsl:if>
+  <xsl:if test="parent::m:apply[m:power[1]]">
+    <m:msup>
+      <m:mfenced open="|" close="|" separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+      </m:mfenced>
+      <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+    </m:msup>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:conjugate[1]]">
+  <m:mover>
+    <m:mrow>
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mrow>
+    <m:mo><xsl:call-template name="insert1"/> <mchar name="UnderBar"/> </m:mo>
+  </m:mover>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="m:arg">
+        <m:mo><xsl:call-template name="insert1"/>arg</m:mo>
+      </xsl:when>
+      <xsl:when test="m:real">
+        <m:mo><xsl:call-template name="insert1"/>Real</m:mo>
+      </xsl:when>
+      <xsl:when test="m:imaginary">
+        <m:mo><xsl:call-template name="insert1"/>Imaginary</m:mo>
+      </xsl:when>
+    </xsl:choose>
+    <m:mfenced separators="">
+      <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- RELATIONS -->
+
+<xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies | m:in | m:notin | m:notsubset | m:notprsubset | m:subset | m:prsubset | m:eq | m:gt | m:lt | m:geq | m:leq | m:equivalent]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:tendsto or *[1]=m:implies or *[1]=m:in or *[1]=m:notin or *[1]=m:notsubset or *[1]=m:notprsubset">
+      <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+      <xsl:if test="*[1]=m:neq">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="NotEqual"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:approx">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="approxeq"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:tendsto">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="RightArrow"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:implies">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="DoubleRightArrow"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:in">
+        <m:mo><xsl:call-template name="insert1"/>
+        <mchar name="Element"/> 
+       </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notin">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="NotElement"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notsubset">
+        <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubset"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notprsubset">
+        <m:mo> <xsl:call-template name="insert1"/> <mchar name="NotSubsetEqual"/> </m:mo>
+      </xsl:if>
+      <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+      <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
+        <m:mo><xsl:call-template name="insert1"/>-</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
+        <m:mo><xsl:call-template name="insert1"/>+</m:mo>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
+      <xsl:apply-templates select = "*[2]" mode="semantics"/>
+      <xsl:for-each select = "*[position()>2]">
+        <xsl:if test="../*[self::m:subset][1]">
+          <m:mo> <xsl:call-template name="insert2"/> <mchar name="SubsetEqual"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:prsubset][1]">
+          <m:mo> <xsl:call-template name="insert2"/><mchar name="subset"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:eq][1]">
+          <m:mo><xsl:call-template name="insert2"/>=</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:gt][1]">
+          <m:mo><xsl:call-template name="insert2"/>&gt;</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:lt][1]">
+          <m:mo><xsl:call-template name="insert2"/>&lt;</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:geq][1]">
+          <m:mo><xsl:call-template name="insert2"/> <mchar name="geq"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:leq][1]">
+          <m:mo><xsl:call-template name="insert2"/> <mchar name="leq"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:equivalent][1]">
+          <m:mo><xsl:call-template name="insert2"/> <mchar name="Congruent"/> </m:mo>
+        </xsl:if>
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- CALCULUS -->
+
+<xsl:template match = "m:apply[*[1][self::m:ln]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="parent::m:apply[m:power[1]]">
+        <m:msup>
+          <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
+          <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+        </m:msup>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mo><xsl:call-template name="insert1"/>ln</m:mo>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:log[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="parent::m:apply[m:power[1]]">
+        <xsl:if test="not(*[2]=m:logbase)">
+          <m:msup>
+            <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+            <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+          </m:msup>
+        </xsl:if>
+        <xsl:if test="*[2]=m:logbase">
+          <m:msubsup>
+            <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+            <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+            <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
+          </m:msubsup>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:if test="not(*[2]=m:logbase)">
+          <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+        </xsl:if>
+        <xsl:if test="*[2]=m:logbase">
+          <m:msub>
+            <m:mo><xsl:call-template name="insert1"/>log</m:mo>
+            <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
+          </m:msub>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="*[2]=m:logbase">
+      <xsl:apply-templates select = "*[3]" mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      </xsl:apply-templates>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:logbase)">
+      <xsl:apply-templates select = "*[2]" mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:diff[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
+      <m:mfrac><xsl:call-template name="insert1"/>
+        <m:msup>
+          <m:mo>d</m:mo>
+          <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
+        </m:msup>
+        <m:mrow>
+          <m:mo>d</m:mo>
+          <m:msup>
+            <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
+            <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
+          </m:msup>
+        </m:mrow>
+      </m:mfrac>
+    </xsl:if>
+    <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
+      <m:mfrac><xsl:call-template name="insert1"/>
+        <m:mo>d</m:mo>
+        <m:mrow>
+          <m:mo>d</m:mo>
+          <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
+        </m:mrow>
+      </m:mfrac>
+    </xsl:if>
+    <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:partialdiff[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:for-each select = "m:bvar">
+      <xsl:if test="*[last()]=m:degree">
+        <m:mfrac><xsl:call-template name="insert1"/>
+          <m:msup>
+             <m:mo>d</m:mo>
+             <xsl:apply-templates select = "m:degree" mode = "semantics"/>
+          </m:msup>
+          <m:mrow>
+            <m:mo>d</m:mo>
+            <m:msup>
+              <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+              <xsl:apply-templates select = "m:degree" mode = "semantics"/>
+            </m:msup>
+          </m:mrow>
+        </m:mfrac>
+      </xsl:if>
+      <xsl:if test="not(*[last()]=m:degree)">
+        <m:mfrac><xsl:call-template name="insert1"/>
+          <m:mo>d</m:mo>
+          <m:mrow>
+            <m:mo>d</m:mo>
+            <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+          </m:mrow>
+        </m:mfrac>
+      </xsl:if>
+    </xsl:for-each>
+    <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
+  <xsl:apply-templates mode = "semantics"/>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[1]=m:divergence">
+      <m:mo><xsl:call-template name="insert1"/>div</m:mo>
+    </xsl:if>
+    <xsl:if test="*[1]=m:grad">
+    <m:mo><xsl:call-template name="insert1"/>grad</m:mo>
+    </xsl:if>
+    <xsl:if test="*[1]=m:curl">
+    <m:mo><xsl:call-template name="insert1"/>curl</m:mo>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="*[2]=m:ci">
+        <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mfenced separators="">
+          <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+        </m:mfenced>
+      </xsl:otherwise>
+    </xsl:choose>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:laplacian[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:msup><xsl:call-template name="insert1"/>
+      <m:mo> &#x0394; </m:mo>
+      <m:mn>2</m:mn>
+    </m:msup>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- SET THEORY -->
+
+<xsl:template match = "m:set | m:list">
+  <m:mfenced open="{{" close="}}" separators="">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
+      <xsl:apply-templates select="m:bvar" mode = "semantics"/>
+      <m:mo>|</m:mo>
+      <xsl:apply-templates select="m:condition" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
+      <m:mfenced open="" close="" separators=",">
+        <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+      <m:mo>|</m:mo>
+      <xsl:apply-templates select="m:condition" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
+      <m:mfenced open="" close="" separators=",">
+        <xsl:for-each select = "*">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+    </xsl:if>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:union[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $UNION_PREC or $IN_PREC=$UNION_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="" helm:xref="{@helm:xref}">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="union">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="union">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="union">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:union[1]]" mode="union">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode="semantics">
+    <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="Union"/> </m:mo>
+    <xsl:apply-templates select = "." mode="semantics">
+      <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:intersect[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $INTERSECT_PREC">
+      <m:mfenced separators="" helm:xref="{@helm:xref}">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="intersect">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="intersect">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="intersect">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode="semantics">
+    <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo><xsl:call-template name="insert2"/> <mchar name="Intersection"/> </m:mo>
+    <xsl:apply-templates select = "." mode="semantics">
+      <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:setdiff[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="setdiff">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="setdiff">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:call-template name="insert_xref"/>
+        <xsl:apply-templates select="." mode="setdiff">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <m:mo><xsl:call-template name="insert1"/>\</m:mo>
+  <xsl:apply-templates select = "*[3]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
+    <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:card[1]]">
+  <m:mfenced open="|" close="|" separators=",">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:for-each select = "*[position()>1]">
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+
+<!-- SEQUENCES AND SERIES -->
+
+<xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:choose>
+      <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
+        <m:munderover>
+          <xsl:if test="*[1]=m:sum">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
+          </xsl:if>
+          <xsl:if test="*[1]=m:product">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
+          </xsl:if>
+          <m:mrow>
+            <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+            <m:mo>=</m:mo>
+            <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
+          </m:mrow>
+          <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
+        </m:munderover>
+        <xsl:apply-templates select = "*[5]" mode = "semantics"/>
+      </xsl:when>
+      <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
+        <m:munder>
+          <xsl:if test="*[1]=m:sum">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Sum"/> </m:mo>
+          </xsl:if>
+          <xsl:if test="*[1]=m:product">
+            <m:mo><xsl:call-template name="insert1"/> <mchar name="Product"/> </m:mo>
+          </xsl:if>
+          <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </m:munder>
+        <xsl:apply-templates select = "*[4]" mode = "semantics"/>
+      </xsl:when>
+    </xsl:choose>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:limit[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:munder>
+      <m:mo><xsl:call-template name="insert1"/>lim</m:mo>
+      <m:mrow>
+        <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
+            <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+            <m:mo> <mchar name="RightArrow"/> </m:mo>
+            <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </xsl:if>
+        <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
+          <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </xsl:if>
+      </m:mrow>
+    </m:munder>
+    <xsl:apply-templates select = "*[4]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- TRIGONOMETRY -->
+
+<xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos | self::m:tan | self::m:sec | self::m:csc | self::m:cot | self::m:sinh | self::m:cosh | self::m:tanh | self::m:sech | self::m:csch | self::m:coth | self::m:arcsin | self::m:arccos | self::m:arctan]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:if test="not(parent::m:apply[m:power[1]])">
+      <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
+    </xsl:if>
+    <xsl:if test="parent::m:apply[m:power[1]]">
+      <m:msup>
+        <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
+        <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:*" mode = "trigonometry">
+    <xsl:choose>
+      <xsl:when test="self::m:sin">
+        <m:mo>sin</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cos">
+        <m:mo>cos</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:tan">
+        <m:mo>tan</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sec">
+        <m:mo>sec</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:csc">
+        <m:mo>csc</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cot">
+        <m:mo>cot</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sinh">
+        <m:mo>sinh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cosh">
+        <m:mo>cosh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:tanh">
+        <m:mo>tanh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sech">
+        <m:mo>sech</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:csch">
+        <m:mo>csch</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:coth">
+        <m:mo>coth</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arcsin">
+        <m:mo>arcsin</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arccos">
+        <m:mo>arccos</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arctan">
+        <m:mo>arctan</m:mo>
+      </xsl:when>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- STATISTICS -->
+
+<xsl:template match = "m:apply[m:mean[1]]">
+  <m:mfenced open="&lt;" close="&gt;" separators=",">
+    <xsl:call-template name="insert_xref"/>
+    <xsl:for-each select = "*[position()>1]">
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:sdev[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/> &#x03c3; </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:variance[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/> &#x03c3; </m:mo>
+    <m:msup>
+      <m:mfenced separators=",">
+        <xsl:for-each select = "*[position()>1]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+      <m:mn>2</m:mn>
+    </m:msup>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:median[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>median</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:mode[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>mode</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:moment[1]]">
+  <xsl:call-template name="insert_xref"/>
+  <m:mfenced open="&lt;" close="&gt;" separators="">
+    <xsl:if test="*[2]=m:degree">
+      <m:msup>
+        <xsl:apply-templates select="*[3]" mode = "semantics"/>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:degree)">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </xsl:if>
+  </m:mfenced>
+</xsl:template>
+
+
+<!-- LINEAR ALGEBRA -->
+
+<xsl:template match="m:vector">
+  <m:mfenced separators="">
+    <m:mtable>
+      <xsl:for-each select="*">
+        <m:mtd>
+          <xsl:apply-templates select="." mode = "semantics"/>
+        </m:mtd>
+      </xsl:for-each>
+    </m:mtable>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:matrix">
+  <m:mfenced separators="">
+    <m:mtable>
+      <xsl:apply-templates mode = "semantics"/>
+    </m:mtable>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:matrixrow">
+  <m:mtr>
+    <xsl:for-each select="*">
+      <m:mtd>
+        <xsl:apply-templates select="." mode = "semantics"/>
+      </m:mtd>
+    </xsl:for-each>
+  </m:mtr>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:determinant[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <m:mo><xsl:call-template name="insert1"/>det</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:transpose[1]]">
+  <m:msup>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+    <m:mo>T</m:mo>
+  </m:msup>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:selector[1]]">
+  <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
+      <xsl:variable name="m" select = "*[3]"/>
+      <xsl:choose>
+        <xsl:when test="*[4]=m:cn">
+          <xsl:variable name="n" select = "*[4]"/>
+          <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
+        </xsl:otherwise>
+      </xsl:choose>
+  </xsl:if>
+  <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
+    <xsl:variable name="m" select = "*[3]"/>
+    <xsl:copy-of select = "*[2]/*[position()=$m]"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:vectorproduct[1] | m:scalarproduct[1] | m:outerproduct[1]]">
+  <m:mrow>
+    <xsl:call-template name="insert_xref"/>
+    <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    <xsl:choose>
+      <xsl:when test="m:vectorproduct[1]">
+        <m:mo><xsl:call-template name="insert1"/> <mchar name="Cross"/> </m:mo>
+      </xsl:when>
+      <xsl:when test="m:scalarproduct[1] | m:outerproduct[1]">
+        <m:mo><xsl:call-template name="insert1"/>.</m:mo>
+      </xsl:when>
+    </xsl:choose>
+    <xsl:apply-templates select="*[3]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/mml2mmlv1_0_original.xsl b/helm/style/style_prima_del_linguaggio_naturale/mml2mmlv1_0_original.xsl
new file mode 100644 (file)
index 0000000..44c34df
--- /dev/null
@@ -0,0 +1,1848 @@
+<?xml version="1.0"?>
+
+<!-- ====================================================== -->
+<!-- XSL Transform of MathML content to MathML presentation -->
+<!--    By Igor Rodionov, Computer Science Department of    -->
+<!--   the University of Western Ontario, London, Canada    -->
+<!--  Complies with the W3C Working Draft from Dec.3, 1999  -->
+<!--             Version x.xx from Feb. 18, 2000            -->
+<!--              Comments to:  igor@csd.uwo.ca             -->
+<!--                                                        -->
+<!-- (C) Copyright 1999, 2000 Symbolic Computation          -->
+<!--     Laboratory, University of Western Ontario.         -->
+<!-- ====================================================== -->
+
+<!-- ====================================================== -->
+<!--  May 11, 2000 - HELM group:                            -->
+<!--  Added the namespace prefix to all the output elements -->
+<!--  Changed the mml prefix into m                         -->
+<!--  Swapped math element out of the semantic element      -->
+<!--  Added the declaration of the xlink namespace          --> 
+<!-- ====================================================== -->
+
+<xsl:stylesheet id="mml2mml"
+                version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:m="http://www.w3.org/1998/Math/MathML"
+                xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<xsl:output method="xml" indent="yes" encoding="iso-8859-1"/>
+
+<!-- ***************************************************** -->
+<!--  Parameters affectin' stylesheet's run-time behavior  -->
+<!-- ***************************************************** -->
+
+<!-- SEM_SW: -1 - strip off all semantics
+             0  - pass semantics "as is" (default)
+             1  - add semantics at top level only
+             2  - add semantics at all levels
+             3  - semantics at top level with cross-references
+-->
+<!-- HELM: SEM_SW was 0 -->
+<xsl:param name="SEM_SW" select="1"/>
+
+<!-- Miscellaneous Variable Definitions -->
+
+<xsl:variable name="NO" select="0"/>
+<xsl:variable name="YES" select="1"/>
+<xsl:variable name="PAR_NO" select="-7"/>
+<xsl:variable name="PAR_YES" select="-5"/>
+<xsl:variable name="PAR_SAME" select="-3"/>
+<xsl:variable name="NO_PARAM" select="-1"/>
+
+<!-- Operator Precedence Definitions -->
+
+<xsl:variable name="NO_PREC" select="0"/>
+<xsl:variable name="UNION_PREC" select="1"/>
+<xsl:variable name="SETDIFF_PREC" select="1"/>
+<xsl:variable name="INTERSECT_PREC" select="3"/>
+<xsl:variable name="OR_PREC" select="5"/>
+<xsl:variable name="XOR_PREC" select="5"/>
+<xsl:variable name="AND_PREC" select="7"/>
+<xsl:variable name="PLUS_PREC" select="9"/>
+<xsl:variable name="MINUS_PREC" select="9"/>
+<xsl:variable name="MUL_PREC" select="11"/>
+<xsl:variable name="DIV_PREC" select="11"/>
+<xsl:variable name="NEG_PREC" select="13"/>
+<xsl:variable name="FUNCTION_PREC" select="99"/>
+
+
+<!-- THE TOPMOST ELEMENT: MATH -->
+
+<xsl:template match = "m:math">
+  <xsl:choose>
+    <xsl:when test="$SEM_SW>0">
+<!-- HELM: deleted math (we have already inserted at object level) -->
+     <!--<m:math>-->
+      <m:semantics>
+          <xsl:apply-templates mode = "semantics"/>
+       <m:annotation-xml encoding="MathML">
+          <xsl:copy-of select = "*"/>
+       </m:annotation-xml>
+      </m:semantics>
+     <!--</m:math>-->
+    </xsl:when>
+    <xsl:otherwise>
+      <!--<m:math>-->
+        <xsl:apply-templates mode = "semantics"/>
+      <!--</m:math>-->  
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- SEMANTICS -->
+
+<xsl:template match = "m:*" mode = "semantics">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$SEM_SW=-1 and self::m:semantics">
+      <xsl:apply-templates select="*[1]">
+        <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=0 and self::m:semantics">
+      <m:semantics>
+        <xsl:apply-templates select="*[1]">
+          <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+        <xsl:copy-of select="m:annotation-xml"/>
+      </m:semantics>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=2">
+      <m:semantics>
+        <xsl:choose>
+          <xsl:when test="self::m:semantics">
+            <xsl:apply-templates select="*[1]">
+              <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+              <xsl:with-param name="PARAM" select="$PARAM"/>
+              <xsl:with-param name="PAREN" select="$PAREN"/>
+              <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+            </xsl:apply-templates>
+            <xsl:copy-of select="m:annotation-xml"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select=".">
+              <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+              <xsl:with-param name="PARAM" select="$PARAM"/>
+              <xsl:with-param name="PAREN" select="$PAREN"/>
+              <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+            </xsl:apply-templates>
+            <m:annotation-xml encoding="MathML">
+              <xsl:copy-of select="."/>
+            </m:annotation-xml>
+          </xsl:otherwise>
+        </xsl:choose>
+      </m:semantics>
+    </xsl:when>
+    <xsl:when test="$SEM_SW=3 and @id">
+      <m:mrow idref="{@id}">
+        <xsl:apply-templates select=".">
+          <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select=".">
+        <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:semantics">
+  <xsl:apply-templates select="*[1]" mode = "semantics"/>
+</xsl:template>
+
+
+<!-- BASIC ELEMENTS -->
+
+<xsl:template match = "m:cn">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test=". &lt; 0 and $IN_PREC &gt; 0 and $PAREN=$PAR_NO and $PAR_NO_IGNORE=$NO">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="cn"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="." mode="cn"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:cn" mode="cn">
+  <xsl:choose>
+    <xsl:when test="@base and (not(@type) or @type='integer' or @type='real')">
+      <m:msub>
+        <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='complex' and not(@base) and child::m:sep[1]">
+      <m:mfenced separators="">
+        <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+        <xsl:if test="text()[2] &lt; 0">
+          <m:mo>-</m:mo>
+          <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
+        </xsl:if>
+        <xsl:if test="not(text()[2] &lt; 0)">
+          <m:mo>+</m:mo>
+          <xsl:apply-templates select="text()[2]" mode = "semantics"/>
+        </xsl:if>
+        <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+        <m:mo>i</m:mo>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@type='complex' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mfenced separators="">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <xsl:if test="text()[2] &lt; 0">
+            <m:mo>-</m:mo>
+            <m:mn> <xsl:value-of select="-text()[2]"/> </m:mn>
+          </xsl:if>
+          <xsl:if test="not(text()[2] &lt; 0)">
+            <m:mo>+</m:mo>
+            <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+          </xsl:if>
+          <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+          <m:mo>i</m:mo>
+        </m:mfenced>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='rational' and not(@base) and child::m:sep[1]">
+      <m:mrow>
+        <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+        <m:mo>/</m:mo>
+        <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+      </m:mrow>
+    </xsl:when>
+    <xsl:when test="@type='rational' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mfenced separators="">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <m:mo>/</m:mo>
+          <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+        </m:mfenced>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+    </xsl:when>
+    <xsl:when test="@type='polar' and not(@base) and child::m:sep[1]">
+      <m:mrow>
+        <m:mo>Polar</m:mo>
+        <m:mfenced separators=",">
+          <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+          <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+        </m:mfenced>
+      </m:mrow>
+    </xsl:when>
+    <xsl:when test="@type='polar' and @base and child::m:sep[1]">
+      <m:msub>
+        <m:mrow>
+          <m:mo>Polar</m:mo>
+          <m:mfenced separators=",">
+            <m:mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </m:mn>
+            <m:mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </m:mn>
+          </m:mfenced>
+        </m:mrow>
+        <m:mn> <xsl:value-of select="@base"/> </m:mn>
+      </m:msub>
+   </xsl:when>
+    <xsl:otherwise>
+      <m:mn> <xsl:apply-templates mode = "semantics"/> </m:mn>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:ci">
+  <xsl:choose>
+    <xsl:when test="@type='vector' or @type=matrix or @type=set">
+      <m:mi fontweight="bold"> <xsl:apply-templates mode = "semantics"/> </m:mi>
+    </xsl:when>
+    <xsl:otherwise>
+<!-- HELM: aggiunta choose temporanea per HREF invece di:
+<m:mi> <xsl:apply-templates mode = "semantics"/> </m:mi>-->
+     <xsl:choose>
+     <xsl:when test="string(@definitionURL) = &quot;&quot;">
+      <m:mi> <xsl:apply-templates mode = "semantics"/> </m:mi>
+     </xsl:when>
+     <xsl:otherwise>
+      <m:mi xlink:href="{@definitionURL}"> <xsl:apply-templates mode = "semantics"/> </m:mi>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:csymbol">
+  <xsl:choose>
+    <xsl:when test="*[1]">
+      <xsl:copy-of select = "*"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mo> <xsl:apply-templates mode = "semantics"/> </m:mo>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- BASIC CONTENT ELEMENTS -->
+
+<xsl:template match = "m:apply[m:fn[1]]">
+  <m:mrow>
+    <xsl:apply-templates select = "m:fn[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:fn">
+  <xsl:apply-templates select = "*[1]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:interval">
+  <xsl:choose>
+    <xsl:when test="@closure='closed'">
+      <m:mfenced open="[" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='open'">
+      <m:mfenced separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='open-closed'">
+      <m:mfenced open="(" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="@closure='closed-open'">
+      <m:mfenced open="[" close=")" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mfenced open="[" close="]" separators=",">
+        <xsl:apply-templates mode = "semantics"/>
+      </m:mfenced>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:*[1][self::m:apply[m:inverse[1]]]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+ </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:inverse]]">
+  <xsl:choose>
+    <xsl:when test="*[2]=m:exp">
+      <m:mo>ln</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:ln | m:log">
+      <m:mo>exp</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sin">
+      <m:mo>arcsin</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cos">
+      <m:mo>arccos</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:tan">
+      <m:mo>arctan</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sec">
+      <m:mo>arcsec</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:csc">
+      <m:mo>arccsc</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cot">
+      <m:mo>arccot</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sinh">
+      <m:mo>arcsinh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:cosh">
+      <m:mo>arccosh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:tanh">
+      <m:mo>arctanh</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:sech">
+      <m:mo>arcsech</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:csch">
+      <m:mo>arccsch</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:coth">
+      <m:mo>arccoth</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arcsin">
+      <m:mo>sin</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arccos">
+      <m:mo>cos</m:mo>
+    </xsl:when>
+    <xsl:when test="*[2]=m:arctan">
+      <m:mo>tan</m:mo>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:msup>
+        <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+        <m:mfenced>
+          <m:mn>-1</m:mn>
+        </m:mfenced>
+      </m:msup>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:sep"/>
+
+<xsl:template match = "m:condition">
+  <xsl:choose>
+    <xsl:when test="parent::m:apply[m:forall[1]]"/>
+    <xsl:otherwise>
+      <xsl:if test="not(*[2])">
+        <xsl:apply-templates mode = "semantics"/>
+      </xsl:if>
+      <xsl:if test="*[2]">
+        <m:mrow>
+          <xsl:apply-templates mode = "semantics"/>
+        </m:mrow>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:declare"/>
+
+<xsl:template match = "m:lambda">
+  <m:mrow>
+    <m:mo> &#x039b; </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*">
+        <xsl:choose>
+          <xsl:when test="self::m:ci or self::m:cn">
+            <xsl:apply-templates select = "." mode="semantics"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <m:mrow>
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </m:mrow>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:*[1][self::m:apply[m:compose[1]]]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+    <m:mfenced separators=",">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+ </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:compose]]">
+  <m:mfenced separators="">
+    <xsl:apply-templates select = "m:*[2][self::m:ci[@type='fn'] | self::m:fn]" mode="semantics"/>
+    <xsl:for-each select = "m:*[position()>2][self::m:ci[@type='fn'] | self::m:fn]">
+      <m:mo> <mchar name="SmallCircle"/> </m:mo>
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:ident">
+  <m:mo>id</m:mo>
+</xsl:template>
+
+
+<!-- ARITHMETIC, ALGEBRA & LOGIC -->
+
+<xsl:template match = "m:apply[m:quotient[1]]">
+  <m:mfenced open="&#x230a;" close="&#x230b;" separators="">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+    <m:mo>/</m:mo>
+    <xsl:apply-templates select="*[3]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[*[1][self::m:exp]]">
+  <m:msup>
+    <m:mo>e</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:msup>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:factorial[1]]">
+  <m:mrow>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+    <m:mo>!</m:mo>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:max[1] | m:min[1]]">
+  <m:mrow>
+    <xsl:if test="*[2]=m:bvar">
+      <m:munder>
+        <xsl:if test="*[1]=m:max">
+          <m:mo>max</m:mo>
+        </xsl:if>
+        <xsl:if test="*[1]=m:min">
+          <m:mo>min</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:munder>
+      <xsl:if test="*[3]=m:condition">
+        <m:mfenced open="{{" close="}}" separators="">
+          <m:mfenced open="" close="" separators=",">
+            <xsl:for-each select = "*[position()>3]">
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </xsl:for-each>
+          </m:mfenced>
+          <m:mo>|</m:mo>
+          <xsl:apply-templates select="*[3]" mode = "semantics"/>
+        </m:mfenced>
+      </xsl:if>
+      <xsl:if test="not(*[3]=m:condition)">
+        <m:mfenced open="{{" close="}}" separators=",">
+          <xsl:for-each select = "*[position()>2]">
+            <xsl:apply-templates select = "." mode="semantics"/>
+          </xsl:for-each>
+        </m:mfenced>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="*[2]=m:condition">
+      <xsl:if test="*[1]=m:max">
+        <m:mo>max</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:min">
+        <m:mo>min</m:mo>
+      </xsl:if>
+      <m:mfenced open="{{" close="}}" separators="">
+        <xsl:if test="*[3]">
+          <m:mfenced open="" close="" separators=",">
+            <xsl:for-each select = "*[position()>2]">
+              <xsl:apply-templates select = "." mode="semantics"/>
+            </xsl:for-each>
+          </m:mfenced>
+          <m:mo>|</m:mo>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:mfenced>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:condition) and not(*[2]=m:bvar)">
+      <xsl:if test="*[1]=m:max">
+        <m:mo>max</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:min">
+        <m:mo>min</m:mo>
+      </xsl:if>
+      <m:mfenced open="{{" close="}}" separators=",">
+        <xsl:for-each select = "*[position()>1]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:minus[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $MINUS_PREC or $IN_PREC=$MINUS_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="minus">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="minus">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="minus">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:minus[1]]" mode="minus">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:if test="not(*[3])">
+    <m:mo>-</m:mo>
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:if>
+  <xsl:if test="*[3]">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+    </xsl:apply-templates>
+    <m:mo>-</m:mo>
+    <xsl:apply-templates select="*[3]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:plus[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $PLUS_PREC or $IN_PREC=$PLUS_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="plus">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="plus">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="plus">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:plus[1]]" mode="plus">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:if test="*[2]">
+    <xsl:apply-templates select="*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+    </xsl:apply-templates>
+    <xsl:for-each select = "*[position()>2]">
+      <xsl:choose>
+        <xsl:when test=". &lt; 0">
+          <m:mo>-</m:mo>
+          <m:mn> <xsl:value-of select="-."/> </m:mn>
+        </xsl:when>
+        <xsl:when test="self::m:apply[m:minus[1]] and not(*[3])">
+          <xsl:apply-templates select="." mode = "semantics">
+            <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+            <xsl:with-param name="PAREN" select="$PAREN"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+          </xsl:apply-templates>
+        </xsl:when>
+        <xsl:otherwise>
+          <m:mo>+</m:mo>
+          <xsl:apply-templates select="." mode = "semantics">
+            <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
+            <xsl:with-param name="PAREN" select="$PAREN"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:power[1]]">
+  <xsl:choose>
+    <xsl:when test="*[2]=m:apply[m:ln[1] | m:log[1] | m:abs[1] | m:gcd[1] | m:sin[1] | m:cos[1] | m:tan[1] | m:sec[1] | m:csc[1] | m:cot[1] | m:sinh[1] | m:cosh[1] | m:tanh[1] | m:sech[1] | m:csch[1] | m:coth[1] | m:arcsin[1] | m:arccos[1] | m:arctan[1]]">
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:msup>
+        <xsl:apply-templates select = "*[2]" mode = "semantics">
+          <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+        </xsl:apply-templates>
+        <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $DIV_PREC or $IN_PREC=$DIV_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="remdiv">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="remdiv">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="remdiv">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:rem[1] | m:divide[1]]" mode="remdiv">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
+      <xsl:with-param name="PARAM" select="$PARAM"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:if test="m:rem">
+    <m:mo>%</m:mo>
+  </xsl:if>
+  <xsl:if test="m:divide">
+    <m:mo>/</m:mo>
+  </xsl:if>
+  <xsl:apply-templates select = "*[3]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
+    <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:times[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $MUL_PREC or $IN_PREC=$MUL_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="times">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="times">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="times">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:times[1]]" mode="times">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:if test="*[3]">
+    <xsl:for-each select = "*[position()>2]">
+      <m:mo> <mchar name="InvisibleTimes"/> </m:mo>
+      <xsl:apply-templates select="." mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+      </xsl:apply-templates>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:root[1]]">
+  <m:msqrt>
+    <xsl:if test="*[2]=m:degree">
+      <xsl:apply-templates select="*[3]" mode = "semantics"/>
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:degree)">
+      <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      <m:mn>2</m:mn>
+    </xsl:if>
+  </m:msqrt>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:gcd[1]]">
+  <m:mrow>
+    <xsl:if test="not(parent::m:apply[m:power[1]])">
+      <m:mo>gcd</m:mo>
+    </xsl:if>
+    <xsl:if test="parent::m:apply[m:power[1]]">
+      <m:msup>
+        <m:mo>gcd</m:mo>
+        <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:and[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $AND_PREC">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="and">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="and">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="and">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:and[1]]" mode="and">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo> <mchar name="wedge"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:or[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $OR_PREC">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="or">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="or">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="or">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:or[1]]" mode="or">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo> <mchar name="vee"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:xor[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $XOR_PREC">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="xor">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAR_YES"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="xor">
+        <xsl:with-param name="PARAM" select="$IN_PREC"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="xor">
+          <xsl:with-param name="PARAM" select="$IN_PREC"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:xor[1]]" mode="xor">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select="*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo> <mchar name="xor"/> </m:mo>
+    <xsl:apply-templates select="." mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:not[1]]">
+  <m:mrow>
+    <m:mo>not</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:forall[1]]">
+  <m:mrow>
+    <m:mo>for all</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "m:bvar">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+    <xsl:if test="m:condition">
+      <m:mo>:</m:mo>
+      <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
+      <m:mo>,</m:mo>
+    </xsl:if>
+    <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:exists[1]]">
+  <m:mrow>
+    <m:mo> <mchar name="Exists"/> </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "m:bvar">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+    <xsl:if test="m:condition">
+      <m:mo>,</m:mo>
+      <xsl:apply-templates select = "m:condition/*" mode = "semantics"/>
+    </xsl:if>
+    <m:mo>:</m:mo>
+    <xsl:apply-templates select = "*[position()>1 and not(self::m:bvar) and not(self::m:condition)]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:abs[1]]">
+  <xsl:if test="not(parent::m:apply[m:power[1]])">
+    <m:mfenced open="|" close="|" separators="">
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mfenced>
+  </xsl:if>
+  <xsl:if test="parent::m:apply[m:power[1]]">
+    <m:msup>
+      <m:mfenced open="|" close="|" separators="">
+        <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+      </m:mfenced>
+      <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+    </m:msup>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:conjugate[1]]">
+  <m:mover>
+    <m:mrow>
+      <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
+    </m:mrow>
+    <m:mo> <mchar name="UnderBar"/> </m:mo>
+  </m:mover>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:arg[1] | m:real[1] | m:imaginary[1]]">
+  <m:mrow>
+    <xsl:choose>
+      <xsl:when test="m:arg">
+        <m:mo>arg</m:mo>
+      </xsl:when>
+      <xsl:when test="m:real">
+        <m:mo>Real</m:mo>
+      </xsl:when>
+      <xsl:when test="m:imaginary">
+        <m:mo>Imaginary</m:mo>
+      </xsl:when>
+    </xsl:choose>
+    <m:mfenced separators="">
+      <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- RELATIONS -->
+
+<xsl:template match = "m:apply[m:neq | m:approx | m:tendsto | m:implies | m:in | m:notin | m:notsubset | m:notprsubset | m:subset | m:prsubset | m:eq | m:gt | m:lt | m:geq | m:leq | m:equivalent]">
+  <m:mrow>
+    <xsl:if test="*[1]=m:neq or *[1]=m:approx or *[1]=m:tendsto or *[1]=m:implies or *[1]=m:in or *[1]=m:notin or *[1]=m:notsubset or *[1]=m:notprsubset">
+      <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+      <xsl:if test="*[1]=m:neq">
+        <m:mo> <mchar name="NotEqual"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:approx">
+        <m:mo> <mchar name="approxeq"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:tendsto">
+        <m:mo> <mchar name="RightArrow"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:implies">
+        <m:mo> <mchar name="DoubleRightArrow"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:in">
+        <m:mo> <mchar name="Element"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notin">
+        <m:mo> <mchar name="NotElement"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notsubset">
+        <m:mo> <mchar name="NotSubset"/> </m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:notprsubset">
+        <m:mo> <mchar name="NotSubsetEqual"/> </m:mo>
+      </xsl:if>
+      <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+      <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='below']">
+        <m:mo>-</m:mo>
+      </xsl:if>
+      <xsl:if test="*[1]=m:tendsto and m:tendsto[1][@type='above']">
+        <m:mo>+</m:mo>
+      </xsl:if>
+    </xsl:if>
+    <xsl:if test="*[1]=m:subset or *[1]=m:prsubset or *[1]=m:eq or *[1]=m:gt or *[1]=m:lt or *[1]=m:geq or *[1]=m:leq or *[1]=m:equivalent">
+      <xsl:apply-templates select = "*[2]" mode="semantics"/>
+      <xsl:for-each select = "*[position()>2]">
+        <xsl:if test="../*[self::m:subset][1]">
+          <m:mo>  <mchar name="SubsetEqual"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:prsubset][1]">
+          <m:mo> <mchar name="subset"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:eq][1]">
+          <m:mo>=</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:gt][1]">
+          <m:mo>&gt;</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:lt][1]">
+          <m:mo>&lt;</m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:geq][1]">
+          <m:mo> <mchar name="geq"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:leq][1]">
+          <m:mo> <mchar name="leq"/> </m:mo>
+        </xsl:if>
+        <xsl:if test="../*[self::m:equivalent][1]">
+          <m:mo> <mchar name="Congruent"/> </m:mo>
+        </xsl:if>
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- CALCULUS -->
+
+<xsl:template match = "m:apply[*[1][self::m:ln]]">
+  <m:mrow>
+    <xsl:choose>
+      <xsl:when test="parent::m:apply[m:power[1]]">
+        <m:msup>
+          <m:mo>ln</m:mo>
+          <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+        </m:msup>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mo>ln</m:mo>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:log[1]]">
+  <m:mrow>
+    <xsl:choose>
+      <xsl:when test="parent::m:apply[m:power[1]]">
+        <xsl:if test="not(*[2]=m:logbase)">
+          <m:msup>
+            <m:mo>log</m:mo>
+            <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+          </m:msup>
+        </xsl:if>
+        <xsl:if test="*[2]=m:logbase">
+          <m:msubsup>
+            <m:mo>log</m:mo>
+            <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+            <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
+          </m:msubsup>
+        </xsl:if>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:if test="not(*[2]=m:logbase)">
+          <m:mo>log</m:mo>
+        </xsl:if>
+        <xsl:if test="*[2]=m:logbase">
+          <m:msub>
+            <m:mo>log</m:mo>
+            <xsl:apply-templates select = "m:logbase" mode = "semantics"/>
+          </m:msub>
+        </xsl:if>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="*[2]=m:logbase">
+      <xsl:apply-templates select = "*[3]" mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      </xsl:apply-templates>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:logbase)">
+      <xsl:apply-templates select = "*[2]" mode = "semantics">
+        <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:diff[1]]">
+  <m:mrow>
+    <xsl:if test="*[2]=m:bvar and m:bvar[*[2]=m:degree]">
+      <m:mfrac>
+        <m:msup>
+          <m:mo>d</m:mo>
+          <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
+        </m:msup>
+        <m:mrow>
+          <m:mo>d</m:mo>
+          <m:msup>
+            <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
+            <xsl:apply-templates select = "m:bvar/m:degree" mode = "semantics"/>
+          </m:msup>
+        </m:mrow>
+      </m:mfrac>
+    </xsl:if>
+    <xsl:if test="*[2]=m:bvar and not(m:bvar[*[2]=m:degree])">
+      <m:mfrac>
+        <m:mo>d</m:mo>
+        <m:mrow>
+          <m:mo>d</m:mo>
+          <xsl:apply-templates select = "m:bvar/*[1]" mode = "semantics"/>
+        </m:mrow>
+      </m:mfrac>
+    </xsl:if>
+    <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:partialdiff[1]]">
+  <m:mrow>
+    <xsl:for-each select = "m:bvar">
+      <xsl:if test="*[last()]=m:degree">
+        <m:mfrac>
+          <m:msup>
+             <m:mo>d</m:mo>
+             <xsl:apply-templates select = "m:degree" mode = "semantics"/>
+          </m:msup>
+          <m:mrow>
+            <m:mo>d</m:mo>
+            <m:msup>
+              <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+              <xsl:apply-templates select = "m:degree" mode = "semantics"/>
+            </m:msup>
+          </m:mrow>
+        </m:mfrac>
+      </xsl:if>
+      <xsl:if test="not(*[last()]=m:degree)">
+        <m:mfrac>
+          <m:mo>d</m:mo>
+          <m:mrow>
+            <m:mo>d</m:mo>
+            <xsl:apply-templates select = "*[1]" mode = "semantics"/>
+          </m:mrow>
+        </m:mfrac>
+      </xsl:if>
+    </xsl:for-each>
+    <xsl:apply-templates select = "*[last()]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:lowlimit | m:uplimit | m:bvar | m:degree | m:logbase">
+  <xsl:apply-templates mode = "semantics"/>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:divergence[1] | m:grad[1] | m:curl[1]]">
+  <m:mrow>
+    <xsl:if test="*[1]=m:divergence">
+      <m:mo>div</m:mo>
+    </xsl:if>
+    <xsl:if test="*[1]=m:grad">
+    <m:mo>grad</m:mo>
+    </xsl:if>
+    <xsl:if test="*[1]=m:curl">
+    <m:mo>curl</m:mo>
+    </xsl:if>
+    <xsl:choose>
+      <xsl:when test="*[2]=m:ci">
+        <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <m:mfenced separators="">
+          <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+        </m:mfenced>
+      </xsl:otherwise>
+    </xsl:choose>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:laplacian[1]]">
+  <m:mrow>
+    <m:msup>
+      <m:mo> &#x0394; </m:mo>
+      <m:mn>2</m:mn>
+    </m:msup>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- SET THEORY -->
+
+<xsl:template match = "m:set | m:list">
+  <m:mfenced open="{{" close="}}" separators="">
+    <xsl:if test="*[1]=m:bvar and *[2]=m:condition">
+      <xsl:apply-templates select="m:bvar" mode = "semantics"/>
+      <m:mo>|</m:mo>
+      <xsl:apply-templates select="m:condition" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="*[1]=m:condition and not(child::m:bvar)">
+      <m:mfenced open="" close="" separators=",">
+        <xsl:for-each select = "*[not(self::m:condition) and not(self::m:bvar)]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+      <m:mo>|</m:mo>
+      <xsl:apply-templates select="m:condition" mode = "semantics"/>
+    </xsl:if>
+    <xsl:if test="not(child::m:bvar) and not(child::m:condition)">
+      <m:mfenced open="" close="" separators=",">
+        <xsl:for-each select = "*">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+    </xsl:if>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:union[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $UNION_PREC or $IN_PREC=$UNION_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="union">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="union">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="union">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:union[1]]" mode="union">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode="semantics">
+    <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo> <mchar name="Union"/> </m:mo>
+    <xsl:apply-templates select = "." mode="semantics">
+      <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:intersect[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $INTERSECT_PREC">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="intersect">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="intersect">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="intersect">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:intersect[1]]" mode="intersect">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode="semantics">
+    <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <xsl:for-each select = "*[position()>2]">
+    <m:mo> <mchar name="Intersection"/> </m:mo>
+    <xsl:apply-templates select = "." mode="semantics">
+      <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
+      <xsl:with-param name="PAREN" select="$PAREN"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:setdiff[1]]">
+  <xsl:param name="IN_PREC" select="$NO_PREC"/>
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:choose>
+    <xsl:when test="$IN_PREC &gt; $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC and $PARAM=$PAR_SAME">
+      <m:mfenced separators="">
+        <xsl:apply-templates select="." mode="setdiff">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mfenced>
+    </xsl:when>
+    <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC and not($SEM_SW=2)">
+      <xsl:apply-templates select="." mode="setdiff">
+        <xsl:with-param name="PARAM" select="$PARAM"/>
+        <xsl:with-param name="PAREN" select="$PAREN"/>
+        <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <m:mrow>
+        <xsl:apply-templates select="." mode="setdiff">
+          <xsl:with-param name="PARAM" select="$PARAM"/>
+          <xsl:with-param name="PAREN" select="$PAREN"/>
+          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+        </xsl:apply-templates>
+      </m:mrow>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:setdiff[1]]" mode="setdiff">
+  <xsl:param name="PARAM" select="$NO_PARAM"/>
+  <xsl:param name="PAREN" select="$PAR_NO"/>
+  <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
+  <xsl:apply-templates select = "*[2]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
+    <xsl:with-param name="PARAM" select="$PARAM"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+  </xsl:apply-templates>
+  <m:mo>\</m:mo>
+  <xsl:apply-templates select = "*[3]" mode = "semantics">
+    <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
+    <xsl:with-param name="PARAM" select="$PAR_SAME"/>
+    <xsl:with-param name="PAREN" select="$PAREN"/>
+    <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+  </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:card[1]]">
+  <m:mfenced open="|" close="|" separators=",">
+    <xsl:for-each select = "*[position()>1]">
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+
+<!-- SEQUENCES AND SERIES -->
+
+<xsl:template match = "m:apply[m:sum[1] | m:product[1]]">
+  <m:mrow>
+    <xsl:choose>
+      <xsl:when test="*[2]=m:bvar and m:lowlimit and m:uplimit">
+        <m:munderover>
+          <xsl:if test="*[1]=m:sum">
+            <m:mo> <mchar name="Sum"/> </m:mo>
+          </xsl:if>
+          <xsl:if test="*[1]=m:product">
+            <m:mo> <mchar name="Product"/> </m:mo>
+          </xsl:if>
+          <m:mrow>
+            <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+            <m:mo>=</m:mo>
+            <xsl:apply-templates select = "m:lowlimit" mode = "semantics"/>
+          </m:mrow>
+          <xsl:apply-templates select = "m:uplimit" mode = "semantics"/>
+        </m:munderover>
+        <xsl:apply-templates select = "*[5]" mode = "semantics"/>
+      </xsl:when>
+      <xsl:when test="*[2]=m:bvar and *[3]=m:condition">
+        <m:munder>
+          <xsl:if test="*[1]=m:sum">
+            <m:mo> <mchar name="Sum"/> </m:mo>
+          </xsl:if>
+          <xsl:if test="*[1]=m:product">
+            <m:mo> <mchar name="Product"/> </m:mo>
+          </xsl:if>
+          <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </m:munder>
+        <xsl:apply-templates select = "*[4]" mode = "semantics"/>
+      </xsl:when>
+    </xsl:choose>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:limit[1]]">
+  <m:mrow>
+    <m:munder>
+      <m:mo>lim</m:mo>
+      <m:mrow>
+        <xsl:if test="*[2]=m:bvar and *[3]=m:lowlimit">
+            <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+            <m:mo> <mchar name="RightArrow"/> </m:mo>
+            <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </xsl:if>
+        <xsl:if test="*[2]=m:bvar and *[3]=m:condition">
+          <xsl:apply-templates select = "*[3]" mode = "semantics"/>
+        </xsl:if>
+      </m:mrow>
+    </m:munder>
+    <xsl:apply-templates select = "*[4]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+
+<!-- TRIGONOMETRY -->
+
+<xsl:template match = "m:apply[*[1][self::m:sin | self::m:cos | self::m:tan | self::m:sec | self::m:csc | self::m:cot | self::m:sinh | self::m:cosh | self::m:tanh | self::m:sech | self::m:csch | self::m:coth | self::m:arcsin | self::m:arccos | self::m:arctan]]">
+  <m:mrow>
+    <xsl:if test="not(parent::m:apply[m:power[1]])">
+      <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
+    </xsl:if>
+    <xsl:if test="parent::m:apply[m:power[1]]">
+      <m:msup>
+        <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
+        <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <xsl:apply-templates select = "*[2]" mode = "semantics">
+      <xsl:with-param name="IN_PREC" select="$FUNCTION_PREC"/>
+      <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
+    </xsl:apply-templates>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:*" mode = "trigonometry">
+    <xsl:choose>
+      <xsl:when test="self::m:sin">
+        <m:mo>sin</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cos">
+        <m:mo>cos</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:tan">
+        <m:mo>tan</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sec">
+        <m:mo>sec</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:csc">
+        <m:mo>csc</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cot">
+        <m:mo>cot</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sinh">
+        <m:mo>sinh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:cosh">
+        <m:mo>cosh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:tanh">
+        <m:mo>tanh</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:sech">
+        <m:mo>sech</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:csch">
+        <m:mo>csch</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:coth">
+        <m:mo>coth</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arcsin">
+        <m:mo>arcsin</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arccos">
+        <m:mo>arccos</m:mo>
+      </xsl:when>
+      <xsl:when test="self::m:arctan">
+        <m:mo>arctan</m:mo>
+      </xsl:when>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- STATISTICS -->
+
+<xsl:template match = "m:apply[m:mean[1]]">
+  <m:mfenced open="&lt;" close="&gt;" separators=",">
+    <xsl:for-each select = "*[position()>1]">
+      <xsl:apply-templates select = "." mode="semantics"/>
+    </xsl:for-each>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:sdev[1]]">
+  <m:mrow>
+    <m:mo> &#x03c3; </m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:variance[1]]">
+  <m:mrow>
+    <m:mo> &#x03c3; </m:mo>
+    <m:msup>
+      <m:mfenced separators=",">
+        <xsl:for-each select = "*[position()>1]">
+          <xsl:apply-templates select = "." mode="semantics"/>
+        </xsl:for-each>
+      </m:mfenced>
+      <m:mn>2</m:mn>
+    </m:msup>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:median[1]]">
+  <m:mrow>
+    <m:mo>median</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:mode[1]]">
+  <m:mrow>
+    <m:mo>mode</m:mo>
+    <m:mfenced separators=",">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </m:mfenced>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:moment[1]]">
+  <m:mfenced open="&lt;" close="&gt;" separators="">
+    <xsl:if test="*[2]=m:degree">
+      <m:msup>
+        <xsl:apply-templates select="*[3]" mode = "semantics"/>
+        <xsl:apply-templates select="*[2]" mode = "semantics"/>
+      </m:msup>
+    </xsl:if>
+    <xsl:if test="not(*[2]=m:degree)">
+      <xsl:for-each select = "*[position()>1]">
+        <xsl:apply-templates select = "." mode="semantics"/>
+      </xsl:for-each>
+    </xsl:if>
+  </m:mfenced>
+</xsl:template>
+
+
+<!-- LINEAR ALGEBRA -->
+
+<xsl:template match="m:vector">
+  <m:mfenced separators="">
+    <m:mtable>
+      <xsl:for-each select="*">
+        <m:mtd>
+          <xsl:apply-templates select="." mode = "semantics"/>
+        </m:mtd>
+      </xsl:for-each>
+    </m:mtable>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:matrix">
+  <m:mfenced separators="">
+    <m:mtable>
+      <xsl:apply-templates mode = "semantics"/>
+    </m:mtable>
+  </m:mfenced>
+</xsl:template>
+
+<xsl:template match = "m:matrixrow">
+  <m:mtr>
+    <xsl:for-each select="*">
+      <m:mtd>
+        <xsl:apply-templates select="." mode = "semantics"/>
+      </m:mtd>
+    </xsl:for-each>
+  </m:mtr>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:determinant[1]]">
+  <m:mrow>
+    <m:mo>det</m:mo>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:transpose[1]]">
+  <m:msup>
+    <xsl:apply-templates select = "*[2]" mode = "semantics"/>
+    <m:mo>T</m:mo>
+  </m:msup>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:selector[1]]">
+  <xsl:if test="*[2]=m:matrix and *[3]=m:cn">
+      <xsl:variable name="m" select = "*[3]"/>
+      <xsl:choose>
+        <xsl:when test="*[4]=m:cn">
+          <xsl:variable name="n" select = "*[4]"/>
+          <xsl:copy-of select = "m:matrix/*[position()=$m]/*[position()=$n]"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select = "m:matrix/*[position()=$m]"/>
+        </xsl:otherwise>
+      </xsl:choose>
+  </xsl:if>
+  <xsl:if test="(*[2]=m:vector or *[2]=m:list) and *[3]=m:cn">
+    <xsl:variable name="m" select = "*[3]"/>
+    <xsl:copy-of select = "*[2]/*[position()=$m]"/>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template match = "m:apply[m:vectorproduct[1] | m:scalarproduct[1] | m:outerproduct[1]]">
+  <m:mrow>
+    <xsl:apply-templates select="*[2]" mode = "semantics"/>
+    <xsl:choose>
+      <xsl:when test="m:vectorproduct[1]">
+        <m:mo> <mchar name="Cross"/> </m:mo>
+      </xsl:when>
+      <xsl:when test="m:scalarproduct[1] | m:outerproduct[1]">
+        <m:mo>.</m:mo>
+      </xsl:when>
+    </xsl:choose>
+    <xsl:apply-templates select="*[3]" mode = "semantics"/>
+  </m:mrow>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/mmlextension.xsl b/helm/style/style_prima_del_linguaggio_naturale/mmlextension.xsl
new file mode 100644 (file)
index 0000000..39d2f5c
--- /dev/null
@@ -0,0 +1,1128 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- Extension to the XSLT version 0.07 of MathML content to presentation: -->
+<!-- First draft: February 19 2000, Andrea Asperti, Irene Schena           -->
+<!-- Revised: March 3 2000, Irene Schena                                   -->
+<!-- Revised: March 15 2000, Claudio Sacerdoti Coen, Irene Schena          -->
+<!-- Revised: March 21 2000, Irene Schena                                  -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="mml2mmlv1_0.xsl"/>
+
+<!--***********************************************************************-->
+<!-- Parameter affecting line-breaking                                     -->
+<!--***********************************************************************-->
+
+<xsl:variable name="framewidth" select="30"/>
+
+<!--***********************************************************************-->
+<!-- Gli oggetti sono stampati come mtext all'interno di una marca toplevel-->
+<!-- math ma al di fuori di semantics. Ora vi sono tanti semantics quanti  -->
+<!-- sono i termini: la presentation per un termine e' generata come primo -->
+<!-- figlio di un semantics e l'originario content viene inserito nel      -->
+<!-- nel secondo figlio di semantics, annotation-xml                       -->
+<!--***********************************************************************-->
+
+<!--**********************-->
+<!--        OBJECTS       -->
+<!--**********************-->
+
+<xsl:template match="/">
+ <xsl:processing-instruction name="cocoon-format">type="text/xhtml"</xsl:processing-instruction>
+ <xsl:apply-templates select="*"/>
+</xsl:template>
+
+<!-- DEFINITION -->
+
+<xsl:template match="Definition">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>DEFINITION <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>AS</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="body/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- AXIOM -->
+
+<xsl:template match="Axiom">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>AXIOM <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>) OF TYPE</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- UNFINISHED PROOF -->
+
+<xsl:template match="CurrentProof">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>UNFINISHED PROOF <xsl:value-of select="@name"/>(<xsl:if test="string(./Params) != &quot;&quot;"><xsl:value-of select="Params"/></xsl:if>)</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>THESIS:</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>CONJECTURES:</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <xsl:for-each select="Conjecture">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <m:mtext><xsl:value-of select="./@no"/>:</m:mtext>
+         <xsl:apply-templates select="./*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      </xsl:for-each>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>CORRESPONDING PROOF:</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="body/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- MUTUAL INDUCTIVE DEFINITION -->
+
+<xsl:template match="InductiveDefinition">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+     <xsl:for-each select="InductiveType">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+          <xsl:choose>
+          <xsl:when test="string(./@inductive) = &quot;true&quot;">
+           <m:mtext>INDUCTIVE DEFINITION</m:mtext>
+          </xsl:when>
+          <xsl:otherwise>
+           <m:mtext>COINDUCTIVE DEFINITION</m:mtext>
+          </xsl:otherwise>
+          </xsl:choose>  
+         </xsl:when>
+         <xsl:otherwise>
+          <m:mtext>AND</m:mtext>
+         </xsl:otherwise>
+         </xsl:choose>
+         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         <m:mtext><xsl:value-of select="./@name"/>(<xsl:if test="string(../Params) != &quot;&quot;"><xsl:value-of select="../Params"/></xsl:if>)</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow> 
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <m:mtext>[</m:mtext>
+         <xsl:choose>
+         <xsl:when test="string(../Param) != &quot;&quot;">         
+          <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+           <xsl:for-each select="../Param">
+            <m:mtr>
+             <m:mtd>
+              <m:mrow>   
+               <m:mi><xsl:value-of select="./@name"/></m:mi>
+               <m:mo>:</m:mo>
+               <xsl:apply-templates select="*"/>
+              </m:mrow>
+             </m:mtd>
+            </m:mtr>
+           </xsl:for-each>
+            <m:mtr>
+             <m:mtd>
+              <m:mrow>
+               <m:mtext>]</m:mtext>
+              </m:mrow>
+             </m:mtd>
+            </m:mtr>
+          </m:mtable>
+         </xsl:when>
+         <xsl:otherwise>
+          <m:mtext>]</m:mtext>
+         </xsl:otherwise>
+         </xsl:choose>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>OF ARITY</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="./arity/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>BUILT FROM</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <xsl:for-each select="./Constructor">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <xsl:choose>
+         <xsl:when test="position() = 1">
+          <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         </xsl:when>
+         <xsl:otherwise>
+          <m:mtext>|</m:mtext>
+          <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         </xsl:otherwise>
+         </xsl:choose>
+         <m:mtext><xsl:value-of select="./@name"/> OF</m:mtext>
+         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         <xsl:apply-templates select="./*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      </xsl:for-each>
+     </xsl:for-each>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!-- VARIABLE -->
+
+<xsl:template match="Variable">
+    <m:math>
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left" helm:xref="{@helm:xref}">
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mtext>VARIABLE <xsl:value-of select="@name"/> OF TYPE</m:mtext>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+        <m:mrow>
+         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+         <xsl:apply-templates select="type/*[1]"/>
+        </m:mrow>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </m:math>
+</xsl:template>
+
+<!--**********************-->
+<!--        TERMS         -->
+<!--**********************-->
+
+<xsl:template match="m:bvar">
+ <xsl:choose>
+  <xsl:when test="m:type">
+   <xsl:variable name="charlength">
+    <xsl:apply-templates select="m:ci" mode="charcount"/>
+   </xsl:variable>
+   <xsl:choose>
+    <xsl:when test="$charlength >= $framewidth">
+     <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+      <m:mtr>
+       <m:mtd>
+        <xsl:apply-templates select="m:ci"/>
+        <m:mo>:</m:mo>
+       </m:mtd>
+      </m:mtr>
+      <m:mtr>
+       <m:mtd>
+         <xsl:apply-templates select="m:type"/>
+       </m:mtd>
+      </m:mtr>
+     </m:mtable>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates select="m:ci"/>
+     <m:mo>:</m:mo>
+     <xsl:apply-templates select="m:type"/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-templates select="m:ci"/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!-- CSYMBOL -->
+
+<xsl:template match="m:apply[m:csymbol]">
+    <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
+    <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
+    <m:mrow>
+     <xsl:if test="@helm:xref">
+      <xsl:attribute name="helm:xref"><xsl:value-of select="@helm:xref"/></xsl:attribute>
+     </xsl:if>
+     <xsl:choose>
+      <xsl:when test="$name='prod'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+            <m:mo color="Blue">&#x03a0;</m:mo>
+            <xsl:apply-templates select="m:bvar"/>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>.</m:mo>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo color="Blue">&#x03a0;</m:mo>
+        <xsl:apply-templates select="m:bvar/m:ci"/>
+        <m:mo>:</m:mo>
+        <xsl:apply-templates select="m:bvar/m:type"/>
+        <m:mo>.</m:mo>
+        <xsl:apply-templates select="*[position()=3]"/>
+       </xsl:otherwise>
+       </xsl:choose> 
+      </xsl:when>
+      <xsl:when test="$name='arrow'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">(</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo color="Blue">&#x2192;</m:mo>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">)</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo stretchy="false">(</m:mo>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <m:mo color="Blue">&#x2192;</m:mo>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <m:mo stretchy="false">)</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='app'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">(</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:for-each select="*[position()>2]">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>(</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">)</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo stretchy="false">(</m:mo>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <xsl:for-each select="*[position()>2]">
+         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+         <xsl:apply-templates select="."/>
+        </xsl:for-each>
+        <m:mo stretchy="false">)</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='cast'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">(</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo color="Yellow">:></m:mo>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">)</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo stretchy="false">(</m:mo>
+        <xsl:apply-templates select="*[position()=2]"/>
+        <m:mo color="Yellow">:></m:mo>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <m:mo stretchy="false">)</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='Prop'">
+       <m:mo>Prop</m:mo>
+      </xsl:when>
+      <xsl:when test="$name='Set'">
+       <m:mo>Set</m:mo>
+      </xsl:when>
+      <xsl:when test="$name='Type'">
+       <m:mo>Type</m:mo>
+      </xsl:when>
+      <xsl:when test="$name='mutcase'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>&lt;</m:mo>
+            <xsl:apply-templates select="*[position()=2]"/>
+            <xsl:if test="$framewidth > $charlength">
+             <m:mo>&gt;</m:mo>
+             <m:mo>CASES</m:mo>
+             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+             <xsl:apply-templates select="*[position()=3]"/>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:if test="$charlength >= $framewidth">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>&gt;</m:mo>
+            <m:mo>CASES</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="*[position()=3]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:if>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>OF</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <xsl:choose>
+            <xsl:when test="position() = 1">
+              <m:mphantom><m:mtext>|</m:mtext></m:mphantom>
+            </xsl:when>
+            <xsl:otherwise>
+             <m:mo stretchy="false">|</m:mo>
+            </xsl:otherwise>
+            </xsl:choose>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <xsl:apply-templates select="."/>
+            <xsl:if test="$framewidth > $charlength">
+             <m:mo color="Green">&#x21d2;</m:mo>
+             <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <xsl:if test="$charlength >= $framewidth">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>  
+            <m:mo color="Green">&#x21d2;</m:mo>
+            <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:if>
+        </xsl:for-each>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>END</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo>&lt;</m:mo><xsl:apply-templates select="*[position()=2]"/><m:mo>&gt;</m:mo>
+        <m:mo>CASES</m:mo>
+        <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+        <xsl:apply-templates select="*[position()=3]"/>
+        <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+        <m:mo>OF</m:mo>
+        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+         <xsl:choose>
+         <xsl:when test="position() != 1">
+          <m:mo stretchy="false">|</m:mo>
+         </xsl:when> 
+         </xsl:choose>
+         <xsl:apply-templates select="."/>
+         <m:mo color="Green">&#x21d2;</m:mo>
+         <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+        </xsl:for-each>
+        <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+        <m:mo>END</m:mo>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='fix'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>FIX</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo stretchy="false">{</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+            <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+            <xsl:for-each select="m:bvar"> 
+             <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mi><xsl:value-of select="m:ci"/></m:mi>
+                <m:mo>:</m:mo>
+                <xsl:if test="$framewidth > $charlength">
+                 <xsl:apply-templates select="m:type"/>
+                </xsl:if>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr> 
+             <xsl:if test="$charlength >= $framewidth">
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
+                <xsl:apply-templates select="m:type"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr>
+             </xsl:if>
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mo>:=</m:mo>
+                <xsl:apply-templates select="following-sibling::*[position()=1]"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr> 
+            </xsl:for-each>
+            </m:mtable>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">}</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo>FIX</m:mo>
+        <m:mi><xsl:value-of select="m:ci"/></m:mi>
+        <m:mo stretchy="false">{</m:mo>
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <xsl:for-each select="m:bvar"> 
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo>:</m:mo>
+            <xsl:apply-templates select="m:type"/>
+            <m:mo>:=</m:mo>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:if test="position()=last()">
+             <m:mo stretchy="false">}</m:mo>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+        </m:mtable>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$name='cofix'">
+       <xsl:choose>
+       <xsl:when test="$charlength >= $framewidth">
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo>COFIX</m:mo>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo stretchy="false">{</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+            <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+            <xsl:for-each select="m:bvar">
+             <xsl:variable name="charlength"><xsl:apply-templates select="m:type" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable> 
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mi><xsl:value-of select="m:ci"/></m:mi>
+                <m:mo>:</m:mo>
+                <xsl:if test="$framewidth > $charlength">
+                 <xsl:apply-templates select="m:type"/>
+                </xsl:if>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr> 
+             <xsl:if test="$charlength >= $framewidth">
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mphantom><m:mtext>:=</m:mtext></m:mphantom>
+                <xsl:apply-templates select="m:type"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr>
+             </xsl:if>
+             <m:mtr>
+              <m:mtd>
+               <m:mrow>
+                <m:mo>:=</m:mo>
+                <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+               </m:mrow>
+              </m:mtd>
+             </m:mtr>
+            </xsl:for-each>
+            </m:mtable>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mo stretchy="false">}</m:mo>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+        </m:mtable>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mo>COFIX</m:mo>
+        <m:mi><xsl:value-of select="m:ci"/></m:mi>
+        <m:mo stretchy="false">{</m:mo>
+        <m:mtable align="baseline 1" equalrows="false" columnalign="left">  
+        <xsl:for-each select="m:bvar"> 
+         <m:mtr>
+          <m:mtd>
+           <m:mrow>
+            <m:mi><xsl:value-of select="m:ci"/></m:mi>
+            <m:mo>:</m:mo>
+            <xsl:apply-templates select="m:type"/>
+            <m:mo>:=</m:mo>
+            <xsl:apply-templates select="following-sibling::*[position() = 1]"/>
+            <xsl:if test="position()=last()">
+             <m:mo stretchy="false">}</m:mo>
+            </xsl:if>
+           </m:mrow>
+          </m:mtd>
+         </m:mtr>
+         </xsl:for-each>
+        </m:mtable>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      </xsl:choose>
+     </m:mrow>
+</xsl:template>
+
+<!-- LAMBDA -->
+
+<xsl:template match="m:lambda">
+    <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
+    <m:mrow helm:xref="{@helm:xref}">
+     <xsl:choose>
+     <xsl:when test="$charlength >= $framewidth">
+      <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+          <m:mtd>
+            <m:mo color="Red">&#x03bb;</m:mo>
+            <xsl:apply-templates select="m:bvar"/>
+          </m:mtd>
+         </m:mtr>
+       <m:mtr>
+        <m:mtd>
+         <m:mrow>
+          <m:mo>.</m:mo>
+          <xsl:apply-templates select="*[position()=2]"/>
+         </m:mrow>
+        </m:mtd>
+       </m:mtr>
+      </m:mtable>
+     </xsl:when>
+     <xsl:otherwise>
+      <m:mo color="Red">&#x03bb;</m:mo>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <m:mo>:</m:mo>
+      <xsl:apply-templates select="m:bvar/m:type"/>
+      <m:mo>.</m:mo>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </m:mrow>
+</xsl:template>
+
+<!-- *********************************** -->
+<!-- BASE SET OF MATHML CONTENT ELEMENTS -->
+<!-- *********************************** -->
+
+<!-- Logic -->
+
+<xsl:template match = "m:apply[m:eq[1]]">
+ <xsl:variable name="charlength">
+  <xsl:apply-templates select="*[1]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$charlength >= $framewidth">
+   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+    <xsl:if test="@helm:xref">
+     <xsl:attribute name="helm:xref">
+      <xsl:value-of select="@helm:xref"/>
+     </xsl:attribute>
+    </xsl:if>    
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">(</m:mo>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </m:mtd>
+    </m:mtr>
+    <xsl:for-each select = "*[position()>2]">
+     <m:mtr>
+      <m:mtd>
+       <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+       <m:mo helm:xref="m:in/@helm:xref"> 
+        =
+       </m:mo>
+       <xsl:apply-templates select="."/>
+      </m:mtd>
+     </m:mtr>
+    </xsl:for-each>
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">)</m:mo>
+     </m:mtd>
+    </m:mtr>
+   </m:mtable>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template match = "m:apply[m:and[1]|m:or[1]
+          |m:geq[1]|m:leq[1]|m:gt[1]|m:lt[1]
+          |m:in[1]|m:intesect[1]|m:union[1]|m:subset[1]
+          |m:prsubset|m:setdiff[1]]">
+ <xsl:variable name="symbol">
+  <xsl:choose>
+   <xsl:when test="m:and[1]">
+    <xsl:value-of select="'wedge'"/>
+   </xsl:when>
+   <xsl:when test="m:or[1]">
+    <xsl:value-of select="'vee'"/>
+   </xsl:when>
+   <xsl:when test="m:geq[1]">
+    <xsl:value-of select="'geq'"/>
+   </xsl:when>
+   <xsl:when test="m:leq[1]">
+    <xsl:value-of select="'leq'"/>
+   </xsl:when>
+   <xsl:when test="m:gt[1]">
+    <xsl:value-of select="'gt'"/>
+   </xsl:when>
+   <xsl:when test="m:lt[1]">
+    <xsl:value-of select="'lt'"/>
+   </xsl:when>
+   <xsl:when test="m:eq[1]">
+    <xsl:value-of select="'Equal'"/>
+   </xsl:when>
+   <xsl:when test="m:in[1]">
+    <xsl:value-of select="'Element'"/>
+   </xsl:when>
+   <xsl:when test="m:subset[1]">
+    <xsl:value-of select="'SubsetEqual'"/>
+   </xsl:when>
+   <xsl:when test="m:prsubset[1]">
+    <xsl:value-of select="'subset'"/>
+   </xsl:when>
+   <xsl:when test="m:intersect[1]">
+    <xsl:value-of select="'Intersection'"/>
+   </xsl:when>
+   <xsl:when test="m:union[1]">
+    <xsl:value-of select="'Union'"/>
+   </xsl:when>
+   <xsl:when test="m:setdiff[1]">
+    <xsl:value-of select="'Backslash'"/>
+   </xsl:when>
+  </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="charlength">
+  <xsl:apply-templates select="*[1]" mode="charcount"/>
+ </xsl:variable>
+ <xsl:choose>
+  <xsl:when test="$charlength >= $framewidth">
+   <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+    <xsl:if test="@helm:xref">
+     <xsl:attribute name="helm:xref">
+      <xsl:value-of select="@helm:xref"/>
+     </xsl:attribute>
+    </xsl:if>    
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">(</m:mo>
+      <xsl:apply-templates select="*[position()=2]"/>
+     </m:mtd>
+    </m:mtr>
+    <xsl:for-each select = "*[position()>2]">
+     <m:mtr>
+      <m:mtd>
+       <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
+       <m:mo helm:xref="{*[1]/@helm:xref}"> 
+        <m:mchar name="{$symbol}"/>
+       </m:mo>
+       <xsl:apply-templates select="."/>
+      </m:mtd>
+     </m:mtr>
+    </xsl:for-each>
+    <m:mtr>
+     <m:mtd>
+      <m:mo stretchy="false">)</m:mo>
+     </m:mtd>
+    </m:mtr>
+   </m:mtable>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:apply-imports/>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match = "m:set">
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <m:mo> 
+    <m:mchar name="EmptySet"/>
+   </m:mo>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:variable name="charlength">
+    <xsl:apply-templates select="*[1]" mode="charcount"/>
+   </xsl:variable>
+   <xsl:choose>
+    <xsl:when test="$charlength >= $framewidth">
+     <xsl:choose>
+      <xsl:when test="name(*[1]) = 'm:bvar'">
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">{</m:mo>
+          <xsl:apply-templates select="*[position()=1]"/>
+         </m:mtd>
+        </m:mtr>
+        <m:mtr>
+         <m:mtd>
+          <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
+          <m:mo stretchy="false">|</m:mo>
+          <xsl:apply-templates select="m:condition/*[1]"/>
+         </m:mtd>
+        </m:mtr>
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">}</m:mo>
+         </m:mtd>
+        </m:mtr>
+       </m:mtable>
+      </xsl:when>
+      <xsl:otherwise>
+       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">{</m:mo>
+          <xsl:apply-templates select="*[position()=1]"/>
+          <xsl:if test="position() != last()">
+           <mo>,</mo>
+          </xsl:if>
+         </m:mtd>
+        </m:mtr>
+        <xsl:for-each select = "*[position()>2]">
+         <m:mtr>
+          <m:mtd>
+           <m:mphantom><m:mtext>{</m:mtext></m:mphantom>
+           <xsl:apply-templates select="."/>
+           <xsl:if test="position() != last()">
+            <mo>,</mo>
+           </xsl:if>
+          </m:mtd>
+         </m:mtr>
+        </xsl:for-each>
+        <m:mtr>
+         <m:mtd>
+          <m:mo stretchy="false">}</m:mo>
+         </m:mtd>
+        </m:mtr>
+       </m:mtable>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-imports/>
+    </xsl:otherwise>
+   </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>      
+
+<xsl:template match = "m:apply[m:card[1]]">
+ <m:mo stretchy="false">|</m:mo>
+  <xsl:apply-templates select="*[2]"/>
+ <m:mo stretchy="false">|</m:mo>
+</xsl:template>
+
+<!--**********************-->
+<!--       COUNTING       -->
+<!--**********************-->
+
+<xsl:template match="m:and|m:or|m:not|m:exists|m:eq|m:lt|m:leq|m:gt|m:geq
+ |m:in|m:notin|m:intersect|m:union|m:subset|m:prsubset|m:card|m:setdiff" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+    <xsl:choose>
+    <xsl:when test="$framewidth > ($incurrent_length + 3 + string-length())">
+     <xsl:variable name="siblength">
+      <xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount">
+       <xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/>
+      </xsl:apply-templates>
+     </xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + 3 + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="m:ci|m:csymbol" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/> 
+<xsl:param name="nosibling" select="0"/>
+    <xsl:choose>
+    <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="$incurrent_length + string-length()"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="$incurrent_length + string-length()"/>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template> 
+
+<xsl:template match="*" mode="charcount">
+<xsl:param name="incurrent_length" select="0"/>
+<xsl:param name="nosibling" select="0"/>
+ <xsl:choose>
+  <xsl:when test="count(child::*) = 0">
+   <xsl:value-of select="$incurrent_length"/>
+  </xsl:when>
+  <xsl:otherwise>
+    <xsl:variable name="childlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length"/><xsl:with-param name="nosibling" select="0"/></xsl:apply-templates></xsl:variable>
+    <xsl:choose>
+    <xsl:when test="$framewidth > number($childlength) and ($nosibling = 0)">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$childlength"/></xsl:apply-templates></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="string($siblength) = &quot;&quot;">
+      <xsl:value-of select="number($childlength)"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:value-of select="number($siblength)"/>
+     </xsl:otherwise>
+     </xsl:choose>>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:value-of select="number($childlength)"/>
+    </xsl:otherwise>
+    </xsl:choose>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet> 
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/objcontent.xsl b/helm/style/style_prima_del_linguaggio_naturale/objcontent.xsl
new file mode 100644 (file)
index 0000000..6ad0a49
--- /dev/null
@@ -0,0 +1,232 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- XSLT version 0.1 of CIC objects to objects and MathML content:   -->
+<!-- First draft: March 21 2000, Irene Schena                         -->
+<!--******************************************************************-->
+
+<!--******************************************************************-->
+<!-- MANCA: gestione annotation e linking                             -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:import href="content.xsl"/>
+
+<!-- ROOT -->
+
+<xsl:template match="cicxml">
+    <xsl:variable name="url"><xsl:value-of select="@baseurl"/></xsl:variable>
+    <xsl:variable name="stylesheet"><xsl:value-of select="@stylesheet"/></xsl:variable>
+    <xsl:processing-instruction name="cocoon-format">type="text/xml"</xsl:processing-instruction>
+    <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select='concat($url,$stylesheet)'/>" type="text/xsl"</xsl:processing-instruction>
+    <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
+    <xsl:apply-templates select="*[1]"/>
+</xsl:template>
+
+<!-- CIC OBJECTS -->
+
+<xsl:template match="Definition" mode="noannot">
+    <Definition name="{@name}" helm:xref="{@id}">  
+     <xsl:if test="string(@params) != &quot;&quot;">
+      <Params>
+       <xsl:value-of select="@params"/>
+      </Params>
+     </xsl:if>
+<!--     <xsl:choose>
+      <xsl:when test="$showproof=0">
+       <body>
+        <m:mi>Here</m:mi>
+       </body>
+      </xsl:when>
+      <xsl:otherwise>
+       <body>
+        <xsl:apply-templates select="body"/>
+       </body>
+      </xsl:otherwise>
+     </xsl:choose> -->
+     <body>
+      <xsl:apply-templates select="body"/>
+     </body>
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </Definition> 
+</xsl:template>
+
+<xsl:template match="Axiom" mode="noannot"> 
+    <Axiom name="{@name}" helm:xref="{@id}">
+     <xsl:if test="string(@params) != &quot;&quot;">
+      <Params>
+       <xsl:value-of select="@params"/>
+      </Params>
+     </xsl:if>
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </Axiom> 
+</xsl:template>
+
+<xsl:template match="CurrentProof" mode="noannot">
+    <CurrentProof name="{@name}" helm:xref="{@id}">
+     <xsl:for-each select="Conjecture">
+      <Conjecture no="./{@no}">
+        <xsl:apply-templates select="."/>
+      </Conjecture>
+     </xsl:for-each>
+     <body>
+       <xsl:apply-templates select="body"/>
+     </body>
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </CurrentProof> 
+</xsl:template>
+
+<xsl:template match="InductiveDefinition" mode="noannot">
+    <InductiveDefinition helm:xref="{@id}">
+     <xsl:if test="string(@params) != &quot;&quot;">
+      <Params>
+       <xsl:value-of select="@params"/>
+      </Params>
+     </xsl:if> 
+     <xsl:if test="string(@noParams) != 0"> 
+      <xsl:apply-templates select="InductiveType/arity/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="@noParams"/>
+      </xsl:apply-templates>
+     </xsl:if>
+     <xsl:for-each select="InductiveType">
+      <InductiveType name="{./@name}" inductive="{./@inductive}">
+       <arity>
+         <xsl:apply-templates select="./arity/*[1]" mode="abstparams">
+          <xsl:with-param name="noparams" select="../@noParams"/>
+          <xsl:with-param name="target" select="1"/>
+         </xsl:apply-templates>
+       </arity>
+       <xsl:for-each select="./Constructor">
+        <Constructor name="{./@name}">
+          <xsl:apply-templates select="./*[1]" mode="abstparams">
+           <xsl:with-param name="noparams" select="../../@noParams"/>
+           <xsl:with-param name="target" select="1"/>
+          </xsl:apply-templates>
+        </Constructor>
+       </xsl:for-each>
+      </InductiveType>
+     </xsl:for-each> 
+    </InductiveDefinition>       
+</xsl:template>
+
+<xsl:template match="Variable" mode="noannot"> 
+    <Variable name="{@name}" helm:xref="{@id}">
+     <type>
+       <xsl:apply-templates select="type"/>
+     </type>
+    </Variable> 
+</xsl:template>
+
+<!--*******************************************-->
+<!--    ABSTRACTING PARAMETERS AND COUNTING    -->
+<!--*******************************************-->
+<!-- Si dimentica i CAST dei termini che astrae. Nel caso dell'astrazione -->
+<!-- dei lambda dei pattern del CASE, qualora i lambda non si trovino     -->
+<!-- nella forma weak-head, astrae solo i lambda che trova e restituisce  -->
+<!-- un corpo depurato da tutti i primi cast che precedono il termine     -->
+<!-- restituito.                                                          -->
+
+<xsl:template match="*" mode="abstparams">
+<xsl:param name="noparams" select="0"/>
+<xsl:param name="target" select="0"/>
+<xsl:param name="binder">PROD</xsl:param>
+    <xsl:choose>
+    <xsl:when test="($noparams != 0) and ((name(.)=string($binder)) or (name(.)=&quot;CAST&quot;))">
+     <xsl:choose>
+     <xsl:when test="name(.) = string($binder)">
+      <xsl:if test="$target = 0">
+       <xsl:choose>
+       <xsl:when test="string($binder) = &quot;LAMBDA&quot;">
+        <m:ci>
+         <xsl:value-of select="target/@binder"/>
+        </m:ci>
+       </xsl:when>
+       <xsl:otherwise> 
+        <Param name="{target/@binder}">
+         <xsl:apply-templates select="source" mode="noannot"/>
+        </Param>
+       </xsl:otherwise>
+       </xsl:choose>
+      </xsl:if>
+      <xsl:apply-templates select="target/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="$noparams - 1"/>
+       <xsl:with-param name="target" select="$target"/>
+       <xsl:with-param name="binder" select="$binder"/>
+      </xsl:apply-templates>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="term/*[1]" mode="abstparams">
+       <xsl:with-param name="noparams" select="$noparams"/>
+       <xsl:with-param name="target" select="$target"/>
+       <xsl:with-param name="binder" select="$binder"/>
+      </xsl:apply-templates>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise> 
+     <xsl:choose>
+     <xsl:when test="($target = 1) and ($noparams != 0)">
+      <m:apply>
+      <m:csymbol>app</m:csymbol>
+      <xsl:apply-templates select="." mode="noannot"/>
+      <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:choose>
+      <xsl:when test="$noparams != 0">
+      <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noparams"/></xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:if test="$target = 1">
+        <xsl:apply-templates select="." mode="noannot"/>
+       </xsl:if>
+      </xsl:otherwise>
+      </xsl:choose>
+     </xsl:otherwise>
+     </xsl:choose>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template name="printparam">
+<xsl:param name="noleft" select="0"/>
+<xsl:param name="number" select="1"/>
+    <xsl:if test="$noleft != 0">
+     <m:ci>$<xsl:value-of select="$number"/></m:ci>
+     <xsl:call-template name="printparam"><xsl:with-param name="noleft" select="$noleft - 1"/><xsl:with-param name="number" select="$number + 1"/></xsl:call-template>  
+    </xsl:if>
+</xsl:template>
+
+<xsl:template match="*" mode="counting">
+<xsl:param name="noparams" select="0"/>
+<xsl:param name="count" select="0"/>
+ <xsl:choose>
+ <xsl:when test="name(.) = &quot;PROD&quot;">
+  <xsl:apply-templates select="target/*[1]" mode="counting">
+   <xsl:with-param name="noparams" select="$noparams"/>
+   <xsl:with-param name="count" select="$count + 1"/>
+  </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="name(.) = &quot;CAST&quot;">
+  <xsl:apply-templates select="term/*[1]" mode="counting">
+   <xsl:with-param name="noparams" select="$noparams"/>
+   <xsl:with-param name="count" select="$count"/> 
+  </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+  <xsl:value-of select="$count - $noparams"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/params.xsl b/helm/style/style_prima_del_linguaggio_naturale/params.xsl
new file mode 100644 (file)
index 0000000..034eeba
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<!--***********************************************************************--> 
+<!-- auxiliary functions                                                   -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
+<!--***********************************************************************--> 
+
+<!--***********************************************************************-->
+<!-- get the name from a URI                                               -->
+<!--***********************************************************************-->
+
+<!-- CSC: PROBLEMA: URI CHE NON CONTENGONO / ED INIZIANO CON cic: -->
+<xsl:template name="name_of_uri">
+ <xsl:param name="uri" select="&quot;&quot;"/>
+ <xsl:variable name="suffix" select="substring-after($uri, &quot;/&quot;)"/>
+ <xsl:choose>
+  <xsl:when test="$suffix = &quot;&quot;">
+   <!-- CSC: PROBLEMA: .con PUO' APPARIRE ALL'INTERNO DELLE URI ===>
+     SCRIVERE UNA FUNZIONE RICORSIVA CHE RISOLVA -->
+   <xsl:value-of select="substring-before($uri,&quot;.con&quot;)"/>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="name_of_uri">
+    <xsl:with-param name="uri" select="$suffix"/>
+   </xsl:call-template>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<!--***********************************************************************-->
+<!-- erase common prefix from two uris                                     -->
+<!--***********************************************************************-->
+
+<xsl:template name="common_prefix">
+ <xsl:param name="first_uri" select="&quot;&quot;"/>
+ <xsl:param name="second_uri" select="&quot;&quot;"/>
+ <xsl:choose>
+  <xsl:when test="(substring-before($first_uri,&quot;/&quot;) = 
+                substring-before($second_uri,&quot;/&quot;) and 
+                substring-after($second_uri,&quot;/&quot;) != &quot;&quot;)">
+   <xsl:call-template name="common_prefix">
+    <xsl:with-param 
+        name="first_uri" select="substring-after($first_uri,&quot;/&quot;)"/>
+    <xsl:with-param 
+        name="second_uri" select="substring-after($second_uri,&quot;/&quot;)"/>    </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="slash_counting">
+    <xsl:with-param name="uri" select="$second_uri"/>
+    <xsl:with-param name="counter" select="0"/>
+   </xsl:call-template>
+  </xsl:otherwise>   
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="slash_counting">
+ <xsl:param name="uri" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="(substring-after($uri,&quot;/&quot;) != &quot;&quot;)">
+   <xsl:call-template name="slash_counting">
+    <xsl:with-param 
+        name="uri" select="substring-after($uri,&quot;/&quot;)"/>
+    <xsl:with-param
+        name="counter" select="$counter +1"/> 
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$counter"/>
+  </xsl:otherwise>
+ </xsl:choose>   
+</xsl:template>
+
+<xsl:template name="blank_counting">
+ <xsl:param name="string" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="(substring-after($string,&quot; &quot;) != &quot;&quot;)">
+   <xsl:call-template name="blank_counting">
+    <xsl:with-param 
+        name="string" select="substring-after($string,&quot; &quot;)"/>
+    <xsl:with-param 
+        name="counter" select="$counter +1"/> 
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$counter + 1"/>
+  </xsl:otherwise> 
+ </xsl:choose>  
+</xsl:template>
+
+<xsl:template name="double_point_counting">
+ <xsl:param name="string" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="(substring-after($string,&quot;:&quot;) != &quot;&quot;)">
+   <xsl:call-template name="double_point_counting">
+    <xsl:with-param 
+        name="string" select="substring-after($string,&quot;:&quot;)"/>
+    <xsl:with-param 
+        name="counter" select="$counter +1"/> 
+   </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:value-of select="$counter"/>
+  </xsl:otherwise> 
+ </xsl:choose>  
+</xsl:template>
+
+<xsl:template name="min">
+ <xsl:param name="string" select="&quot;&quot;"/>
+ <xsl:param name="counter" select="0"/>
+ <xsl:choose>
+  <xsl:when test="contains($string,concat($counter,&quot;:&quot;))
+         or (0 > $counter)">
+  <xsl:value-of select="$counter"/>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="min">
+    <xsl:with-param 
+        name="string" select="$string"/>
+    <xsl:with-param 
+        name="counter" select="$counter -1"/> 
+   </xsl:call-template>
+  </xsl:otherwise>
+ </xsl:choose>  
+</xsl:template>
+
+<xsl:template name="get_no_params">
+    <xsl:param name="first_uri" select="&quot;&quot;"/>
+    <xsl:param name="second_uri" select="&quot;&quot;"/>
+     <xsl:variable name="offset">
+      <xsl:call-template name="common_prefix">
+       <xsl:with-param name="first_uri" select="$first_uri"/>
+       <xsl:with-param name="second_uri" select="$second_uri"/>
+      </xsl:call-template>
+     </xsl:variable>
+     <xsl:choose>
+      <xsl:when test="$offset > 0">
+       <xsl:variable name="params"> 
+        <xsl:value-of 
+            select="document(concat(string($absPath),$second_uri))/*/@params"/>
+       </xsl:variable>
+       <xsl:variable name="minimum">
+        <xsl:call-template name="min">
+         <xsl:with-param name="string" select="$params"/>
+         <xsl:with-param name="counter" select="$offset - 1"/>
+        </xsl:call-template>
+       </xsl:variable>
+       <xsl:choose>
+        <xsl:when test="0 > $minimum">
+         0
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:variable name="relevant_params">
+          <!-- the blank after : in the next line is essential -->
+          <xsl:value-of 
+            select="substring-after($params,concat($minimum,&quot;: &quot;))"/>
+         </xsl:variable>
+         <xsl:variable name="tokens">
+          <xsl:call-template name="blank_counting">
+           <xsl:with-param name="string" select="$relevant_params"/>
+           <xsl:with-param name="counter" select="0"/>
+          </xsl:call-template>
+         </xsl:variable>
+         <xsl:variable name="separators">
+          <xsl:call-template name="double_point_counting">
+           <xsl:with-param name="string" select="$relevant_params"/>
+           <xsl:with-param name="counter" select="0"/>
+          </xsl:call-template>
+         </xsl:variable>
+         <xsl:value-of select="$tokens - $separators"/>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+      0
+      </xsl:otherwise>
+     </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet> 
+
+
+
+
+
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/reals.xsl b/helm/style/style_prima_del_linguaggio_naturale/reals.xsl
new file mode 100644 (file)
index 0000000..0e4afef
--- /dev/null
@@ -0,0 +1,277 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Reals                                                            -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm"
+                              xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+<!-- REALS -->
+
+<!--
+<xsl:template match="CONST[attribute::uri='cic:/coq/REALS/Raxioms/R.con']" mode="noannot">
+ <m:reals/>
+</xsl:template>
+-->
+
+<!-- 0 e 1 -->
+
+<xsl:template match="CONST[attribute::uri='cic:/coq/REALS/Raxioms/R0.con']" mode="noannot">
+ <m:cn definitionURL="{@uri}" helm:xref="{@id}">0</m:cn>
+</xsl:template>
+
+<xsl:template match="CONST[attribute::uri='cic:/coq/REALS/Raxioms/R1.con']" mode="noannot">
+ <m:cn definitionURL="{@uri}" helm:xref="{@id}">1</m:cn>
+</xsl:template>
+
+
+
+<!-- Unary Operations -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Raxioms/Ropp.con' or
+ attribute::uri='cic:/coq/REALS/Rbasic_fun/Rabsolu.con' or
+ attribute::uri='cic:/coq/REALS/Rfunctions/fact.con' or
+ attribute::uri='cic:/coq/REALS/Rbase/Rsqr.con']]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 2">
+      <xsl:variable name="elem">
+       <xsl:choose>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Ropp.con'">
+         <xsl:value-of select="'minus'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rbasic_fun/Rabsolu.con'">
+         <xsl:value-of select="'abs'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rfunctions/fact.con'">
+         <xsl:value-of select="'factorial'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rbase/Rsqr.con'">
+         <xsl:value-of select="'root'"/>
+        </xsl:when>
+       </xsl:choose>
+      </xsl:variable>
+      <m:apply helm:xref="{@id}">
+       <xsl:element name="{concat('m:',$elem)}">
+        <xsl:attribute name="definitionURL">
+         <xsl:value-of select="CONST/@uri"/> 
+        </xsl:attribute>
+        <xsl:attribute name="helm:xref">
+         <xsl:value-of select="CONST/@id"/>
+        </xsl:attribute>
+       </xsl:element>
+       <xsl:apply-templates select="*[2]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Raxioms/Rinv.con']]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 2">
+      <m:apply helm:xref="{@id}">
+       <m:power/>
+       <xsl:apply-templates select="*[2]" mode="noannot"/>
+       <m:apply>
+        <m:minus>
+         <xsl:attribute name="definitionURL">
+          <xsl:value-of select="CONST/@uri"/> 
+         </xsl:attribute>
+        </m:minus>
+        <xsl:attribute name="helm:xref">
+         <xsl:value-of select="CONST/@id"/>
+        </xsl:attribute>
+        <m:cn>1</m:cn>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- Binary Operations and Relations -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Raxioms/Rplus.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rminus.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rmult.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rle.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rlt.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rge.con' or
+ attribute::uri='cic:/coq/REALS/Raxioms/Rgt.con' or
+ attribute::uri='cic:/coq/REALS/Rbasic_fun/Rmin.con' or
+ attribute::uri='cic:/coq/REALS/Rfunctions/pow.con']]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 3">
+      <xsl:variable name="elem">
+       <xsl:choose>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rplus.con'">
+         <xsl:value-of select="'plus'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rminus.con'">
+         <xsl:value-of select="'minus'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rmult.con'">
+         <xsl:value-of select="'times'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rle.con'">
+         <xsl:value-of select="'leq'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rlt.con'">
+         <xsl:value-of select="'lt'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rge.con'">
+         <xsl:value-of select="'geq'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Raxioms/Rgt.con'">
+         <xsl:value-of select="'gt'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rbasic_fun/Rmin.con'">
+         <xsl:value-of select="'min'"/>
+        </xsl:when>
+        <xsl:when test="CONST/@uri='cic:/coq/REALS/Rfunctions/pow.con'">
+         <xsl:value-of select="'power'"/>
+        </xsl:when>
+       </xsl:choose>
+      </xsl:variable>
+      <m:apply helm:xref="{@id}">
+       <xsl:element name="{concat('m:',$elem)}">
+        <xsl:attribute name="definitionURL">
+         <xsl:value-of select="CONST/@uri"/> 
+        </xsl:attribute>
+        <xsl:attribute name="helm:xref">
+         <xsl:value-of select="CONST/@id"/>
+        </xsl:attribute>
+       </xsl:element>
+       <xsl:apply-templates select="*[2]" mode="noannot"/>
+       <xsl:apply-templates select="*[3]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- LIMIT -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Rlimit/limit1_in.con']]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 5">
+      <m:apply>
+       <m:eq/>
+       <xsl:choose>
+        <xsl:when test="name(*[2]) = 'LAMBDA'">
+         <m:apply helm:xref="{@id}">
+          <m:limit>
+           <xsl:attribute name="definitionURL">
+            <xsl:value-of select="CONST/@uri"/> 
+           </xsl:attribute>
+           <xsl:attribute name="helm:xref">
+            <xsl:value-of select="CONST/@id"/>
+           </xsl:attribute>
+          </m:limit>
+          <m:bvar>
+           <m:ci><xsl:value-of select="LAMBDA/target/@binder"/></m:ci>
+          </m:bvar>
+          <m:lowlimit>
+           <xsl:apply-templates select="*[5]" mode="noannot"/>
+          </m:lowlimit>
+          <xsl:apply-templates select="*[2]/target" mode="noannot"/>
+         </m:apply>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:apply helm:xref="{@id}">
+          <m:limit/>
+          <m:bvar>
+           <m:ci>$x</m:ci>
+          </m:bvar>
+          <m:lowlimit>
+           <xsl:apply-templates select="*[5]" mode="noannot"/>
+          </m:lowlimit>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[2]" mode="noannot"/>
+           <m:ci>$x</m:ci>
+          </m:apply>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+       <xsl:apply-templates select="*[4]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- DIFFERENTIATION -->
+
+<xsl:template match="APPLY[CONST[
+ attribute::uri='cic:/coq/REALS/Rderiv/D_in.con']]" mode="noannot">
+    <xsl:choose>
+     <xsl:when test="count(child::*) = 4">
+      <m:apply>
+       <m:eq/>
+       <xsl:choose>
+        <xsl:when test="name(*[2]) = 'LAMBDA'">
+         <m:apply helm:xref="{@id}">
+          <m:diff >
+           <xsl:attribute name="definitionURL">
+            <xsl:value-of select="CONST/@uri"/> 
+           </xsl:attribute>
+           <xsl:attribute name="helm:xref">
+            <xsl:value-of select="CONST/@id"/>
+           </xsl:attribute>
+          </m:diff>
+          <m:bvar>
+           <m:ci><xsl:value-of select="LAMBDA[1]/target/@binder"/></m:ci>
+          </m:bvar>
+          <xsl:apply-templates select="*[2]/target" mode="noannot"/>
+         </m:apply>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:apply helm:xref="{@id}">
+          <m:diff/>
+          <m:bvar>
+           <m:ci>$x</m:ci>
+          </m:bvar>
+          <m:apply>
+           <m:csymbol>app</m:csymbol>
+           <xsl:apply-templates select="*[2]" mode="noannot"/>
+           <m:ci>$x</m:ci>
+          </m:apply>
+         </m:apply>
+        </xsl:otherwise>
+       </xsl:choose>
+       <xsl:apply-templates select="*[4]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/ricerca.xsl b/helm/style/style_prima_del_linguaggio_naturale/ricerca.xsl
new file mode 100644 (file)
index 0000000..e0fa13a
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+
+
+<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="html"/>
+
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<xsl:template match="/">
+               <html> 
+                <head></head>
+                <body>
+                <xsl:apply-templates select="Theory"/>
+                </body>
+               </html>
+</xsl:template>
+
+
+<!-- CIC TERMS -->
+
+
+
+<xsl:template match="MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind']" mode="search" >
+<!-- <xsl:param name="current_uri" select=""/> -->
+<!-- <h1><xsl:value-of select="string(@uri)"/></h1> -->
+<!-- <xsl:if test="string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'"> -->
+  <xsl:value-of select="$current_uri"/><BR/>
+<!-- </xsl:if> -->
+</xsl:template>
+
+<!-- AGGIUNGERE cic: alle uri nei file Theory -->
+
+<xsl:template match="Theory">
+<!-- <xsl:param name="current_uri" select=""/> -->
+ <xsl:apply-templates>
+  <xsl:with-param name="current_uri" select="string(@uri)"/>
+ </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="VARIABLE">
+<!-- <xsl:param name="current_uri" select=""/> -->
+<xsl:variable name="found" 
+  select="boolean(document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))//MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'])"/>
+<xsl:if test="$found">
+  <xsl:value-of select="concat(string($current_uri),&quot;/&quot;,string(@uri),&quot;.xml&quot;)"/><BR/>
+</xsl:if>
+
+<!--   <xsl:with-param name="current_uri" select="concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates> -->
+</xsl:template>
+
+<xsl:template match="DEFINITION">
+<!-- <xsl:param name="current_uri" select=""/> -->
+<!-- <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))" mode="search">
+  <xsl:with-param name="current_uri" select="concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates> -->
+<xsl:variable name="found" 
+  select="boolean(document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))//MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'])"/>
+<xsl:if test="$found">
+  <xsl:value-of select="concat(string($current_uri),&quot;/&quot;,string(@uri),&quot;.xml&quot;)"/><BR/>
+</xsl:if>
+</xsl:template>
+
+<xsl:template match="THEOREM">
+<!-- <xsl:param name="current_uri" select=""/> -->
+<!-- <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))" mode="search">
+  <xsl:with-param name="current_uri" select="concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates> -->
+<xsl:variable name="found" 
+  select="boolean(document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))//MUTIND[string(@uri)='cic:/coq/INIT/Logic/Equality/eq.ind'])"/>
+<xsl:if test="$found">
+  <xsl:value-of select="concat(string($current_uri),&quot;/&quot;,string(@uri),&quot;.xml&quot;)"/><BR/>
+</xsl:if>
+</xsl:template>
+
+
+<xsl:template match="SECTION">
+<!-- <xsl:param name="current_uri" select=""/> -->
+ <xsl:apply-templates>
+  <xsl:with-param name="current_uri" select="concat($current_uri,&quot;/&quot;,string(@uri))"/>
+ </xsl:apply-templates>
+
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/rootcontent.xsl b/helm/style/style_prima_del_linguaggio_naturale/rootcontent.xsl
new file mode 100644 (file)
index 0000000..2a680a4
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of the stylesheet to accomplish the right inclusion  -->
+<!-- of the content stylesheets:                                           -->
+<!-- First draft: May 26 2000, Claudio Sacerdoti Coen, Irene Schena        -->
+<!--***********************************************************************-->
+
+<!-- Schema of stylesheet precedences (from highest to lowest):          -->
+<!-- set -> basic -> annotatedcont                                       -->
+<!-- because theory_content is imported and has lower precendence than   -->
+<!-- the templates of rootcontent (i.e. the templates of set and basic). -->
+<!-- annotatedcont -> objcontent -> content                              -->
+<!-- because theory_content generates an import precedence tree.         --> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+
+<xsl:import href="annotatedcont.xsl"/>
+<xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
+<xsl:include href="basic.xsl"/>
+<xsl:include href="set.xsl"/>
+<xsl:include href="reals.xsl"/>
+
+<xsl:variable name="showproof" select="0"/>
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/roottheory.xsl b/helm/style/style_prima_del_linguaggio_naturale/roottheory.xsl
new file mode 100644 (file)
index 0000000..d293ee6
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of the stylesheet to accomplish the right inclusion  -->
+<!-- of the theory content stylesheets:                                    -->
+<!-- First draft: May 26 2000, Claudio Sacerdoti Coen, Irene Schena        -->
+<!--***********************************************************************-->
+
+<!-- Schema of stylesheet precedences (from highest to lowest):          -->
+<!-- set -> basic -> theory_content                                      -->
+<!-- because theory_content is imported and has lower precendence than   -->
+<!-- the templates of rootcontent (i.e. the templates of set and basic). -->
+<!-- theory_content -> annotatedcont -> objcontent -> content            -->
+<!-- because theory_content generates an import precedence tree.         --> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="theory_content.xsl"/>
+<xsl:include href="basic.xsl"/>
+<xsl:include href="set.xsl"/>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/set.xsl b/helm/style/style_prima_del_linguaggio_naturale/set.xsl
new file mode 100644 (file)
index 0000000..303c872
--- /dev/null
@@ -0,0 +1,487 @@
+<?xml version="1.0"?>
+
+<!--******************************************************************--> 
+<!-- Basic Set Theory                                                 -->
+<!-- First draft: April 3 2000                                        -->
+<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                 -->
+<!--******************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML"
+                              xmlns:helm="http://www.cs.unibo.it/helm">
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- ************************* LOGIC *********************************-->
+
+
+
+<xsl:template match="*" mode="set">
+    <xsl:choose>
+     <xsl:when test="name() = 'LAMBDA'">
+      <m:set>
+       <m:bvar>
+        <m:ci>
+         <xsl:value-of select="target/@binder"/>
+        </m:ci>
+        <m:type>
+         <xsl:apply-templates select="source" mode="noannot"/>
+        </m:type>
+       </m:bvar>
+       <m:condition>
+        <xsl:apply-templates select="target" mode="noannot"/>
+       </m:condition>
+      </m:set>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="." mode="noannot"/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- IN -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/In.con']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       <!-- <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/> -->
+       <xsl:apply-templates select="*[2+$no_params]" mode="set" /> 
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- NOT-IN -->
+<!-- NOT ha no parameters -->
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/INIT/Logic/not.con']
+and (count(child::*) = 2) and APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/In.con']]]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="APPLY/CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(APPLY/child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:notin/>
+       <xsl:apply-templates select="*[2]/*[3+$no_params]" mode="noannot"/>
+  <!-- <xsl:apply-templates select="*[2]/*[2+$no_params]" mode="noannot"/> -->
+       <xsl:apply-templates select="*[2]/*[2+$no_params]" mode="set"/>  
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- EMPTY SET -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Empty_set.ind']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 1">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 2">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- SINGLETON -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Singleton.ind']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 2">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}">
+        <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- COUPLE -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Couple.ind']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}">
+        <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- TRIPLE -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Triple.ind'] and (count(child::*) = 5)]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:set definitionURL="{MUTIND/@uri}" helm:xref="{@id}">
+       <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+      </m:set>
+     </xsl:when>   
+     <xsl:when test="(count(child::*) - number($no_params)) = 5">
+      <m:apply helm:xref="{@id}">
+       <m:in definitionURL="cic:/coq/SETS/Ensembles/Ensembles/In.con"/>
+       <xsl:apply-templates select="*[5+$no_params]" mode="noannot"/>
+       <m:set definitionURL="{MUTIND/@uri}">
+        <xsl:apply-templates select="*[2+$no_params]" mode="noannot"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+        <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- INTERSECTION -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Intersection.ind']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:intersect definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:intersect definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+
+<!-- UNION -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Union.ind']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:union definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:union definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- INCLUDED -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Included.con']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:subset definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- STRICTLY INCLUDED -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Strict_Included.con']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:prsubset definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- SET-DIFF -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Setminus.con']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <xsl:apply-templates select="*[3+$no_params]" mode="set"/>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- ADD-ELEM -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Add.con']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:union definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <m:set>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:union definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <m:set>
+         <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+        </m:set>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- SUBTRACT-ELEM -->
+
+<xsl:template match="APPLY[CONST[attribute::uri='cic:/coq/SETS/Ensembles/Ensembles/Subtract.con']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="CONST/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+       <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       <m:set>
+        <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+       </m:set>
+      </m:apply>
+     </xsl:when>
+     <xsl:when test="(count(child::*) - number($no_params)) = 4">
+      <m:apply helm:xref="{@id}">
+       <m:in/>
+       <xsl:apply-templates select="*[4+$no_params]" mode="noannot"/>
+       <m:apply>
+        <m:setdiff definitionURL="{CONST/@uri}" helm:xref="{CONST/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+        <m:set>
+         <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+        </m:set>
+       </m:apply>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+<!-- CARD -->
+
+<xsl:template match="APPLY[MUTIND[attribute::uri='cic:/coq/SETS/Finite_sets/Ensembles_finis/cardinal.ind']]" mode="noannot">
+    <xsl:variable name="no_params">
+     <xsl:call-template name="get_no_params">
+      <xsl:with-param name="first_uri" select="/cicxml/@uri"/>
+      <xsl:with-param name="second_uri" select="MUTIND/@uri"/>
+     </xsl:call-template>
+    </xsl:variable>
+    <xsl:choose>
+     <xsl:when test="(count(child::*) - number($no_params)) = 3">
+      <m:apply helm:xref="{@id}">
+       <m:eq/>
+       <m:apply>
+        <m:card definitionURL="{MUTIND/@uri}" helm:xref="{MUTIND/@id}"/>
+        <xsl:apply-templates select="*[2+$no_params]" mode="set"/>
+       </m:apply>
+       <xsl:apply-templates select="*[3+$no_params]" mode="noannot"/>
+      </m:apply>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-imports/>
+     </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/helm/style/style_prima_del_linguaggio_naturale/theory_content.xsl b/helm/style/style_prima_del_linguaggio_naturale/theory_content.xsl
new file mode 100644 (file)
index 0000000..9b65cc5
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of theory objects to theory sections:                -->
+<!-- First draft: May 08 2000, Claudio Sacerdoti Coen, Irene Schena        -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="rootcontent.xsl"/>
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
+
+<!-- THEORY -->
+
+<xsl:template match="Theory">
+    <SECTION>
+     <xsl:apply-templates><xsl:with-param name="current_uri" select="string(@uri)"/></xsl:apply-templates>
+    </SECTION>
+</xsl:template>
+
+<!-- SUBTHEORY -->
+
+<xsl:template match="SECTION">
+<xsl:param name="current_uri"/>
+    <SECTION>
+     <xsl:apply-templates><xsl:with-param name="current_uri" select="concat($current_uri,&quot;/&quot;,string(@uri))"/></xsl:apply-templates>
+    </SECTION>
+</xsl:template>
+
+<!-- THEORY ELEMENTS -->
+
+<xsl:template match="DEFINITION">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+<xsl:template match="AXIOM">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+<xsl:template match="THEOREM">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+<xsl:template match="VARIABLE">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/style_prima_del_linguaggio_naturale/theory_pres.xsl b/helm/style/style_prima_del_linguaggio_naturale/theory_pres.xsl
new file mode 100644 (file)
index 0000000..9a96cdc
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of theory sections to HTML:                          -->
+<!-- First draft: May 10 2000, Irene Schena                                -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<xsl:include href="annotatedpres.xsl"/>
+
+<xsl:template match="SECTION">
+<xsl:param name="subsect" select="0"/>
+    <xsl:choose>
+    <xsl:when test="$subsect = 0">
+     <html> 
+      <head></head>
+      <body>
+       <m:math><m:mtext>BEGIN SECTION</m:mtext></m:math>
+       <xsl:apply-templates select="*"><xsl:with-param name="subsect" select="1"/></xsl:apply-templates>
+       <m:math><m:mtext>END SECTION</m:mtext></m:math>
+      </body>
+     </html>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:math><m:mtext>BEGIN SECTION</m:mtext></m:math>
+      <xsl:apply-templates select="*"><xsl:with-param name="subsect" select="1"/></xsl:apply-templates>
+     <m:math><m:mtext>END SECTION</m:mtext></m:math>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/theory_content.xsl b/helm/style/theory_content.xsl
new file mode 100644 (file)
index 0000000..5ff5a41
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of theory objects to theory sections:                -->
+<!-- First draft: May 08 2000, Claudio Sacerdoti Coen, Irene Schena        -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="rootcontent.xsl"/>
+
+<!--******************************************************************-->
+<!-- Variable containing the absolute path of the CIC file            -->
+<!--******************************************************************-->
+
+<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+
+<!-- THEORY -->
+
+<xsl:template match="Theory">
+    <SECTION>
+     <xsl:apply-templates><xsl:with-param name="current_uri" select="string(@uri)"/></xsl:apply-templates>
+    </SECTION>
+</xsl:template>
+
+<!-- SUBTHEORY -->
+
+<xsl:template match="SECTION">
+<xsl:param name="current_uri"/>
+    <SECTION>
+     <xsl:apply-templates><xsl:with-param name="current_uri" select="concat($current_uri,&quot;/&quot;,string(@uri))"/></xsl:apply-templates>
+    </SECTION>
+</xsl:template>
+
+<!-- THEORY ELEMENTS -->
+
+<xsl:template match="DEFINITION">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+<xsl:template match="AXIOM">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+<xsl:template match="THEOREM">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+<xsl:template match="VARIABLE">
+<xsl:param name="current_uri"/>
+    <xsl:apply-templates select="document(concat(string($absPath),string($current_uri),&quot;/&quot;,string(@uri)))"/>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/style/theory_pres.xsl b/helm/style/theory_pres.xsl
new file mode 100644 (file)
index 0000000..f8ade2a
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<!--***********************************************************************--> 
+<!-- XSLT version 0.1 of theory sections to HTML:                          -->
+<!-- First draft: May 10 2000, Irene Schena                                -->
+<!--              November 15 2000, Irene Schena                           -->
+<!--***********************************************************************--> 
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:m="http://www.w3.org/1998/Math/MathML">
+
+<xsl:import href="annotatedpres.xsl"/>
+
+<xsl:template match="SECTION">
+<xsl:param name="subsect" select="0"/>
+    <xsl:choose>
+    <xsl:when test="$subsect = 0">
+     <html> 
+      <head></head>
+      <body>
+       <m:math><m:mtext>BEGIN SECTION</m:mtext></m:math>
+       <xsl:apply-templates select="*"><xsl:with-param name="subsect" select="1"/></xsl:apply-templates>
+       <m:math><m:mtext>END SECTION</m:mtext></m:math>
+      </body>
+     </html>
+    </xsl:when>
+    <xsl:otherwise>
+     <m:math><m:mtext>BEGIN SECTION</m:mtext></m:math>
+      <xsl:apply-templates select="*"><xsl:with-param name="subsect" select="1"/></xsl:apply-templates>
+     <m:math><m:mtext>END SECTION</m:mtext></m:math>
+    </xsl:otherwise>
+    </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>