<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
  "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"
  [<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
   <!ENTITY CLin "<mo class='builtin' lspace='thickmathspace' rspace='thickmathspace'>&epsiv;</mo>">]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Clausal Language (ver. 5.81.16, by P.J. Voda, J. Komara, J. Kluka)</title
>
<script type="text/javascript"><![CDATA[
base = document.baseURI;
i = base.indexOf("#"); //remove fragment
if (i >= 0) base = String(base.substring(0,i));
i = base.indexOf("?"); //remove query
if (i >= 0) base = String(base.substring(0,i));
http = "http://"
if (base.indexOf(http) == 0) {
    i = base.indexOf("/",String(http).length);
} else
    i = base.lastIndexOf("/");
if (i >= 0) base = base.substring(0,i); else base = base.toString();
BLANK_URI = base+"/blank.xml";
UPDATE_URI = base+"/update";
SUBMITWIN_FEATURES = "dependent,alwaysLowered,"+
                     "width=50,height=50,"+
                     "z-lock,resizable=no,status=yes";
ID_ATTR = "id";
RESPONSE_FOOTER_ID = "_update_footer_";
RESPONSE_FOOTER_XOFF_ID = "_update_footer_xoff_";
RESPONSE_FOOTER_YOFF_ID = "_update_footer_yoff_";
RESPONSE_FOOTER_FOCUS_SEL = "_update_footer_focus_sel_";
RESPONSE_FOOTER_FOCUS_NAME = "_update_footer_focus_name_";
RESPONSE_ID = "_update_container_";
loading = 0;
selector = null;
function submitForm(aForm,submitter)
{
    /* I know, I know, unless ++x is atomic, a race condition exists,
     * but this is better than nothing */
    if (++loading > 1) {
      loading--;
      alert("You are requesting an action while your previous request "+
            "is still being processed.\n"+
            "Please wait until it is completed.");
      return false;
    }
    var submitframe = document.getElementById("_updater_");
    window.blur(submitter);
    window.focus(document.defaultView);
    selector = aForm.elements["selector"];
    submitframe.onload =
      function() { doSubmit(aForm,submitter,submitframe); };
    submitframe.src = BLANK_URI;
    return false; //prohibit form submission in the original window
}
function doSubmit(aForm,submitter,submitframe)
{
    submitframe.onload = function () {};
    submitframe.style.display = "block";
    if (submitframe.src == BLANK_URI) {
        var submitdoc = submitframe.contentDocument;
        var impForm = submitdoc.importNode(aForm,true);
        var submitbody = submitdoc.getElementsByTagName("body")[0];
        impForm.onsubmit = null;
        submitbody.appendChild(impForm);
        submitframe.onload =
            function () { getUpdate(submitframe); };
        submitImportedForm(impForm,aForm,submitter);
    } else {
        alert("An error occured while trying to submit a form.\n\n"+
            "Check whether the CL server is still running and try again.");
        loading--;
        submitframe.style.display = "none";
    }
    return;
}
function submitImportedForm(impForm,origForm,submitter)
{
    impForm.action = UPDATE_URI;
    var elems = impForm.elements;
    var origElems = origForm.elements;
    var elemslen = elems.length;
    var submitElem = null;
    var elem = null;
    var origElem = null;
    var atMostOneSubmit = false;
    var someSubmit = null;
    for (var i = 0; i < elemslen; i++) {
        elem = elems[i];
        origElem = origElems[i];
        elem.name = origElem.name;
        elem.value = origElem.value;
        if (elem.type == "checkbox" || elem.type == "radio")
            elem.checked = origElem.checked;
        if (elem.type == "select") {
            var opts = elem.options;
            var origOpts = origElem.options;
            var optslen = opts.length;
            for (var j = 0; j < optslen; j++)
                opts[j].selected = origOpts[j].selected;
        }
        if (origElem.isSameNode(submitter))
            submitElem = elem;
        if (elem.type == "submit") {
            if (someSubmit == null)
              someSubmit = elem;
            else
              atMostOneSubmit = false;
        }
    }
    if (elems["xoff"] && elems["yoff"]) {
        elems["xoff"].value = window.pageXOffset+1;
        elems["yoff"].value = window.pageYOffset+1;
    }
    if (submitElem != null && submitElem.type == "submit")
        submitElem.click();
    else if (atMostOneSubmit && someSubmit != null)
        someSubmit.click();
    else
        impForm.submit();
}
function getUpdate(submitframe)
{
    submitframe.onload = function () {};
    var respdoc = submitframe.contentDocument;
    var footer = respdoc.getElementById(RESPONSE_FOOTER_ID);
    if (footer) {
        var resp = respdoc.getElementById(RESPONSE_ID);
        if (resp == null)
            return;
        var elems = resp.childNodes;
        var elemslen = elems.length;
        var elem, oldelem, parent, reArr, id, inselem;
        var focusSel, focusName;
        while (elems.length > 0) {
            elem = elems[0];
            resp.removeChild(elem);
            if (elem.hasAttributes() && elem.hasAttribute(ID_ATTR)) {
                id = elem.getAttribute(ID_ATTR);
                if (elem.hasAttribute("class") &&
                    elem.getAttribute("class") == "element_deleted") {
                    elem = document.getElementById(id);
                    elem.parentNode.removeChild(elem);
                } else if (elem.hasAttribute("class") &&
                    elem.getAttribute("class") == "element_inserted") {
                    splitRe = /^(.*)\.(.*)$/;
                    reArr = splitRe.exec(id);
                    parent = document.getElementById(reArr[1]);
                    oldelem = document.getElementById(reArr[2]);
                    inselem = nextElementSibling(elem.firstChild);
                    inselem = document.importNode(inselem,true);
                    insertAfter(parent,oldelem,inselem);
                } else {
                    oldelem = document.getElementById(id);
                    if (oldelem != null) {
                        elem = document.importNode(elem,true);
                        oldelem.parentNode.replaceChild(elem,oldelem);
                    }
                }
            } else {
                footer.appendChild(elem);
            }
        }
        elem = respdoc.getElementById(RESPONSE_FOOTER_XOFF_ID);
        var xoff = elem ? parseInt(elem.value,10) : 0;
        elem = respdoc.getElementById(RESPONSE_FOOTER_YOFF_ID);
        var yoff = elem ? parseInt(elem.value,10) : 0;
        if (xoff && yoff) {
            xoff--; yoff--;
        } else {
            xoff = window.pageXOffset;
            yoff = window.pageYOffset;
        };
        window.scrollTo(xoff,yoff);
        loading--;
        elem = respdoc.getElementById(RESPONSE_FOOTER_FOCUS_SEL);
        focusSel = elem ? elem.value : null;
        elem = respdoc.getElementById(RESPONSE_FOOTER_FOCUS_NAME);
        focusName = elem ? elem.value : null;
        submitframe.style.display = "none";
        var fobj,fform = document.getElementById(focusSel);
        if (!fform || fform.tagName != "form")
            fform = document.getElementById(focusSel+"__");
        if (fform && fform.tagName == "form" && fform.elements) {
            var fidx = parseInt(focusName,10);
            if (isNaN(fidx)) {
                fobj = fform.elements[focusName];
                if (fobj && !fobj.type && fobj.length) fobj = fobj.item(0);
            } else
                fobj = fform.elements[fidx];
            if (!fobj) fobj = findFocElem(fform);
        }
        if (!fobj) fobj = document.defaultView;
        try {fobj.focus();} catch(ex) {}; /* success */
    } else {
        alert("An error occured while trying to receive an update of "+
              "your view from the CL server.\n\n"+
              "Check whether the server is still running. If it is, "+
              "copy the most recently edited data to the clipboard, "+
              "and press Ctrl-R to update your view.");
        loading--;
        submitframe.style.display = "none";
    }
    return;
}
function insertAfter(parent,child,newchild)
{
    if (child == null) {
        child = nextElementSibling(parent.firstChild);
        parent.insertBefore(newchild,child);
    } else {
        child = nextElementSibling(child.nextSibling);
        parent.insertBefore(newchild,child);
    }
}
function nextElementSibling(node)
{
    while (node != null && node.nodeType != Node.ELEMENT_NODE)
        node = node.nextSibling;
    return node;
}
function firstNNull(elems,op)
{
    var i,res,elemslen = elems.length;
    for (i = 0; i < elemslen; i++)
        if ((res = op(elems[i])) != null)
            return res;
    return null;
}
function findFocElem(elem)
{
    if (elem.tagName == "form")
        return firstNNull(elem.elements,
                          function(e){return e.type == "hidden"?null:e;});
    return firstNNull(elem.childNodes,
                      function(e){return findFocElem(e);});
}
function taKey(ta,event)
{
    if (event.keyCode == 13 && (event.ctrlKey | event.shiftKey)) {
        var els = ta.form.elements;
        for (var i = 0, len = els.length; i < len; i++)
            if (els[i].type == "submit")
                return submitForm(ta.form,els[i]);
        return submitForm(ta.form,ta.form);
    }
}
function taKeyUp(ta,event)
{
    if (event.keyCode == event.DOM_VK_LEFT ||
        event.keyCode == event.DOM_VK_RIGHT ||
        event.keyCode == event.DOM_VK_UP ||
        event.keyCode == event.DOM_VK_DOWN)
        return;
    var c = countNls(ta.value)+1;
    if (c > 20) c = 20;
    if (ta.rows < c) ta.rows = c;
    if (ta.rows > c+1) ta.rows = c+1;
}
function countNls(str)
{
    var i,c,l; l = str.length;
    for(i = c = 0; i < l; ++i)
        if (str[i] == "\n") ++c;
    return c;
}
//]]></script>
<link rel="stylesheet" type="text/css" href="default.css" title="Default"/>
<link rel="alternate stylesheet" type="text/css" href="embers.css" title="Embers"
/>
</head>
<body><iframe id="_updater_" name="_edit_updater_" scrolling="no"/>
<div id="_main_editor_">
<form action="#" method="POST" class="quit_box"><input type="hidden" name="action"
 value="quit"/><input type="hidden" name="selector" value="id------"/><button
 type="submit" name="name" value="File" accesskey="f" class="quit" onclick="return submitForm(this.form,this);"
><span class="acskey">F</span>ile</button><button type="submit" name="name" value="Save"
 accesskey="s" class="quit" onclick="return submitForm(this.form,this);"><span
 class="acskey">S</span>ave</button><button type="submit" name="name" value="Setup"
 accesskey="u" class="quit" onclick="return submitForm(this.form,this);">Set<span
 class="acskey">u</span>p</button><button type="submit" name="name" value="Recompile"
 accesskey="r" class="quit" onclick="return submitForm(this.form,this);"><span
 class="acskey">R</span>ecompile</button><button type="submit" name="name" value="Reexec. Query"
 accesskey="q" class="quit" onclick="return submitForm(this.form,this);">Reexec. 
<span class="acskey">Q</span>uery</button><button type="submit" name="name" value="Save &amp; Exit"
 accesskey="x" class="quit" onclick="return submitForm(this.form,this);">Save &amp; E<span
 class="acskey">x</span>it</button><input type="hidden" name="xoff" value="0"
/><input type="hidden" name="yoff" value="0"/>
</form>
<div class="framed1">
<div class="framename">Clausal Language (ver. 5.81.16, by P.J. Voda, J. Komara, J. Kluka)
</div>
<div id="idD-----">
<div id="idE-----">
<div id="idF-----"/>
</div>
<div id="idG-----">
<div id="idH-----"/>
</div>
<div id="idI-----">
<div id="idJ-----"/>
</div>
</div>
<table id="idL-----" class="fill">
<tr>
<td class="fill"><span class="header">Module
<math xmlns="&mathml;">
<msub class="comp_id_hdr"><mi class="comp_id_hdr">Test02_</mi><mn class="id_sub"
>1300</mn>
</msub>
</math>
</span>
</td>
<td class="editbuttontd">
<form action="#idL-----" method="POST" id="idL-----__" onsubmit="return submitForm(this,this);"
><a name="idL-----"/><input type="hidden" name="selector" value="idL-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
<div id="idM-----">
<div id="idN-----"><a name="idP-----"/>
<form action="#idP-----" method="POST" id="idP-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idP-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idQ-----" class="fill"><a name="idQ-----"/><span class="header">Included module
<math xmlns="&mathml;">
<mi class="comp_id_hdr">Standard</mi>
</math>
</span>
</div>
</div>
<div id="idR-----"><a name="idT-----"/>
<form action="#idT-----" method="POST" id="idT-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idT-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idU-----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>2. TEST Z ÚVODU DO DEKLARATÍVNEHO PROGRAMOVANIA </b>
</p>
<p>Piatok 19. 5. 2006 o 13:00 
</p>
</td>
<td class="editbuttontd">
<form action="#idU-----" method="POST" id="idU-----__" onsubmit="return submitForm(this,this);"
><a name="idU-----"/><input type="hidden" name="selector" value="idU-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idV-----"><a name="idX-----"/>
<form action="#idX-----" method="POST" id="idX-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idX-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idY-----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>Vaše meno: </b>[Marian Oresansky] 
</p>
</td>
<td class="editbuttontd">
<form action="#idY-----" method="POST" id="idY-----__" onsubmit="return submitForm(this,this);"
><a name="idY-----"/><input type="hidden" name="selector" value="idY-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idZ-----"><a name="idb-----"/>
<form action="#idb-----" method="POST" id="idb-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idb-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idc-----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p>Test pozostáva zo štyroch úloh. Zadania pozri dole. 
</p>
<p><b>POKYNY </b>
</p>
<ul>
<li>
<p>Na vyriešenie úloh máte 60 minút. 
</p>
</li>
<li>
<p>Meno súboru obsahujúceho vaše riešenie: <i>test02_1300.cl </i>. 
</p>
</li>
<li>
<p>Na priebežné ukladanie vášho riešenia používajte tlačidlo <i>Save
 </i>( <i>Alt+S </i>). 
</p>
</li>
<li>
<p>Vaše riešenie odovzdajte podľa pokynov cvičiaceho. 
</p>
</li>
</ul>
<p><b>POČET BODOV: </b>
</p>
<ul>
<li>
<p>1. úloha = 5 bodov 
</p>
</li>
<li>
<p>2. úloha = 5 bodov 
</p>
</li>
<li>
<p>3. úloha = 10 bodov 
</p>
</li>
<li>
<p>4. úloha = 10 bodov 
</p>
</li>
</ul>
</td>
<td class="editbuttontd">
<form action="#idc-----" method="POST" id="idc-----__" onsubmit="return submitForm(this,this);"
><a name="idc-----"/><input type="hidden" name="selector" value="idc-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idd-----"><a name="idf-----"/>
<form action="#idf-----" method="POST" id="idf-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idf-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idg-----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b><i>Preskočte nasledujúce komponenty až po nadpis <b>ÚLOHY </b>. </i
></b>
</p>
</td>
<td class="editbuttontd">
<form action="#idg-----" method="POST" id="idg-----__" onsubmit="return submitForm(this,this);"
><a name="idg-----"/><input type="hidden" name="selector" value="idg-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idh-----"><a name="idj-----"/>
<form action="#idj-----" method="POST" id="idj-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idj-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idk-----" class="fill"><a name="idk-----"/><span class="header">Application display&nbsp;<em
>Cdots</em>&nbsp;/&nbsp;0: 
<math xmlns="&mathml;">
<mo>&ctdot;</mo>
</math>
</span>
</div>
</div>
<div id="idl-----"><a name="idn-----"/>
<form action="#idn-----" method="POST" id="idn-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idn-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="ido-----" class="fill"><a name="ido-----"/><span class="header">Application display&nbsp;<em
>Ldots</em>&nbsp;/&nbsp;0: 
<math xmlns="&mathml;">
<mo>&hellip;</mo>
</math>
</span>
</div>
</div>
<div id="idp-----"><a name="idr-----"/>
<form action="#idr-----" method="POST" id="idr-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idr-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="ids-----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<acronym title="This function is a constructor"
 class="fun_constr">
<math xmlns="&mathml;">
<mi class="inh_col_id">Fill_in</mi>
</math>
</acronym>&nbsp;/&nbsp;0 displayed by&nbsp;<em>Cdots</em> as&nbsp;
<math xmlns="&mathml;">
<mo>&ctdot;</mo>
</math>
</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mo>&ctdot;</mo><mo>=</mo><mn class="builtin">20060519</mn>
</math>
</td>
<td class="editbuttontd">
<form action="#ids-----" method="POST" id="ids-----__" onsubmit="return submitForm(this,this);"
><a name="ids-----"/><input type="hidden" name="selector" value="ids-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idt-----"><a name="idv-----"/>
<form action="#idv-----" method="POST" id="idv-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idv-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idw-----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<acronym title="This function is a constructor"
 class="fun_constr">
<math xmlns="&mathml;">
<mi class="inh_col_id">Fill_arg</mi>
</math>
</acronym>&nbsp;/&nbsp;0 displayed by&nbsp;<em>Ldots</em> as&nbsp;
<math xmlns="&mathml;">
<mo>&hellip;</mo>
</math>
</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mo>&hellip;</mo><mo>=</mo><mn class="builtin">20060519</mn>
</math>
</td>
<td class="editbuttontd">
<form action="#idw-----" method="POST" id="idw-----__" onsubmit="return submitForm(this,this);"
><a name="idw-----"/><input type="hidden" name="selector" value="idw-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idx-----"><a name="idz-----"/>
<form action="#idz-----" method="POST" id="idz-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idz-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="id0-----" class="fill">
<tr>
<td class="fill"><span class="header">Predicate&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Fill_in_p</mi>
</math>
</span>&nbsp;/&nbsp;0 displayed by&nbsp;<em>Cdots</em> as&nbsp;
<math xmlns="&mathml;">
<mo>&ctdot;</mo>
</math>
</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mo>&ctdot;</mo>
</math>
</td>
<td class="editbuttontd">
<form action="#id0-----" method="POST" id="id0-----__" onsubmit="return submitForm(this,this);"
><a name="id0-----"/><input type="hidden" name="selector" value="id0-----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="id1-----"><a name="id3-----"/>
<form action="#id3-----" method="POST" id="id3-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id3-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="id4-----" class="fill"><a name="id4-----"/><span class="header">Application display&nbsp;<em
>Sub_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub>
<mrow><mo>(</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>)</mo>
</mrow>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</msub>
</math>
</span>
</div>
</div>
<div id="id5-----"><a name="id7-----"/>
<form action="#id7-----" method="POST" id="id7-----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id7-----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="id8-----" class="fill"><a name="id8-----"/><span class="header">Application display&nbsp;<em
>Var_sub</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub>
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</msub>
</math>
</span>
</div>
</div>
<div id="id9-----"><a name="id-A----"/>
<form action="#id-A----" method="POST" id="id-A----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id-A----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idAA----" class="fill"><a name="idAA----"/><span class="header">Application display&nbsp;<em
>Member_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>&isin;</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</math>
</span>
</div>
</div>
<div id="idBA----"><a name="idDA----"/>
<form action="#idDA----" method="POST" id="idDA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idDA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idEA----" class="fill"><a name="idEA----"/><span class="header">Application display&nbsp;<em
>Delete_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>\</mo>
<mrow><mo>{</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub><mo>}</mo>
</mrow>
</math>
</span>
</div>
</div>
<div id="idFA----"><a name="idHA----"/>
<form action="#idHA----" method="POST" id="idHA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idHA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idIA----" class="fill"><a name="idIA----"/><span class="header">Application display&nbsp;<em
>Union_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>&cup;</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</math>
</span>
</div>
</div>
<div id="idJA----"><a name="idLA----"/>
<form action="#idLA----" method="POST" id="idLA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idLA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idMA----" class="fill"><a name="idMA----"/><span class="header">Application display&nbsp;<em
>Inter_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>&cap;</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</math>
</span>
</div>
</div>
<div id="idNA----"><a name="idPA----"/>
<form action="#idPA----" method="POST" id="idPA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idPA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idQA----" class="fill"><a name="idQA----"/><span class="header">Application display&nbsp;<em
>Diff_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>\</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</math>
</span>
</div>
</div>
<div id="idRA----"><a name="idTA----"/>
<form action="#idTA----" method="POST" id="idTA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idTA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idUA----" class="fill"><a name="idUA----"/><span class="header">Application display&nbsp;<em
>Sdiff_d</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>&bowtie;</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</math>
</span>
</div>
</div>
<div id="idVA----"><a name="idXA----"/>
<form action="#idXA----" method="POST" id="idXA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idXA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<div id="idYA----" class="fill"><a name="idYA----"/><span class="header">Application display&nbsp;<em
>Perm</em>&nbsp;/&nbsp;2: 
<math xmlns="&mathml;">
<msub class="ad_constr_arg"><mi>#</mi><mn>1</mn>
</msub><mo>&sim;</mo>
<msub class="ad_constr_arg"><mi>#</mi><mn>2</mn>
</msub>
</math>
</span>
</div>
</div>
<div id="idZA----"><a name="idbA----"/>
<form action="#idbA----" method="POST" id="idbA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idbA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idcA----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><i><b>Ú L O H Y </b></i>
</p>
</td>
<td class="editbuttontd">
<form action="#idcA----" method="POST" id="idcA----__" onsubmit="return submitForm(this,this);"
><a name="idcA----"/><input type="hidden" name="selector" value="idcA----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="iddA----"><a name="idfA----"/>
<form action="#idfA----" method="POST" id="idfA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idfA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idgA----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>1. ÚLOHA </b>(5 bodov) 
</p>
</td>
<td class="editbuttontd">
<form action="#idgA----" method="POST" id="idgA----__" onsubmit="return submitForm(this,this);"
><a name="idgA----"/><input type="hidden" name="selector" value="idgA----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idhA----"><a name="idjA----"/>
<form action="#idjA----" method="POST" id="idjA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idjA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idkA----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p>Definujte funkciu 
<math xmlns="&mathml;">
<mi class="ident">Take</mi>
<mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
, ktorá vráti zoznam pozostávajúci z prvých 
<math xmlns="&mathml;">
<mi>k</mi>
</math>
prvkov zoznamu 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
. Ak 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
má menej, ako 
<math xmlns="&mathml;">
<mi>k</mi>
</math>
prvkov, funkcia vráti všetky. Formálne 
</p>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Take</mi>
<mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>x</mi><mo>)</mo>
</mrow><mo>=</mo><mi>y</mi><mo>&rarr;</mo>
<mrow><mo>&exist;</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mi>x</mi><mo>=</mo><mi>y</mi><mo class="builtin">&oplus;</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle>
</mrow>
</math>
<math xmlns="&mathml;" mode="display">
<mi>k</mi><mo class="builtin">&lE;</mo><mi class="ident">L</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow><mo>&rarr;</mo><mi class="ident">L</mi><mi class="ident">Take</mi>
<mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>x</mi><mo>)</mo>
</mrow><mo>=</mo><mi>k</mi>
</math>
<p>Príklad: 
<math xmlns="&mathml;">
<mi class="ident">Take</mi>
<mrow><mo>(</mo><mn class="builtin">2</mn><mo>,</mo><mn class="builtin">9</mn
><mo class="builtin">,</mo><mn class="builtin">8</mn><mo class="builtin">,</mo
><mn class="builtin">7</mn><mo class="builtin">,</mo><mn class="builtin">6</mn
><mo class="builtin">,</mo><mn class="builtin">5</mn><mo class="builtin">,</mo
><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">9</mn><mo class="builtin">,</mo><mn class="builtin"
>8</mn><mo class="builtin">,</mo><mn class="builtin">0</mn>
</math>
. 
</p>
</td>
<td class="editbuttontd">
<form action="#idkA----" method="POST" id="idkA----__" onsubmit="return submitForm(this,this);"
><a name="idkA----"/><input type="hidden" name="selector" value="idkA----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idlA----"><a name="idnA----"/>
<form action="#idnA----" method="POST" id="idnA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idnA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idoA----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Take</mi>
</math>
</span>&nbsp;/&nbsp;2</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Take</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Take</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>k</mi>
</mstyle><mo class="builtin">+</mo><mn class="builtin">1</mn><mo>,</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi>a</mi><mo class="builtin">,</mo><mi class="ident">Take</mi
>
<mrow><mo>(</mo><mi>k</mi><mo>,</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#idoA----" method="POST" id="idoA----__" onsubmit="return submitForm(this,this);"
><a name="idoA----"/><input type="hidden" name="selector" value="idoA----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idpA----"><a name="idrA----"/>
<form action="#idrA----" method="POST" id="idrA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idrA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idsA----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>2. ÚLOHA </b>(5 bodov) 
</p>
</td>
<td class="editbuttontd">
<form action="#idsA----" method="POST" id="idsA----__" onsubmit="return submitForm(this,this);"
><a name="idsA----"/><input type="hidden" name="selector" value="idsA----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idtA----"><a name="idvA----"/>
<form action="#idvA----" method="POST" id="idvA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idvA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idwA----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p>Definujte funkciu 
<math xmlns="&mathml;">
<mi class="ident">Table_sq</mi>
<mrow><mo>(</mo><mi>n</mi><mo>)</mo>
</mrow>
</math>
, ktorá vypočíta zoznam prvých 
<math xmlns="&mathml;">
<mi>n</mi>
</math>
hodnôt funkcie zabudovanej funkcie 
<math xmlns="&mathml;">
<mi class="ident">Sq</mi>
</math>
(druhá mocnina, 
<math xmlns="&mathml;">
<msup><mi>x</mi><mn>2</mn>
</msup>
</math>
), teda 
</p>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Table_sq</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn>
</math>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Table_sq</mi>
<mrow><mo>(</mo><mi>n</mi><mo class="builtin">+</mo><mn class="builtin">1</mn
><mo>)</mo>
</mrow><mo>=</mo>
<msup><mn class="builtin">0</mn><mn>2</mn>
</msup><mo class="builtin">,</mo>
<msup><mn class="builtin">1</mn><mn>2</mn>
</msup><mo class="builtin">,</mo>
<mrow><mo>&hellip;</mo><mo class="builtin">,</mo>
<msup><mi>n</mi><mn>2</mn>
</msup><mo class="builtin">,</mo><mn class="builtin">0</mn>
</mrow>
</math>
<p>Ak vaša definícia použije zreťazenie, môžete získať <b>najviac 3 
body </b>. Definícia bez zreťazenia vyžaduje pomocnú funkciu simulujúcu
 cyklus while alebo for. 
</p>
</td>
<td class="editbuttontd">
<form action="#idwA----" method="POST" id="idwA----__" onsubmit="return submitForm(this,this);"
><a name="idwA----"/><input type="hidden" name="selector" value="idwA----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idxA----"><a name="idzA----"/>
<form action="#idzA----" method="POST" id="idzA----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idzA----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="id0A----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">While</mi>
</math>
</span>&nbsp;/&nbsp;2</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">While</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>,</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi>a</mi>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">While</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>n</mi>
</mstyle><mo class="builtin">+</mo><mn class="builtin">1</mn><mo>,</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi class="ident">While</mi>
<mrow><mo>(</mo><mi>n</mi><mo>,</mo><mi>a</mi><mo class="builtin">&oplus;</mo
>
<mrow><mo class="cp2">(</mo><mi>n</mi><mo class="builtin">+</mo><mn class="builtin"
>1</mn><mo class="builtin">,</mo><mn class="builtin">0</mn><mo class="cp2">)</mo
>
</mrow><mo>)</mo>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#id0A----" method="POST" id="id0A----__" onsubmit="return submitForm(this,this);"
><a name="id0A----"/><input type="hidden" name="selector" value="id0A----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="id1A----"><a name="id3A----"/>
<form action="#id3A----" method="POST" id="id3A----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id3A----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="id4A----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Table</mi>
</math>
</span></span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Table</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Table</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>n</mi>
</mstyle><mo class="builtin">+</mo><mn class="builtin">1</mn><mo>)</mo>
</mrow><mo>=</mo>
<msup><mi>a</mi><mn>2</mn>
</msup><mo class="builtin">,</mo><mi class="ident">Table</mi>
<mrow><mo>(</mo><mi>n</mi><mo>)</mo>
</mrow><mo>&larr;</mo>
<mrow><mi class="ident">While</mi>
<mrow><mo>(</mo><mi>n</mi><mo class="builtin">+</mo><mn class="builtin">1</mn
><mo>,</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#id4A----" method="POST" id="id4A----__" onsubmit="return submitForm(this,this);"
><a name="id4A----"/><input type="hidden" name="selector" value="id4A----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="id5A----"><a name="id7A----"/>
<form action="#id7A----" method="POST" id="id7A----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id7A----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="id8A----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Table_sq</mi>
</math>
</span></span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Table_sq</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Table_sq</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>n</mi>
</mstyle><mo class="builtin">+</mo><mn class="builtin">1</mn><mo>)</mo>
</mrow><mo>=</mo><mi class="ident">Table_sq</mi>
<mrow><mo>(</mo><mi>n</mi><mo>)</mo>
</mrow><mo class="builtin">&oplus;</mo>
<mrow><mo>(</mo>
<msup>
<mrow><mo class="cp2">(</mo><mi>n</mi><mo class="builtin">+</mo><mn class="builtin"
>1</mn><mo class="cp2">)</mo>
</mrow><mn>2</mn>
</msup><mo class="builtin">,</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#id8A----" method="POST" id="id8A----__" onsubmit="return submitForm(this,this);"
><a name="id8A----"/><input type="hidden" name="selector" value="id8A----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="id9A----"><a name="id-B----"/>
<form action="#id-B----" method="POST" id="id-B----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id-B----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idAB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b><i>Poznámka k 3. úlohe. </i></b>(Zadanie pozri nižsie.) 
</p>
<p class="indented">Zoznam 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
nazveme <i>množinou </i>(a zapíšeme 
<math xmlns="&mathml;">
<mi class="ident">Set</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
) práve vtedy, keď jeho prvky sú vzostupne usporiadané bez opakovania. 
</p>
</td>
<td class="editbuttontd">
<form action="#idAB----" method="POST" id="idAB----__" onsubmit="return submitForm(this,this);"
><a name="idAB----"/><input type="hidden" name="selector" value="idAB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idBB----"><a name="idDB----"/>
<form action="#idDB----" method="POST" id="idDB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idDB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idEB----" class="fill">
<tr>
<td class="fill"><span class="header">Predicate&nbsp;<acronym title="This is an inductive predicate"
 class="pred_induct">
<math xmlns="&mathml;">
<mi class="inh_col_id">Set</mi>
</math>
</acronym></span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Set</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Set</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Set</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo>)</mo>
</mrow><mo>&larr;</mo>
<mrow><mi>a</mi><mo class="builtin">&lt;</mo><mi>b</mi>
</mrow><mo>&and;</mo>
<mrow><mi class="ident">Set</mi>
<mrow><mo>(</mo><mi>b</mi><mo class="builtin">,</mo><mi>x</mi><mo>)</mo>
</mrow>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#idEB----" method="POST" id="idEB----__" onsubmit="return submitForm(this,this);"
><a name="idEB----"/><input type="hidden" name="selector" value="idEB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idFB----"><a name="idHB----"/>
<form action="#idHB----" method="POST" id="idHB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idHB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idIB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>3. ÚLOHA </b>(10 bodov) 
</p>
</td>
<td class="editbuttontd">
<form action="#idIB----" method="POST" id="idIB----__" onsubmit="return submitForm(this,this);"
><a name="idIB----"/><input type="hidden" name="selector" value="idIB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idJB----"><a name="idLB----"/>
<form action="#idLB----" method="POST" id="idLB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idLB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idMB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p>Definujte funkciu 
<math xmlns="&mathml;">
<mi>x</mi><mo>\</mo>
<mrow><mo>{</mo><mi>a</mi><mo>}</mo>
</mrow>
</math>
( 
<math xmlns="&mathml;">
<mi class="ident">Delete</mi>
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>a</mi><mo>)</mo>
</mrow>
</math>
), ktorá odstráni prvok 
<math xmlns="&mathml;">
<mi>a</mi>
</math>
z množiny 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
. 
</p>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Set</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow><mo>&rarr;</mo><mi class="ident">Set</mi>
<mrow><mo>(</mo><mi>x</mi><mo>\</mo>
<mrow><mo class="cp2">{</mo><mi>a</mi><mo class="cp2">}</mo>
</mrow><mo>)</mo>
</mrow>
</math>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Set</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow><mo>&rarr;</mo>
<mrow><mo>&forall;</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo>&isin;</mo><mi>x</mi><mo>\</mo>
<mrow><mo class="cp2">{</mo><mi>a</mi><mo class="cp2">}</mo>
</mrow><mo>&harr;</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo>&ne;</mo><mi>a</mi><mo>&and;</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo>&isin;</mo><mi>x</mi><mo>)</mo>
</mrow>
</mrow>
</math>
<p>Využite, že 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
je množina. 
</p>
</td>
<td class="editbuttontd">
<form action="#idMB----" method="POST" id="idMB----__" onsubmit="return submitForm(this,this);"
><a name="idMB----"/><input type="hidden" name="selector" value="idMB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idNB----"><a name="idPB----"/>
<form action="#idPB----" method="POST" id="idPB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idPB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idQB----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Delete</mi>
</math>
</span>&nbsp;/&nbsp;2 displayed by&nbsp;<em>Delete_d</em> as&nbsp;
<math xmlns="&mathml;">
<mstyle class="bvar">
<msub><mi>#</mi><mn>1</mn>
</msub>
</mstyle><mo>\</mo>
<mrow><mo>{</mo>
<mstyle class="bvar">
<msub><mi>#</mi><mn>2</mn>
</msub>
</mstyle><mo>}</mo>
</mrow>
</math>
</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mn class="builtin">0</mn><mo>\</mo>
<mrow><mo>{</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo>}</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo>)</mo>
</mrow><mo>\</mo>
<mrow><mo>{</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo>}</mo>
</mrow><mo>=</mo><mi>x</mi><mo>\</mo>
<mrow><mo>{</mo><mi>a</mi><mo>}</mo>
</mrow><mo>&larr;</mo>
<mrow><mi>a</mi><mo>=</mo><mi>b</mi>
</mrow>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo>)</mo>
</mrow><mo>\</mo>
<mrow><mo>{</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo>}</mo>
</mrow><mo>=</mo><mi>b</mi><mo class="builtin">,</mo><mi>x</mi><mo>\</mo>
<mrow><mo>{</mo><mi>a</mi><mo>}</mo>
</mrow><mo>&larr;</mo>
<mrow><mi>a</mi><mo>&ne;</mo><mi>b</mi>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#idQB----" method="POST" id="idQB----__" onsubmit="return submitForm(this,this);"
><a name="idQB----"/><input type="hidden" name="selector" value="idQB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idRB----"><a name="idTB----"/>
<form action="#idTB----" method="POST" id="idTB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idTB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idUB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b><i>Poznámka k 4. úlohe. </i></b>(Zadanie pozri nižsie.) 
</p>
<p class="indented">Zoznam 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
nazveme <i>usporiadaným </i>(zapíšeme 
<math xmlns="&mathml;">
<mi class="ident">Ord</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
) práve vtedy, keď jeho prvky sú vzostupne usporiadané (s možným opakovaním).
 
