https://github.com/coq-ext-lib/coq-ext-lib
Tip revision: 4e16cb58bb743938ce27de4155ca97a43796db45 authored by Yishuai Li on 17 January 2024, 23:01:51 UTC
Update templates
Update templates
Tip revision: 4e16cb5
ExtLib.Data.Set.TwoThreeTrees.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link href="resources/coqdoc.css" rel="stylesheet" type="text/css" />
<link href="resources/coqdocjs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resources/config.js"></script>
<script type="text/javascript" src="resources/coqdocjs.js"></script>
</head>
<body onload="document.getElementById('content').focus()">
<div id="header">
<span class="left">
<span class="modulename"> <script> document.write(document.title) </script> </span>
</span>
<span class="button" id="toggle-proofs"></span>
<span class="right">
<a href="../">Project Page</a>
<a href="./indexpage.html"> Index </a>
<a href="./toc.html"> Table of Contents </a>
</span>
</div>
<div id="content" tabindex="-1" onblur="document.getElementById('content').focus()">
<div id="main">
<h1 class="libtitle">ExtLib.Data.Set.TwoThreeTrees</h1>
<div class="code">
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="ExtLib.Structures.Monads.html#"><span class="id" title="library">ExtLib.Structures.Monads</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="ExtLib.Data.Monads.OptionMonad.html#"><span class="id" title="library">ExtLib.Data.Monads.OptionMonad</span></a>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="ExtLib.Programming.Extras.html#"><span class="id" title="library">ExtLib.Programming.Extras</span></a>.<br/>
<span class="id" title="keyword">Import</span> <span class="id" title="var">FunNotation</span>.<br/>
<br/>
<span class="id" title="keyword">Set Implicit Arguments</span>.<br/>
<span class="id" title="keyword">Set</span> <span class="id" title="var">Maximal</span> <span class="id" title="keyword">Implicit</span> <span class="id" title="var">Insertion</span>.<br/>
<br/>
<span class="id" title="keyword">Import</span> <span class="id" title="var">MonadNotation</span>.<br/>
<span class="id" title="keyword">Import</span> <span class="id" title="var">MonadPlusNotation</span>.<br/>
<span class="id" title="keyword">Open</span> <span class="id" title="keyword">Scope</span> <span class="id" title="var">monad_scope</span>.<br/>
<br/>
<span class="id" title="keyword">Section</span> <a name="tree"><span class="id" title="section">tree</span></a>.<br/>
<span class="id" title="keyword">Variable</span> <a name="tree.E"><span class="id" title="variable">E</span></a>:<span class="id" title="keyword">Type</span>.<br/>
<span class="id" title="keyword">Variable</span> <a name="tree.comp"><span class="id" title="variable">comp</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#comparison"><span class="id" title="inductive">comparison</span></a>.<br/>
<br/>
<span class="comment">(* a two-three tree *)</span><br/>
<span class="id" title="keyword">Inductive</span> <a name="tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="comment">(* Null_t = _ *)</span><br/>
| <a name="Null_t"><span class="id" title="constructor">Null_t</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a><br/>
<span class="comment">(* <span class="inlinecode"><span class="id" title="var">a</span></span><br/>
* Two_t X a Y = / \<br/>
* X Y<br/>
* Invariant: x in X => x < a; y in Y => y > a<br/>
*)</span><br/>
| <a name="Two_t"><span class="id" title="constructor">Two_t</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a><br/>
<span class="comment">(* <span class="inlinecode"><span class="id" title="var">a</span></span><span class="inlinecode"><span class="id" title="var">b</span></span><br/>
* Three_t X a Y b Z = / | \<br/>
* X Y Z<br/>
* Invariant: x in X => x < a; y in Y => a < y < b; z in Z => z > b<br/>
*)</span><br/>
| <a name="Three_t"><span class="id" title="constructor">Three_t</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a><br/>
.<br/>
<br/>
<span class="id" title="keyword">Fixpoint</span> <a name="height_t"><span class="id" title="definition">height_t</span></a> (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) : <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#O"><span class="id" title="constructor">O</span></a><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">_</span> <span class="id" title="var">tr</span> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Peano.html#max"><span class="id" title="abbreviation">max</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#height_t"><span class="id" title="definition">height_t</span></a> <span class="id" title="var">tl</span>) (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#height_t"><span class="id" title="definition">height_t</span></a> <span class="id" title="var">tr</span>)<br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">_</span> <span class="id" title="var">tm</span> <span class="id" title="var">_</span> <span class="id" title="var">tr</span> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Peano.html#max"><span class="id" title="abbreviation">max</span></a> (<a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Peano.html#max"><span class="id" title="abbreviation">max</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#height_t"><span class="id" title="definition">height_t</span></a> <span class="id" title="var">tl</span>) (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#height_t"><span class="id" title="definition">height_t</span></a> <span class="id" title="var">tm</span>)) (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#height_t"><span class="id" title="definition">height_t</span></a> <span class="id" title="var">tr</span>)<br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="comment">(* a context of a two-three tree. this is the type of taking a tree and<br/>
* replacing a sub-tree with a hole.<br/>
*)</span><br/>
<span class="id" title="keyword">Inductive</span> <a name="context"><span class="id" title="inductive">context</span></a> :=<br/>
<span class="comment">(* Top_c = _ *)</span><br/>
| <a name="Top_c"><span class="id" title="constructor">Top_c</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><br/>
<span class="comment">(* C<br/>
* TwoLeftHole_c a Y C = |<br/>
* <span class="inlinecode"><span class="id" title="var">a</span></span><br/>
* / \<br/>
* ? Y<br/>
*)</span><br/>
| <a name="TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><br/>
<span class="comment">(* C<br/>
* TwoRightHole_c X a C = |<br/>
* <span class="inlinecode"><span class="id" title="var">a</span></span><br/>
* / \<br/>
* X ?<br/>
*)</span><br/>
| <a name="TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><br/>
<span class="comment">(* C<br/>
* ThreeLeftHole a Y b Z C = |<br/>
* <span class="inlinecode"><span class="id" title="var">a</span></span><span class="inlinecode"><span class="id" title="var">b</span></span><br/>
* / | \<br/>
* ? Y Z<br/>
*)</span><br/>
| <a name="ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><br/>
<span class="comment">(* C<br/>
* ThreeMiddleHole X a b Z C = |<br/>
* <span class="inlinecode"><span class="id" title="var">a</span></span><span class="inlinecode"><span class="id" title="var">b</span></span><br/>
* / | \<br/>
* X ? Z<br/>
*)</span><br/>
| <a name="ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><br/>
<span class="comment">(* C<br/>
* ThreeRightHole_c X a Y b C = |<br/>
* <span class="inlinecode"><span class="id" title="var">a</span></span><span class="inlinecode"><span class="id" title="var">b</span></span><br/>
* / | \<br/>
* X Y ?<br/>
*)</span><br/>
| <a name="ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><br/>
.<br/>
<br/>
<span class="comment">(* zip takes a context (which can be thought of as a tree with a hole), and a<br/>
* subtree, and fills the hole with the subtree<br/>
*)</span><br/>
<span class="id" title="keyword">Fixpoint</span> <a name="zip"><span class="id" title="definition">zip</span></a> (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) (<span class="id" title="var">c</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">c'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>) <span class="id" title="var">c'</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">er</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <span class="id" title="var">c'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>) <span class="id" title="var">c'</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Fixpoint</span> <a name="fuse"><span class="id" title="definition">fuse</span></a> (<span class="id" title="var">c1</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>) (<span class="id" title="var">c2</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c1"><span class="id" title="variable">c1</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c2"><span class="id" title="variable">c2</span></a><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> <span class="id" title="var">c1'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> <span class="id" title="var">c1'</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c2"><span class="id" title="variable">c2</span></a>)<br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">c1'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> <span class="id" title="var">c1'</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c2"><span class="id" title="variable">c2</span></a>)<br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c1'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> <span class="id" title="var">c1'</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c2"><span class="id" title="variable">c2</span></a>)<br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c1'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> <span class="id" title="var">c1'</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c2"><span class="id" title="variable">c2</span></a>)<br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> <span class="id" title="var">c1'</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">em</span> <span class="id" title="var">er</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> <span class="id" title="var">c1'</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c2"><span class="id" title="variable">c2</span></a>)<br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Inductive</span> <a name="location"><span class="id" title="inductive">location</span></a> :=<br/>
<span class="comment">(* C<br/>
* TwoHole_l X Y C = |<br/>
* <span class="inlinecode">?</span><br/>
* / \<br/>
* X Y<br/>
*)</span><br/>
| <a name="TwoHole_l"><span class="id" title="constructor">TwoHole_l</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#location"><span class="id" title="inductive">location</span></a><br/>
<span class="comment">(* C<br/>
* TwoHole_l X Y b Z C = |<br/>
* <span class="inlinecode">?</span><span class="inlinecode"><span class="id" title="var">b</span></span><br/>
* / | \<br/>
* X Y Z<br/>
*)</span><br/>
| <a name="ThreeLeftHole_l"><span class="id" title="constructor">ThreeLeftHole_l</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#location"><span class="id" title="inductive">location</span></a><br/>
<span class="comment">(* C<br/>
* TwoHole_l X a Y Z C = |<br/>
* <span class="inlinecode"><span class="id" title="var">a</span></span><span class="inlinecode">?</span><br/>
* / | \<br/>
* X Y Z<br/>
*)</span><br/>
| <a name="ThreeRightHole_l"><span class="id" title="constructor">ThreeRightHole_l</span></a> : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Logic.html#1c93e43e07fbeaeb6a625cb6614beb5d"><span class="id" title="notation">-></span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#location"><span class="id" title="inductive">location</span></a><br/>
.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a name="fillLocation"><span class="id" title="definition">fillLocation</span></a> (<span class="id" title="var">e</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a>) (<span class="id" title="var">l</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#location"><span class="id" title="inductive">location</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#l"><span class="id" title="variable">l</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoHole_l"><span class="id" title="constructor">TwoHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">tr</span> <span class="id" title="var">c</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tr</span>) <span class="id" title="var">c</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_l"><span class="id" title="constructor">ThreeLeftHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">tm</span> <span class="id" title="var">vr</span> <span class="id" title="var">tr</span> <span class="id" title="var">c</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tm</span> <span class="id" title="var">vr</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_l"><span class="id" title="constructor">ThreeRightHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">tr</span> <span class="id" title="var">c</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tr</span>) <span class="id" title="var">c</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Fixpoint</span> <a name="locate"><span class="id" title="definition">locate</span></a> (<span class="id" title="var">e</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a>) (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) (<span class="id" title="var">c</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e03f39daf98516fa530d3f6f5a1b4d92"><span class="id" title="notation">+</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#location"><span class="id" title="inductive">location</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> =><br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.comp"><span class="id" title="variable">comp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">em</span> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Lt"><span class="id" title="constructor">Lt</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tl</span> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Eq"><span class="id" title="constructor">Eq</span></a> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">em</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoHole_l"><span class="id" title="constructor">TwoHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Gt"><span class="id" title="constructor">Gt</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><br/>
<span class="id" title="keyword">end</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> =><br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.comp"><span class="id" title="variable">comp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">el</span>, <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.comp"><span class="id" title="variable">comp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">er</span> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Lt"><span class="id" title="constructor">Lt</span></a>, <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tl</span> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Eq"><span class="id" title="constructor">Eq</span></a>, <span class="id" title="var">_</span> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">el</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_l"><span class="id" title="constructor">ThreeLeftHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Gt"><span class="id" title="constructor">Gt</span></a>, <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Lt"><span class="id" title="constructor">Lt</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tm</span> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><br/>
| <span class="id" title="var">_</span>, <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Eq"><span class="id" title="constructor">Eq</span></a> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">er</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_l"><span class="id" title="constructor">ThreeRightHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><br/>
| <span class="id" title="var">_</span>, <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Gt"><span class="id" title="constructor">Gt</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><br/>
<span class="id" title="keyword">end</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Fixpoint</span> <a name="locateGreatest"><span class="id" title="definition">locateGreatest</span></a> (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) (<span class="id" title="var">c</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>)<br/>
: <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e03f39daf98516fa530d3f6f5a1b4d92"><span class="id" title="notation">+</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a>) :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> => <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> => <a class="idref" href="ExtLib.Structures.Monad.html#liftM"><span class="id" title="definition">liftM</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#sum_tot"><span class="id" title="definition">sum_tot</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locateGreatest"><span class="id" title="definition">locateGreatest</span></a> <span class="id" title="var">tr</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a>)<br/>
<a class="idref" href="ExtLib.Structures.MonadPlus.html#1ccf5cb3409233ebd0446c3b758b1c65"><span class="id" title="notation"><+></span></a><br/>
<a class="idref" href="ExtLib.Structures.Monad.html#ret"><span class="id" title="method">ret</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">em</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> => <a class="idref" href="ExtLib.Structures.Monad.html#liftM"><span class="id" title="definition">liftM</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#sum_tot"><span class="id" title="definition">sum_tot</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locateGreatest"><span class="id" title="definition">locateGreatest</span></a> <span class="id" title="var">tr</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a>)<br/>
<a class="idref" href="ExtLib.Structures.MonadPlus.html#1ccf5cb3409233ebd0446c3b758b1c65"><span class="id" title="notation"><+></span></a><br/>
<a class="idref" href="ExtLib.Structures.Monad.html#ret"><span class="id" title="method">ret</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">er</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">el</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">))</span></a><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a name="single"><span class="id" title="definition">single</span></a> <span class="id" title="var">e</span> := <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a>.<br/>
<br/>
<span class="comment">(* if insertion results in a subtree which is too tall, propegate it up into<br/>
* its context.<br/>
*)</span><br/>
<span class="id" title="keyword">Fixpoint</span> <a name="insertUp"><span class="id" title="definition">insertUp</span></a> (<span class="id" title="var">tet</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) (<span class="id" title="var">c</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="id" title="keyword">let</span> '<a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">tl</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">em</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">tr</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> := <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tet"><span class="id" title="variable">tet</span></a> <span class="id" title="tactic">in</span><br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* _<br/>
* |<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> => <span class="inlinecode"><span class="id" title="var">em</span></span><br/>
* // \\ / \<br/>
* tl tr tl tr<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">em'</span></span> => <span class="inlinecode"><span class="id" title="var">em</span></span><span class="inlinecode"><span class="id" title="var">em'</span></span><br/>
* / \ / | \<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> tr' tl tr tr'<br/>
* // \\<br/>
* tl tr<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">em'</span></span> => <span class="inlinecode"><span class="id" title="var">em'</span></span><span class="inlinecode"><span class="id" title="var">em</span></span><br/>
* / \ / | \<br/>
* tl' <span class="inlinecode"><span class="id" title="var">em</span></span> tl' tl tr<br/>
* // \\<br/>
* tl tr<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span> ) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">el</span></span><br/>
* / | \ // \\<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> tm tr' <span class="inlinecode"><span class="id" title="var">em</span></span> <span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* // \\ / \ / \<br/>
* tl tr tl tr tm tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr'</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#insertUp"><span class="id" title="definition">insertUp</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">el</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">em</span></span><br/>
* / | \ // \\<br/>
* tl' <span class="inlinecode"><span class="id" title="var">em</span></span> tr' <span class="inlinecode"><span class="id" title="var">el</span></span> <span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* // \\ / \ / \<br/>
* tl tr tl' tl tr tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr'</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#insertUp"><span class="id" title="definition">insertUp</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el</span> <span class="id" title="var">tl</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">em</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tr</span> <span class="id" title="var">er</span> <span class="id" title="var">tr'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* / | \ // \\<br/>
* tl' tm <span class="inlinecode"><span class="id" title="var">em</span></span> <span class="inlinecode"><span class="id" title="var">el</span></span> <span class="inlinecode"><span class="id" title="var">em</span></span><br/>
* // \\ / \ / \<br/>
* tl tr tl' tm tl tr<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#insertUp"><span class="id" title="definition">insertUp</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">er</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">em</span> <span class="id" title="var">tr</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <span class="id" title="var">c'</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="comment">(* insert an element into the two-three tree *)</span><br/>
<span class="id" title="keyword">Definition</span> <a name="insert"><span class="id" title="definition">insert</span></a> (<span class="id" title="var">e</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a>) (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <span class="id" title="var">c</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#insertUp"><span class="id" title="definition">insertUp</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <span class="id" title="var">c</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">_</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">l</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fillLocation"><span class="id" title="definition">fillLocation</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <span class="id" title="var">l</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="comment">(* if remove results in a tree which is too short, propegate the gap into the<br/>
* context *)</span><br/>
<span class="id" title="keyword">Fixpoint</span> <a name="removeUp"><span class="id" title="definition">removeUp</span></a> (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) (<span class="id" title="var">c</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#context"><span class="id" title="inductive">context</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c"><span class="id" title="variable">c</span></a> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* _<br/>
* ||<br/>
* e => e<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> => <span class="inlinecode"><span class="id" title="var">el'</span></span><br/>
* // \ / \<br/>
* t <span class="inlinecode"><span class="id" title="var">el'</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span> <span class="inlinecode"><span class="id" title="var">em</span></span> <span class="inlinecode"><span class="id" title="var">er'</span></span><br/>
* / | \ / \ / \<br/>
* tl' tm' tr' t tl' tm' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tl'</span>) <span class="id" title="var">el'</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>)) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | ||<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> => <span class="inlinecode"><span class="id" title="var">em</span></span><span class="inlinecode"><span class="id" title="var">em'</span></span><br/>
* // \ / | \<br/>
* t <span class="inlinecode"><span class="id" title="var">em'</span></span> t tl' tr'<br/>
* / \<br/>
* tl' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">em</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#removeUp"><span class="id" title="definition">removeUp</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">em</span> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> => <span class="inlinecode"><span class="id" title="var">er'</span></span><br/>
* / \\ / \<br/>
* <span class="inlinecode"><span class="id" title="var">el'</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span> t <span class="inlinecode"><span class="id" title="var">el'</span></span> <span class="inlinecode"><span class="id" title="var">em</span></span><br/>
* / | \ / \ / \<br/>
* tl' tm' tr' tl' tm' tr' t<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">em</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span>) <span class="id" title="var">er'</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tr'</span> <span class="id" title="var">em</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>)) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | ||<br/>
* <span class="inlinecode"><span class="id" title="var">em</span></span> => <span class="inlinecode"><span class="id" title="var">em'</span></span><span class="inlinecode"><span class="id" title="var">em</span></span><br/>
* / \\ / | \<br/>
* <span class="inlinecode"><span class="id" title="var">em'</span></span> t tl' tr' t<br/>
* / \<br/>
* tl' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">em</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#removeUp"><span class="id" title="definition">removeUp</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span> <span class="id" title="var">em</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* // | \ / | \<br/>
* t <span class="inlinecode"><span class="id" title="var">el'</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span> tr <span class="inlinecode"><span class="id" title="var">el'</span></span> <span class="inlinecode"><span class="id" title="var">er'</span></span> tr<br/>
* / | \ / \ / \<br/>
* tl' tm' tr' t tl' tm' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">el'</span> <span class="id" title="var">tl'</span>) <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">er</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* // | \ / \<br/>
* t <span class="inlinecode"><span class="id" title="var">em'</span></span> tr <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">em'</span></span> tr<br/>
* / \ / | \<br/>
* tl' tr' t tl' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">el</span> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">er</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">er'</span></span><span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* / || \ / | \<br/>
* <span class="inlinecode"><span class="id" title="var">el'</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span> t tr <span class="inlinecode"><span class="id" title="var">el'</span></span> <span class="inlinecode"><span class="id" title="var">el</span></span> tr<br/>
* / | \ / \ / \<br/>
* tl' tm' tr' tl' tm' tr' t<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span>) <span class="id" title="var">er'</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tr'</span> <span class="id" title="var">el</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>) <span class="id" title="var">er</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">el'</span></span><br/>
* / || \ / | \<br/>
* tl t <span class="inlinecode"><span class="id" title="var">el'</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span> tl <span class="inlinecode"><span class="id" title="var">er</span></span> <span class="inlinecode"><span class="id" title="var">er'</span></span><br/>
* / | \ / \ / \<br/>
* tl' tm' tr' t tl' tm' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">er</span> <span class="id" title="var">tl'</span>) <span class="id" title="var">el'</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>)) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* / || \ / \<br/>
* <span class="inlinecode"><span class="id" title="var">em'</span></span> t tr <span class="inlinecode"><span class="id" title="var">em'</span></span><span class="inlinecode"><span class="id" title="var">el</span></span> tr<br/>
* / \ / | \<br/>
* tl' tr' tl' tr' t<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">el</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span> <span class="id" title="var">el</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>) <span class="id" title="var">er</span> <span class="id" title="var">tr</span>) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">el</span></span><br/>
* / || \ / \<br/>
* tl t <span class="inlinecode"><span class="id" title="var">em'</span></span> tl <span class="inlinecode"><span class="id" title="var">er</span></span><span class="inlinecode"><span class="id" title="var">em'</span></span><br/>
* / \ / | \<br/>
* tl' tr' t tl' tr'<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">er</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <span class="id" title="var">er</span> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>)) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span><br/>
* / | \\ / | \<br/>
* tl <span class="inlinecode"><span class="id" title="var">el'</span></span><span class="inlinecode"><span class="id" title="var">er'</span></span> t tl <span class="inlinecode"><span class="id" title="var">el'</span></span> <span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* / | \ / \ / \<br/>
* tl' tm' tr' tl' tm' tr' t<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span> <span class="id" title="var">er'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">er</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">el'</span> <span class="id" title="var">tm'</span>) <span class="id" title="var">er'</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tr'</span> <span class="id" title="var">er</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>)) <span class="id" title="var">c'</span><br/>
<span class="comment">(* c' c'<br/>
* | |<br/>
* <span class="inlinecode"><span class="id" title="var">el</span></span><span class="inlinecode"><span class="id" title="var">er</span></span> => <span class="inlinecode"><span class="id" title="var">el</span></span><br/>
* / | \\ / \<br/>
* tl <span class="inlinecode"><span class="id" title="var">em'</span></span> t tl <span class="inlinecode"><span class="id" title="var">em'</span></span><span class="inlinecode"><span class="id" title="var">er</span></span><br/>
* / \ / | \<br/>
* tl' tr' tl' tr t<br/>
*)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span>) <span class="id" title="var">er</span> <span class="id" title="var">c'</span> =><br/>
<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Two_t"><span class="id" title="constructor">Two_t</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Three_t"><span class="id" title="constructor">Three_t</span></a> <span class="id" title="var">tl'</span> <span class="id" title="var">em'</span> <span class="id" title="var">tr'</span> <span class="id" title="var">er</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a>)) <span class="id" title="var">c'</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <span class="id" title="var">_</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="comment">(* not wf *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoRightHole_c"><span class="id" title="constructor">TwoRightHole_c</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="comment">(* not wf *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <span class="id" title="var">_</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="comment">(* not wf *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="comment">(* not wf *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_c"><span class="id" title="constructor">ThreeRightHole_c</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="comment">(* not wf *)</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a name="remove"><span class="id" title="definition">remove</span></a> (<span class="id" title="var">e</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree.E"><span class="id" title="variable">E</span></a>) (<span class="id" title="var">t</span>:<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a>) : <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="inductive">tree</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locate"><span class="id" title="definition">locate</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#e"><span class="id" title="variable">e</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* element doesn't exist *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <span class="id" title="var">_</span> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#t"><span class="id" title="variable">t</span></a><br/>
<span class="comment">(* element found at location <span class="inlinecode"><span class="id" title="var">loc</span></span> *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">_</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">loc</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> =><br/>
<span class="id" title="keyword">match</span> <span class="id" title="var">loc</span> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* element found at a two-node *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoHole_l"><span class="id" title="constructor">TwoHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">tr</span> <span class="id" title="var">c</span> =><br/>
<span class="id" title="keyword">let</span> <span class="id" title="var">mkContext</span> <span class="id" title="var">g</span> <span class="id" title="var">c'</span> := <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#TwoLeftHole_c"><span class="id" title="constructor">TwoLeftHole_c</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#g"><span class="id" title="variable">g</span></a> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c'"><span class="id" title="variable">c'</span></a> <span class="id" title="tactic">in</span><br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locateGreatest"><span class="id" title="definition">locateGreatest</span></a> <span class="id" title="var">tl</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* no children: turn into a hole and propagate *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#removeUp"><span class="id" title="definition">removeUp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <span class="id" title="var">c</span><br/>
<span class="comment">(* greatest leaf is a two-node: replace it with a hole and propagate *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">g</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <span class="id" title="var">c'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#removeUp"><span class="id" title="definition">removeUp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#mkContext"><span class="id" title="variable">mkContext</span></a> <span class="id" title="var">g</span> <span class="id" title="var">c'</span>) <span class="id" title="var">c</span><br/>
<span class="comment">(* greatest leaf is a three-node: turn it into a two-node *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">g</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">el</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">c'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">))</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#single"><span class="id" title="definition">single</span></a> <span class="id" title="var">el</span>) <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#mkContext"><span class="id" title="variable">mkContext</span></a> <span class="id" title="var">g</span> <span class="id" title="var">c'</span>) <span class="id" title="var">c</span><br/>
<span class="id" title="keyword">end</span><br/>
<span class="comment">(* element found on left side of three-node *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_l"><span class="id" title="constructor">ThreeLeftHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <span class="id" title="var">c</span> =><br/>
<span class="id" title="keyword">let</span> <span class="id" title="var">mkContext</span> <span class="id" title="var">g</span> <span class="id" title="var">c'</span> := <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeLeftHole_c"><span class="id" title="constructor">ThreeLeftHole_c</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#g"><span class="id" title="variable">g</span></a> <span class="id" title="var">tm</span> <span class="id" title="var">er</span> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c'"><span class="id" title="variable">c'</span></a> <span class="id" title="tactic">in</span><br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locateGreatest"><span class="id" title="definition">locateGreatest</span></a> <span class="id" title="var">tl</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* no children: turn into a two-node *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#single"><span class="id" title="definition">single</span></a> <span class="id" title="var">er</span>) <span class="id" title="var">c</span><br/>
<span class="comment">(* greatest leaf is a two-node: replace it with a hole and propagate *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">g</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <span class="id" title="var">c'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#removeUp"><span class="id" title="definition">removeUp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#mkContext"><span class="id" title="variable">mkContext</span></a> <span class="id" title="var">g</span> <span class="id" title="var">c'</span>) <span class="id" title="var">c</span><br/>
<span class="comment">(* greatest leaf is a three-node: turn it into a two-node *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">g</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">el</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">c'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">))</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#single"><span class="id" title="definition">single</span></a> <span class="id" title="var">el</span>) <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#mkContext"><span class="id" title="variable">mkContext</span></a> <span class="id" title="var">g</span> <span class="id" title="var">c'</span>) <span class="id" title="var">c</span><br/>
<span class="id" title="keyword">end</span><br/>
<span class="comment">(* element found on right side of three-node *)</span><br/>
| <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeRightHole_l"><span class="id" title="constructor">ThreeRightHole_l</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <span class="id" title="var">tm</span> <span class="id" title="var">tr</span> <span class="id" title="var">c</span> =><br/>
<span class="id" title="keyword">let</span> <span class="id" title="var">mkContext</span> <span class="id" title="var">g</span> <span class="id" title="var">c'</span> := <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#ThreeMiddleHole_c"><span class="id" title="constructor">ThreeMiddleHole_c</span></a> <span class="id" title="var">tl</span> <span class="id" title="var">el</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#g"><span class="id" title="variable">g</span></a> <span class="id" title="var">tr</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#c'"><span class="id" title="variable">c'</span></a> <span class="id" title="tactic">in</span><br/>
<span class="id" title="keyword">match</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#locateGreatest"><span class="id" title="definition">locateGreatest</span></a> <span class="id" title="var">tm</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Top_c"><span class="id" title="constructor">Top_c</span></a> <span class="id" title="keyword">with</span><br/>
<span class="comment">(* no children: turn into a two-node *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#single"><span class="id" title="definition">single</span></a> <span class="id" title="var">el</span>) <span class="id" title="var">c</span><br/>
<span class="comment">(* greatest leaf is a two-node: replace it with a hole and propagate *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">g</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inl"><span class="id" title="constructor">inl</span></a> <span class="id" title="var">c'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#removeUp"><span class="id" title="definition">removeUp</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#mkContext"><span class="id" title="variable">mkContext</span></a> <span class="id" title="var">g</span> <span class="id" title="var">c'</span>) <span class="id" title="var">c</span><br/>
<span class="comment">(* greatest leaf is a three-node: turn it into a two-node *)</span><br/>
| <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">g</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#inr"><span class="id" title="constructor">inr</span></a> <a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">el</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">c'</span><a class="idref" href="http://coq.inria.fr/distrib/V8.9.1/stdlib//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">))</span></a> => <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#zip"><span class="id" title="definition">zip</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#single"><span class="id" title="definition">single</span></a> <span class="id" title="var">el</span>) <a class="idref" href="ExtLib.Programming.Extras.html#2980cfb53961d5189e0a1f3e473d6bf0"><span class="id" title="notation">$</span></a> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#fuse"><span class="id" title="definition">fuse</span></a> (<a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#mkContext"><span class="id" title="variable">mkContext</span></a> <span class="id" title="var">g</span> <span class="id" title="var">c'</span>) <span class="id" title="var">c</span><br/>
<span class="id" title="keyword">end</span><br/>
<span class="id" title="keyword">end</span><br/>
<span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">End</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#tree"><span class="id" title="section">tree</span></a>.<br/>
<span class="id" title="var">Arguments</span> <a class="idref" href="ExtLib.Data.Set.TwoThreeTrees.html#Null_t"><span class="id" title="constructor">Null_t</span></a> {<span class="id" title="var">E</span>}.<br/>
<br/>
<span class="comment">(*<br/>
Section treeWfP.<br/>
Context {E:Type} {TO:TotalOrder E} {TOP:TotalOrderP E}.<br/>
Context {EP:EquivP E} {POEP:PreOrderEquivP _ EP}.<br/>
<br/>
Inductive tree_wf : tree E -> nat -> EtndTopBot E -> EtndTopBot E -> Prop :=<br/>
| NullTreeWf : forall eLL eRR, tree_wf Null_t O eLL eRR<br/>
| TwoTreeWf : forall tl em tr h eLL eRR,<br/>
eLL << IncEtndTopBot em<br/>
-> IncEtndTopBot em << eRR<br/>
-> tree_wf tl h eLL (IncEtndTopBot em)<br/>
-> tree_wf tr h (IncEtndTopBot em) eRR<br/>
-> tree_wf (Two_t tl em tr) (S h) eLL eRR<br/>
| ThreeTreWf : forall tl el tm er tr eLL eRR h,<br/>
eLL << IncEtndTopBot el<br/>
-> el << er<br/>
-> IncEtndTopBot er << eRR<br/>
-> tree_wf tl h eLL (IncEtndTopBot el)<br/>
-> tree_wf tm h (IncEtndTopBot el) (IncEtndTopBot er)<br/>
-> tree_wf tr h (IncEtndTopBot er) eRR<br/>
-> tree_wf (Three_t tl el tm er tr) (S h) eLL eRR<br/>
.<br/>
<br/>
Inductive tree_in : E -> tree E -> Prop :=<br/>
| TwoTreeIn : forall e tl em tr,<br/>
e ~= em<br/>
\/ tree_in e tl<br/>
\/ tree_in e tr<br/>
-> tree_in e (Two_t tl em tr)<br/>
| ThreeTreeIn : forall e tl el tm er tr,<br/>
e ~= el<br/>
\/ e ~= er<br/>
\/ tree_in e tl<br/>
\/ tree_in e tm<br/>
\/ tree_in e tr<br/>
-> tree_in e (Three_t tl el tm er tr)<br/>
.<br/>
<br/>
<span class="comment">(*<br/>
Lemma swapTwoWf : forall tl em tr h eLL eRR em',<br/>
tree_wf (Two_t tl em tr) h eLL eRR<br/>
-> em ~= em'<br/>
-> tree_wf (Two_t tl em' tr) h eLL eRR.<br/>
Proof. intros ; induction h.<br/>
inversion H.<br/>
inversion H ; subst ; clear H. constructor. repeat (ohsnap ; girlforeal).<br/>
unfold ltP in H5. destruct eLL ; repeat (ohsnap ; girlforeal).<br/>
...<br/>
*)</span><br/>
<br/>
End treeWfP.<br/>
<br/>
<br/>
<span class="comment">(*<br/>
Definition context_wf (c:context) (sth:nat) (sel:E+bool) (ser:E+bool) (th:nat) (eLL:E+bool) (eRR:E+bool) : Prop :=<br/>
forall t:tree, tree_wf t sth sel ser -> tree_wf (zip t c) th eLL eRR.<br/>
<br/>
Lemma twoLeftHoleZipWf : forall tl em tr c h eLL eRR,<br/>
tree_wf (zip (Two_t tl em tr) c) h eLL eRR -> tree_wf (zip tl (TwoLeftHole_c em tr c)) h eLL eRR.<br/>
Proof. intros. induction tl ; intros ; simpl ; auto. Qed. Hint Immediate twoLeftHoleZipWf : twoThreeDb.<br/>
Lemma twoRightHoleZipWf : forall tl em tr c h eLL eRR,<br/>
tree_wf (zip (Two_t tl em tr) c) h eLL eRR -> tree_wf (zip tr (TwoRightHole_c tl em c)) h eLL eRR.<br/>
Proof. intros. induction tl ; intros ; simpl ; auto. Qed. Hint Immediate twoRightHoleZipWf : twoThreeDb.<br/>
Lemma threeLeftHoleZipWf : forall tl el tm er tr c h eLL eRR,<br/>
tree_wf (zip (Three_t tl el tm er tr) c) h eLL eRR-> tree_wf (zip tl (ThreeLeftHole_c el tm er tr c)) h eLL eRR.<br/>
Proof. intros. induction tl ; intros ; simpl ; auto. Qed. Hint Immediate threeLeftHoleZipWf : twoThreeDb.<br/>
Lemma threeMiddleHoleZipWf : forall tl el tm er tr c h eLL eRR,<br/>
tree_wf (zip (Three_t tl el tm er tr) c) h eLL eRR -> tree_wf (zip tm (ThreeMiddleHole_c tl el er tr c)) h eLL eRR.<br/>
Proof. intros. induction tl ; intros ; simpl ; auto. Qed. Hint Immediate threeMiddleHoleZipWf : twoThreeDb.<br/>
Lemma threeRightHoleZipWf : forall tl el tm er tr c h eLL eRR,<br/>
tree_wf (zip (Three_t tl el tm er tr) c) h eLL eRR -> tree_wf (zip tr (ThreeRightHole_c tl el tm er c)) h eLL eRR.<br/>
Proof. intros. induction tl ; intros ; simpl ; auto. Qed. Hint Immediate threeRightHoleZipWf : twoThreeDb.<br/>
<br/>
Definition location_wf (l:location) h eLL eRR : Prop := forall e:E, tree_wf (fillLocation e l) h eLL eRR.<br/>
<br/>
Lemma zipLocationWf : forall tl em tr c, tree_wf (zip (Two_t tl em tr) c) -> location_wf (TwoHole_l tl tr c).<br/>
Proof. intros. unfold location_wf. intros. simpl.<br/>
<br/>
exists em. auto. Qed. Hint Immediate zipLocationWf : twoThreeDb.<br/>
<br/>
Lemma locate_wf : forall e t c, tree_wf (zip t c) -> match locate e t c with inl c => tree_wf (zip Null_t c) | inr (_,l) => location_wf l end.<br/>
Proof. intros. gd c. gd e.<br/>
induction t ; intros ; simpl ; auto. destruct (compareo e0 e).<br/>
pose (twoLeftHoleZipWf _ _ _ _ H). specialize (IHt1 e0 _ t). apply IHt1.<br/>
eauto with twoThreeDb.<br/>
pose (twoRightHoleZipWf _ _ _ _ H). specialize (IHt2 e0 _ t). apply IHt2.<br/>
<br/>
Lemma single_wf : forall e, tree_wf (single e). Proof. intros. simpl. auto. Qed.<br/>
<br/>
Definition insert_wf : forall e t, tree_wf t -> tree_wf (insert e t).<br/>
Proof. intros.<br/>
destruct t. simpl. auto.<br/>
unfold insert. simpl.<br/>
destruct (compareo e e0).<br/>
unfold insert.<br/>
destruct (locate e t Top_c). simpl.<br/>
*)</span><br/>
<br/>
*)</span><br/>
</div>
</div>
<div id="footer">
Generated by <a href="http://coq.inria.fr/">coqdoc</a> and improved with <a href="https://github.com/tebbi/coqdocjs">CoqdocJS</a>
</div>
</div>
</body>
</html>