Quelle miz.xml
Sprache: XML
|
|
<? xml version= '1.0' encoding= 'UTF-8'?>
<!-- This file is now automatically produced from the files in the MHTML directory. -->
<!-- Its only reason is to have just one big .xsl file in the Mizar distro. -->
<!-- So any changes should be done to the MHTML files, running 'make miz.xsl' afterwards. -->
<!-- The main stylesheet mhtml_main.xsl can be used instead miz.xsl, -->
<!-- provided the included .xsl files are available in the same directory -->
< xsl: stylesheet version= "1.0" extension- element-prefixes= "dc" xmlns:dc= "http://purl.org/dc/elements/1.1/" xmlns: xsl= "http://www.w3.org/1999/XSL/Transform">
< xsl:output method= "html"/>
<!-- $Revision: 1.8 $ -->
<!-- -->
<!-- File: mhtml_main.xsltxt - html-ization of Mizar XML, main file -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- XSLTXT (https://xsltxt.dev.java.net/) stylesheet taking -->
<!-- XML terms, formulas and types to less verbose format. -->
<!-- To produce standard XSLT from this do e.g.: -->
<!-- java -jar xsltxt.jar toXSL miz.xsltxt | sed -e 's/<!\-\- *\(<\/*xsl:document.*\) *\-\->/\1/g' >miz.xsl -->
<!-- (the sed hack is there because xsl:document is not yet supported by xsltxtx) -->
<!-- Then e.g.: xsltproc miz.xsl ordinal2.pre >ordinal2.pre1 -->
<!-- TODO: number B vars in fraenkel - done since 1.72 -->
<!-- handle F and H parenthesis as K parenthesis -->
<!-- article numbering in Ref? -->
<!-- absolute definiens numbers for thesisExpansions? - done -->
<!-- do not display BlockThesis for Proof? - done, should but should be optional for Now -->
<!-- add @nr to canceled -->
<!-- Constructor should know its serial number! - needed in defs -->
<!-- possibly also article? -->
<!-- change globally 'G' to 'L' for types? -> then change the -->
<!-- hacks here and in emacs.el -->
<!-- display definiens? - done -->
<!-- NOTES: constructor disambiguation is done using the absolute numbers -->
<!-- (attribute 'nr' and 'aid' of the Constructor element. -->
<!-- This info for Constructors not defined in the article is -->
<!-- taken from the .atr file (see variable $constrs) -->
<!-- -->
<!-- File: params.xsltxt - html-ization of Mizar XML, top-level parameters -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- The following are user-customizable -->
<!-- mmlquery address -->
< xsl:param name= "mmlq">
< xsl:text> http://merak.pb.bialystok.pl/mmlquery/fillin.php?entry=</ xsl:text>
</ xsl:param>
<!-- #mmlq= {"";} -->
<!-- linking methods: -->
<!-- "q" - query, everything is linked to mmlquery -->
<!-- "s" - self, everything is linked to these xml/html files -->
<!-- "m" - mizaring and mmlquery, current article's constructs are linked to self, -->
<!-- the rest is linked to mmlquery -->
<!-- "l" - local mizaring, current article's constructs are linked to self, -->
<!-- the rest to $MIZFILES/html -->
< xsl:param name= "linking">
< xsl:text>l</ xsl:text>
</ xsl:param>
<!-- needed for local linking, document("") gives the sylesheet as a document -->
< xsl:param name= "mizfiles">
< xsl:value-of select= "string(/*/@mizfiles)"/>
</ xsl:param>
< xsl:param name= "mizhtml">
< xsl:value-of select= "concat("file://",$mizfiles,"html/")"/>
</ xsl:param>
<!-- extension for linking to other articles - either xml or html -->
< xsl:param name= "ext">
< xsl:text> html</ xsl:text>
</ xsl:param>
<!-- extension for linking to other articles - either xml or html -->
< xsl:param name= "selfext">
< xsl:choose>
< xsl:when test= "$linking = "l"">
< xsl:text> xml</ xsl:text>
</ xsl:when>
< xsl:when test= "$linking = "s"">
< xsl:value-of select= "$ext"/>
</ xsl:when>
< xsl:when test= "$linking = "m"">
< xsl:text> xml</ xsl:text>
</ xsl:when>
< xsl:when test= "$linking = "q"">
< xsl:text> html</ xsl:text>
</ xsl:when>
</ xsl:choose>
</ xsl:param>
<!-- default target frame for links -->
< xsl:param name= "default_target">
< xsl:choose>
< xsl:when test= "$linking = "s"">
< xsl:text>_self</ xsl:text>
</ xsl:when>
< xsl:otherwise>
< xsl:text>mmlquery</ xsl:text>
</ xsl:otherwise>
</ xsl:choose>
</ xsl:param>
<!-- put titles to links or not -->
< xsl:param name= "titles">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- coloured output or not -->
< xsl:param name= "colored">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- print identifiers (like in JFM) instead of normalized names -->
< xsl:variable name= "print_identifiers">
< xsl:text> 1</ xsl:text>
</ xsl:variable>
<!-- new brackets: trying to print brackets as mizar does - -->
<!-- when two or more arguments of a functor - now default -->
< xsl:param name= "mizar_brackets">
< xsl:text> 1</ xsl:text>
</ xsl:param>
<!-- no spaces around functor symbols -->
< xsl:param name= "funcs_no_spaces">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- print label identifiers instead of normalized names -->
<!-- this is kept separate from $print_identifiers, because -->
<!-- it should be turned off for item generating -->
< xsl:variable name= "print_lab_identifiers">
< xsl:text> 1</ xsl:text>
</ xsl:variable>
<!-- print "for" in registrations - newly in version 1132 -->
< xsl:param name= "regs_use_for">
< xsl:text> 1</ xsl:text>
</ xsl:param>
<!-- tells whether relative or absolute names are shown -->
< xsl:param name= "relnames">
< xsl:text> 1</ xsl:text>
</ xsl:param>
<!-- link by (now also from) inferences to ATP solutions rendered by MMLQuery; experimental - off -->
<!-- 1 - static linking (to pre-generated html) -->
<!-- 2 - dynamic linking to MML Query (static dli sent to MMLQuery DLI-processor) -->
<!-- 3 - dynamic linking to the TPTP-processor CGI ($lbytptpcgi) -->
< xsl:param name= "linkby">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- if non zero, add icons for atp exlpanation calls to theorems and proofs in the same way as to by's -->
< xsl:param name= "linkarproofs">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- if > 0, call the mk_by_title function to create a title for by|from|; -->
< xsl:param name= "by_titles">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- If 1, the target frame for by explanations is _self -->
< xsl:param name= "linkbytoself">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- directory with by ATP solutions in HTML; each article in its own subdir -->
< xsl:param name= "lbydir">
< xsl:text>_by/</ xsl:text>
</ xsl:param>
<!-- directory with by ATP solutions in DLI; each article in its own subdir -->
<!-- now whole url for the CGI script -->
< xsl:param name= "lbydliurl">
< xsl:text> http://lipa.ms.mff.cuni.cz/~urban/xmlmml/html. 930/_by_dli/</ xsl:text>
</ xsl:param>
<!-- URL of the DLI-processor CGI -->
< xsl:param name= "lbydlicgi">
< xsl:text> http://mmlquery.mizar.org/cgi-bin/mmlquery/dli</ xsl:text>
</ xsl:param>
<!-- complete prefix of the DLI-processor CGI request -->
< xsl:variable name= "lbydlicgipref">
< xsl:value-of select= "concat($lbydlicgi,"?url=",$lbydliurl)"/>
</ xsl:variable>
<!-- URL of the MizAR root dir -->
<!-- #ltptproot= { "http://octopi.mizar.org/~mptp/"; } -->
< xsl:param name= "ltptproot">
< xsl:text> http://mws.cs.ru.nl/~mptp/</ xsl:text>
</ xsl:param>
<!-- URL of the TPTP-processor CGI -->
< xsl:param name= "ltptpcgi">
< xsl:value-of select= "concat($ltptproot,"cgi-bin/")"/>
</ xsl:param>
<!-- URL of the showby CGI -->
< xsl:param name= "lbytptpcgi">
< xsl:value-of select= "concat($ltptpcgi,"showby.cgi")"/>
</ xsl:param>
<!-- URL of the showtmpfile CGI -->
< xsl:param name= "ltmpftptpcgi">
< xsl:value-of select= "concat($ltptpcgi,"showtmpfile.cgi")"/>
</ xsl:param>
<!-- tells if by action is fetched through AJAX; default is off -->
< xsl:param name= "ajax_by">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- temporary dir with the tptp by files, needs to be passed as a param -->
< xsl:param name= "lbytmpdir">
< xsl:text/>
</ xsl:param>
<!-- additional params for lbytptpcgi, needs to be passed as a param -->
< xsl:param name= "lbycgiparams">
< xsl:text/>
</ xsl:param>
<!-- add links to tptp files for thms -->
< xsl:param name= "thms_tptp_links">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- add editing, history, and possibly other links for wiki -->
<!-- the namespace for the scripts is taken from #ltptproot -->
< xsl:param name= "wiki_links">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- add buttons for editing wiki sections -->
< xsl:param name= "wiki_sections">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- domain name of the "wiki" server -->
< xsl:param name= "lwikihost">
< xsl:text>mws.cs.ru.nl</ xsl:text>
</ xsl:param>
<!-- URL of the "wiki" server -->
< xsl:param name= "lwikiserver">
< xsl:value-of select= "concat("http://",$lwikihost)"/>
</ xsl:param>
<!-- URL of the "mwiki" cgi, used for mwiki actions -->
< xsl:param name= "lmwikicgi">
< xsl:value-of select= "concat($lwikiserver,"/cgi-bin/mwiki/mwiki.cgi")"/>
</ xsl:param>
<!-- name of the index page for wiki -->
< xsl:param name= "lmwikiindex">
< xsl:text> 00INDEX. html</ xsl:text>
</ xsl:param>
<!-- URL of the "wiki" raw cgi, showing the raw file -->
< xsl:param name= "lrawcgi">
< xsl:value-of select= "concat($lwikiserver,"/cgi-bin/mwiki/raw.cgi")"/>
</ xsl:param>
<!-- URL of the "gitweb" cgi, showing git history -->
< xsl:param name= "lgitwebcgi">
< xsl:value-of select= "concat($lwikiserver,":1234/")"/>
</ xsl:param>
<!-- name of the git repository (project) in which this page is contained - -->
<!-- used for gitweb history -->
< xsl:param name= "lgitproject">
< xsl:text>mw1.git</ xsl:text>
</ xsl:param>
<!-- git clone address used for wiki cloning -->
< xsl:param name= "lgitclone">
< xsl:value-of select= "concat("git://",$lwikihost,"/git/", $lgitproject)"/>
</ xsl:param>
<!-- http clone address used for wiki cloning -->
< xsl:param name= "lhttpclone">
< xsl:value-of select= "concat("http://",$lwikihost,"/git/", $lgitproject)"/>
</ xsl:param>
<!-- tells if linkage of proof elements is done; default is off -->
< xsl:param name= "proof_links">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- tells if linkage of constants is done; default is 0 (off), -->
<!-- 1 tells to only create the anchors, 2 tells to also link constants -->
<!-- ##TODO: 2 is implement incorrectly and should not be used now, -->
<!-- it should be done like privname (via the C key, not like now) -->
< xsl:param name= "const_links">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- tells if proofs are fetched through AJAX; default is off -->
<!-- value 2 tells to produce the proofs, but not to insert the ajax calls, -->
<!-- and instead insert tags for easy regexp-based post-insertion of files -->
<!-- value 3 uses the ltmpftptpcgi to fetch the proof in the ajax request - like for by -->
< xsl:param name= "ajax_proofs">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- the dir with proofs that are fetched through AJAX -->
< xsl:param name= "ajax_proof_dir">
< xsl:text>proofs</ xsl:text>
</ xsl:param>
<!-- tells to display thesis after skeleton items -->
< xsl:param name= "display_thesis">
< xsl:text> 1</ xsl:text>
</ xsl:param>
<!-- tells if only selected items are generated to subdirs; default is off -->
< xsl:param name= "generate_items">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- relevant only if $generate_items>0 -->
<!-- tells if proofs of selected items are generated to subdirs; default is off -->
< xsl:param name= "generate_items_proofs">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- add IDV links and icons -->
< xsl:param name= "idv">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- create header info from .hdr file -->
< xsl:param name= "mk_header">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- include comment info from .cmt file -->
< xsl:param name= "mk_comments">
< xsl:text> 0</ xsl:text>
</ xsl:param>
<!-- Suppress the header and trailer of the final document. -->
<!-- Thus, you can insert the resulting document into a larger one. -->
< xsl:param name= "body_only">
< xsl:text> 0</ xsl:text>
</ xsl:param>
< xsl:variable name= "lcletters">
< xsl:text>abcdefghijklmnopqrstuvwxyz</ xsl:text>
</ xsl:variable>
< xsl:variable name= "ucletters">
< xsl:text>ABCDEFGHIJKLMNOPQRSTUVWXYZ</ xsl:text>
</ xsl:variable>
<!-- name of current article (upper case) -->
< xsl:param name= "aname">
< xsl:value-of select= "string(/*/@aid)"/>
</ xsl:param>
<!-- name of current article (lower case) -->
< xsl:param name= "anamelc">
< xsl:value-of select= "translate($aname, $ucletters, $lcletters)"/>
</ xsl:param>
<!-- this needs to be set to 1 for processing MML files -->
< xsl:param name= "mml">
< xsl:choose>
< xsl:when test= "/Article">
< xsl:text> 0</ xsl:text>
</ xsl:when>
< xsl:otherwise>
< xsl:text> 1</ xsl:text>
</ xsl:otherwise>
</ xsl:choose>
</ xsl:param>
<!-- nr. of clusters in Typ -->
<!-- this is set to 1 for processing MML files -->
< xsl:param name= "cluster_nr">
< xsl:choose>
< xsl:when test= "$mml = "0"">
< xsl:text> 2</ xsl:text>
</ xsl:when>
< xsl:otherwise>
< xsl:text> 1</ xsl:text>
</ xsl:otherwise>
</ xsl:choose>
</ xsl:param>
<!-- whether we print all attributes (not just those with @pid) -->
<!-- this is set to 1 for processing MML files -->
<xsl:param name= "print_all_attrs">
<xsl:value-of select= "$mml"/>
</xsl:param>
<!-- .atr file with imported constructors -->
<xsl:param name= "constrs">
<xsl:value-of select= "concat($anamelc, '.atr')"/>
</xsl:param>
<!-- .eth file with imported theorems -->
<xsl:param name= "thms">
<xsl:value-of select= "concat($anamelc, '.eth')"/>
</xsl:param>
<!-- .esh file with imported schemes -->
<xsl:param name= "schms">
<xsl:value-of select= "concat($anamelc, '.esh')"/>
</xsl:param>
<!-- .eno file with imported patterns -->
<xsl:param name= "patts">
<xsl:value-of select= "concat($anamelc, '.eno')"/>
</xsl:param>
<!-- .frx file with all (both imported and article 's) formats -->
<xsl:param name="formats">
<xsl:value-of select="concat($anamelc, '.frx')"/>
</xsl:param>
<!-- .dcx file with vocabulary -->
<xsl:param name="vocs">
<xsl:value-of select="concat($anamelc, '.dcx')"/>
</xsl:param>
<!-- .idx file with identifier names -->
<xsl:param name="ids">
<xsl:value-of select="concat($anamelc, '.idx')"/>
</xsl:param>
<!-- .dfs file with imported definientia -->
<xsl:param name="dfs">
<xsl:value-of select="concat($anamelc, '.dfs')"/>
</xsl:param>
<!-- .hdr file with header info (done by mkxmlhdr.pl) -->
<xsl:param name="hdr">
<xsl:value-of select="concat($anamelc, '.hdr')"/>
</xsl:param>
<!-- .cmt file with comments info (done by MizComments.pl) -->
<xsl:param name="cmt">
<xsl:value-of select="concat($anamelc, '.cmt')"/>
</xsl:param>
<xsl:param name="varcolor">
<xsl:text>Olive</xsl:text>
</xsl:param>
<xsl:param name="constcolor">
<xsl:text>Maroon</xsl:text>
</xsl:param>
<xsl:param name="locicolor">
<xsl:text>Maroon</xsl:text>
</xsl:param>
<xsl:param name="schpcolor">
<xsl:text>Maroon</xsl:text>
</xsl:param>
<xsl:param name="schfcolor">
<xsl:text>Maroon</xsl:text>
</xsl:param>
<xsl:param name="ppcolor">
<xsl:text>Maroon</xsl:text>
</xsl:param>
<xsl:param name="pfcolor">
<xsl:text>Maroon</xsl:text>
</xsl:param>
<xsl:param name="labcolor">
<xsl:text>Green</xsl:text>
</xsl:param>
<xsl:param name="commentcolor">
<xsl:text>firebrick</xsl:text>
</xsl:param>
<!-- use spans for brackets -->
<xsl:param name="parenspans">
<xsl:text>1</xsl:text>
</xsl:param>
<!-- number of parenthesis colors (see the stylesheet in the bottom) -->
<xsl:param name="pcolors_nr">
<xsl:text>6</xsl:text>
</xsl:param>
<!-- top level element instead of top-level document, which is hard to -->
<!-- know -->
<xsl:param name="top" select="/"/>
<!-- debugging message -->
<xsl:param name="dbgmsg">
<xsl:text>zzzzzzzzz</xsl:text>
</xsl:param>
<!-- relative nr of the first expandable mode -->
<!-- #first_exp = { `//Pattern[(@constrkind='M') and (@constrnr=0)][1]/@relnr`; } -->
<!-- symbols, should be overloaded with different (eg tex, mathml) presentations -->
<xsl:param name="for_s">
<xsl:text> for </xsl:text>
</xsl:param>
<xsl:param name="ex_s">
<xsl:text> ex </xsl:text>
</xsl:param>
<xsl:param name="not_s">
<xsl:text> not </xsl:text>
</xsl:param>
<xsl:param name="non_s">
<xsl:text> non </xsl:text>
</xsl:param>
<xsl:param name="and_s">
<xsl:text> & </xsl:text>
</xsl:param>
<xsl:param name="imp_s">
<xsl:text> implies </xsl:text>
</xsl:param>
<xsl:param name="equiv_s">
<xsl:text> iff </xsl:text>
</xsl:param>
<xsl:param name="or_s">
<xsl:text> or </xsl:text>
</xsl:param>
<xsl:param name="holds_s">
<xsl:text> holds </xsl:text>
</xsl:param>
<xsl:param name="being_s">
<xsl:text> being </xsl:text>
</xsl:param>
<xsl:param name="be_s">
<xsl:text> be </xsl:text>
</xsl:param>
<xsl:param name="st_s">
<xsl:text> st </xsl:text>
</xsl:param>
<xsl:param name="is_s">
<xsl:text> is </xsl:text>
</xsl:param>
<xsl:param name="dots_s">
<xsl:text> ... </xsl:text>
</xsl:param>
<xsl:param name="fraenkel_start">
<xsl:text> { </xsl:text>
</xsl:param>
<xsl:param name="fraenkel_end">
<xsl:text> } </xsl:text>
</xsl:param>
<xsl:param name="of_sel_s">
<xsl:text> of </xsl:text>
</xsl:param>
<xsl:param name="of_typ_s">
<xsl:text> of </xsl:text>
</xsl:param>
<xsl:param name="the_sel_s">
<xsl:text> the </xsl:text>
</xsl:param>
<xsl:param name="choice_s">
<xsl:text> the </xsl:text>
</xsl:param>
<xsl:param name="lbracket_s">
<xsl:text>(</xsl:text>
</xsl:param>
<xsl:param name="rbracket_s">
<xsl:text>)</xsl:text>
</xsl:param>
<!-- -->
<!-- File: keys.xsltxt - html-ization of Mizar XML, definition of keys (indexes) -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- keys for fast constructor and reference lookup -->
<xsl:key name="M" match="Constructor[@kind='M']" use="@relnr"/>
<xsl:key name="L" match="Constructor[@kind='L']" use="@relnr"/>
<xsl:key name="V" match="Constructor[@kind='V']" use="@relnr"/>
<xsl:key name="R" match="Constructor[@kind='R']" use="@relnr"/>
<xsl:key name="K" match="Constructor[@kind='K']" use="@relnr"/>
<xsl:key name="U" match="Constructor[@kind='U']" use="@relnr"/>
<xsl:key name="G" match="Constructor[@kind='G']" use="@relnr"/>
<xsl:key name="T" match="/Theorems/Theorem[@kind='T']" use="concat(@articlenr,':',@nr)"/>
<xsl:key name="D" match="/Theorems/Theorem[@kind='D']" use="concat(@articlenr,':',@nr)"/>
<xsl:key name="S" match="/Schemes/Scheme" use="concat(@articlenr,':',@nr)"/>
<xsl:key name="DF" match="Definiens" use="@relnr"/>
<!-- patterns are slightly tricky, since a predicate pattern -->
<!-- may be linked to an attribute constructor; hence the -->
<!-- indexing is done according to @constrkind and not @kind -->
<!-- TODO: the attribute<->predicate change should propagate to usage -->
<!-- of "is" -->
<!-- Expandable modes have all @constrkind='M ' and @constrnr=0, -->
<!-- they are indexed separately only on their @relnr (@pid) -->
<xsl:key name="P_M" match="Pattern[(@constrkind='M') and (@constrnr>0)]" use="@constrnr"/>
<xsl:key name="P_L" match="Pattern[@constrkind='L']" use="@constrnr"/>
<xsl:key name="P_V" match="Pattern[@constrkind='V']" use="@constrnr"/>
<xsl:key name="P_R" match="Pattern[@constrkind='R']" use="@constrnr"/>
<xsl:key name="P_K" match="Pattern[@constrkind='K']" use="@constrnr"/>
<xsl:key name="P_U" match="Pattern[@constrkind='U']" use="@constrnr"/>
<xsl:key name="P_G" match="Pattern[@constrkind='G']" use="@constrnr"/>
<xsl:key name="EXP" match="Pattern[(@constrkind='M') and (@constrnr=0)]" use="@relnr"/>
<xsl:key name="F" match="Format" use="@nr"/>
<xsl:key name="D_G" match="Symbol[@kind='G']" use="@nr"/>
<xsl:key name="D_K" match="Symbol[@kind='K']" use="@nr"/>
<xsl:key name="D_J" match="Symbol[@kind='J']" use="@nr"/>
<xsl:key name="D_L" match="Symbol[@kind='L']" use="@nr"/>
<xsl:key name="D_M" match="Symbol[@kind='M']" use="@nr"/>
<xsl:key name="D_O" match="Symbol[@kind='O']" use="@nr"/>
<xsl:key name="D_R" match="Symbol[@kind='R']" use="@nr"/>
<xsl:key name="D_U" match="Symbol[@kind='U']" use="@nr"/>
<xsl:key name="D_V" match="Symbol[@kind='V']" use="@nr"/>
<!-- identifiers -->
<xsl:key name="D_I" match="Symbol[@kind='I']" use="@nr"/>
<!-- keys for absolute linkage inside proofs; -->
<!-- requires preprocessing by addabsrefs, otherwise wrong results, -->
<!-- so commented now (could be uncommented using conditional include probably) -->
<!-- lookup for local constants -->
<xsl:key name="C" match="Let|Given|TakeAsVar|Consider|Set|Reconsider" use="@plevel"/>
<!-- lookup for propositions -->
<xsl:key name="E" match="Proposition|IterEquality|Now" use="concat(@nr,":",@plevel)"/>
<!-- lookup for scheme functors and predicates -->
<xsl:key name="f" match="SchemeFuncDecl" use="concat(@nr,":",@plevel)"/>
<xsl:key name="p" match="SchemePredDecl" use="concat(@nr,":",@plevel)"/>
<!-- lookup for private functors and predicates -->
<xsl:key name="pf" match="DefFunc" use="concat(@nr,":",@plevel)"/>
<xsl:key name="pp" match="DefPred" use="concat(@nr,":",@plevel)"/>
<!-- lookup for comments -->
<xsl:key name="CMT" match="Comment" use="@endline"/>
<!-- -->
<!-- File: print_simple.xsltxt - html-ization of Mizar XML, simple printing funcs -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- pretty print variables and labels -->
<!-- ##TODO: link variables and consts to their introduction? -->
<!-- private - look up the name of id -->
<xsl:template name="get_vid_name">
<xsl:param name="vid"/>
<xsl:for-each select="document($ids, /)">
<xsl:for-each select="key('D_I', $vid)">
<xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template name="pqvar">
<xsl:param name="nr"/>
<xsl:param name="vid"/>
<xsl:choose>
<xsl:when test="($print_identifiers > 0) and ($vid > 0)">
<xsl:variable name="nm">
<xsl:call-template name="get_vid_name">
<xsl:with-param name="vid" select="$vid"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$colored = "1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$varcolor"/>
</xsl:attribute>
<xsl:if test="$titles="1"">
<xsl:attribute name="title">
<xsl:value-of select="concat("b",$nr)"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$nm"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pvar">
<xsl:with-param name="nr" select="$nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pvar">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$varcolor"/>
</xsl:attribute>
<xsl:text>b</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>b</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pconst">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$constcolor"/>
</xsl:attribute>
<xsl:text>c</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>c</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- #pl gives the optional proof level -->
<xsl:template name="ppconst">
<xsl:param name="nr"/>
<xsl:param name="vid"/>
<xsl:param name="pl"/>
<xsl:choose>
<xsl:when test="($print_identifiers > 0) and ($vid > 0)">
<xsl:variable name="ctarget">
<xsl:choose>
<xsl:when test="($const_links>0) and ($pl)">
<xsl:text>c</xsl:text>
<xsl:value-of select="$nr"/>
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="$pl"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat("c",$nr)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nm">
<xsl:call-template name="get_vid_name">
<xsl:with-param name="vid" select="$vid"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="($const_links=2)">
<xsl:element name="a">
<xsl:attribute name="class">
<xsl:text>txt</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="concat("#",$ctarget)"/>
</xsl:attribute>
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$constcolor"/>
</xsl:attribute>
<xsl:if test="$titles="1"">
<xsl:attribute name="title">
<xsl:value-of select="$ctarget"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$nm"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$colored = "1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$constcolor"/>
</xsl:attribute>
<xsl:if test="$titles="1"">
<xsl:attribute name="title">
<xsl:value-of select="$ctarget"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$nm"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pconst">
<xsl:with-param name="nr" select="$nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pploci">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="($print_identifiers > 0) and ($proof_links>0)">
<xsl:variable name="pl">
<xsl:call-template name="get_nearest_level">
<xsl:with-param name="el" select=".."/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="absconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="pl" select="$pl"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pconst">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="ploci">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$locicolor"/>
</xsl:attribute>
<xsl:text>a</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>a</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pschpvar">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$schpcolor"/>
</xsl:attribute>
<xsl:text>P</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>P</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pschfvar">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$schfcolor"/>
</xsl:attribute>
<xsl:text>F</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>F</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pppred">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$ppcolor"/>
</xsl:attribute>
<xsl:text>S</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>S</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="ppfunc">
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$pfcolor"/>
</xsl:attribute>
<xsl:text>H</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>H</xsl:text>
<xsl:element name="sub">
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pplab">
<xsl:param name="nr"/>
<xsl:param name="vid"/>
<xsl:param name="txt"/>
<xsl:choose>
<xsl:when test="($print_lab_identifiers > 0) and ($vid > 0)">
<xsl:variable name="nm">
<xsl:call-template name="get_vid_name">
<xsl:with-param name="vid" select="$vid"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$colored = "1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$labcolor"/>
</xsl:attribute>
<xsl:if test="$titles="1"">
<xsl:attribute name="title">
<xsl:value-of select="concat("E",$nr)"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$nm"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$txt">
<xsl:call-template name="plab1">
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="txt" select="$txt"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="plab">
<xsl:with-param name="nr" select="$nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="plab">
<xsl:param name="nr"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$labcolor"/>
</xsl:attribute>
<xsl:text>E</xsl:text>
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>E</xsl:text>
<xsl:value-of select="$nr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template name="plab1">
<xsl:param name="nr"/>
<xsl:param name="txt"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$labcolor"/>
</xsl:attribute>
<xsl:value-of select="$txt"/>
<xsl:value-of select="$nr"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$txt"/>
<xsl:value-of select="$nr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template name="pkeyword">
<xsl:param name="str"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>kw</xsl:text>
</xsl:attribute>
<xsl:value-of select="$str"/>
</xsl:element>
</xsl:template>
<xsl:template name="pcomment0">
<xsl:param name="str"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>comment</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$commentcolor"/>
</xsl:attribute>
<xsl:text>:: </xsl:text>
<xsl:value-of select="$str"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:text>:: </xsl:text>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template name="pcomment">
<xsl:param name="str"/>
<xsl:call-template name="pcomment0">
<xsl:with-param name="str" select="$str"/>
</xsl:call-template>
<xsl:element name="br"/>
</xsl:template>
<!-- this assumes comments with :: already -->
<xsl:template name="pcommentedblock">
<xsl:param name="str"/>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>comment</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$commentcolor"/>
</xsl:attribute>
<xsl:call-template name="br">
<xsl:with-param name="text" select="$str"/>
</xsl:call-template>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="br">
<xsl:with-param name="text" select="$str"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<!-- argument list -->
<xsl:template name="arglist">
<xsl:param name="separ"/>
<xsl:param name="elems"/>
<xsl:for-each select="$elems">
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="position()"/>
</xsl:call-template>
<xsl:if test="not(position() = last())">
<xsl:value-of select="$separ"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- translate newlines to <br; -->
<xsl:template name="br">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="contains($text,'
')">
<xsl:value-of select="substring-before($text,'
')"/>
<xsl:element name="br"/>
<xsl:call-template name="br">
<xsl:with-param name="text" select="substring-after($text,'
')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- like jlist, but with loci -->
<xsl:template name="alist">
<xsl:param name="j"/>
<xsl:param name="sep1"/>
<xsl:param name="sep2"/>
<xsl:param name="elems"/>
<xsl:for-each select="$elems">
<xsl:apply-templates select="."/>
<xsl:if test="not(position() = last())">
<xsl:value-of select="$sep1"/>
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="$j+position()"/>
</xsl:call-template>
<xsl:value-of select="$sep2"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- -->
<!-- File: utils.xsltxt - html-ization of Mizar XML, various utility functions -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<xsl:param name="pid_Ex">
<xsl:text>-1</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<xsl:param name="pid_Ex_Univ">
<xsl:text>-2</xsl:text>
</xsl:param>
<!-- usually UnivFrmPtr -->
<xsl:param name="pid_Ex_InnerNot">
<xsl:text>-3</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<xsl:param name="pid_Impl">
<xsl:text>-4</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<xsl:param name="pid_Impl_And">
<xsl:text>-5</xsl:text>
</xsl:param>
<!-- usually ConjFrmPtr -->
<xsl:param name="pid_Impl_RightNot">
<xsl:text>-6</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<xsl:param name="pid_Iff">
<xsl:text>-7</xsl:text>
</xsl:param>
<!-- usually ConjFrmPtr -->
<xsl:param name="pid_Or">
<xsl:text>-8</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<xsl:param name="pid_Or_And">
<xsl:text>-9</xsl:text>
</xsl:param>
<!-- usually ConjFrmPtr -->
<xsl:param name="pid_Or_LeftNot">
<xsl:text>-10</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<xsl:param name="pid_Or_RightNot">
<xsl:text>-11</xsl:text>
</xsl:param>
<!-- usually NegFrmPtr -->
<!-- means that "not" will not be used -->
<xsl:template name="is_positive">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(name()="Not")">
<xsl:choose>
<xsl:when test="Pred[(@kind='V') or (@kind='R')]">
<xsl:variable name="pi">
<xsl:call-template name="patt_info">
<xsl:with-param name="k" select="*[1]/@kind"/>
<xsl:with-param name="nr" select="*[1]/@nr"/>
<xsl:with-param name="pid" select="*[1]/@pid"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="antonym">
<xsl:call-template name="cadr">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$antonym mod 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="(name()="Pred") and ((@kind='V') or (@kind='R'))">
<xsl:variable name="pi">
<xsl:call-template name="patt_info">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="pid" select="@pid"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="antonym">
<xsl:call-template name="cadr">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="($antonym + 1) mod 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="is_negative">
<xsl:param name="el"/>
<xsl:variable name="pos">
<xsl:call-template name="is_positive">
<xsl:with-param name="el" select="$el"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="1 - $pos"/>
</xsl:template>
<xsl:template name="count_positive">
<xsl:param name="els"/>
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$nr > 0">
<xsl:variable name="el1" select="$els[position()=$nr]"/>
<xsl:variable name="res1">
<xsl:call-template name="is_positive">
<xsl:with-param name="el" select="$els[position()=$nr]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="res2">
<xsl:call-template name="count_positive">
<xsl:with-param name="els" select="$els"/>
<xsl:with-param name="nr" select="$nr - 1"/>
</xsl:call-template>
</xsl:variable>
<!-- DEBUG `concat($res1,":",$res2)`; -->
<xsl:value-of select="$res1 + $res2"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- if $neg, then put negative, striping the negation -->
<xsl:template name="put_positive">
<xsl:param name="separ"/>
<xsl:param name="els"/>
<xsl:param name="nr"/>
<xsl:param name="neg"/>
<xsl:param name="i"/>
<xsl:if test="$nr > 0">
<xsl:variable name="el1" select="$els[position()=1]"/>
<xsl:variable name="pos">
<xsl:call-template name="is_positive">
<xsl:with-param name="el" select="$el1"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pos1">
<xsl:choose>
<xsl:when test="$neg="1"">
<xsl:value-of select="($neg + $pos) mod 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pos"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$pos1="1"">
<xsl:variable name="nm" select="name($el1)"/>
<xsl:choose>
<xsl:when test="$neg="1"">
<!-- change this if is_positive changes! -->
<xsl:choose>
<xsl:when test="$nm="Not"">
<xsl:apply-templates select="$el1/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$nm="Pred"">
<xsl:apply-templates select="$el1">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$dbgmsg"/>
<xsl:value-of select="$nm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$nm="Not"">
<xsl:apply-templates select="$el1/*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$el1">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$nr > 1">
<xsl:value-of select="$separ"/>
</xsl:if>
</xsl:if>
<xsl:call-template name="put_positive">
<xsl:with-param name="separ" select="$separ"/>
<xsl:with-param name="els" select="$els[position() > 1]"/>
<xsl:with-param name="nr" select="$nr - $pos1"/>
<xsl:with-param name="neg" select="$neg"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="is_or">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Or)
and (*[1][@pid=$pid_Or_And]) and (count(*[1]/*)=2)
and (*[1]/*[1][@pid=$pid_Or_LeftNot])
and (*[1]/*[2][@pid=$pid_Or_RightNot])">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- now also used when included "or" ate the implicant -->
<xsl:template name="is_or1">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="((@pid=$pid_Or) or (@pid=$pid_Impl))
and (*[1][@pid=$pid_Or_And]) and (count(*[1]/*)>=2)">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- used when is_or failed -->
<xsl:template name="is_or3">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Or)
and (*[1][@pid=$pid_Or_And]) and (count(*[1]/*)=2)">
<xsl:variable name="neg1">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="*[1]/*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="neg2">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="*[1]/*[2]"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$neg1 * $neg2"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- used when is_or3 failed -->
<xsl:template name="is_or4">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Or)
and (*[1][@pid=$pid_Or_And]) and (count(*[1]/*)=2)">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="is_impl">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Impl)
and (*[1][@pid=$pid_Impl_And]) and (count(*[1]/*)=2)
and (*[1]/*[2][@pid=$pid_Impl_RightNot])">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="is_impl1">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Impl)
and (*[1][@pid=$pid_Impl_And]) and (count(*[1]/*)>=2)">
<xsl:choose>
<xsl:when test="*[1]/*[@pid=$pid_Impl_RightNot]">
<xsl:text>2</xsl:text>
</xsl:when>
<xsl:when test="name(*[1]/*[position()=last()]) = "For"">
<xsl:text>4</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="neg1">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="*[1]/*[position()=last()]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$neg1 = "1"">
<xsl:text>3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>5</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="is_impl2">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Impl)
and (*[1][@pid=$pid_Impl_And]) and (count(*[1]/*)>=2)
and ((*[1]/*[@pid=$pid_Impl_RightNot]))">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- used when is_impl2 failed -->
<xsl:template name="is_impl3">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Impl)
and (*[1][@pid=$pid_Impl_And]) and (count(*[1]/*)>=2)">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="*[1]/*[position()=last()]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- used when is_impl3 failed -->
<xsl:template name="is_impl4">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Impl)
and (*[1][@pid=$pid_Impl_And]) and (count(*[1]/*)>=2)
and (name(*[1]/*[position()=last()]) = "For")">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- used when is_impl4 failed -->
<xsl:template name="is_impl5">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="(@pid=$pid_Impl)
and (*[1][@pid=$pid_Impl_And]) and (count(*[1]/*)>=2)">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="is_equiv">
<xsl:param name="el"/>
<xsl:for-each select="$el">
<xsl:variable name="e1">
<xsl:choose>
<xsl:when test="(@pid=$pid_Iff) and (count(*)=2)">
<xsl:variable name="i1">
<xsl:call-template name="is_impl">
<xsl:with-param name="el" select="$el/*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$i1="1"">
<xsl:call-template name="is_impl">
<xsl:with-param name="el" select="*[2]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$e1="1"">
<xsl:variable name="res1">
<xsl:call-template name="are_equal">
<xsl:with-param name="el1" select="*[1]/*[1]/*[1]"/>
<xsl:with-param name="el2" select="*[2]/*[1]/*[2]/*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="res2">
<xsl:call-template name="are_equal">
<xsl:with-param name="el1" select="*[2]/*[1]/*[1]"/>
<xsl:with-param name="el2" select="*[1]/*[1]/*[2]/*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="($res1="1") and ($res2="1")">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$e1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- recursive equality on subnodes and attributes -->
<xsl:template name="are_equal">
<xsl:param name="el1"/>
<xsl:param name="el2"/>
<xsl:choose>
<xsl:when test=" not(name($el1)=name($el2)) or not(count($el1/*)=count($el2/*))
or not(count($el1/@*)=count($el2/@*))">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="s1">
<xsl:for-each select="$el1/@*">
<xsl:value-of select="string()"/>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="s2">
<xsl:for-each select="$el2/@*">
<xsl:value-of select="string()"/>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($s1=$s2)">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="are_equal_many">
<xsl:with-param name="els1" select="$el1/*"/>
<xsl:with-param name="els2" select="$el2/*"/>
<xsl:with-param name="nr" select="count($el1/*)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="are_equal_many">
<xsl:param name="els1"/>
<xsl:param name="els2"/>
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$nr > 0">
<xsl:variable name="el1" select="$els1[position()=$nr]"/>
<xsl:variable name="el2" select="$els2[position()=$nr]"/>
<xsl:variable name="res1">
<xsl:call-template name="are_equal">
<xsl:with-param name="el1" select="$el1"/>
<xsl:with-param name="el2" select="$el2"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$res1="1"">
<xsl:call-template name="are_equal_many">
<xsl:with-param name="els1" select="$els1"/>
<xsl:with-param name="els2" select="$els2"/>
<xsl:with-param name="nr" select="$nr - 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- recursive equality on subnodes and attributes upto the @vid attribute -->
<xsl:template name="are_equal_vid">
<xsl:param name="el1"/>
<xsl:param name="el2"/>
<xsl:choose>
<xsl:when test=" not(name($el1)=name($el2)) or not(count($el1/*)=count($el2/*))
or not(count($el1/@*)=count($el2/@*))">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="s1">
<xsl:for-each select="$el1/@*">
<xsl:if test="not(name()="vid")">
<xsl:value-of select="string()"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="s2">
<xsl:for-each select="$el2/@*">
<xsl:if test="not(name()="vid")">
<xsl:value-of select="string()"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($s1=$s2)">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="are_equal_many_vid">
<xsl:with-param name="els1" select="$el1/*"/>
<xsl:with-param name="els2" select="$el2/*"/>
<xsl:with-param name="nr" select="count($el1/*)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="are_equal_many_vid">
<xsl:param name="els1"/>
<xsl:param name="els2"/>
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$nr > 0">
<xsl:variable name="el1" select="$els1[position()=$nr]"/>
<xsl:variable name="el2" select="$els2[position()=$nr]"/>
<xsl:variable name="res1">
<xsl:call-template name="are_equal_vid">
<xsl:with-param name="el1" select="$el1"/>
<xsl:with-param name="el2" select="$el2"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$res1="1"">
<xsl:call-template name="are_equal_many_vid">
<xsl:with-param name="els1" select="$els1"/>
<xsl:with-param name="els2" select="$els2"/>
<xsl:with-param name="nr" select="$nr - 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="lc">
<xsl:param name="s"/>
<xsl:value-of select="translate($s, $ucletters, $lcletters)"/>
</xsl:template>
<xsl:template name="uc">
<xsl:param name="s"/>
<xsl:value-of select="translate($s, $lcletters, $ucletters)"/>
</xsl:template>
<!-- utilities for adding lemma names -->
<xsl:template name="addp">
<xsl:param name="pl"/>
<xsl:if test="string-length($pl)>0">
<xsl:text>:</xsl:text>
<xsl:value-of select="$pl"/>
</xsl:if>
</xsl:template>
<xsl:template name="propname">
<xsl:param name="n"/>
<xsl:param name="pl"/>
<xsl:text>E</xsl:text>
<xsl:value-of select="$n"/>
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="$pl"/>
</xsl:call-template>
</xsl:template>
<!-- poor man's data structure, aka "colon-list" -->
<xsl:param name="nil">
<xsl:text/>
</xsl:param>
<xsl:template name="cons">
<xsl:param name="h"/>
<xsl:param name="t"/>
<xsl:value-of select="concat($h,":",$t)"/>
</xsl:template>
<xsl:template name="car">
<xsl:param name="l"/>
<xsl:value-of select="substring-before($l,":")"/>
</xsl:template>
<xsl:template name="cdr">
<xsl:param name="l"/>
<xsl:value-of select="substring-after($l,":")"/>
</xsl:template>
<xsl:template name="cadr">
<xsl:param name="l"/>
<xsl:call-template name="car">
<xsl:with-param name="l">
<xsl:call-template name="cdr">
<xsl:with-param name="l" select="$l"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="cddr">
<xsl:param name="l"/>
<xsl:call-template name="cdr">
<xsl:with-param name="l">
<xsl:call-template name="cdr">
<xsl:with-param name="l" select="$l"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="third">
<xsl:param name="l"/>
<xsl:call-template name="car">
<xsl:with-param name="l">
<xsl:call-template name="cddr">
<xsl:with-param name="l" select="$l"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="cdddr">
<xsl:param name="l"/>
<xsl:call-template name="cdr">
<xsl:with-param name="l">
<xsl:call-template name="cddr">
<xsl:with-param name="l" select="$l"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- poor man's 0-based integer arrays (integer is non-negative and four digits long now) -->
<!-- the biggest identifier number is 1061 for jordan7 in MML 758 -->
<xsl:param name="int_size">
<xsl:text>4</xsl:text>
</xsl:param>
<!-- #index must be 0-based -->
<xsl:template name="arr_ref">
<xsl:param name="array"/>
<xsl:param name="index"/>
<xsl:variable name="beg" select="$int_size * $index"/>
<xsl:value-of select="number(substring($array, $beg, $beg + $int_size))"/>
</xsl:template>
<xsl:template name="apush">
<xsl:param name="array"/>
<xsl:param name="obj"/>
<xsl:variable name="obj1">
<xsl:call-template name="arr_pad_obj">
<xsl:with-param name="obj"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat($array, $obj1)"/>
</xsl:template>
<xsl:template name="arr_set">
<xsl:param name="array"/>
<xsl:param name="index"/>
<xsl:param name="obj"/>
<xsl:variable name="obj1">
<xsl:call-template name="arr_pad_obj">
<xsl:with-param name="obj"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="beg" select="$int_size * $index"/>
<xsl:variable name="end" select="$beg + $int_size"/>
<xsl:variable name="prefix" select="substring($array, 0, $beg)"/>
<xsl:variable name="postfix" select="substring($array, $end)"/>
<xsl:value-of select="concat($prefix, $obj1, $postfix)"/>
</xsl:template>
<!-- explicit for speed -->
<xsl:template name="arr_zeros">
<xsl:param name="l"/>
<xsl:choose>
<xsl:when test="$l = 0">
<xsl:text/>
</xsl:when>
<xsl:when test="$l = 1">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:when test="$l = 2">
<xsl:text>00</xsl:text>
</xsl:when>
<xsl:when test="$l = 3">
<xsl:text>000</xsl:text>
</xsl:when>
<xsl:when test="$l = 4">
<xsl:text>0000</xsl:text>
</xsl:when>
<xsl:when test="$l = 5">
<xsl:text>00000</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="arr_pad_obj">
<xsl:param name="obj"/>
<xsl:variable name="length" select="$int_size - string-length($obj)"/>
<xsl:variable name="padding">
<xsl:call-template name="arr_zeros">
<xsl:with-param name="l" select="$length"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat($padding, $obj)"/>
</xsl:template>
<!-- List utilities -->
<xsl:template name="list">
<xsl:param name="separ"/>
<xsl:param name="elems"/>
<xsl:for-each select="$elems">
<xsl:apply-templates select="."/>
<xsl:if test="not(position()=last())">
<xsl:copy-of select="$separ"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- List utility with additional arg - now only used for formula lists -->
<xsl:template name="ilist">
<xsl:param name="separ"/>
<xsl:param name="elems"/>
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:for-each select="$elems">
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr" select="$pr"/>
</xsl:apply-templates>
<xsl:if test="not(position()=last())">
<xsl:copy-of select="$separ"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- newlined list -->
<xsl:template name="nlist">
<xsl:param name="separ"/>
<xsl:param name="elems"/>
<xsl:for-each select="$elems">
<xsl:apply-templates select="."/>
<xsl:if test="not(position()=last())">
<xsl:element name="br"/>
<xsl:copy-of select="$separ"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- newlined andlist -->
<xsl:template name="andlist">
<xsl:param name="elems"/>
<xsl:for-each select="$elems">
<xsl:apply-templates select="."/>
<xsl:if test="not(position()=last())">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>and </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="br"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="dlist">
<xsl:param name="separ"/>
<xsl:param name="elems"/>
<xsl:for-each select="$elems">
<xsl:element name="div">
<xsl:apply-templates select="."/>
<xsl:if test="not(position()=last())">
<xsl:copy-of select="$separ"/>
</xsl:if>
</xsl:element>
</xsl:for-each>
</xsl:template>
<!-- Pretty print constants with their types. -->
<!-- This now assumes that all #elems are Typ. -->
<!-- For subseries of consts with the same Typ, -->
<!-- the Typ is printed only once. -->
<!-- #sep2 is now either "be " or "being ", -->
<!-- comma is added automatically. -->
<!-- #pl passes proolevel if after addabsrefs processing -->
<!-- (needed for const_links) -->
<xsl:template name="jtlist">
<xsl:param name="j"/>
<xsl:param name="sep2"/>
<xsl:param name="elems"/>
<xsl:param name="pl"/>
<xsl:variable name="addpl">
<xsl:if test="$const_links>0">
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="$pl"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:for-each select="$elems">
<xsl:variable name="nr1" select="$j+position()"/>
<xsl:if test="$const_links>0">
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("c",$nr1,$addpl)"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$nr1"/>
<xsl:with-param name="vid" select="@vid"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="position()=last()">
<xsl:value-of select="$sep2"/>
<xsl:apply-templates select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="eq1">
<xsl:call-template name="are_equal_vid">
<xsl:with-param name="el1" select="."/>
<xsl:with-param name="el2" select="following-sibling::*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$eq1="0"">
<xsl:value-of select="$sep2"/>
<xsl:apply-templates select="."/>
</xsl:if>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- translate constructor (notation) kinds to their mizar/mmlquery names -->
<xsl:template name="mkind">
<xsl:param name="kind"/>
<xsl:choose>
<xsl:when test="$kind = 'M'">
<xsl:text>mode</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'V'">
<xsl:text>attr</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'R'">
<xsl:text>pred</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'K'">
<xsl:text>func</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'G'">
<xsl:text>aggr</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'L'">
<xsl:text>struct</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'U'">
<xsl:text>sel</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- translate reference kinds to their mizar/mmlquery names -->
<xsl:template name="refkind">
<xsl:param name="kind"/>
<xsl:choose>
<xsl:when test="$kind = 'T'">
<xsl:text>th</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'D'">
<xsl:text>def</xsl:text>
</xsl:when>
<xsl:when test="$kind = 'S'">
<xsl:text>sch</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- return first symbol corresponding to a constructor ($,$nr); -->
<!-- sometimes we know the $pid or even the formatnr ($fnr) precisely; -->
<!-- if nothing found, just concat #k and #nr; #r says to look for -->
<!-- right bracket instead of left or fail if the format is not bracket -->
<xsl:template name="abs1">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="r"/>
<xsl:param name="fnr"/>
<xsl:param name="pid"/>
<!-- DEBUG "abs1:"; $k; ":"; $fnr; ":"; -->
<xsl:variable name="fnr1">
<xsl:choose>
<xsl:when test="$fnr">
<xsl:value-of select="$fnr"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="formt_nr">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($formats,/)">
<xsl:choose>
<xsl:when test="not(key('F',$fnr1))">
<xsl:value-of select="concat($k,$nr)"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="key('F',$fnr1)">
<xsl:variable name="snr" select="@symbolnr"/>
<xsl:variable name="sk1" select="@kind"/>
<xsl:variable name="sk">
<xsl:choose>
<xsl:when test="$sk1="L"">
<xsl:text>G</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sk1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="dkey" select="concat('D_',$sk)"/>
<xsl:variable name="rsnr">
<xsl:if test="$sk='K'">
<xsl:value-of select="@rightsymbolnr"/>
</xsl:if>
</xsl:variable>
<!-- return nothing if right bracket of nonbracket symbol is asked -->
<!-- shouldn't it be an error? -->
<xsl:if test="not($r='1') or ($sk='K')">
<xsl:for-each select="document($vocs,/)">
<xsl:choose>
<xsl:when test="key($dkey,$snr)">
<xsl:for-each select="key($dkey,$snr)[1]">
<xsl:choose>
<xsl:when test="($sk='K') and ($r='1')">
<xsl:for-each select="key('D_L',$rsnr)[1]">
<xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<!-- try the built-in symbols -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($snr='1') and ($sk='M')">
<xsl:text>set</xsl:text>
</xsl:when>
<xsl:when test="($snr='1') and ($sk='R')">
<xsl:text>=</xsl:text>
</xsl:when>
<xsl:when test="($snr='1') and ($sk='K')">
<xsl:choose>
<xsl:when test="$r='1'">
<xsl:text>]</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>[</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="($snr='2') and ($sk='K')">
<xsl:choose>
<xsl:when test="$r='1'">
<xsl:text>}</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>{</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($k,$nr)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- private for abs1 -->
<xsl:template name="formt_nr">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="pid"/>
<xsl:call-template name="car">
<xsl:with-param name="l">
<xsl:call-template name="patt_info">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- private for patt_info -->
<xsl:template name="mk_vis_list">
<xsl:param name="els"/>
<xsl:for-each select="$els">
<xsl:value-of select="@x"/>
<xsl:text>:</xsl:text>
</xsl:for-each>
</xsl:template>
<!-- private for patt_info - -->
<!-- assumes we already are inside the right pattern -->
<xsl:template name="encode_std_pattern">
<xsl:param name="k"/>
<xsl:variable name="shift0">
<xsl:choose>
<xsl:when test="@antonymic">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="shift">
<xsl:choose>
<xsl:when test="($k="V") and (@kind="R")">
<xsl:value-of select="2 + $shift0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$shift0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="plink">
<xsl:choose>
<xsl:when test="@redefnr>0">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="vis">
<xsl:call-template name="mk_vis_list">
<xsl:with-param name="els" select="Visible/Int"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="cons">
<xsl:with-param name="h" select="@formatnr"/>
<xsl:with-param name="t">
<xsl:call-template name="cons">
<xsl:with-param name="h" select="$shift"/>
<xsl:with-param name="t">
<xsl:call-template name="cons">
<xsl:with-param name="h" select="$plink"/>
<xsl:with-param name="t" select="$vis"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- this is a small hack to minimize chasing patterns -->
<!-- returns list [formatnr, antonymic or expandable (+2 if attrpred), -->
<!-- redefinition | visiblelist] -->
<xsl:template name="patt_info">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="pid"/>
<xsl:variable name="k1">
<xsl:choose>
<xsl:when test="$k="L"">
<xsl:text>G</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$k"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="typ" select="($k1 = "G") or ($k1="M")"/>
<xsl:variable name="pkey" select="concat('P_',$k1)"/>
<xsl:choose>
<xsl:when test="$pid>0">
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="($typ and key('EXP',$pid))
or (key($pkey,$nr)[$pid=@relnr])">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$patts"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:choose>
<xsl:when test="$typ and key('EXP',$pid)">
<xsl:for-each select="key('EXP',$pid)">
<xsl:variable name="vis">
<xsl:call-template name="mk_vis_list">
<xsl:with-param name="els" select="Visible/Int"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="cons">
<xsl:with-param name="h" select="@formatnr"/>
<xsl:with-param name="t">
<xsl:call-template name="cons">
<xsl:with-param name="h">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="t">
<xsl:call-template name="cons">
<xsl:with-param name="h">
<xsl:text>0</xsl:text>
</xsl:with-param>
<xsl:with-param name="t" select="$vis"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="key($pkey,$nr)[$pid=@relnr]">
<xsl:for-each select="key($pkey,$nr)[$pid=@relnr]">
<xsl:call-template name="encode_std_pattern">
<xsl:with-param name="k" select="$k"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:text>failedpid:</xsl:text>
<xsl:value-of select="$k1"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="$nr"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="$pid"/>
<xsl:text>:</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key($pkey,$nr)">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$patts"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:for-each select="key($pkey,$nr)[position()=1]">
<xsl:call-template name="encode_std_pattern">
<xsl:with-param name="k" select="$k"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- the string length #ls does not change; -->
<!-- test if the #n-th position in #pl from back is underscore, -->
<!-- if so, cut it and what follows it, -->
<!-- otherwise try with n+1 -->
<!-- called externally with #n=1; -->
<!-- $n<10 is probably needed to guard the recursion - limits us -->
<!-- to nine digit numbers of previous blocks - seems safe now -->
<xsl:template name="get_parent_level">
<xsl:param name="pl"/>
<xsl:param name="ls"/>
<xsl:param name="n"/>
<xsl:variable name="p">
<xsl:value-of select="$ls - $n"/>
</xsl:variable>
<xsl:variable name="p1">
<xsl:value-of select="$ls - ($n + 1)"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($pl, $p, 1) = '_'">
<xsl:value-of select="substring($pl, 1, $p1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$n < 10">
<xsl:call-template name="get_parent_level">
<xsl:with-param name="pl" select="$pl"/>
<xsl:with-param name="ls" select="$ls"/>
<xsl:with-param name="n" select="$n+1"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="add_hs_attrs">
<xsl:attribute name="class">
<xsl:text>txt</xsl:text>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:text>hs(this)</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:()</xsl:text>
</xsl:attribute>
</xsl:template>
<xsl:template name="add_hs2_attrs">
<xsl:attribute name="class">
<xsl:text>txt</xsl:text>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:text>hs2(this)</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:()</xsl:text>
</xsl:attribute>
</xsl:template>
<xsl:template name="add_hsNdiv_attrs">
<xsl:attribute name="class">
<xsl:text>txt</xsl:text>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:text>hsNdiv(this)</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:()</xsl:text>
</xsl:attribute>
</xsl:template>
<xsl:template name="add_ajax_attrs">
<xsl:param name="u"/>
<xsl:attribute name="class">
<xsl:text>txt</xsl:text>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:value-of select="concat("makeRequest(this,'",$u,"')")"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:()</xsl:text>
</xsl:attribute>
</xsl:template>
<!-- -->
<!-- File: frmtrm.xsltxt - html-ization of Mizar XML, code for terms, formulas, and types -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- Formulas -->
<!-- #i is nr of the bound variable, 0 by default -->
<!-- #k is start of the sequence of vars with the same type, $i by default -->
<!-- we now output only one typing for such sequences -->
<!-- #ex tells that we should print it as existential statement, -->
<!-- i.e. also omitting the first descending Not (the caller -->
<!-- should guarantee that there _is_ a Not after the block of For-s) -->
<!-- #pr tells to put the formula in paranthesis -->
<xsl:template match="For">
<xsl:param name="i"/>
<xsl:param name="k"/>
<xsl:param name="ex"/>
<xsl:param name="pr"/>
<xsl:variable name="j">
<xsl:choose>
<xsl:when test="$i">
<xsl:value-of select="$i"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="l">
<xsl:choose>
<xsl:when test="$k">
<xsl:value-of select="$k"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$j"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$l = $j">
<!-- print initial quantifier if at the beginning of var segment -->
<xsl:if test="$pr">
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:choose>
<xsl:when test="$ex="1"">
<xsl:copy-of select="$ex_s"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$for_s"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:call-template name="pqvar">
<xsl:with-param name="nr" select="$j + 1"/>
<xsl:with-param name="vid" select="@vid"/>
</xsl:call-template>
<xsl:variable name="nm">
<xsl:value-of select="name(*[2])"/>
</xsl:variable>
<xsl:variable name="eq1">
<xsl:choose>
<xsl:when test="($nm = "For") and (*[1]/@nr = *[2]/*[1]/@nr)">
<xsl:call-template name="are_equal">
<xsl:with-param name="el1" select="*[1]"/>
<xsl:with-param name="el2" select="*[2]/*[1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$eq1="1"">
<xsl:text>, </xsl:text>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="k" select="$l"/>
<xsl:with-param name="ex" select="$ex"/>
<xsl:with-param name="pr" select="$pr"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$ex="1"">
<xsl:copy-of select="$being_s"/>
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$j + 1"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="$nm = "For"">
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="ex" select="$ex"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$st_s"/>
<!-- $nm; -->
<xsl:if test="($nm = "And") or (name(Not/*[1]) = "And") or (name(Not/*[1]) = "For")">
<xsl:element name="br"/>
</xsl:if>
<xsl:apply-templates select="Not/*[1]">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="Pred|PrivPred|Is|Verum|ErrorFrm">
<!-- " PREDFOR "; -->
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<!-- for antonymous Preds -->
<xsl:otherwise>
<xsl:if test="And">
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="And[@pid=$pid_Or_And]">
<xsl:for-each select="*[2]/*">
<xsl:if test="position()>1">
<xsl:copy-of select="$or_s"/>
</xsl:if>
<xsl:variable name="neg1">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$neg1 = "1"">
<xsl:choose>
<xsl:when test="name() = "Not"">
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
</xsl:when>
<!-- now Pred, which is antonymous -->
<xsl:otherwise>
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name() = "For"">
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="ex">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:text> not </xsl:text>
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<!-- pretend this is an impl -->
<xsl:call-template name="ilist">
<xsl:with-param name="separ" select="$and_s"/>
<xsl:with-param name="elems" select="*[2]/*[position()<last()]"/>
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:copy-of select="$imp_s"/>
<xsl:choose>
<xsl:when test="*[2]/*[@pid=$pid_Impl_RightNot]">
<xsl:apply-templates select="*[2]/*[@pid=$pid_Impl_RightNot]/*[1]">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="name(*[2]/*[position()=last()]) = "For"">
<xsl:apply-templates select="*[2]/*[position()=last()]">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="ex">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="neg1">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="*[2]/*[position()=last()]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$neg1 = "1"">
<xsl:choose>
<xsl:when test="name(*[2]/*[position()=last()]) = "Not"">
<xsl:apply-templates select="*[2]/*[position()=last()]/*[1]">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
</xsl:when>
<!-- now Pred, which is antonymous -->
<xsl:otherwise>
<xsl:apply-templates select="*[2]/*[position()=last()]">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$not_s"/>
<xsl:apply-templates select="*[2]/*[position()=last()]">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$being_s"/>
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$j + 1"/>
</xsl:apply-templates>
<xsl:if test="not(($nm = "For") or ($nm="Not"))">
<xsl:copy-of select="$holds_s"/>
</xsl:if>
<xsl:if test="($nm = "And") or ($nm="For")">
<xsl:element name="br"/>
</xsl:if>
<xsl:choose>
<xsl:when test="$nm="Not"">
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$j+1"/>
<xsl:with-param name="st">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$j+1"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$pr">
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- tpl [And/For] { <div {"for B being"; apply[*[1]]; -->
<!-- copy-of $holds_s; <div { @class="add"; apply[*[2]]; } } } -->
<!-- return 1 if this is a Not-ended sequence of For-s -->
<xsl:template name="check_for_not">
<xsl:param name="el"/>
<xsl:choose>
<xsl:when test="(name($el)="Not") or (name($el)="Pred")">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="$el"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="(name($el)="And") and (($el/@pid = $pid_Or_And) or ($el/@pid = $pid_Impl_And))">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name($el)="For"">
<xsl:call-template name="check_for_not">
<xsl:with-param name="el" select="$el/*[2]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Not">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:param name="st"/>
<xsl:variable name="fnb">
<xsl:choose>
<xsl:when test="For">
<xsl:call-template name="check_for_not">
<xsl:with-param name="el" select="*[1]/*[2]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$fnb="1"">
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="ex">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="Pred|Is|PrivPred|Verum|ErrorFrm">
<xsl:if test="$st="1"">
<xsl:copy-of select="$holds_s"/>
</xsl:if>
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="i3">
<xsl:call-template name="is_impl1">
with-let f be PartFunc of C,V;
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$i3 > 0">
<!-- " IMPL1 "; $i3; -->
<xsl:choose>
<xsl:when test="$st="1"">
<xsl:copy-of select="$st_s"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$i3=2">
<xsl:call-template name="ilist">
<xsl:with-param name="separ" select="$and_s"/>
<xsl:with-param name="elems" select="*[1]/*[not(@pid=$pid_Impl_RightNot)]"/>
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$st="1"">
<xsl:copy-of select="$holds_s"/>
<xsl:element name="br"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$imp_s"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*[1]/*[@pid=$pid_Impl_RightNot]/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ilist">
<xsl:with-param name="separ" select="$and_s"/>
<xsl:with-param name="elems" select="*[1]/*[position()<last()]"/>
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$st="1"">
<xsl:copy-of select="$holds_s"/>
<xsl:element name="br"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$imp_s"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$i3=3">
<xsl:choose>
<xsl:when test="name(*[1]/*[position()=last()]) = "Not"">
<xsl:apply-templates select="*[1]/*[position()=last()]/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
<!-- now Pred, which is antonymous -->
<xsl:otherwise>
<xsl:apply-templates select="*[1]/*[position()=last()]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$i3=4">
<xsl:apply-templates select="*[1]/*[position()=last()]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="ex">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$i3=5">
<xsl:copy-of select="$not_s"/>
<xsl:apply-templates select="*[1]/*[position()=last()]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not($st="1")">
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$st="1"">
<xsl:copy-of select="$holds_s"/>
<xsl:element name="br"/ hence thesis;
</xsl:if>
<xsl:variable name="i1_1">
<java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 6
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="i1">
<xsl:choose>
<xsl:when test="$i1_1="1"">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- artifficially system-constructed complex fla, try some reconstruction -->
<xsl:choose>
<xsl:when test="not(@pid) and (name(*[1])="And") and (count(*[1]/*)>=2)">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$i1="1"">
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<!-- " OR1 "; -->
<xsl:for-each select="*[1]/*">
<xsl:if test="position()>1">
c-of select="$r_s">
</xsl:if>
<xsl:variable name="neg1">
<xsl:call-template name="is_negative">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$neg1 = "1"">
<xsl:choose>
<xsl:when test="name() = "Not"">
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
<!-- now Pred, which is antonymous -->
<xsl:otherwise>
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
/sl:with->
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name() = "For"">
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="ex">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$not_s"/>
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$"/>
</xsl:apply-emplates>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose reconsider g as Functional_Sequence of the carrier of V,the carrier of W;
/xsl:for-each
<xsl:java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 27
<:opy-ofselect="$rbracket_s"/>
</xsl:when>
<xsl:A4: for n be Nat holds seq1.(n+1 fD(seq1.n,h) and
:for .n) =(.,h;
<xsl:if ="pid">
A:P];
<:text>UMANRECFAILED<xsl:text>
</xsl:comment>
/xsl:if>
<!-- java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 26
<apply-templates select=*[1]>
<xsl:with-param namejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
</xsl:apply-java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 30
/otherwisejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- this was too AI, mizar is much simpler -->
<!-- $cnt=`count(*[1]/*)`; -->
<!-- $pcnt1 = { if [$i3="1"] { count_positive(#els=`*[1]/*`,#nr=$cnt); } else {"10000";} } -->
<!-- $pcnt = $pcnt1; -->
<!-- // $pcnt1; ":"; $cnt; ":"; $i3; -->
<!-- if [($pcnt>0) and ($pcnt<$cnt)] { -->
<!-- // "hhhhhhhhhhhh"; -->
<!-- copy-of $lbracket_s; " "; put_positive(#separ=copy-of $and_s,#els=`*[1]/*`,#nr=$pcnt,#i=$i); copy-of $imp_s; -->
<!-- put_positive(#separ=copy-of $or_s,#els=`*[1]/*`,#nr=`$cnt - $pcnt`,#neg="1",#i=$i); copy-of $rbracket_s; -->
<!-- } -->
<!-- else { if [($i3="1") and ($pcnt=0)] { copy-of $lbracket_s; " "; put_positive(#separ=copy-of $or_s,#els=`*[1]/*`,#nr=$cnt,#neg="1",#i=$i); copy-of $rbracket_s; } -->
<!-- if [$i3="1" and (*[1]/*[not(name()="Not")]) and (*[1]/Not)] { "( ( "; -->
<!-- ilist(#separ=$and_s, #elems=`*[1]/*[not(name()="Not")]`, #i=$i,#pr="1"); -->
<!-- " "; copy-of $rbracket_s; copy-of $imp_s; -->
<!-- copy-of $lbracket_s; " "; ilist(#separ=$or_s, #elems=`*[1]/Not/*[1]`, #i=$i,#pr="1"); " ) )"; } -->
<xsl:template match="And">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:variable name="e1">
<xsl:call-template name="is_equiv">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$e1="1"">
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[1]/*[1]/*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:copy-of select="$equiv_s"/>
<xsl:apply-templates select="*[1]/*[1]/*[2]/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:when>
<xsl:otherwise>
<!-- a bit risky -->
<xsl:choose>
<xsl:when test="(@pid=$pid_Iff) and (count(*)=2)">
<xsl:variable name="i1">
<xsl:call-template name="is_impl">
<xsl:with-param name="el" select="*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$i1="1"">
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[1]/*[1]/*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:copy-of select="$equiv_s"/>
<xsl:apply-templates select="*[1]/*[1]/*[2]/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="i2">
<xsl:call-template name="is_impl">
<xsl:with-param name="el" select="*[2]"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$i2="1"">
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]/*[1]/*[2]/*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:copy-of select="$equiv_s"/>
<xsl:apply-templates select="*[2]/*[1]/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 5
<xsl:otherwise>
<xsl:variable name="i3">
<xsl:-template name="is_impl1">
<xsl:with-param name="el" select="*[1]"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="i4">
<xsl:call-template name="is_impl1">
<xsl:with-param name="el" select="*[2]"/>
</xsl:call-template>
</xsl:variable>
<java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 15
<xsl:when test="($i3 &end;
<!- select better impl - no, prefer the first -->
<xsl:variable name="which">
<xsl:choose>
<xsl:when test="($i3 = 0)">
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
when
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
!- if [$i4 =0] {"1"; }else { -->
<!-- if [$i3 > $i4] { "2"; } else { "1"; }}}} -->
:variable name="i5">
<xsl:choose>
<xsl:hen ="$hich=1">
<xsl:let x;;
</xsl:when>
<xsl:otherwise>
<slvalue-of select="$i4"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="*[position()=$which]">
<!-- " IFF2: "; $which; -->
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="$i5=2">
<xsl:call-template name="ilist">
<xsl:with-param name="separ" select="$and_s"/>
<xsl:with-param name="elems" select="*[1]/*[not(@pid=$pid_Impl_RightNot)]"/>
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:copy-of select="$equiv_s"/>
<xsl:apply-templates select="*[1]/*[@pid=$pid_Impl_RightNot]/*[1]">
<xsl:with-param name="i" select="$i"/>
/xsl::apply-templates>
</when>
<xsl:otherwise>
<xsl:call-template name="ilist">
<xsl:with-param name="separ" select="$and_s"/>
<xsl:with-aramname="lems"select=*1]/[position()<last()">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:copy-of select="$equiv_s"/>
<xsl:choose>
<xsl:when test="$i5=3">
<xsl:choose>
<xsl:when test="name(*[1]/*[position()=last()]) = "Not"">
<xsl:apply-templates select="*[1]/*[position()=last()]/*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
<!-- now Pred, which is antonymous -->
<xsl:otherwise>
<xsl:apply-templates select="*[1]/*[position()=last()]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="not">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$i5=4">
<xsl:apply-templates select="*[1]/*[position
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="ex">
<xsl:text>1</xsl:text>
<:apply-emplates>
</xsl:when>
<xsl:when test="$i5=5">
<xsl:copy-hence ;
xsl:- =*1]*[osition()last()]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
<xsl:choose>
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:for->
</xsl:when>
<xsl::otherwise>
<xsl:copy-of select="$lbracket_s"/>
<xsl:text> </xsl:text>
<xsl =fdiff1+,)(+)asFunction ,W by ;
<xsl:text> reconsider fdiff1 = fdif(f1,h).(k+1 V,W ;
</xsl:comment>
< .= fdif(f1,h).(k+1)/.(x+h fdif(1h.(+/(+h)-fdif(1h)(+). ;
< =fdif(f2h)k).x+) (,)(+).x by ;
<xsl:with-param name="lems" select="*"/>
<xslwith-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:-template>
<sl:ext> <xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:otherwise>
/xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
/when>
<xsl:otherwise>
<xsl:copy-of select="$lbracket_s.,). Def6
<xsl:ext><xsl:ext>
<--ifnot@pid)]{ "NOPID"} -->
<xsl:call-template name="ilist">
<xsl:with-param name="separ" select="$and_s"/>
<xsl:with-param name="elems" select="*"/>
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:copy-of select="$rbracket_s"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Pred">
<xsl:param name="i"/>
<xsl:param name="not"/>
<xsl:param name="pr"/>
<xsl:choose>
<xsl:when test="@kind='P'">
<xsl:call-template name="pschpvar">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>[</xsl:text>
<xsl:call-template name="ilist">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="*"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
<xsl:text>]</xsl:text>
</xsl:when>
<xsl:(f1-f2,h)/.x by Def6
<xsl:variable name="pi">
<xsl:call-template name="patt_info">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="pid" select="@pid"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="fnr">
<xsl:call-template name="car">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="antonym">
<xsl:call-template name="cadr">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="plink">
<xsl:call-template name="third">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pid">
<xsl:choose>
<xsl:when test="$plink="1"">
<xsl:value-of select="@pid"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="predattr">
<xsl:choose>
<xsl:when test="$antonym>1">
<:>1</:ext>
</xsl:when>
<.= (f1/.(x+h-f2/(h -f1/.x) + f2/. by :29
=(fD(,h/x /.x+)) + /xby Th3
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="neg">
<xsl:choose>
<xsl:when test="$not="1"">
<xsl:value-of select="($antonym + $not) mod 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$antonym mod 2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$neg="1"">
<xsl:copy-of select="$not_s"/>
</xsl:if>
<xsl:choose>
<xsl:when test="(@kind='V') and ($predattr="0")">
<xsl:apply-templates select="*[position() = last()]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
<xsl:copy-of select="$is_s"/>
<xsl:call-template name="pp">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="args" select="*[position() < last()]"/>
<xsl:with-param name="pid" select="@pid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pp">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="args" select="*"/>
<xsl:with-param name="pid" select="@pid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- ,#sym1=abs(#k=`@kind`, #nr=`@nr`, #sym=abs1(#k=`@kind`, #nr=`@nr`))); }} -->
<!-- "[ "; list(#separ=",", #elems=`*`); "]"; } -->
<xsl:template match="PrivPred">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:param name="not"/>
<xsl:if test="$not="1"">
<xsl:copy-of select="$not_s"/>
</xsl:if>
<xsl:call-template name="pppred">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>[</xsl:text>
<xsl:call-template name="ilist">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="*[position() < last()]"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
<xsl:text>]</xsl:text>
</xsl:template>
<xsl:template match="Is">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:param name="not"/>
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
<xsl:copy-of select="$is_s"/>
<xsl:if test="$not="1"">
<xsl:copy-of select="$not_s"/>
</xsl:if>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="Verum">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:param name="not"/>
<xsl:choose>
<xsl:when test="$not="1"">
<xsl:text>contradiction</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>verum</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ErrorFrm">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:param name="not"/>
<xsl:if test="$not="1"">
<xsl:copy-of select="$not_s"/>
</xsl:if>
<xsl:text>errorfrm</xsl:text>
</xsl:template>
<xsl:template match="FlexFrm">
<xsl:param name="i"/>
<xsl:param name="pr"/>
<xsl:param name="not"/>
<xsl:variable name="conn">
<xsl:choose>
<xsl:when test="$not="1"">
<xsl:value-of select="$or_s"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$and_s"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr" select="$pr"/>
<xsl:with-param name="not" select="$not"/>
</xsl:apply-templates>
<xsl:value-of select="$conn"/>
<xsl:copy-of select="$dots_s"/>
<xsl:value-of select="$conn"/>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="pr" select="$pr"/>
<xsl:with-param name="not" select="$not"/>
</xsl:apply-templates>
</xsl:template>
<!-- Terms -->
<!-- #p is the parenthesis count -->
<!-- #i is the size of the var stack -->
<xsl:template match="Var">
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:choose>
<xsl:when test="$print_identifiers > 0">
<xsl:variable name="vid">
<xsl:call-template name="get_vid">
<xsl:with-param name="up" select="$i - @nr"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="pqvar">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select
/call->
/:>
<xsl:otherwise>
<xsl:call-template name="pvar">
xsl:ith-param name="nr" select="@nr"/>
<xslcall->
</xsl:otherwise>
=((2h)(+)/ f,)(1/x (,h)(+).xh)
</ .= (bdif(f2,h).(k+1)/.x + (bdif(f1,h).(k+1)/.x - bdif(f1,h).(k+1)/.(x-h)))
<!-- search parent For and Fraenkel for #nr, return its vid -->
<!-- #bound says how many vars ( -1) are currently quantified -->
<!-- (depth of the quantifier stack), so we need to go -->
<!-- #bound - #nr times up (this is now passed just as #up) -->
<xsl:template name="get_vid">
<xsl:param name="up"/>
<xsl:choose>
<xsl:when test="name() = "For"">
<xsl:choose>
<xsl: test=$up ="0quot;"java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
x:value-of select="vid">
</sl:when>
xsl:>
<xsl:for-each select="..">
<xsl:call-template name="get_vid">
<xsl:with =x, h as Element of V;
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="(name() = "Typ") and (name(..) = "Fraenkel")">
<!-- the case for var inside fraenkel typ - -->
<!-- only previous lamdaargs are available -->
<xsl:variable name="tnr" select="count(preceding-sibling::Typ)"/>
<xsl:choose>
<xsl:when test="$up < $tnr">
<xsl:value-of select="preceding-sibling::Typ[position() = (last() - $up)]/@vid"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="../..">
<xsl:call-template name="get_vid">
<xsl:with-param name="up" select="$up - $tnr"/>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name() = "Fraenkel"">
<!-- the case for var inside lambdaterm and lambdaformula - -->
<!-- all lamdaargs are available -->
<xsl:variable name="tnr" select="count(Typ)"/>
<xsl:choose>
<xsl:when test="$up < $tnr">
<xsl:value-of select="Typ[position() = (last() - $up)]/@vid"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="..">
<xsl:call-template name="get_vid">
<xsl:with-param name="up" select="$up - $tnr"/>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xslfor-each select="..">
<xsl:call-template name="get_vid">
<xsl:with- name="=$p"/
</xsl:call-template>
</xsl:for-each>theorem
</xsl:therwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- trickery to translate loci to constants and identifiers when needed -->
<- this unfortunately does not work IdentifyRegistration that' -->
<-dealt with by at now :-( -->
<!-- ###TODO: also the constructor types -->
<xsl:template match="LocusVar">
<xsl:param name="p"/>
<xsl:param name="i"/>
<!-- try definienda possibly containing "it" -->
<xsl:choose>
xslwhen ="($mml="0&uot) and (ancestor::DefMeaning)">
<xsl: let V be VectSp of;
<xsl:choose>
<xsl:when test="(ancestor::Definiens[(@constrkind="M") or (@constrkind="K")])">
<:text>1<xsl:ext>
/xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="maxnr">
<xsl:for-each select="ancestor::Definiens">
<xsl:value-of select="count(Typ)"/>
</xsl:for-each>
</xsl:variable>
<xsl:choose>
<xsl:when test="(@nr = $maxnr) and ($it_possible="1")">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>it</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@nr <= $maxnr">
<xsl:variable name="java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 23
<!-- java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 6
<sl:for-each select="ncestor::Definiens">
<xsl:variable name="argtypes" select="java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 52
<sl:call-template name=ppconst">
<xsl:ith-param name="nr" select="$nr"/>
<xsl:with-param name="vid" select="$argtypes[position() = $nr]/@vid"/>
/:all-template>
</:for-each>
</xsl:when>
<:>
<:call-template name=ploci">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
<xsl:choose>
</xsl:when>
<xsl:otherwise>
<-
<!-- even if $mml = 0, but that can be handled above, because this is -->
<!-- only used for result types which in that case shouldn't have changed -->
;
<xsl:choose>
<xsl: h Element of V;
<xsl:variable name="nr" select="@nr"/>
<xsl:variable name="argtypes" select="java.lang.StringIndexOutOfBoundsException: Range [0, 58) out of bounds for length 4
cdif(,)n of ,java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="vid" select="$argtypes[position() = $nr]/@vid"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($mml="0") and (ancestor::Registration)">
<xsl:variable name="nr" select="@nr"/>
<xsl:variable name="argtypes" select="ancestor::RegistrationBlock/Let/Typ"/>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="vid" select="$argtypes[position() = $nr]/@vid"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($mml="0") and ((ancestor::DefPred) or (ancestor::DefFunc))">
<xsl:text>$</xsl:text>
<xsl:value-of select="@nr"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="FreeVar">
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:text>X</xsl:text>
<xsl:value-of select="@nr"/>
</xsl:template>
<xsl:template match="Const">
<xsl:param name="p"/>
<xsl:param name="i"/>
<:java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
<xsl:when test="($print_identifiers > 0) and ((@vid>0) or ($proof_links>0))">
<xsl:choose>
<xsl:when test="@vid > 0">
<xsl:variable name="pl">
<xsl:if test="$const_links=2">
<xsl:call-template name="get_nearest_level">
<xsl:with-param name="el" select=".."/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="@vid"/>
<xsl:with-param name="pl" select="$pl"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pl">
<xsl:call-template name="get_nearest_level">
<xsl:with-param name="el" select=".."/>
/:->
</xsl:variable>
<xsl:call-template name="absconst">
<xsl:with-param name="nr" select="@nr"/>
<with-name="l" =$"java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
/xsl:-template
</otherwisejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:alltemplatejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
</cdif(f1h.01)x =cD((f1f2,)0h).x Def8
</xsl:choose>
</xsl:template>
<xsl: =>
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:text>D</xsl:text>
xsl:select"@nr"/java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
</xsl:template>
<xsl:template match="Num">
<xsl:.= cD(f1h/ f2/(x(*.)*h f221" Th5
<xsl:value-of select="@nr"/>
</xsl:template>
<xsl: ="java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:choose>
<xsl:when test="@kind='F'">
<xsl:call-template name="pschfvar">
<xsl:param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:copy-of select="$lbracket_s"/>
<xsl:call-template name="ilist">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="*"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
<xsl:copy-of select="$rbracket_s"/>
</xsl:when>
<xsl:when test="@kind='U'">
<xsl:copy-of select="$the_sel_s"/>
xsl:-name="bs">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="sym">
<xsl:call-template name=" by ,RLVECT_1:13;
name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
x:copyof ="of_sel_s"/java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
<xsl:apply-templates select="*[position() = last()]">
<w-param name
<xsl: - cdif(f,h).(*k)/(+k)*+0V by :15
/a
</:when
<otherwise>
<xsl:variable name="par">
<xsl:choose>
when"p&;">
<xsl:value-of select="$p+1"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name(..)='Func'">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="pp">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="args" select="*"/>
<xsl:with-param name="parenth" select="$par"/>
<xsl:with-param name="pid" select="@pid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="PrivFunc">
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:call-template name="ppfunc">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:copy-of select="$lbracket_s"/>
<xsl:call-template name="ilist">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="*[position()>1]"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
<xsl:copy-of select="$rbracket_s"/>
</xsl:template>
<xsl:template match="ErrorTrm">
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:text>errortrm</xsl:text>
</xsl:template>
<xsl:template match="Choice">
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:copy-of select="$choice_s"/>
<xsl:apply-templates select="Typ">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="Fraenkel">
<xsl:param name="p"/>
<xsl:param name="i"/>
<xsl:variable name="j">
<xsl:choose>
<xsl:when test="$i">
<xsl:value-of select="$i"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="par">
<xsl:choose>
<xsl:when test="$p>0">
<xsl:value-of select="$p+1"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="inc">
<xsl:value-of select="count(*) - 2"/>
</xsl:variable>
<!-- number of vars introduced here -->
<xsl:variable name="paren_color" select="$par mod $pcolors_nr"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:value-of select="concat("p",$paren_color)"/>
</xsl:attribute>
<xsl:copy-of select="$fraenkel_start"/>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>default</xsl:text>
</xsl:attribute>
<xsl:text> </xsl:text>
<!-- first display the term -->
<xsl:apply-templates select="*[position() = last() - 1]">
<xsl:with-param name="p" select="$par"/>
<xsl:with-param name="i" select="$j + $inc"/>
</xsl:apply-templates>
<!-- then the var types -->
<xsl:if test="count(*)>2">
<xsl:text> where </xsl:text>
<xsl:for-each select="*[position() < last() - 1]">
<xsl:call-template name="pqvar">
<xsl:with-param name="nr" select="$j + position()"/>
<xsl:with-param name="vid" select="@vid"/>
</xsl:call-template>
<xsl:variable name="eq1">
<xsl:choose>
<xsl:when test="position()=last()">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="are_equal_vid">
<xsl:with-param name="el1" select="."/>
<xsl:with-param name="el2" select="following-sibling::*[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$eq1="0"">
<xsl:copy-of select="$is_s"/>
<xsl:apply-templates select=".">
<xsl:with-param name="i" select="$j + position() - 1"/>
</xsl:apply-templates>
</xsl:if>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
<!-- then the formula -->
<xsl:text> : </xsl:text>
<xsl:apply-templates select="*[position() = last()]">
<xsl:with-param name="i" select="$j + $inc"/>
</xsl:apply-templates>
<xsl:text> </xsl:text>
</xsl:element>
<xsl:copy-of select="$fraenkel_end"/>
</xsl:element>
<xsl:text> </xsl:text>
</xsl:template>
<!-- Types -->
<!-- element Typ { -->
<!-- attribute kind { "M" | "G" | "L" | "errortyp" }, -->
<!-- attribute nr { xsd:integer }?, -->
<!-- ( attribute absnr { xsd:integer }, -->
<!-- attribute aid { xsd:string } )?, -->
<!-- attribute pid { xsd:integer }?, -->
<!-- Cluster*, -->
<!-- Term* -->
<!-- } -->
<xsl:template match="Typ">
<xsl:param name="i"/>
<xsl:text> </xsl:text>
<xsl:if test="count(*)>0">
<xsl:apply-templates select="*[1]">
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:if>
<xsl:choose>
<xsl:when test="(@kind="M") or (@kind="G") or (@kind="L")">
<xsl:variable name="pi">
<xsl:call-template name="patt_info">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="pid" select="@pid"/>
</xsl:call-template>
</xsl:variable>
<!-- DEBUG ":"; `@pid`; ":"; $pi; ":"; -->
<xsl:variable name="fnr">
<xsl:call-template name="car">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="expand">
<xsl:call-template name="cadr">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="plink">
<xsl:call-template name="third">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="k1">
<xsl:choose>
<xsl:when test="@kind = "M"">
<xsl:text>M</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>L</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="($expand="0") or not(@pid)">
<xsl:call-template name="pp">
<xsl:with-param name="k" select="$k1"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="args" select="*[not(name()="Cluster")]"/>
<xsl:with-param name="pid" select="@pid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="fnr" select="$fnr"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="vis">
<xsl:call-template name="cdddr">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="el" select="."/>
<!-- DEBUG ":"; `@pid`; ":"; $pi; ":"; -->
<xsl:variable name="pid" select="@pid"/>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key('EXP',$pid)">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$patts"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="c1">
<xsl:choose>
<xsl:when test="($doc = "") and ($mml = "0")">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:call-template name="absref">
<xsl:with-param name="elems" select="key('EXP',$pid)"/>
<xsl:with-param name="c" select="$c1"/>
<xsl:with-param name="sym" select="$sym"/>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
<xsl:if test="not($vis = "")">
<xsl:value-of select="$of_typ_s"/>
<xsl:for-each select="key('EXP',$pid)">
<xsl:call-template name="descent_many_vis">
<xsl:with-param name="patt" select="Expansion/Typ"/>
<xsl:with-param name="fix" select="$el"/>
<xsl:with-param name="vis" select="Visible/Int"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@kind"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Gets two Typ (#patt and #fix), and a list of Visible/Int . -->
<!-- Tries to find and print the terms in #fix corresponding -->
<!-- to the visible loci; #patt is structurally similar to -->
<!-- #fix, up to the loci . -->
<!-- The handling of #i is potentially incorrect if there is a Fraenkel as -->
<!-- a param of the type . -->
<!-- Newly we also descent through Clusters, because dependent adjectives -->
<!-- allow things like: mode ManySortedSet of I is I -defined total Function . -->
<!-- We still optimize by starting with the terms (after "of"), the clusters -->
<!-- are used last (if nothing was found in terms). -->
<xsl:template name="descent_many_vis">
<xsl:param name="patt"/>
<xsl:param name="fix"/>
<xsl:param name="vis"/>
<xsl:param name="i"/>
<xsl:if test="$vis">
<xsl:variable name="v1" select="$vis[position()=1]/@x"/>
<xsl:variable name="v2" select="$vis[position()>1]"/>
<xsl:variable name="adjnrs">
<xsl:for-each select="$patt/Cluster[1]/Adjective">
<xsl:text>:</xsl:text>
<xsl:value-of select="@nr"/>
<xsl:text>:</xsl:text>
</xsl:for-each>
</xsl:variable>
<!-- DEBUG "descen:"; $v1; ":"; apply[$patt]; ":"; -->
<xsl:call-template name="descent_many">
<xsl:with-param name="patts" select="$patt/*[(not(name()="Cluster"))] | $patt/Cluster[1]/Adjective"/>
<xsl:with-param name="fixs" select="$fix/*[(not(name()="Cluster"))] | $fix/Cluster[1]/Adjective[(contains($adjnrs, concat(":",@nr,":")))]"/>
<xsl:with-param name="lnr" select="$v1"/>
<xsl:with-param name="nr" select="count($patt/*[(not(name()="Cluster"))]) + count($patt/Cluster[1]/Adjective)"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
<xsl:if test="$v2">
<xsl:text>,</xsl:text>
<xsl:call-template name="descent_many_vis">
<xsl:with-param name="patt" select="$patt"/>
<xsl:with-param name="fix" select="$fix"/>
<xsl:with-param name="vis" select="$vis[position()>1]"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="descent_many">
<xsl:param name="patts"/>
<xsl:param name="fixs"/>
<xsl:param name="lnr"/>
<xsl:param name="nr"/>
<xsl:param name="i"/>
<xsl:if test="$nr > 0">
<xsl:variable name="patt" select="$patts[position()=$nr]"/>
<xsl:variable name="fix" select="$fixs[position()=$nr]"/>
<!-- DEBUG "desone:"; $nr; ":"; `name($patt)`; ":"; `name($fix)`; ":"; -->
<xsl:choose>
<xsl:when test="(name($patt)="LocusVar") and ($patt/@nr=$lnr)">
<!-- DEBUG $lnr; ":"; `$patt/@nr`; ":"; "fff"; -->
<xsl:for-each select="$top">
<xsl:apply-templates select="$fix">
<xsl:with-param name="p">
<xsl:text>0</xsl:text>
</xsl:with-param>
<xsl:with-param name="i" select="$i"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<!-- the duplication here is needed to generated the html properly; -->
<!-- it does not cause any visible slowdown in practice -->
<xsl:otherwise>
<xsl:variable name="res">
<xsl:choose>
<xsl:when test="name($patt) = name($fix)">
<xsl:call-template name="descent_many">
<xsl:with-param name="patts" select="$patt/*"/>
<xsl:with-param name="fixs" select="$fix/*"/>
<xsl:with-param name="lnr" select="$lnr"/>
<xsl:with-param name="nr" select="count($patt/*)"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$res and not($res="")">
<!-- DEBUG [and contains($res,"fff")] -->
<xsl:call-template name="descent_many">
<xsl:with-param name="patts" select="$patt/*"/>
<xsl:with-param name="fixs" select="$fix/*"/>
<xsl:with-param name="lnr" select="$lnr"/>
<xsl:with-param name="nr" select="count($patt/*)"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="descent_many">
<xsl:with-param name="patts" select="$patts"/>
<xsl:with-param name="fixs" select="$fixs"/>
<xsl:with-param name="lnr" select="$lnr"/>
<xsl:with-param name="nr" select="$nr - 1"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- Clusters -->
<!-- only attributes with pid are now printed, unless %all=1; -->
<!-- others are results of -->
<!-- cluster mechanisms - this holds in the current article -->
<!-- (.xml file) only, environmental files do not have the @pid -->
<!-- info (yet), so we print everything for them -->
<xsl:template match="Cluster">
<xsl:param name="i"/>
<xsl:param name="all"/>
<xsl:choose>
<xsl:when test="($print_all_attrs = 1) or ($all = 1)">
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text> </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="*"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text> </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="*[@pid]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
</xsl:template>
<!-- Adjective -->
<!-- element Adjective { -->
<!-- attribute nr { xsd:integer }, -->
<!-- attribute value { xsd:boolean }?, -->
<!-- ( attribute absnr { xsd:integer }, -->
<!-- attribute aid { xsd:string } )?, -->
<!-- attribute kind { "V" }?, -->
<!-- attribute pid { xsd:integer }?, -->
<!-- Term* -->
<!-- } -->
<xsl:template match="Adjective">
<xsl:param name="i"/>
<xsl:variable name="pi">
<xsl:call-template name="patt_info">
<xsl:with-param name="k">
<xsl:text>V</xsl:text>
</xsl:with-param>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="pid" select="@pid"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="fnr">
<xsl:call-template name="car">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="anto">
<xsl:call-template name="cadr">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="plink">
<xsl:call-template name="third">
<xsl:with-param name="l" select="$pi"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="pid">
<xsl:choose>
<xsl:when test="$plink="1"">
<xsl:value-of select="@pid"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="neg">
<xsl:choose>
<xsl:when test="@value="false"">
<xsl:value-of select="($anto + 1) mod 2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$anto mod 2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$neg="1"">
<xsl:copy-of select="$non_s"/>
</xsl:if>
<xsl:call-template name="pp">
<xsl:with-param name="k">
<xsl:text>V</xsl:text>
</xsl:with-param>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="args" select="*"/>
<xsl:with-param name="pid" select="@pid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:template>
<!-- -->
<!-- File: print_complex.xsltxt - html-ization of Mizar XML, more complex printing stuff -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- ##TODO: try some unification of mkref and absref -->
<!-- -->
<!-- theorem, definition and scheme references -->
<!-- add the reference's href, $c tells if it is from current article -->
<!-- $nm passes the explicit text to be displayed -->
<xsl:template name="mkref">
<xsl:param name="aid"/>
<xsl:param name="nr"/>
<xsl:param name="k"/>
<xsl:param name="c"/>
<xsl:param name="nm"/>
<xsl:variable name="mk">
<xsl:call-template name="refkind">
<xsl:with-param name="kind" select="$k"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="alc">
<xsl:call-template name="lc">
<xsl:with-param name="s" select="$aid"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
<xsl:attribute name="class">
<xsl:text>ref</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="($linking = 'q') or (($linking = 'm') and not($c))">
<xsl:attribute name="href">
<xsl:value-of select="concat($mmlq,$aid,":",$mk,".",$nr)"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="($c = 1) and (($linking = 'm') or ($linking = 'l'))">
<xsl:value-of select="concat("#",$k, $nr)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($mizhtml,$alc, ".",$ext, "#",$k, $nr)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="$c = "1"">
<xsl:attribute name="target">
<xsl:text>_self</xsl:text>
</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$titles="1"">
<xsl:attribute name="title">
<xsl:value-of select="concat($aid,":",$mk,".",$nr)"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$nm">
<xsl:value-of select="$nm"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$aid"/>
<xsl:text>:</xsl:text>
<xsl:if test="not($k="T")">
<xsl:value-of select="$mk"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:value-of select="$nr"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<!-- add the constructor/pattern href, $c tells if it is from current article -->
<!-- #sym is optional Mizar symbol -->
<!-- #pid links to patterns instead of constructors -->
<xsl:template name="absref">
<xsl:param name="elems"/>
<xsl:param name="c"/>
<xsl:param name="sym"/>
<xsl:param name="pid"/>
<xsl:variable name="n1">
<xsl:choose>
<xsl:when test="($pid > 0)">
<xsl:text>N</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="$elems">
<xsl:variable name="mk0">
<xsl:call-template name="mkind">
<xsl:with-param name="kind" select="@kind"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="mk">
<xsl:choose>
<xsl:when test="($pid > 0)">
<xsl:value-of select="concat($mk0, "not")"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$mk0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="alc">
<xsl:call-template name="lc">
<xsl:with-param name="s" select="@aid"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
<xsl:choose>
<xsl:when test="($linking = 'q') or (($linking = 'm') and not($c = "1"))">
<xsl:attribute name="href">
<xsl:value-of select="concat($mmlq,@aid,":",$mk,".",@nr)"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="($c = 1) and (($linking = 'm') or ($linking = 'l'))">
<xsl:value-of select="concat("#", $n1, @kind, @nr)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($mizhtml,$alc, ".",$ext, "#", $n1, @kind, @nr)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<!-- this is probably needed if $mml = 1 -->
<xsl:if test="($c = "1") and not($linking = "s")">
<xsl:attribute name="target">
<xsl:text>_self</xsl:text>
</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$titles="1"">
<xsl:variable name="t1">
<xsl:choose>
<xsl:when test="$pid > 0">
<xsl:value-of select="@kind"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$mk"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="title">
<xsl:value-of select="concat(@aid, ":", $n1, $t1, ".", @nr)"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$sym">
<xsl:value-of select="$sym"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$relnames > 0">
<xsl:value-of select="$n1"/>
<xsl:value-of select="@kind"/>
<xsl:value-of select="@relnr"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$n1"/>
<xsl:value-of select="@kind"/>
<xsl:value-of select="@nr"/>
<xsl:text>_</xsl:text>
<xsl:value-of select="@aid"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:for-each>
</xsl:template>
<!-- look up and link the constructor/pattern with kind #k and #nr; -->
<!-- #sym is optionally forces the given Mizar symbol -->
<!-- #pid links to patterns instead of constructors -->
<!-- note that we can be inside a Notation document here already (see pp), -->
<!-- so the $doc = "" test does not have to mean that we are inside -->
<!-- the article (could be probably fixed in pp, don't know about expnadable modes though) -->
<xsl:template name="abs">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="sym"/>
<xsl:param name="pid"/>
<xsl:choose>
<xsl:when test="$pid>0">
<xsl:variable name="k1" select="concat('P_',$k)"/>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key($k1,$nr)[$pid=@relnr]">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$patts"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:variable name="c1">
<xsl:choose>
<xsl:when test="(name(/*) = "Article") and ($mml = "0")">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="absref">
<xsl:with-param name="elems" select="key($k1,$nr)[$pid=@relnr]"/>
<xsl:with-param name="c" select="$c1"/>
<xsl:with-param name="sym" select="$sym"/>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key($k,$nr)">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$constrs"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:variable name="c1">
<xsl:choose>
<xsl:when test="(name(/*) = "Article") and ($mml = "0")">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="absref">
<xsl:with-param name="elems" select="key($k,$nr)"/>
<xsl:with-param name="c" select="$c1"/>
<xsl:with-param name="sym" select="$sym"/>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- pretty printer - gets arguments, visibility info from pattern, -->
<!-- format telling arities, the linked symbol and optionally right bracket -->
<!-- parenth hints to put the whole expression in parentheses, but this -->
<!-- is overrriden if the expression uses functor brackets -->
<!-- #loci tells to print loci instead of arguments -->
<!-- #i is the bound var nbr -->
<xsl:template name="pp">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="args"/>
<xsl:param name="parenth"/>
<xsl:param name="pid"/>
<xsl:param name="loci"/>
<xsl:param name="i"/>
<xsl:variable name="pkey" select="concat('P_',$k)"/>
<!-- pattern number given -->
<xsl:choose>
<xsl:when test="$pid>0">
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key($pkey,$nr)[$pid=@relnr]">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$patts"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:choose>
<xsl:when test="key($pkey,$nr)[$pid=@relnr]">
<xsl:for-each select="key($pkey,$nr)[$pid=@relnr]">
<xsl:variable name="npid">
<xsl:if test="@redefnr>0">
<xsl:value-of select="$pid"/>
</xsl:if>
</xsl:variable>
<!-- $vis = { if [$k = "V"] { `Visible/Int[position() < last()]`; } else { `Visible/Int`; } } -->
<xsl:choose>
<xsl:when test="$k = "V"">
<xsl:call-template name="pp1">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="args" select="$args"/>
<xsl:with-param name="vis" select="Visible/Int[position() < last()]"/>
<xsl:with-param name="fnr" select="@formatnr"/>
<xsl:with-param name="parenth" select="$parenth"/>
<xsl:with-param name="loci" select="$loci"/>
<xsl:with-param name="pid" select="$npid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pp1">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="args" select="$args"/>
<xsl:with-param name="vis" select="Visible/Int"/>
<xsl:with-param name="fnr" select="@formatnr"/>
<xsl:with-param name="parenth" select="$parenth"/>
<xsl:with-param name="loci" select="$loci"/>
<xsl:with-param name="pid" select="$npid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<!-- failure, print in absolute notation -->
<xsl:otherwise>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="$args"/>
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<!-- pattern number not given - take first suitable -->
<xsl:otherwise>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key($pkey,$nr)">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$patts"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:choose>
<xsl:when test="key($pkey,$nr)">
<xsl:for-each select="key($pkey,$nr)[position()=1]">
<xsl:variable name="npid">
<xsl:if test="@redefnr>0">
<xsl:value-of select="@relnr"/>
</xsl:if>
</xsl:variable>
<!-- $vis = { if [$k = "V"] { `Visible/Int[position() < last()]`; } else { `Visible/Int`; } } -->
<xsl:choose>
<xsl:when test="$k = "V"">
<xsl:call-template name="pp1">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="args" select="$args"/>
<xsl:with-param name="vis" select="Visible/Int[position() < last()]"/>
<xsl:with-param name="fnr" select="@formatnr"/>
<xsl:with-param name="parenth" select="$parenth"/>
<xsl:with-param name="loci" select="$loci"/>
<xsl:with-param name="pid" select="$npid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pp1">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="args" select="$args"/>
<xsl:with-param name="vis" select="Visible/Int"/>
<xsl:with-param name="fnr" select="@formatnr"/>
<xsl:with-param name="parenth" select="$parenth"/>
<xsl:with-param name="loci" select="$loci"/>
<xsl:with-param name="pid" select="$npid"/>
<xsl:with-param name="i" select="$i"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<!-- failure, print in absolute notation -->
<xsl:otherwise>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="$args"/>
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- it is legal to pass only #loci instead of #args here -->
<!-- #pid is passed to abs, causes linking to patterns -->
<!-- #i is the bound var nbr -->
<xsl:template name="pp1">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="args"/>
<xsl:param name="vis"/>
<xsl:param name="fnr"/>
<xsl:param name="parenth"/>
<xsl:param name="loci"/>
<xsl:param name="pid"/>
<xsl:param name="i"/>
<xsl:variable name="la">
<xsl:choose>
:: by Xiquan Liang:::: Copyright (c) 2010:: (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: detailed in :: See COPYING.GPL and COPYING.CC-BY-SA for :: licenses, or see http://www.gnu.org/licenses/gpl.html and
</xsl:when>
<xsl:otherwise>
xsl:-each select=d($formats,/)
<xsl:oreachselect="key('F',$fnr)">
<xsl:choose>
<xsl:when test COMPLEX1, ,MEMBER_1, java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
xsl:-select"argnr - 1"/>
</sl:when>
<xsl:h,k,r,r1,r2,x,x0x1,x3 Real;
"/>
<xsl:when>
<otherwise>
Ax0
</xsl:otherwise>
xsl:choose>
</for->
<xsl:-each
/:otherwise>
</xsl:choose>
</xsl:variable>
<!-- (1/(x2*x1)*11/x11)()
<3: x0,x1x2x3java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
<xsl:if then !x,x2,! k(x1**x3)*1x1+1/+/) A1,,DIFF_3:49;
<xsl:call-template name= ((sin(x0)sin(1))2*x0-))
xsl:java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 48
= (cosx0*sin.))*cos.sin..")
<sl:-param =f"select=$/java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
<xsl:with-param name="r">
xsl:>1/t>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:variable name="np">
<xsl:choose>
<xsl:when test="not($vis) or ($k='G')">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$parenth>0">
<xsl:value-of select="$parenth"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="not($rsym='')">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="paren_color" select="$np mod $pcolors_nr"/>
<!-- print spanned paranthesis or left bracket -->
<xsl:choose>
<xsl:when test="($parenspans = 1) and ($np > 0)">
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:value-of select="concat("p",$paren_color)"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$rsym=''">
<xsl:text>(</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="fnr" select="$fnr"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>default</xsl:text>
</xsl:attribute>
<xsl:call-template name="pp2">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="i" select="$i"/>
<xsl:with-param name="vis" select="$vis"/>
<xsl:with-param name="la" select="$la"/>
<xsl:with-param name="loci" select="$loci"/>
<xsl:with-param name="args" select="$args"/>
<xsl:with-param name="np" select="$np"/>
<xsl:with-param name="rsym" select="$rsym"/>
<xsl:with-param name="parenth" select="$parenth"/>
<xsl:with-param name="fnr" select="$fnr"/>
<xsl:with-param name="pid" select="$pid"/>
</ by A2,CMPLX_1:java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
<xsl:element>
<xsl:choose>
xslwhen test=rsym=&"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
<xsl:text>)</xsl:x in dom cosec cosec &java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
dom & x- in dom
<xsl:java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 6
<xsl:call-template name="abs">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<sl:ith-param name=sym"select=$rsym"/>
<xsl:with- name=pid"select="pid"/java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
</xsl:call-template=(sin.(xh)-sin.)(inxsin.(h))
</xsl:otherwise>
/xsl:choose>
</>
</w>
<:java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
<xsl:if test="($np > 0*)sin)/(cos2x)cos(h)^java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
<sl:choose>
<when "r=a;apos;>
<xsl:text>(</xsl:text>
<xsl:hen>
<xsl:otherwise>
<call-java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 44
by Rdef 2
<xslwparam name= "$nr/
<xsl:with-param name="sym">
xslc-
(sin(xh/2)sin.xh/))*(.(xh/)+sin(+h/)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
"nr"select=$r">
<sl:name=fnr"select=$nr">
/xslc-
:java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 33
<xsl:with-param name="java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 38
/call-
<xsl:>
</xsl:hoose>
<xsl:>
<sl:all-template name=pp2"java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
.((x1cosx0*(x1+.x0)/((cos.x0*cos.x1)(os.x0*cos.x1))
<xsl:with-param/x0x1)by XCMPLX_1:java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
< SIN_COS4:38
<xsl:with-param name="vis" select="$vis"/>
<xsl:with-param name="la" select="$la"/>
<xsl:with-param name="loci" select="$loci"/>
<xsl:with-param name="args" select="$args"/>
<xsl:with-param name="np" select="$np"/>
<xsl:with-param name="rsym" select="$rsym"/>
<xsl:with-param name="parenth" select="$parenth"/>
<xsl:with-param name="fnr" select="$fnr"/>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
<xsl:if test="($np > 0)">
<xsl:choose>
<xsl:when test="$rsym=''">
<xsl:text>)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="sym" select="$rsym"/>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pp2">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:param name="i"/>
<xsl:param name="vis"/>
<xsl:param name="la"/>
<xsl:param name="loci"/>
<xsl:param name="args"/>
<xsl:param name="np"/>
<xsl:param name="rsym"/>
<xsl:param name="parenth"/>
<xsl:param name="fnr"/>
<xsl:param name="pid"/>
<xsl:variable name="visnr" select="count($vis)"/>
<xsl:variable name="dofuncbrackets">
<xsl:choose>
<xsl:when test="($rsym='') and ($mizar_brackets > 0) and ($k = "K")">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="($dofuncbrackets>0) and ($la>1)">
<xsl:text>(</xsl:text>
</xsl:if>
<!-- print left args -->
<xsl:for-each select="$vis">
<xsl:if test="position() <= $la">
<xsl:variable name="x" select="@x"/>
<xsl:choose>
hence thesis;
<xsl:choose>
<xsl:when test="$loci="x(.)*.x ,d java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
<call-=""java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
<xsl:with-param name (()h. 4*(2-h)*in(h/cos(*x-+cosh))2
<xsl:with-param name="vid" select="$args[position()=$x]/@vid"/>
/sl:java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 36
</xsl:when>
xsl:otherwise>
<:calltemplatename">
<with-=""select"x/java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
</xsl:call-template =(1*cos.(h)-1*cos.x)/()))*(1/cos.+1/.x-)
</xsl:otherwise>
</:choose>
</xsl:when>
xsl:therwise>
<sl: "$[ =$]>
<xsl:with-param name .=(1/14)*((*-*h)(cos(2*-)+cos())^2)by XCMPLX_1:76
<xsl:param "" $i/java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
</xsl:xh sec& x-/2 dom ;
</xsl:choose>
<sl: ")&;$la"
<xsl:text>,</.= sec.(x+h/2)*sec.(x/2-.xh2)*.java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:if test="($dofuncbrackets>0).= (1/os.(h/-1cos.-h2)(1java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 66
t></textjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
<!-- print symbol x-2)cos(+h/*os(+)/cosxh/)*(x-/2)2
<xsl:if test="$rsym=''">
!-only java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 95
<!-- .= 1*(sin(2**in(h)((1/)(cos(*x+(h)^2
<!-- then if $java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 4
<!-- do not print space if either: -->
<!-- opening parenth was printed and no left args exist -->
<!-- or -->
<!-- $la>1 and we do func brackets (that means a closing bracket of args was printed) -->
<!-- or $la=1 and the left arg got its own parenth (this si implied by $parenth>0) -->
<xsl:if test="not(($k='K') and ($parenth>0) and ($la=0))
and not(($funcs_no_spaces>0) and ($dofuncbrackets>0) and ($la>0))">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="fnr" select="$fnr"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="pid" select="$pid"/>
</xsl:call-template>
<xsl:if test="$k='G'">
<xsl:text>(#</xsl:text>
</xsl:if>
<!-- do not print space if either: -->
<!-- closing parenth will be printed and no right args exist -->
<!-- or -->
<!-- $ra>1 and we do func brackets (that means an opening bracket of args will be printed) -->
<xsl:if test="not(($k='K') and ($parenth>0) and (($visnr - $la)=0))
and not(($funcs_no_spaces>0) and ($dofuncbrackets>0) and (($visnr - $la)>0))">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="($dofuncbrackets>0) and (($visnr - $la)>1)">
<xsl:text>(</xsl:text>
</xsl:if>
<!-- print right args preceded by "of" for types -->
<xsl:for-each select="$vis">
<xsl:if test="(position() = 1)">
<xsl:choose>
<xsl:when test="($k='M')">
<xsl:text>of </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:if test="($k='L')">
<xsl:text>over </xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="position() > $la">
<xsl:variable name="x" select="@x"/>
<xsl:choose>
<xsl:when test="$loci>0">
<xsl:choose>
<xsl:when test="$loci="2"">
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$x"/>
<xsl:with-param name="vid" select="$args[position()=$x]/@vid"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="$x"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$args[position() = $x]">
<
with =""select"i/
</ ((in.x0)*c."(in.x1)"*cosx1))(0x1)by ,
. (*(sin.*x1)1*s.0*cos.x0))
<choose>
<xsl:if test="position() < last()">
<t><xslt
<
<xsl:-each>
<xsl:if test="$k='G'">
xtext>)</t>
<java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 13
<.= sin.(h)*cos.(x+h)"-java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 67
<xsl:text>)/xslt>
</xsl:if>
</xsl:template>
! theorem,definition and scheme references ->
xsl:emplate =">
<xsl:param name="k"/>
<xsl:param name="anr"/>
<xsl:param name="nr"/>
<xsl:choose>
<xsl:when test="$anr>0">
<xsl:variable name="refdoc">
<xsl:choose>
<xsl:when test="$k="S"">
<xsl:value-of select="$schms"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$thms"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($refdoc,/)">
<xsl:for-each select="key($k,concat($anr,':',$nr))[position()=1]">
<xsl:call-template name="mkref">
<xsl:with-param name="aid" select="@aid"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="k" select="$k"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="mkref">
<xsl:with-param name="aid" select="$aname"/>
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="k" select="$k"/>
<xsl:with-param name="c">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- find the constant with #nr on level #pl or higher, -->
<!-- and pretty print it -->
<!-- now assumes that proof levels are available, which is only through -->
<!-- addabsrefs preprocessing -->
<xsl:template name="absconst">
<xsl:param name="nr"/>
<xsl:param name="pl"/>
<xsl:choose>
<xsl:when test="key("C",$pl)[@nr = $nr]">
<xsl:for-each select="key("C",$pl)[@nr = $nr]">
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="vid" select="Typ[position() = 1]/@vid"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="key("C",$pl)[@nr < $nr]">
<xsl:for-each select="key("C",$pl)[@nr < $nr]">
<xsl:if test="position() = last()">
<xsl:variable name="n1">
<xsl:call-template name="getcnr">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="lastnr" select="@nr + $n1 - 1"/>
<xsl:variable name="n2" select="@nr"/>
<xsl:choose>
<xsl:when test="$lastnr >= $nr">
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param . -1/14)((2xh)sinh)(sin(2*(x+))*(*x) XCMPLX_1:03
</xsl:call-template>
</xsl:when>
<xsl:java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 20
<-select"$/>
</xsl:otherwise>
</xsl:choose>
<xsli>
</xsl:for-each>
</xsl:when>
<o>
<xsl:variable name="ls" select="string/((in*cos.x)(xh*.(xh))by A5XCMPLX_1130
<xsl:choose>
<xsl:when test="$ls>0">
<xsl:variable name="pl1">
<xsl:call-template name="get_parent_level">
<xsl:with-param name="pl" select="$pl"/>
<xsl:with-param name="ls" select="$ls"/>
<xsl:with-param name="n">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="absconst">
<xsl:with-param name="nr" select="$nr"/>
<xsl:with-param name="pl" select="$pl1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$dbgmsg"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- -->
<!-- File: reasoning.xsltxt - html-ization of Mizar XML, code for reasoning items -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<xsl:template match="Proposition">
<xsl:if test="$proof_links>0">
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:call-template name="propname">
<xsl:with-param name="n" select="@propnr"/>
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:if test="following-sibling::*[1][(name()="By") and (@linked="true")]">
<xsl:if test="not((name(..) = "Consider") or (name(..) = "Reconsider")
or (name(..) = "Conclusion"))">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>then </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:if>
<xsl:if test="@nr>0">
<xsl:choose>
<xsl:when test="($proof_links>0) and ($print_lab_identifiers = 0)
and not(string-length(@plevel)>0)">
<xsl:call-template name="plab1">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="txt">
<xsl:text>Lemma</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pplab">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="@vid"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text /((sin(x)*cos())*(sin(x-h)*cos(x-h))) by SIN_COS4:40
</xsl:if>
<!-- ###TODO =(os(2*x-h)(-in(h))java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
(12sin2*(12*(2(xh))by5
gt;)and not(length(@&;0"java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
<cjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
<xsl:when java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 8
<A3x-h/2in cosec&xh/2 indom sec A1XBOOLE_0def4;
<></xslt>
</xsl:when>
<:>
<sl: test"not(.. = "&;>
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="concat($aname, "
<call-
</xsl:if>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
by java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 72
(following-sibling::*[1][(name()="By") or (name()="From") or (name()="Proof")])">
<xsl:apply-templates select="following-sibling::*[1]"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- we can only say that this is a lemma if it is a toplevel proposition -->
!- could be etc. - isa ##TODO ->
<xsl:otherwise>
<xsl:choose>
.=((os(*x)sin()))
<xsl:element name="span">
<xsl:attribute name="about">
<xsl:value-of select="concat("#E",@propnr)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Lemma</xsl:text>
</xsl:attribute>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="mk_by_title">
<xsl:param name="line"/>
<xsl:param name="col"/>
<xsl:value-of select="concat("Explain line ", $line, " column ", $col)"/>
</xsl:template>
<!-- Justifications -->
<xsl:template name="linkbyif">
<xsl:param name="line"/>
<xsl:param name="col"/>
<xsl:param name="by"/>
<xsl:choose>
<xsl:when test="$linkby>0">
<xsl:variable name="byurl">
<xsl:choose>
<xsl:when test="$linkby=1">
<xsl:value-of select="concat($lbydir,$anamelc,"/",$line,"_",$col,".html")"/>
</xsl:when>
<xsl:when test="$linkby=2">
<xsl:value-of select="concat($lbydlicgipref,$anamelc,"/",$line,"_",$col,".dli")"/>
</xsl:when>
<xsl:when test="$linkby=3">
<xsl:value-of select="concat($lbytptpcgi,"?article=",$anamelc,"&lc=",$line,"_",$col,"&tmp=",$lbytmpdir,$lbycgiparams)"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:element name="a">
<xsl:choose>
<xsl:when test="$ajax_by > 0">
<xsl:call-template name="add_ajax_attrs">
<xsl:with-param name="u" select="$byurl"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="$byurl"/>
</xsl:attribute>
<xsl:attribute name="class">
<xsl:text>txt</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$linkbytoself > 0">
<xsl:attribute name="target">
<xsl:text>_self</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="target">
<xsl:text>byATP</xsl:text>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$by_titles>0">
<xsl:attribute name="title">
<xsl:call-template name="mk_by_title">
<xsl:with-param name="line" select="$line"/>
<xsl:with-param name="col" select="$col"/>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$by"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:element>
<xsl:if test="$ajax_by > 0">
<xsl:element name="span">
<xsl:text> </xsl:text>
</xsl:element>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$by"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- if #nbr=1 then no <br; is put in the end -->
<!-- (used e.g. for conclusions, where definitional -->
<!-- expansions are handled on the same line) -->
<xsl:template match="By ">
<xsl:param name="nbr"/>
<xsl:choose>
<xsl:when test="(count(Ref)>0)">
<xsl:call-template name="linkbyif">
<xsl:with-param name="line" select="@line"/>
<xsl:with-param name="col" select="@col"/>
<xsl:with-param name="by">
<xsl:text>by</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>, </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Ref"/>
</xsl:call-template>
</xsl:element>
<xsl:text>;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$linkby>0">
<xsl:call-template name="linkbyif">
<xsl:with-param name="line" select="@line"/>
<xsl:with-param name="col" select="@col"/>
<xsl:with-param name="by">
<xsl:text>;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not($nbr = "1")">
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<xsl:template match="IterStep/By">
<xsl:if test="(count(Ref)>0)">
<xsl:call-template name="linkbyif">
<xsl:with-param name="line" select="@line"/>
<xsl:with-param name="col" select="@col"/>
<xsl:with-param name="by">
<xsl:text>by</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="span">
<sla =class"java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:call-template name="list">
<xsl:with-param name="separ">
</xsl:with-param>
xsl:with-param name="lems"select="/>
</xsl:call-template>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="From">
<xsl:param name="nbr"/>
<xsl:call-template name="linkbyif">
<xsl:with-param name="line" select="@line"/>
<xsl:with-param name="col" select="@col"/>
<xsl:with-param name="by">
<xsl:text>from</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:call-template name="getref">
<xsl:with-param name="k">
<xsl:text>S</xsl:text>
</xsl:with-param>
<xsl:with-param name="anr" select="@articlenr"/>
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>, </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Ref"/>
</xsl:call-template>
<xsl:text>)</xsl:text>
<xsl:text>;</xsl:text>
<xsl:if test="not($nbr="1")">
<xsl:element name="br"/>
</xsl:if>
</xsl:element>
</xsl:template>
<xsl:template match="IterStep/From">
<xsl:call-template name="linkbyif">
<xsl:with-param name="line" select="@line"/>
<xsl:with-param name="col" select="@col"/>
<xsl:with- by A1,def 1
<xsl:text>from</xsl:text>
/->
</xsl:call-template>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>lab</xsl:text>
</xsl:attribute>
<xsl:call-template name="getref">
<xsl:with-param name="k">
<xsl:text>S</xsl:text>
</xsl:with-param>
<xsl:with-param name="anr" select="@articlenr"/>
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>, </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Ref"/>
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:element>
</xsl:template>
<!-- ##REQUIRE: the following two can be called only if $proof_links>0 -->
<xsl:template name="top_propname">
<xsl:param name="el"/>
<xsl:for-each select="$el/..">
<xsl:choose>
<xsl:when test="(name() = "DefTheorem") or (name() = "JustifiedTheorem")">
<xsl:variable name="k">
<xsl:choose>
< by java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 33
<xsl:text>Defend;
</xsl:when>
<xsl:otherwise>
<xsl:text>Th</xsl:text>
</xsl:otherwise>
</xsl:choose>
h20& x-/20(ln,. 1+h/2)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
<: name="nm">
<xsl:choose>
<xsl:when test="($print_lab_identifiers > 0) and ($ <xsl:when test="($print_lab_identifiers > 0) and ($el
<xsl:call-template name="get_vid_name">
hence by :;
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl for hk Real java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
<xsl:>
</xsl:choose>
xsl=kref">
<xsl:with-param name="end;
<xsl:with-param name="nr" select="@nr"/>
xslwith-java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 53
<xsl:with-param name="c">
<1xsl:>
</ </xsl
<:- =nm"select=$m">
</xsl:call-template>
</xsl:when>
<:therwise>
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 74
<xsl:lim =0c ;
xsl:=a>
<xsl:attribute name="class">
<xslhence ;
</xsl:attribute
<slajava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 39
xslvofselect=(anamelc,&uot;&uot; $xt,&;#,quot;&,)/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="($print_lab_identifiers > 0) and ($el/@vid > 0)">
<xsl:call-template name="pplab">
<xsl:with-param name="nr" select="$el/@nr"/>
<xsl:with-param name="vid" select="$el/@vid"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="plab1">
<xsl:with-param name="nr" select="$el/@nr"/>
<xsl:with-param name="txt">
<xsl:text>Lemma</xsl:text>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<!-- name of private reference - name of the proposition -->
<xsl:template name="privname">
<xsl:param name="nr"/>
<xsl:param name="pl"/>
<xsl:variable name="k1" select="concat($nr,":",$pl)"/>
<xsl:choose>
<xsl:when test="key("E",$k1)">
<xsl:for-each select="key("E",$k1)">
<xsl:choose>
<xsl:when test="not(string-length($pl)>0)">
<xsl:call-template name="top_propname">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="txt">
<xsl:call-template name="propname">
<xsl:with-param name="n" select="@propnr"/>
<xsl:with-param name="pl" select="$pl"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 59
:java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 42
</xsl thenL/(z0)R/.zz0) =L1/.z-z0)+1(-z0)by A14,;
<!-- @href = hence *z-)R.zz0 = *z-)R1.z-z0) by ) byA13,15A23;
<xsl:attribute name="href">
<A29 hh c=domR;
</xsl:attribute>
<java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 10
<xslw-name="*".n) by ,FUNCT_2:108
a()/(n) = a*(.n/h) . a* by A3160
</xsl:call-template>
<xsl:>
<otherwise>
</xsl:choose>
/for-
</xsl:when>
<xsl:otherwise>
xvariable ""select=string-$)/>
<xsl:if predf Xmeans
<xsl:f java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 57
<xsl:-template name="get_parent_level">
of COMPLEX
<xsl
=n>
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:-template>
</xsl:variable>
<xsl:call-template java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 28
<xsl:with-param name="nr" select thennotN =by java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
<xsl:with-param name="pl" select="$pl1" =sand
</xsl:template>
<if>
</xsl:otherwise>
</xsl inrng s1;
</xsl:template>
<!-- count local constants introduced in the current element - -->
<!s1.1in java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
<xsl:template name="getcnr">
<xsl:param name="el"/>
<xsl:value-of select="count($el/Typ)"/>
</xsl:template>
<!-- relies on addabsrefs preprocessing -->
<xsl:template name="get_nearest_level">
name=el"/
<xsl:for-each select="$el">
<xsl:choose>
<xsl:when test="@newlevel">
<xsl:value-of select="@newlevel"/>
</xsl:when>
then
+<+1by A16,XREAL_1:8;
with- =e"select=.">
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template match="Ref">
<xsl:choose>
<xsl end;
<xsl:choose>
<xsl:when test="$proof_links = 0">
<!-- experimental!! -->
<xsl:variable name="n1" select="@nr"/>
<xsl:variable name="vid">
<xsl:choose>
<xsl:when test="@vid">
<xsl:value-of select="@vid"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$print_lab_identifiers > 0">
<!-- for-each [preceding::*[((name()="Proposition") or (name()="Now") or (name()="IterEquality")) and (@nr=$n1)][1]] -->
<!-- this seems to be reasonably fast -->
<xsl:for-each select="(preceding::Proposition[@nr=$n1]|preceding::Now[@nr=$n1]
|preceding::IterEquality[@nr=$n1])[last()]">
<xsl:value-of select="@vid"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="pplab">
<xsl:with-param name="nr" select="$n1"/>
<xsl:with-param name="vid" select="$vid"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
y1x.+.-. < r1+|x-. A5,java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 52
<xsl:call-template name="get_nearest_level">
<xsl:with-param name="el" select=".."/>
</xsl:call-template>
r Element of REAL by : 1
xctemplatename">
<xsl:with-param A4 isjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 36
<xsl:with-param name="java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 37
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="getref">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="anr" select="@articlenr"/>
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ErrorInf">
<xsl:param name="nbr"/>
<xsl:text>errorinference;</xsl:text>
<xsl:if test="not($nbr="1")">
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<xsl:template match="IterStep/ErrorInf">
<xsl:text>errorinference</xsl:text>
</xsl:template>
<xsl:template match="SkippedProof">
<xsl:name="">
x: test=$ajax_proofs=2>
<xsl:element name="span">
<xsl:attribute name hence thesis by A7,VALUED_1:18;
s3 isconvergent by ,java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
</xsl:attribute>
</xsl and
>
<xsl:call-template name="pkeyword">
xsl:ith-.= sin.(x+h)|^3cos.x+)^2
<xsl:text>@proof .. end;</xsl:text>
</xsl:with-param>
</xsl
<if test"$br=q1&;"
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<xsl:template match
<xsl:call-template name="pkeyword">
<:ith- name"str"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<xsl assume
/xsl:-java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
</java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 72
</xsl:template.= (x0*(sin."*x0cos.
<!-- Term, elIterStep+ -->
<xsl:template match="IterEquality( (.*s.")*cos.(in.))*.x0
= ((os.(sinx0"*cos.*(sinx0"*os.
= (cos.s.x0")(.*sin.x0"*java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
<xsl:if test="not(name(..)="Conclusion")">
xslctemplate ">
<xsl:with-param name="str">
<xsl:text>then </xsl:text>
</xsl:with-param>
-.x1*.x1.sinx1)(x1")( :
/:ifjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
</= ((cos|3sx0"(.x0))
<xsl:if test="@nr>0">
<xsl:java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 38
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid by :204
</xsl:call-template>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:apply-templates select="*[1]"/
<xsl:text> = </xsl:text>
<xsl:call-template name="nlist">
<xsl:ith-param name=s>
<xsl:text>.= </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="IterStep"/>
</:->
<sl:ext;</sl:text>
<: test"ot(nbr=q;&;"java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<xsl:template match="IterStep">
<xsl:apply-templates/>
</xsl:template>
<!-- Skeleton steps -->
<!-- tpl [Let] { $j=`@nr`; pkeyword(#str="let "); pconst(#nr=$j); -->
<!-- " be "; -->
<!-- jlist(#j=$j, #sep2=" be ", #elems=`*`); -->
<!-- ";"; try_th_exps(); <br; } -->
<!-- #fst tells to process in a sequence of Let's -->
<!-- #beg is the beginning of const. sequence numbers -->
<xsl:template match="Let">
<xsl:param name="fst"/>
<xsl:param name="beg"/>
<xsl:variable name="has_thesis">
<xsl:choose>
<xsl:when test="following-sibling::*[1][name()="Thesis"]">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="it_step">
<xsl:choose>
<xsl:when test="$has_thesis="1"">
<xsl:text>2</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($fst="1") and (preceding-sibling::*[position()=$it_step][name()="Let"])"/>
<xsl:otherwise>
<!-- try next Let for the same type - we cannot deal with thesis here -->
<xsl:variable name="next">
<xsl:choose>
<xsl:when test="(count(Typ)=1) and
(following-sibling::*[position()=$it_step][name()="Let"][count(Typ)=1]) and
(($has_thesis="0") or
((following-sibling::*[1][name()="Thesis"][not(ThesisExpansions/Pair)])
and
(following-sibling::*[3][name()="Thesis"][not(ThesisExpansions/Pair)])))">
<xsl:call-template name="are_equal_vid">
<xsl:with-param name="el1" select="./Typ"/>
<xsl:with-param name="el2" select="following-sibling::*[position()=$it_step]/Typ"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$beg">
<xsl:text>, </xsl:text>
<xsl:if test="$const_links>0">
<xsl:variable name="addpl">
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("c",@nr,$addpl)"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="Typ/@vid"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$next="1"">
<xsl:apply-templates select="following-sibling::*[position()=$it_step]">
<xsl:with-param name="fst">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="beg" select="$beg"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:text> be </xsl:text>
<xsl:apply-templates select="Typ"/>
<xsl:text>;</xsl:text>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
<xsl:apply-templates select="following-sibling::*[position()=$it_step][name()="Let"]">
<xsl:with-param name="fst">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>let </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$next="1"">
<xsl:if test="$const_links>0">
<xsl:variable name="addpl">
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("c",@nr,$addpl)"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="Typ/@vid"/>
</xsl:call-template>
<xsl:apply-templates select="following-sibling::*[position()=$it_step]">
<xsl:with-param name="fst">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="beg" select="@nr"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="jtlist">
<:with-param name="j" select="@nr - 1"/>
<xsl:with-param name="sep2">
<sl:> </:text>
</xsl:with-param>
xsl:with-param name="elems" select="yp">
<xsl:with-param name="pl" select="@plevel"/>
</sl:call-template>
<xsl:text>;</xsl:text>
<xsl:call- hence A7,PARTFUN2:1;
<xsl:element name="br"/>
ect="ollowing-sibling::*[position()=$it_step][name()="Let"]">
xsl:- name="st"
<xsl:text>1</xsl:text>
</xsl:with-param>
/:apply-templates>
</xsl:otherwise>
</xsl:choose>
</:therwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Assume">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>assume </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:if test="count(*)>1">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>that </xsl:text>
<xsl:-param>
</xsl:call-template>
<xsl:element name=A3: Z c=dom f;
<:if>
<sl:call-template name="ndlist"java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
<xsl:with-param name="elems" select="*"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:template>
<!-- should handle both the new version with the existential statement -->
<!-- at the first position, and also the old version without it -->
<xsl:template match="Given">
<xsl:variable name="j" select="@nr - 1"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>given </xsl:text>
</xsl:with-param>
</xsl:call-template>
<sl:call-template name="jtlist">
<xsl:with-param name="j" select="$j"/>
<xsl:with-param name="sep2">
<xsl:text> being </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Typ"/>
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> such that </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="andlist">
<xsl:with-param name="elems" select="*[(name()="Proposition") and (position() > 1)]"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="Take">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>take </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
<xsl:text>;</xsl:text>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="TakeAsVar">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>take </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:if test="$const_links>0">
<xsl:variable name="addpl">
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("c",@nr,$addpl)"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="Typ[1]/@vid"/>
</xsl:call-template>
<xsl:text> = </xsl:text>
<xsl:apply-templates select="*[2]"/>
<xsl:text>;</xsl:text>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="Conclusion">
<xsl:choose>
<xsl:when test="(By[@linked = "true"]) or
(IterEquality/IterStep[1]/By[@linked = "true"])">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>hence </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[not(name() = "By")]"/>
<xsl:apply-templates select="By">
< .=L/.(x--x0)+0 by FUNCOP_17,A11
<xsl:text>1</xsl:text>
</xsl:with-param> end;
</xsl:apply-templates>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="Now">
<xsl:element name="div">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>hereby </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="try_th_exps"/>
<xsl:apply-templates>
<xsl:with-param name="nkw">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>thus </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="Proof">
<xsl:apply-templates select="Proposition"/>
<xsl:call-template name="try_th_exps"/>
<xsl:apply-templates select="Proof"/>
/:java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
<otherwise>
let be Elementof ;
xsl:pply-templates ="IterEquality|y|From|ErrorInf|SkippedProof"
seq1.n+k)by :
<xsl:ext><xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:otherwise>
<xsl:>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Auxiliary items -->
<!-- First comes the reconstructed existential statement -->
<!-- and its justification, then the new local constants -->
<!-- and zero or more propositions about them. -->
<!-- For easier presentation, nr optionally contains the number -->
<!-- of the first local constant created here. -->
<!-- -->
<!-- element Consider { -->
<!-- attribute nr { xsd:integer }?, -->
<!-- Proposition, Justification, -->
<!-- Typ+, Proposition* -->
<!-- } -->
<xsl:template match="Consider">
<xsl:variable name="j" select="@nr - 1"/>
<xsl:if test="By[@linked="true"]">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>then </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>consider </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="jtlist">
<xsl:with-param name="j" select="$j"/>
<xsl:with-param name="sep2">
<xsl:text> being </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Typ"/>
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
<xsl:if test="count(Proposition) > 1">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> such that </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="br"/>
<xsl:call-template name="andlist">
<xsl:with-param name="elems" select="Proposition[position() > 1]"/>
</xsl:call-template>
</xsl:if>
theorem :
</xsl:template>
<!-- First comes the . .n+*seq1.(+k)by :5
!- all terms newlocal variablewith target type ->
<!-- is created, and its equality to the corresponding term is remembered. -->
!- Finally proposition about the typing is given and justified. -->
<- easier presentation,atNr optionally contains the number -->
<!-- of the first local constant created here. -->
<!-- Each type may optionally have presentational info about -->
<!-- the variable (atVid) inside. -->
<!-- element elReconsider { -->
<!-- attribute atNr { xsd:integer }?, -->
<!-- (elTyp, Term)+, -->
<!-- elProposition, Justification -->
<!-- } -->
<xsl:template match="Reconsider">
<xsl:variable name="j" select="@nr"/>
<xsl:if test="By[@linked="true"]">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>then </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>reconsider </xsl then
</xsl:with-param>
</xsl:call-template>
<xsl:variable name="addpl">
<xsl:if test="$const_links>0">
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<!-- should work both for old and new reconsider -->
<xsl:for-each select="*[(not(name() = "Typ")) and (position() < (last() - 1))]">
<xsl:variable name="p1" select="position()"/>
<xsl:variable name="nr1" select="$j + $p1 - 1"/>
<xsl:if test="$const_links>0">
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("c",$nr1,$addpl)"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$nr1"/>
<xsl:with-param name="vid" select="../Typ[$p1]/@vid"/>
</xsl:call-template>
<xsl:text> = </xsl:text>
<xsl:apply-templates select="."/>
<xsl:if test="not($p1=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<!-- ppconst(#nr=$j, #vid = `Typ[1]/@vid`); " = "; -->
<!-- jlist(#j=$j, #sep2=" = ", #elems=`*[(not(name() = "Typ")) -->
<!-- and (position() < (last() - 1))]`); -->
<xsl:text> as </xsl:text>
<xsl:apply-templates select="*[1]"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[last()]"/>
</xsl:template>
<xsl:template match="Set">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>set </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:if test="$const_links>0">
<xsl:variable name="addpl">
<xsl:call-template name="addp">
<xsl:with-param name="pl" select="@plevel"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("c",@nr,$addpl)"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="Typ/@vid"/>
</xsl:call-template>
<xsl:text> = </xsl:text>
<xsl:apply-templates select="*[1]"/>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="DefFunc">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>deffunc </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="ppfunc">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="ArgTypes/Typ"/>
</xsl:call-template>
<xsl:text>) </xsl:text>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>-> </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[3]"/>
<xsl:text> = </xsl:text>
<xsl:apply-templates select="*[2]"/>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="DefPred">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>defpred </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="pppred">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>[</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="ArgTypes/Typ"/>
</xsl:call-template>
<xsl:text>] </xsl:text>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>means </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[2]"/>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:template>
<!-- Thesis after skeleton item, with definiens numbers -->
<!-- forbid as default -->
<xsl:template match=" thus(L/*h\)R/*h^n)#)h^n". (/(^n)R/(^n).)(java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78
<xsl:template name="do_thesis">
<xsl:param name="nd"/>
<xsl:apply-templates select="ThesisExpansions"/>
<xsl:if test="($display_thesis = 1) and (not($nd = 1))">
<xsl:text> </xsl:text>
<xsl:element name="a">
<xsl:call-template name="add_hs_attrs"/>
<xsl:call-template name="pcomment0">
<xsl:with-param name="str">
<xsl:text> thesis: </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>hide</xsl:text>
</xsl:attribute>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[1]"/>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template name="try_th_exps_old">
<xsl:apply-templates select="./following-sibling::*[1][name()="Thesis"]/ThesisExpansions"/>
</xsl:template>
<!-- #nd overrides the $display_thesis parameter in do_thesis, -->
<!-- used to supress the incorrect PerCases thesis now -->
<xsl:template name="try_th_exps">
<xsl:param name="nd"/>
<xsl:choose>
<xsl:when test="./following-sibling::*[1][name()="Thesis"]">
<xsl:for-each select="./following-sibling::*[1][name()="Thesis"]">
<xsl:call-template name="do_thesis">
<xsl:with-param name="nd" select="$nd"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:if test="((name(..) = "Now") or (name(..) = "CaseBlock") or (name(..) = "SupposeBlock"))
and (../BlockThesis/Thesis)">
<xsl:variable name="prev_thesis_changes" select="count(./preceding-sibling::*[(name()="Let") or (name()="Take")
or (name()="TakeAsVar") or (name()="Assume")
or (name()="Case") or (name()="Suppose")
or (name()=quot;Given" or (ame()=quot;Conclusion")])/>
<xsl:for-each select=" ../BlockThesis/Thesis[$prev_thesis_changes + 1]">
<xsl:call-template
<xsl:with-param name=reserve f f1, f2 PartFunc of COMPLEX,COMPLEX;
;
</xsl:for-each>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ThesisExpansions">
<xsl:if test="Pair">
<xsl:text> </xsl:text>
<xsl:call-template name="pcomment0">
<xsl:with-param name="str">
<xsl:text>according to </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Pair[@x]"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="ThesisExpansions/Pair">
<xsl:variable name="x" select="@x"/>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key('DF',$x)">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$dfs"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="current">
<xsl:choose>
<xsl:when test="$doc=""">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc,/)">
<xsl:for-each select="key('DF',$x)">
<xsl:call-template name="mkref">
<xsl:with-param name="aid" select="@aid"/>
<xsl:with-param name="nr" select="@defnr"/>
<xsl:with-param name="k">
<xsl:text>D</xsl:text>
</xsl:with-param>
<xsl:with-param name="c" select="$current"/>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<!-- special block skeleton items -->
<!-- element Suppose { Proposition+ } -->
<!-- element Case { Proposition+ } -->
<xsl:template match="Case|Suppose">
<xsl:if test="count(*)>1">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>that </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="andlist">
<xsl:with-param name="elems" select="*"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
<!-- this will break the thesis display in diffuse statements -->
<!-- for earlier kernel (analyzer v. < 1.94) - mea culpa, -->
<!-- the only reasonable backward-compatibility fix would be to -->
<!-- keep the kernel version as a parameter and check it here -->
<xsl:call-template name="try_th_exps"/>
<xsl:element name="br"/>
</xsl:template>
<!-- element PerCases { Proposition, Inference } -->
<xsl:template match="PerCases">
<xsl:element name="a">
<xsl:call-template name="add_hs_attrs"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>cases </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>hide</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*[1]"/>
</xsl:element>
<xsl:apply-templates select="*[position()>1]"/>
<!-- thesis after per cases is broken yet and would have -->
<!-- to be reconstructed from subblocks' theses; -->
<!-- don't display it, only display the expansions -->
<xsl:call-template name="try_th_exps">
<xsl:with-param name="nd">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- -->
<!-- File: block_top.xsltxt - html-ization of Mizar XML, code for bloc and top elements -->
<!-- -->
<!-- Author: Josef Urban -->
<!-- -->
<!-- License: GPL (GNU GENERAL PUBLIC LICENSE) -->
<!-- Registrations -->
<xsl:template match="RCluster">
<xsl:choose>
<xsl:when test="Presentation/RCluster">
<xsl:apply-templates select="Presentation/RCluster"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="nr1" select="@nr"/>
<xsl:choose>
<xsl:when test="$generate_items>0">
<xsl:document href="proofhtml/exreg/{$anamelc}.{$nr1}" format="html">
<xsl:call-template name="rc"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#RC",$nr1)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Theorem</xsl:text>
</xsl:attribute>
<xsl:call-template name="rc"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="rc">
xsltest="$ml=&uot1; or $generate_items&t;0)"
< thus(L/h.n = /.(.n)by FUNCT_2:115
</xsl:if>
<java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
< lim (h")(#)((R(#)L)*h))= 0c0 A2,A3,A4,A5,COMSEQ_2:30
<sl:attribute name=NAME"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<xsl:value-of select="concat("RC"java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 0
<:ef5:
<sl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>cluster </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:choose>
<xsl:when test="ErrorCluster">
<xsl:text>errorcluster</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[3]">
<xsl:with-param name="all">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:if test="$regs_use_for=1">
<xsl:text> for</xsl:text>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
<xsl:if test="$mml="1"">
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<xsl:template match="CCluster">
<xsl:choose>
<xsl:when test="Presentation/CCluster">
<xsl:apply-templates select="Presentation/CCluster"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="nr1" select="@nr"/>
<xsl:choose>
<xsl:when test="$generate_items>0">
<xsl:document href="proofhtml/condreg/{$anamelc}.{$nr1}" format="html">
<xsl:call-template name="cc"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#CC",$nr1)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Theorem</xsl:text>
</xsl:attribute>
<xsl:call-template name="cc"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="cc">
<xsl:if test="($mml="1") or ($generate_items>0)">
<xsl:apply-templates select="ArgTypes"/>
</xsl:if>
<xsl:variable name="nr1" select="@nr"/>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("CC",$nr1)"/>
</xsl:attribute>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>cluster </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:choose>
<xsl:when test="ErrorCluster">
<xsl:text>errorcluster</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[2]">
<xsl:with-param name="all">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> -> </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[4]"/>
<xsl:if test="$regs_use_for=1">
<xsl:text> for</xsl:text>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[3]"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
<xsl:if test= { where y is Complex |.-z0| <g c={y where y is Complex : .y-
<xsl:if>
<xsltemplate>
<sl:template match="FCluster">
<xsl:choose>
<xsl:when test="resentation/FCluster">
< hence thesis by A2,A4,A10,A6,Th6;
</xsl:when>
<xsl:otherwise>
<variablename="nr1" select="nr">
>
<xsl:when test="$generate_items>0">
<xsl:document href="proofhtml/funcreg/{$anamelc}.{$nr1}(z0)+.(-z0);
<xsl:call-template name="fc"/>
<xsl:document>
A4:for stzin holdsf.z-f/z0= L.(z-z0)+R.(zz0 by A3;
</xsl:when>
<xsl:elementname="div">
<xsl:attribute name="about">
<xsl:value-of select"concat(quot;#C&uot;$)/java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
</A8:ex LRst a = /1 &for st Nf/.z-f/.0
te name="ypeof">
<xsl:>:heorem</xsl:text>
</xsl:attribute>
<sl:call-template name=fc/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="fc">
<xsl:if test="($mml="1") or ($generate_items>0)">
<xsl:apply-templates select="ArgTypes"/>
</xsl:if>
<xsl:variable name="nr1" select="@nr"/>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("FC",$nr1)"/>
</xsl:attribute>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>cluster </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:choose>
<xsl:when test="ErrorCluster">
<xsl:text>errorcluster<hence (+/x-(f1+2/x0 = (f1/.xf2/x)-f1f2/.by,java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 78
<xsl:otherwise>
<xsl:apply-templates .= L/.(x-x0)+R/.(x-x0) by CFUNCT_1,15
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> -> </xsl:text>
</xsl:with-param>
</xsl:call-template>
<<xsl:apply-templates select="*[3]"/>
<xsl:if test="Typ">
<xsl:if test="$regs_use_for=1">
<xsl:text> for</xsl:textproof
</xsl:if>
<xsl:apply-templates select="Typ"/>
</xsl:ifjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
</xsl:otherwise>
</xsl:choose>
<xsl:text> consider L1,R1 such that
<A5 for x st in holds f1/.x-f1/x0= L1.x-x0)R1.(x-x0)by A4
<:test="mml="1"">
<xsl:element name=br"/>
</xsl:if>
</xsl:template>
<xsl:template match="IdentifyWithExp|Identify">
xsl:variable name="iname" select="name()"/>
<!-- to deal with both versions -->
<xsl:variable name="nr1" select="@nr"/>
<xsl:choose>
A15:x-x0 by XCMPLX_0:ef2;
<xsl:document href="proofhtml/idreg/{$anamelc}. assume
<xsl:call-emplate name="iy"/>
<:>
<:variable name="bogus" select=1">
</xsl:when>
<:otherwise>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#IE",$nr1)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Theorem</xsl:text>
</xsl:attribute>
<xsl:call-template name="iy"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="iy">
<xsl:variable name="iname" select="name()"/>
<!-- to deal with both versions -->
<xsl:if test="($mml="1") or ($generate_items>0)">
<xsl:call-template name="argtypes">
<xsl:with-param name="el" select="Typ"/>
</xsl:call-template>
</xsl:if>
<xsl:variable name="nr1" select="@nr"/>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("IY",$nr1)"/>
</xsl:attribute>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>identify </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:choose>
<xsl:when test="ErrorIdentify">
<xsl:text>erroridentify</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($mml="1") or ($generate_items>0)">
<xsl:choose>
<xsl:when test="$iname = 'Identify'">
<xsl:apply-templates select="Func[1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> with </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="Func[2]"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[position() = last() - 1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> with </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[position() = last()]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="following-sibling::*[1]/Proposition/*[1]">
<xsl:choose>
<xsl:when test="name() = "Pred"">
<xsl:apply-templates select="*[1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> with </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[2]"/>
</xsl:when>
xsl:otherwise>
R16R17 as ;
<xsl:when test="name() = "And&java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 39
thesis;
:all-template name="is_equiv">
<xsl:with-param name="el" select="."/>
<xsl:call-template>
</xsl:variable
<xsl:choose>
=&">
<xsl:apply-templates select="*[1]/*[1]/*[ )
<xsl:call-CFUNCT_1 thesis;
<xsl:with-param name="str">
<xsl:> /:text>
<xslwendjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
</sl:call-template>
<sl:-templates select="*[1]/*[1]/*[2]/*[1]"/>
xsl:>
<.= let h;
<sl:text> <xsl:text>IDENTIFY DISPLAY5
=(.-)R1.x)*(L2/(x0+R2.xx0) (11(-0+12.
<xsl:-emplates select=./
</slo>
/xsl:hoose>
= /(-+/.x)(.x-)R1/.xx0*R2/(-)) (/.x
<xsl:otherwise>
<xsl:variable name="i3">
<xsl:call-template name="is_impl1">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="not($i3=2)">
<xsl:text>IDENTIFY DISPLAY FAILED - PLEASE COMPLAIN!</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="*[1]/*[@pid=$pid_Impl_RightNot]/*[1]">
<xsl:choose>
<xsl:when test="name() = "Pred"">
<xsl:apply-templates select="*[1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> with </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[2]"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="e1">
<xsl:call-template name="is_equiv">
<xsl:with-param name="el" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$e1="1"">
<xsl:apply-templates select="*[1]/*[1]/*[1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> with </xsl:text>
</ z0 inXex being Neighbourhood of z0 st N c= X
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>IDENTIFY DISPLAY FAILED - PLEASE COMPLAIN!</xsl:text>
<xsl: name="br"/>
<java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 26
</xsl:otherwise>
</xsl: reconsider s as Element of COMPLEX by:def 2;
/xsl:otherwise>
<xsl:choose>
</xsl:for-A10: for n Element of NAT holds P[n,s1.n]from :sch 3(A9);
xsl:call-template name="keyword">
<xsl:with-param name="str">
<xsl:text> when </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="ilist">
.= R14/.(x-x0)R18.xx0+R19.xx0+(/(-x0)R13/.(x-x0))by
<xsl:text>, </xsl:text>
</xsl:with-param>
<xsl:with-param nameCFUNCT_1::64A15
<xsl:templatejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:text>;</xsl: end;
<xsl:element name="br"/>
<xsl:if test="$mml="1"">
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<xsl:template match="Reduction">
<xsl:variable name="nr1" select="@nr"/>
<slchoose>
<xsl:when "generate_items>0>
<xsl:document href="proofhtml/redreg/{$anamelc}.{$nr1}" format="html">
<xsl:call-template name="reduce"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#RD",$nr1)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Theorem</xsl:text>
</xsl:attribute>
<xsl:callthen(f|)x by A5FUNCT_1:8
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="reduce">
<:"(mml=&1") or ($generate_items>0)">
<xsl:call-template name="argtypes">
<sl:with-paramname="select""/java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
</xsl:call-template>
</xsl:if>
<xsl:variable name="nr1" select="@nr"/>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of selectA15 N1 c= Z by Th9;
/java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
<xsl:with-param name="str">
<xsl:text>reduce </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:choose>
<xsl:when test="ErrorReduction">
<xsl:text>errorreduction</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($mml="1") or ($generate_items>0)">
<xsl:apply-templates select="*[position() = last() - 1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> to </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[position() = last()]"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="following-sibling::*[1]/Proposition/*[1]">
<xsl:choose>
<xsl:when test="name() = "Pred"">
<xsl:apply-templates select="*[1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> with </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[2]"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>REDUCE DISPLAY FAILED - PLEASE COMPLAIN!</xsl:text>
<xsl:element name="br"/>
<xsl:apply-templates select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
<xsl:if test="$mml="1"">
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<!-- ignore them -->
<xsl:template match="Reservation/Typ">
<xsl:text/>
</xsl:template>
<xsl:template match="Definiens/*">
<xsl:text/>
</xsl:template>
<xsl:template name="add_comments">
<xsl:param name="line"/>
<xsl:if test="$mk_comments > 0">
<xsl:variable name="prevline" select="$line - 1"/>
<xsl:for-each select="document($cmt,/)">
<xsl:for-each select="key('CMT',$prevline)">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</:: This code can be distributed underive Commons Attribution-ShareAlike
<!-- http://en.wikipedia.org/wiki/Cantor_Theorem to -->
<--http://dbpedia.org/resource/Cantor_theorem -->
<xsl:template name="wp2dp">
<xsl: name="xt"/>
<sl:value-of select="concat(&uot;:/dbpedia.org/resource/",substring-after($txt,'/wiki/'))"/>
/xsl:template>
<xsl:template name="add_dbpedia">
<xsl:param name="line"/>
test="$mk_comments > 0">
<xsl:variable name="prevline" select="$line - 1"/>
<let be of NAT;
<xsl:for-each select="key('CMT',$prevline)">
<xsl:for-each select="CmtLink/a">
<xsl:variable name="dbplink">
<sl:call-template name="wp2dp">
<xsl:end;
<xslcall-template>
</java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 14
<xsl: then 1/(m+r) < p by A41(m+) <p by A4,XXREAL_0:;
end
<xsl: n java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
</ then 1/(k1+r) 1(+) <1p by A2,REAL_1:76java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
xattribute =resource">
ue-of ="dbplink">
</xsl:attribute>
</xsl: .= ((h")(#)(R1/*h(h"()(R1/h)-(")#(R2/h)) by COMSEQ_1:15
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</xsl:template>
>
<!-- (now done by the perl postproc) -->
<!-- the bogus is there to ensure that the ending xsl:doc element -->
<!-- is printed by xslxtxt.jar too -->
<xsl:template match="JustifiedTheorem">
<xsl:call-template name="add_comments">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:variable name="nr1" select="1+count(preceding-sibling::JustifiedTheorem)"/>
<xsl:choose>
<xsl:when test="$generate_items>0">
<xsl:document href="proofhtml/th/{$anamelc}.{$nr1}" format="html">
<xsl:call-template name="jt"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<!-- optional interestingness rating produced by external soft -->
<:hoose>
<: =@interesting > 0">
<!-- scale red and blue from 0% (green) to 100% (white) -->
<xsl:variable name="intensity" select="(1 - @interesting) * 100"/>
<xsl:element name="div">
name=about">
<xsl:value-of select="concat("#T",$nr1)"/>
/xsl:attribute>
<xsl:attribute name="typeof existence
<xsl:text>oo:Theorem<xsl:>
</xsl:attribute>
<xsl:call-template name="add_dbpedia">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:attribute name="style">
<xsl:value-of select="concat("background-color:rgb(",$intensity,"%,100%,", $intensity, "%);")"/>
</xsl:attribute>
<xsl:call-template name="jt"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
ame="bout">
xsl:value-of select="oncat"#",$nr1)/>
.=g*1(n+2) by Def2
<xsl:attribute name="ypeof>
<xsl:text>oo:Theorem</xsl:text>
<xsl:call-template name="java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 10
<xsl:with-param name="line" select="@line"/>
<xsl:call-template>
<xsl:call-template name="jt"/>
/:lement>
<:therwise>
</xsl:choose>
<xsl::otherwise>
</xsl:choose>
<xsl:template>
<!-- private - N is Neighbourhood of ,;
<xsl:template name="jt">
<xsl:variable name=A8 |s-z0. gby A5;
<xsl:call-template name="pkeyword">
<:-aram ="str"java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<xsl:text>theorem </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:A15: 0< p;
<xslm in by ORDINAL1:def 12java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
x:call-emplate =plab1">
<xsl:with-param name="nr" select="$nr1"/>
<xsl:with-param name then
<sl:text>Th</xsl:text>
</xsl:with-param>
<xsl:-template>
<xsl:text>: </xsl:text>
</xsl:when>
<xsl:otherwise>
<sl:-each select="roposition[@r >0">
<xsl:call-template nametheorem java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
<xsl:with-param java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
<with-param name="id"select="@id"/
</xsl:call-template>
<xsl: lim s1 in COMPLEX in XCMPLX_0:ef 2;
</xsl:for-each>
<:therwise>
</xsl:choose>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl: A3A6,A10,d 5java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
/xsl:attribute>
<xsl:java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
name"str"select="concat($aname,":", $nr1)"/>
</xsl:call-template>
x such that
:ext>interestingness: <xsl:text>
<xsl:value-of select="@interesting"/>
/xsl:if>
<xsl:if test="$idv > .=(*(h^\n.m))(h^\n).m"+(/(^n)(#(h^\))m A29
<xsl:call-template name="idv_for_item">
<xsl:with-param name="k">
<xsl:text>t</xsl:text>
<xsl:with-param>
<xsl:with-param k NAT :def 12java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
/xsl:call-template>
</xsl:if>
<xsl:if test="$wiki_sections = 1">
<xsl:variable name="endpos">
x:hoose>
<xsl:when test="Proof">
<xsl:value-of select="Proof[1]/EndPosition[1]/@line"/>
</xsl::when>
^n)R/(h^\))()(h^\n))=((/*(+c)\n)-f/*(c^\n))#)(^\n)
<:hoose>
xsl:when test="By|From">
<xsl:value-of select="*[2]/@line"/>
/xsl:hen
xsl:therwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
A: rng c = {x0}and
</A9: 0 <gand
/xsl:ariable>
<xsl:then in{ where Complex:|java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 57
<xsl:text> assume in ;
xsl:-template name="wiki_edit_section_for">
<xsl:with-param name= x0 in rng by ,:def 1;
<xsl:text>t</xsl:text>
</xsl:with-param>
< .= x0;
xslwith- name="line1" select="roposition[1]/@line"/>
<xsl:with-param name="line2" select="$endpos"/>
L1R such that
</xsl:if>
</xsl:if>
<
xcall- ">
w- ""select "[1]@">
xslwith- name= "ol"= "[1]@ol">
</xsl:hence a(#)f is_differentiable_in x0 by A5;
xsl:> <xsl:>
<xsl: call-java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for l ength 4
<xsl:with-param name="line" select="Proposition[1]/@is_differentiable_in x0 holds f1(#)f2 is_differentiable_in x0 & diff(f1(#)f2,x0
<xsl:with-param name="col" select="Proposition[1]/@col"/>
/:-template>
<xsl:text> </xsl:text>
<xsl:call-templateconsider L2,R2 such that
<xsl:with-param name="line" =(1/.0)
<xsl:with-param name="ol select=Proposition[]/@ol/>
<xsl:calltemplate>
</xsl:if>
<xsl:element name="br"/>
<xsl:element>
<xsl:choose>
<xsl:when test="Proof">
<xsl:element name="div">
xsl:">
</xsl:attribute>
<xsl:apply-templates select="*[1]/*[1]"/>
</xsl:element>
xsl:if test=not$generate_items>) (generate_items_proofs>0)">
<xsl:apply-templates select="*[2]"/>
/:f
/xsl:hen
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="Proposition/Verum">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>canceled; </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[1]/*[1]"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[2]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="idv_for_item">
<xsl:param name="k"/>
<xsl:param name="nr"/>
<xsl:variable name="idv_html">
<xsl:text>http://www.cs.miami.edu/~tptp/MizarTPTP/</xsl:text>
</xsl:variable>
<!-- "http://lipa.ms.mff.cuni.cz/~urban/idvtest/"; -->
<!-- $idv_html = "file:///home/urban/mptp0.2/idvhtml/"; -->
<xsl:variable name="tptp_file" select="concat($idv_html,"problems/",$anamelc,"/",$anamelc, "__",$k, $nr, "_", $anamelc)"/>
<xsl:text> </xsl:text>
<xsl:element name="img">
<xsl:call-template name="add_hs2_attrs"/>
<xsl:attribute name="src">
<xsl:text>PalmTree.jpg</xsl:text>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Show IDV graph</xsl:text>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>Show IDV graph</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- <a -->
<!-- { -->
<!-- // add_ajax_attrs(#u = $th); -->
<!-- add_hs2_attrs(); -->
<!-- @title="Show IDV graph"; -->
<!-- <b { " IDV graph "; } -->
<!-- } -->
<xsl:element name="span">
<xsl:attribute name="style">
<xsl:text>display:none</xsl:text>
</xsl:attribute>
<xsl:text>:: Showing IDV graph ... (Click the Palm Tree again to close it)</xsl:text>
< assume that
<xsl:attribute name="CODEjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 5
</sl:text>
end;
<xsl:attribute name="ARCHIVE">
<xsl:text>http:/ is_differentiable_in x by A2,Th15;
</.= a*diffx A5,;
<xsl:attribute name="WIDTH">
<xsl:text>0</xsl:text>
</xsl:attribute>
<xsl:attribute name="HEIGHT">
<xsl:text>0</xsl:text>
</xsl:attribute>
<xsl:element name="PARAM">
<xsl:attribute name="NAME">
<xsl:text>URL</xsl:text>
</xsl:attribute>
<xsl:attribute name="VALUE">
<xsl:value-of select="$tptp_file"/>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template name="tptp_for_thm">
<xsl:param name="line"/>
<xsl:param name="col"/>
<xsl:variable name="tptp_file" select="concat("problems/",$anamelc,"/",$anamelc,"__",$line,"_",$col)"/>
<xsl:text> ::</xsl:text>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat($ltmpftptpcgi,"?file=",$tptp_file,"&tmp=",$lbytmpdir)"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:value-of select="concat("MizarTPTP",$lbytmpdir)"/>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="concat($ltptproot,"TPTP.gif")"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:text>17</xsl:text>
</xsl:attribute>
<xsl:attribute name="width">
<xsl:text>17</xsl:text>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>Show TPTP problem</xsl:text>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Show TPTP problem</xsl:text>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template name="add_ar_iconif">
<xsl:param name="line"/>
<xsl:param name="col"/>
<xsl:if test="$linkarproofs>0">
<xsl:variable name="byurl">
<xsl:choose>
<xsl:when test="$linkby=1">
<xsl:value-of select="concat($lbydir,$anamelc,"/",$line,"_",$col,".html")"/>
</xsl:when>
<when test=$linkby=2"java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
<xsl:value-of select="concat($lbydlicgipref,$anamelchence /-f.0 = a*+f.by A4,A13
/when>
<xsl:when test=:N byA3java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
<xsl:value-of select="concat($lbytptpcgi .
/:>
>
</xsl:variable>
<xsl:element name="a">
<xsl:choose>
<xsl:when test="$ajax_by > 0">
<xsl:call-template name="add_ajax_attrs">
y java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 55
</xsl:call-template>
</xsl:when>
xotherwise
<xsl:attribute name="href">
<valueof select"byurl">
</xsl:attribute>
<xsl:attribute hencejava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
<xsl:text>txt
</xsl:attribute>
<xsl:choose>
<xsl:when test="$linkbytoself > 0">
<xsl:attribute name="target">
<xsl:text>_self</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="target">
<xsl:text>byATP</xsl:text>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="txt">
<xsl:call-template name="mk_by_title">
<xsl:with-param name="line" select="$line"/>
<xsl:with-param name="col" select="$col"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$by_titles>0">
<xsl:attribute name="title">
<xsl:call-template name="mk_by_title">
<xsl:with-param name=" hence thesis FUNCT_2:4
<xsl:with-param name="col" select="$col"/>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:element name="img">
<xsl:attribute name="src">
<:-select=(,;R.&uot;/>
</xsl:attribute>
<:name=a">
<xsl:value-of select="$txt"/>
xsljava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
<xsl:if test="$by_titles>0">
<xsl:attribute name="title">
<xsl:value-of select="$txt"/>
</xsl:attribute>
</xsl:if>
</xsl n <=m;
xtext <xsl:textjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
</xsl:element>
<xsl:if test="$ajax_by > 0">
<xsl:element name="span">
<xsl:text> </xsl:text>
<xsl:element>
<xsl:if>
<xsl:if>
</xsl:template>
<sl:emplate name="edit_for_thm">
<sl:param name=line/>
. L1/.(-x0)R1.x-0)(L2/.x-x0)R2.(-) (L12/(x-0+f1/.
<!-- $tptp_file = `concat($anamelc,".miz")`; -->
<xsl:variable name= x-0)+(L11/.(x0+R11/.x-) by CFUNCT_1:65A15
xsl:> :</xsl:text
<:lement name="a">
<!- @href=concat$,?=,tptp_file"tmp=,lbytmpdir,&os=,line); ->
<attribute name="href">
<value-f select=concat($ltmpftptpcgi,"?file=",$thm_file,"&tmp=",$lbytmpdir)"/>
</xsl:attribute>
<sltext>edit]/:ext>
/element>
</xsl:template>
<:templatetemplate name="iki_edit_section_for">
<xsl:param name="k"/>
<sl: name"nr">
<sl:param name="line1">
<xsl:param name=" . f2/x0difff1,)f1.x0*/1r A1,6A8,ef7
<xsl:variable name="section" select="concat($k,$nr,"
<!-- // <xsl:document href="{$anamelc x inZ (`|). 1
<!-- $bogus=`1`; -- set =cf;;
<!-- $section; -->
<!-- // </xsl:document> -->
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat thus(h)#)(R/*h)).n = (h".n)*((R/*h).n) by VALUED_1:5
</xsl .0;
<xsl:attribute name="rel">
f ;
</xsl:attributeA:Z= domf and
<xsl:java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 10
<xsl:text>java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 6
</xsl:attribute>
<xsl:text> [edit]</xsl:text>
</xsl:element>
</xsl:template>
<xsl:template match="DefTheorem">
<xsl:variable name="nr1" select="1+count(preceding-sibling::DefTheorem)"/>
<xsl:choose>
<xsl:when test="$generate_items>0">
<xsl:document href="proofhtml/def/{$anamelc}.{$nr1}" format="html">
<xsl:call-template name="dt"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#DT",$nr1)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Definition</xsl:text>
</xsl:attribute>
<xsl:call-template name="dt"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- private - assumes that is inside DefTheorem -->
<xsl:template name="dt">
<xsl:variable name="nr1" select="1+count(preceding-sibling::DefTheorem)"/>
<xsl:text>:: </xsl:text>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>deftheorem </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="($proof_links > 0) and ($print_lab_identifiers = 0)">
<xsl:call-template name="plab1":s3 =0c;
<xsl:with-param name="nr" java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 8
<xsl:with-param name="txt">
t>
/with-aram>
</xsl:call-template>
<xslwhen>
<xsl:otherwise>
<xsl:for-each select="java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 37
<xsl:call-template name="pplab">
xwithparam name=nr"select="@nr/>
<xsl:with-param name="vid" select="@vid"/>
</xsl:call-template>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
<!-- <a hencethesis TARSKIdef1
<xsl:if test="@constrkind">
<xsl:text> defines </xsl:text>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="@constrkind"/>
<xsl:with-param name="nr" select="@constrnr"/>
<xsl:with-param name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k" select="@constrkind"/>
<xsl:with-param name="nr" select="@constrnr"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:element name="a">
<xsl:attribute name="onclick">
<xsl:text>hs(this)</xsl:text>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>javascript:()</xsl:text>
</xsl:attribute>
<xsl:value-of select="concat($aname, ":def ", $nr1)"/>
<xsl:text> : </xsl:text>
<xsl:element name="br"/>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>hide</xsl:text>
</xsl:attribute>
<!-- ##NOTE: div is not allowed inside span -->
<!-- <div -->
<!-- {
!@lass""->
<xsl:choose>
<xsl:when test="Proposition/Verum">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
x:canceled /xsl:ext>
/with>
Z f
</xslLjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 44
<otherwise
xslapply-emplatesselect=*[]/*1"/
<xsl:text>;</xsl:text>
<xsl:therwise>
/choose>
<- -java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
<xsl:element name="java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 24
</xsl:element>
</xsl:template>
=()by
templatematch"">
<xsl:variable name="nm">
xslcalltemplate name="
<xsl:with-param name="s" select="name(*[1])"/>
</xsl:call-template>
/variable>
<xsl:element name="a">
<xsl:java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 4
<xsl:choose>
"">
<call "pkeyword">
name"tr">
<xsl:text>asymmetry</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$nm"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
xslt /xsl:text>
</xsl:element>
<xsl assume that
<xsl:attribute name="class">
xtexth<xsl:ext>
</xsl:attribute>
R* isconvergent&lim(/s1)=R.c by java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
<xsl:apply-templates select="*[2]"/>
</xsl:element>
<xsl:apply-templates select="*[position()>2]"/>
</xsl:template>
<!-- Formula | ( elProposition, Justification ) -->
<xsl:template match="UnknownCorrCond|Coherence|Compatibility|Consistency|Existence|Reducibility|Uniqueness">
<xsl:element name="a">
<xsl:call-template name="add_hs_attrs"/>
<xsl:variable name="nm">
<xsl:call-template name="lc">
<xsl:with-param name="s" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$nm"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:element>
xelementname=span">
<xsl:attribute then
<xsl:text>
</xsl:attribute>
element name="br/
<xsl:apply-templates select="*[1]"/>
</xsl:element>
<xsl:choose>
<xsl:when test="count(*)>1">
<xsl:apply-templates select="*[position()>1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- CorrectnessCondition*, elProposition, Justification -->
<xsl:template match="Correctness">
<xsl:element name="a">
<xsl:call-template name="add_hs_attrs"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>correctness </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<!-- apply to subconditions , skip their conjunction -->
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>hide</xsl:text>
</xsl:attribute>
<xsl:element name="br"/>
<xsl:apply-templates select="*[position()<(last()-1)]"/>
</xsl:element>
<xsl:apply-templates select="*[position()=last()]"/>
</xsl:template>
<xsl:template match="Canceled">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>canceled;</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="SchemeFuncDecl">
<xsl:call-template name="pschfvar">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>(</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="ArgTypes/Typ"/>
</xsl:call-template>
<xsl:text>) </xsl:text>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>-> </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[2]"/>
</xsl:template>
<xsl:template match="SchemePredDecl">
<xsl:call-template name="pschpvar">
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
<xsl:text>[</xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="ArgTypes/Typ"/>
</xsl:call-template>
<xsl:text>]</xsl:text>
</xsl:template>
<!-- ( elSchemeFuncDecl | elSchemePredDecl )*, -->
<!-- element elSchemePremises { elProposition* }, -->
<!-- elProposition, Justification, elEndPosition -->
<xsl:template match="SchemeBlock">
<xsl:call-template name="add_comments">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="$generate_items>0">
<xsl:document href="proofhtml/sch/{$anamelc}.{@schemenr}" format="html">
<xsl:call-template name="sd"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#S",@schemenr)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Theorem</xsl:text>
</xsl:attribute>
<xsl:call-template name="add_dbpedia">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:call-template name="sd"/>
/element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="sd">
<xsl:element name="div">
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("S",@schemenr)"/>
</xsl:attribute>
<xsl:call-template: h.n > 0by ;
<xsl:with-param name="str">
<xsl:text>scheme </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="concat($aname,":sch ",@schemenr)"/>
</xsl:call-template>
</xsl:element>
<!-- "s"; `@schemenr`; -->
<xsl:choose>
<xsl:when test="($proof_links > 0) and ($print_lab_identifiers = 0)">
<xsl:call-template name="plab1">
<xsl:with-param name="nr" select="@schemenr"/>
<xsl:with-param name="txt">
<xsl:text>Sch</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pplab">
<xsl:with-param name="nr" select="@schemenr"/>
<xsl:with-param name="vid" select="@vid"/>
<xsl:with-param name="txt">
<xsl:text>Sch</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text>{ </xsl:text>
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>, </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="SchemeFuncDecl|SchemePredDecl"/>
</xsl:call-template>
<xsl:text> } :</xsl:text>
<xsl:element name="br"/>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="Proposition"/>
</xsl:element>
<xsl:if test="SchemePremises/Proposition">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>provided</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:call-template name="andlist">
<xsl:with-param name="elems" select="SchemePremises/Proposition"/>
</xsl:call-template>
</xsl:element>
</xsl:if>
<xsl:if test="not($generate_items>0)">
<xsl:apply-templates select="*[position() = last() - 1]"/>
</xsl:if>
</xsl:element>
</xsl:template>
<!-- ( ( CorrectnessCondition*, elCorrectness?, -->
<!-- elJustifiedProperty*, elConstructor?, elPattern? ) -->
<!-- | ( elConstructor, elConstructor, elConstructor+, -->
<!-- elRegistration, CorrectnessCondition*, -->
<!-- elCorrectness?, elPattern+ )) -->
<!-- ##TODO: commented registration and strict attr for defstruct -->
<xsl:template match="Definition">
<xsl:call-template name="add_comments">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="@expandable = "true"">
<xsl:variable name="argtypes" select="../Let/Typ"/>
<xsl:variable name="loci">
<xsl:choose>
<xsl:when test="($mml="1") or ($generate_items>0)">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>2</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="Pattern">
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("NM", @nr)"/>
</xsl:attribute>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>mode </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="abs1">
<xsl:with-param name="k">
<xsl:text>M</xsl:text>
</xsl:with-param>
<xsl:with-param name="fnr" select="@formatnr"/>
</xsl:call-template>
<xsl:if test="Visible/Int">
<xsl:text> of </xsl:text>
<xsl:for-each select="Visible/Int">
<xsl:variable name="x" select="@x"/>
<xsl:choose>
<xsl:when test="$loci="2"">
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$x"/>
<xsl:with-param name="vid" select="$argtypes[position()=$x]/@vid"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="$x"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(position()=last())">
<xsl:text>,</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> is </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:apply-templates select="Expansion/Typ"/>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<!-- @nr is present iff Definiens is present; it can be 0 if -->
<!-- the definiens is not labeled, otherwise it is the proposition number -->
<!-- of its deftheorem -->
<xsl:choose>
<xsl:when test="@nr and ($generate_items>0)">
<xsl:variable name="cnt1" select="1 + count(preceding-sibling::Definition[@nr])"/>
<xsl:variable name="defnr" select="../following-sibling::Definiens[position() = $cnt1]/@defnr"/>
<xsl:document href="proofhtml/dfs/{$anamelc}.{$defnr}" format="html">
<xsl:call-template name="dfs"/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@nr">
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#D",@nr)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Definition</xsl:text>
</xsl:attribute>
<xsl:call-template name="add_dbpedia">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:call-template name="dfs"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="dfs"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*[not((name()='Constructor') or (name()='Pattern')
or (name()='Registration'))]"/>
</xsl:template>
<xsl:template name="dfs">
<xsl:variable name="nl">
<xsl:choose>
<xsl:when test="@nr">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="argtypes" select="../Let/Typ"/>
<!-- Constructor may be missing, if this is a redefinition -->
<!-- that does not change its types. In that case, the Constructor needs -->
<!-- to be retrieved from the Definiens - see below. -->
<xsl:if test="not(@nr)">
<!-- for generate_items, we have to take loci from the constructor here -->
<xsl:variable name="indef1">
<xsl:choose>
<xsl:when test="($generate_items > 0)">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:apply-templates select="Constructor">
<xsl:with-param name="indef" select="$indef1"/>
<xsl:with-param name="nl" select="$nl"/>
<xsl:with-param name="argt" select="$argtypes"/>
</xsl:apply-templates>
</xsl:if>
<!-- @nr is present iff Definiens is present; it can be 0 if -->
<!-- the deiniens is not labeled, otherwise it is the proposition number -->
<!-- of its deftheorem -->
<xsl:if test="@nr">
<xsl:variable name="nr1" select="@nr"/>
<xsl:variable name="vid" select="@vid"/>
<xsl:variable name="cnt1" select="1 + count(preceding-sibling::Definition[@nr])"/>
<xsl:variable name="cnstr" select="count(Constructor)"/>
<xsl:if test="($generate_items > 0)">
<!-- Definiens is better than Constructor for loci display, -->
<!-- since Constructor may be missing for redefinitions. -->
<xsl:for-each select="../following-sibling::Definiens[position() = $cnt1]">
<xsl:call-template name="argtypes">
<xsl:with-param name="el" select="Typ"/>
</xsl:call-template>
</xsl:for-each>
</xsl:if>
<xsl:apply-templates select="Constructor">
<xsl:with-param name="indef">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="nl" select="$nl"/>
<xsl:with-param name="argt" select="$argtypes"/>
</xsl:apply-templates>
<xsl:for-each select="../following-sibling::Definiens[position() = $cnt1]">
<xsl:variable name="ckind" select="@constrkind"/>
<xsl:variable name="cnr" select="@constrnr"/>
<xsl:if test="$cnstr = 0">
<!-- here the redefined constructor is retrieved from definiens -->
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>redefine </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:variable name="doc">
<xsl:choose>
<xsl:when test="key($ckind, $cnr)">
<xsl:text/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$constrs"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="document($doc, /)">
<xsl:apply-templates select="key($ckind, $cnr)">
<xsl:with-param name="indef">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="nl" select="$nl"/>
<xsl:with-param name="argt" select="$argtypes"/>
<xsl:with-param name="nrt">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="old">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:apply-templates>
</xsl:for-each>
</xsl:if>
<xsl:choose>
<xsl:when test="DefMeaning/@kind = 'e'">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> equals </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> means </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$nr1 > 0">
<xsl:text>:</xsl:text>
<xsl:choose>
<xsl:when test="($proof_links > 0) and ($print_lab_identifiers = 0)">
<xsl:call-template name="plab1">
<xsl:with-param name="nr" select="@defnr"/>
<xsl:with-param name="txt">
<xsl:text>Def</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pplab">
<xsl:with-param name="nr" select="$nr1"/>
<xsl:with-param name="vid" select="$vid"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("D", @defnr)"/>
</xsl:attribute>
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="concat($aname, ":def ", @defnr)"/>
</xsl:call-template>
</xsl:element>
<!-- note that loci below can be translated to constants and identifiers -->
<!-- - see definition of LocusVar -->
<xsl:for-each select="DefMeaning/PartialDef">
<xsl:apply-templates select="*[1]"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> if </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*[2]"/>
<xsl:element name="br"/>
</xsl:for-each>
<xsl:if test="(DefMeaning/PartialDef)
and (DefMeaning/*[(position() = last())
and not(name()="PartialDef")])">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> otherwise </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select="DefMeaning/*[(position() = last()) and not(name()="PartialDef")]"/>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!-- ( elLet | elAssume | elGiven | AuxiliaryItem | -->
<!-- elCanceled | elDefinition )*, elEndPosition -->
<xsl:template match="DefinitionBlock">
<xsl:call-template name="add_comments">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:element name="div">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>definition</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*[not(name()='EndPosition')]"/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<!-- ( elRCluster | elFCluster | elCCluster ), -->
<!-- CorrectnessCondition*, elCorrectness? -->
<xsl:template match="Registration">
<xsl:apply-templates/>
</xsl:template>
<!-- elIdentifyWithExp, CorrectnessCondition*, elCorrectness? -->
<xsl:template match="IdentifyRegistration">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ReductionRegistration">
<xsl:apply-templates/>
</xsl:template>
<!-- ( elLet | AuxiliaryItem | elRegistration | elCanceled )+, elEndPosition -->
<xsl:template match="RegistrationBlock">
<xsl:call-template name="add_comments">
<xsl:with-param name="line" select="@line"/>
</xsl:call-template>
<xsl:element name="div">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>registration</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*[not(name()='EndPosition')]"/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<xsl:template match="NotationBlock">
<xsl:element name="div">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>notation</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*[not(name()='EndPosition')]"/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<!-- Blocks -->
<xsl:template match="BlockThesis"/>
<!-- "blockthesis: "; apply; ";"; <br; } -->
<!-- ( ( elBlockThesis, elCase, elThesis, Reasoning ) -->
<!-- | ( elCase, Reasoning, elBlockThesis ) ) -->
<xsl:template match="CaseBlock">
<xsl:element name="div">
<xsl:element name="a">
<xsl:call-template name="add_hsNdiv_attrs"/>
<xsl:if test="$proof_links>0">
<xsl:attribute name="title">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>case </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:apply-templates select="Case"/>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*[not(name()='Case')]"/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<xsl:template match="SupposeBlock">
<xsl:element name="div">
<xsl:element name="a">
<xsl:call-template name="add_hsNdiv_attrs"/>
<xsl:if test="$proof_links>0">
<xsl:attribute name="title">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>suppose </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:apply-templates select="Suppose"/>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*[not(name()='Suppose')]"/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<!-- ( ( elBlockThesis, ( elCaseBlock+ | elSupposeBlock+ ), -->
<!-- elPerCases, elThesis, elEndPosition ) -->
<!-- | ( ( elCaseBlock+ | elSupposeBlock+ ), -->
<!-- elPerCases, elEndPosition, elBlockThesis ) ) -->
<xsl:template match="PerCasesReasoning">
<xsl:element name="div">
<xsl:element name="a">
<xsl:call-template name="add_hsNdiv_attrs"/>
<xsl:if test="$proof_links>0">
<xsl:attribute name="title">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>per </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:apply-templates select="PerCases"/>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="BlockThesis"/>
<xsl:apply-templates select="Thesis"/>
<xsl:apply-templates select="CaseBlock | SupposeBlock"/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<!-- elBlockThesis, Reasoning -->
<!-- the Proof is done in two parts, as a preparation for printing -->
<!-- top proofs into separate documents, and their loading via AJAX -->
<!-- this is a non-top-level proof -->
<xsl:template match="Proof/Proof | Now/Proof | Conclusion/Proof | CaseBlock/Proof | SupposeBlock/Proof">
<xsl:element name="div">
<xsl:element name="a">
<xsl:call-template name="add_hs2_attrs"/>
<xsl:if test="$proof_links>0">
<xsl:attribute name="title">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>proof </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<!-- add_ar_iconif(#line=`EndPosition[1]/@line`, #col=`EndPosition[1]/@col`); -->
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<!-- hence the rest is a top-level proof -->
<!-- xsltxt cannot use xsl:document yet, so manually insert -->
<!-- (now done as perl postproc) -->
<!-- if you want ajax_proofs -->
<xsl:template match="Proof">
<xsl:variable name="nm0" select="concat($ajax_proof_dir,"/",$anamelc,"/",@newlevel)"/>
<xsl:variable name="nm">
<xsl:choose>
<xsl:when test="$ajax_proofs=3">
<xsl:value-of select="concat($ltmpftptpcgi,"?tmp=",$lbytmpdir,"&raw=1","&file=",$nm0)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nm0"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="div">
<xsl:attribute name="about">
<xsl:value-of select="concat("#PF",@newlevel)"/>
</xsl:attribute>
<xsl:attribute name="typeof">
<xsl:text>oo:Proof</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="(name(..) = "JustifiedTheorem")">
<xsl:element name="span">
<xsl:attribute name="rel">
<xsl:text>oo:proves</xsl:text>
</xsl:attribute>
<xsl:attribute name="resource">
<xsl:value-of select="concat("#T",../@nr)"/>
</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:when test="(name(..) = "SchemeBlock")">
<xsl:element name="span">
<xsl:attribute name="rel">
<xsl:text>oo:proves</xsl:text>
</xsl:attribute>
<xsl:attribute name="resource">
<xsl:value-of select="concat("#S",../@schemenr)"/>
</xsl:attribute>
</xsl:element>
</xsl:when>
<!-- toplevel lemma, hopefully -->
<xsl:when test="not(string-length(@plevel)>0)">
<xsl:element name="span">
<xsl:attribute name="rel">
<xsl:text>oo:proves</xsl:text>
</xsl:attribute>
<xsl:attribute name="resource">
<xsl:value-of select="concat("#E",preceding-sibling::Proposition[1]/@propnr)"/>
</xsl:attribute>
</xsl:element>
</xsl:when>
</xsl:choose>
<xsl:element name="a">
<xsl:choose>
<xsl:when test="($ajax_proofs=1) or ($ajax_proofs=3)">
<xsl:call-template name="add_ajax_attrs">
<xsl:with-param name="u" select="$nm"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="add_hs2_attrs"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$proof_links>0">
<xsl:attribute name="title">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>proof </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<!-- add_ar_iconif(#line=`EndPosition[1]/@line`, #col=`EndPosition[1]/@col`); -->
<xsl:choose>
<xsl:when test="$ajax_proofs>0">
<xsl:element name="span">
<xsl:if test="$ajax_proofs=2">
<xsl:attribute name="filebasedproofinsert">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
</xsl:element>
<xsl:document href="{$ajax_proof_dir}/{$anamelc}/{@newlevel}" format="html">
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:template>
<!-- Reasoning, elBlockThesis -->
<!-- #nkw tells not to print the keyword (used if hereby was printed above) -->
<!-- ###TODO: fix for generating items (see Proposition) -->
<xsl:template match="Now">
<xsl:param name="nkw"/>
<xsl:choose>
<xsl:when test="not($nkw="1")">
<xsl:element name="div">
<xsl:if test="@nr>0">
<xsl:call-template name="pplab">
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="vid" select="@vid"/>
</xsl:call-template>
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:element name="a">
<xsl:call-template name="add_hs2_attrs"/>
<xsl:if test="$proof_links>0">
<xsl:attribute name="title">
<xsl:value-of select="@newlevel"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>now </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:if test="($display_thesis = 1)">
<xsl:for-each select=" BlockThesis">
<xsl:text> </xsl:text>
<xsl:element name="a">
<xsl:call-template name="add_hs_attrs"/>
<xsl:call-template name="pcomment0">
<xsl:with-param name="str">
<xsl:text> thesis: </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">
<xsl:text>hide</xsl:text>
</xsl:attribute>
<xsl:text> </xsl:text>
<xsl:apply-templates select="*[position()=last()]"/>
</xsl:element>
</xsl:for-each>
</xsl:if>
</xsl:element>
<xsl:call-template name="now_body"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>end;</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="now_body"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="now_body">
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>add</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="BlockThesis"/>
<xsl:apply-templates select="*[not(name()='BlockThesis')]"/>
</xsl:element>
</xsl:template>
<xsl:template name="idv_for_top">
<xsl:variable name="idv_html">
<xsl:text>http://lipa.ms.mff.cuni.cz/~urban/idvtest/</xsl:text>
</xsl:variable>
<!-- $idv_html = "file:///home/urban/mptp0.2/idvhtml/"; -->
<xsl:variable name="tptp_file" select="concat($idv_html,"top/",$anamelc,".top.rated")"/>
<xsl:text> </xsl:text>
<xsl:element name="img">
<xsl:call-template name="add_hs2_attrs"/>
<xsl:attribute name="src">
<xsl:text>hammock.jpg</xsl:text>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:text>Show IDV graph for whole article</xsl:text>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>Show IDV graph for whole article</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- <a -->
<!-- { -->
<!-- // add_ajax_attrs(#u = $th); -->
<!-- add_hs2_attrs(); -->
<!-- @title="Show IDV graph"; -->
<!-- <b { " IDV graph "; } -->
<!-- } -->
<xsl:element name="span">
<xsl:attribute name="style">
<xsl:text>display:none</xsl:text>
</xsl:attribute>
<xsl:text>:: Showing IDV graph ... (Click the Palm Trees again to close it)</xsl:text>
<xsl:element name="APPLET">
<xsl:attribute name="CODE">
<xsl:text>IDVApplet.class</xsl:text>
</xsl:attribute>
<xsl:attribute name="ARCHIVE">
<xsl:text>IDV.jar,TptpParser.jar,antlr-2.7.5.jar</xsl:text>
</xsl:attribute>
<xsl:attribute name="WIDTH">
<xsl:text>0</xsl:text>
</xsl:attribute>
<xsl:attribute name="HEIGHT">
<xsl:text>0</xsl:text>
</xsl:attribute>
<xsl:element name="PARAM">
<xsl:attribute name="NAME">
<xsl:text>URL</xsl:text>
</xsl:attribute>
<xsl:attribute name="VALUE">
<xsl:value-of select="$tptp_file"/>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- tpl [Now](#nkw) { -->
<!-- <div { <b { if [not($nkw="1")] { "now ";} } -->
<!-- <div { @class="add"; apply[BlockThesis]; -->
<!-- apply[*[not(name()='BlockThesis')]]; } -->
<!-- pkeyword(#str="end;"); } } -->
<!-- separate top-level items by additional newline -->
<xsl:template match="Article">
<xsl:element name="div">
<xsl:if test="not($mk_header > 0)">
<xsl:call-template name="pcomment0">
<xsl:with-param name="str" select="concat($aname, " semantic presentation")"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="$idv > 0">
<xsl:call-template name="idv_for_top"/>
</xsl:if>
</xsl:element>
<xsl:element name="br"/>
<xsl:for-each select="*">
<xsl:apply-templates select="."/>
<xsl:if test="(not(name()='Definiens')) and (not(name()='Reservation'))">
<xsl:element name="br"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="Section">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>begin</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="br"/>
</xsl:template>
<!-- processing of imported documents -->
<xsl:template match="Theorem">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>theorem </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="mkref">
<xsl:with-param name="aid" select="@aid"/>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="k" select="@kind"/>
</xsl:call-template>
<xsl:element name="br"/>
<xsl:choose>
<xsl:when test="Verum">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>canceled; </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="br"/>
<xsl:element name="br"/>
</xsl:template>
<!-- now used only when #mml=1 - in article the block has them -->
<xsl:template match="ArgTypes">
<xsl:call-template name="argtypes">
<xsl:with-param name="el" select="*"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="argtypes">
<xsl:param name="el"/>
<xsl:if test="$el">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>let </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="ploci">
<xsl:with-param name="nr">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:text> be </xsl:text>
<xsl:call-template name="alist">
<xsl:with-param name="j">
<xsl:text>1</xsl:text>
</xsl:with-param>
<xsl:with-param name="sep1">
<xsl:text>, </xsl:text>
</xsl:with-param>
<xsl:with-param name="sep2">
<xsl:text> be </xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="$el"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<!-- #indef tells not to use Argtypes (we are inside Definition) -->
<!-- note that this can also be used for displaying -->
<!-- environmental constructors, or constructor retrieved from other file -->
<!-- #argt is explicit list of argument types, useful for -->
<!-- getting the @vid (identifier numbers) of loci -->
<!-- #nrt tells not to show the result type(s) -->
<!-- #old says that the constructor is from a redefinition and not new, -->
<!-- so an anchor should not be created -->
<xsl:template match="Constructor">
<xsl:param name="indef"/>
<xsl:param name="nl"/>
<xsl:param name="argt"/>
<xsl:param name="nrt"/>
<xsl:param name="old"/>
<xsl:variable name="loci">
<xsl:choose>
<xsl:when test="($mml="1") or ($generate_items>0)">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>2</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($indef="1")">
<xsl:apply-templates select="ArgTypes"/>
</xsl:if>
<xsl:if test="@redefnr>0">
<xsl:call-template name="pcomment0">
<xsl:with-param name="str">
<xsl:text>original: </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="abs">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@redefnr"/>
<xsl:with-param name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@redefnr"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="br"/>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>redefine </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:variable name="mk">
<xsl:call-template name="mkind">
<xsl:with-param name="kind" select="@kind"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$old="1"">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$mk"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat(@kind,@nr)"/>
</xsl:attribute>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$mk"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@kind="G"">
<xsl:call-template name="abs">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@relnr"/>
<xsl:with-param name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@relnr"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:text>(# </xsl:text>
<xsl:for-each select="Fields/Field">
<xsl:call-template name="abs">
<xsl:with-param name="k">
<xsl:text>U</xsl:text>
</xsl:with-param>
<xsl:with-param name="nr" select="@nr"/>
<xsl:with-param name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k">
<xsl:text>U</xsl:text>
</xsl:with-param>
<xsl:with-param name="nr" select="@nr"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text> #)</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@kind='V'">
<xsl:variable name="nr1" select="count(ArgTypes/Typ)"/>
<xsl:choose>
<xsl:when test="$loci = 1">
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="$nr1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ppconst">
<xsl:with-param name="nr" select="$nr1"/>
<xsl:with-param name="vid" select="$argt[position() = $nr1]/@vid"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:text> is </xsl:text>
<xsl:call-template name="pp">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@relnr"/>
<xsl:with-param name="args" select="$argt[position() < last()]"/>
<xsl:with-param name="loci" select="$loci"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pp">
<xsl:with-param name="k" select="@kind"/>
<xsl:with-param name="nr" select="@relnr"/>
<xsl:with-param name="args" select="$argt"/>
<xsl:with-param name="loci" select="$loci"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not($nrt = 1) and
((@kind = 'M') or (@kind = 'K') or (@kind= 'G')
or (@kind= 'U') or (@kind= 'L'))">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> -> </xsl:text>
</xsl:with-param>
</xsl:call-template>
<!-- note that loci in Typs here can be translated to constants and identifiers -->
<!-- - see definition of LocusVar -->
<xsl:call-template name="list">
<xsl:with-param name="separ">
<xsl:text>,</xsl:text>
</xsl:with-param>
<xsl:with-param name="elems" select="Typ"/>
</xsl:call-template>
</xsl:if>
<xsl:choose>
<xsl:when test="not($indef="1")">
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
<xsl:element name="br"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$nl="1"">
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- display synonym and antonym definiiotns -->
<xsl:template match="NotationBlock/Pattern">
<!-- pp1(#k=`@constrkind`,#nr=`@constrnr`,#vis=`Visible/Int`, -->
<!-- #fnr=`@formatnr`, #loci="1"); <br; -->
<xsl:variable name="loci">
<xsl:choose>
<xsl:when test="$mml="1"">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>2</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="argtypes" select="../Let/Typ"/>
<xsl:element name="a">
<xsl:attribute name="NAME">
<xsl:value-of select="concat("N",@kind,@nr)"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="@antonymic">
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>antonym </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>synonym </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="pp1">
<xsl:with-param name="k" select="@constrkind"/>
<xsl:with-param name="nr" select="@constrnr"/>
<xsl:with-param name="args" select="$argtypes"/>
<xsl:with-param name="vis" select="Visible/Int"/>
<xsl:with-param name="fnr" select="@formatnr"/>
<xsl:with-param name="loci" select="$loci"/>
</xsl:call-template>
</xsl:element>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> for </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="pp">
<xsl:with-param name="k" select="@constrkind"/>
<xsl:with-param name="nr" select="@constrnr"/>
<xsl:with-param name="args" select="$argtypes"/>
<xsl:with-param name="pid" select="@redefnr"/>
<xsl:with-param name="loci" select="$loci"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:template>
<!-- ignore forgetful functors - unhandled yet -->
<xsl:template match="Notations/Pattern">
<!-- pp1(#k=`@constrkind`,#nr=`@constrnr`,#vis=`Visible/Int`, -->
<!-- #fnr=`@formatnr`, #loci="1"); <br; -->
<xsl:if test="not(@kind = "J")">
<xsl:apply-templates select="ArgTypes"/>
<xsl:choose>
<xsl:when test="Expansion">
<!-- $alc = lc(#s=`@aid`); -->
<xsl:variable name="sym">
<xsl:call-template name="abs1">
<xsl:with-param name="k">
<xsl:text>M</xsl:text>
</xsl:with-param>
<xsl:with-param name="fnr" select="@formatnr"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text>mode </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="absref">
<xsl:with-param name="elems" select="."/>
<xsl:with-param name="c">
<xsl:text>0</xsl:text>
</xsl:with-param>
<xsl:with-param name="sym" select="$sym"/>
<xsl:with-param name="pid" select="@relnr"/>
</xsl:call-template>
<!-- <a -->
<!-- { -->
<!-- @href=`concat($alc, ".", $ext, "#","NM",@nr)`; -->
<!-- if [$titles="1"] { @title=`concat(@aid,":","NM",".",@nr)`; } -->
<!-- abs1(#k = "M", #fnr = `@formatnr`); -->
<!-- } -->
<xsl:if test="Visible/Int">
<xsl:text> of </xsl:text>
<xsl:for-each select="Visible/Int">
<xsl:call-template name="ploci">
<xsl:with-param name="nr" select="@x"/>
</xsl:call-template>
<xsl:if test="not(position()=last())">
<xsl:text>,</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str">
<xsl:text> is </xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="Expansion/Typ"/>
<xsl:text>;</xsl:text>
<xsl:element name="br"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="loci">
<xsl:choose>
<xsl:when test="$mml="1"">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>2</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="mk">
<xsl:call-template name="mkind">
<xsl:with-param name="kind" select="@kind"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="pkeyword">
<xsl:with-param name="str" select="$mk"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:call-template name="pp1">
<xsl:with-param name="k" select="@constrkind"/>
<xsl:with-param name="nr" select="@constrnr"/>
<xsl:with-param name="vis" select="Visible/Int"/>
<xsl:with-param name="fnr" select="@formatnr"/>
<xsl:with-param name="loci">
<xsl:text>1</xsl:text>
</xsl:with-param>
</xsl:call-template>
<xsl:element name="br"/>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="br"/>
</xsl:if>
</xsl:template>
<!-- ignore normal Patterns now -->
<xsl:template match="Pattern"/>
<!-- Default -->
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$generate_items = "1"">
<xsl:apply-templates select="/*/JustifiedTheorem|/*/DefTheorem|/*/SchemeBlock"/>
<xsl:apply-templates select="//RCluster|//CCluster|//FCluster|//Definition|//IdentifyWithExp"/>
<!-- top-level lemmas -->
<xsl:for-each select="/*/Proposition">
<xsl:document href="proofhtml/lemma/{$anamelc}.{@propnr}" format="html">
<xsl:apply-templates select="."/>
</xsl:document>
<xsl:variable name="bogus" select="1"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$body_only = "0"">
<xsl:element name="html">
<xsl:attribute name="prefix">
<xsl:text>oo: http://omdoc.org/ontology#</xsl:text>
</xsl:attribute>
<!-- output the css defaults for div and p (for indenting) -->
<xsl:element name="style">
<xsl:attribute name="type">
<xsl:text>text/css</xsl:text>
</xsl:attribute>
<xsl:text>
div { padding: 0 0 0 0; margin: 0 0 0 0; }
div.add { padding-left: 3mm; padding-bottom: 0mm; margin: 0 0 0 0; }
div.box { border-width:thin; border-color:blue; border-style:solid; }
p { margin: 0 0 0 0; }
body {font-family: monospace; margin: 0px;}
a {text-decoration:none} a:hover { color: red; }
a.ref { font-size:x-small; }
a.ref:link { color:green; }
a.ref:hover { color: red; }
a.txt:link { color:black; }
a.txt:hover { color: red; }
.wikiactions ul { background-color: DarkSeaGreen ; color:blue; margin: 0; padding: 6px; list-style-type: none; border-bottom: 1px solid #000; }
.wikiactions li { display: inline; padding: .2em .4em; }
.wikiactions a {text-decoration:underline;}
span.kw {font-weight: bold; }
span.lab {font-style: italic; }
span.comment {font-style: italic; }
span.hide { display: none; }
span.p1:hover { color : inherit; background-color : #BAFFFF; }
span.p2:hover { color : inherit; background-color : #FFCACA; }
span.p3:hover { color : inherit; background-color : #FFFFBA; }
span.p4:hover { color : inherit; background-color : #CACAFF; }
span.p5:hover { color : inherit; background-color : #CAFFCA; }
span.p0:hover { color : inherit; background-color : #FFBAFF; }
.defaultjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
.default:hover { background-color: white; color: black; }
:target { background: #5D9BF7; border: solid 1java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 8
/:element>
<xsl:element name="head">
<java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 8
<
xsl:when test="mk_header 0"
imageViewWidthConstraint.sActive = true
<sl:text> /xsl:text>
tle">
<xsl}
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$aname"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="script">
<xsl:attribute name="type">
<xsl:text>text/javascript</xsl:text>
</xsl:attribute>
<xsl:text>
<!--
function hs(obj)
{
// document.getElementById('myimage').nextSibling.style.display = 'block';
if (obj.nextSibling.style.display == 'inline')
{ obj.nextSibling.style.display = 'none'; }
else { if (obj.nextSibling.style.display == 'none')
{ obj.nextSibling.style.display = 'inline'; }
else { obj.nextSibling.style.display = 'inline'; }}
return false;
}
function hs2(obj)
{
if (obj.nextSibling.style.display == 'block')
{ obj.nextSibling.style.display = 'none'; }
else { if (obj.nextSibling.style.display == 'none')
{ obj.nextSibling.style.display = 'block'; }
else { obj.nextSibling.style.display = 'none'; }}
return false;
}
function hsNdiv(obj)
{
var ndiv = obj;
while (ndiv.nextSibling.nodeName != 'DIV') { ndiv = ndiv.nextSibling; }
return hs2(ndiv);
}
// explorer7 implements XMLHttpRequest in some strange way
function makeRequest(obj,url) {
var http_request = false;
if (window.XMLHttpRequest && !(window.ActiveXObject)) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try {
http_request = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function() { insertRequest(obj,http_request); };
http_request.open('GET', url, true);
http_request.send(null);
}
// commented the 200 state to have local requests too
function insertRequest(obj,http_request) {
if (http_request.readyState == 4) {
// if (http_request.status == 200) {
var ndiv = obj;
while (ndiv.nodeName != 'SPAN') { ndiv = ndiv.nextSibling; }
ndiv.innerHTML = http_request.responseText;
obj.onclick = function(){ return hs2(obj) };
// } else {
// alert('There was a problem with the request.');
// alert(http_request.status);
// }
}}
// End -->
</xsl:text>
</xsl:element>
<xsl:if test="$idv>0">
<xsl:element name="script">
<xsl:attribute name="type">
<xsl:text>text/javascript</xsl:text>
</xsl:attribute>
<xsl:text>
<!--
var tstp_dump;
function openSoTSTP (dump) {
var tstp_url = 'http://www.cs.miami.edu/~tptp/cgi-bin/SystemOnTSTP';
var tstp_browser = window.open(tstp_url, '_blank');
tstp_dump = dump;
}
function getTSTPDump () {
return tstp_dump;
}
// End -->
</xsl:text>
</xsl:element>
</xsl:if>
<xsl:element name="base">
<xsl:attribute name="target">
<xsl:value-of select="$default_target"/>
</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="body">
<xsl:if test="$wiki_links=1">
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>wikiactions</xsl:text>
</xsl:attribute>
<xsl:element name="ul">
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat($lmwikicgi,"?p=",$lgitproject,";a=edit;f=mml/",$anamelc,".miz")"/>
</xsl:attribute>
<xsl:attribute name="rel">
<xsl:text>nofollow</xsl:text>
</xsl:attribute>
<xsl:text>Edit</xsl:text>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat($lmwikicgi,"?p=",$lgitproject,";a=history;f=mml/",$anamelc,".miz")"/>
</xsl:attribute>
<xsl:text>History</xsl:text>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat($lmwikicgi,"?p=",$lgitproject,";a=blob_plain;f=mml/",$anamelc,".miz")"/>
</xsl:attribute>
<xsl:attribute name="rel">
<xsl:text>nofollow</xsl:text>
</xsl:attribute>
<xsl:text>Raw</xsl:text>
</xsl:element>
</xsl:element>
<!-- <li { <a { @href=`concat("../discussion/",$anamelc, ".html")`; "Discussion"; } } -->
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$lmwikiindex"/>
</xsl:attribute>
<xsl:text>Index</xsl:text>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat($lmwikicgi,"?p=",$lgitproject,";a=gitweb")"/>
</xsl:attribute>
<xsl:text>Gitweb</xsl:text>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:if>
<xsl:if test="$mk_header > 0">
<xsl:apply-templates select="document($hdr,/)/Header/*"/>
<xsl:element name="br"/>
</xsl:if>
<!-- first read the keys for imported stuff -->
<!-- apply[document($constrs,/)/Constructors/Constructor]; -->
<!-- apply[document($thms,/)/Theorems/Theorem]; -->
<!-- apply[document($schms,/)/Schemes/Scheme]; -->
<!-- then process the whole document -->
<xsl:apply-templates/>
</xsl:element>
</xsl:element>
</xsl:when>
<!-- $body_only > 0 -->
<xsl:otherwise>
<xsl:if test="$mk_header > 0">
<xsl:apply-templates select="document($hdr,/)/Header/*"/>
<xsl:element name="br"/>
</xsl:if>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- tpl [*] { copy { apply [@*]; apply; } } -->
<!-- tpl [@*] { copy-of `.`; } -->
<!-- Header rules -->
<xsl:template match="dc:title">
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="text()"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:creator">
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="concat("by ", text())"/>
</xsl:call-template>
<xsl:call-template name="pcomment">
<xsl:with-param name="str">
<xsl:text/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:date">
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="concat("Received ", text())"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="dc:rights">
<xsl:call-template name="pcomment">
<xsl:with-param name="str" select="concat("Copyright ", text())"/>
</xsl:call-template>
</xsl:template>
<!-- comment rules -->
<xsl:template match="Comment">
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>comment</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$colored="1"">
<xsl:element name="font">
<xsl:attribute name="color">
<xsl:value-of select="$commentcolor"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template match="CmtLine">
<xsl:value-of select="text()"/>
<xsl:element name="br"/>
</xsl:template>
<xsl:template match="CmtLink">
<xsl:text>:: </xsl:text>
<xsl:call-template name="add_wp_icon"/>
<xsl:text> </xsl:text>
<xsl:for-each select="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:copy-of select="text()"/>
</xsl:copy>
</xsl:for-each>
<xsl:element name="br"/>
</xsl:template>
<xsl:template name="add_wp_icon">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="concat($ltptproot,"WP.ico")"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:text>WP: </xsl:text>
</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
¤ Dauer der Verarbeitung: 2.2 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-23
|