</p>
<p class="indented">Zoznam 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
je <i>permutáciou </i>zoznamu 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
(zapisujeme 
<math xmlns="&mathml;">
<mi>x</mi><mo>&sim;</mo><mi>y</mi>
</math>
) práve vtedy, keď sa každý prvok vyskytuje v zozname 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
rovnaký početkrát ako v zozname 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
. 
</p>
<p class="indented"><i>Triedenie </i>je taká funkcia 
<math xmlns="&mathml;">
<mi class="ident">Sort</mi>
</math>
, ktorá pre každý zoznam 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
vráti zoznam, ktorý je jeho usporiadanou permutáciou; teda platí 
</p>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Ord</mi><mi class="ident">Sort</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
<math xmlns="&mathml;" mode="display">
<mi>x</mi><mo>&sim;</mo><mi class="ident">Sort</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#idUB----" method="POST" id="idUB----__" onsubmit="return submitForm(this,this);"
><a name="idUB----"/><input type="hidden" name="selector" value="idUB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idVB----"><a name="idXB----"/>
<form action="#idXB----" method="POST" id="idXB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idXB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idYB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>4. ÚLOHA </b>(10 bodov) 
</p>
<p>Naprogramujte <i>triedenie vkladaním </i>( <i>insertion sort </i>). Musíte
 zadefinovať dve funkcie: 
