<TeXmacs|1.0.7.10>

<style|<tuple|source|env-theorem|env|cite-author-year|std-list|env-base>>

<\body>
  <assign|alg-keyword|<macro|body|<with|font-series|bold|<arg|body>>>>

  <\style-with|src-compact|none>
    <new-counter|algo>

    <assign|render-algo-list|<macro|bodyb|<indent-left|3fn|<with|par-par-sep|.2fn|<surround|<no-page-break*>|<no-indent*>|<arg|bodyb>>>>>>

    <style-with|src-compact|all|<assign|algorithmic|<macro|bodya|<with|algo-nr|0|algo-ind|0|ind|<value|algo-indent>|state|<value|algo-item>|item|<value|algo-item>|<algo-indent|<arg|bodya>>>>>>

    <style-with|src-compact|all|<style-with|src-compact|all|<style-with|src-compact|none|<assign|algo-indent|<macro|bodyc|<with|algo-ind|<plus|<value|algo-ind>|3>|<render-algo-list|<arg|bodyc>>>>>>>>

    <assign|render-algo|<macro|x|<with|par-first|<times|-1fn|<value|algo-ind>>|<yes-indent><resize|<arg|x>:|<plus|1r|-2fn>||<plus|<plus|1r|-2fn>|<times|<value|algo-ind>|1fn>>|>>>>

    <assign|algo-item|<macro|<next-algo><render-algo|<the-algo>>>>
  </style-with>

  <assign|WHILE|<\macro|cond|body|post>
    <alg-keyword|while> <arg|cond>

    <\algo-indent>
      <arg|body>
    </algo-indent>

    <item><alg-keyword|end while><arg|post>
  </macro>>

  \;

  <assign|count+|<macro|x|1>>

  <assign|count|<xmacro|x|<map-args|count+|plus|x>>>

  \;

  \;

  <assign|if-extend-if|<macro|body|<alg-keyword|if> <arg|body>>>

  <assign|if-extend-else|<\macro|body>
    <item><alg-keyword|else>

    <algo-indent|<arg|body>>
  </macro>>

  <assign|if-extend-elseif|<\macro|body>
    <item><alg-keyword|else if> <arg|body>
  </macro>>

  <style-with|src-compact|all|<assign|if-extend-block|<macro|body|<algo-indent|<arg|body>>>>>

  \;

  <assign|if-extend|<macro|body|index|<compound|<case|<equal|<arg|index>|0>|if-extend-if|<equal|<mod|<arg|index>|2>|1>|if-extend-block|<if|<equal|<arg|index>|<minus|<value|nargs>|1>>|if-extend-else|if-extend-elseif>>|<arg|body>>>>

  <assign|combine|<\macro|a|b>
    <arg|a>

    <arg|b>
  </macro>>

  <assign|IF|<xmacro|args|<with|nargs|<map-args|identity|count|args>|<combine|<map-args|if-extend|document|args>|<item><alg-keyword|end
  if>>>>>

  \;

  <extern|(define-group enumerate-tag algo-indent)>

  \;

  \;

  \;

  \;

  <assign|new-algorithm|<macro|env|name|<new-env|<arg|env>|<arg|name>|theorem-env|render-algorithm>>>

  <new-algorithm|algorithmenv|Algorithm>

  <assign|render-big-algorithm|<\macro|type|name|body|cap>
    <\padded-normal|1fn|1fn>
      <block|<tformat|<twith|table-width|1par>|<twith|table-hmode|exact>|<cwith|1|-1|1|-1|cell-lborder|0>|<cwith|1|-1|1|-1|cell-rborder|0>|<cwith|1|-1|1|-1|cell-tborder|2ln>|<cwith|1|-1|1|-1|cell-lsep|0>|<cwith|1|-1|1|-1|cell-tsep|5ln>|<cwith|1|-1|1|-1|cell-bsep|4ln>|<cwith|1|-1|1|-1|cell-rsep|0>|<table|<row|<cell|<theorem-name|<arg|name><theorem-sep>>
      <arg|cap>>>>>>

      <arg|body>

      <hrule>
    </padded-normal>
  </macro>>

  <assign|new-algorithm|<\macro|env|name>
    <quasi|<style-with|src-compact|none|<add-to-counter-group|<unquote|<arg|env>>|figure-env><assign|<unquote|<merge|<arg|env>|-text>>|<macro|<localize|<unquote|<arg|name>>>>><assign|<unquote|<merge|<arg|env>|>>|<\macro|caption|body>
      <surround|<compound|<unquote|<merge|next-|<arg|env>>>>||<style-with|src-compact|none|<render-big-algorithm|<unquote|<arg|env>>|<style-with|src-compact|none|<compound|<unquote|<merge|<arg|env>|-text>>>
      <compound|<unquote|<merge|the-|<arg|env>>>>>|<with|alg-indentation|0cm|<arg|body>>|<arg|caption>>>>
    </macro>><assign|<unquote|<merge|<arg|env>|*>>|<\macro|caption|body>
      <style-with|src-compact|none|<render-big-algorithm|<unquote|<arg|env>>|<compound|<unquote|<merge|<arg|env>|-text>>>|<with|alg-indentation|0cm|<arg|body>>|<arg|caption>>>
    </macro>>>>
  </macro>>

  <new-algorithm|algorithm|Algorithm>

  \;
</body>

<\initial>
  <\collection>
    <associate|src-special|normal>
    <associate|src-style|angular>
  </collection>
</initial>