</p>
</td>
<td class="editbuttontd">
<form action="#idYB----" method="POST" id="idYB----__" onsubmit="return submitForm(this,this);"
><a name="idYB----"/><input type="hidden" name="selector" value="idYB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idZB----"><a name="idbB----"/>
<form action="#idbB----" method="POST" id="idbB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idbB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idcB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p>Naprogramujte <i>triedenie zlučovaním </i>( <i>merge sort </i>). Musíte
 zadefinovať tri funkcie: 
</p>
</td>
<td class="editbuttontd">
<form action="#idcB----" method="POST" id="idcB----__" onsubmit="return submitForm(this,this);"
><a name="idcB----"/><input type="hidden" name="selector" value="idcB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="iddB----"><a name="idfB----"/>
<form action="#idfB----" method="POST" id="idfB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idfB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idgB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>a) </b>(3 body) 
<math xmlns="&mathml;">
<mi class="ident">Msplit</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
rozdelí zoznam 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
na dvojicu zoznamov 
<math xmlns="&mathml;">
<mi>y</mi><mo class="builtin">,</mo><mi>z</mi>
</math>
polovičnej dĺžky ako zoznam 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
(ak 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
má nepárnu dĺžku, zoznam 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
je o jeden prvok dlhší ako 
<math xmlns="&mathml;">
<mi>z</mi>
</math>
). Zoznam 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
bude obsahovať prvky na párnych miestach (číslované od 0) v zozname 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
, zoznam 
<math xmlns="&mathml;">
<mi>z</mi>
</math>
bude obsahovať prvky na nepárnych miestach v 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
. Formálne 
</p>
<math xmlns="&mathml;" mode="display">
<mo>&exist;</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle>
<mrow><mo>&exist;</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle>
<mrow><mo>(</mo><mi class="ident">Msplit</mi>
<mrow><mo class="cp2">(</mo><mi>x</mi><mo class="cp2">)</mo>
</mrow><mo>=</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mo>&and;</mo><mi class="ident">L</mi>
<mrow><mo class="cp2">(</mo><mi>x</mi><mo class="cp2">)</mo>
</mrow><mo>=</mo><mi class="ident">L</mi>
<mrow><mo class="cp2">(</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo class="cp2">)</mo>
</mrow><mo class="builtin">+</mo><mi class="ident">L</mi>
<mrow><mo class="cp2">(</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mo class="cp2">)</mo>
</mrow><mo>&and;</mo>
<mrow><mo class="cp2">(</mo><mi class="ident">L</mi>
<mrow><mo class="cp3">(</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo class="cp3">)</mo>
</mrow><mo>=</mo><mi class="ident">L</mi>
<mrow><mo class="cp3">(</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mo class="cp3">)</mo>
</mrow><mo>&or;</mo><mi class="ident">L</mi>
<mrow><mo class="cp3">(</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo class="cp3">)</mo>
</mrow><mo>=</mo><mi class="ident">L</mi>
<mrow><mo class="cp3">(</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mo class="cp3">)</mo>
</mrow><mo class="builtin">+</mo><mn class="builtin">1</mn><mo class="cp2">)</mo
>
</mrow><mo>)</mo>
</mrow>
</mrow>
</math>
<math xmlns="&mathml;" mode="display">
<mo>&exist;</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle>
<mrow><mo>&exist;</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle>
<mrow><mo>(</mo><mi class="ident">Msplit</mi>
<mrow><mo class="cp2">(</mo><mi>x</mi><mo class="cp2">)</mo>
</mrow><mo>=</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mo>&and;</mo>
<mrow><mo>&forall;</mo>
<mstyle class="bvar"><mi>i</mi>
</mstyle>
<mrow><mo class="cp2">(</mo><mn class="builtin">2</mn><mo class="builtin">&sdot;</mo
>
<mstyle class="bvar"><mi>i</mi>
</mstyle><mo class="builtin">&lt;</mo><mi class="ident">L</mi>
<mrow><mo class="cp3">(</mo><mi>x</mi><mo class="cp3">)</mo>
</mrow><mo>&rarr;</mo>
<msub>
<mrow><mo class="cp3">(</mo><mi>x</mi><mo class="cp3">)</mo>
</mrow>
<mrow><mn class="builtin">2</mn><mo class="builtin">&sdot;</mo>
<mstyle class="bvar"><mi>i</mi>
</mstyle>
</mrow>
</msub><mo>=</mo>
<msub>
<mrow><mo class="cp3">(</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo class="cp3">)</mo>
</mrow>
<mstyle class="bvar"><mi>i</mi>
</mstyle>
</msub><mo class="cp2">)</mo>
</mrow>
</mrow><mo>&and;</mo>
<mrow><mo>&forall;</mo>
<mstyle class="bvar"><mi>i</mi>
</mstyle>
<mrow><mo class="cp2">(</mo><mn class="builtin">2</mn><mo class="builtin">&sdot;</mo
>
<mstyle class="bvar"><mi>i</mi>
</mstyle><mo class="builtin">+</mo><mn class="builtin">1</mn><mo class="builtin"
>&lt;</mo><mi class="ident">L</mi>
<mrow><mo class="cp3">(</mo><mi>x</mi><mo class="cp3">)</mo>
</mrow><mo>&rarr;</mo>
<msub>
<mrow><mo class="cp3">(</mo><mi>x</mi><mo class="cp3">)</mo>
</mrow>
<mrow><mn class="builtin">2</mn><mo class="builtin">&sdot;</mo>
<mstyle class="bvar"><mi>i</mi>
</mstyle><mo class="builtin">+</mo><mn class="builtin">1</mn>
</mrow>
</msub><mo>=</mo>
<msub>
<mrow><mo class="cp3">(</mo>
<mstyle class="bvar"><mi>z</mi>
</mstyle><mo class="cp3">)</mo>
</mrow>
<mstyle class="bvar"><mi>i</mi>
</mstyle>
</msub><mo class="cp2">)</mo>
</mrow>
</mrow><mo>)</mo>
</mrow>
</mrow>
</math>
<p>Funkcia 
<math xmlns="&mathml;">
<mi class="ident">Msplit</mi>
</math>
musí <i>vždy </i>vrátiť dvojicu. Nepoužite žiadne pomocné funkcie ani
 predikáty. 
</p>
</td>
<td class="editbuttontd">
<form action="#idgB----" method="POST" id="idgB----__" onsubmit="return submitForm(this,this);"
><a name="idgB----"/><input type="hidden" name="selector" value="idgB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idhB----"><a name="idjB----"/>
<form action="#idjB----" method="POST" id="idjB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idjB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idkB----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Msplit</mi>
</math>
</span></span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Msplit</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn><mo class="builtin">,</mo><mn class="builtin"
>0</mn>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Msplit</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo>
<mrow><mo>(</mo><mi>a</mi><mo class="builtin">,</mo><mi>u</mi><mo>)</mo>
</mrow><mo class="builtin">,</mo><mi>x</mi><mo class="builtin">,</mo><mi>v</mi
><mo>&larr;</mo>
<mrow><mi class="ident">Msplit</mi>
<mrow><mo>(</mo><mi>b</mi><mo>)</mo>
</mrow><mo>=</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle>
</mrow><mo>&and;</mo>
<mrow><mi class="ident">Msplit</mi>
<mrow><mo>(</mo><mi>y</mi><mo>)</mo>
</mrow><mo>=</mo>
<mstyle class="bvar"><mi>u</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>v</mi>
</mstyle>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#idkB----" method="POST" id="idkB----__" onsubmit="return submitForm(this,this);"
><a name="idkB----"/><input type="hidden" name="selector" value="idkB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idlB----"><a name="idnB----"/>
<form action="#idnB----" method="POST" id="idnB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idnB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idoB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>b) </b>(4 body) 
<math xmlns="&mathml;">
<mi class="ident">Merge</mi>
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo>
</mrow>
</math>
predpokladá, že zoznamy 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
a 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
sú usporiadané, a vráti usporiadaný zoznam, ktorý obsahuje všetky prvky
 z oboch zoznamov 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
a 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
aj s prípadnými opakovaniami. Má teda platiť 
</p>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Ord</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow><mo>&and;</mo><mi class="ident">Ord</mi>
<mrow><mo>(</mo><mi>y</mi><mo>)</mo>
</mrow><mo>&rarr;</mo><mi class="ident">Ord</mi><mi class="ident">Merge</mi>
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo>
</mrow>
</math>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Ord</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow><mo>&and;</mo><mi class="ident">Ord</mi>
<mrow><mo>(</mo><mi>y</mi><mo>)</mo>
</mrow><mo>&rarr;</mo><mi>x</mi><mo class="builtin">&oplus;</mo><mi>y</mi><mo
>&sim;</mo><mi class="ident">Merge</mi>
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo>
</mrow>
</math>
<p>Nepoužite žiadne pomocné funkcie ani predikáty. Využite, že zoznamy
 
<math xmlns="&mathml;">
<mi>x</mi>
</math>
a 
<math xmlns="&mathml;">
<mi>y</mi>
</math>
sú usporiadané. 
</p>
</td>
<td class="editbuttontd">
<form action="#idoB----" method="POST" id="idoB----__" onsubmit="return submitForm(this,this);"
><a name="idoB----"/><input type="hidden" name="selector" value="idoB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idpB----"><a name="idrB----"/>
<form action="#idrB----" method="POST" id="idrB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idrB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idsB----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Merge</mi>
</math>
</span>&nbsp;/&nbsp;2</span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Merge</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>,</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi>y</mi>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Merge</mi>
<mrow><mo>(</mo>
<mrow><mo class="cp2">(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo class="cp2">)</mo>
</mrow><mo>,</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mi>a</mi><mo class="builtin">,</mo><mi>x</mi>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Merge</mi>
<mrow><mo>(</mo>
<mrow><mo class="cp2">(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo class="cp2">)</mo>
</mrow><mo>,</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi>a</mi><mo class="builtin">,</mo><mi class="ident">Merge</mi
>
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>b</mi><mo class="builtin">,</mo><mi>y</mi
><mo>)</mo>
</mrow><mo>&larr;</mo>
<mrow><mi>a</mi><mo class="builtin">&lt;</mo><mi>b</mi>
</mrow>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Merge</mi>
<mrow><mo>(</mo>
<mrow><mo class="cp2">(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo class="cp2">)</mo>
</mrow><mo>,</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi>a</mi><mo class="builtin">,</mo><mi>b</mi><mo class="builtin"
>,</mo><mi class="ident">Merge</mi>
<mrow><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>)</mo>
</mrow><mo>&larr;</mo>
<mrow><mi>a</mi><mo>=</mo><mi>b</mi>
</mrow>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Merge</mi>
<mrow><mo>(</mo>
<mrow><mo class="cp2">(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo class="cp2">)</mo>
</mrow><mo>,</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>y</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi>b</mi><mo class="builtin">,</mo><mi class="ident">Merge</mi
>
<mrow><mo>(</mo>
<mrow><mo class="cp2">(</mo><mi>a</mi><mo class="builtin">,</mo><mi>x</mi><mo
 class="cp2">)</mo>
</mrow><mo>,</mo><mi>y</mi><mo>)</mo>
</mrow><mo>&larr;</mo>
<mrow><mi>a</mi><mo class="builtin">&gt;</mo><mi>b</mi>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#idsB----" method="POST" id="idsB----__" onsubmit="return submitForm(this,this);"
><a name="idsB----"/><input type="hidden" name="selector" value="idsB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idtB----"><a name="idvB----"/>
<form action="#idvB----" method="POST" id="idvB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idvB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="idwB----" class="fill">
<tr>
<td class="fill">
<div class="header">Remark
<math xmlns="&mathml;">
<mi class="comp_id_hdr"></mi>
</math>
</div>
<p><b>c) </b>(3 body) 
<math xmlns="&mathml;">
<mi class="ident">Msort</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
, samotné triedenie zlučovaním, používa funkcie 
<math xmlns="&mathml;">
<mi class="ident">Msplit</mi>
</math>
a 
<math xmlns="&mathml;">
<mi class="ident">Merge</mi>
</math>
. Pretože táto funkcia je triedením, podľa poznámky má platiť 
</p>
<math xmlns="&mathml;" mode="display">
<mi class="ident">Ord</mi><mi class="ident">Msort</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
<math xmlns="&mathml;" mode="display">
<mi>x</mi><mo>&sim;</mo><mi class="ident">Msort</mi>
<mrow><mo>(</mo><mi>x</mi><mo>)</mo>
</mrow>
</math>
<p>Nepoužite žiadne ďalšie pomocné funkcie ani predikáty. 
</p>
</td>
<td class="editbuttontd">
<form action="#idwB----" method="POST" id="idwB----__" onsubmit="return submitForm(this,this);"
><a name="idwB----"/><input type="hidden" name="selector" value="idwB----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="idxB----"><a name="idzB----"/>
<form action="#idzB----" method="POST" id="idzB----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="idzB----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Ins/Del" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
<td><input type="submit" name="char" value="Expand" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
<table id="id0B----" class="fill">
<tr>
<td class="fill"><span class="header">Function&nbsp;<span class="comp_id_hdr"
>
<math xmlns="&mathml;">
<mi class="inh_col_id">Msort</mi>
</math>
</span></span><br/>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Msort</mi>
<mrow><mo>(</mo><mn class="builtin">0</mn><mo>)</mo>
</mrow><mo>=</mo><mn class="builtin">0</mn>
</math>
<math xmlns="&mathml;" mode="display" class="clause">
<mi class="ident">Msort</mi>
<mrow><mo>(</mo>
<mstyle class="bvar"><mi>a</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>x</mi>
</mstyle><mo>)</mo>
</mrow><mo>=</mo><mi class="ident">Merge</mi>
<mrow><mo>(</mo><mi class="ident">Msort</mi>
<mrow><mo class="cp2">(</mo><mi>b</mi><mo class="cp2">)</mo>
</mrow><mo>,</mo><mi class="ident">Msort</mi>
<mrow><mo class="cp2">(</mo><mi>c</mi><mo class="cp2">)</mo>
</mrow><mo>)</mo>
</mrow><mo>&larr;</mo>
<mrow><mi class="ident">Msplit</mi>
<mrow><mo>(</mo><mi>a</mi><mo class="builtin">,</mo><mi>x</mi><mo>)</mo>
</mrow><mo>=</mo>
<mstyle class="bvar"><mi>b</mi>
</mstyle><mo class="builtin">,</mo>
<mstyle class="bvar"><mi>c</mi>
</mstyle>
</mrow>
</math>
</td>
<td class="editbuttontd">
<form action="#id0B----" method="POST" id="id0B----__" onsubmit="return submitForm(this,this);"
><a name="id0B----"/><input type="hidden" name="selector" value="id0B----"/><input
 type="submit" name="action" value="Edit" class="editbutton" onclick="return submitForm(this.form,this);"
/><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
</td>
</tr>
</table>
</div>
<div id="id1B----"><a name="id2B----"/>
<form action="#id2B----" method="POST" id="id2B----" onsubmit="return submitForm(this,this);"
><input type="hidden" name="action" value="button"/><input type="hidden" name="selector"
 value="id2B----"/>
<table class="fill">
<tr>
<td><pre><span class="fg3"></span></pre>
</td>
<td class="fill">
<hr/>
</td>
<td><input type="submit" name="char" value="Insert" class="button" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table>
</form>
</div>
</div>
<table class="fill">
<tr>
<td class="vert_sep_name">Query:
</td>
<td class="fill">
<hr/>
</td>
</tr>
</table>
<form action="#id4B----" method="POST" id="id4B----" onsubmit="return submitForm(this,this);"
><a name="id4B----"/><input type="hidden" name="selector" value="id4B----"/>
<table class="fill">
<tr>
<td class="fill"><textarea name="data" cols="78" rows="3">0 = x

</textarea>
</td>
<td class="editbuttontd"><input type="submit" name="action" value="OK" class="editbutton"
 onclick="return submitForm(this.form,this);"/><br/><input type="submit" name="action"
 value="Cancel" class="editbutton" onclick="return submitForm(this.form,this);"
/>
</td>
</tr>
</table><input type="hidden" name="xoff" value="0"/><input type="hidden" name="yoff"
 value="0"/>
</form>
<table class="fill">
<tr>
<td class="vert_sep_name">Results:
</td>
<td class="fill">
<hr/>
</td>
</tr>
</table>
<div id="id5B----" class="fill"><a name="id5B----"/>
<div>Heap used:&nbsp;280896 free:&nbsp;133936076
</div>
<div>Time used:&nbsp;0:0:0:2
</div>
</div>
</div>
</div>
</body></html>