diff --git a/stlc.html b/stlc.html index 43da7a9de..cfd4e4918 100644 --- a/stlc.html +++ b/stlc.html @@ -119,57 +119,57 @@ <h1>stlc.html</h1> } </script> <p>Filter predicate: <input onkeyup='filter();' type='text' id='filter' name='filter'></p> -<div class='clause' predicate='declare-evar'><div class='loc'>File "coq-builtin.elpi: default-declare-evar", line 170, column 0, character 6584:</div><div class='hyps'>declare_constraint (declare-evar <span class='name' varname='1'>Ctx</span> <span class='name' varname='2'>RawEv</span> <span class='name' varname='3'>Ty</span> <span class='name' varname='4'>Ev</span>) <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='2'>RawEv</span></div><b>]</b></div></div><div class='concl'><div class='compound'>declare-evar <span class='name' varname='1'>Ctx</span> <span class='name' varname='2'>RawEv</span> <span class='name' varname='3'>Ty</span> <span class='name' varname='4'>Ev</span></div></div></div> -<div class='clause' predicate='rm-evar'><div class='loc'>File "coq-builtin.elpi", line 179, column 0, character 6944:</div><div class='hyps'><div class='hyp compound' level='60'>declare_constraint (rm-evar <span class='name' varname='5'>X</span> <span class='name' varname='6'>Y</span>) <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='5'>X</span><b>,</b></div><div class='compound'> <span class='name' varname='6'>Y</span></div><b>]</b></div></div></div><div class='concl neckcut'><div class='compound'>rm-evar <div class='compound'>(uvar <b>as</b> </div><div class='compound'><span class='name' varname='5'>X</span>)</div> <div class='compound'>(uvar <b>as</b> </div><div class='compound'><span class='name' varname='6'>Y</span>)</div></div></div></div> -<div class='clause' predicate='rm-evar'><div class='loc'>File "coq-builtin.elpi", line 180, column 0, character 7021:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>rm-evar _ _</div></div> -<div class='clause' predicate='evar'><div class='loc'>File "coq-builtin.elpi", line 201, column 0, character 7801:</div><div class='hyps'><div class='hyp compound' level='60'>var <span class='name' varname='9'>S</span> _ <span class='name' varname='10'>VL</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>prune <span class='name' varname='8'>T</span> <span class='name' varname='10'>VL</span>,</div><div class='hyp compound'>prune <span class='name' varname='7'>X</span> <span class='name' varname='10'>VL</span>,</div><div class='hyp compound'>declare_constraint (evar <span class='name' varname='7'>X</span> <span class='name' varname='8'>T</span> <span class='name' varname='9'>S</span>) <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='7'>X</span><b>,</b></div><div class='compound'> <span class='name' varname='9'>S</span></div><b>]</b></div></div></div><div class='concl'><div class='compound'>evar <div class='compound'>(uvar <b>as</b> </div><div class='compound'><span class='name' varname='7'>X</span>)</div> <span class='name' varname='8'>T</span> <span class='name' varname='9'>S</span></div></div></div> -<div class='clause' predicate='evar'><div class='loc'>File "coq-builtin.elpi: default-assign-evar", line 204, column 0, character 7907:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>evar _ _ _</div></div> -<div class='clause' predicate='coq.env.const-opaque?'><div class='loc'>File "coq-builtin.elpi", line 735, column 3, character 30170:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.const-opaque use coq.env.opaque? in place of coq.env.const-opaque?,</div><div class='hyp compound'>coq.env.opaque? <span class='name' varname='11'>C</span></div></div><div class='concl'><div class='compound'>coq.env.const-opaque? <span class='name' varname='11'>C</span></div></div></div> -<div class='clause' predicate='coq.env.const-primitive?'><div class='loc'>File "coq-builtin.elpi", line 742, column 3, character 30418:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.const-primitive use coq.env.primitive? in place of coq.env.const-primitive?,</div><div class='hyp compound'>coq.env.primitive? <span class='name' varname='12'>C</span></div></div><div class='concl'><div class='compound'>coq.env.const-primitive? <span class='name' varname='12'>C</span></div></div></div> -<div class='clause' predicate='coq.env.begin-module'><div class='loc'>File "coq-builtin.elpi", line 823, column 0, character 33729:</div><div class='hyps'>coq.env.begin-module-functor <span class='name' varname='13'>Name</span> <span class='name' varname='14'>MP</span> []</div><div class='concl'><div class='compound'>coq.env.begin-module <span class='name' varname='13'>Name</span> <span class='name' varname='14'>MP</span></div></div></div> -<div class='clause' predicate='coq.env.begin-module-type'><div class='loc'>File "coq-builtin.elpi", line 837, column 0, character 34183:</div><div class='hyps'>coq.env.begin-module-type-functor <span class='name' varname='15'>Name</span> []</div><div class='concl'><div class='compound'>coq.env.begin-module-type <span class='name' varname='15'>Name</span></div></div></div> -<div class='clause' predicate='coq.CS.canonical-projections'><div class='loc'>File "coq-builtin.elpi", line 1194, column 0, character 47940:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.canonical-projections use coq.env.projections in place of coq.CS.canonical-projections,</div><div class='hyp compound'>coq.env.projections <span class='name' varname='16'>I</span> <span class='name' varname='17'>L</span></div></div><div class='concl'><div class='compound'>coq.CS.canonical-projections <span class='name' varname='16'>I</span> <span class='name' varname='17'>L</span></div></div></div> -<div class='clause' predicate='coq.reduction.cbv.whd_all'><div class='loc'>File "coq-builtin.elpi", line 1502, column 0, character 60826:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.cbv-whd-all use coq.reduction.cbv.norm in place of coq.reduction.cbv.whd_all,</div><div class='hyp compound'>coq.reduction.cbv.norm <span class='name' varname='18'>T</span> <span class='name' varname='19'>R</span></div></div><div class='concl'><div class='compound'>coq.reduction.cbv.whd_all <span class='name' varname='18'>T</span> <span class='name' varname='19'>R</span></div></div></div> -<div class='clause' predicate='coq.reduction.vm.whd_all'><div class='loc'>File "coq-builtin.elpi", line 1509, column 0, character 61104:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.vm-whd-all use coq.reduction.vm.norm in place of coq.reduction.vm.whd_all,</div><div class='hyp compound'>coq.reduction.vm.norm <span class='name' varname='20'>T</span> <span class='name' varname='21'>TY</span> <span class='name' varname='22'>R</span></div></div><div class='concl'><div class='compound'>coq.reduction.vm.whd_all <span class='name' varname='20'>T</span> <span class='name' varname='21'>TY</span> <span class='name' varname='22'>R</span></div></div></div> -<div class='clause' predicate='coq.reduction.lazy.whd_all'><div class='loc'>File "coq-builtin.elpi", line 1516, column 0, character 61338:</div><div class='hyps'><div class='compound'>get-option coq:redflags coq.redflags.all <b>⇒</b> </div><div class='compound'>coq.reduction.lazy.whd <span class='name' varname='23'>X</span> <span class='name' varname='24'>Y</span></div></div><div class='concl'><div class='compound'>coq.reduction.lazy.whd_all <span class='name' varname='23'>X</span> <span class='name' varname='24'>Y</span></div></div></div> -<div class='clause' predicate='coq.id->name'><div class='loc'>File "coq-builtin.elpi", line 1633, column 0, character 65849:</div><div class='hyps'>coq.string->name <span class='name' varname='25'>S</span> <span class='name' varname='26'>N</span></div><div class='concl'><div class='compound'>coq.id->name <span class='name' varname='25'>S</span> <span class='name' varname='26'>N</span></div></div></div> -<div class='clause' predicate='coq.elpi.accumulate'><div class='loc'>File "coq-builtin.elpi", line 1722, column 0, character 69170:</div><div class='hyps'>coq.elpi.accumulate-clauses <span class='name' varname='27'>S</span> <span class='name' varname='28'>N</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='29'>C</span></div><b>]</b></div></div><div class='concl'><div class='compound'>coq.elpi.accumulate <span class='name' varname='27'>S</span> <span class='name' varname='28'>N</span> <span class='name' varname='29'>C</span></div></div></div> +<div class='clause' predicate='declare-evar'><div class='loc'>File "coq-builtin.elpi: default-declare-evar", line 268, column 0, character 10808:</div><div class='hyps'>declare_constraint (declare-evar <span class='name' varname='1'>Ctx</span> <span class='name' varname='2'>RawEv</span> <span class='name' varname='3'>Ty</span> <span class='name' varname='4'>Ev</span>) <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='2'>RawEv</span></div><b>]</b></div></div><div class='concl'><div class='compound'>declare-evar <span class='name' varname='1'>Ctx</span> <span class='name' varname='2'>RawEv</span> <span class='name' varname='3'>Ty</span> <span class='name' varname='4'>Ev</span></div></div></div> +<div class='clause' predicate='rm-evar'><div class='loc'>File "coq-builtin.elpi", line 277, column 0, character 11168:</div><div class='hyps'><div class='hyp compound' level='60'>declare_constraint (rm-evar <span class='name' varname='5'>X</span> <span class='name' varname='6'>Y</span>) <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='5'>X</span><b>,</b></div><div class='compound'> <span class='name' varname='6'>Y</span></div><b>]</b></div></div></div><div class='concl neckcut'><div class='compound'>rm-evar <div class='compound'>(uvar <b>as</b> </div><div class='compound'><span class='name' varname='5'>X</span>)</div> <div class='compound'>(uvar <b>as</b> </div><div class='compound'><span class='name' varname='6'>Y</span>)</div></div></div></div> +<div class='clause' predicate='rm-evar'><div class='loc'>File "coq-builtin.elpi", line 278, column 0, character 11245:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>rm-evar _ _</div></div> +<div class='clause' predicate='evar'><div class='loc'>File "coq-builtin.elpi", line 299, column 0, character 12025:</div><div class='hyps'><div class='hyp compound' level='60'>var <span class='name' varname='9'>S</span> _ <span class='name' varname='10'>VL</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>prune <span class='name' varname='8'>T</span> <span class='name' varname='10'>VL</span>,</div><div class='hyp compound'>prune <span class='name' varname='7'>X</span> <span class='name' varname='10'>VL</span>,</div><div class='hyp compound'>declare_constraint (evar <span class='name' varname='7'>X</span> <span class='name' varname='8'>T</span> <span class='name' varname='9'>S</span>) <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='7'>X</span><b>,</b></div><div class='compound'> <span class='name' varname='9'>S</span></div><b>]</b></div></div></div><div class='concl'><div class='compound'>evar <div class='compound'>(uvar <b>as</b> </div><div class='compound'><span class='name' varname='7'>X</span>)</div> <span class='name' varname='8'>T</span> <span class='name' varname='9'>S</span></div></div></div> +<div class='clause' predicate='evar'><div class='loc'>File "coq-builtin.elpi: default-assign-evar", line 302, column 0, character 12131:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>evar _ _ _</div></div> +<div class='clause' predicate='coq.env.const-opaque?'><div class='loc'>File "coq-builtin.elpi", line 747, column 3, character 30685:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.const-opaque use coq.env.opaque? in place of coq.env.const-opaque?,</div><div class='hyp compound'>coq.env.opaque? <span class='name' varname='11'>C</span></div></div><div class='concl'><div class='compound'>coq.env.const-opaque? <span class='name' varname='11'>C</span></div></div></div> +<div class='clause' predicate='coq.env.const-primitive?'><div class='loc'>File "coq-builtin.elpi", line 754, column 3, character 30933:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.const-primitive use coq.env.primitive? in place of coq.env.const-primitive?,</div><div class='hyp compound'>coq.env.primitive? <span class='name' varname='12'>C</span></div></div><div class='concl'><div class='compound'>coq.env.const-primitive? <span class='name' varname='12'>C</span></div></div></div> +<div class='clause' predicate='coq.env.begin-module'><div class='loc'>File "coq-builtin.elpi", line 835, column 0, character 34271:</div><div class='hyps'>coq.env.begin-module-functor <span class='name' varname='13'>Name</span> <span class='name' varname='14'>MP</span> []</div><div class='concl'><div class='compound'>coq.env.begin-module <span class='name' varname='13'>Name</span> <span class='name' varname='14'>MP</span></div></div></div> +<div class='clause' predicate='coq.env.begin-module-type'><div class='loc'>File "coq-builtin.elpi", line 848, column 0, character 34752:</div><div class='hyps'>coq.env.begin-module-type-functor <span class='name' varname='15'>Name</span> []</div><div class='concl'><div class='compound'>coq.env.begin-module-type <span class='name' varname='15'>Name</span></div></div></div> +<div class='clause' predicate='coq.CS.canonical-projections'><div class='loc'>File "coq-builtin.elpi", line 1205, column 0, character 48653:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.canonical-projections use coq.env.projections in place of coq.CS.canonical-projections,</div><div class='hyp compound'>coq.env.projections <span class='name' varname='16'>I</span> <span class='name' varname='17'>L</span></div></div><div class='concl'><div class='compound'>coq.CS.canonical-projections <span class='name' varname='16'>I</span> <span class='name' varname='17'>L</span></div></div></div> +<div class='clause' predicate='coq.reduction.cbv.whd_all'><div class='loc'>File "coq-builtin.elpi", line 1508, column 0, character 61426:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.cbv-whd-all use coq.reduction.cbv.norm in place of coq.reduction.cbv.whd_all,</div><div class='hyp compound'>coq.reduction.cbv.norm <span class='name' varname='18'>T</span> <span class='name' varname='19'>R</span></div></div><div class='concl'><div class='compound'>coq.reduction.cbv.whd_all <span class='name' varname='18'>T</span> <span class='name' varname='19'>R</span></div></div></div> +<div class='clause' predicate='coq.reduction.vm.whd_all'><div class='loc'>File "coq-builtin.elpi", line 1515, column 0, character 61704:</div><div class='hyps'><div class='hyp compound' level='60'>coq.warning elpi.deprecated elpi.vm-whd-all use coq.reduction.vm.norm in place of coq.reduction.vm.whd_all,</div><div class='hyp compound'>coq.reduction.vm.norm <span class='name' varname='20'>T</span> <span class='name' varname='21'>TY</span> <span class='name' varname='22'>R</span></div></div><div class='concl'><div class='compound'>coq.reduction.vm.whd_all <span class='name' varname='20'>T</span> <span class='name' varname='21'>TY</span> <span class='name' varname='22'>R</span></div></div></div> +<div class='clause' predicate='coq.reduction.lazy.whd_all'><div class='loc'>File "coq-builtin.elpi", line 1522, column 0, character 61938:</div><div class='hyps'><div class='compound'>get-option coq:redflags coq.redflags.all <b>⇒</b> </div><div class='compound'>coq.reduction.lazy.whd <span class='name' varname='23'>X</span> <span class='name' varname='24'>Y</span></div></div><div class='concl'><div class='compound'>coq.reduction.lazy.whd_all <span class='name' varname='23'>X</span> <span class='name' varname='24'>Y</span></div></div></div> +<div class='clause' predicate='coq.id->name'><div class='loc'>File "coq-builtin.elpi", line 1639, column 0, character 66449:</div><div class='hyps'>coq.string->name <span class='name' varname='25'>S</span> <span class='name' varname='26'>N</span></div><div class='concl'><div class='compound'>coq.id->name <span class='name' varname='25'>S</span> <span class='name' varname='26'>N</span></div></div></div> +<div class='clause' predicate='coq.elpi.accumulate'><div class='loc'>File "coq-builtin.elpi", line 1728, column 0, character 69770:</div><div class='hyps'>coq.elpi.accumulate-clauses <span class='name' varname='27'>S</span> <span class='name' varname='28'>N</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='29'>C</span></div><b>]</b></div></div><div class='concl'><div class='compound'>coq.elpi.accumulate <span class='name' varname='27'>S</span> <span class='name' varname='28'>N</span> <span class='name' varname='29'>C</span></div></div></div> <div class='clause' predicate='true'><div class='loc'>File "elpi-builtin.elpi", line 9, column 0, character 89:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>true</div></div> <div class='clause' predicate=';'><div class='loc'>File "elpi-builtin.elpi", line 28, column 0, character 296:</div><div class='hyps'><span class='name' varname='30'>A</span></div><div class='concl'><div class='compound'><div class='compound'>(<span class='name' varname='30'>A</span> ; </div><div class='compound'>_)</div></div></div></div> <div class='clause' predicate=';'><div class='loc'>File "elpi-builtin.elpi", line 30, column 0, character 311:</div><div class='hyps'><span class='name' varname='31'>B</span></div><div class='concl'><div class='compound'><div class='compound'>(_ ; </div><div class='compound'><span class='name' varname='31'>B</span>)</div></div></div></div> <div class='clause' predicate='not'><div class='loc'>File "elpi-builtin.elpi", line 52, column 0, character 609:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='32'>X</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>fail</div></div><div class='concl'><div class='compound'>not <span class='name' varname='32'>X</span></div></div></div> <div class='clause' predicate='not'><div class='loc'>File "elpi-builtin.elpi", line 54, column 0, character 631:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>not _</div></div> <div class='clause' predicate='stop'><div class='loc'>File "elpi-builtin.elpi", line 67, column 0, character 974:</div><div class='hyps'>halt</div><div class='concl'><div class='compound'>stop</div></div></div> -<div class='clause' predicate='is'><div class='loc'>File "elpi-builtin.elpi", line 77, column 0, character 1179:</div><div class='hyps'>calc <span class='name' varname='34'>Y</span> <span class='name' varname='33'>X</span></div><div class='concl'><div class='compound'><div class='compound'><span class='name' varname='33'>X</span> <b>is</b> </div><div class='compound'><span class='name' varname='34'>Y</span></div></div></div></div> -<div class='clause' predicate='>'><div class='loc'>File "elpi-builtin.elpi", line 177, column 0, character 2851:</div><div class='hyps'>gt_ <span class='name' varname='35'>X</span> <span class='name' varname='36'>Y</span></div><div class='concl'><div class='compound'>> <span class='name' varname='35'>X</span> <span class='name' varname='36'>Y</span></div></div></div> -<div class='clause' predicate='<'><div class='loc'>File "elpi-builtin.elpi", line 179, column 0, character 2872:</div><div class='hyps'>lt_ <span class='name' varname='37'>X</span> <span class='name' varname='38'>Y</span></div><div class='concl'><div class='compound'><div class='compound'><span class='name' varname='37'>X</span> < </div><div class='compound'><span class='name' varname='38'>Y</span></div></div></div></div> -<div class='clause' predicate='=<'><div class='loc'>File "elpi-builtin.elpi", line 181, column 0, character 2893:</div><div class='hyps'>le_ <span class='name' varname='39'>X</span> <span class='name' varname='40'>Y</span></div><div class='concl'><div class='compound'>=< <span class='name' varname='39'>X</span> <span class='name' varname='40'>Y</span></div></div></div> -<div class='clause' predicate='>='><div class='loc'>File "elpi-builtin.elpi", line 183, column 0, character 2914:</div><div class='hyps'>ge_ <span class='name' varname='41'>X</span> <span class='name' varname='42'>Y</span></div><div class='concl'><div class='compound'>>= <span class='name' varname='41'>X</span> <span class='name' varname='42'>Y</span></div></div></div> -<div class='clause' predicate='i<'><div class='loc'>File "elpi-builtin.elpi", line 187, column 0, character 2986:</div><div class='hyps'>lt_ <span class='name' varname='43'>X</span> <span class='name' varname='44'>Y</span></div><div class='concl'><div class='compound'>i< <span class='name' varname='43'>X</span> <span class='name' varname='44'>Y</span></div></div></div> -<div class='clause' predicate='i>'><div class='loc'>File "elpi-builtin.elpi", line 189, column 0, character 3007:</div><div class='hyps'>gt_ <span class='name' varname='45'>X</span> <span class='name' varname='46'>Y</span></div><div class='concl'><div class='compound'>i> <span class='name' varname='45'>X</span> <span class='name' varname='46'>Y</span></div></div></div> -<div class='clause' predicate='i=<'><div class='loc'>File "elpi-builtin.elpi", line 191, column 0, character 3028:</div><div class='hyps'>le_ <span class='name' varname='47'>X</span> <span class='name' varname='48'>Y</span></div><div class='concl'><div class='compound'>i=< <span class='name' varname='47'>X</span> <span class='name' varname='48'>Y</span></div></div></div> -<div class='clause' predicate='i>='><div class='loc'>File "elpi-builtin.elpi", line 193, column 0, character 3049:</div><div class='hyps'>ge_ <span class='name' varname='49'>X</span> <span class='name' varname='50'>Y</span></div><div class='concl'><div class='compound'>i>= <span class='name' varname='49'>X</span> <span class='name' varname='50'>Y</span></div></div></div> -<div class='clause' predicate='r<'><div class='loc'>File "elpi-builtin.elpi", line 197, column 0, character 3125:</div><div class='hyps'>lt_ <span class='name' varname='51'>X</span> <span class='name' varname='52'>Y</span></div><div class='concl'><div class='compound'>r< <span class='name' varname='51'>X</span> <span class='name' varname='52'>Y</span></div></div></div> -<div class='clause' predicate='r>'><div class='loc'>File "elpi-builtin.elpi", line 199, column 0, character 3146:</div><div class='hyps'>gt_ <span class='name' varname='53'>X</span> <span class='name' varname='54'>Y</span></div><div class='concl'><div class='compound'>r> <span class='name' varname='53'>X</span> <span class='name' varname='54'>Y</span></div></div></div> -<div class='clause' predicate='r=<'><div class='loc'>File "elpi-builtin.elpi", line 201, column 0, character 3167:</div><div class='hyps'>le_ <span class='name' varname='55'>X</span> <span class='name' varname='56'>Y</span></div><div class='concl'><div class='compound'>r=< <span class='name' varname='55'>X</span> <span class='name' varname='56'>Y</span></div></div></div> -<div class='clause' predicate='r>='><div class='loc'>File "elpi-builtin.elpi", line 203, column 0, character 3188:</div><div class='hyps'>ge_ <span class='name' varname='57'>X</span> <span class='name' varname='58'>Y</span></div><div class='concl'><div class='compound'>r>= <span class='name' varname='57'>X</span> <span class='name' varname='58'>Y</span></div></div></div> -<div class='clause' predicate='s<'><div class='loc'>File "elpi-builtin.elpi", line 207, column 0, character 3266:</div><div class='hyps'>lt_ <span class='name' varname='59'>X</span> <span class='name' varname='60'>Y</span></div><div class='concl'><div class='compound'>s< <span class='name' varname='59'>X</span> <span class='name' varname='60'>Y</span></div></div></div> -<div class='clause' predicate='s>'><div class='loc'>File "elpi-builtin.elpi", line 209, column 0, character 3287:</div><div class='hyps'>gt_ <span class='name' varname='61'>X</span> <span class='name' varname='62'>Y</span></div><div class='concl'><div class='compound'>s> <span class='name' varname='61'>X</span> <span class='name' varname='62'>Y</span></div></div></div> -<div class='clause' predicate='s=<'><div class='loc'>File "elpi-builtin.elpi", line 211, column 0, character 3308:</div><div class='hyps'>le_ <span class='name' varname='63'>X</span> <span class='name' varname='64'>Y</span></div><div class='concl'><div class='compound'>s=< <span class='name' varname='63'>X</span> <span class='name' varname='64'>Y</span></div></div></div> -<div class='clause' predicate='s>='><div class='loc'>File "elpi-builtin.elpi", line 213, column 0, character 3329:</div><div class='hyps'>ge_ <span class='name' varname='65'>X</span> <span class='name' varname='66'>Y</span></div><div class='concl'><div class='compound'>s>= <span class='name' varname='65'>X</span> <span class='name' varname='66'>Y</span></div></div></div> -<div class='clause' predicate='fst'><div class='loc'>File "elpi-builtin.elpi", line 234, column 0, character 3739:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>fst (pr <span class='name' varname='67'>A</span> _) <span class='name' varname='67'>A</span></div></div> -<div class='clause' predicate='snd'><div class='loc'>File "elpi-builtin.elpi", line 238, column 0, character 3784:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>snd (pr _ <span class='name' varname='68'>B</span>) <span class='name' varname='68'>B</span></div></div> -<div class='clause' predicate='counter'><div class='loc'>File "elpi-builtin.elpi", line 266, column 0, character 4422:</div><div class='hyps'>trace.counter <span class='name' varname='69'>C</span> <span class='name' varname='70'>N</span></div><div class='concl'><div class='compound'>counter <span class='name' varname='69'>C</span> <span class='name' varname='70'>N</span></div></div></div> -<div class='clause' predicate='rex_match'><div class='loc'>File "elpi-builtin.elpi", line 297, column 0, character 5578:</div><div class='hyps'>rex.match <span class='name' varname='71'>Rx</span> <span class='name' varname='72'>S</span></div><div class='concl'><div class='compound'>rex_match <span class='name' varname='71'>Rx</span> <span class='name' varname='72'>S</span></div></div></div> -<div class='clause' predicate='rex_replace'><div class='loc'>File "elpi-builtin.elpi", line 301, column 0, character 5700:</div><div class='hyps'>rex.replace <span class='name' varname='73'>Rx</span> <span class='name' varname='74'>R</span> <span class='name' varname='75'>S</span> <span class='name' varname='76'>O</span></div><div class='concl'><div class='compound'>rex_replace <span class='name' varname='73'>Rx</span> <span class='name' varname='74'>R</span> <span class='name' varname='75'>S</span> <span class='name' varname='76'>O</span></div></div></div> -<div class='clause' predicate='rex_split'><div class='loc'>File "elpi-builtin.elpi", line 305, column 0, character 5825:</div><div class='hyps'>rex.split <span class='name' varname='77'>Rx</span> <span class='name' varname='78'>S</span> <span class='name' varname='79'>L</span></div><div class='concl'><div class='compound'>rex_split <span class='name' varname='77'>Rx</span> <span class='name' varname='78'>S</span> <span class='name' varname='79'>L</span></div></div></div> -<div class='clause' predicate='=='><div class='loc'>File "elpi-builtin.elpi", line 339, column 0, character 7053:</div><div class='hyps'>same_term <span class='name' varname='80'>X</span> <span class='name' varname='81'>Y</span></div><div class='concl'><div class='compound'>== <span class='name' varname='80'>X</span> <span class='name' varname='81'>Y</span></div></div></div> -<div class='clause' predicate='primitive?'><div class='loc'>File "elpi-builtin.elpi", line 373, column 0, character 8239:</div><div class='hyps'>is_cdata <span class='name' varname='82'>X</span> (ctype <span class='name' varname='83'>S</span>)</div><div class='concl'><div class='compound'>primitive? <span class='name' varname='82'>X</span> <span class='name' varname='83'>S</span></div></div></div> -<div class='clause' predicate='if'><div class='loc'>File "elpi-builtin.elpi", line 404, column 0, character 9204:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='84'>B</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><span class='name' varname='85'>T</span></div></div><div class='concl'><div class='compound'>if <span class='name' varname='84'>B</span> <span class='name' varname='85'>T</span> _</div></div></div> -<div class='clause' predicate='if'><div class='loc'>File "elpi-builtin.elpi", line 405, column 0, character 9225:</div><div class='hyps'><span class='name' varname='86'>E</span></div><div class='concl'><div class='compound'>if _ _ <span class='name' varname='86'>E</span></div></div></div> -<div class='clause' predicate='if2'><div class='loc'>File "elpi-builtin.elpi", line 409, column 0, character 9368:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='87'>G<sub>1</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><span class='name' varname='88'>P<sub>1</sub></span></div></div><div class='concl'><div class='compound'>if2 <span class='name' varname='87'>G<sub>1</sub></span> <span class='name' varname='88'>P<sub>1</sub></span> _ _ _</div></div></div> -<div class='clause' predicate='if2'><div class='loc'>File "elpi-builtin.elpi", line 410, column 0, character 9400:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='89'>G<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><span class='name' varname='90'>P<sub>2</sub></span></div></div><div class='concl'><div class='compound'>if2 _ _ <span class='name' varname='89'>G<sub>2</sub></span> <span class='name' varname='90'>P<sub>2</sub></span> _</div></div></div> -<div class='clause' predicate='if2'><div class='loc'>File "elpi-builtin.elpi", line 411, column 0, character 9432:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='91'>E</span></div></div><div class='concl neckcut'><div class='compound'>if2 _ _ _ _ <span class='name' varname='91'>E</span></div></div></div> +<div class='clause' predicate='is'><div class='loc'>File "elpi-builtin.elpi", line 73, column 0, character 1031:</div><div class='hyps'>calc <span class='name' varname='34'>Y</span> <span class='name' varname='33'>X</span></div><div class='concl'><div class='compound'><div class='compound'><span class='name' varname='33'>X</span> <b>is</b> </div><div class='compound'><span class='name' varname='34'>Y</span></div></div></div></div> +<div class='clause' predicate='>'><div class='loc'>File "elpi-builtin.elpi", line 173, column 0, character 2867:</div><div class='hyps'>gt_ <span class='name' varname='35'>X</span> <span class='name' varname='36'>Y</span></div><div class='concl'><div class='compound'>> <span class='name' varname='35'>X</span> <span class='name' varname='36'>Y</span></div></div></div> +<div class='clause' predicate='<'><div class='loc'>File "elpi-builtin.elpi", line 175, column 0, character 2888:</div><div class='hyps'>lt_ <span class='name' varname='37'>X</span> <span class='name' varname='38'>Y</span></div><div class='concl'><div class='compound'><div class='compound'><span class='name' varname='37'>X</span> < </div><div class='compound'><span class='name' varname='38'>Y</span></div></div></div></div> +<div class='clause' predicate='=<'><div class='loc'>File "elpi-builtin.elpi", line 177, column 0, character 2909:</div><div class='hyps'>le_ <span class='name' varname='39'>X</span> <span class='name' varname='40'>Y</span></div><div class='concl'><div class='compound'>=< <span class='name' varname='39'>X</span> <span class='name' varname='40'>Y</span></div></div></div> +<div class='clause' predicate='>='><div class='loc'>File "elpi-builtin.elpi", line 179, column 0, character 2930:</div><div class='hyps'>ge_ <span class='name' varname='41'>X</span> <span class='name' varname='42'>Y</span></div><div class='concl'><div class='compound'>>= <span class='name' varname='41'>X</span> <span class='name' varname='42'>Y</span></div></div></div> +<div class='clause' predicate='i<'><div class='loc'>File "elpi-builtin.elpi", line 183, column 0, character 3002:</div><div class='hyps'>lt_ <span class='name' varname='43'>X</span> <span class='name' varname='44'>Y</span></div><div class='concl'><div class='compound'>i< <span class='name' varname='43'>X</span> <span class='name' varname='44'>Y</span></div></div></div> +<div class='clause' predicate='i>'><div class='loc'>File "elpi-builtin.elpi", line 185, column 0, character 3023:</div><div class='hyps'>gt_ <span class='name' varname='45'>X</span> <span class='name' varname='46'>Y</span></div><div class='concl'><div class='compound'>i> <span class='name' varname='45'>X</span> <span class='name' varname='46'>Y</span></div></div></div> +<div class='clause' predicate='i=<'><div class='loc'>File "elpi-builtin.elpi", line 187, column 0, character 3044:</div><div class='hyps'>le_ <span class='name' varname='47'>X</span> <span class='name' varname='48'>Y</span></div><div class='concl'><div class='compound'>i=< <span class='name' varname='47'>X</span> <span class='name' varname='48'>Y</span></div></div></div> +<div class='clause' predicate='i>='><div class='loc'>File "elpi-builtin.elpi", line 189, column 0, character 3065:</div><div class='hyps'>ge_ <span class='name' varname='49'>X</span> <span class='name' varname='50'>Y</span></div><div class='concl'><div class='compound'>i>= <span class='name' varname='49'>X</span> <span class='name' varname='50'>Y</span></div></div></div> +<div class='clause' predicate='r<'><div class='loc'>File "elpi-builtin.elpi", line 193, column 0, character 3141:</div><div class='hyps'>lt_ <span class='name' varname='51'>X</span> <span class='name' varname='52'>Y</span></div><div class='concl'><div class='compound'>r< <span class='name' varname='51'>X</span> <span class='name' varname='52'>Y</span></div></div></div> +<div class='clause' predicate='r>'><div class='loc'>File "elpi-builtin.elpi", line 195, column 0, character 3162:</div><div class='hyps'>gt_ <span class='name' varname='53'>X</span> <span class='name' varname='54'>Y</span></div><div class='concl'><div class='compound'>r> <span class='name' varname='53'>X</span> <span class='name' varname='54'>Y</span></div></div></div> +<div class='clause' predicate='r=<'><div class='loc'>File "elpi-builtin.elpi", line 197, column 0, character 3183:</div><div class='hyps'>le_ <span class='name' varname='55'>X</span> <span class='name' varname='56'>Y</span></div><div class='concl'><div class='compound'>r=< <span class='name' varname='55'>X</span> <span class='name' varname='56'>Y</span></div></div></div> +<div class='clause' predicate='r>='><div class='loc'>File "elpi-builtin.elpi", line 199, column 0, character 3204:</div><div class='hyps'>ge_ <span class='name' varname='57'>X</span> <span class='name' varname='58'>Y</span></div><div class='concl'><div class='compound'>r>= <span class='name' varname='57'>X</span> <span class='name' varname='58'>Y</span></div></div></div> +<div class='clause' predicate='s<'><div class='loc'>File "elpi-builtin.elpi", line 203, column 0, character 3282:</div><div class='hyps'>lt_ <span class='name' varname='59'>X</span> <span class='name' varname='60'>Y</span></div><div class='concl'><div class='compound'>s< <span class='name' varname='59'>X</span> <span class='name' varname='60'>Y</span></div></div></div> +<div class='clause' predicate='s>'><div class='loc'>File "elpi-builtin.elpi", line 205, column 0, character 3303:</div><div class='hyps'>gt_ <span class='name' varname='61'>X</span> <span class='name' varname='62'>Y</span></div><div class='concl'><div class='compound'>s> <span class='name' varname='61'>X</span> <span class='name' varname='62'>Y</span></div></div></div> +<div class='clause' predicate='s=<'><div class='loc'>File "elpi-builtin.elpi", line 207, column 0, character 3324:</div><div class='hyps'>le_ <span class='name' varname='63'>X</span> <span class='name' varname='64'>Y</span></div><div class='concl'><div class='compound'>s=< <span class='name' varname='63'>X</span> <span class='name' varname='64'>Y</span></div></div></div> +<div class='clause' predicate='s>='><div class='loc'>File "elpi-builtin.elpi", line 209, column 0, character 3345:</div><div class='hyps'>ge_ <span class='name' varname='65'>X</span> <span class='name' varname='66'>Y</span></div><div class='concl'><div class='compound'>s>= <span class='name' varname='65'>X</span> <span class='name' varname='66'>Y</span></div></div></div> +<div class='clause' predicate='fst'><div class='loc'>File "elpi-builtin.elpi", line 230, column 0, character 3755:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>fst (pr <span class='name' varname='67'>A</span> _) <span class='name' varname='67'>A</span></div></div> +<div class='clause' predicate='snd'><div class='loc'>File "elpi-builtin.elpi", line 234, column 0, character 3800:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>snd (pr _ <span class='name' varname='68'>B</span>) <span class='name' varname='68'>B</span></div></div> +<div class='clause' predicate='counter'><div class='loc'>File "elpi-builtin.elpi", line 262, column 0, character 4438:</div><div class='hyps'>trace.counter <span class='name' varname='69'>C</span> <span class='name' varname='70'>N</span></div><div class='concl'><div class='compound'>counter <span class='name' varname='69'>C</span> <span class='name' varname='70'>N</span></div></div></div> +<div class='clause' predicate='rex_match'><div class='loc'>File "elpi-builtin.elpi", line 293, column 0, character 5594:</div><div class='hyps'>rex.match <span class='name' varname='71'>Rx</span> <span class='name' varname='72'>S</span></div><div class='concl'><div class='compound'>rex_match <span class='name' varname='71'>Rx</span> <span class='name' varname='72'>S</span></div></div></div> +<div class='clause' predicate='rex_replace'><div class='loc'>File "elpi-builtin.elpi", line 297, column 0, character 5716:</div><div class='hyps'>rex.replace <span class='name' varname='73'>Rx</span> <span class='name' varname='74'>R</span> <span class='name' varname='75'>S</span> <span class='name' varname='76'>O</span></div><div class='concl'><div class='compound'>rex_replace <span class='name' varname='73'>Rx</span> <span class='name' varname='74'>R</span> <span class='name' varname='75'>S</span> <span class='name' varname='76'>O</span></div></div></div> +<div class='clause' predicate='rex_split'><div class='loc'>File "elpi-builtin.elpi", line 301, column 0, character 5841:</div><div class='hyps'>rex.split <span class='name' varname='77'>Rx</span> <span class='name' varname='78'>S</span> <span class='name' varname='79'>L</span></div><div class='concl'><div class='compound'>rex_split <span class='name' varname='77'>Rx</span> <span class='name' varname='78'>S</span> <span class='name' varname='79'>L</span></div></div></div> +<div class='clause' predicate='=='><div class='loc'>File "elpi-builtin.elpi", line 335, column 0, character 7069:</div><div class='hyps'>same_term <span class='name' varname='80'>X</span> <span class='name' varname='81'>Y</span></div><div class='concl'><div class='compound'>== <span class='name' varname='80'>X</span> <span class='name' varname='81'>Y</span></div></div></div> +<div class='clause' predicate='primitive?'><div class='loc'>File "elpi-builtin.elpi", line 369, column 0, character 8255:</div><div class='hyps'>is_cdata <span class='name' varname='82'>X</span> (ctype <span class='name' varname='83'>S</span>)</div><div class='concl'><div class='compound'>primitive? <span class='name' varname='82'>X</span> <span class='name' varname='83'>S</span></div></div></div> +<div class='clause' predicate='if'><div class='loc'>File "elpi-builtin.elpi", line 400, column 0, character 9220:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='84'>B</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><span class='name' varname='85'>T</span></div></div><div class='concl'><div class='compound'>if <span class='name' varname='84'>B</span> <span class='name' varname='85'>T</span> _</div></div></div> +<div class='clause' predicate='if'><div class='loc'>File "elpi-builtin.elpi", line 401, column 0, character 9241:</div><div class='hyps'><span class='name' varname='86'>E</span></div><div class='concl'><div class='compound'>if _ _ <span class='name' varname='86'>E</span></div></div></div> +<div class='clause' predicate='if2'><div class='loc'>File "elpi-builtin.elpi", line 405, column 0, character 9384:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='87'>G<sub>1</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><span class='name' varname='88'>P<sub>1</sub></span></div></div><div class='concl'><div class='compound'>if2 <span class='name' varname='87'>G<sub>1</sub></span> <span class='name' varname='88'>P<sub>1</sub></span> _ _ _</div></div></div> +<div class='clause' predicate='if2'><div class='loc'>File "elpi-builtin.elpi", line 406, column 0, character 9416:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='89'>G<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><span class='name' varname='90'>P<sub>2</sub></span></div></div><div class='concl'><div class='compound'>if2 _ _ <span class='name' varname='89'>G<sub>2</sub></span> <span class='name' varname='90'>P<sub>2</sub></span> _</div></div></div> +<div class='clause' predicate='if2'><div class='loc'>File "elpi-builtin.elpi", line 407, column 0, character 9448:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='91'>E</span></div></div><div class='concl neckcut'><div class='compound'>if2 _ _ _ _ <span class='name' varname='91'>E</span></div></div></div> <div class='clause' predicate='std.fatal-error'><div class='loc'>File "builtin_stdlib.elpi: default-fatal-error", line 16, column 0, character 659:</div><div class='hyps'>halt <span class='name' varname='92'>Msg</span></div><div class='concl'><div class='compound'>std.fatal-error <span class='name' varname='92'>Msg</span></div></div></div> <div class='clause' predicate='std.fatal-error-w-data'><div class='loc'>File "builtin_stdlib.elpi: default-fatal-error-w-data", line 20, column 0, character 756:</div><div class='hyps'>halt <span class='name' varname='93'>Msg</span> : <span class='name' varname='94'>Data</span></div><div class='concl'><div class='compound'>std.fatal-error-w-data <span class='name' varname='93'>Msg</span> <span class='name' varname='94'>Data</span></div></div></div> <div class='clause' predicate='std.debug-print'><div class='loc'>File "builtin_stdlib.elpi: default-debug-print", line 24, column 0, character 874:</div><div class='hyps'>print <span class='name' varname='95'>Msg</span> <span class='name' varname='96'>Data</span></div><div class='concl'><div class='compound'>std.debug-print <span class='name' varname='95'>Msg</span> <span class='name' varname='96'>Data</span></div></div></div> @@ -208,172 +208,174 @@ <h1>stlc.html</h1> <div class='clause' predicate='std.split-at'><div class='loc'>File "builtin_stdlib.elpi", line 110, column 0, character 3550:</div><div class='hyps'>std.fatal-error split-at run out of list items</div><div class='concl'><div class='compound'>std.split-at _ _ _ _</div></div></div> <div class='clause' predicate='std.fold'><div class='loc'>File "builtin_stdlib.elpi", line 113, column 0, character 3672:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.fold [] <span class='name' varname='162'>A</span> _ <span class='name' varname='162'>A</span></div></div> <div class='clause' predicate='std.fold'><div class='loc'>File "builtin_stdlib.elpi", line 114, column 0, character 3687:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='166'>F</span> <span class='name' varname='163'>X</span> <span class='name' varname='165'>A</span> <span class='name' varname='168'>A<sub>1</sub></span>,</div><div class='hyp compound'>std.fold <span class='name' varname='164'>XS</span> <span class='name' varname='168'>A<sub>1</sub></span> <span class='name' varname='166'>F</span> <span class='name' varname='167'>R</span></div></div><div class='concl'><div class='compound'>std.fold <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='163'>X</span> <b>|</b> <span class='name' varname='164'>XS</span></div><b>]</b></div> <span class='name' varname='165'>A</span> <span class='name' varname='166'>F</span> <span class='name' varname='167'>R</span></div></div></div> -<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 117, column 0, character 3806:</div><div class='hyps'>std.fatal-error fold2 on lists of different length</div><div class='concl'><div class='compound'>std.fold2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _ _ _</div></div></div> -<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 118, column 0, character 3880:</div><div class='hyps'>std.fatal-error fold2 on lists of different length</div><div class='concl'><div class='compound'>std.fold2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _ _ _</div></div></div> -<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 119, column 0, character 3954:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.fold2 [] [] <span class='name' varname='169'>A</span> _ <span class='name' varname='169'>A</span></div></div> -<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 120, column 0, character 3973:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='175'>F</span> <span class='name' varname='170'>X</span> <span class='name' varname='172'>Y</span> <span class='name' varname='174'>A</span> <span class='name' varname='177'>A<sub>1</sub></span>,</div><div class='hyp compound'>std.fold2 <span class='name' varname='171'>XS</span> <span class='name' varname='173'>YS</span> <span class='name' varname='177'>A<sub>1</sub></span> <span class='name' varname='175'>F</span> <span class='name' varname='176'>R</span></div></div><div class='concl'><div class='compound'>std.fold2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='170'>X</span> <b>|</b> <span class='name' varname='171'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='172'>Y</span> <b>|</b> <span class='name' varname='173'>YS</span></div><b>]</b></div> <span class='name' varname='174'>A</span> <span class='name' varname='175'>F</span> <span class='name' varname='176'>R</span></div></div></div> -<div class='clause' predicate='std.map'><div class='loc'>File "builtin_stdlib.elpi", line 123, column 0, character 4084:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map [] _ []</div></div> -<div class='clause' predicate='std.map'><div class='loc'>File "builtin_stdlib.elpi", line 124, column 0, character 4097:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='180'>F</span> <span class='name' varname='178'>X</span> <span class='name' varname='181'>Y</span>,</div><div class='hyp compound'>std.map <span class='name' varname='179'>XS</span> <span class='name' varname='180'>F</span> <span class='name' varname='182'>YS</span></div></div><div class='concl'><div class='compound'>std.map <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='178'>X</span> <b>|</b> <span class='name' varname='179'>XS</span></div><b>]</b></div> <span class='name' varname='180'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='181'>Y</span> <b>|</b> <span class='name' varname='182'>YS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.map-i'><div class='loc'>File "builtin_stdlib.elpi", line 127, column 0, character 4199:</div><div class='hyps'>std.map-i.aux <span class='name' varname='183'>L</span> 0 <span class='name' varname='184'>F</span> <span class='name' varname='185'>R</span></div><div class='concl'><div class='compound'>std.map-i <span class='name' varname='183'>L</span> <span class='name' varname='184'>F</span> <span class='name' varname='185'>R</span></div></div></div> -<div class='clause' predicate='std.map-i.aux'><div class='loc'>File "builtin_stdlib.elpi", line 128, column 0, character 4233:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map-i.aux [] _ _ []</div></div> -<div class='clause' predicate='std.map-i.aux'><div class='loc'>File "builtin_stdlib.elpi", line 129, column 0, character 4254:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='189'>F</span> <span class='name' varname='188'>N</span> <span class='name' varname='186'>X</span> <span class='name' varname='190'>Y</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='192'>M</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='188'>N</span> + </div><div class='compound'>1,</div></div></div><div class='hyp compound'>std.map-i.aux <span class='name' varname='187'>XS</span> <span class='name' varname='192'>M</span> <span class='name' varname='189'>F</span> <span class='name' varname='191'>YS</span></div></div><div class='concl'><div class='compound'>std.map-i.aux <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='186'>X</span> <b>|</b> <span class='name' varname='187'>XS</span></div><b>]</b></div> <span class='name' varname='188'>N</span> <span class='name' varname='189'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='190'>Y</span> <b>|</b> <span class='name' varname='191'>YS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.map-filter'><div class='loc'>File "builtin_stdlib.elpi", line 132, column 0, character 4384:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map-filter [] _ []</div></div> -<div class='clause' predicate='std.map-filter'><div class='loc'>File "builtin_stdlib.elpi", line 133, column 0, character 4404:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='195'>F</span> <span class='name' varname='193'>X</span> <span class='name' varname='196'>Y</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.map-filter <span class='name' varname='194'>XS</span> <span class='name' varname='195'>F</span> <span class='name' varname='197'>YS</span></div></div><div class='concl'><div class='compound'>std.map-filter <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='193'>X</span> <b>|</b> <span class='name' varname='194'>XS</span></div><b>]</b></div> <span class='name' varname='195'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='196'>Y</span> <b>|</b> <span class='name' varname='197'>YS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.map-filter'><div class='loc'>File "builtin_stdlib.elpi", line 134, column 0, character 4464:</div><div class='hyps'>std.map-filter <span class='name' varname='198'>XS</span> <span class='name' varname='199'>F</span> <span class='name' varname='200'>YS</span></div><div class='concl'><div class='compound'>std.map-filter <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='198'>XS</span></div><b>]</b></div> <span class='name' varname='199'>F</span> <span class='name' varname='200'>YS</span></div></div></div> -<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 138, column 0, character 4588:</div><div class='hyps'>std.fatal-error map2 on lists of different length</div><div class='concl'><div class='compound'>std.map2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _ _</div></div></div> -<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 139, column 0, character 4658:</div><div class='hyps'>std.fatal-error map2 on lists of different length</div><div class='concl'><div class='compound'>std.map2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _ _</div></div></div> -<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 140, column 0, character 4728:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map2 [] [] _ []</div></div> -<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 141, column 0, character 4745:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='205'>F</span> <span class='name' varname='201'>X</span> <span class='name' varname='203'>Y</span> <span class='name' varname='206'>Z</span>,</div><div class='hyp compound'>std.map2 <span class='name' varname='202'>XS</span> <span class='name' varname='204'>YS</span> <span class='name' varname='205'>F</span> <span class='name' varname='207'>ZS</span></div></div><div class='concl'><div class='compound'>std.map2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='201'>X</span> <b>|</b> <span class='name' varname='202'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='203'>Y</span> <b>|</b> <span class='name' varname='204'>YS</span></div><b>]</b></div> <span class='name' varname='205'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='206'>Z</span> <b>|</b> <span class='name' varname='207'>ZS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 144, column 0, character 4875:</div><div class='hyps'>std.fatal-error map2-filter on lists of different length</div><div class='concl'><div class='compound'>std.map2-filter [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _ _</div></div></div> -<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 145, column 0, character 4959:</div><div class='hyps'>std.fatal-error map2-filter on lists of different length</div><div class='concl'><div class='compound'>std.map2-filter <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _ _</div></div></div> -<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 146, column 0, character 5043:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map2-filter [] [] _ []</div></div> -<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 147, column 0, character 5067:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='212'>F</span> <span class='name' varname='208'>X</span> <span class='name' varname='210'>Y</span> <span class='name' varname='213'>Z</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.map2-filter <span class='name' varname='209'>XS</span> <span class='name' varname='211'>YS</span> <span class='name' varname='212'>F</span> <span class='name' varname='214'>ZS</span></div></div><div class='concl'><div class='compound'>std.map2-filter <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='208'>X</span> <b>|</b> <span class='name' varname='209'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='210'>Y</span> <b>|</b> <span class='name' varname='211'>YS</span></div><b>]</b></div> <span class='name' varname='212'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='213'>Z</span> <b>|</b> <span class='name' varname='214'>ZS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 148, column 0, character 5141:</div><div class='hyps'>std.map2-filter <span class='name' varname='215'>XS</span> <span class='name' varname='216'>YS</span> <span class='name' varname='217'>F</span> <span class='name' varname='218'>ZS</span></div><div class='concl'><div class='compound'>std.map2-filter <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='215'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='216'>YS</span></div><b>]</b></div> <span class='name' varname='217'>F</span> <span class='name' varname='218'>ZS</span></div></div></div> -<div class='clause' predicate='std.map-ok'><div class='loc'>File "builtin_stdlib.elpi", line 151, column 0, character 5280:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='221'>P</span> <span class='name' varname='219'>X</span> <span class='name' varname='222'>Y</span> <span class='name' varname='225'>S<sub>0</sub></span>,</div><div class='hyp compound'>if <div class='compound'>(<span class='name' varname='225'>S<sub>0</sub></span> = </div><div class='compound'>ok)</div> (std.map-ok <span class='name' varname='220'>L</span> <span class='name' varname='221'>P</span> <span class='name' varname='223'>YS</span> <span class='name' varname='224'>S</span>) <div class='compound'>(<span class='name' varname='224'>S</span> = </div><div class='compound'><span class='name' varname='225'>S<sub>0</sub></span>)</div></div></div><div class='concl'><div class='compound'>std.map-ok <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='219'>X</span> <b>|</b> <span class='name' varname='220'>L</span></div><b>]</b></div> <span class='name' varname='221'>P</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='222'>Y</span> <b>|</b> <span class='name' varname='223'>YS</span></div><b>]</b></div> <span class='name' varname='224'>S</span></div></div></div> -<div class='clause' predicate='std.map-ok'><div class='loc'>File "builtin_stdlib.elpi", line 152, column 0, character 5358:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map-ok [] _ [] ok</div></div> -<div class='clause' predicate='std.fold-map'><div class='loc'>File "builtin_stdlib.elpi", line 155, column 0, character 5452:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.fold-map [] <span class='name' varname='226'>A</span> _ [] <span class='name' varname='226'>A</span></div></div> -<div class='clause' predicate='std.fold-map'><div class='loc'>File "builtin_stdlib.elpi", line 156, column 0, character 5474:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='230'>F</span> <span class='name' varname='227'>X</span> <span class='name' varname='229'>A</span> <span class='name' varname='231'>Y</span> <span class='name' varname='234'>A<sub>1</sub></span>,</div><div class='hyp compound'>std.fold-map <span class='name' varname='228'>XS</span> <span class='name' varname='234'>A<sub>1</sub></span> <span class='name' varname='230'>F</span> <span class='name' varname='232'>YS</span> <span class='name' varname='233'>A<sub>2</sub></span></div></div><div class='concl'><div class='compound'>std.fold-map <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='227'>X</span> <b>|</b> <span class='name' varname='228'>XS</span></div><b>]</b></div> <span class='name' varname='229'>A</span> <span class='name' varname='230'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='231'>Y</span> <b>|</b> <span class='name' varname='232'>YS</span></div><b>]</b></div> <span class='name' varname='233'>A<sub>2</sub></span></div></div></div> -<div class='clause' predicate='std.omap'><div class='loc'>File "builtin_stdlib.elpi", line 159, column 0, character 5598:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.omap none _ none</div></div> -<div class='clause' predicate='std.omap'><div class='loc'>File "builtin_stdlib.elpi", line 160, column 0, character 5616:</div><div class='hyps'><span class='name' varname='236'>F</span> <span class='name' varname='235'>X</span> <span class='name' varname='237'>Y</span></div><div class='concl'><div class='compound'>std.omap (some <span class='name' varname='235'>X</span>) <span class='name' varname='236'>F</span> (some <span class='name' varname='237'>Y</span>)</div></div></div> -<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 164, column 0, character 5756:</div><div class='hyps'><div class='hyp compound' level='60'><div class='compound'><span class='name' varname='238'>X</span> = </div><div class='compound'><span class='name' varname='239'>R</span></div></div></div><div class='concl neckcut'><div class='compound'>std.nth 0 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='238'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='239'>R</span></div></div></div> -<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 165, column 0, character 5784:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='240'>N</span> 0,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='243'>N<sub>1</sub></span> <b>is</b> </div><div class='compound'>- <span class='name' varname='240'>N</span> 1,</div></div><div class='hyp compound'>std.nth <span class='name' varname='243'>N<sub>1</sub></span> <span class='name' varname='241'>XS</span> <span class='name' varname='242'>R</span></div></div><div class='concl'><div class='compound'>std.nth <span class='name' varname='240'>N</span> <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='241'>XS</span></div><b>]</b></div> <span class='name' varname='242'>R</span></div></div></div> -<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 166, column 0, character 5838:</div><div class='hyps'><div class='hyp compound' level='60'><div class='compound'><span class='name' varname='244'>N</span> < </div><div class='compound'>0,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.fatal-error nth got a negative index</div></div><div class='concl'><div class='compound'>std.nth <span class='name' varname='244'>N</span> _ _</div></div></div> -<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 167, column 0, character 5901:</div><div class='hyps'>std.fatal-error nth run out of list items</div><div class='concl'><div class='compound'>std.nth _ _ _</div></div></div> -<div class='clause' predicate='std.lookup'><div class='loc'>File "builtin_stdlib.elpi", line 171, column 0, character 6042:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.lookup <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='245'>X</span> <span class='name' varname='246'>Y</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='245'>X</span> <span class='name' varname='246'>Y</span></div></div> -<div class='clause' predicate='std.lookup'><div class='loc'>File "builtin_stdlib.elpi", line 172, column 0, character 6065:</div><div class='hyps'>std.lookup <span class='name' varname='247'>LS</span> <span class='name' varname='248'>X</span> <span class='name' varname='249'>Y</span></div><div class='concl'><div class='compound'>std.lookup <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='247'>LS</span></div><b>]</b></div> <span class='name' varname='248'>X</span> <span class='name' varname='249'>Y</span></div></div></div> -<div class='clause' predicate='std.lookup!'><div class='loc'>File "builtin_stdlib.elpi", line 176, column 0, character 6224:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.lookup! <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='250'>X</span> <span class='name' varname='251'>Y</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='250'>X</span> <span class='name' varname='251'>Y</span></div></div></div> -<div class='clause' predicate='std.lookup!'><div class='loc'>File "builtin_stdlib.elpi", line 177, column 0, character 6253:</div><div class='hyps'>std.lookup! <span class='name' varname='252'>LS</span> <span class='name' varname='253'>X</span> <span class='name' varname='254'>Y</span></div><div class='concl'><div class='compound'>std.lookup! <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='252'>LS</span></div><b>]</b></div> <span class='name' varname='253'>X</span> <span class='name' varname='254'>Y</span></div></div></div> -<div class='clause' predicate='std.mem!'><div class='loc'>File "builtin_stdlib.elpi", line 181, column 0, character 6372:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.mem! <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='255'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='255'>X</span></div></div></div> -<div class='clause' predicate='std.mem!'><div class='loc'>File "builtin_stdlib.elpi", line 182, column 0, character 6391:</div><div class='hyps'>std.mem! <span class='name' varname='256'>L</span> <span class='name' varname='257'>X</span></div><div class='concl'><div class='compound'>std.mem! <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='256'>L</span></div><b>]</b></div> <span class='name' varname='257'>X</span></div></div></div> -<div class='clause' predicate='std.mem'><div class='loc'>File "builtin_stdlib.elpi", line 186, column 0, character 6496:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.mem <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='258'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='258'>X</span></div></div> -<div class='clause' predicate='std.mem'><div class='loc'>File "builtin_stdlib.elpi", line 187, column 0, character 6509:</div><div class='hyps'>std.mem <span class='name' varname='259'>L</span> <span class='name' varname='260'>X</span></div><div class='concl'><div class='compound'>std.mem <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='259'>L</span></div><b>]</b></div> <span class='name' varname='260'>X</span></div></div></div> -<div class='clause' predicate='std.exists'><div class='loc'>File "builtin_stdlib.elpi", line 190, column 0, character 6571:</div><div class='hyps'><span class='name' varname='262'>P</span> <span class='name' varname='261'>X</span></div><div class='concl'><div class='compound'>std.exists <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='261'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='262'>P</span></div></div></div> -<div class='clause' predicate='std.exists'><div class='loc'>File "builtin_stdlib.elpi", line 191, column 0, character 6594:</div><div class='hyps'>std.exists <span class='name' varname='263'>L</span> <span class='name' varname='264'>P</span></div><div class='concl'><div class='compound'>std.exists <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='263'>L</span></div><b>]</b></div> <span class='name' varname='264'>P</span></div></div></div> -<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 194, column 0, character 6678:</div><div class='hyps'>std.fatal-error exists2 on lists of different length</div><div class='concl'><div class='compound'>std.exists2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _</div></div></div> -<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 195, column 0, character 6752:</div><div class='hyps'>std.fatal-error exists2 on lists of different length</div><div class='concl'><div class='compound'>std.exists2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _</div></div></div> -<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 196, column 0, character 6826:</div><div class='hyps'><span class='name' varname='267'>P</span> <span class='name' varname='265'>X</span> <span class='name' varname='266'>Y</span></div><div class='concl'><div class='compound'>std.exists2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='265'>X</span> <b>|</b> _</div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='266'>Y</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='267'>P</span></div></div></div> -<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 197, column 0, character 6858:</div><div class='hyps'>std.exists2 <span class='name' varname='268'>L</span> <span class='name' varname='269'>M</span> <span class='name' varname='270'>P</span></div><div class='concl'><div class='compound'>std.exists2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='268'>L</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='269'>M</span></div><b>]</b></div> <span class='name' varname='270'>P</span></div></div></div> -<div class='clause' predicate='std.forall'><div class='loc'>File "builtin_stdlib.elpi", line 200, column 0, character 6936:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.forall [] _</div></div> -<div class='clause' predicate='std.forall'><div class='loc'>File "builtin_stdlib.elpi", line 201, column 0, character 6949:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='273'>P</span> <span class='name' varname='271'>X</span>,</div><div class='hyp compound'>std.forall <span class='name' varname='272'>L</span> <span class='name' varname='273'>P</span></div></div><div class='concl'><div class='compound'>std.forall <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='271'>X</span> <b>|</b> <span class='name' varname='272'>L</span></div><b>]</b></div> <span class='name' varname='273'>P</span></div></div></div> -<div class='clause' predicate='std.forall-ok'><div class='loc'>File "builtin_stdlib.elpi", line 204, column 0, character 7053:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='276'>P</span> <span class='name' varname='274'>X</span> <span class='name' varname='278'>S<sub>0</sub></span>,</div><div class='hyp compound'>if <div class='compound'>(<span class='name' varname='278'>S<sub>0</sub></span> = </div><div class='compound'>ok)</div> (std.forall-ok <span class='name' varname='275'>L</span> <span class='name' varname='276'>P</span> <span class='name' varname='277'>S</span>) <div class='compound'>(<span class='name' varname='277'>S</span> = </div><div class='compound'><span class='name' varname='278'>S<sub>0</sub></span>)</div></div></div><div class='concl'><div class='compound'>std.forall-ok <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='274'>X</span> <b>|</b> <span class='name' varname='275'>L</span></div><b>]</b></div> <span class='name' varname='276'>P</span> <span class='name' varname='277'>S</span></div></div></div> -<div class='clause' predicate='std.forall-ok'><div class='loc'>File "builtin_stdlib.elpi", line 205, column 0, character 7125:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.forall-ok [] _ ok</div></div> -<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 208, column 0, character 7198:</div><div class='hyps'>std.fatal-error forall2 on lists of different length</div><div class='concl'><div class='compound'>std.forall2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _</div></div></div> -<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 209, column 0, character 7272:</div><div class='hyps'>std.fatal-error forall2 on lists of different length</div><div class='concl'><div class='compound'>std.forall2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _</div></div></div> -<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 210, column 0, character 7346:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='283'>P</span> <span class='name' varname='279'>X</span> <span class='name' varname='281'>Y</span>,</div><div class='hyp compound'>std.forall2 <span class='name' varname='280'>XS</span> <span class='name' varname='282'>YS</span> <span class='name' varname='283'>P</span></div></div><div class='concl'><div class='compound'>std.forall2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='279'>X</span> <b>|</b> <span class='name' varname='280'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='281'>Y</span> <b>|</b> <span class='name' varname='282'>YS</span></div><b>]</b></div> <span class='name' varname='283'>P</span></div></div></div> -<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 211, column 0, character 7397:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.forall2 [] [] _</div></div> -<div class='clause' predicate='std.filter'><div class='loc'>File "builtin_stdlib.elpi", line 214, column 0, character 7462:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.filter [] _ []</div></div> -<div class='clause' predicate='std.filter'><div class='loc'>File "builtin_stdlib.elpi", line 215, column 0, character 7481:</div><div class='hyps'><div class='hyp compound' level='60'>if (<span class='name' varname='286'>P</span> <span class='name' varname='284'>X</span>) <div class='compound'>(<span class='name' varname='287'>R</span> = </div><div class='compound'><div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='284'>X</span> <b>|</b> <span class='name' varname='288'>L<sub>1</sub></span></div><b>]</b></div>)</div> <div class='compound'>(<span class='name' varname='287'>R</span> = </div><div class='compound'><span class='name' varname='288'>L<sub>1</sub></span>),</div></div><div class='hyp compound'>std.filter <span class='name' varname='285'>L</span> <span class='name' varname='286'>P</span> <span class='name' varname='288'>L<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.filter <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='284'>X</span> <b>|</b> <span class='name' varname='285'>L</span></div><b>]</b></div> <span class='name' varname='286'>P</span> <span class='name' varname='287'>R</span></div></div></div> -<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 218, column 0, character 7598:</div><div class='hyps'>std.fatal-error zip on lists of different length</div><div class='concl'><div class='compound'>std.zip <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _</div></div></div> -<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 219, column 0, character 7664:</div><div class='hyps'>std.fatal-error zip on lists of different length</div><div class='concl'><div class='compound'>std.zip [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _</div></div></div> -<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 220, column 0, character 7730:</div><div class='hyps'>std.zip <span class='name' varname='290'>LX</span> <span class='name' varname='292'>LY</span> <span class='name' varname='293'>LR</span></div><div class='concl'><div class='compound'>std.zip <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='289'>X</span> <b>|</b> <span class='name' varname='290'>LX</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='291'>Y</span> <b>|</b> <span class='name' varname='292'>LY</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='289'>X</span> <span class='name' varname='291'>Y</span> <b>|</b> <span class='name' varname='293'>LR</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 221, column 0, character 7777:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.zip [] [] []</div></div> -<div class='clause' predicate='std.unzip'><div class='loc'>File "builtin_stdlib.elpi", line 224, column 0, character 7842:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.unzip [] [] []</div></div> -<div class='clause' predicate='std.unzip'><div class='loc'>File "builtin_stdlib.elpi", line 225, column 0, character 7858:</div><div class='hyps'>std.unzip <span class='name' varname='296'>L</span> <span class='name' varname='297'>LX</span> <span class='name' varname='298'>LY</span></div><div class='concl'><div class='compound'>std.unzip <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='294'>X</span> <span class='name' varname='295'>Y</span> <b>|</b> <span class='name' varname='296'>L</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='294'>X</span> <b>|</b> <span class='name' varname='297'>LX</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='295'>Y</span> <b>|</b> <span class='name' varname='298'>LY</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.flatten'><div class='loc'>File "builtin_stdlib.elpi", line 228, column 0, character 7948:</div><div class='hyps'><div class='hyp compound' level='60'>std.flatten <span class='name' varname='300'>LS</span> <span class='name' varname='302'>LS'</span>,</div><div class='hyp compound'>std.append <span class='name' varname='299'>X</span> <span class='name' varname='302'>LS'</span> <span class='name' varname='301'>R</span></div></div><div class='concl'><div class='compound'>std.flatten <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='299'>X</span> <b>|</b> <span class='name' varname='300'>LS</span></div><b>]</b></div> <span class='name' varname='301'>R</span></div></div></div> -<div class='clause' predicate='std.flatten'><div class='loc'>File "builtin_stdlib.elpi", line 229, column 0, character 8000:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.flatten [] []</div></div> -<div class='clause' predicate='std.null'><div class='loc'>File "builtin_stdlib.elpi", line 232, column 0, character 8040:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.null []</div></div> -<div class='clause' predicate='std.iota'><div class='loc'>File "builtin_stdlib.elpi", line 235, column 0, character 8079:</div><div class='hyps'>std.iota.aux 0 <span class='name' varname='303'>N</span> <span class='name' varname='304'>L</span></div><div class='concl'><div class='compound'>std.iota <span class='name' varname='303'>N</span> <span class='name' varname='304'>L</span></div></div></div> -<div class='clause' predicate='std.iota.aux'><div class='loc'>File "builtin_stdlib.elpi", line 236, column 0, character 8107:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.iota.aux <span class='name' varname='305'>X</span> <span class='name' varname='305'>X</span> []</div></div></div> -<div class='clause' predicate='std.iota.aux'><div class='loc'>File "builtin_stdlib.elpi", line 237, column 0, character 8129:</div><div class='hyps'><div class='hyp compound' level='60'><div class='compound'><span class='name' varname='309'>M</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='306'>N</span> + </div><div class='compound'>1,</div></div></div><div class='hyp compound'>std.iota.aux <span class='name' varname='309'>M</span> <span class='name' varname='307'>X</span> <span class='name' varname='308'>R</span></div></div><div class='concl'><div class='compound'>std.iota.aux <span class='name' varname='306'>N</span> <span class='name' varname='307'>X</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='306'>N</span> <b>|</b> <span class='name' varname='308'>R</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.intersperse'><div class='loc'>File "builtin_stdlib.elpi", line 242, column 0, character 8281:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.intersperse _ [] []</div></div> -<div class='clause' predicate='std.intersperse'><div class='loc'>File "builtin_stdlib.elpi", line 243, column 0, character 8302:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.intersperse _ <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='310'>X</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='310'>X</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.intersperse'><div class='loc'>File "builtin_stdlib.elpi", line 244, column 0, character 8330:</div><div class='hyps'>std.intersperse <span class='name' varname='311'>Sep</span> <span class='name' varname='313'>XS</span> <span class='name' varname='314'>YS</span></div><div class='concl'><div class='compound'>std.intersperse <span class='name' varname='311'>Sep</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='312'>X</span> <b>|</b> <span class='name' varname='313'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='312'>X</span><b>,</b></div><div class='compound'> <span class='name' varname='311'>Sep</span> <b>|</b> <span class='name' varname='314'>YS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.flip'><div class='loc'>File "builtin_stdlib.elpi", line 249, column 0, character 8446:</div><div class='hyps'><span class='name' varname='315'>P</span> <span class='name' varname='317'>Y</span> <span class='name' varname='316'>X</span></div><div class='concl'><div class='compound'>std.flip <span class='name' varname='315'>P</span> <span class='name' varname='316'>X</span> <span class='name' varname='317'>Y</span></div></div></div> -<div class='clause' predicate='std.time'><div class='loc'>File "builtin_stdlib.elpi", line 252, column 0, character 8495:</div><div class='hyps'><div class='hyp compound' level='60'>gettimeofday <span class='name' varname='320'>Before</span>,</div><div class='hyp compound'><span class='name' varname='318'>P</span>,</div><div class='hyp compound'>gettimeofday <span class='name' varname='321'>After</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='319'>T</span> <b>is</b> </div><div class='compound'>- <span class='name' varname='321'>After</span> <span class='name' varname='320'>Before</span></div></div></div><div class='concl'><div class='compound'>std.time <span class='name' varname='318'>P</span> <span class='name' varname='319'>T</span></div></div></div> -<div class='clause' predicate='std.do!'><div class='loc'>File "builtin_stdlib.elpi", line 255, column 0, character 8595:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.do! []</div></div> -<div class='clause' predicate='std.do!'><div class='loc'>File "builtin_stdlib.elpi", line 256, column 0, character 8603:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='322'>P</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.do! <span class='name' varname='323'>PS</span></div></div><div class='concl'><div class='compound'>std.do! <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='322'>P</span> <b>|</b> <span class='name' varname='323'>PS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.do-ok!'><div class='loc'>File "builtin_stdlib.elpi", line 260, column 0, character 8699:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.do-ok! ok []</div></div> -<div class='clause' predicate='std.do-ok!'><div class='loc'>File "builtin_stdlib.elpi", line 261, column 0, character 8713:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='325'>P</span> <span class='name' varname='327'>S<sub>0</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>if <div class='compound'>(<span class='name' varname='327'>S<sub>0</sub></span> = </div><div class='compound'>ok)</div> (std.do-ok! <span class='name' varname='324'>S</span> <span class='name' varname='326'>PS</span>) <div class='compound'>(<span class='name' varname='324'>S</span> = </div><div class='compound'><span class='name' varname='327'>S<sub>0</sub></span>)</div></div></div><div class='concl'><div class='compound'>std.do-ok! <span class='name' varname='324'>S</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='325'>P</span> <b>|</b> <span class='name' varname='326'>PS</span></div><b>]</b></div></div></div></div> -<div class='clause' predicate='std.lift-ok'><div class='loc'>File "builtin_stdlib.elpi", line 264, column 0, character 8824:</div><div class='hyps'><div class='compound'><div class='hyp compound' level='60'>(<span class='name' varname='328'>P</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='330'>R</span> = </div><div class='compound'>ok ; </div></div></div><div class='compound'><div class='compound'><span class='name' varname='330'>R</span> = </div><div class='compound'>(error <span class='name' varname='329'>Msg</span>))</div></div></div><div class='concl'><div class='compound'>std.lift-ok <span class='name' varname='328'>P</span> <span class='name' varname='329'>Msg</span> <span class='name' varname='330'>R</span></div></div></div> -<div class='clause' predicate='std.spy-do!'><div class='loc'>File "builtin_stdlib.elpi", line 267, column 0, character 8898:</div><div class='hyps'><div class='hyp compound' level='60'>std.map <span class='name' varname='331'>L</span> <div class='compound' level='70'><b>λ</b><span class='name' varname='333'>x<sub>1</sub></span>. </div><div class='compound'><div class='compound' level='70'><b>λ</b><span class='name' varname='334'>x<sub>2</sub></span>. </div><div class='compound'><div class='compound'><span class='name' varname='334'>x<sub>2</sub></span> = </div><div class='compound'>(std.spy <span class='name' varname='333'>x<sub>1</sub></span>)</div></div></div> <span class='name' varname='332'>L<sub>1</sub></span>,</div><div class='hyp compound'>std.do! <span class='name' varname='332'>L<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.spy-do! <span class='name' varname='331'>L</span></div></div></div> -<div class='clause' predicate='std.while-ok-do!'><div class='loc'>File "builtin_stdlib.elpi", line 270, column 0, character 9021:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.while-ok-do! <div class='compound'>(error _ <b>as</b> </div><div class='compound'><span class='name' varname='335'>E</span>)</div> _ <span class='name' varname='335'>E</span></div></div> -<div class='clause' predicate='std.while-ok-do!'><div class='loc'>File "builtin_stdlib.elpi", line 271, column 0, character 9054:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.while-ok-do! ok [] ok</div></div> -<div class='clause' predicate='std.while-ok-do!'><div class='loc'>File "builtin_stdlib.elpi", line 272, column 0, character 9077:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='336'>P</span> <span class='name' varname='339'>C</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.while-ok-do! <span class='name' varname='339'>C</span> <span class='name' varname='337'>PS</span> <span class='name' varname='338'>R</span></div></div><div class='concl'><div class='compound'>std.while-ok-do! ok <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='336'>P</span> <b>|</b> <span class='name' varname='337'>PS</span></div><b>]</b></div> <span class='name' varname='338'>R</span></div></div></div> -<div class='clause' predicate='std.any->string'><div class='loc'>File "builtin_stdlib.elpi", line 275, column 0, character 9167:</div><div class='hyps'>term_to_string <span class='name' varname='340'>X</span> <span class='name' varname='341'>Y</span></div><div class='concl'><div class='compound'>std.any->string <span class='name' varname='340'>X</span> <span class='name' varname='341'>Y</span></div></div></div> -<div class='clause' predicate='std.max'><div class='loc'>File "builtin_stdlib.elpi", line 278, column 0, character 9231:</div><div class='hyps'><div class='hyp compound' level='60'>>= <span class='name' varname='342'>N</span> <span class='name' varname='343'>M</span>,</div><div class='hyp compound'><span class='cut'>!</span></div></div><div class='concl'><div class='compound'>std.max <span class='name' varname='342'>N</span> <span class='name' varname='343'>M</span> <span class='name' varname='342'>N</span></div></div></div> -<div class='clause' predicate='std.max'><div class='loc'>File "builtin_stdlib.elpi", line 279, column 0, character 9255:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.max _ <span class='name' varname='344'>M</span> <span class='name' varname='344'>M</span></div></div> -<div class='clause' predicate='std.findall'><div class='loc'>File "builtin_stdlib.elpi", line 283, column 0, character 9378:</div><div class='hyps'>findall_solutions <span class='name' varname='345'>P</span> <span class='name' varname='346'>L</span></div><div class='concl'><div class='compound'>std.findall <span class='name' varname='345'>P</span> <span class='name' varname='346'>L</span></div></div></div> -<div class='clause' predicate='std.map.make'><div class='loc'>File "builtin_map.elpi", line 7, column 0, character 10078:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.make <span class='name' varname='347'>Cmp</span> (std.map std.map.private.empty <span class='name' varname='347'>Cmp</span>)</div></div> -<div class='clause' predicate='std.map.find'><div class='loc'>File "builtin_map.elpi", line 11, column 0, character 10210:</div><div class='hyps'>std.map.private.find <span class='name' varname='349'>M</span> <span class='name' varname='350'>Cmp</span> <span class='name' varname='348'>K</span> <span class='name' varname='351'>V</span></div><div class='concl'><div class='compound'>std.map.find <span class='name' varname='348'>K</span> (std.map <span class='name' varname='349'>M</span> <span class='name' varname='350'>Cmp</span>) <span class='name' varname='351'>V</span></div></div></div> -<div class='clause' predicate='std.map.add'><div class='loc'>File "builtin_map.elpi", line 15, column 0, character 10359:</div><div class='hyps'>std.map.private.add <span class='name' varname='354'>M</span> <span class='name' varname='355'>Cmp</span> <span class='name' varname='352'>K</span> <span class='name' varname='353'>V</span> <span class='name' varname='356'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.map.add <span class='name' varname='352'>K</span> <span class='name' varname='353'>V</span> (std.map <span class='name' varname='354'>M</span> <span class='name' varname='355'>Cmp</span>) (std.map <span class='name' varname='356'>M<sub>1</sub></span> <span class='name' varname='355'>Cmp</span>)</div></div></div> -<div class='clause' predicate='std.map.remove'><div class='loc'>File "builtin_map.elpi", line 19, column 0, character 10522:</div><div class='hyps'>std.map.private.remove <span class='name' varname='358'>M</span> <span class='name' varname='359'>Cmp</span> <span class='name' varname='357'>K</span> <span class='name' varname='360'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.map.remove <span class='name' varname='357'>K</span> (std.map <span class='name' varname='358'>M</span> <span class='name' varname='359'>Cmp</span>) (std.map <span class='name' varname='360'>M<sub>1</sub></span> <span class='name' varname='359'>Cmp</span>)</div></div></div> -<div class='clause' predicate='std.map.bindings'><div class='loc'>File "builtin_map.elpi", line 23, column 0, character 10705:</div><div class='hyps'>std.map.private.bindings <span class='name' varname='361'>M</span> [] <span class='name' varname='362'>L</span></div><div class='concl'><div class='compound'>std.map.bindings (std.map <span class='name' varname='361'>M</span> _) <span class='name' varname='362'>L</span></div></div></div> -<div class='clause' predicate='std.map.private.height'><div class='loc'>File "builtin_map.elpi", line 33, column 0, character 10948:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.height std.map.private.empty 0</div></div> -<div class='clause' predicate='std.map.private.height'><div class='loc'>File "builtin_map.elpi", line 34, column 0, character 10964:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.height (std.map.private.node _ _ _ _ <span class='name' varname='363'>H</span>) <span class='name' varname='363'>H</span></div></div> -<div class='clause' predicate='std.map.private.create'><div class='loc'>File "builtin_map.elpi", line 37, column 0, character 11047:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='364'>L</span> <span class='name' varname='369'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='367'>R</span> <span class='name' varname='370'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.max <span class='name' varname='369'>Spilled<sub>1</sub></span> <span class='name' varname='370'>Spilled<sub>2</sub></span> <span class='name' varname='371'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='368'>H</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='371'>Spilled<sub>3</sub></span> + </div><div class='compound'>1</div></div></div></div><div class='concl'><div class='compound'>std.map.private.create <span class='name' varname='364'>L</span> <span class='name' varname='365'>K</span> <span class='name' varname='366'>V</span> <span class='name' varname='367'>R</span> (std.map.private.node <span class='name' varname='364'>L</span> <span class='name' varname='365'>K</span> <span class='name' varname='366'>V</span> <span class='name' varname='367'>R</span> <span class='name' varname='368'>H</span>)</div></div></div> -<div class='clause' predicate='std.map.private.bal'><div class='loc'>File "builtin_map.elpi", line 40, column 0, character 11177:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='372'>L</span> <span class='name' varname='377'>HL</span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='375'>R</span> <span class='name' varname='378'>HR</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='379'>HL<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='377'>HL</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'><div class='compound'><span class='name' varname='380'>HR<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='378'>HR</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'>std.map.private.bal.aux <span class='name' varname='377'>HL</span> <span class='name' varname='378'>HR</span> <span class='name' varname='379'>HL<sub>2</sub></span> <span class='name' varname='380'>HR<sub>2</sub></span> <span class='name' varname='372'>L</span> <span class='name' varname='373'>K</span> <span class='name' varname='374'>V</span> <span class='name' varname='375'>R</span> <span class='name' varname='376'>T</span></div></div><div class='concl'><div class='compound'>std.map.private.bal <span class='name' varname='372'>L</span> <span class='name' varname='373'>K</span> <span class='name' varname='374'>V</span> <span class='name' varname='375'>R</span> <span class='name' varname='376'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 47, column 0, character 11294:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='381'>HL</span> <span class='name' varname='382'>HR<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='383'>LL</span> <span class='name' varname='392'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='386'>LR</span> <span class='name' varname='393'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='392'>Spilled<sub>2</sub></span> <span class='name' varname='393'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='386'>LR</span> <span class='name' varname='387'>X</span> <span class='name' varname='388'>D</span> <span class='name' varname='389'>R</span> <span class='name' varname='391'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='383'>LL</span> <span class='name' varname='384'>LV</span> <span class='name' varname='385'>LD</span> <span class='name' varname='391'>Spilled<sub>1</sub></span> <span class='name' varname='390'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux <span class='name' varname='381'>HL</span> _ _ <span class='name' varname='382'>HR<sub>2</sub></span> (std.map.private.node <span class='name' varname='383'>LL</span> <span class='name' varname='384'>LV</span> <span class='name' varname='385'>LD</span> <span class='name' varname='386'>LR</span> _) <span class='name' varname='387'>X</span> <span class='name' varname='388'>D</span> <span class='name' varname='389'>R</span> <span class='name' varname='390'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 50, column 0, character 11427:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='394'>HL</span> <span class='name' varname='395'>HR<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='396'>LL</span> <span class='name' varname='397'>LV</span> <span class='name' varname='398'>LD</span> <span class='name' varname='399'>LRL</span> <span class='name' varname='407'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='402'>LRR</span> <span class='name' varname='403'>X</span> <span class='name' varname='404'>D</span> <span class='name' varname='405'>R</span> <span class='name' varname='408'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='407'>Spilled<sub>1</sub></span> <span class='name' varname='400'>LRV</span> <span class='name' varname='401'>LRD</span> <span class='name' varname='408'>Spilled<sub>2</sub></span> <span class='name' varname='406'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux <span class='name' varname='394'>HL</span> _ _ <span class='name' varname='395'>HR<sub>2</sub></span> (std.map.private.node <span class='name' varname='396'>LL</span> <span class='name' varname='397'>LV</span> <span class='name' varname='398'>LD</span> (std.map.private.node <span class='name' varname='399'>LRL</span> <span class='name' varname='400'>LRV</span> <span class='name' varname='401'>LRD</span> <span class='name' varname='402'>LRR</span> _) _) <span class='name' varname='403'>X</span> <span class='name' varname='404'>D</span> <span class='name' varname='405'>R</span> <span class='name' varname='406'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 53, column 0, character 11576:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='409'>HR</span> <span class='name' varname='410'>HL<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='417'>RR</span> <span class='name' varname='420'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='414'>RL</span> <span class='name' varname='421'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='420'>Spilled<sub>2</sub></span> <span class='name' varname='421'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='411'>L</span> <span class='name' varname='412'>X</span> <span class='name' varname='413'>D</span> <span class='name' varname='414'>RL</span> <span class='name' varname='419'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='419'>Spilled<sub>1</sub></span> <span class='name' varname='415'>RV</span> <span class='name' varname='416'>RD</span> <span class='name' varname='417'>RR</span> <span class='name' varname='418'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux _ <span class='name' varname='409'>HR</span> <span class='name' varname='410'>HL<sub>2</sub></span> _ <span class='name' varname='411'>L</span> <span class='name' varname='412'>X</span> <span class='name' varname='413'>D</span> (std.map.private.node <span class='name' varname='414'>RL</span> <span class='name' varname='415'>RV</span> <span class='name' varname='416'>RD</span> <span class='name' varname='417'>RR</span> _) <span class='name' varname='418'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 56, column 0, character 11709:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='422'>HR</span> <span class='name' varname='423'>HL<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='424'>L</span> <span class='name' varname='425'>X</span> <span class='name' varname='426'>D</span> <span class='name' varname='427'>RLL</span> <span class='name' varname='435'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='430'>RLR</span> <span class='name' varname='431'>RV</span> <span class='name' varname='432'>RD</span> <span class='name' varname='433'>RR</span> <span class='name' varname='436'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='435'>Spilled<sub>1</sub></span> <span class='name' varname='428'>RLV</span> <span class='name' varname='429'>RLD</span> <span class='name' varname='436'>Spilled<sub>2</sub></span> <span class='name' varname='434'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux _ <span class='name' varname='422'>HR</span> <span class='name' varname='423'>HL<sub>2</sub></span> _ <span class='name' varname='424'>L</span> <span class='name' varname='425'>X</span> <span class='name' varname='426'>D</span> (std.map.private.node (std.map.private.node <span class='name' varname='427'>RLL</span> <span class='name' varname='428'>RLV</span> <span class='name' varname='429'>RLD</span> <span class='name' varname='430'>RLR</span> _) <span class='name' varname='431'>RV</span> <span class='name' varname='432'>RD</span> <span class='name' varname='433'>RR</span> _) <span class='name' varname='434'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 59, column 0, character 11858:</div><div class='hyps'>std.map.private.create <span class='name' varname='437'>L</span> <span class='name' varname='438'>K</span> <span class='name' varname='439'>V</span> <span class='name' varname='440'>R</span> <span class='name' varname='441'>T</span></div><div class='concl'><div class='compound'>std.map.private.bal.aux _ _ _ _ <span class='name' varname='437'>L</span> <span class='name' varname='438'>K</span> <span class='name' varname='439'>V</span> <span class='name' varname='440'>R</span> <span class='name' varname='441'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.add'><div class='loc'>File "builtin_map.elpi", line 62, column 0, character 11974:</div><div class='hyps'>std.map.private.create std.map.private.empty <span class='name' varname='442'>K</span> <span class='name' varname='443'>V</span> std.map.private.empty <span class='name' varname='444'>T</span></div><div class='concl'><div class='compound'>std.map.private.add std.map.private.empty _ <span class='name' varname='442'>K</span> <span class='name' varname='443'>V</span> <span class='name' varname='444'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.add'><div class='loc'>File "builtin_map.elpi", line 63, column 0, character 12021:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='447'>Cmp</span> <span class='name' varname='448'>X<sub>1</sub></span> <span class='name' varname='445'>X</span> <span class='name' varname='451'>E</span>,</div><div class='hyp compound'>std.map.private.add.aux <span class='name' varname='451'>E</span> <span class='name' varname='446'>M</span> <span class='name' varname='447'>Cmp</span> <span class='name' varname='448'>X<sub>1</sub></span> <span class='name' varname='449'>XD</span> <span class='name' varname='450'>M<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.map.private.add <div class='compound'>(std.map.private.node _ <span class='name' varname='445'>X</span> _ _ _ <b>as</b> </div><div class='compound'><span class='name' varname='446'>M</span>)</div> <span class='name' varname='447'>Cmp</span> <span class='name' varname='448'>X<sub>1</sub></span> <span class='name' varname='449'>XD</span> <span class='name' varname='450'>M<sub>1</sub></span></div></div></div> -<div class='clause' predicate='std.map.private.add.aux'><div class='loc'>File "builtin_map.elpi", line 64, column 0, character 12101:</div><div class='hyps'><div class='compound'><span class='name' varname='457'>T</span> = </div><div class='compound'>(std.map.private.node <span class='name' varname='452'>L</span> <span class='name' varname='455'>X</span> <span class='name' varname='456'>XD</span> <span class='name' varname='453'>R</span> <span class='name' varname='454'>H</span>)</div></div><div class='concl'><div class='compound'>std.map.private.add.aux eq (std.map.private.node <span class='name' varname='452'>L</span> _ _ <span class='name' varname='453'>R</span> <span class='name' varname='454'>H</span>) _ <span class='name' varname='455'>X</span> <span class='name' varname='456'>XD</span> <span class='name' varname='457'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.add.aux'><div class='loc'>File "builtin_map.elpi", line 65, column 0, character 12165:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.add <span class='name' varname='458'>L</span> <span class='name' varname='462'>Cmp</span> <span class='name' varname='463'>X</span> <span class='name' varname='464'>XD</span> <span class='name' varname='466'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='466'>Spilled<sub>1</sub></span> <span class='name' varname='459'>V</span> <span class='name' varname='460'>D</span> <span class='name' varname='461'>R</span> <span class='name' varname='465'>T</span></div></div><div class='concl'><div class='compound'>std.map.private.add.aux lt (std.map.private.node <span class='name' varname='458'>L</span> <span class='name' varname='459'>V</span> <span class='name' varname='460'>D</span> <span class='name' varname='461'>R</span> _) <span class='name' varname='462'>Cmp</span> <span class='name' varname='463'>X</span> <span class='name' varname='464'>XD</span> <span class='name' varname='465'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.add.aux'><div class='loc'>File "builtin_map.elpi", line 66, column 0, character 12237:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.add <span class='name' varname='470'>R</span> <span class='name' varname='471'>Cmp</span> <span class='name' varname='472'>X</span> <span class='name' varname='473'>XD</span> <span class='name' varname='475'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='467'>L</span> <span class='name' varname='468'>V</span> <span class='name' varname='469'>D</span> <span class='name' varname='475'>Spilled<sub>1</sub></span> <span class='name' varname='474'>T</span></div></div><div class='concl'><div class='compound'>std.map.private.add.aux gt (std.map.private.node <span class='name' varname='467'>L</span> <span class='name' varname='468'>V</span> <span class='name' varname='469'>D</span> <span class='name' varname='470'>R</span> _) <span class='name' varname='471'>Cmp</span> <span class='name' varname='472'>X</span> <span class='name' varname='473'>XD</span> <span class='name' varname='474'>T</span></div></div></div> -<div class='clause' predicate='std.map.private.find'><div class='loc'>File "builtin_map.elpi", line 69, column 0, character 12368:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='480'>Cmp</span> <span class='name' varname='481'>K</span> <span class='name' varname='477'>K<sub>1</sub></span> <span class='name' varname='483'>E</span>,</div><div class='hyp compound'>std.map.private.find.aux <span class='name' varname='483'>E</span> <span class='name' varname='480'>Cmp</span> <span class='name' varname='476'>L</span> <span class='name' varname='479'>R</span> <span class='name' varname='478'>V<sub>1</sub></span> <span class='name' varname='481'>K</span> <span class='name' varname='482'>V</span></div></div><div class='concl'><div class='compound'>std.map.private.find (std.map.private.node <span class='name' varname='476'>L</span> <span class='name' varname='477'>K<sub>1</sub></span> <span class='name' varname='478'>V<sub>1</sub></span> <span class='name' varname='479'>R</span> _) <span class='name' varname='480'>Cmp</span> <span class='name' varname='481'>K</span> <span class='name' varname='482'>V</span></div></div></div> -<div class='clause' predicate='std.map.private.find.aux'><div class='loc'>File "builtin_map.elpi", line 70, column 0, character 12442:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.find.aux eq _ _ _ <span class='name' varname='484'>V</span> _ <span class='name' varname='484'>V</span></div></div> -<div class='clause' predicate='std.map.private.find.aux'><div class='loc'>File "builtin_map.elpi", line 71, column 0, character 12469:</div><div class='hyps'>std.map.private.find <span class='name' varname='486'>L</span> <span class='name' varname='485'>Cmp</span> <span class='name' varname='487'>K</span> <span class='name' varname='488'>V</span></div><div class='concl'><div class='compound'>std.map.private.find.aux lt <span class='name' varname='485'>Cmp</span> <span class='name' varname='486'>L</span> _ _ <span class='name' varname='487'>K</span> <span class='name' varname='488'>V</span></div></div></div> -<div class='clause' predicate='std.map.private.find.aux'><div class='loc'>File "builtin_map.elpi", line 72, column 0, character 12514:</div><div class='hyps'>std.map.private.find <span class='name' varname='490'>R</span> <span class='name' varname='489'>Cmp</span> <span class='name' varname='491'>K</span> <span class='name' varname='492'>V</span></div><div class='concl'><div class='compound'>std.map.private.find.aux gt <span class='name' varname='489'>Cmp</span> _ <span class='name' varname='490'>R</span> _ <span class='name' varname='491'>K</span> <span class='name' varname='492'>V</span></div></div></div> -<div class='clause' predicate='std.map.private.remove-min-binding'><div class='loc'>File "builtin_map.elpi", line 75, column 0, character 12606:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.remove-min-binding (std.map.private.node std.map.private.empty _ _ <span class='name' varname='493'>R</span> _) <span class='name' varname='493'>R</span></div></div></div> -<div class='clause' predicate='std.map.private.remove-min-binding'><div class='loc'>File "builtin_map.elpi", line 76, column 0, character 12654:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.remove-min-binding <span class='name' varname='494'>L</span> <span class='name' varname='499'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='499'>Spilled<sub>1</sub></span> <span class='name' varname='495'>V</span> <span class='name' varname='496'>D</span> <span class='name' varname='497'>R</span> <span class='name' varname='498'>X</span></div></div><div class='concl'><div class='compound'>std.map.private.remove-min-binding (std.map.private.node <span class='name' varname='494'>L</span> <span class='name' varname='495'>V</span> <span class='name' varname='496'>D</span> <span class='name' varname='497'>R</span> _) <span class='name' varname='498'>X</span></div></div></div> -<div class='clause' predicate='std.map.private.min-binding'><div class='loc'>File "builtin_map.elpi", line 79, column 0, character 12770:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.min-binding (std.map.private.node std.map.private.empty <span class='name' varname='500'>V</span> <span class='name' varname='501'>D</span> _ _) <span class='name' varname='500'>V</span> <span class='name' varname='501'>D</span></div></div></div> -<div class='clause' predicate='std.map.private.min-binding'><div class='loc'>File "builtin_map.elpi", line 80, column 0, character 12813:</div><div class='hyps'>std.map.private.min-binding <span class='name' varname='502'>L</span> <span class='name' varname='503'>V</span> <span class='name' varname='504'>D</span></div><div class='concl'><div class='compound'>std.map.private.min-binding (std.map.private.node <span class='name' varname='502'>L</span> _ _ _ _) <span class='name' varname='503'>V</span> <span class='name' varname='504'>D</span></div></div></div> -<div class='clause' predicate='std.map.private.merge'><div class='loc'>File "builtin_map.elpi", line 83, column 0, character 12913:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.merge std.map.private.empty <span class='name' varname='505'>X</span> <span class='name' varname='505'>X</span></div></div></div> -<div class='clause' predicate='std.map.private.merge'><div class='loc'>File "builtin_map.elpi", line 84, column 0, character 12935:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.merge <span class='name' varname='506'>X</span> std.map.private.empty <span class='name' varname='506'>X</span></div></div></div> -<div class='clause' predicate='std.map.private.merge'><div class='loc'>File "builtin_map.elpi", line 85, column 0, character 12957:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.min-binding <span class='name' varname='508'>M<sub>2</sub></span> <span class='name' varname='510'>X</span> <span class='name' varname='511'>D</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.remove-min-binding <span class='name' varname='508'>M<sub>2</sub></span> <span class='name' varname='512'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='507'>M<sub>1</sub></span> <span class='name' varname='510'>X</span> <span class='name' varname='511'>D</span> <span class='name' varname='512'>Spilled<sub>1</sub></span> <span class='name' varname='509'>R</span></div></div></div><div class='concl'><div class='compound'>std.map.private.merge <span class='name' varname='507'>M<sub>1</sub></span> <span class='name' varname='508'>M<sub>2</sub></span> <span class='name' varname='509'>R</span></div></div></div> -<div class='clause' predicate='std.map.private.remove'><div class='loc'>File "builtin_map.elpi", line 90, column 0, character 13103:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.remove std.map.private.empty _ _ std.map.private.empty</div></div></div> -<div class='clause' predicate='std.map.private.remove'><div class='loc'>File "builtin_map.elpi", line 91, column 0, character 13132:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='517'>Cmp</span> <span class='name' varname='518'>X</span> <span class='name' varname='514'>V</span> <span class='name' varname='520'>E</span>,</div><div class='hyp compound'>std.map.private.remove.aux <span class='name' varname='520'>E</span> <span class='name' varname='517'>Cmp</span> <span class='name' varname='513'>L</span> <span class='name' varname='516'>R</span> <span class='name' varname='514'>V</span> <span class='name' varname='515'>D</span> <span class='name' varname='518'>X</span> <span class='name' varname='519'>M</span></div></div><div class='concl'><div class='compound'>std.map.private.remove (std.map.private.node <span class='name' varname='513'>L</span> <span class='name' varname='514'>V</span> <span class='name' varname='515'>D</span> <span class='name' varname='516'>R</span> _) <span class='name' varname='517'>Cmp</span> <span class='name' varname='518'>X</span> <span class='name' varname='519'>M</span></div></div></div> -<div class='clause' predicate='std.map.private.remove.aux'><div class='loc'>File "builtin_map.elpi", line 92, column 0, character 13208:</div><div class='hyps'>std.map.private.merge <span class='name' varname='521'>L</span> <span class='name' varname='522'>R</span> <span class='name' varname='523'>M</span></div><div class='concl'><div class='compound'>std.map.private.remove.aux eq _ <span class='name' varname='521'>L</span> <span class='name' varname='522'>R</span> _ _ _ <span class='name' varname='523'>M</span></div></div></div> -<div class='clause' predicate='std.map.private.remove.aux'><div class='loc'>File "builtin_map.elpi", line 93, column 0, character 13254:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.remove <span class='name' varname='525'>L</span> <span class='name' varname='524'>Cmp</span> <span class='name' varname='529'>X</span> <span class='name' varname='531'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='531'>Spilled<sub>1</sub></span> <span class='name' varname='527'>V</span> <span class='name' varname='528'>D</span> <span class='name' varname='526'>R</span> <span class='name' varname='530'>M</span></div></div><div class='concl'><div class='compound'>std.map.private.remove.aux lt <span class='name' varname='524'>Cmp</span> <span class='name' varname='525'>L</span> <span class='name' varname='526'>R</span> <span class='name' varname='527'>V</span> <span class='name' varname='528'>D</span> <span class='name' varname='529'>X</span> <span class='name' varname='530'>M</span></div></div></div> -<div class='clause' predicate='std.map.private.remove.aux'><div class='loc'>File "builtin_map.elpi", line 94, column 0, character 13317:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.remove <span class='name' varname='534'>R</span> <span class='name' varname='532'>Cmp</span> <span class='name' varname='537'>X</span> <span class='name' varname='539'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='533'>L</span> <span class='name' varname='535'>V</span> <span class='name' varname='536'>D</span> <span class='name' varname='539'>Spilled<sub>1</sub></span> <span class='name' varname='538'>M</span></div></div><div class='concl'><div class='compound'>std.map.private.remove.aux gt <span class='name' varname='532'>Cmp</span> <span class='name' varname='533'>L</span> <span class='name' varname='534'>R</span> <span class='name' varname='535'>V</span> <span class='name' varname='536'>D</span> <span class='name' varname='537'>X</span> <span class='name' varname='538'>M</span></div></div></div> -<div class='clause' predicate='std.map.private.bindings'><div class='loc'>File "builtin_map.elpi", line 97, column 0, character 13444:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.bindings std.map.private.empty <span class='name' varname='540'>X</span> <span class='name' varname='540'>X</span></div></div> -<div class='clause' predicate='std.map.private.bindings'><div class='loc'>File "builtin_map.elpi", line 98, column 0, character 13464:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.bindings <span class='name' varname='544'>R</span> <span class='name' varname='545'>X</span> <span class='name' varname='547'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bindings <span class='name' varname='541'>L</span> <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='542'>V</span> <span class='name' varname='543'>D</span> <b>|</b> <span class='name' varname='547'>Spilled<sub>1</sub></span></div><b>]</b></div> <span class='name' varname='546'>X<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.map.private.bindings (std.map.private.node <span class='name' varname='541'>L</span> <span class='name' varname='542'>V</span> <span class='name' varname='543'>D</span> <span class='name' varname='544'>R</span> _) <span class='name' varname='545'>X</span> <span class='name' varname='546'>X<sub>1</sub></span></div></div></div> -<div class='clause' predicate='std.set.make'><div class='loc'>File "builtin_set.elpi", line 7, column 0, character 16965:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.make <span class='name' varname='548'>Cmp</span> (std.set std.set.private.empty <span class='name' varname='548'>Cmp</span>)</div></div> -<div class='clause' predicate='std.set.mem'><div class='loc'>File "builtin_set.elpi", line 11, column 0, character 17062:</div><div class='hyps'>std.set.private.mem <span class='name' varname='550'>M</span> <span class='name' varname='551'>Cmp</span> <span class='name' varname='549'>E</span></div><div class='concl'><div class='compound'>std.set.mem <span class='name' varname='549'>E</span> (std.set <span class='name' varname='550'>M</span> <span class='name' varname='551'>Cmp</span>)</div></div></div> -<div class='clause' predicate='std.set.add'><div class='loc'>File "builtin_set.elpi", line 15, column 0, character 17177:</div><div class='hyps'>std.set.private.add <span class='name' varname='553'>M</span> <span class='name' varname='554'>Cmp</span> <span class='name' varname='552'>E</span> <span class='name' varname='555'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.set.add <span class='name' varname='552'>E</span> (std.set <span class='name' varname='553'>M</span> <span class='name' varname='554'>Cmp</span>) (std.set <span class='name' varname='555'>M<sub>1</sub></span> <span class='name' varname='554'>Cmp</span>)</div></div></div> -<div class='clause' predicate='std.set.remove'><div class='loc'>File "builtin_set.elpi", line 19, column 0, character 17319:</div><div class='hyps'>std.set.private.remove <span class='name' varname='557'>M</span> <span class='name' varname='558'>Cmp</span> <span class='name' varname='556'>E</span> <span class='name' varname='559'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.set.remove <span class='name' varname='556'>E</span> (std.set <span class='name' varname='557'>M</span> <span class='name' varname='558'>Cmp</span>) (std.set <span class='name' varname='559'>M<sub>1</sub></span> <span class='name' varname='558'>Cmp</span>)</div></div></div> -<div class='clause' predicate='std.set.cardinal'><div class='loc'>File "builtin_set.elpi", line 23, column 0, character 17476:</div><div class='hyps'>std.set.private.cardinal <span class='name' varname='560'>M</span> <span class='name' varname='561'>N</span></div><div class='concl'><div class='compound'>std.set.cardinal (std.set <span class='name' varname='560'>M</span> _) <span class='name' varname='561'>N</span></div></div></div> -<div class='clause' predicate='std.set.elements'><div class='loc'>File "builtin_set.elpi", line 26, column 0, character 17564:</div><div class='hyps'>std.set.private.elements <span class='name' varname='562'>M</span> [] <span class='name' varname='563'>L</span></div><div class='concl'><div class='compound'>std.set.elements (std.set <span class='name' varname='562'>M</span> _) <span class='name' varname='563'>L</span></div></div></div> -<div class='clause' predicate='std.set.private.height'><div class='loc'>File "builtin_set.elpi", line 36, column 0, character 17784:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.height std.set.private.empty 0</div></div> -<div class='clause' predicate='std.set.private.height'><div class='loc'>File "builtin_set.elpi", line 37, column 0, character 17800:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.height (std.set.private.node _ _ _ <span class='name' varname='564'>H</span>) <span class='name' varname='564'>H</span></div></div> -<div class='clause' predicate='std.set.private.create'><div class='loc'>File "builtin_set.elpi", line 40, column 0, character 17870:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='565'>L</span> <span class='name' varname='569'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='567'>R</span> <span class='name' varname='570'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.max <span class='name' varname='569'>Spilled<sub>1</sub></span> <span class='name' varname='570'>Spilled<sub>2</sub></span> <span class='name' varname='571'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='568'>H</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='571'>Spilled<sub>3</sub></span> + </div><div class='compound'>1</div></div></div></div><div class='concl'><div class='compound'>std.set.private.create <span class='name' varname='565'>L</span> <span class='name' varname='566'>E</span> <span class='name' varname='567'>R</span> (std.set.private.node <span class='name' varname='565'>L</span> <span class='name' varname='566'>E</span> <span class='name' varname='567'>R</span> <span class='name' varname='568'>H</span>)</div></div></div> -<div class='clause' predicate='std.set.private.bal'><div class='loc'>File "builtin_set.elpi", line 43, column 0, character 17985:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='572'>L</span> <span class='name' varname='576'>HL</span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='574'>R</span> <span class='name' varname='577'>HR</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='578'>HL<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='576'>HL</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'><div class='compound'><span class='name' varname='579'>HR<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='577'>HR</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'>std.set.private.bal.aux <span class='name' varname='576'>HL</span> <span class='name' varname='577'>HR</span> <span class='name' varname='578'>HL<sub>2</sub></span> <span class='name' varname='579'>HR<sub>2</sub></span> <span class='name' varname='572'>L</span> <span class='name' varname='573'>E</span> <span class='name' varname='574'>R</span> <span class='name' varname='575'>T</span></div></div><div class='concl'><div class='compound'>std.set.private.bal <span class='name' varname='572'>L</span> <span class='name' varname='573'>E</span> <span class='name' varname='574'>R</span> <span class='name' varname='575'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 50, column 0, character 18098:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='580'>HL</span> <span class='name' varname='581'>HR<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='582'>LL</span> <span class='name' varname='589'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='584'>LR</span> <span class='name' varname='590'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='589'>Spilled<sub>2</sub></span> <span class='name' varname='590'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='584'>LR</span> <span class='name' varname='585'>X</span> <span class='name' varname='586'>R</span> <span class='name' varname='588'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='582'>LL</span> <span class='name' varname='583'>LV</span> <span class='name' varname='588'>Spilled<sub>1</sub></span> <span class='name' varname='587'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux <span class='name' varname='580'>HL</span> _ _ <span class='name' varname='581'>HR<sub>2</sub></span> (std.set.private.node <span class='name' varname='582'>LL</span> <span class='name' varname='583'>LV</span> <span class='name' varname='584'>LR</span> _) <span class='name' varname='585'>X</span> <span class='name' varname='586'>R</span> <span class='name' varname='587'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 53, column 0, character 18221:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='591'>HL</span> <span class='name' varname='592'>HR<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='593'>LL</span> <span class='name' varname='594'>LV</span> <span class='name' varname='595'>LRL</span> <span class='name' varname='601'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='597'>LRR</span> <span class='name' varname='598'>X</span> <span class='name' varname='599'>R</span> <span class='name' varname='602'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='601'>Spilled<sub>1</sub></span> <span class='name' varname='596'>LRV</span> <span class='name' varname='602'>Spilled<sub>2</sub></span> <span class='name' varname='600'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux <span class='name' varname='591'>HL</span> _ _ <span class='name' varname='592'>HR<sub>2</sub></span> (std.set.private.node <span class='name' varname='593'>LL</span> <span class='name' varname='594'>LV</span> (std.set.private.node <span class='name' varname='595'>LRL</span> <span class='name' varname='596'>LRV</span> <span class='name' varname='597'>LRR</span> _) _) <span class='name' varname='598'>X</span> <span class='name' varname='599'>R</span> <span class='name' varname='600'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 56, column 0, character 18352:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='603'>HR</span> <span class='name' varname='604'>HL<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='609'>RR</span> <span class='name' varname='612'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='607'>RL</span> <span class='name' varname='613'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='612'>Spilled<sub>2</sub></span> <span class='name' varname='613'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='605'>L</span> <span class='name' varname='606'>X</span> <span class='name' varname='607'>RL</span> <span class='name' varname='611'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='611'>Spilled<sub>1</sub></span> <span class='name' varname='608'>RV</span> <span class='name' varname='609'>RR</span> <span class='name' varname='610'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux _ <span class='name' varname='603'>HR</span> <span class='name' varname='604'>HL<sub>2</sub></span> _ <span class='name' varname='605'>L</span> <span class='name' varname='606'>X</span> (std.set.private.node <span class='name' varname='607'>RL</span> <span class='name' varname='608'>RV</span> <span class='name' varname='609'>RR</span> _) <span class='name' varname='610'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 59, column 0, character 18475:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='614'>HR</span> <span class='name' varname='615'>HL<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='616'>L</span> <span class='name' varname='617'>X</span> <span class='name' varname='618'>RLL</span> <span class='name' varname='624'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='620'>RLR</span> <span class='name' varname='621'>RV</span> <span class='name' varname='622'>RR</span> <span class='name' varname='625'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='624'>Spilled<sub>1</sub></span> <span class='name' varname='619'>RLV</span> <span class='name' varname='625'>Spilled<sub>2</sub></span> <span class='name' varname='623'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux _ <span class='name' varname='614'>HR</span> <span class='name' varname='615'>HL<sub>2</sub></span> _ <span class='name' varname='616'>L</span> <span class='name' varname='617'>X</span> (std.set.private.node (std.set.private.node <span class='name' varname='618'>RLL</span> <span class='name' varname='619'>RLV</span> <span class='name' varname='620'>RLR</span> _) <span class='name' varname='621'>RV</span> <span class='name' varname='622'>RR</span> _) <span class='name' varname='623'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 62, column 0, character 18606:</div><div class='hyps'>std.set.private.create <span class='name' varname='626'>L</span> <span class='name' varname='627'>E</span> <span class='name' varname='628'>R</span> <span class='name' varname='629'>T</span></div><div class='concl'><div class='compound'>std.set.private.bal.aux _ _ _ _ <span class='name' varname='626'>L</span> <span class='name' varname='627'>E</span> <span class='name' varname='628'>R</span> <span class='name' varname='629'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.add'><div class='loc'>File "builtin_set.elpi", line 65, column 0, character 18709:</div><div class='hyps'>std.set.private.create std.set.private.empty <span class='name' varname='630'>E</span> std.set.private.empty <span class='name' varname='631'>T</span></div><div class='concl'><div class='compound'>std.set.private.add std.set.private.empty _ <span class='name' varname='630'>E</span> <span class='name' varname='631'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.add'><div class='loc'>File "builtin_set.elpi", line 66, column 0, character 18752:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='636'>Cmp</span> <span class='name' varname='637'>X<sub>1</sub></span> <span class='name' varname='633'>X</span> <span class='name' varname='639'>E</span>,</div><div class='hyp compound'>std.set.private.add.aux <span class='name' varname='639'>E</span> <span class='name' varname='636'>Cmp</span> <span class='name' varname='632'>L</span> <span class='name' varname='634'>R</span> <span class='name' varname='633'>X</span> <span class='name' varname='637'>X<sub>1</sub></span> <span class='name' varname='635'>H</span> <span class='name' varname='638'>S</span></div></div><div class='concl'><div class='compound'>std.set.private.add (std.set.private.node <span class='name' varname='632'>L</span> <span class='name' varname='633'>X</span> <span class='name' varname='634'>R</span> <span class='name' varname='635'>H</span>) <span class='name' varname='636'>Cmp</span> <span class='name' varname='637'>X<sub>1</sub></span> <span class='name' varname='638'>S</span></div></div></div> -<div class='clause' predicate='std.set.private.add.aux'><div class='loc'>File "builtin_set.elpi", line 67, column 0, character 18823:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.add.aux eq _ <span class='name' varname='640'>L</span> <span class='name' varname='641'>R</span> <span class='name' varname='642'>X</span> _ <span class='name' varname='643'>H</span> (std.set.private.node <span class='name' varname='640'>L</span> <span class='name' varname='642'>X</span> <span class='name' varname='641'>R</span> <span class='name' varname='643'>H</span>)</div></div> -<div class='clause' predicate='std.set.private.add.aux'><div class='loc'>File "builtin_set.elpi", line 68, column 0, character 18862:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.add <span class='name' varname='645'>L</span> <span class='name' varname='644'>Cmp</span> <span class='name' varname='648'>X</span> <span class='name' varname='650'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='650'>Spilled<sub>1</sub></span> <span class='name' varname='647'>E</span> <span class='name' varname='646'>R</span> <span class='name' varname='649'>T</span></div></div><div class='concl'><div class='compound'>std.set.private.add.aux lt <span class='name' varname='644'>Cmp</span> <span class='name' varname='645'>L</span> <span class='name' varname='646'>R</span> <span class='name' varname='647'>E</span> <span class='name' varname='648'>X</span> _ <span class='name' varname='649'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.add.aux'><div class='loc'>File "builtin_set.elpi", line 69, column 0, character 18917:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.add <span class='name' varname='653'>R</span> <span class='name' varname='651'>Cmp</span> <span class='name' varname='655'>X</span> <span class='name' varname='657'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='652'>L</span> <span class='name' varname='654'>E</span> <span class='name' varname='657'>Spilled<sub>1</sub></span> <span class='name' varname='656'>T</span></div></div><div class='concl'><div class='compound'>std.set.private.add.aux gt <span class='name' varname='651'>Cmp</span> <span class='name' varname='652'>L</span> <span class='name' varname='653'>R</span> <span class='name' varname='654'>E</span> <span class='name' varname='655'>X</span> _ <span class='name' varname='656'>T</span></div></div></div> -<div class='clause' predicate='std.set.private.mem'><div class='loc'>File "builtin_set.elpi", line 72, column 0, character 19023:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='661'>Cmp</span> <span class='name' varname='662'>E</span> <span class='name' varname='659'>K</span> <span class='name' varname='663'>O</span>,</div><div class='hyp compound'>std.set.private.mem.aux <span class='name' varname='663'>O</span> <span class='name' varname='661'>Cmp</span> <span class='name' varname='658'>L</span> <span class='name' varname='660'>R</span> <span class='name' varname='662'>E</span></div></div><div class='concl'><div class='compound'>std.set.private.mem (std.set.private.node <span class='name' varname='658'>L</span> <span class='name' varname='659'>K</span> <span class='name' varname='660'>R</span> _) <span class='name' varname='661'>Cmp</span> <span class='name' varname='662'>E</span></div></div></div> -<div class='clause' predicate='std.set.private.mem.aux'><div class='loc'>File "builtin_set.elpi", line 73, column 0, character 19083:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.mem.aux eq _ _ _ _</div></div> -<div class='clause' predicate='std.set.private.mem.aux'><div class='loc'>File "builtin_set.elpi", line 74, column 0, character 19103:</div><div class='hyps'>std.set.private.mem <span class='name' varname='665'>L</span> <span class='name' varname='664'>Cmp</span> <span class='name' varname='666'>E</span></div><div class='concl'><div class='compound'>std.set.private.mem.aux lt <span class='name' varname='664'>Cmp</span> <span class='name' varname='665'>L</span> _ <span class='name' varname='666'>E</span></div></div></div> -<div class='clause' predicate='std.set.private.mem.aux'><div class='loc'>File "builtin_set.elpi", line 75, column 0, character 19140:</div><div class='hyps'>std.set.private.mem <span class='name' varname='668'>R</span> <span class='name' varname='667'>Cmp</span> <span class='name' varname='669'>E</span></div><div class='concl'><div class='compound'>std.set.private.mem.aux gt <span class='name' varname='667'>Cmp</span> _ <span class='name' varname='668'>R</span> <span class='name' varname='669'>E</span></div></div></div> -<div class='clause' predicate='std.set.private.remove-min-binding'><div class='loc'>File "builtin_set.elpi", line 78, column 0, character 19220:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.remove-min-binding (std.set.private.node std.set.private.empty _ <span class='name' varname='670'>R</span> _) <span class='name' varname='670'>R</span></div></div></div> -<div class='clause' predicate='std.set.private.remove-min-binding'><div class='loc'>File "builtin_set.elpi", line 79, column 0, character 19266:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.remove-min-binding <span class='name' varname='671'>L</span> <span class='name' varname='675'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='675'>Spilled<sub>1</sub></span> <span class='name' varname='672'>E</span> <span class='name' varname='673'>R</span> <span class='name' varname='674'>X</span></div></div><div class='concl'><div class='compound'>std.set.private.remove-min-binding (std.set.private.node <span class='name' varname='671'>L</span> <span class='name' varname='672'>E</span> <span class='name' varname='673'>R</span> _) <span class='name' varname='674'>X</span></div></div></div> -<div class='clause' predicate='std.set.private.min-binding'><div class='loc'>File "builtin_set.elpi", line 82, column 0, character 19371:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.min-binding (std.set.private.node std.set.private.empty <span class='name' varname='676'>E</span> _ _) <span class='name' varname='676'>E</span></div></div></div> -<div class='clause' predicate='std.set.private.min-binding'><div class='loc'>File "builtin_set.elpi", line 83, column 0, character 19410:</div><div class='hyps'>std.set.private.min-binding <span class='name' varname='677'>L</span> <span class='name' varname='678'>E</span></div><div class='concl'><div class='compound'>std.set.private.min-binding (std.set.private.node <span class='name' varname='677'>L</span> _ _ _) <span class='name' varname='678'>E</span></div></div></div> -<div class='clause' predicate='std.set.private.merge'><div class='loc'>File "builtin_set.elpi", line 86, column 0, character 19498:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.merge std.set.private.empty <span class='name' varname='679'>X</span> <span class='name' varname='679'>X</span></div></div></div> -<div class='clause' predicate='std.set.private.merge'><div class='loc'>File "builtin_set.elpi", line 87, column 0, character 19520:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.merge <span class='name' varname='680'>X</span> std.set.private.empty <span class='name' varname='680'>X</span></div></div></div> -<div class='clause' predicate='std.set.private.merge'><div class='loc'>File "builtin_set.elpi", line 88, column 0, character 19542:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.min-binding <span class='name' varname='682'>M<sub>2</sub></span> <span class='name' varname='684'>X</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.remove-min-binding <span class='name' varname='682'>M<sub>2</sub></span> <span class='name' varname='685'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='681'>M<sub>1</sub></span> <span class='name' varname='684'>X</span> <span class='name' varname='685'>Spilled<sub>1</sub></span> <span class='name' varname='683'>R</span></div></div></div><div class='concl'><div class='compound'>std.set.private.merge <span class='name' varname='681'>M<sub>1</sub></span> <span class='name' varname='682'>M<sub>2</sub></span> <span class='name' varname='683'>R</span></div></div></div> -<div class='clause' predicate='std.set.private.remove'><div class='loc'>File "builtin_set.elpi", line 93, column 0, character 19680:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.remove std.set.private.empty _ _ std.set.private.empty</div></div> -<div class='clause' predicate='std.set.private.remove'><div class='loc'>File "builtin_set.elpi", line 94, column 0, character 19704:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='689'>Cmp</span> <span class='name' varname='690'>X</span> <span class='name' varname='687'>E</span> <span class='name' varname='692'>O</span>,</div><div class='hyp compound'>std.set.private.remove.aux <span class='name' varname='692'>O</span> <span class='name' varname='689'>Cmp</span> <span class='name' varname='686'>L</span> <span class='name' varname='688'>R</span> <span class='name' varname='687'>E</span> <span class='name' varname='690'>X</span> <span class='name' varname='691'>M</span></div></div><div class='concl'><div class='compound'>std.set.private.remove (std.set.private.node <span class='name' varname='686'>L</span> <span class='name' varname='687'>E</span> <span class='name' varname='688'>R</span> _) <span class='name' varname='689'>Cmp</span> <span class='name' varname='690'>X</span> <span class='name' varname='691'>M</span></div></div></div> -<div class='clause' predicate='std.set.private.remove.aux'><div class='loc'>File "builtin_set.elpi", line 95, column 0, character 19776:</div><div class='hyps'>std.set.private.merge <span class='name' varname='693'>L</span> <span class='name' varname='694'>R</span> <span class='name' varname='695'>M</span></div><div class='concl'><div class='compound'>std.set.private.remove.aux eq _ <span class='name' varname='693'>L</span> <span class='name' varname='694'>R</span> _ _ <span class='name' varname='695'>M</span></div></div></div> -<div class='clause' predicate='std.set.private.remove.aux'><div class='loc'>File "builtin_set.elpi", line 96, column 0, character 19820:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.remove <span class='name' varname='697'>L</span> <span class='name' varname='696'>Cmp</span> <span class='name' varname='700'>X</span> <span class='name' varname='702'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='702'>Spilled<sub>1</sub></span> <span class='name' varname='699'>E</span> <span class='name' varname='698'>R</span> <span class='name' varname='701'>M</span></div></div><div class='concl'><div class='compound'>std.set.private.remove.aux lt <span class='name' varname='696'>Cmp</span> <span class='name' varname='697'>L</span> <span class='name' varname='698'>R</span> <span class='name' varname='699'>E</span> <span class='name' varname='700'>X</span> <span class='name' varname='701'>M</span></div></div></div> -<div class='clause' predicate='std.set.private.remove.aux'><div class='loc'>File "builtin_set.elpi", line 97, column 0, character 19879:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.remove <span class='name' varname='705'>R</span> <span class='name' varname='703'>Cmp</span> <span class='name' varname='707'>X</span> <span class='name' varname='709'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='704'>L</span> <span class='name' varname='706'>E</span> <span class='name' varname='709'>Spilled<sub>1</sub></span> <span class='name' varname='708'>M</span></div></div><div class='concl'><div class='compound'>std.set.private.remove.aux gt <span class='name' varname='703'>Cmp</span> <span class='name' varname='704'>L</span> <span class='name' varname='705'>R</span> <span class='name' varname='706'>E</span> <span class='name' varname='707'>X</span> <span class='name' varname='708'>M</span></div></div></div> -<div class='clause' predicate='std.set.private.cardinal'><div class='loc'>File "builtin_set.elpi", line 100, column 0, character 19969:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.cardinal std.set.private.empty 0</div></div> -<div class='clause' predicate='std.set.private.cardinal'><div class='loc'>File "builtin_set.elpi", line 101, column 0, character 19987:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.cardinal <span class='name' varname='710'>L</span> <span class='name' varname='713'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.cardinal <span class='name' varname='711'>R</span> <span class='name' varname='714'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='712'>N</span> <b>is</b> </div><div class='compound'><div class='compound'><div class='compound'><span class='name' varname='713'>Spilled<sub>1</sub></span> + </div><div class='compound'>1 + </div></div><div class='compound'><span class='name' varname='714'>Spilled<sub>2</sub></span></div></div></div></div><div class='concl'><div class='compound'>std.set.private.cardinal (std.set.private.node <span class='name' varname='710'>L</span> _ <span class='name' varname='711'>R</span> _) <span class='name' varname='712'>N</span></div></div></div> -<div class='clause' predicate='std.set.private.elements'><div class='loc'>File "builtin_set.elpi", line 104, column 0, character 20098:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.elements std.set.private.empty <span class='name' varname='715'>X</span> <span class='name' varname='715'>X</span></div></div> -<div class='clause' predicate='std.set.private.elements'><div class='loc'>File "builtin_set.elpi", line 105, column 0, character 20118:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.elements <span class='name' varname='718'>R</span> <span class='name' varname='719'>Acc</span> <span class='name' varname='721'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.elements <span class='name' varname='716'>L</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='717'>E</span> <b>|</b> <span class='name' varname='721'>Spilled<sub>1</sub></span></div><b>]</b></div> <span class='name' varname='720'>X</span></div></div><div class='concl'><div class='compound'>std.set.private.elements (std.set.private.node <span class='name' varname='716'>L</span> <span class='name' varname='717'>E</span> <span class='name' varname='718'>R</span> _) <span class='name' varname='719'>Acc</span> <span class='name' varname='720'>X</span></div></div></div> -<div class='clause' predicate='printterm'><div class='loc'>File "builtin_set.elpi", line 255, column 0, character 25249:</div><div class='hyps'><div class='hyp compound' level='60'>term_to_string <span class='name' varname='723'>T</span> <span class='name' varname='724'>T<sub>1</sub></span>,</div><div class='hyp compound'>output <span class='name' varname='722'>S</span> <span class='name' varname='724'>T<sub>1</sub></span></div></div><div class='concl'><div class='compound'>printterm <span class='name' varname='722'>S</span> <span class='name' varname='723'>T</span></div></div></div> -<div class='clause' predicate='read'><div class='loc'>File "builtin_set.elpi", line 259, column 0, character 25317:</div><div class='hyps'><div class='hyp compound' level='60'>flush std_out,</div><div class='hyp compound'>input_line std_in <span class='name' varname='726'>X</span>,</div><div class='hyp compound'>string_to_term <span class='name' varname='726'>X</span> <span class='name' varname='725'>S</span></div></div><div class='concl'><div class='compound'>read <span class='name' varname='725'>S</span></div></div></div> -<div class='clause' predicate='whd'><div class='loc'>File "(stdin)", line 7, column 3, character 142:</div><div class='hyps'><div class='hyp compound' level='60'>whd <span class='name' varname='727'>Hd</span> (fun <span class='name' varname='730'>F</span>),</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>whd (<span class='name' varname='730'>F</span> <span class='name' varname='728'>Arg</span>) <span class='name' varname='729'>Reduct</span></div></div><div class='concl'><div class='compound'>whd (app <span class='name' varname='727'>Hd</span> <span class='name' varname='728'>Arg</span>) <span class='name' varname='729'>Reduct</span></div></div></div> -<div class='clause' predicate='whd'><div class='loc'>File "(stdin)", line 11, column 3, character 265:</div><div class='hyps'><div class='compound'><span class='name' varname='732'>Reduct</span> = </div><div class='compound'><span class='name' varname='731'>X</span></div></div><div class='concl'><div class='compound'>whd <span class='name' varname='731'>X</span> <span class='name' varname='732'>Reduct</span></div></div></div> -<div class='clause' predicate='of'><div class='loc'>File "(stdin)", line 10, column 3, character 294:</div><div class='hyps'><div class='hyp compound' level='60'>of <span class='name' varname='733'>Hd</span> (arr <span class='name' varname='736'>A</span> <span class='name' varname='735'>B</span>),</div><div class='hyp compound'>of <span class='name' varname='734'>Arg</span> <span class='name' varname='736'>A</span></div></div><div class='concl'><div class='compound'>of (app <span class='name' varname='733'>Hd</span> <span class='name' varname='734'>Arg</span>) <span class='name' varname='735'>B</span></div></div></div> -<div class='clause' predicate='of'><div class='loc'>File "(stdin)", line 15, column 3, character 459:</div><div class='hyps'><div class='compound'><b>∀</b><span class='name' varname='740'>x<sub>1</sub></span>. </div><div class='compound'><div class='compound'>of <span class='name' varname='740'>x<sub>1</sub></span> <span class='name' varname='738'>A</span> <b>⇒</b> </div><div class='compound'>of (<span class='name' varname='737'>F</span> <span class='name' varname='740'>x<sub>1</sub></span>) <span class='name' varname='739'>B</span></div></div></div><div class='concl'><div class='compound'>of (fun <span class='name' varname='737'>F</span>) (arr <span class='name' varname='738'>A</span> <span class='name' varname='739'>B</span>)</div></div></div> +<div class='clause' predicate='std.fold-right'><div class='loc'>File "builtin_stdlib.elpi", line 117, column 0, character 3796:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.fold-right [] <span class='name' varname='169'>A</span> _ <span class='name' varname='169'>A</span></div></div> +<div class='clause' predicate='std.fold-right'><div class='loc'>File "builtin_stdlib.elpi", line 118, column 0, character 3817:</div><div class='hyps'><div class='hyp compound' level='60'>std.fold-right <span class='name' varname='171'>XS</span> <span class='name' varname='172'>A</span> <span class='name' varname='173'>F</span> <span class='name' varname='175'>A'</span>,</div><div class='hyp compound'><span class='name' varname='173'>F</span> <span class='name' varname='170'>X</span> <span class='name' varname='175'>A'</span> <span class='name' varname='174'>R</span></div></div><div class='concl'><div class='compound'>std.fold-right <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='170'>X</span> <b>|</b> <span class='name' varname='171'>XS</span></div><b>]</b></div> <span class='name' varname='172'>A</span> <span class='name' varname='173'>F</span> <span class='name' varname='174'>R</span></div></div></div> +<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 121, column 0, character 3948:</div><div class='hyps'>std.fatal-error fold2 on lists of different length</div><div class='concl'><div class='compound'>std.fold2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _ _ _</div></div></div> +<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 122, column 0, character 4022:</div><div class='hyps'>std.fatal-error fold2 on lists of different length</div><div class='concl'><div class='compound'>std.fold2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _ _ _</div></div></div> +<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 123, column 0, character 4096:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.fold2 [] [] <span class='name' varname='176'>A</span> _ <span class='name' varname='176'>A</span></div></div> +<div class='clause' predicate='std.fold2'><div class='loc'>File "builtin_stdlib.elpi", line 124, column 0, character 4115:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='182'>F</span> <span class='name' varname='177'>X</span> <span class='name' varname='179'>Y</span> <span class='name' varname='181'>A</span> <span class='name' varname='184'>A<sub>1</sub></span>,</div><div class='hyp compound'>std.fold2 <span class='name' varname='178'>XS</span> <span class='name' varname='180'>YS</span> <span class='name' varname='184'>A<sub>1</sub></span> <span class='name' varname='182'>F</span> <span class='name' varname='183'>R</span></div></div><div class='concl'><div class='compound'>std.fold2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='177'>X</span> <b>|</b> <span class='name' varname='178'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='179'>Y</span> <b>|</b> <span class='name' varname='180'>YS</span></div><b>]</b></div> <span class='name' varname='181'>A</span> <span class='name' varname='182'>F</span> <span class='name' varname='183'>R</span></div></div></div> +<div class='clause' predicate='std.map'><div class='loc'>File "builtin_stdlib.elpi", line 127, column 0, character 4226:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map [] _ []</div></div> +<div class='clause' predicate='std.map'><div class='loc'>File "builtin_stdlib.elpi", line 128, column 0, character 4239:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='187'>F</span> <span class='name' varname='185'>X</span> <span class='name' varname='188'>Y</span>,</div><div class='hyp compound'>std.map <span class='name' varname='186'>XS</span> <span class='name' varname='187'>F</span> <span class='name' varname='189'>YS</span></div></div><div class='concl'><div class='compound'>std.map <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='185'>X</span> <b>|</b> <span class='name' varname='186'>XS</span></div><b>]</b></div> <span class='name' varname='187'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='188'>Y</span> <b>|</b> <span class='name' varname='189'>YS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.map-i'><div class='loc'>File "builtin_stdlib.elpi", line 131, column 0, character 4341:</div><div class='hyps'>std.map-i.aux <span class='name' varname='190'>L</span> 0 <span class='name' varname='191'>F</span> <span class='name' varname='192'>R</span></div><div class='concl'><div class='compound'>std.map-i <span class='name' varname='190'>L</span> <span class='name' varname='191'>F</span> <span class='name' varname='192'>R</span></div></div></div> +<div class='clause' predicate='std.map-i.aux'><div class='loc'>File "builtin_stdlib.elpi", line 132, column 0, character 4375:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map-i.aux [] _ _ []</div></div> +<div class='clause' predicate='std.map-i.aux'><div class='loc'>File "builtin_stdlib.elpi", line 133, column 0, character 4396:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='196'>F</span> <span class='name' varname='195'>N</span> <span class='name' varname='193'>X</span> <span class='name' varname='197'>Y</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='199'>M</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='195'>N</span> + </div><div class='compound'>1,</div></div></div><div class='hyp compound'>std.map-i.aux <span class='name' varname='194'>XS</span> <span class='name' varname='199'>M</span> <span class='name' varname='196'>F</span> <span class='name' varname='198'>YS</span></div></div><div class='concl'><div class='compound'>std.map-i.aux <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='193'>X</span> <b>|</b> <span class='name' varname='194'>XS</span></div><b>]</b></div> <span class='name' varname='195'>N</span> <span class='name' varname='196'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='197'>Y</span> <b>|</b> <span class='name' varname='198'>YS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.map-filter'><div class='loc'>File "builtin_stdlib.elpi", line 136, column 0, character 4526:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map-filter [] _ []</div></div> +<div class='clause' predicate='std.map-filter'><div class='loc'>File "builtin_stdlib.elpi", line 137, column 0, character 4546:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='202'>F</span> <span class='name' varname='200'>X</span> <span class='name' varname='203'>Y</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.map-filter <span class='name' varname='201'>XS</span> <span class='name' varname='202'>F</span> <span class='name' varname='204'>YS</span></div></div><div class='concl'><div class='compound'>std.map-filter <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='200'>X</span> <b>|</b> <span class='name' varname='201'>XS</span></div><b>]</b></div> <span class='name' varname='202'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='203'>Y</span> <b>|</b> <span class='name' varname='204'>YS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.map-filter'><div class='loc'>File "builtin_stdlib.elpi", line 138, column 0, character 4606:</div><div class='hyps'>std.map-filter <span class='name' varname='205'>XS</span> <span class='name' varname='206'>F</span> <span class='name' varname='207'>YS</span></div><div class='concl'><div class='compound'>std.map-filter <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='205'>XS</span></div><b>]</b></div> <span class='name' varname='206'>F</span> <span class='name' varname='207'>YS</span></div></div></div> +<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 142, column 0, character 4730:</div><div class='hyps'>std.fatal-error map2 on lists of different length</div><div class='concl'><div class='compound'>std.map2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _ _</div></div></div> +<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 143, column 0, character 4800:</div><div class='hyps'>std.fatal-error map2 on lists of different length</div><div class='concl'><div class='compound'>std.map2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _ _</div></div></div> +<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 144, column 0, character 4870:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map2 [] [] _ []</div></div> +<div class='clause' predicate='std.map2'><div class='loc'>File "builtin_stdlib.elpi", line 145, column 0, character 4887:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='212'>F</span> <span class='name' varname='208'>X</span> <span class='name' varname='210'>Y</span> <span class='name' varname='213'>Z</span>,</div><div class='hyp compound'>std.map2 <span class='name' varname='209'>XS</span> <span class='name' varname='211'>YS</span> <span class='name' varname='212'>F</span> <span class='name' varname='214'>ZS</span></div></div><div class='concl'><div class='compound'>std.map2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='208'>X</span> <b>|</b> <span class='name' varname='209'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='210'>Y</span> <b>|</b> <span class='name' varname='211'>YS</span></div><b>]</b></div> <span class='name' varname='212'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='213'>Z</span> <b>|</b> <span class='name' varname='214'>ZS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 148, column 0, character 5017:</div><div class='hyps'>std.fatal-error map2-filter on lists of different length</div><div class='concl'><div class='compound'>std.map2-filter [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _ _</div></div></div> +<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 149, column 0, character 5101:</div><div class='hyps'>std.fatal-error map2-filter on lists of different length</div><div class='concl'><div class='compound'>std.map2-filter <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _ _</div></div></div> +<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 150, column 0, character 5185:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map2-filter [] [] _ []</div></div> +<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 151, column 0, character 5209:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='219'>F</span> <span class='name' varname='215'>X</span> <span class='name' varname='217'>Y</span> <span class='name' varname='220'>Z</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.map2-filter <span class='name' varname='216'>XS</span> <span class='name' varname='218'>YS</span> <span class='name' varname='219'>F</span> <span class='name' varname='221'>ZS</span></div></div><div class='concl'><div class='compound'>std.map2-filter <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='215'>X</span> <b>|</b> <span class='name' varname='216'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='217'>Y</span> <b>|</b> <span class='name' varname='218'>YS</span></div><b>]</b></div> <span class='name' varname='219'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='220'>Z</span> <b>|</b> <span class='name' varname='221'>ZS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.map2-filter'><div class='loc'>File "builtin_stdlib.elpi", line 152, column 0, character 5283:</div><div class='hyps'>std.map2-filter <span class='name' varname='222'>XS</span> <span class='name' varname='223'>YS</span> <span class='name' varname='224'>F</span> <span class='name' varname='225'>ZS</span></div><div class='concl'><div class='compound'>std.map2-filter <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='222'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='223'>YS</span></div><b>]</b></div> <span class='name' varname='224'>F</span> <span class='name' varname='225'>ZS</span></div></div></div> +<div class='clause' predicate='std.map-ok'><div class='loc'>File "builtin_stdlib.elpi", line 155, column 0, character 5422:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='228'>P</span> <span class='name' varname='226'>X</span> <span class='name' varname='229'>Y</span> <span class='name' varname='232'>S<sub>0</sub></span>,</div><div class='hyp compound'>if <div class='compound'>(<span class='name' varname='232'>S<sub>0</sub></span> = </div><div class='compound'>ok)</div> (std.map-ok <span class='name' varname='227'>L</span> <span class='name' varname='228'>P</span> <span class='name' varname='230'>YS</span> <span class='name' varname='231'>S</span>) <div class='compound'>(<span class='name' varname='231'>S</span> = </div><div class='compound'><span class='name' varname='232'>S<sub>0</sub></span>)</div></div></div><div class='concl'><div class='compound'>std.map-ok <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='226'>X</span> <b>|</b> <span class='name' varname='227'>L</span></div><b>]</b></div> <span class='name' varname='228'>P</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='229'>Y</span> <b>|</b> <span class='name' varname='230'>YS</span></div><b>]</b></div> <span class='name' varname='231'>S</span></div></div></div> +<div class='clause' predicate='std.map-ok'><div class='loc'>File "builtin_stdlib.elpi", line 156, column 0, character 5500:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map-ok [] _ [] ok</div></div> +<div class='clause' predicate='std.fold-map'><div class='loc'>File "builtin_stdlib.elpi", line 159, column 0, character 5594:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.fold-map [] <span class='name' varname='233'>A</span> _ [] <span class='name' varname='233'>A</span></div></div> +<div class='clause' predicate='std.fold-map'><div class='loc'>File "builtin_stdlib.elpi", line 160, column 0, character 5616:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='237'>F</span> <span class='name' varname='234'>X</span> <span class='name' varname='236'>A</span> <span class='name' varname='238'>Y</span> <span class='name' varname='241'>A<sub>1</sub></span>,</div><div class='hyp compound'>std.fold-map <span class='name' varname='235'>XS</span> <span class='name' varname='241'>A<sub>1</sub></span> <span class='name' varname='237'>F</span> <span class='name' varname='239'>YS</span> <span class='name' varname='240'>A<sub>2</sub></span></div></div><div class='concl'><div class='compound'>std.fold-map <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='234'>X</span> <b>|</b> <span class='name' varname='235'>XS</span></div><b>]</b></div> <span class='name' varname='236'>A</span> <span class='name' varname='237'>F</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='238'>Y</span> <b>|</b> <span class='name' varname='239'>YS</span></div><b>]</b></div> <span class='name' varname='240'>A<sub>2</sub></span></div></div></div> +<div class='clause' predicate='std.omap'><div class='loc'>File "builtin_stdlib.elpi", line 163, column 0, character 5740:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.omap none _ none</div></div> +<div class='clause' predicate='std.omap'><div class='loc'>File "builtin_stdlib.elpi", line 164, column 0, character 5758:</div><div class='hyps'><span class='name' varname='243'>F</span> <span class='name' varname='242'>X</span> <span class='name' varname='244'>Y</span></div><div class='concl'><div class='compound'>std.omap (some <span class='name' varname='242'>X</span>) <span class='name' varname='243'>F</span> (some <span class='name' varname='244'>Y</span>)</div></div></div> +<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 168, column 0, character 5898:</div><div class='hyps'><div class='hyp compound' level='60'><div class='compound'><span class='name' varname='245'>X</span> = </div><div class='compound'><span class='name' varname='246'>R</span></div></div></div><div class='concl neckcut'><div class='compound'>std.nth 0 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='245'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='246'>R</span></div></div></div> +<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 169, column 0, character 5926:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='247'>N</span> 0,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='250'>N<sub>1</sub></span> <b>is</b> </div><div class='compound'>- <span class='name' varname='247'>N</span> 1,</div></div><div class='hyp compound'>std.nth <span class='name' varname='250'>N<sub>1</sub></span> <span class='name' varname='248'>XS</span> <span class='name' varname='249'>R</span></div></div><div class='concl'><div class='compound'>std.nth <span class='name' varname='247'>N</span> <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='248'>XS</span></div><b>]</b></div> <span class='name' varname='249'>R</span></div></div></div> +<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 170, column 0, character 5980:</div><div class='hyps'><div class='hyp compound' level='60'><div class='compound'><span class='name' varname='251'>N</span> < </div><div class='compound'>0,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.fatal-error nth got a negative index</div></div><div class='concl'><div class='compound'>std.nth <span class='name' varname='251'>N</span> _ _</div></div></div> +<div class='clause' predicate='std.nth'><div class='loc'>File "builtin_stdlib.elpi", line 171, column 0, character 6043:</div><div class='hyps'>std.fatal-error nth run out of list items</div><div class='concl'><div class='compound'>std.nth _ _ _</div></div></div> +<div class='clause' predicate='std.lookup'><div class='loc'>File "builtin_stdlib.elpi", line 175, column 0, character 6184:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.lookup <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='252'>X</span> <span class='name' varname='253'>Y</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='252'>X</span> <span class='name' varname='253'>Y</span></div></div> +<div class='clause' predicate='std.lookup'><div class='loc'>File "builtin_stdlib.elpi", line 176, column 0, character 6207:</div><div class='hyps'>std.lookup <span class='name' varname='254'>LS</span> <span class='name' varname='255'>X</span> <span class='name' varname='256'>Y</span></div><div class='concl'><div class='compound'>std.lookup <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='254'>LS</span></div><b>]</b></div> <span class='name' varname='255'>X</span> <span class='name' varname='256'>Y</span></div></div></div> +<div class='clause' predicate='std.lookup!'><div class='loc'>File "builtin_stdlib.elpi", line 180, column 0, character 6366:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.lookup! <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='257'>X</span> <span class='name' varname='258'>Y</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='257'>X</span> <span class='name' varname='258'>Y</span></div></div></div> +<div class='clause' predicate='std.lookup!'><div class='loc'>File "builtin_stdlib.elpi", line 181, column 0, character 6395:</div><div class='hyps'>std.lookup! <span class='name' varname='259'>LS</span> <span class='name' varname='260'>X</span> <span class='name' varname='261'>Y</span></div><div class='concl'><div class='compound'>std.lookup! <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='259'>LS</span></div><b>]</b></div> <span class='name' varname='260'>X</span> <span class='name' varname='261'>Y</span></div></div></div> +<div class='clause' predicate='std.mem!'><div class='loc'>File "builtin_stdlib.elpi", line 185, column 0, character 6514:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.mem! <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='262'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='262'>X</span></div></div></div> +<div class='clause' predicate='std.mem!'><div class='loc'>File "builtin_stdlib.elpi", line 186, column 0, character 6533:</div><div class='hyps'>std.mem! <span class='name' varname='263'>L</span> <span class='name' varname='264'>X</span></div><div class='concl'><div class='compound'>std.mem! <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='263'>L</span></div><b>]</b></div> <span class='name' varname='264'>X</span></div></div></div> +<div class='clause' predicate='std.mem'><div class='loc'>File "builtin_stdlib.elpi", line 190, column 0, character 6638:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.mem <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='265'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='265'>X</span></div></div> +<div class='clause' predicate='std.mem'><div class='loc'>File "builtin_stdlib.elpi", line 191, column 0, character 6651:</div><div class='hyps'>std.mem <span class='name' varname='266'>L</span> <span class='name' varname='267'>X</span></div><div class='concl'><div class='compound'>std.mem <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='266'>L</span></div><b>]</b></div> <span class='name' varname='267'>X</span></div></div></div> +<div class='clause' predicate='std.exists'><div class='loc'>File "builtin_stdlib.elpi", line 194, column 0, character 6713:</div><div class='hyps'><span class='name' varname='269'>P</span> <span class='name' varname='268'>X</span></div><div class='concl'><div class='compound'>std.exists <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='268'>X</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='269'>P</span></div></div></div> +<div class='clause' predicate='std.exists'><div class='loc'>File "builtin_stdlib.elpi", line 195, column 0, character 6736:</div><div class='hyps'>std.exists <span class='name' varname='270'>L</span> <span class='name' varname='271'>P</span></div><div class='concl'><div class='compound'>std.exists <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='270'>L</span></div><b>]</b></div> <span class='name' varname='271'>P</span></div></div></div> +<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 198, column 0, character 6820:</div><div class='hyps'>std.fatal-error exists2 on lists of different length</div><div class='concl'><div class='compound'>std.exists2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _</div></div></div> +<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 199, column 0, character 6894:</div><div class='hyps'>std.fatal-error exists2 on lists of different length</div><div class='concl'><div class='compound'>std.exists2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _</div></div></div> +<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 200, column 0, character 6968:</div><div class='hyps'><span class='name' varname='274'>P</span> <span class='name' varname='272'>X</span> <span class='name' varname='273'>Y</span></div><div class='concl'><div class='compound'>std.exists2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='272'>X</span> <b>|</b> _</div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='273'>Y</span> <b>|</b> _</div><b>]</b></div> <span class='name' varname='274'>P</span></div></div></div> +<div class='clause' predicate='std.exists2'><div class='loc'>File "builtin_stdlib.elpi", line 201, column 0, character 7000:</div><div class='hyps'>std.exists2 <span class='name' varname='275'>L</span> <span class='name' varname='276'>M</span> <span class='name' varname='277'>P</span></div><div class='concl'><div class='compound'>std.exists2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='275'>L</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> <span class='name' varname='276'>M</span></div><b>]</b></div> <span class='name' varname='277'>P</span></div></div></div> +<div class='clause' predicate='std.forall'><div class='loc'>File "builtin_stdlib.elpi", line 204, column 0, character 7078:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.forall [] _</div></div> +<div class='clause' predicate='std.forall'><div class='loc'>File "builtin_stdlib.elpi", line 205, column 0, character 7091:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='280'>P</span> <span class='name' varname='278'>X</span>,</div><div class='hyp compound'>std.forall <span class='name' varname='279'>L</span> <span class='name' varname='280'>P</span></div></div><div class='concl'><div class='compound'>std.forall <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='278'>X</span> <b>|</b> <span class='name' varname='279'>L</span></div><b>]</b></div> <span class='name' varname='280'>P</span></div></div></div> +<div class='clause' predicate='std.forall-ok'><div class='loc'>File "builtin_stdlib.elpi", line 208, column 0, character 7195:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='283'>P</span> <span class='name' varname='281'>X</span> <span class='name' varname='285'>S<sub>0</sub></span>,</div><div class='hyp compound'>if <div class='compound'>(<span class='name' varname='285'>S<sub>0</sub></span> = </div><div class='compound'>ok)</div> (std.forall-ok <span class='name' varname='282'>L</span> <span class='name' varname='283'>P</span> <span class='name' varname='284'>S</span>) <div class='compound'>(<span class='name' varname='284'>S</span> = </div><div class='compound'><span class='name' varname='285'>S<sub>0</sub></span>)</div></div></div><div class='concl'><div class='compound'>std.forall-ok <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='281'>X</span> <b>|</b> <span class='name' varname='282'>L</span></div><b>]</b></div> <span class='name' varname='283'>P</span> <span class='name' varname='284'>S</span></div></div></div> +<div class='clause' predicate='std.forall-ok'><div class='loc'>File "builtin_stdlib.elpi", line 209, column 0, character 7267:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.forall-ok [] _ ok</div></div> +<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 212, column 0, character 7340:</div><div class='hyps'>std.fatal-error forall2 on lists of different length</div><div class='concl'><div class='compound'>std.forall2 [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _</div></div></div> +<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 213, column 0, character 7414:</div><div class='hyps'>std.fatal-error forall2 on lists of different length</div><div class='concl'><div class='compound'>std.forall2 <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _</div></div></div> +<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 214, column 0, character 7488:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='290'>P</span> <span class='name' varname='286'>X</span> <span class='name' varname='288'>Y</span>,</div><div class='hyp compound'>std.forall2 <span class='name' varname='287'>XS</span> <span class='name' varname='289'>YS</span> <span class='name' varname='290'>P</span></div></div><div class='concl'><div class='compound'>std.forall2 <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='286'>X</span> <b>|</b> <span class='name' varname='287'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='288'>Y</span> <b>|</b> <span class='name' varname='289'>YS</span></div><b>]</b></div> <span class='name' varname='290'>P</span></div></div></div> +<div class='clause' predicate='std.forall2'><div class='loc'>File "builtin_stdlib.elpi", line 215, column 0, character 7539:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.forall2 [] [] _</div></div> +<div class='clause' predicate='std.filter'><div class='loc'>File "builtin_stdlib.elpi", line 218, column 0, character 7604:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.filter [] _ []</div></div> +<div class='clause' predicate='std.filter'><div class='loc'>File "builtin_stdlib.elpi", line 219, column 0, character 7623:</div><div class='hyps'><div class='hyp compound' level='60'>if (<span class='name' varname='293'>P</span> <span class='name' varname='291'>X</span>) <div class='compound'>(<span class='name' varname='294'>R</span> = </div><div class='compound'><div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='291'>X</span> <b>|</b> <span class='name' varname='295'>L<sub>1</sub></span></div><b>]</b></div>)</div> <div class='compound'>(<span class='name' varname='294'>R</span> = </div><div class='compound'><span class='name' varname='295'>L<sub>1</sub></span>),</div></div><div class='hyp compound'>std.filter <span class='name' varname='292'>L</span> <span class='name' varname='293'>P</span> <span class='name' varname='295'>L<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.filter <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='291'>X</span> <b>|</b> <span class='name' varname='292'>L</span></div><b>]</b></div> <span class='name' varname='293'>P</span> <span class='name' varname='294'>R</span></div></div></div> +<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 222, column 0, character 7740:</div><div class='hyps'>std.fatal-error zip on lists of different length</div><div class='concl'><div class='compound'>std.zip <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> [] _</div></div></div> +<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 223, column 0, character 7806:</div><div class='hyps'>std.fatal-error zip on lists of different length</div><div class='concl'><div class='compound'>std.zip [] <div class='compound' level='99'><b>[</b><div class='compound'>_ <b>|</b> _</div><b>]</b></div> _</div></div></div> +<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 224, column 0, character 7872:</div><div class='hyps'>std.zip <span class='name' varname='297'>LX</span> <span class='name' varname='299'>LY</span> <span class='name' varname='300'>LR</span></div><div class='concl'><div class='compound'>std.zip <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='296'>X</span> <b>|</b> <span class='name' varname='297'>LX</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='298'>Y</span> <b>|</b> <span class='name' varname='299'>LY</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='296'>X</span> <span class='name' varname='298'>Y</span> <b>|</b> <span class='name' varname='300'>LR</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.zip'><div class='loc'>File "builtin_stdlib.elpi", line 225, column 0, character 7919:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.zip [] [] []</div></div> +<div class='clause' predicate='std.unzip'><div class='loc'>File "builtin_stdlib.elpi", line 228, column 0, character 7984:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.unzip [] [] []</div></div> +<div class='clause' predicate='std.unzip'><div class='loc'>File "builtin_stdlib.elpi", line 229, column 0, character 8000:</div><div class='hyps'>std.unzip <span class='name' varname='303'>L</span> <span class='name' varname='304'>LX</span> <span class='name' varname='305'>LY</span></div><div class='concl'><div class='compound'>std.unzip <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='301'>X</span> <span class='name' varname='302'>Y</span> <b>|</b> <span class='name' varname='303'>L</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='301'>X</span> <b>|</b> <span class='name' varname='304'>LX</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='302'>Y</span> <b>|</b> <span class='name' varname='305'>LY</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.flatten'><div class='loc'>File "builtin_stdlib.elpi", line 232, column 0, character 8090:</div><div class='hyps'><div class='hyp compound' level='60'>std.flatten <span class='name' varname='307'>LS</span> <span class='name' varname='309'>LS'</span>,</div><div class='hyp compound'>std.append <span class='name' varname='306'>X</span> <span class='name' varname='309'>LS'</span> <span class='name' varname='308'>R</span></div></div><div class='concl'><div class='compound'>std.flatten <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='306'>X</span> <b>|</b> <span class='name' varname='307'>LS</span></div><b>]</b></div> <span class='name' varname='308'>R</span></div></div></div> +<div class='clause' predicate='std.flatten'><div class='loc'>File "builtin_stdlib.elpi", line 233, column 0, character 8142:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.flatten [] []</div></div> +<div class='clause' predicate='std.null'><div class='loc'>File "builtin_stdlib.elpi", line 236, column 0, character 8182:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.null []</div></div> +<div class='clause' predicate='std.iota'><div class='loc'>File "builtin_stdlib.elpi", line 239, column 0, character 8221:</div><div class='hyps'>std.iota.aux 0 <span class='name' varname='310'>N</span> <span class='name' varname='311'>L</span></div><div class='concl'><div class='compound'>std.iota <span class='name' varname='310'>N</span> <span class='name' varname='311'>L</span></div></div></div> +<div class='clause' predicate='std.iota.aux'><div class='loc'>File "builtin_stdlib.elpi", line 240, column 0, character 8249:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.iota.aux <span class='name' varname='312'>X</span> <span class='name' varname='312'>X</span> []</div></div></div> +<div class='clause' predicate='std.iota.aux'><div class='loc'>File "builtin_stdlib.elpi", line 241, column 0, character 8271:</div><div class='hyps'><div class='hyp compound' level='60'><div class='compound'><span class='name' varname='316'>M</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='313'>N</span> + </div><div class='compound'>1,</div></div></div><div class='hyp compound'>std.iota.aux <span class='name' varname='316'>M</span> <span class='name' varname='314'>X</span> <span class='name' varname='315'>R</span></div></div><div class='concl'><div class='compound'>std.iota.aux <span class='name' varname='313'>N</span> <span class='name' varname='314'>X</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='313'>N</span> <b>|</b> <span class='name' varname='315'>R</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.intersperse'><div class='loc'>File "builtin_stdlib.elpi", line 246, column 0, character 8423:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.intersperse _ [] []</div></div> +<div class='clause' predicate='std.intersperse'><div class='loc'>File "builtin_stdlib.elpi", line 247, column 0, character 8444:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.intersperse _ <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='317'>X</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='317'>X</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.intersperse'><div class='loc'>File "builtin_stdlib.elpi", line 248, column 0, character 8472:</div><div class='hyps'>std.intersperse <span class='name' varname='318'>Sep</span> <span class='name' varname='320'>XS</span> <span class='name' varname='321'>YS</span></div><div class='concl'><div class='compound'>std.intersperse <span class='name' varname='318'>Sep</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='319'>X</span> <b>|</b> <span class='name' varname='320'>XS</span></div><b>]</b></div> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='319'>X</span><b>,</b></div><div class='compound'> <span class='name' varname='318'>Sep</span> <b>|</b> <span class='name' varname='321'>YS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.flip'><div class='loc'>File "builtin_stdlib.elpi", line 253, column 0, character 8588:</div><div class='hyps'><span class='name' varname='322'>P</span> <span class='name' varname='324'>Y</span> <span class='name' varname='323'>X</span></div><div class='concl'><div class='compound'>std.flip <span class='name' varname='322'>P</span> <span class='name' varname='323'>X</span> <span class='name' varname='324'>Y</span></div></div></div> +<div class='clause' predicate='std.time'><div class='loc'>File "builtin_stdlib.elpi", line 256, column 0, character 8637:</div><div class='hyps'><div class='hyp compound' level='60'>gettimeofday <span class='name' varname='327'>Before</span>,</div><div class='hyp compound'><span class='name' varname='325'>P</span>,</div><div class='hyp compound'>gettimeofday <span class='name' varname='328'>After</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='326'>T</span> <b>is</b> </div><div class='compound'>- <span class='name' varname='328'>After</span> <span class='name' varname='327'>Before</span></div></div></div><div class='concl'><div class='compound'>std.time <span class='name' varname='325'>P</span> <span class='name' varname='326'>T</span></div></div></div> +<div class='clause' predicate='std.do!'><div class='loc'>File "builtin_stdlib.elpi", line 259, column 0, character 8737:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.do! []</div></div> +<div class='clause' predicate='std.do!'><div class='loc'>File "builtin_stdlib.elpi", line 260, column 0, character 8745:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='329'>P</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.do! <span class='name' varname='330'>PS</span></div></div><div class='concl'><div class='compound'>std.do! <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='329'>P</span> <b>|</b> <span class='name' varname='330'>PS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.do-ok!'><div class='loc'>File "builtin_stdlib.elpi", line 264, column 0, character 8841:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.do-ok! ok []</div></div> +<div class='clause' predicate='std.do-ok!'><div class='loc'>File "builtin_stdlib.elpi", line 265, column 0, character 8855:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='332'>P</span> <span class='name' varname='334'>S<sub>0</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>if <div class='compound'>(<span class='name' varname='334'>S<sub>0</sub></span> = </div><div class='compound'>ok)</div> (std.do-ok! <span class='name' varname='331'>S</span> <span class='name' varname='333'>PS</span>) <div class='compound'>(<span class='name' varname='331'>S</span> = </div><div class='compound'><span class='name' varname='334'>S<sub>0</sub></span>)</div></div></div><div class='concl'><div class='compound'>std.do-ok! <span class='name' varname='331'>S</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='332'>P</span> <b>|</b> <span class='name' varname='333'>PS</span></div><b>]</b></div></div></div></div> +<div class='clause' predicate='std.lift-ok'><div class='loc'>File "builtin_stdlib.elpi", line 268, column 0, character 8966:</div><div class='hyps'><div class='compound'><div class='hyp compound' level='60'>(<span class='name' varname='335'>P</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='337'>R</span> = </div><div class='compound'>ok ; </div></div></div><div class='compound'><div class='compound'><span class='name' varname='337'>R</span> = </div><div class='compound'>(error <span class='name' varname='336'>Msg</span>))</div></div></div><div class='concl'><div class='compound'>std.lift-ok <span class='name' varname='335'>P</span> <span class='name' varname='336'>Msg</span> <span class='name' varname='337'>R</span></div></div></div> +<div class='clause' predicate='std.spy-do!'><div class='loc'>File "builtin_stdlib.elpi", line 271, column 0, character 9040:</div><div class='hyps'><div class='hyp compound' level='60'>std.map <span class='name' varname='338'>L</span> <div class='compound' level='70'><b>λ</b><span class='name' varname='340'>x<sub>1</sub></span>. </div><div class='compound'><div class='compound' level='70'><b>λ</b><span class='name' varname='341'>x<sub>2</sub></span>. </div><div class='compound'><div class='compound'><span class='name' varname='341'>x<sub>2</sub></span> = </div><div class='compound'>(std.spy <span class='name' varname='340'>x<sub>1</sub></span>)</div></div></div> <span class='name' varname='339'>L<sub>1</sub></span>,</div><div class='hyp compound'>std.do! <span class='name' varname='339'>L<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.spy-do! <span class='name' varname='338'>L</span></div></div></div> +<div class='clause' predicate='std.while-ok-do!'><div class='loc'>File "builtin_stdlib.elpi", line 274, column 0, character 9163:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.while-ok-do! <div class='compound'>(error _ <b>as</b> </div><div class='compound'><span class='name' varname='342'>E</span>)</div> _ <span class='name' varname='342'>E</span></div></div> +<div class='clause' predicate='std.while-ok-do!'><div class='loc'>File "builtin_stdlib.elpi", line 275, column 0, character 9196:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.while-ok-do! ok [] ok</div></div> +<div class='clause' predicate='std.while-ok-do!'><div class='loc'>File "builtin_stdlib.elpi", line 276, column 0, character 9219:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='343'>P</span> <span class='name' varname='346'>C</span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>std.while-ok-do! <span class='name' varname='346'>C</span> <span class='name' varname='344'>PS</span> <span class='name' varname='345'>R</span></div></div><div class='concl'><div class='compound'>std.while-ok-do! ok <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='343'>P</span> <b>|</b> <span class='name' varname='344'>PS</span></div><b>]</b></div> <span class='name' varname='345'>R</span></div></div></div> +<div class='clause' predicate='std.any->string'><div class='loc'>File "builtin_stdlib.elpi", line 279, column 0, character 9309:</div><div class='hyps'>term_to_string <span class='name' varname='347'>X</span> <span class='name' varname='348'>Y</span></div><div class='concl'><div class='compound'>std.any->string <span class='name' varname='347'>X</span> <span class='name' varname='348'>Y</span></div></div></div> +<div class='clause' predicate='std.max'><div class='loc'>File "builtin_stdlib.elpi", line 282, column 0, character 9373:</div><div class='hyps'><div class='hyp compound' level='60'>>= <span class='name' varname='349'>N</span> <span class='name' varname='350'>M</span>,</div><div class='hyp compound'><span class='cut'>!</span></div></div><div class='concl'><div class='compound'>std.max <span class='name' varname='349'>N</span> <span class='name' varname='350'>M</span> <span class='name' varname='349'>N</span></div></div></div> +<div class='clause' predicate='std.max'><div class='loc'>File "builtin_stdlib.elpi", line 283, column 0, character 9397:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.max _ <span class='name' varname='351'>M</span> <span class='name' varname='351'>M</span></div></div> +<div class='clause' predicate='std.findall'><div class='loc'>File "builtin_stdlib.elpi", line 287, column 0, character 9520:</div><div class='hyps'>findall_solutions <span class='name' varname='352'>P</span> <span class='name' varname='353'>L</span></div><div class='concl'><div class='compound'>std.findall <span class='name' varname='352'>P</span> <span class='name' varname='353'>L</span></div></div></div> +<div class='clause' predicate='std.map.make'><div class='loc'>File "builtin_map.elpi", line 7, column 0, character 10094:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.make <span class='name' varname='354'>Cmp</span> (std.map std.map.private.empty <span class='name' varname='354'>Cmp</span>)</div></div> +<div class='clause' predicate='std.map.find'><div class='loc'>File "builtin_map.elpi", line 11, column 0, character 10226:</div><div class='hyps'>std.map.private.find <span class='name' varname='356'>M</span> <span class='name' varname='357'>Cmp</span> <span class='name' varname='355'>K</span> <span class='name' varname='358'>V</span></div><div class='concl'><div class='compound'>std.map.find <span class='name' varname='355'>K</span> (std.map <span class='name' varname='356'>M</span> <span class='name' varname='357'>Cmp</span>) <span class='name' varname='358'>V</span></div></div></div> +<div class='clause' predicate='std.map.add'><div class='loc'>File "builtin_map.elpi", line 15, column 0, character 10375:</div><div class='hyps'>std.map.private.add <span class='name' varname='361'>M</span> <span class='name' varname='362'>Cmp</span> <span class='name' varname='359'>K</span> <span class='name' varname='360'>V</span> <span class='name' varname='363'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.map.add <span class='name' varname='359'>K</span> <span class='name' varname='360'>V</span> (std.map <span class='name' varname='361'>M</span> <span class='name' varname='362'>Cmp</span>) (std.map <span class='name' varname='363'>M<sub>1</sub></span> <span class='name' varname='362'>Cmp</span>)</div></div></div> +<div class='clause' predicate='std.map.remove'><div class='loc'>File "builtin_map.elpi", line 19, column 0, character 10538:</div><div class='hyps'>std.map.private.remove <span class='name' varname='365'>M</span> <span class='name' varname='366'>Cmp</span> <span class='name' varname='364'>K</span> <span class='name' varname='367'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.map.remove <span class='name' varname='364'>K</span> (std.map <span class='name' varname='365'>M</span> <span class='name' varname='366'>Cmp</span>) (std.map <span class='name' varname='367'>M<sub>1</sub></span> <span class='name' varname='366'>Cmp</span>)</div></div></div> +<div class='clause' predicate='std.map.bindings'><div class='loc'>File "builtin_map.elpi", line 23, column 0, character 10721:</div><div class='hyps'>std.map.private.bindings <span class='name' varname='368'>M</span> [] <span class='name' varname='369'>L</span></div><div class='concl'><div class='compound'>std.map.bindings (std.map <span class='name' varname='368'>M</span> _) <span class='name' varname='369'>L</span></div></div></div> +<div class='clause' predicate='std.map.private.height'><div class='loc'>File "builtin_map.elpi", line 33, column 0, character 10964:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.height std.map.private.empty 0</div></div> +<div class='clause' predicate='std.map.private.height'><div class='loc'>File "builtin_map.elpi", line 34, column 0, character 10980:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.height (std.map.private.node _ _ _ _ <span class='name' varname='370'>H</span>) <span class='name' varname='370'>H</span></div></div> +<div class='clause' predicate='std.map.private.create'><div class='loc'>File "builtin_map.elpi", line 37, column 0, character 11063:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='371'>L</span> <span class='name' varname='376'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='374'>R</span> <span class='name' varname='377'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.max <span class='name' varname='376'>Spilled<sub>1</sub></span> <span class='name' varname='377'>Spilled<sub>2</sub></span> <span class='name' varname='378'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='375'>H</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='378'>Spilled<sub>3</sub></span> + </div><div class='compound'>1</div></div></div></div><div class='concl'><div class='compound'>std.map.private.create <span class='name' varname='371'>L</span> <span class='name' varname='372'>K</span> <span class='name' varname='373'>V</span> <span class='name' varname='374'>R</span> (std.map.private.node <span class='name' varname='371'>L</span> <span class='name' varname='372'>K</span> <span class='name' varname='373'>V</span> <span class='name' varname='374'>R</span> <span class='name' varname='375'>H</span>)</div></div></div> +<div class='clause' predicate='std.map.private.bal'><div class='loc'>File "builtin_map.elpi", line 40, column 0, character 11193:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='379'>L</span> <span class='name' varname='384'>HL</span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='382'>R</span> <span class='name' varname='385'>HR</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='386'>HL<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='384'>HL</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'><div class='compound'><span class='name' varname='387'>HR<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='385'>HR</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'>std.map.private.bal.aux <span class='name' varname='384'>HL</span> <span class='name' varname='385'>HR</span> <span class='name' varname='386'>HL<sub>2</sub></span> <span class='name' varname='387'>HR<sub>2</sub></span> <span class='name' varname='379'>L</span> <span class='name' varname='380'>K</span> <span class='name' varname='381'>V</span> <span class='name' varname='382'>R</span> <span class='name' varname='383'>T</span></div></div><div class='concl'><div class='compound'>std.map.private.bal <span class='name' varname='379'>L</span> <span class='name' varname='380'>K</span> <span class='name' varname='381'>V</span> <span class='name' varname='382'>R</span> <span class='name' varname='383'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 47, column 0, character 11310:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='388'>HL</span> <span class='name' varname='389'>HR<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='390'>LL</span> <span class='name' varname='399'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='393'>LR</span> <span class='name' varname='400'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='399'>Spilled<sub>2</sub></span> <span class='name' varname='400'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='393'>LR</span> <span class='name' varname='394'>X</span> <span class='name' varname='395'>D</span> <span class='name' varname='396'>R</span> <span class='name' varname='398'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='390'>LL</span> <span class='name' varname='391'>LV</span> <span class='name' varname='392'>LD</span> <span class='name' varname='398'>Spilled<sub>1</sub></span> <span class='name' varname='397'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux <span class='name' varname='388'>HL</span> _ _ <span class='name' varname='389'>HR<sub>2</sub></span> (std.map.private.node <span class='name' varname='390'>LL</span> <span class='name' varname='391'>LV</span> <span class='name' varname='392'>LD</span> <span class='name' varname='393'>LR</span> _) <span class='name' varname='394'>X</span> <span class='name' varname='395'>D</span> <span class='name' varname='396'>R</span> <span class='name' varname='397'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 50, column 0, character 11443:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='401'>HL</span> <span class='name' varname='402'>HR<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='403'>LL</span> <span class='name' varname='404'>LV</span> <span class='name' varname='405'>LD</span> <span class='name' varname='406'>LRL</span> <span class='name' varname='414'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='409'>LRR</span> <span class='name' varname='410'>X</span> <span class='name' varname='411'>D</span> <span class='name' varname='412'>R</span> <span class='name' varname='415'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='414'>Spilled<sub>1</sub></span> <span class='name' varname='407'>LRV</span> <span class='name' varname='408'>LRD</span> <span class='name' varname='415'>Spilled<sub>2</sub></span> <span class='name' varname='413'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux <span class='name' varname='401'>HL</span> _ _ <span class='name' varname='402'>HR<sub>2</sub></span> (std.map.private.node <span class='name' varname='403'>LL</span> <span class='name' varname='404'>LV</span> <span class='name' varname='405'>LD</span> (std.map.private.node <span class='name' varname='406'>LRL</span> <span class='name' varname='407'>LRV</span> <span class='name' varname='408'>LRD</span> <span class='name' varname='409'>LRR</span> _) _) <span class='name' varname='410'>X</span> <span class='name' varname='411'>D</span> <span class='name' varname='412'>R</span> <span class='name' varname='413'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 53, column 0, character 11592:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='416'>HR</span> <span class='name' varname='417'>HL<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.height <span class='name' varname='424'>RR</span> <span class='name' varname='427'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.height <span class='name' varname='421'>RL</span> <span class='name' varname='428'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='427'>Spilled<sub>2</sub></span> <span class='name' varname='428'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='418'>L</span> <span class='name' varname='419'>X</span> <span class='name' varname='420'>D</span> <span class='name' varname='421'>RL</span> <span class='name' varname='426'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='426'>Spilled<sub>1</sub></span> <span class='name' varname='422'>RV</span> <span class='name' varname='423'>RD</span> <span class='name' varname='424'>RR</span> <span class='name' varname='425'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux _ <span class='name' varname='416'>HR</span> <span class='name' varname='417'>HL<sub>2</sub></span> _ <span class='name' varname='418'>L</span> <span class='name' varname='419'>X</span> <span class='name' varname='420'>D</span> (std.map.private.node <span class='name' varname='421'>RL</span> <span class='name' varname='422'>RV</span> <span class='name' varname='423'>RD</span> <span class='name' varname='424'>RR</span> _) <span class='name' varname='425'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 56, column 0, character 11725:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='429'>HR</span> <span class='name' varname='430'>HL<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.create <span class='name' varname='431'>L</span> <span class='name' varname='432'>X</span> <span class='name' varname='433'>D</span> <span class='name' varname='434'>RLL</span> <span class='name' varname='442'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='437'>RLR</span> <span class='name' varname='438'>RV</span> <span class='name' varname='439'>RD</span> <span class='name' varname='440'>RR</span> <span class='name' varname='443'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.map.private.create <span class='name' varname='442'>Spilled<sub>1</sub></span> <span class='name' varname='435'>RLV</span> <span class='name' varname='436'>RLD</span> <span class='name' varname='443'>Spilled<sub>2</sub></span> <span class='name' varname='441'>T</span></div></div></div><div class='concl'><div class='compound'>std.map.private.bal.aux _ <span class='name' varname='429'>HR</span> <span class='name' varname='430'>HL<sub>2</sub></span> _ <span class='name' varname='431'>L</span> <span class='name' varname='432'>X</span> <span class='name' varname='433'>D</span> (std.map.private.node (std.map.private.node <span class='name' varname='434'>RLL</span> <span class='name' varname='435'>RLV</span> <span class='name' varname='436'>RLD</span> <span class='name' varname='437'>RLR</span> _) <span class='name' varname='438'>RV</span> <span class='name' varname='439'>RD</span> <span class='name' varname='440'>RR</span> _) <span class='name' varname='441'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.bal.aux'><div class='loc'>File "builtin_map.elpi", line 59, column 0, character 11874:</div><div class='hyps'>std.map.private.create <span class='name' varname='444'>L</span> <span class='name' varname='445'>K</span> <span class='name' varname='446'>V</span> <span class='name' varname='447'>R</span> <span class='name' varname='448'>T</span></div><div class='concl'><div class='compound'>std.map.private.bal.aux _ _ _ _ <span class='name' varname='444'>L</span> <span class='name' varname='445'>K</span> <span class='name' varname='446'>V</span> <span class='name' varname='447'>R</span> <span class='name' varname='448'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.add'><div class='loc'>File "builtin_map.elpi", line 62, column 0, character 11990:</div><div class='hyps'>std.map.private.create std.map.private.empty <span class='name' varname='449'>K</span> <span class='name' varname='450'>V</span> std.map.private.empty <span class='name' varname='451'>T</span></div><div class='concl'><div class='compound'>std.map.private.add std.map.private.empty _ <span class='name' varname='449'>K</span> <span class='name' varname='450'>V</span> <span class='name' varname='451'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.add'><div class='loc'>File "builtin_map.elpi", line 63, column 0, character 12037:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='454'>Cmp</span> <span class='name' varname='455'>X<sub>1</sub></span> <span class='name' varname='452'>X</span> <span class='name' varname='458'>E</span>,</div><div class='hyp compound'>std.map.private.add.aux <span class='name' varname='458'>E</span> <span class='name' varname='453'>M</span> <span class='name' varname='454'>Cmp</span> <span class='name' varname='455'>X<sub>1</sub></span> <span class='name' varname='456'>XD</span> <span class='name' varname='457'>M<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.map.private.add <div class='compound'>(std.map.private.node _ <span class='name' varname='452'>X</span> _ _ _ <b>as</b> </div><div class='compound'><span class='name' varname='453'>M</span>)</div> <span class='name' varname='454'>Cmp</span> <span class='name' varname='455'>X<sub>1</sub></span> <span class='name' varname='456'>XD</span> <span class='name' varname='457'>M<sub>1</sub></span></div></div></div> +<div class='clause' predicate='std.map.private.add.aux'><div class='loc'>File "builtin_map.elpi", line 64, column 0, character 12117:</div><div class='hyps'><div class='compound'><span class='name' varname='464'>T</span> = </div><div class='compound'>(std.map.private.node <span class='name' varname='459'>L</span> <span class='name' varname='462'>X</span> <span class='name' varname='463'>XD</span> <span class='name' varname='460'>R</span> <span class='name' varname='461'>H</span>)</div></div><div class='concl'><div class='compound'>std.map.private.add.aux eq (std.map.private.node <span class='name' varname='459'>L</span> _ _ <span class='name' varname='460'>R</span> <span class='name' varname='461'>H</span>) _ <span class='name' varname='462'>X</span> <span class='name' varname='463'>XD</span> <span class='name' varname='464'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.add.aux'><div class='loc'>File "builtin_map.elpi", line 65, column 0, character 12181:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.add <span class='name' varname='465'>L</span> <span class='name' varname='469'>Cmp</span> <span class='name' varname='470'>X</span> <span class='name' varname='471'>XD</span> <span class='name' varname='473'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='473'>Spilled<sub>1</sub></span> <span class='name' varname='466'>V</span> <span class='name' varname='467'>D</span> <span class='name' varname='468'>R</span> <span class='name' varname='472'>T</span></div></div><div class='concl'><div class='compound'>std.map.private.add.aux lt (std.map.private.node <span class='name' varname='465'>L</span> <span class='name' varname='466'>V</span> <span class='name' varname='467'>D</span> <span class='name' varname='468'>R</span> _) <span class='name' varname='469'>Cmp</span> <span class='name' varname='470'>X</span> <span class='name' varname='471'>XD</span> <span class='name' varname='472'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.add.aux'><div class='loc'>File "builtin_map.elpi", line 66, column 0, character 12253:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.add <span class='name' varname='477'>R</span> <span class='name' varname='478'>Cmp</span> <span class='name' varname='479'>X</span> <span class='name' varname='480'>XD</span> <span class='name' varname='482'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='474'>L</span> <span class='name' varname='475'>V</span> <span class='name' varname='476'>D</span> <span class='name' varname='482'>Spilled<sub>1</sub></span> <span class='name' varname='481'>T</span></div></div><div class='concl'><div class='compound'>std.map.private.add.aux gt (std.map.private.node <span class='name' varname='474'>L</span> <span class='name' varname='475'>V</span> <span class='name' varname='476'>D</span> <span class='name' varname='477'>R</span> _) <span class='name' varname='478'>Cmp</span> <span class='name' varname='479'>X</span> <span class='name' varname='480'>XD</span> <span class='name' varname='481'>T</span></div></div></div> +<div class='clause' predicate='std.map.private.find'><div class='loc'>File "builtin_map.elpi", line 69, column 0, character 12384:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='487'>Cmp</span> <span class='name' varname='488'>K</span> <span class='name' varname='484'>K<sub>1</sub></span> <span class='name' varname='490'>E</span>,</div><div class='hyp compound'>std.map.private.find.aux <span class='name' varname='490'>E</span> <span class='name' varname='487'>Cmp</span> <span class='name' varname='483'>L</span> <span class='name' varname='486'>R</span> <span class='name' varname='485'>V<sub>1</sub></span> <span class='name' varname='488'>K</span> <span class='name' varname='489'>V</span></div></div><div class='concl'><div class='compound'>std.map.private.find (std.map.private.node <span class='name' varname='483'>L</span> <span class='name' varname='484'>K<sub>1</sub></span> <span class='name' varname='485'>V<sub>1</sub></span> <span class='name' varname='486'>R</span> _) <span class='name' varname='487'>Cmp</span> <span class='name' varname='488'>K</span> <span class='name' varname='489'>V</span></div></div></div> +<div class='clause' predicate='std.map.private.find.aux'><div class='loc'>File "builtin_map.elpi", line 70, column 0, character 12458:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.find.aux eq _ _ _ <span class='name' varname='491'>V</span> _ <span class='name' varname='491'>V</span></div></div> +<div class='clause' predicate='std.map.private.find.aux'><div class='loc'>File "builtin_map.elpi", line 71, column 0, character 12485:</div><div class='hyps'>std.map.private.find <span class='name' varname='493'>L</span> <span class='name' varname='492'>Cmp</span> <span class='name' varname='494'>K</span> <span class='name' varname='495'>V</span></div><div class='concl'><div class='compound'>std.map.private.find.aux lt <span class='name' varname='492'>Cmp</span> <span class='name' varname='493'>L</span> _ _ <span class='name' varname='494'>K</span> <span class='name' varname='495'>V</span></div></div></div> +<div class='clause' predicate='std.map.private.find.aux'><div class='loc'>File "builtin_map.elpi", line 72, column 0, character 12530:</div><div class='hyps'>std.map.private.find <span class='name' varname='497'>R</span> <span class='name' varname='496'>Cmp</span> <span class='name' varname='498'>K</span> <span class='name' varname='499'>V</span></div><div class='concl'><div class='compound'>std.map.private.find.aux gt <span class='name' varname='496'>Cmp</span> _ <span class='name' varname='497'>R</span> _ <span class='name' varname='498'>K</span> <span class='name' varname='499'>V</span></div></div></div> +<div class='clause' predicate='std.map.private.remove-min-binding'><div class='loc'>File "builtin_map.elpi", line 75, column 0, character 12622:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.remove-min-binding (std.map.private.node std.map.private.empty _ _ <span class='name' varname='500'>R</span> _) <span class='name' varname='500'>R</span></div></div></div> +<div class='clause' predicate='std.map.private.remove-min-binding'><div class='loc'>File "builtin_map.elpi", line 76, column 0, character 12670:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.remove-min-binding <span class='name' varname='501'>L</span> <span class='name' varname='506'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='506'>Spilled<sub>1</sub></span> <span class='name' varname='502'>V</span> <span class='name' varname='503'>D</span> <span class='name' varname='504'>R</span> <span class='name' varname='505'>X</span></div></div><div class='concl'><div class='compound'>std.map.private.remove-min-binding (std.map.private.node <span class='name' varname='501'>L</span> <span class='name' varname='502'>V</span> <span class='name' varname='503'>D</span> <span class='name' varname='504'>R</span> _) <span class='name' varname='505'>X</span></div></div></div> +<div class='clause' predicate='std.map.private.min-binding'><div class='loc'>File "builtin_map.elpi", line 79, column 0, character 12786:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.min-binding (std.map.private.node std.map.private.empty <span class='name' varname='507'>V</span> <span class='name' varname='508'>D</span> _ _) <span class='name' varname='507'>V</span> <span class='name' varname='508'>D</span></div></div></div> +<div class='clause' predicate='std.map.private.min-binding'><div class='loc'>File "builtin_map.elpi", line 80, column 0, character 12829:</div><div class='hyps'>std.map.private.min-binding <span class='name' varname='509'>L</span> <span class='name' varname='510'>V</span> <span class='name' varname='511'>D</span></div><div class='concl'><div class='compound'>std.map.private.min-binding (std.map.private.node <span class='name' varname='509'>L</span> _ _ _ _) <span class='name' varname='510'>V</span> <span class='name' varname='511'>D</span></div></div></div> +<div class='clause' predicate='std.map.private.merge'><div class='loc'>File "builtin_map.elpi", line 83, column 0, character 12929:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.merge std.map.private.empty <span class='name' varname='512'>X</span> <span class='name' varname='512'>X</span></div></div></div> +<div class='clause' predicate='std.map.private.merge'><div class='loc'>File "builtin_map.elpi", line 84, column 0, character 12951:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.merge <span class='name' varname='513'>X</span> std.map.private.empty <span class='name' varname='513'>X</span></div></div></div> +<div class='clause' predicate='std.map.private.merge'><div class='loc'>File "builtin_map.elpi", line 85, column 0, character 12973:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.min-binding <span class='name' varname='515'>M<sub>2</sub></span> <span class='name' varname='517'>X</span> <span class='name' varname='518'>D</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.map.private.remove-min-binding <span class='name' varname='515'>M<sub>2</sub></span> <span class='name' varname='519'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='514'>M<sub>1</sub></span> <span class='name' varname='517'>X</span> <span class='name' varname='518'>D</span> <span class='name' varname='519'>Spilled<sub>1</sub></span> <span class='name' varname='516'>R</span></div></div></div><div class='concl'><div class='compound'>std.map.private.merge <span class='name' varname='514'>M<sub>1</sub></span> <span class='name' varname='515'>M<sub>2</sub></span> <span class='name' varname='516'>R</span></div></div></div> +<div class='clause' predicate='std.map.private.remove'><div class='loc'>File "builtin_map.elpi", line 90, column 0, character 13119:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.map.private.remove std.map.private.empty _ _ std.map.private.empty</div></div></div> +<div class='clause' predicate='std.map.private.remove'><div class='loc'>File "builtin_map.elpi", line 91, column 0, character 13148:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='524'>Cmp</span> <span class='name' varname='525'>X</span> <span class='name' varname='521'>V</span> <span class='name' varname='527'>E</span>,</div><div class='hyp compound'>std.map.private.remove.aux <span class='name' varname='527'>E</span> <span class='name' varname='524'>Cmp</span> <span class='name' varname='520'>L</span> <span class='name' varname='523'>R</span> <span class='name' varname='521'>V</span> <span class='name' varname='522'>D</span> <span class='name' varname='525'>X</span> <span class='name' varname='526'>M</span></div></div><div class='concl'><div class='compound'>std.map.private.remove (std.map.private.node <span class='name' varname='520'>L</span> <span class='name' varname='521'>V</span> <span class='name' varname='522'>D</span> <span class='name' varname='523'>R</span> _) <span class='name' varname='524'>Cmp</span> <span class='name' varname='525'>X</span> <span class='name' varname='526'>M</span></div></div></div> +<div class='clause' predicate='std.map.private.remove.aux'><div class='loc'>File "builtin_map.elpi", line 92, column 0, character 13224:</div><div class='hyps'>std.map.private.merge <span class='name' varname='528'>L</span> <span class='name' varname='529'>R</span> <span class='name' varname='530'>M</span></div><div class='concl'><div class='compound'>std.map.private.remove.aux eq _ <span class='name' varname='528'>L</span> <span class='name' varname='529'>R</span> _ _ _ <span class='name' varname='530'>M</span></div></div></div> +<div class='clause' predicate='std.map.private.remove.aux'><div class='loc'>File "builtin_map.elpi", line 93, column 0, character 13270:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.remove <span class='name' varname='532'>L</span> <span class='name' varname='531'>Cmp</span> <span class='name' varname='536'>X</span> <span class='name' varname='538'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='538'>Spilled<sub>1</sub></span> <span class='name' varname='534'>V</span> <span class='name' varname='535'>D</span> <span class='name' varname='533'>R</span> <span class='name' varname='537'>M</span></div></div><div class='concl'><div class='compound'>std.map.private.remove.aux lt <span class='name' varname='531'>Cmp</span> <span class='name' varname='532'>L</span> <span class='name' varname='533'>R</span> <span class='name' varname='534'>V</span> <span class='name' varname='535'>D</span> <span class='name' varname='536'>X</span> <span class='name' varname='537'>M</span></div></div></div> +<div class='clause' predicate='std.map.private.remove.aux'><div class='loc'>File "builtin_map.elpi", line 94, column 0, character 13333:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.remove <span class='name' varname='541'>R</span> <span class='name' varname='539'>Cmp</span> <span class='name' varname='544'>X</span> <span class='name' varname='546'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bal <span class='name' varname='540'>L</span> <span class='name' varname='542'>V</span> <span class='name' varname='543'>D</span> <span class='name' varname='546'>Spilled<sub>1</sub></span> <span class='name' varname='545'>M</span></div></div><div class='concl'><div class='compound'>std.map.private.remove.aux gt <span class='name' varname='539'>Cmp</span> <span class='name' varname='540'>L</span> <span class='name' varname='541'>R</span> <span class='name' varname='542'>V</span> <span class='name' varname='543'>D</span> <span class='name' varname='544'>X</span> <span class='name' varname='545'>M</span></div></div></div> +<div class='clause' predicate='std.map.private.bindings'><div class='loc'>File "builtin_map.elpi", line 97, column 0, character 13460:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.map.private.bindings std.map.private.empty <span class='name' varname='547'>X</span> <span class='name' varname='547'>X</span></div></div> +<div class='clause' predicate='std.map.private.bindings'><div class='loc'>File "builtin_map.elpi", line 98, column 0, character 13480:</div><div class='hyps'><div class='hyp compound' level='60'>std.map.private.bindings <span class='name' varname='551'>R</span> <span class='name' varname='552'>X</span> <span class='name' varname='554'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.map.private.bindings <span class='name' varname='548'>L</span> <div class='compound' level='99'><b>[</b><div class='compound'>pr <span class='name' varname='549'>V</span> <span class='name' varname='550'>D</span> <b>|</b> <span class='name' varname='554'>Spilled<sub>1</sub></span></div><b>]</b></div> <span class='name' varname='553'>X<sub>1</sub></span></div></div><div class='concl'><div class='compound'>std.map.private.bindings (std.map.private.node <span class='name' varname='548'>L</span> <span class='name' varname='549'>V</span> <span class='name' varname='550'>D</span> <span class='name' varname='551'>R</span> _) <span class='name' varname='552'>X</span> <span class='name' varname='553'>X<sub>1</sub></span></div></div></div> +<div class='clause' predicate='std.set.make'><div class='loc'>File "builtin_set.elpi", line 7, column 0, character 19405:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.make <span class='name' varname='555'>Cmp</span> (std.set std.set.private.empty <span class='name' varname='555'>Cmp</span>)</div></div> +<div class='clause' predicate='std.set.mem'><div class='loc'>File "builtin_set.elpi", line 11, column 0, character 19502:</div><div class='hyps'>std.set.private.mem <span class='name' varname='557'>M</span> <span class='name' varname='558'>Cmp</span> <span class='name' varname='556'>E</span></div><div class='concl'><div class='compound'>std.set.mem <span class='name' varname='556'>E</span> (std.set <span class='name' varname='557'>M</span> <span class='name' varname='558'>Cmp</span>)</div></div></div> +<div class='clause' predicate='std.set.add'><div class='loc'>File "builtin_set.elpi", line 15, column 0, character 19617:</div><div class='hyps'>std.set.private.add <span class='name' varname='560'>M</span> <span class='name' varname='561'>Cmp</span> <span class='name' varname='559'>E</span> <span class='name' varname='562'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.set.add <span class='name' varname='559'>E</span> (std.set <span class='name' varname='560'>M</span> <span class='name' varname='561'>Cmp</span>) (std.set <span class='name' varname='562'>M<sub>1</sub></span> <span class='name' varname='561'>Cmp</span>)</div></div></div> +<div class='clause' predicate='std.set.remove'><div class='loc'>File "builtin_set.elpi", line 19, column 0, character 19759:</div><div class='hyps'>std.set.private.remove <span class='name' varname='564'>M</span> <span class='name' varname='565'>Cmp</span> <span class='name' varname='563'>E</span> <span class='name' varname='566'>M<sub>1</sub></span></div><div class='concl'><div class='compound'>std.set.remove <span class='name' varname='563'>E</span> (std.set <span class='name' varname='564'>M</span> <span class='name' varname='565'>Cmp</span>) (std.set <span class='name' varname='566'>M<sub>1</sub></span> <span class='name' varname='565'>Cmp</span>)</div></div></div> +<div class='clause' predicate='std.set.cardinal'><div class='loc'>File "builtin_set.elpi", line 23, column 0, character 19916:</div><div class='hyps'>std.set.private.cardinal <span class='name' varname='567'>M</span> <span class='name' varname='568'>N</span></div><div class='concl'><div class='compound'>std.set.cardinal (std.set <span class='name' varname='567'>M</span> _) <span class='name' varname='568'>N</span></div></div></div> +<div class='clause' predicate='std.set.elements'><div class='loc'>File "builtin_set.elpi", line 26, column 0, character 20004:</div><div class='hyps'>std.set.private.elements <span class='name' varname='569'>M</span> [] <span class='name' varname='570'>L</span></div><div class='concl'><div class='compound'>std.set.elements (std.set <span class='name' varname='569'>M</span> _) <span class='name' varname='570'>L</span></div></div></div> +<div class='clause' predicate='std.set.private.height'><div class='loc'>File "builtin_set.elpi", line 36, column 0, character 20224:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.height std.set.private.empty 0</div></div> +<div class='clause' predicate='std.set.private.height'><div class='loc'>File "builtin_set.elpi", line 37, column 0, character 20240:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.height (std.set.private.node _ _ _ <span class='name' varname='571'>H</span>) <span class='name' varname='571'>H</span></div></div> +<div class='clause' predicate='std.set.private.create'><div class='loc'>File "builtin_set.elpi", line 40, column 0, character 20310:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='572'>L</span> <span class='name' varname='576'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='574'>R</span> <span class='name' varname='577'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.max <span class='name' varname='576'>Spilled<sub>1</sub></span> <span class='name' varname='577'>Spilled<sub>2</sub></span> <span class='name' varname='578'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='575'>H</span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='578'>Spilled<sub>3</sub></span> + </div><div class='compound'>1</div></div></div></div><div class='concl'><div class='compound'>std.set.private.create <span class='name' varname='572'>L</span> <span class='name' varname='573'>E</span> <span class='name' varname='574'>R</span> (std.set.private.node <span class='name' varname='572'>L</span> <span class='name' varname='573'>E</span> <span class='name' varname='574'>R</span> <span class='name' varname='575'>H</span>)</div></div></div> +<div class='clause' predicate='std.set.private.bal'><div class='loc'>File "builtin_set.elpi", line 43, column 0, character 20425:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='579'>L</span> <span class='name' varname='583'>HL</span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='581'>R</span> <span class='name' varname='584'>HR</span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='585'>HL<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='583'>HL</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'><div class='compound'><span class='name' varname='586'>HR<sub>2</sub></span> <b>is</b> </div><div class='compound'><div class='compound'><span class='name' varname='584'>HR</span> + </div><div class='compound'>2,</div></div></div><div class='hyp compound'>std.set.private.bal.aux <span class='name' varname='583'>HL</span> <span class='name' varname='584'>HR</span> <span class='name' varname='585'>HL<sub>2</sub></span> <span class='name' varname='586'>HR<sub>2</sub></span> <span class='name' varname='579'>L</span> <span class='name' varname='580'>E</span> <span class='name' varname='581'>R</span> <span class='name' varname='582'>T</span></div></div><div class='concl'><div class='compound'>std.set.private.bal <span class='name' varname='579'>L</span> <span class='name' varname='580'>E</span> <span class='name' varname='581'>R</span> <span class='name' varname='582'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 50, column 0, character 20538:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='587'>HL</span> <span class='name' varname='588'>HR<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='589'>LL</span> <span class='name' varname='596'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='591'>LR</span> <span class='name' varname='597'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='596'>Spilled<sub>2</sub></span> <span class='name' varname='597'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='591'>LR</span> <span class='name' varname='592'>X</span> <span class='name' varname='593'>R</span> <span class='name' varname='595'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='589'>LL</span> <span class='name' varname='590'>LV</span> <span class='name' varname='595'>Spilled<sub>1</sub></span> <span class='name' varname='594'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux <span class='name' varname='587'>HL</span> _ _ <span class='name' varname='588'>HR<sub>2</sub></span> (std.set.private.node <span class='name' varname='589'>LL</span> <span class='name' varname='590'>LV</span> <span class='name' varname='591'>LR</span> _) <span class='name' varname='592'>X</span> <span class='name' varname='593'>R</span> <span class='name' varname='594'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 53, column 0, character 20661:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='598'>HL</span> <span class='name' varname='599'>HR<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='600'>LL</span> <span class='name' varname='601'>LV</span> <span class='name' varname='602'>LRL</span> <span class='name' varname='608'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='604'>LRR</span> <span class='name' varname='605'>X</span> <span class='name' varname='606'>R</span> <span class='name' varname='609'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='608'>Spilled<sub>1</sub></span> <span class='name' varname='603'>LRV</span> <span class='name' varname='609'>Spilled<sub>2</sub></span> <span class='name' varname='607'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux <span class='name' varname='598'>HL</span> _ _ <span class='name' varname='599'>HR<sub>2</sub></span> (std.set.private.node <span class='name' varname='600'>LL</span> <span class='name' varname='601'>LV</span> (std.set.private.node <span class='name' varname='602'>LRL</span> <span class='name' varname='603'>LRV</span> <span class='name' varname='604'>LRR</span> _) _) <span class='name' varname='605'>X</span> <span class='name' varname='606'>R</span> <span class='name' varname='607'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 56, column 0, character 20792:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='610'>HR</span> <span class='name' varname='611'>HL<sub>2</sub></span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.height <span class='name' varname='616'>RR</span> <span class='name' varname='619'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.height <span class='name' varname='614'>RL</span> <span class='name' varname='620'>Spilled<sub>3</sub></span>,</div><div class='hyp compound'>>= <span class='name' varname='619'>Spilled<sub>2</sub></span> <span class='name' varname='620'>Spilled<sub>3</sub></span>,</div></div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='612'>L</span> <span class='name' varname='613'>X</span> <span class='name' varname='614'>RL</span> <span class='name' varname='618'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='618'>Spilled<sub>1</sub></span> <span class='name' varname='615'>RV</span> <span class='name' varname='616'>RR</span> <span class='name' varname='617'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux _ <span class='name' varname='610'>HR</span> <span class='name' varname='611'>HL<sub>2</sub></span> _ <span class='name' varname='612'>L</span> <span class='name' varname='613'>X</span> (std.set.private.node <span class='name' varname='614'>RL</span> <span class='name' varname='615'>RV</span> <span class='name' varname='616'>RR</span> _) <span class='name' varname='617'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 59, column 0, character 20915:</div><div class='hyps'><div class='hyp compound' level='60'>> <span class='name' varname='621'>HR</span> <span class='name' varname='622'>HL<sub>2</sub></span>,</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.create <span class='name' varname='623'>L</span> <span class='name' varname='624'>X</span> <span class='name' varname='625'>RLL</span> <span class='name' varname='631'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='627'>RLR</span> <span class='name' varname='628'>RV</span> <span class='name' varname='629'>RR</span> <span class='name' varname='632'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'>std.set.private.create <span class='name' varname='631'>Spilled<sub>1</sub></span> <span class='name' varname='626'>RLV</span> <span class='name' varname='632'>Spilled<sub>2</sub></span> <span class='name' varname='630'>T</span></div></div></div><div class='concl'><div class='compound'>std.set.private.bal.aux _ <span class='name' varname='621'>HR</span> <span class='name' varname='622'>HL<sub>2</sub></span> _ <span class='name' varname='623'>L</span> <span class='name' varname='624'>X</span> (std.set.private.node (std.set.private.node <span class='name' varname='625'>RLL</span> <span class='name' varname='626'>RLV</span> <span class='name' varname='627'>RLR</span> _) <span class='name' varname='628'>RV</span> <span class='name' varname='629'>RR</span> _) <span class='name' varname='630'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.bal.aux'><div class='loc'>File "builtin_set.elpi", line 62, column 0, character 21046:</div><div class='hyps'>std.set.private.create <span class='name' varname='633'>L</span> <span class='name' varname='634'>E</span> <span class='name' varname='635'>R</span> <span class='name' varname='636'>T</span></div><div class='concl'><div class='compound'>std.set.private.bal.aux _ _ _ _ <span class='name' varname='633'>L</span> <span class='name' varname='634'>E</span> <span class='name' varname='635'>R</span> <span class='name' varname='636'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.add'><div class='loc'>File "builtin_set.elpi", line 65, column 0, character 21149:</div><div class='hyps'>std.set.private.create std.set.private.empty <span class='name' varname='637'>E</span> std.set.private.empty <span class='name' varname='638'>T</span></div><div class='concl'><div class='compound'>std.set.private.add std.set.private.empty _ <span class='name' varname='637'>E</span> <span class='name' varname='638'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.add'><div class='loc'>File "builtin_set.elpi", line 66, column 0, character 21192:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='643'>Cmp</span> <span class='name' varname='644'>X<sub>1</sub></span> <span class='name' varname='640'>X</span> <span class='name' varname='646'>E</span>,</div><div class='hyp compound'>std.set.private.add.aux <span class='name' varname='646'>E</span> <span class='name' varname='643'>Cmp</span> <span class='name' varname='639'>L</span> <span class='name' varname='641'>R</span> <span class='name' varname='640'>X</span> <span class='name' varname='644'>X<sub>1</sub></span> <span class='name' varname='642'>H</span> <span class='name' varname='645'>S</span></div></div><div class='concl'><div class='compound'>std.set.private.add (std.set.private.node <span class='name' varname='639'>L</span> <span class='name' varname='640'>X</span> <span class='name' varname='641'>R</span> <span class='name' varname='642'>H</span>) <span class='name' varname='643'>Cmp</span> <span class='name' varname='644'>X<sub>1</sub></span> <span class='name' varname='645'>S</span></div></div></div> +<div class='clause' predicate='std.set.private.add.aux'><div class='loc'>File "builtin_set.elpi", line 67, column 0, character 21263:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.add.aux eq _ <span class='name' varname='647'>L</span> <span class='name' varname='648'>R</span> <span class='name' varname='649'>X</span> _ <span class='name' varname='650'>H</span> (std.set.private.node <span class='name' varname='647'>L</span> <span class='name' varname='649'>X</span> <span class='name' varname='648'>R</span> <span class='name' varname='650'>H</span>)</div></div> +<div class='clause' predicate='std.set.private.add.aux'><div class='loc'>File "builtin_set.elpi", line 68, column 0, character 21302:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.add <span class='name' varname='652'>L</span> <span class='name' varname='651'>Cmp</span> <span class='name' varname='655'>X</span> <span class='name' varname='657'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='657'>Spilled<sub>1</sub></span> <span class='name' varname='654'>E</span> <span class='name' varname='653'>R</span> <span class='name' varname='656'>T</span></div></div><div class='concl'><div class='compound'>std.set.private.add.aux lt <span class='name' varname='651'>Cmp</span> <span class='name' varname='652'>L</span> <span class='name' varname='653'>R</span> <span class='name' varname='654'>E</span> <span class='name' varname='655'>X</span> _ <span class='name' varname='656'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.add.aux'><div class='loc'>File "builtin_set.elpi", line 69, column 0, character 21357:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.add <span class='name' varname='660'>R</span> <span class='name' varname='658'>Cmp</span> <span class='name' varname='662'>X</span> <span class='name' varname='664'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='659'>L</span> <span class='name' varname='661'>E</span> <span class='name' varname='664'>Spilled<sub>1</sub></span> <span class='name' varname='663'>T</span></div></div><div class='concl'><div class='compound'>std.set.private.add.aux gt <span class='name' varname='658'>Cmp</span> <span class='name' varname='659'>L</span> <span class='name' varname='660'>R</span> <span class='name' varname='661'>E</span> <span class='name' varname='662'>X</span> _ <span class='name' varname='663'>T</span></div></div></div> +<div class='clause' predicate='std.set.private.mem'><div class='loc'>File "builtin_set.elpi", line 72, column 0, character 21463:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='668'>Cmp</span> <span class='name' varname='669'>E</span> <span class='name' varname='666'>K</span> <span class='name' varname='670'>O</span>,</div><div class='hyp compound'>std.set.private.mem.aux <span class='name' varname='670'>O</span> <span class='name' varname='668'>Cmp</span> <span class='name' varname='665'>L</span> <span class='name' varname='667'>R</span> <span class='name' varname='669'>E</span></div></div><div class='concl'><div class='compound'>std.set.private.mem (std.set.private.node <span class='name' varname='665'>L</span> <span class='name' varname='666'>K</span> <span class='name' varname='667'>R</span> _) <span class='name' varname='668'>Cmp</span> <span class='name' varname='669'>E</span></div></div></div> +<div class='clause' predicate='std.set.private.mem.aux'><div class='loc'>File "builtin_set.elpi", line 73, column 0, character 21523:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.mem.aux eq _ _ _ _</div></div> +<div class='clause' predicate='std.set.private.mem.aux'><div class='loc'>File "builtin_set.elpi", line 74, column 0, character 21543:</div><div class='hyps'>std.set.private.mem <span class='name' varname='672'>L</span> <span class='name' varname='671'>Cmp</span> <span class='name' varname='673'>E</span></div><div class='concl'><div class='compound'>std.set.private.mem.aux lt <span class='name' varname='671'>Cmp</span> <span class='name' varname='672'>L</span> _ <span class='name' varname='673'>E</span></div></div></div> +<div class='clause' predicate='std.set.private.mem.aux'><div class='loc'>File "builtin_set.elpi", line 75, column 0, character 21580:</div><div class='hyps'>std.set.private.mem <span class='name' varname='675'>R</span> <span class='name' varname='674'>Cmp</span> <span class='name' varname='676'>E</span></div><div class='concl'><div class='compound'>std.set.private.mem.aux gt <span class='name' varname='674'>Cmp</span> _ <span class='name' varname='675'>R</span> <span class='name' varname='676'>E</span></div></div></div> +<div class='clause' predicate='std.set.private.remove-min-binding'><div class='loc'>File "builtin_set.elpi", line 78, column 0, character 21660:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.remove-min-binding (std.set.private.node std.set.private.empty _ <span class='name' varname='677'>R</span> _) <span class='name' varname='677'>R</span></div></div></div> +<div class='clause' predicate='std.set.private.remove-min-binding'><div class='loc'>File "builtin_set.elpi", line 79, column 0, character 21706:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.remove-min-binding <span class='name' varname='678'>L</span> <span class='name' varname='682'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='682'>Spilled<sub>1</sub></span> <span class='name' varname='679'>E</span> <span class='name' varname='680'>R</span> <span class='name' varname='681'>X</span></div></div><div class='concl'><div class='compound'>std.set.private.remove-min-binding (std.set.private.node <span class='name' varname='678'>L</span> <span class='name' varname='679'>E</span> <span class='name' varname='680'>R</span> _) <span class='name' varname='681'>X</span></div></div></div> +<div class='clause' predicate='std.set.private.min-binding'><div class='loc'>File "builtin_set.elpi", line 82, column 0, character 21811:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.min-binding (std.set.private.node std.set.private.empty <span class='name' varname='683'>E</span> _ _) <span class='name' varname='683'>E</span></div></div></div> +<div class='clause' predicate='std.set.private.min-binding'><div class='loc'>File "builtin_set.elpi", line 83, column 0, character 21850:</div><div class='hyps'>std.set.private.min-binding <span class='name' varname='684'>L</span> <span class='name' varname='685'>E</span></div><div class='concl'><div class='compound'>std.set.private.min-binding (std.set.private.node <span class='name' varname='684'>L</span> _ _ _) <span class='name' varname='685'>E</span></div></div></div> +<div class='clause' predicate='std.set.private.merge'><div class='loc'>File "builtin_set.elpi", line 86, column 0, character 21938:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.merge std.set.private.empty <span class='name' varname='686'>X</span> <span class='name' varname='686'>X</span></div></div></div> +<div class='clause' predicate='std.set.private.merge'><div class='loc'>File "builtin_set.elpi", line 87, column 0, character 21960:</div><div class='hyps'><span class='cut'>!</span></div><div class='concl'><div class='compound'>std.set.private.merge <span class='name' varname='687'>X</span> std.set.private.empty <span class='name' varname='687'>X</span></div></div></div> +<div class='clause' predicate='std.set.private.merge'><div class='loc'>File "builtin_set.elpi", line 88, column 0, character 21982:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.min-binding <span class='name' varname='689'>M<sub>2</sub></span> <span class='name' varname='691'>X</span>,</div><div class='hyp compound'><div class='hyp compound' level='60'>std.set.private.remove-min-binding <span class='name' varname='689'>M<sub>2</sub></span> <span class='name' varname='692'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='688'>M<sub>1</sub></span> <span class='name' varname='691'>X</span> <span class='name' varname='692'>Spilled<sub>1</sub></span> <span class='name' varname='690'>R</span></div></div></div><div class='concl'><div class='compound'>std.set.private.merge <span class='name' varname='688'>M<sub>1</sub></span> <span class='name' varname='689'>M<sub>2</sub></span> <span class='name' varname='690'>R</span></div></div></div> +<div class='clause' predicate='std.set.private.remove'><div class='loc'>File "builtin_set.elpi", line 93, column 0, character 22120:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.remove std.set.private.empty _ _ std.set.private.empty</div></div> +<div class='clause' predicate='std.set.private.remove'><div class='loc'>File "builtin_set.elpi", line 94, column 0, character 22144:</div><div class='hyps'><div class='hyp compound' level='60'><span class='name' varname='696'>Cmp</span> <span class='name' varname='697'>X</span> <span class='name' varname='694'>E</span> <span class='name' varname='699'>O</span>,</div><div class='hyp compound'>std.set.private.remove.aux <span class='name' varname='699'>O</span> <span class='name' varname='696'>Cmp</span> <span class='name' varname='693'>L</span> <span class='name' varname='695'>R</span> <span class='name' varname='694'>E</span> <span class='name' varname='697'>X</span> <span class='name' varname='698'>M</span></div></div><div class='concl'><div class='compound'>std.set.private.remove (std.set.private.node <span class='name' varname='693'>L</span> <span class='name' varname='694'>E</span> <span class='name' varname='695'>R</span> _) <span class='name' varname='696'>Cmp</span> <span class='name' varname='697'>X</span> <span class='name' varname='698'>M</span></div></div></div> +<div class='clause' predicate='std.set.private.remove.aux'><div class='loc'>File "builtin_set.elpi", line 95, column 0, character 22216:</div><div class='hyps'>std.set.private.merge <span class='name' varname='700'>L</span> <span class='name' varname='701'>R</span> <span class='name' varname='702'>M</span></div><div class='concl'><div class='compound'>std.set.private.remove.aux eq _ <span class='name' varname='700'>L</span> <span class='name' varname='701'>R</span> _ _ <span class='name' varname='702'>M</span></div></div></div> +<div class='clause' predicate='std.set.private.remove.aux'><div class='loc'>File "builtin_set.elpi", line 96, column 0, character 22260:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.remove <span class='name' varname='704'>L</span> <span class='name' varname='703'>Cmp</span> <span class='name' varname='707'>X</span> <span class='name' varname='709'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='709'>Spilled<sub>1</sub></span> <span class='name' varname='706'>E</span> <span class='name' varname='705'>R</span> <span class='name' varname='708'>M</span></div></div><div class='concl'><div class='compound'>std.set.private.remove.aux lt <span class='name' varname='703'>Cmp</span> <span class='name' varname='704'>L</span> <span class='name' varname='705'>R</span> <span class='name' varname='706'>E</span> <span class='name' varname='707'>X</span> <span class='name' varname='708'>M</span></div></div></div> +<div class='clause' predicate='std.set.private.remove.aux'><div class='loc'>File "builtin_set.elpi", line 97, column 0, character 22319:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.remove <span class='name' varname='712'>R</span> <span class='name' varname='710'>Cmp</span> <span class='name' varname='714'>X</span> <span class='name' varname='716'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.bal <span class='name' varname='711'>L</span> <span class='name' varname='713'>E</span> <span class='name' varname='716'>Spilled<sub>1</sub></span> <span class='name' varname='715'>M</span></div></div><div class='concl'><div class='compound'>std.set.private.remove.aux gt <span class='name' varname='710'>Cmp</span> <span class='name' varname='711'>L</span> <span class='name' varname='712'>R</span> <span class='name' varname='713'>E</span> <span class='name' varname='714'>X</span> <span class='name' varname='715'>M</span></div></div></div> +<div class='clause' predicate='std.set.private.cardinal'><div class='loc'>File "builtin_set.elpi", line 100, column 0, character 22409:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.cardinal std.set.private.empty 0</div></div> +<div class='clause' predicate='std.set.private.cardinal'><div class='loc'>File "builtin_set.elpi", line 101, column 0, character 22427:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.cardinal <span class='name' varname='717'>L</span> <span class='name' varname='720'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.cardinal <span class='name' varname='718'>R</span> <span class='name' varname='721'>Spilled<sub>2</sub></span>,</div><div class='hyp compound'><div class='compound'><span class='name' varname='719'>N</span> <b>is</b> </div><div class='compound'><div class='compound'><div class='compound'><span class='name' varname='720'>Spilled<sub>1</sub></span> + </div><div class='compound'>1 + </div></div><div class='compound'><span class='name' varname='721'>Spilled<sub>2</sub></span></div></div></div></div><div class='concl'><div class='compound'>std.set.private.cardinal (std.set.private.node <span class='name' varname='717'>L</span> _ <span class='name' varname='718'>R</span> _) <span class='name' varname='719'>N</span></div></div></div> +<div class='clause' predicate='std.set.private.elements'><div class='loc'>File "builtin_set.elpi", line 104, column 0, character 22538:</div><div class='hyps'><div class='hyp'></div></div><div class='concl'>std.set.private.elements std.set.private.empty <span class='name' varname='722'>X</span> <span class='name' varname='722'>X</span></div></div> +<div class='clause' predicate='std.set.private.elements'><div class='loc'>File "builtin_set.elpi", line 105, column 0, character 22558:</div><div class='hyps'><div class='hyp compound' level='60'>std.set.private.elements <span class='name' varname='725'>R</span> <span class='name' varname='726'>Acc</span> <span class='name' varname='728'>Spilled<sub>1</sub></span>,</div><div class='hyp compound'>std.set.private.elements <span class='name' varname='723'>L</span> <div class='compound' level='99'><b>[</b><div class='compound'><span class='name' varname='724'>E</span> <b>|</b> <span class='name' varname='728'>Spilled<sub>1</sub></span></div><b>]</b></div> <span class='name' varname='727'>X</span></div></div><div class='concl'><div class='compound'>std.set.private.elements (std.set.private.node <span class='name' varname='723'>L</span> <span class='name' varname='724'>E</span> <span class='name' varname='725'>R</span> _) <span class='name' varname='726'>Acc</span> <span class='name' varname='727'>X</span></div></div></div> +<div class='clause' predicate='printterm'><div class='loc'>File "builtin_set.elpi", line 255, column 0, character 27689:</div><div class='hyps'><div class='hyp compound' level='60'>term_to_string <span class='name' varname='730'>T</span> <span class='name' varname='731'>T<sub>1</sub></span>,</div><div class='hyp compound'>output <span class='name' varname='729'>S</span> <span class='name' varname='731'>T<sub>1</sub></span></div></div><div class='concl'><div class='compound'>printterm <span class='name' varname='729'>S</span> <span class='name' varname='730'>T</span></div></div></div> +<div class='clause' predicate='read'><div class='loc'>File "builtin_set.elpi", line 259, column 0, character 27757:</div><div class='hyps'><div class='hyp compound' level='60'>flush std_out,</div><div class='hyp compound'>input_line std_in <span class='name' varname='733'>X</span>,</div><div class='hyp compound'>string_to_term <span class='name' varname='733'>X</span> <span class='name' varname='732'>S</span></div></div><div class='concl'><div class='compound'>read <span class='name' varname='732'>S</span></div></div></div> +<div class='clause' predicate='whd'><div class='loc'>File "(stdin)", line 7, column 3, character 142:</div><div class='hyps'><div class='hyp compound' level='60'>whd <span class='name' varname='734'>Hd</span> (fun <span class='name' varname='737'>F</span>),</div><div class='hyp compound'><span class='cut'>!</span>,</div><div class='hyp compound'>whd (<span class='name' varname='737'>F</span> <span class='name' varname='735'>Arg</span>) <span class='name' varname='736'>Reduct</span></div></div><div class='concl'><div class='compound'>whd (app <span class='name' varname='734'>Hd</span> <span class='name' varname='735'>Arg</span>) <span class='name' varname='736'>Reduct</span></div></div></div> +<div class='clause' predicate='whd'><div class='loc'>File "(stdin)", line 11, column 3, character 265:</div><div class='hyps'><div class='compound'><span class='name' varname='739'>Reduct</span> = </div><div class='compound'><span class='name' varname='738'>X</span></div></div><div class='concl'><div class='compound'>whd <span class='name' varname='738'>X</span> <span class='name' varname='739'>Reduct</span></div></div></div> +<div class='clause' predicate='of'><div class='loc'>File "(stdin)", line 10, column 3, character 294:</div><div class='hyps'><div class='hyp compound' level='60'>of <span class='name' varname='740'>Hd</span> (arr <span class='name' varname='743'>A</span> <span class='name' varname='742'>B</span>),</div><div class='hyp compound'>of <span class='name' varname='741'>Arg</span> <span class='name' varname='743'>A</span></div></div><div class='concl'><div class='compound'>of (app <span class='name' varname='740'>Hd</span> <span class='name' varname='741'>Arg</span>) <span class='name' varname='742'>B</span></div></div></div> +<div class='clause' predicate='of'><div class='loc'>File "(stdin)", line 15, column 3, character 459:</div><div class='hyps'><div class='compound'><b>∀</b><span class='name' varname='747'>x<sub>1</sub></span>. </div><div class='compound'><div class='compound'>of <span class='name' varname='747'>x<sub>1</sub></span> <span class='name' varname='745'>A</span> <b>⇒</b> </div><div class='compound'>of (<span class='name' varname='744'>F</span> <span class='name' varname='747'>x<sub>1</sub></span>) <span class='name' varname='746'>B</span></div></div></div><div class='concl'><div class='compound'>of (fun <span class='name' varname='744'>F</span>) (arr <span class='name' varname='745'>A</span> <span class='name' varname='746'>B</span>)</div></div></div> </body></html> \ No newline at end of file diff --git a/tutorial_coq_elpi_HOAS.html b/tutorial_coq_elpi_HOAS.html index 23bec11d0..a394ae907 100644 --- a/tutorial_coq_elpi_HOAS.html +++ b/tutorial_coq_elpi_HOAS.html @@ -176,17 +176,17 @@ <h1><a class="toc-backref" href="#toc-entry-1">HOAS for Gallina</a></h1> syntax tree of Coq terms.</p> <div class="section" id="constructor-global"> <h2><a class="toc-backref" href="#toc-entry-2">Constructor <code class="e elpi">global</code></a></h2> -<p>Let's start with the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L562">gref</a> data type (for global rerence).</p> +<p>Let's start with the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L574">gref</a> data type (for global rerence).</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">const</span> <span class="kt">constant</span> <span class="kt">-></span> <span class="kt">gref</span>. <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">indt</span> <span class="kt">inductive</span> <span class="kt">-></span> <span class="kt">gref</span>. <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">indc</span> <span class="kt">constructor</span> <span class="kt">-></span> <span class="kt">gref</span>. </pre> -<p><a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L550">constant</a>, <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L554">inductive</a> and <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L558">constructor</a> are Coq specific -data types that are opaque to Elpi. Still the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L562">gref</a> data type lets you +<p><a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L562">constant</a>, <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L566">inductive</a> and <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L570">constructor</a> are Coq specific +data types that are opaque to Elpi. Still the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L574">gref</a> data type lets you see what these names point to (a constant, and inductive type or a constructor).</p> -<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L591">coq.locate</a> API resolves a string to a <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L562">gref</a>.</p> +<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L599">coq.locate</a> API resolves a string to a <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L574">gref</a>.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-hoas-v-chk0" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-hoas-v-chk0"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> coq.locate <span class="s2">"nat"</span> <span class=" -ElpiVariable">GRnat</span><span class="k k-ElpiKeyword">,</span> @@ -211,15 +211,15 @@ <h2><a class="toc-backref" href="#toc-entry-2">Constructor <code class="e elpi"> coq.env.const <span class=" -ElpiVariable">C</span> (some <span class=" -ElpiVariable">Bo</span>) <span class=" -ElpiVariable">TyC</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Bo = app [<span class="kn">global</span> (indc «S»), app [<span class="kn">global</span> (indc «S»), <span class="kn">global</span> (indc «O»)]]</blockquote><blockquote class="alectryon-message">C = «x»</blockquote><blockquote class="alectryon-message">GR = const «x»</blockquote><blockquote class="alectryon-message">Ty = <span class="kn">global</span> (indt «nat»)</blockquote><blockquote class="alectryon-message">TyC = <span class="kn">global</span> (indt «nat»)</blockquote></div></div></small></span></pre><p>An expression like <code class="e elpi">indt <span class="err">«</span>nat<span class="err">»</span></code> is not a Coq term (or better a type) yet.</p> -<p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L85">global</a> term constructor turns a <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L562">gref</a> into an -actual <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L80">term</a>.</p> +<p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L183">global</a> term constructor turns a <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L574">gref</a> into an +actual <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L178">term</a>.</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">global</span> <span class="kt">gref</span> <span class="kt">-></span> <span class="kt">term</span>. </pre> </div> <div class="section" id="constructors-app-and-fun"> <h2><a class="toc-backref" href="#toc-entry-3">Constructors <code class="e elpi">app</code> and <code class="e elpi">fun</code></a></h2> -<p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L94">app</a> term constructor takes a list of terms and builds +<p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L192">app</a> term constructor takes a list of terms and builds the (n-ary) application. The first term is the head, while the others are the arguments.</p> <p>For example <code class="e elpi">app <span class="k-ElpiKeyword">[</span>global (indc <span class="err">«</span><span class="n-ElpiVariable">S</span><span class="err">»</span><span class="o">)</span><span class="k-ElpiKeyword">,</span> global (indc <span class="err">«</span><span class="n-ElpiVariable">O</span><span class="err">»</span><span class="o">)</span><span class="k-ElpiKeyword">]</span></code> is @@ -235,30 +235,30 @@ <h2><a class="toc-backref" href="#toc-entry-3">Constructors <code class="e elpi" coq.locate <span class="s2">"f"</span> (const <span class=" -ElpiVariable">C</span>)<span class="k k-ElpiKeyword">,</span> coq.env.const <span class=" -ElpiVariable">C</span> (some <span class=" -ElpiVariable">Bo</span>) <span class=" -ElpiVariable">_</span> -<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Bo = <span class="kr">fun</span> `x` (<span class="kn">global</span> (indt «nat»)) c0 \ c0</blockquote><blockquote class="alectryon-message">C = «f»</blockquote></div></div></small></span></pre><p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L89">fun</a> constructor carries a pretty printing hint <tt class="docutils literal">`x`</tt>, +<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Bo = <span class="kr">fun</span> `x` (<span class="kn">global</span> (indt «nat»)) c0 \ c0</blockquote><blockquote class="alectryon-message">C = «f»</blockquote></div></div></small></span></pre><p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L187">fun</a> constructor carries a pretty printing hint <tt class="docutils literal">`x`</tt>, the type of the bound variable <code class="highlight coq"><span class="n">nat</span></code> and a function describing the body:</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">fun</span> <span class="kt">name</span> <span class="kt">-></span> <span class="kt">term</span> <span class="kt">-></span> <span class="kt">(term</span> <span class="kt">-></span> <span class="kt">term)</span> <span class="kt">-></span> <span class="kt">term</span>. </pre> <div class="admonition note"> <p class="first admonition-title">Note</p> -<p><a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1621">name</a> is just for pretty printing: in spite of carrying +<p><a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1627">name</a> is just for pretty printing: in spite of carrying a value in the Coq world, it has no content in Elpi (like the unit type)</p> -<p>Elpi terms of type <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1621">name</a> are just identifiers +<p>Elpi terms of type <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1627">name</a> are just identifiers written between <tt class="docutils literal">`</tt> (backticks).</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-hoas-v-chk3" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-hoas-v-chk3"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> <span class="k k-ElpiKeyword">fun</span> `foo` <span class=" -ElpiVariable">T</span> <span class=" -ElpiVariable">B</span> <span class="k k-ElpiKeyword">=</span> <span class="k k-ElpiKeyword">fun</span> `bar` <span class=" -ElpiVariable">T</span> <span class=" -ElpiVariable">B</span> <span class="c">% names don't matter</span> -<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">B = X0</blockquote><blockquote class="alectryon-message">T = X1</blockquote></div></div></small></span></pre><p class="last">API such as <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1624">coq.name-suffix</a> lets one craft a family of +<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">B = X0</blockquote><blockquote class="alectryon-message">T = X1</blockquote></div></div></small></span></pre><p class="last">API such as <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1630">coq.name-suffix</a> lets one craft a family of names starting from one, eg <tt class="docutils literal"><span class="pre">coq.name-suffix</span> `H` 1 N</tt> sets <code class="e elpi"><span class="n-ElpiVariable">N</span></code> to <tt class="docutils literal">`H1`</tt>.</p> </div> </div> <div class="section" id="constructors-fix-and-match"> <h2><a class="toc-backref" href="#toc-entry-4">Constructors <code class="e elpi">fix</code> and <code class="e elpi">match</code></a></h2> -<p>The other binders <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L90">prod</a> (Coq's <code class="highlight coq"><span class="kr">forall</span></code>, AKA <code class="highlight coq"><span class="n">Π</span></code>) and <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L91">let</a> are similar, -so let's rather focus on <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L96">fix</a> here.</p> +<p>The other binders <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L188">prod</a> (Coq's <code class="highlight coq"><span class="kr">forall</span></code>, AKA <code class="highlight coq"><span class="n">Π</span></code>) and <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L189">let</a> are similar, +so let's rather focus on <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L194">fix</a> here.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-hoas-v-chk4" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-hoas-v-chk4"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> coq.locate <span class="s2">"plus"</span> (const <span class=" -ElpiVariable">C</span>)<span class="k k-ElpiKeyword">,</span> @@ -272,14 +272,14 @@ <h2><a class="toc-backref" href="#toc-entry-4">Constructors <code class="e elpi" <span class="kr">match</span> c1 (<span class="kr">fun</span> `n` (<span class="kn">global</span> (indt «nat»)) c3 \ <span class="kn">global</span> (indt «nat»)) [c2, <span class="kr">fun</span> `p` (<span class="kn">global</span> (indt «nat»)) c3 \ - app [<span class="kn">global</span> (indc «S»), app [c0, c3, c2]]]</blockquote><blockquote class="alectryon-message">C = «Nat.add»</blockquote></div></div></small></span></pre><p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L96">fix</a> constructor carries a pretty printing hint, + app [<span class="kn">global</span> (indc «S»), app [c0, c3, c2]]]</blockquote><blockquote class="alectryon-message">C = «Nat.add»</blockquote></div></div></small></span></pre><p>The <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L194">fix</a> constructor carries a pretty printing hint, the number of the recursive argument (starting at <code class="e elpi"><span class="m-ElpiInteger">0</span></code>), the type of the recursive function and finally the body where the recursive call is represented via a bound variable</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">fix</span> <span class="kt">name</span> <span class="kt">-></span> <span class="kt">int</span> <span class="kt">-></span> <span class="kt">term</span> <span class="kt">-></span> <span class="kt">(term</span> <span class="kt">-></span> <span class="kt">term)</span> <span class="kt">-></span> <span class="kt">term</span>. </pre> -<p>A <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L95">match</a> constructor carries the term being inspected, +<p>A <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L193">match</a> constructor carries the term being inspected, the return clause and a list of branches. Each branch is a Coq function expecting in input the arguments of the corresponding constructor. The order follows the @@ -311,13 +311,13 @@ <h2><a class="toc-backref" href="#toc-entry-4">Constructors <code class="e elpi" c3 \ prod `_` (app [c1, <span class="kn">global</span> (indc «O»)]) c4 \ app [c1, c2]</blockquote></div></div></small></span></pre></div> <div class="section" id="constructor-sort"> <h2><a class="toc-backref" href="#toc-entry-5">Constructor <code class="e elpi">sort</code></a></h2> -<p>The last term constructor worth discussing is <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L82">sort</a>.</p> +<p>The last term constructor worth discussing is <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L180">sort</a>.</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">sort</span> <span class="kt">universe</span> <span class="kt">-></span> <span class="kt">term</span>. <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">prop</span> <span class="kt">universe</span>. <span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">typ</span> <span class="kt">univ</span> <span class="kt">-></span> <span class="kt">universe</span>. </pre> -<p>The opaque type <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L937">univ</a> is a universe level variable. Elpi holds a store of +<p>The opaque type <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L948">univ</a> is a universe level variable. Elpi holds a store of constraints among these variables and provides APIs named <code class="e elpi">coq.univ<span class="o">.</span><span class="k-ElpiKeyword">*</span></code> to impose constraints.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-hoas-v-chk6" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-hoas-v-chk6"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> @@ -349,7 +349,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Constructor <code class="e elpi"> variables (<code class="e elpi"><span class="n-ElpiVariable">U</span></code> and <code class="e elpi"><span class="n-ElpiVariable">V</span></code> below).</p> </div> <p>Let's play a bit more with universe constraints using the -<a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a> API:</p> +<a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a> API:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-hoas-v-chk7" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-hoas-v-chk7"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> <span class=" -ElpiVariable">ID</span> <span class="k k-ElpiKeyword">=</span> (<span class="k k-ElpiKeyword">fun</span> `x` (<span class="k k-ElpiKeyword">sort</span> (typ <span class=" -ElpiVariable">U</span>)) <span class=" -ElpiVariable">x\</span> x)<span class="k k-ElpiKeyword">,</span> @@ -416,7 +416,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Constructor <code class="e elpi"> WEAK CONSTRAINTS: -</blockquote></div></div></small></span></pre><p>The <a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L252">diagnostic</a> data type is used by <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a> to +</blockquote></div></div></small></span></pre><p>The <a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L248">diagnostic</a> data type is used by <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a> to tell if the term is well typed. The constructor <code class="e elpi">ok</code> signals success, while <code class="e elpi">error</code> carries an error message. In case of success universe constraints are added to the store.</p> @@ -588,7 +588,7 @@ <h1><a class="toc-backref" href="#toc-entry-7">The context</a></h1> <p>In some sense Elpi's way of traversing a binder is similar to a Zipper. The context of Elpi must record the part of the Zipper context that is relevant for binders.</p> -<p>The two predicates <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L166">decl</a> and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L167">def</a> are used +<p>The two predicates <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L264">decl</a> and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L265">def</a> are used for that purpose:</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">pred</span> <span class="n-ElpiFunction">decl</span> <span class="k-ElpiMode">i:</span><span class="kt">term</span>, <span class="k-ElpiMode">o:</span><span class="kt">name</span>, <span class="k-ElpiMode">o:</span><span class="kt">term</span>. <span class="c">% Var Name Ty @@ -636,9 +636,9 @@ <h1><a class="toc-backref" href="#toc-entry-7">The context</a></h1> app [<span class="kn">global</span> (indc «S»), <span class="kn">global</span> (indc «O»)]]</blockquote><blockquote class="alectryon-message">Ty = <span class="kn">global</span> (indt «nat»)</blockquote></div></div></small></span></pre></div></div> <div class="admonition tip"> <p class="first admonition-title">Tip</p> -<p class="last"><code class="e elpi"><span class="k-ElpiKeyword">@</span>pi-decl <span class="n-ElpiVariable">N</span> <span class="n-ElpiVariable">Ty</span> <span class="n-ElpiVariable">x\</span> </code> takes arguments in the same order of <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L89">fun</a> and -<a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L90">prod</a>, while -<code class="e elpi"><span class="k-ElpiKeyword">@</span>pi-def <span class="n-ElpiVariable">N</span> <span class="n-ElpiVariable">Ty</span> <span class="n-ElpiVariable">Bo</span> <span class="n-ElpiVariable">x\</span> </code> takes arguments in the same order of <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L91">let</a>.</p> +<p class="last"><code class="e elpi"><span class="k-ElpiKeyword">@</span>pi-decl <span class="n-ElpiVariable">N</span> <span class="n-ElpiVariable">Ty</span> <span class="n-ElpiVariable">x\</span> </code> takes arguments in the same order of <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L187">fun</a> and +<a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L188">prod</a>, while +<code class="e elpi"><span class="k-ElpiKeyword">@</span>pi-def <span class="n-ElpiVariable">N</span> <span class="n-ElpiVariable">Ty</span> <span class="n-ElpiVariable">Bo</span> <span class="n-ElpiVariable">x\</span> </code> takes arguments in the same order of <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L189">let</a>.</p> </div> </div> <div class="section" id="holes-implicit-arguments"> @@ -686,7 +686,7 @@ <h1><a class="toc-backref" href="#toc-entry-7">The context</a></h1> α7 := <span class="kt">Type</span> WEAK CONSTRAINTS: -</blockquote></div></div></small></span></pre><p>Before the call to <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a>, <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1384">coq.sigma.print</a> +</blockquote></div></div></small></span></pre><p>Before the call to <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a>, <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1390">coq.sigma.print</a> prints nothing interesting, while after the call it also prints the following syntactic constraint:</p> <pre class="alectryon-block highlight"><!-- Generator: Alectryon -->evar (<span class=" -ElpiVariable">X1</span>) (global (indt «nat»)) (<span class=" -ElpiVariable">X1</span>) <span class="c">/* suspended on X1 */</span></pre><p>which indicates that the hole <code class="e elpi"><span class="n-ElpiVariable">X1</span></code> is linked to a Coq evar @@ -837,7 +837,7 @@ <h2><a class="toc-backref" href="#toc-entry-9">Outside the pattern fragment</a>< to be a special dummy constant, to be turned into an actual hole on the fly when needed.</p> <p>This use case is perfectly legitimate and is supported by all APIs taking -terms in input thanks to the <a class="macro ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L223">@holes!</a> option.</p> +terms in input thanks to the <a class="macro ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L321">@holes!</a> option.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-hoas-v-chk16" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-hoas-v-chk16"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> <span class=" -ElpiVariable">T</span> <span class="k k-ElpiKeyword">=</span> <span class="si">{{</span> <span class="kr">fun</span> <span class="nv">x</span> : nat => x + _ <span class="si">}}</span><span class="k k-ElpiKeyword">,</span> @@ -873,16 +873,16 @@ <h2><a class="toc-backref" href="#toc-entry-9">Outside the pattern fragment</a>< α9 := <span class="kt">Type</span> WEAK CONSTRAINTS: -</blockquote></div></div></small></span></pre><p>Note that after the call to <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a>, <code class="e elpi"><span class="n-ElpiVariable">X0</span></code> is assigned the +</blockquote></div></div></small></span></pre><p>Note that after the call to <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a>, <code class="e elpi"><span class="n-ElpiVariable">X0</span></code> is assigned the term <code class="e elpi"><span class="n-ElpiVariable">_</span><span class="err">\</span> <span class="n-ElpiVariable">X1</span></code>, that means that the offending argument has been pruned (discarded).</p> <div class="admonition note"> <p class="first admonition-title">Note</p> -<p class="last">All APIs taking a term support the <a class="macro ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L223">@holes!</a> option.</p> +<p class="last">All APIs taking a term support the <a class="macro ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L321">@holes!</a> option.</p> </div> -<p>In addition to the <a class="macro ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L223">@holes!</a> option, there is a class of APIs which can +<p>In addition to the <a class="macro ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L321">@holes!</a> option, there is a class of APIs which can deal with terms outside the pattern fragment. These APIs take in input a term -<em>skeleton</em>. A skeleton is not modified in place, as <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a> +<em>skeleton</em>. A skeleton is not modified in place, as <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a> does with its first argument, but is rather elaborated to a term related to it.</p> <p>In some sense APIs taking a skeleton are more powerful, because they can modify the structure of the term, eg. insert a coercions, but are less diff --git a/tutorial_coq_elpi_command.html b/tutorial_coq_elpi_command.html index 1b784f9ec..97e689adb 100644 --- a/tutorial_coq_elpi_command.html +++ b/tutorial_coq_elpi_command.html @@ -167,6 +167,7 @@ <h1 class="title">Tutorial on Coq commands</h1> <li><a class="reference internal" href="#reporting-errors" id="toc-entry-12">Reporting errors</a></li> </ul> </li> +<li><a class="reference internal" href="#parsing-and-execution" id="toc-entry-13">Parsing and Execution</a></li> </ul> </div> <div class="section" id="defining-commands"> @@ -186,9 +187,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Defining commands</a></h1> <p>The first one <code class="highlight coq"><span class="n">Elpi</span> <span class="n">Command</span> <span class="n">hello</span><span class="o">.</span></code> sets the current program to hello. Since it is declared as a <code class="highlight coq"><span class="n">Command</span></code> some code is loaded automatically:</p> <ul class="simple"> -<li>APIs (eg <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L517">coq.say</a>) and data types (eg Coq <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L80">term</a> s) are loaded from +<li>APIs (eg <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L529">coq.say</a>) and data types (eg Coq <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L178">term</a> s) are loaded from <a class="reference external" href="https://github.com/LPCIC/coq-elpi/blob/master/coq-builtin.elpi">coq-builtin.elpi</a></li> -<li>some utilities, like <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a> or <a class="libred ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-reduction.elpi#L15">whd1</a> are loaded from +<li>some utilities, like <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a> or <a class="libred ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-reduction.elpi#L15">whd1</a> are loaded from <a class="reference external" href="https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-command-template.elpi">elpi-command-template.elpi</a></li> </ul> <p>The second one <code class="highlight coq"><span class="n">Elpi</span> <span class="n">Accumulate</span> <span class="o">...</span></code> loads some extra code. @@ -213,7 +214,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Defining commands</a></h1> as <code class="e elpi">(str <span class="s2">"world!"</span><span class="o">)</span></code>.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> -<p class="last"><a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L517">coq.say</a> won't print quotes around strings</p> +<p class="last"><a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L529">coq.say</a> won't print quotes around strings</p> </div> </div> <div class="section" id="command-arguments"> @@ -262,7 +263,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Command arguments</a></h1> the type of the record (which was omitted) defaults to <code class="highlight coq"><span class="kt">Type</span></code>. Finally note that the type of the second field sees <code class="e elpi">c0</code> (the value of the first field).</p> -<p>See the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L50">argument</a> data type +<p>See the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L46">argument</a> data type for a detailed decription of all the arguments a command can receive.</p> <div class="section" id="processing-raw-arguments"> <h2><a class="toc-backref" href="#toc-entry-3">Processing raw arguments</a></h2> @@ -295,9 +296,9 @@ <h2><a class="toc-backref" href="#toc-entry-3">Processing raw arguments</a></h2> <span class="s2">"true"</span> : <span class="s2">"bool"</span> The <span class="mi">3</span>rd term has type <span class="s2">"bool"</span> which should be a subtype of <span class="s2">"nat"</span>.</blockquote></div></div></small></span></pre><p>The command <code class="highlight coq"><span class="n">check_arg</span></code> receives a term <code class="e elpi"><span class="n-ElpiVariable">T</span></code> and type checks it, then it prints the term and its type.</p> -<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a> API has 3 arguments: a term, its type and a -<a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L252">diagnostic</a> which can either be <code class="e elpi">ok</code> or <code class="e elpi">(error <span class="n-ElpiVariable">Message</span><span class="o">)</span></code>. -The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L461">assert-ok!</a> combinator checks if the diagnostic is <code class="e elpi">ok</code>, +<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a> API has 3 arguments: a term, its type and a +<a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L248">diagnostic</a> which can either be <code class="e elpi">ok</code> or <code class="e elpi">(error <span class="n-ElpiVariable">Message</span><span class="o">)</span></code>. +The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L457">assert-ok!</a> combinator checks if the diagnostic is <code class="e elpi">ok</code>, and if not it prints the error message and bails out.</p> <p>The first invocation succeeds while the second one fails and prints the type checking error (given by Coq) following the string passed to @@ -313,10 +314,10 @@ <h2><a class="toc-backref" href="#toc-entry-3">Processing raw arguments</a></h2> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chkc" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chkc"><span class="kn">Check</span> (<span class="mi">1</span> = true).</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="mi">1</span> = true : <span class="kt">Prop</span></blockquote></div></div></small></span></pre><p>The command still fails even if we told Coq how to inject booleans values into the natural numbers. Indeed the <code class="highlight coq"><span class="kn">Check</span></code> commands works.</p> -<p>The call to <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1388">coq.typecheck</a> modifies the term in place, it can assign +<p>The call to <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1394">coq.typecheck</a> modifies the term in place, it can assign implicit arguments (like the type parameter of <code class="highlight coq"><span class="n">eq</span></code>) but it cannot modify the structure of the term. To do so, one has to use the -<a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1407">coq.elaborate-skeleton</a> API.</p> +<a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1413">coq.elaborate-skeleton</a> API.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input">#[arguments(raw)] <span class="kn">Elpi</span> <span class="kn">Command</span> elaborate_arg.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -354,8 +355,8 @@ <h1><a class="toc-backref" href="#toc-entry-4">Examples</a></h1> <h2><a class="toc-backref" href="#toc-entry-5">Synthesizing a term</a></h2> <p>Synthesizing a term typically involves reading an existing declaration and writing a new one. The relevant APIs are in the <code class="highlight coq"><span class="n">coq</span><span class="o">.</span><span class="n">env</span><span class="o">.*</span></code> namespace -and are named after the global refence they manipulate, eg <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L667">coq.env.const</a> -for reading and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L755">coq.env.add-const</a> for writing.</p> +and are named after the global refence they manipulate, eg <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L679">coq.env.const</a> +for reading and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L767">coq.env.add-const</a> for writing.</p> <p>Here we implement a little command that given an inductive type name generates a term of type <code class="highlight coq"><span class="n">nat</span></code> whose value is the number of constructors of the given inductive type.</p> @@ -387,20 +388,20 @@ <h2><a class="toc-backref" href="#toc-entry-5">Synthesizing a term</a></h2> </span></span><span class="alectryon-wsp"> </span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk10" style="display: none" type="checkbox"><label class="alectryon-input alectryon-failed" for="tutorial-coq-elpi-command-v-chk10"><span class="kn">Elpi</span> constructors_num plus nK_plus.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">not an inductive type: coq.locate plus (indt X0)</blockquote></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk11" style="display: none" type="checkbox"><label class="alectryon-input alectryon-failed" for="tutorial-coq-elpi-command-v-chk11"><span class="kn">Elpi</span> constructors_num not_there bla.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Global</span> reference not found: not_there</blockquote></div></div></small></span></pre><p>The command starts by locating the first argument and asserting it points to -an inductive type. This line is idiomatic: <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L591">coq.locate</a> aborts if +an inductive type. This line is idiomatic: <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L599">coq.locate</a> aborts if the string cannot be located, and if it relates it to a <code class="e elpi">gref</code> which is not -<code class="e elpi">indt</code> (for example <code class="e elpi">const plus</code>) <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L457">assert!</a> aborts with the given +<code class="e elpi">indt</code> (for example <code class="e elpi">const plus</code>) <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L453">assert!</a> aborts with the given error message.</p> -<p><a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L617">coq.env.indt</a> lets one access all the details of an inductive type, +<p><a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L629">coq.env.indt</a> lets one access all the details of an inductive type, here we just use the list of constructors. -The twin API <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L628">coq.env.indt-decl</a> lets +The twin API <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L640">coq.env.indt-decl</a> lets one access the declaration of the inductive in HOAS form, which might be easier to manipulate in other situations, like the next example.</p> <p>Then the program crafts a natural number and declares a constant for it.</p> </div> <div class="section" id="abstracting-an-inductive"> <h2><a class="toc-backref" href="#toc-entry-6">Abstracting an inductive</a></h2> -<p>For the sake of introducing <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a>, the swiss army knife of λProlog, we +<p>For the sake of introducing <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a>, the swiss army knife of λProlog, we write a command which takes an inductive type declaration and builds a new one abstracting the former one on a given term. The new inductive has a parameter in place of the occurrences of that term.</p> @@ -457,7 +458,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Abstracting an inductive</a></h2> <span class="kn">Arguments</span> tree' A%type_scope <span class="kn">Arguments</span> leaf' A%type_scope <span class="kn">Arguments</span> node' A%type_scope _ _ _</blockquote></div></div></small></span></pre><p>As expected <code class="highlight coq"><span class="n">tree'</span></code> has a parameter <code class="highlight coq"><span class="n">A</span></code>.</p> -<p>Now let's focus on <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a>. The standard +<p>Now let's focus on <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a>. The standard coq library (loaded by the command template) contains a definition of copy for terms and declarations.</p> <p>An excerpt:</p> @@ -479,19 +480,19 @@ <h2><a class="toc-backref" href="#toc-entry-6">Abstracting an inductive</a></h2> copy (app <span class="k-ElpiKeyword">[</span>global <span class="o">(</span>indt <span class="err">«</span>option<span class="err">»</span><span class="o">)</span><span class="k-ElpiKeyword">,</span> global <span class="o">(</span>indt <span class="err">«</span>nat<span class="err">»</span><span class="o">)</span><span class="k-ElpiKeyword">]</span><span class="o">)</span> c0 </pre> <p>and that rule masks the one for <code class="highlight coq"><span class="n">app</span></code> when the sub-term being copied is -exactly <code class="highlight coq"><span class="n">option</span> <span class="n">nat</span></code>. The API <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L140">copy-indt-decl</a> copies an inductive +exactly <code class="highlight coq"><span class="n">option</span> <span class="n">nat</span></code>. The API <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L129">copy-indt-decl</a> copies an inductive declaration and calls <code class="highlight coq"><span class="n">copy</span></code> on all the terms it contains (e.g. the type of the constructors).</p> -<p>The <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a> predicate is very flexible, but sometimes one needs to collect -some data along the way. The sibling API <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L160">fold-map</a> lets one do that.</p> +<p>The <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a> predicate is very flexible, but sometimes one needs to collect +some data along the way. The sibling API <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L149">fold-map</a> lets one do that.</p> <p>An excerpt:</p> <pre class="code elpi literal-block"> fold-map (fun <span class="n-ElpiVariable">N</span> <span class="n-ElpiVariable">T</span> <span class="n-ElpiVariable">F</span><span class="o">)</span> <span class="n-ElpiVariable">A</span> (fun <span class="n-ElpiVariable">N</span> <span class="n-ElpiVariable">T1</span> <span class="n-ElpiVariable">F1</span><span class="o">)</span> <span class="n-ElpiVariable">A2</span> <span class="k-ElpiKeyword">:-</span> fold-map <span class="n-ElpiVariable">T</span> <span class="n-ElpiVariable">A</span> <span class="n-ElpiVariable">T1</span> <span class="n-ElpiVariable">A1</span><span class="k-ElpiKeyword">,</span> <span class="k-ElpiKeyword">pi</span> <span class="n-ElpiVariable">x</span>\ fold-map (<span class="n-ElpiVariable">F</span> x<span class="o">)</span> <span class="n-ElpiVariable">A1</span> (<span class="n-ElpiVariable">F1</span> x<span class="o">)</span> <span class="n-ElpiVariable">A2</span><span class="o">.</span> </pre> -<p>For example one can use <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L160">fold-map</a> to collect into a list all the occurrences +<p>For example one can use <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L149">fold-map</a> to collect into a list all the occurrences of inductive type constructors in a given term, then use the list to postulate -the right number of binders for them, and finally use <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a> to capture them.</p> +the right number of binders for them, and finally use <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a> to capture them.</p> </div> </div> <div class="section" id="using-dbs-to-store-data-across-calls"> @@ -504,7 +505,7 @@ <h1><a class="toc-backref" href="#toc-entry-7">Using DBs to store data across ca Since is a Db is accumulated <em>when a program runs</em> the <em>current contents of the Db are used</em>. Moreover the Db can be extended by Elpi programs themselves -thanks to the API <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1721">coq.elpi.accumulate</a>, enabling code to save a state +thanks to the API <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1727">coq.elpi.accumulate</a>, enabling code to save a state which is then visible at subsequent runs.</p> <p>The initial contents of a Db, <code class="highlight coq"><span class="n">some</span> <span class="n">code</span></code> in the example above, is usually just the type declaration for the predicates part of the Db, @@ -545,7 +546,7 @@ <h1><a class="toc-backref" href="#toc-entry-7">Using DBs to store data across ca </span></span><span class="alectryon-wsp"> </span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk14" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk14"><span class="kn">Elpi</span> age bob.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">bob <span class="kr">is</span> <span class="mi">24</span> years old</blockquote></div></div></small></span></pre><p>Extending data bases this way is fine, but requires the user of our command to be familiar with Elpi's syntax, which is not very nice. Instead, -we can write a new program that uses the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1721">coq.elpi.accumulate</a> API +we can write a new program that uses the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1727">coq.elpi.accumulate</a> API to extend the Db.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> set_age.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="kn">Db</span> age.db.</span><span class="alectryon-wsp"> @@ -563,9 +564,9 @@ <h1><a class="toc-backref" href="#toc-entry-7">Using DBs to store data across ca instance: these object live inside a Coq module (or a Coq file) and become active when that module is Imported.</p> <p>Deciding to which Coq module these -extra rules belong is important and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1721">coq.elpi.accumulate</a> provides +extra rules belong is important and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1727">coq.elpi.accumulate</a> provides a few options to tune that. Here we passed <code class="e elpi"><span class="n-ElpiVariable">_</span></code>, that uses the default -setting. See the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1714">scope</a> and <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1705">clause</a> data types for more info.</p> +setting. See the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1720">scope</a> and <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1711">clause</a> data types for more info.</p> <div class="section" id="inspecting-a-db"> <span id="inspecting"></span><h2><a class="toc-backref" href="#toc-entry-8">Inspecting a Db</a></h2> <p>So far we did query a Db but sometimes one needs to inspect the whole @@ -586,11 +587,11 @@ <h1><a class="toc-backref" href="#toc-entry-7">Using DBs to store data across ca <span class="si">}}</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> -</span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk16" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk16"><span class="kn">Elpi</span> print_all_ages.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">bob <span class="kr">is</span> <span class="mi">24</span> years old</blockquote><blockquote class="alectryon-message">alice <span class="kr">is</span> <span class="mi">21</span> years old</blockquote></div></div></small></span></pre><p>The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L379">std.findall</a> predicate gathers in a list all solutions to -a query, while <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L627">std.forall</a> iterates a predicate over a list. -It is important to notice that <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L529">coq.error</a> is a fatal error which +</span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk16" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk16"><span class="kn">Elpi</span> print_all_ages.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">bob <span class="kr">is</span> <span class="mi">24</span> years old</blockquote><blockquote class="alectryon-message">alice <span class="kr">is</span> <span class="mi">21</span> years old</blockquote></div></div></small></span></pre><p>The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L375">std.findall</a> predicate gathers in a list all solutions to +a query, while <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L623">std.forall</a> iterates a predicate over a list. +It is important to notice that <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L541">coq.error</a> is a fatal error which aborts an Elpi program. Here we shadow the catch all clause with a regular -failure so that <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L379">std.findall</a> can complete to list all the results.</p> +failure so that <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L375">std.findall</a> can complete to list all the results.</p> </div> </div> <div class="section" id="polishing-a-command"> @@ -610,16 +611,17 @@ <h2><a class="toc-backref" href="#toc-entry-10">Attributes</a></h2> <span class="si">}}</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-wsp"> -</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk17" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk17">#[this, more(stuff=<span class="s2">"33"</span>)] <span class="kn">Elpi</span> attr.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">[attribute <span class="nb">elpi</span>.loc +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk17" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk17">#[this, more(stuff=<span class="s2">"33"</span>)] <span class="kn">Elpi</span> attr.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">This command does not support these attributes: more, +this. [unsupported-attributes,parsing,default]</blockquote><blockquote class="alectryon-message">[attribute <span class="nb">elpi</span>.loc (leaf-loc File <span class="s2">"(stdin)"</span>, line <span class="mi">10</span>, column <span class="mi">31</span>, character <span class="mi">175</span>:), - attribute this (leaf-str ), + attribute <span class="nb">elpi</span>.phase (leaf-str interp), attribute this (leaf-str ), attribute more (node [attribute stuff (leaf-str <span class="mi">33</span>)])]</blockquote></div></div></small></span></pre><p>The first attribute, <code class="e elpi">elpi.loc</code> is always present and corresponds to the location in the source file of the command. Then we find an attribute for <code class="e elpi"><span class="s2">"this"</span></code> holding the emptry string and an attribute for <code class="e elpi"><span class="s2">"more.stuff"</span></code> holding the string <code class="e elpi"><span class="s2">"33"</span></code>.</p> <p>Attributes are usually validated (parsed) and turned into regular options -using <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L620">coq.parse-attributes</a> and a description of their types using -the <a class="libtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L660">attribute-type</a> data type:</p> +using <a class="lib-common ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib-common.elpi#L25">coq.parse-attributes</a> and a description of their types using +the <a class="libtype-common ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib-common.elpi#L65">attribute-type</a> data type:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> parse_attr.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -638,10 +640,12 @@ <h2><a class="toc-backref" href="#toc-entry-10">Attributes</a></h2> <span class="si">}}</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-wsp"> -</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk18" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk18">#[this, more(stuff=<span class="s2">"33"</span>)] <span class="kn">Elpi</span> parse_attr.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">options= +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk18" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk18">#[this, more(stuff=<span class="s2">"33"</span>)] <span class="kn">Elpi</span> parse_attr.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">This command does not support these attributes: more, +this. [unsupported-attributes,parsing,default]</blockquote><blockquote class="alectryon-message">options= [get-option <span class="nb">elpi</span>.loc File <span class="s2">"(stdin)"</span>, line <span class="mi">19</span>, column <span class="mi">31</span>, character <span class="mi">358</span>:, - get-option this tt, get-option more.stuff <span class="mi">33</span>]</blockquote><blockquote class="alectryon-message"><span class="mi">33</span> tt</blockquote></div></div></small><span class="alectryon-wsp"> -</span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk19" style="display: none" type="checkbox"><label class="alectryon-input alectryon-failed" for="tutorial-coq-elpi-command-v-chk19">#[unknown] <span class="kn">Elpi</span> parse_attr.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">Attribute unknown <span class="kr">is</span> not supported</blockquote></div></div></small></span></pre><p>Note that <code class="e elpi">get-option</code> links a string with a datum of type <code class="e elpi">any</code>, which means + get-option <span class="nb">elpi</span>.phase interp, get-option this tt, get-option more.stuff <span class="mi">33</span>]</blockquote><blockquote class="alectryon-message"><span class="mi">33</span> tt</blockquote></div></div></small><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk19" style="display: none" type="checkbox"><label class="alectryon-input alectryon-failed" for="tutorial-coq-elpi-command-v-chk19">#[unknown] <span class="kn">Elpi</span> parse_attr.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">This command does not support this attribute: unknown. +[unsupported-attributes,parsing,default]</blockquote><blockquote class="alectryon-message">Attribute unknown <span class="kr">is</span> not supported</blockquote></div></div></small></span></pre><p>Note that <code class="e elpi">get-option</code> links a string with a datum of type <code class="e elpi">any</code>, which means no type checking is performed on it. It is recommended to wrap calls to get-option into other predicates typed in a more precise way. Eg:</p> <pre class="code elpi literal-block"> @@ -690,18 +694,223 @@ <h2><a class="toc-backref" href="#toc-entry-12">Reporting errors</a></h2> error:</p> <pre class="alectryon-block highlight"><!-- Generator: Alectryon -->The elpi tactic/command bad failed without giving a specific error message. Please report this -inconvenience to the authors of the program.</pre><p>You should use the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L529">coq.error</a> API or the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L457">assert!</a> one -to abort a program. There is a dedicated <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1545">coq.ltac.fail</a> API to abort +inconvenience to the authors of the program.</pre><p>You should use the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L541">coq.error</a> API or the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L453">assert!</a> one +to abort a program. There is a dedicated <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1551">coq.ltac.fail</a> API to abort tactics.</p> -<p>Warnings can be reported using the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L523">coq.warning</a> which lets you +<p>Warnings can be reported using the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L535">coq.warning</a> which lets you pick a name and category. In turn these can be used to disable or make fatal your warnings (as any other Coq warning).</p> -<p>This is really the end, unless you want to learn more about writing +</div> +</div> +<div class="section" id="parsing-and-execution"> +<h1><a class="toc-backref" href="#toc-entry-13">Parsing and Execution</a></h1> +<p>Since version 8.18 Coq has separate parsing and execution phases, +respectively called synterp and interp.</p> +<p>Since Coq has an extensible grammar the parsing phase is not entirely +performed by the parser: after parsing one sentence Coq evaluates its +synterp action. The synterp actions of a command like <code class="highlight coq"><span class="kn">Import</span> <span class="n">A</span><span class="o">.</span></code> are +the subset of its effect which affect parsing, like enabling a notation. +Later, during the execution phase, Coq evaluates its +interp actions, which include effects like putting lemma in scope or +enabling type class instances etc. Synterp actions are quick, if only because +they don't really manipulate Coq terms, hence no type checking and the like.</p> +<p>Being able to parse an entire document quickly +is important for developing reactive +user interfaces, but requires some extra work when defining new commands, +in particular to identify their synterp. +Each command defined with Coq-Elpi is split into two programs, +one running during the parsing phase and the other one during the execution +phase. Each API that affects the parser, i.e. APIs dealing with modules +and sections like begin/end-module or import/export, is available to both the +synterp and the interp program under the same name, but its actual effect is +limited to what concerns the current phase. Hence all these APIs have to be +called at <em>both</em> synterp and interp time and <em>in the same order</em>.</p> +<p>At synterp time the data types and the APIs are restricted, in particular +Coq terms are not available. When a command argument contains a term, that +term is replaced by <code class="highlight coq"><span class="n">_</span></code> at synterp time. In the following example, the synterp +program can see the name of the definition and the fact that a body was given, +but not the value of the body.</p> +<pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> hello_synterp.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main <span class="k k-ElpiKeyword">[</span>const-decl <span class=" -ElpiVariable">Name</span> <span class=" -ElpiVariable">Body</span> <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">]</span> <span class="k k-ElpiKeyword">:-</span> coq.say <span class="s2">"synterp"</span> <span class=" -ElpiVariable">Name</span> <span class="s2">":="</span> <span class=" -ElpiVariable">Body</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main <span class="k k-ElpiKeyword">[</span>const-decl <span class=" -ElpiVariable">Name</span> <span class=" -ElpiVariable">Body</span> <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">]</span> <span class="k k-ElpiKeyword">:-</span> coq.say <span class="s2">"interp"</span> <span class=" -ElpiVariable">Name</span> <span class="s2">":="</span> <span class=" -ElpiVariable">Body</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk1e" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk1e"><span class="kn">Elpi</span> hello_synterp <span class="kn">Definition</span> <span class="nf">x</span> := <span class="mi">2</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">synterp x := some _</blockquote><blockquote class="alectryon-message">interp x := +some + (app [<span class="kn">global</span> (indc «S»), app [<span class="kn">global</span> (indc «S»), <span class="kn">global</span> (indc «O»)]])</blockquote></div></div></small></span></pre><p>This simple command has no real synterp action, one could safely remove +the synterp code. On the contrary when a command performs actions affecting +the parser then it must come equipped with some synterp code performing +the corresponding actions.</p> +<pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Module</span> <span class="nf">Notations</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Notation</span> <span class="s2">"x '>>' y"</span> := (x > y) (<span class="kn">at level</span> <span class="mi">40</span>).</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Definition</span> <span class="nf">w</span> := <span class="mi">3</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">End</span> <span class="nf">Notations</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> import_module.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main <span class="k k-ElpiKeyword">[</span>str <span class=" -ElpiVariable">M</span><span class="k k-ElpiKeyword">]</span> <span class="k k-ElpiKeyword">:-</span> + coq.locate-module <span class=" -ElpiVariable">M</span> <span class=" -ElpiVariable">MP</span><span class="k k-ElpiKeyword">,</span> + coq.env.import-module <span class=" -ElpiVariable">MP</span><span class="k k-ElpiKeyword">,</span> + coq.locate <span class="s2">"w"</span> (const <span class=" -ElpiVariable">GR</span>)<span class="k k-ElpiKeyword">,</span> + coq.env.const <span class=" -ElpiVariable">GR</span> (some <span class="si">{{</span> <span class="mi">3</span> <span class="si">}}</span>) <span class=" -ElpiVariable">_</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk1f" style="display: none" type="checkbox"><label class="alectryon-input alectryon-failed" for="tutorial-coq-elpi-command-v-chk1f"><span class="kn">Elpi</span> import_module Notations.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">The command did perform no (more) actions during the +parsing phase (aka synterp), while during the +execution phase (aka interp) it tried to perform a +import-module action. Interp actions must <span class="kr">match</span> +synterp actions. For example <span class="kr">if</span> a module was imported +during the synterp phase, <span class="kr">then</span> it must also be +imported during the interp one. +The command lacks code <span class="kr">for</span> the synterp phase. In order +to add code to this phase use '#[synterp] <span class="kn">Elpi</span> +Accumulate'. See also +https://lpcic.github.io/coq-<span class="nb">elpi</span>/tutorial_coq_elpi_command.html#parsing-<span class="kn">and</span>-execution</blockquote></div></div></small><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +<span class="c">(* oops, we forgot to declare code for the synterp phase. Here it is *)</span> +</span><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main <span class="k k-ElpiKeyword">[</span>str <span class=" -ElpiVariable">M</span><span class="k k-ElpiKeyword">]</span> <span class="k k-ElpiKeyword">:-</span> + coq.locate-module <span class=" -ElpiVariable">M</span> <span class=" -ElpiVariable">MP</span><span class="k k-ElpiKeyword">,</span> + coq.env.import-module <span class=" -ElpiVariable">MP</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> import_module Notations.</span></span></pre><p>Elpi reports a descriptive error message if actions affecting the parser are +not declared in the synterp code of the command.</p> +<pre class="alectryon-block highlight"><!-- Generator: Alectryon -->The command did perform no (more) actions during the +parsing phase (aka synterp), while during the +execution phase (aka interp) it tried to perform a +import-module action. Interp actions must match +synterp actions. For example if a module was imported +during the synterp phase, then it must also be +imported during the interp one. +The command lacks code for the synterp phase. In order +to add code to this phase use '#[synterp] Elpi +Accumulate'. See also +https://lpcic.github.io/coq-elpi/tutorial_coq_elpi_command.html#parsing-and-execution</pre><p>Thanks to the synterp code, Coq can parse the document without even looking +at the interp code.</p> +<p>Sometimes it is necessary to pass data from the synterp code to the interp one. +Passing data can be done in two ways. the former is by using the <code class="e elpi">main-synterp</code> +and <code class="e elpi">main-interp</code> entry points.</p> +<pre class="code elpi literal-block"> +<span class="k-ElpiKeyword">pred</span> <span class="n-ElpiFunction">main-synterp</span> <span class="k-ElpiMode">i:</span><span class="kt">list</span> <span class="kt">argument</span>, <span class="k-ElpiMode">o:</span><span class="kt">any</span>. +<span class="k-ElpiKeyword">pred</span> <span class="n-ElpiFunction">main-interp</span> <span class="k-ElpiMode">i:</span><span class="kt">list</span> <span class="kt">argument</span>, <span class="k-ElpiMode">i:</span><span class="kt">any</span>. +</pre> +<p>Unlike <code class="e elpi">main</code> the former outputs a datum while the latter receives it +in input. In the following command we create a (empty) module with a random +name. Even if the name is random, the two phases need to agree on it, hence +we pass the name from one to the other.</p> +<pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> mk_random_module.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main-synterp <span class="k k-ElpiKeyword">[]</span> <span class=" -ElpiVariable">M</span> <span class="k k-ElpiKeyword">:-</span> + random.self_init<span class="k k-ElpiKeyword">,</span> + random.int <span class="m m-ElpiInteger">99</span> <span class=" -ElpiVariable">N</span><span class="k k-ElpiKeyword">,</span> + <span class=" -ElpiVariable">M</span> <span class="k k-ElpiKeyword">is</span> <span class="s2">"Module"</span> <span class="k k-ElpiKeyword">^</span> {std.any->string <span class=" -ElpiVariable">N</span>}, + coq.env.begin-module <span class=" -ElpiVariable">M</span> none<span class="k k-ElpiKeyword">,</span> + coq.env.end-module <span class=" -ElpiVariable">_</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main-interp <span class="k k-ElpiKeyword">[]</span> <span class=" -ElpiVariable">M</span> <span class="k k-ElpiKeyword">:-</span> + coq.env.begin-module <span class=" -ElpiVariable">M</span> none<span class="k k-ElpiKeyword">,</span> + coq.env.end-module <span class=" -ElpiVariable">MP</span><span class="k k-ElpiKeyword">,</span> + coq.say <span class="s2">"The module is"</span> <span class=" -ElpiVariable">MP</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk20" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk20"><span class="kn">Elpi</span> mk_random_module.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">The module <span class="kr">is</span> «tutorial_coq_elpi_command.Module15»</blockquote></div></div></small></span></pre><p>If the only data to be passed to the interp phase is the list of +synterp actions, then a few APIs can come in handy. +The synterp phase has access to the API <a class="builtin-synterp ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin-synterp.elpi#L360">coq.synterp-actions</a> +that lists the actions performed so far. The interp phase can use +<a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L609">coq.replay-synterp-action</a> and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1788">coq.next-synterp-action</a> to +replay an action or peek the next one to be performed.</p> +<p>An excerpt of the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1774">synterp-action</a>.</p> +<pre class="code elpi literal-block"> +<span class="c">% Action executed during the parsing phase (aka synterp) +</span><span class="k-ElpiKeyword">kind</span> <span class="n-ElpiFunction">synterp-action</span> <span class="kt">type</span>. +<span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">begin-module</span> <span class="kt">id</span> <span class="kt">-></span> <span class="kt">synterp-action</span>. +<span class="k-ElpiKeyword">type</span> <span class="n-ElpiFunction">end-module</span> <span class="kt">modpath</span> <span class="kt">-></span> <span class="kt">synterp-action</span>. +</pre> +<p>The following command creates a stack of modules and puts in there +the given definition. The synterp phase saves the actions when the top of the +stack is reached, and passes them to the interp phase that replays them before +putting a definition inside. Finally the interp phase replays all the missing +actions.</p> +<pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> put_inside.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main-synterp <span class="k k-ElpiKeyword">[</span>int <span class=" -ElpiVariable">N</span><span class="k k-ElpiKeyword">,</span> <span class=" -ElpiVariable">A</span><span class="k k-ElpiKeyword">]</span> <span class=" -ElpiVariable">ActionsUpToNow</span> <span class="k k-ElpiKeyword">:-</span> <span class=" -ElpiVariable">N</span> <span class="k k-ElpiKeyword">></span> <span class="m m-ElpiInteger">0</span><span class="k k-ElpiKeyword">,</span> <span class=" -ElpiVariable">M</span> <span class="k k-ElpiKeyword">is</span> <span class=" -ElpiVariable">N</span> <span class="k k-ElpiKeyword">-</span> <span class="m m-ElpiInteger">1</span><span class="k k-ElpiKeyword">,</span> + coq.env.begin-module <span class="s2">"Box"</span> none<span class="k k-ElpiKeyword">,</span> + main-synterp <span class="k k-ElpiKeyword">[</span>int <span class=" -ElpiVariable">M</span><span class="k k-ElpiKeyword">,</span> <span class=" -ElpiVariable">A</span><span class="k k-ElpiKeyword">]</span> <span class=" -ElpiVariable">ActionsUpToNow</span><span class="k k-ElpiKeyword">,</span> + coq.env.end-module <span class=" -ElpiVariable">_</span>. + main-synterp <span class="k k-ElpiKeyword">[</span>int <span class="m m-ElpiInteger">0</span><span class="k k-ElpiKeyword">,</span> <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">]</span> <span class=" -ElpiVariable">ActionsUpToNow</span> <span class="k k-ElpiKeyword">:-</span> + coq.synterp-actions <span class=" -ElpiVariable">ActionsUpToNow</span>. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main-interp <span class="k k-ElpiKeyword">[</span>int <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">,</span> const-decl <span class=" -ElpiVariable">Name</span> (some <span class=" -ElpiVariable">BO</span>) <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">]</span> <span class=" -ElpiVariable">Before</span> <span class="k k-ElpiKeyword">:-</span> + std.forall <span class=" -ElpiVariable">Before</span> coq.replay-synterp-action<span class="k k-ElpiKeyword">,</span> + coq.env.add-const <span class=" -ElpiVariable">Name</span> <span class=" -ElpiVariable">BO</span> <span class=" -ElpiVariable">_</span> <span class=" -ElpiVariable">_</span> <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">,</span> + replay-missing. + <span class="k k-ElpiKeyword">pred</span> <span class=" -ElpiFunction">replay-missing</span>. + replay-missing <span class="k k-ElpiKeyword">:-</span> + coq.replay-synterp-action {coq.next-synterp-action}, + replay-missing. + replay-missing. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> put_inside <span class="mi">4</span> <span class="kn">Definition</span> <span class="nf">foo</span> (<span class="nv">n</span> : nat) := n + <span class="mi">2</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk21" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk21"><span class="kn">Print</span> Box.Box.Box.Box.foo.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">Box.Box.Box.Box.foo = +<span class="kr">fun</span> <span class="nv">n</span> : nat => n + <span class="mi">2</span> + : nat -> nat + +<span class="kn">Arguments</span> Box.Box.Box.Box.foo n%nat_scope</blockquote></div></div></small></span></pre><p>This last example delegates to the synterp phase the creation of an arbitrary +complex module structure, a structure the interp phase does not need to be aware +of. The data passed to the interp phase is sufficient to replicate it without +too much effort.</p> +<p>Finally, as regular commands, data bases can be used to store a state which +is available at subsequent calls. Data bases used in the two phases live +in different name spaces, and are only available to the corresponding phase. +The <code class="highlight coq"><span class="o">#[</span><span class="n">synterp</span><span class="o">]</span></code> attribute tells <code class="highlight coq"><span class="n">Elpi</span> <span class="n">Db</span></code> to create a data base for the +synterp phase. Here a simple command saving a state in the synterp phase.</p> +<pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Db</span> counter.db <span class="si">lp:{{</span> <span class="k k-ElpiKeyword">pred</span> <span class=" -ElpiFunction">tick</span>. <span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Command</span> mk_next_module.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="kn">Db</span> counter.db.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input">#[synterp] <span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main <span class="k k-ElpiKeyword">[]</span> <span class="k k-ElpiKeyword">:-</span> + std.findall tick <span class=" -ElpiVariable">L</span><span class="k k-ElpiKeyword">,</span> + std.length <span class=" -ElpiVariable">L</span> <span class=" -ElpiVariable">N</span><span class="k k-ElpiKeyword">,</span> + <span class=" -ElpiVariable">M</span> <span class="k k-ElpiKeyword">is</span> <span class="s2">"NextModule"</span> <span class="k k-ElpiKeyword">^</span> {std.any->string <span class=" -ElpiVariable">N</span>}, + coq.env.begin-module <span class=" -ElpiVariable">M</span> none<span class="k k-ElpiKeyword">,</span> + coq.env.end-module <span class=" -ElpiVariable">_</span><span class="k k-ElpiKeyword">,</span> + coq.elpi.accumulate <span class=" -ElpiVariable">_</span> <span class="s2">"counter.db"</span> (clause <span class=" -ElpiVariable">_</span> <span class=" -ElpiVariable">_</span> tick). +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> + main <span class="k k-ElpiKeyword">[]</span> <span class="k k-ElpiKeyword">:-</span> replay-missing. + <span class="k k-ElpiKeyword">pred</span> <span class=" -ElpiFunction">replay-missing</span>. + replay-missing <span class="k k-ElpiKeyword">:-</span> + coq.replay-synterp-action {coq.next-synterp-action}, + replay-missing. + replay-missing. +<span class="si">}}</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Typecheck</span>.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> mk_next_module.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> mk_next_module.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> mk_next_module.</span><span class="alectryon-wsp"> +</span></span><span class="alectryon-wsp"> +</span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-command-v-chk22" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-command-v-chk22"><span class="kn">Print Module</span> NextModule2.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Module</span> <span class="nf">NextModule2</span> := Struct <span class="kn">End</span> +</blockquote></div></div></small></span></pre><p>This is really the end, unless you want to learn more about writing <a class="reference external" href="https://lpcic.github.io/coq-elpi/tutorial_coq_elpi_tactic.html">tactics</a> in Elpi, in that case look at that tutorial ;-)</p> </div> </div> </div> -</div> </div></body> </html> diff --git a/tutorial_coq_elpi_tactic.html b/tutorial_coq_elpi_tactic.html index e770b4466..9cccc3536 100644 --- a/tutorial_coq_elpi_tactic.html +++ b/tutorial_coq_elpi_tactic.html @@ -193,9 +193,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Defining tactics</a></h1> <p>The first one <code class="highlight coq"><span class="n">Elpi</span> <span class="n">Tactic</span> <span class="n">show</span><span class="o">.</span></code> sets the current program to <code class="highlight coq"><span class="n">show</span></code>. Since it is declared as a <code class="highlight coq"><span class="n">Tactic</span></code> some code is loaded automatically:</p> <ul class="simple"> -<li>APIs (eg <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L517">coq.say</a>) and data types (eg Coq <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L80">term</a> s) are loaded from +<li>APIs (eg <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L529">coq.say</a>) and data types (eg Coq <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L178">term</a> s) are loaded from <a class="reference external" href="https://github.com/LPCIC/coq-elpi/blob/master/coq-builtin.elpi">coq-builtin.elpi</a></li> -<li>some utilities, like <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a> or <a class="libred ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-reduction.elpi#L15">whd1</a> are loaded from +<li>some utilities, like <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a> or <a class="libred ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-reduction.elpi#L15">whd1</a> are loaded from <a class="reference external" href="https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-tactic-template.elpi">elpi-command-template.elpi</a></li> </ul> <p>The second one <code class="highlight coq"><span class="n">Elpi</span> <span class="n">Accumulate</span> <span class="o">...</span></code> loads some extra code. @@ -214,8 +214,8 @@ <h1><a class="toc-backref" href="#toc-entry-1">Defining tactics</a></h1> code does not contain the most frequent kind of mistakes. This command considers some mistakes minor and only warns about them. You can pass <code class="highlight coq"><span class="o">-</span><span class="n">w</span> <span class="o">+</span><span class="n">elpi</span><span class="o">.</span><span class="n">typecheck</span></code> to <code class="highlight coq"><span class="n">coqc</span></code> to turn these warnings into errors.</p> -<p>The entry point for tactics is called <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L46">solve</a> which maps a <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L259">goal</a> -into a list of <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L260">sealed-goal</a> (representing subgoals).</p> +<p>The entry point for tactics is called <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L165">solve</a> which maps a <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L357">goal</a> +into a list of <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L358">sealed-goal</a> (representing subgoals).</p> <p>Tactics written in Elpi can be invoked by prefixing its name with <code class="highlight coq"><span class="n">elpi</span></code>.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-tactic-v-chk1" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-tactic-v-chk1"><span class="kn">Lemma</span> <span class="nf">tutorial</span> <span class="nv">x</span> <span class="nv">y</span> : x + <span class="mi">1</span> = y.</label><small class="alectryon-output"><div><div class="alectryon-goals"><blockquote class="alectryon-goal"><div class="goal-hyps"><span><var>x, y</var><span class="hyp-type"><b>: </b><span>nat</span></span></span><br></div><span class="goal-separator"><hr></span><div class="goal-conclusion">x + <span class="mi">1</span> = y</div></blockquote></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-tactic-v-chk2" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-tactic-v-chk2"><span class="nb">elpi</span> show.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Goal</span>: @@ -251,7 +251,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Defining tactics</a></h1> <p>The <code class="e elpi"><span class="n-ElpiVariable">_Trigger</span></code> component, which we did not print, is a variable that, when assigned, trigger the elaboration of its value against the type of the goal and obtains a value for <code class="e elpi"><span class="n-ElpiVariable">Proof</span></code> this way.</p> -<p>Keeping in mind that the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L46">solve</a> predicate relates one goal to a list of +<p>Keeping in mind that the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L165">solve</a> predicate relates one goal to a list of subgoals, we implement our first tactic which blindly tries to solve the goal.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> blind.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -277,12 +277,12 @@ <h2><a class="toc-backref" href="#toc-entry-2">Integration with Ltac</a></h2> <p>For a simple tactic like <code class="highlight coq"><span class="n">blind</span></code> the list of subgoals is easy to write, since it is empty, but in general one should collect all the holes in the value of <code class="e elpi"><span class="n-ElpiVariable">Proof</span></code> (the checked proof term) and build goals out of them.</p> -<p>There is a family of APIs named after <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a>, the mother of all +<p>There is a family of APIs named after <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a>, the mother of all tactics, in <a class="reference external" href="https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-ltac.elpi">elpi-ltac.elpi</a> which does this job for you.</p> <p>Usually a tactic builds a (possibly partial) term and calls -<a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a> on it.</p> +<a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a> on it.</p> <p>Let's rewrite the <code class="highlight coq"><span class="n">blind</span></code> tactic using this schema.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> blind2.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -347,7 +347,7 @@ <h2><a class="toc-backref" href="#toc-entry-2">Integration with Ltac</a></h2> its type <code class="highlight coq"><span class="n">nat</span></code> is not of sort <code class="highlight coq"><span class="kt">Prop</span></code>, so it backtracks and picks <code class="highlight coq"><span class="o">{{</span><span class="n">I</span><span class="o">}}</span></code>.</p> <p>Another common way to build an Elpi tactic is to synthesize a term and then call some Ltac piece of code finishing the work.</p> -<p>The API <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L41">coq.ltac.call</a> invokes some Ltac piece +<p>The API <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L41">coq.ltac.call</a> invokes some Ltac piece of code passing to it the desired arguments. Then it builds the list of subgoals.</p> <p>Here we pass an integer, which in turn is passed to <code class="highlight coq"><span class="kp">fail</span></code>, and a term, @@ -395,13 +395,13 @@ <h1><a class="toc-backref" href="#toc-entry-3">Arguments and Tactic Notation</a> <p class="first admonition-title">Important</p> <p>terms are received in raw format, eg before elaboration</p> <p class="last">Indeed the type argument to <code class="highlight coq"><span class="n">eq</span></code> is a variable. -One can use APIs like <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1407">coq.elaborate-skeleton</a> to infer holes like +One can use APIs like <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1413">coq.elaborate-skeleton</a> to infer holes like <code class="e elpi"><span class="n-ElpiVariable">X0</span></code>.</p> </div> -<p>See the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L50">argument</a> data type +<p>See the <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L46">argument</a> data type for a detailed decription of all the arguments a tactic can receive.</p> -<p>Now let's write a tactic which behaves pretty much like the <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a> -one from Coq, but prints what it does using the API <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1667">coq.term->string</a>.</p> +<p>Now let's write a tactic which behaves pretty much like the <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a> +one from Coq, but prints what it does using the API <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1673">coq.term->string</a>.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> <span class="nb">refine</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> solve (goal <span class=" -ElpiVariable">_</span> <span class=" -ElpiVariable">_</span> <span class=" -ElpiVariable">Ty</span> <span class=" -ElpiVariable">_</span> <span class="k k-ElpiKeyword">[</span>trm <span class=" -ElpiVariable">S</span><span class="k k-ElpiKeyword">]</span> <span class="k k-ElpiKeyword">as</span> <span class=" -ElpiVariable">G</span>) <span class=" -ElpiVariable">GL</span> <span class="k k-ElpiKeyword">:-</span> @@ -463,14 +463,14 @@ <h2><a class="toc-backref" href="#toc-entry-4">Ltac arguments to Elpi arguments< </div> <div class="section" id="failure"> <h1><a class="toc-backref" href="#toc-entry-5">Failure</a></h1> -<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L529">coq.error</a> aborts the execution of both +<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L541">coq.error</a> aborts the execution of both Elpi and any enclosing LTac context. This failure cannot be catched by LTac.</p> -<p>On the contrary the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1545">coq.ltac.fail</a> builtin can be used to +<p>On the contrary the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1551">coq.ltac.fail</a> builtin can be used to abort the execution of Elpi code in such a way that LTac can catch it. This API takes an integer akin to LTac's fail depth together with the error message to be displayed to the user.</p> -<p>Library functions of the <code class="highlight coq"><span class="nb">assert</span><span class="o">!</span></code> family call, by default, <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L529">coq.error</a>. +<p>Library functions of the <code class="highlight coq"><span class="nb">assert</span><span class="o">!</span></code> family call, by default, <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L541">coq.error</a>. The flag <code class="highlight coq"><span class="o">@</span><span class="n">ltacfail</span><span class="o">!</span> <span class="n">N</span></code> can be set to alter this behavior and turn erros into calls to <code class="highlight coq"><span class="n">coq</span><span class="o">.</span><span class="kp">ltac</span><span class="o">.</span><span class="kp">fail</span> <span class="n">N</span></code>.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> abort.</span><span class="alectryon-wsp"> @@ -499,7 +499,7 @@ <h1><a class="toc-backref" href="#toc-entry-6">Examples</a></h1> <h2><a class="toc-backref" href="#toc-entry-7">Let's code <code class="highlight coq"><span class="bp">assumption</span></code> in Elpi</a></h2> <p><code class="highlight coq"><span class="bp">assumption</span></code> is a very simple tactic: we look up in the proof context for an hypothesis which unifies with the goal. -Recall that <code class="highlight coq"><span class="n">Ctx</span></code> is made of <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L166">decl</a> and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L167">def</a> +Recall that <code class="highlight coq"><span class="n">Ctx</span></code> is made of <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L264">decl</a> and <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L265">def</a> (here, for simplicity, we ignore the latter case).</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> <span class="bp">assumption</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -521,9 +521,9 @@ <h2><a class="toc-backref" href="#toc-entry-7">Let's code <code class="highlight goal the assumption has type <code class="highlight coq"><span class="n">Q</span></code> but the goal has type <code class="highlight coq"><span class="n">id</span> <span class="n">Q</span></code> which is convertible (unifiable, for Coq's unification) to <code class="highlight coq"><span class="n">Q</span></code>.</p> <p>Let's improve our tactic looking for an assumption which is unifiable with -the goal, an not just alpha convertible. The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1403">coq.unify-leq</a> +the goal, an not just alpha convertible. The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1409">coq.unify-leq</a> calls Coq's unification for types (on which cumulativity applies, hence the -<code class="highlight coq"><span class="o">-</span><span class="n">leq</span></code> suffix). The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L607">std.mem</a> utility, thanks to backtracking, +<code class="highlight coq"><span class="o">-</span><span class="n">leq</span></code> suffix). The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L603">std.mem</a> utility, thanks to backtracking, eventually finds an hypothesis that satisfies the following predicate (ie unifies with the goal).</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> assumption2.</span><span class="alectryon-wsp"> @@ -541,7 +541,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Let's code <code class="highlight </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Proof</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-tactic-v-chk29" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-tactic-v-chk29"><span class="nb">split</span>.</label><small class="alectryon-output"><div><div class="alectryon-goals"><blockquote class="alectryon-goal"><div class="goal-hyps"><span><var>P, Q</var><span class="hyp-type"><b>: </b><span><span class="kt">Prop</span></span></span></span><br><span><var>p</var><span class="hyp-type"><b>: </b><span>P</span></span></span><br><span><var>q</var><span class="hyp-type"><b>: </b><span>Q</span></span></span><br></div><span class="goal-separator"><hr></span><div class="goal-conclusion">P</div></blockquote><div class="alectryon-extra-goals"><input class="alectryon-extra-goal-toggle" id="tutorial-coq-elpi-tactic-v-chk2a" style="display: none" type="checkbox"><blockquote class="alectryon-goal"><div class="goal-hyps"><span><var>P, Q</var><span class="hyp-type"><b>: </b><span><span class="kt">Prop</span></span></span></span><br><span><var>p</var><span class="hyp-type"><b>: </b><span>P</span></span></span><br><span><var>q</var><span class="hyp-type"><b>: </b><span>Q</span></span></span><br></div><label class="goal-separator" for="tutorial-coq-elpi-tactic-v-chk2a"><hr></label><div class="goal-conclusion">id Q</div></blockquote></div></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kp">all</span>: <span class="nb">elpi</span> assumption2.</span><span class="alectryon-wsp"> -</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Qed</span>.</span></span></pre><p><a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a> does unify the type of goal with the type of the term, +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Qed</span>.</span></span></pre><p><a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a> does unify the type of goal with the type of the term, hence we can simplify the code further. We obtain a tactic very similar to our initial <code class="highlight coq"><span class="n">blind</span></code> tactic, which picks candidates from the context rather than from the program itself.</p> @@ -564,7 +564,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Let's code <code class="highlight <h2><a class="toc-backref" href="#toc-entry-8">Let's code <code class="highlight coq"><span class="nb">set</span></code> in Elpi</a></h2> <p>The <code class="highlight coq"><span class="nb">set</span></code> tactic takes a term, possibly with holes, and makes a let-in out of it.</p> -<p>It gives us the occasion to explain the <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a> utility.</p> +<p>It gives us the occasion to explain the <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a> utility.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> find.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -584,7 +584,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Let's code <code class="highlight </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-tactic-v-chk31" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-tactic-v-chk31"><span class="nb">elpi</span> find (P /\ _).</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">found P /\ P</blockquote></div><div class="alectryon-goals"><blockquote class="alectryon-goal"><div class="goal-hyps"><span><var>P, Q</var><span class="hyp-type"><b>: </b><span><span class="kt">Prop</span></span></span></span><br></div><span class="goal-separator"><hr></span><div class="goal-conclusion">P /\ P \/ P /\ Q</div></blockquote></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Abort</span>.</span></span></pre><p>This first approximation only prints the term it found, or better the first intance of the given term.</p> -<p>Now lets focus on <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/coq-lib.elpi#L105">copy</a>. An excerpt:</p> +<p>Now lets focus on <a class="lib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/coq-lib.elpi#L94">copy</a>. An excerpt:</p> <pre class="code elpi literal-block"> copy <span class="n-ElpiVariable">X</span> <span class="n-ElpiVariable">X</span> <span class="k-ElpiKeyword">:-</span> name <span class="n-ElpiVariable">X</span><span class="o">.</span> <span class="c">% checks X is a bound variable </span>copy (global <span class="n-ElpiVariable">_</span> <span class="k-ElpiKeyword">as</span> <span class="n-ElpiVariable">C</span><span class="o">)</span> <span class="n-ElpiVariable">C</span><span class="o">.</span> @@ -602,7 +602,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Let's code <code class="highlight <pre class="code elpi literal-block"> copy (app <span class="k-ElpiKeyword">[</span>global <span class="o">(</span>indt <span class="err">«</span>andn<span class="err">»</span><span class="o">)</span><span class="k-ElpiKeyword">,</span> sort prop<span class="k-ElpiKeyword">,</span> sort prop<span class="k-ElpiKeyword">,</span> c0<span class="k-ElpiKeyword">,</span> <span class="n-ElpiVariable">X0</span> c0 c1<span class="k-ElpiKeyword">]</span><span class="o">)</span> c2 </pre> -<p>and that rule masks the one for <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L94">app</a> when the +<p>and that rule masks the one for <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L192">app</a> when the sub-term being copied matches <code class="highlight coq"><span class="o">(</span><span class="n">P</span> <span class="o">/\</span> <span class="n">_</span><span class="o">)</span></code>. The first time this rule is used <code class="e elpi"><span class="n-ElpiVariable">X0</span></code> is assigned, making the rule represent the term <code class="highlight coq"><span class="o">(</span><span class="n">P</span> <span class="o">/\</span> <span class="n">P</span><span class="o">)</span></code>.</p> <p>Now let's refine the tactic to build a let-in, and complain if the @@ -719,9 +719,9 @@ <h2><a class="toc-backref" href="#toc-entry-8">Let's code <code class="highlight This means that when an Elpi tactic assigns a value to <code class="e elpi"><span class="n-ElpiVariable">X1</span></code> some procedure to turn that value into <code class="e elpi"><span class="n-ElpiVariable">X0</span></code> is triggered. That procedure is called elaboration and it is currently implemented by calling the -<a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1407">coq.elaborate-skeleton</a> API.</p> +<a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1413">coq.elaborate-skeleton</a> API.</p> <p>Given this set up, it is impossible to use a term of the wrong type as a -Proof. Let's rewrite the <code class="highlight coq"><span class="nb">split</span></code> tactic without using <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a>.</p> +Proof. Let's rewrite the <code class="highlight coq"><span class="nb">split</span></code> tactic without using <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a>.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> split_ll.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> solve (goal <span class=" -ElpiVariable">Ctx</span> <span class=" -ElpiVariable">Trigger</span> <span class="si">{{</span> <span class="si">lp:</span><span class=" -ElpiVariable">A</span> /\ <span class="si">lp:</span><span class=" -ElpiVariable">B</span> <span class="si">}}</span> <span class=" -ElpiVariable">Proof</span> <span class="k k-ElpiKeyword">[]</span>) <span class=" -ElpiVariable">GL</span> <span class="k k-ElpiKeyword">:-</span> <span class="k k-ElpiKeyword">!,</span> @@ -743,7 +743,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Let's code <code class="highlight </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Qed</span>.</span></span></pre><p>Crafting by hand the list of subgoal is not easy. In particular here we did not set up the new trigger for <code class="e elpi"><span class="n-ElpiVariable">Pa</span></code> and <code class="e elpi"><span class="n-ElpiVariable">Pb</span></code>, nor seal the goals appropriately (we did not bind proof variables).</p> -<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L1550">coq.ltac.collect-goals</a> API helps us doing this.</p> +<p>The <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L1556">coq.ltac.collect-goals</a> API helps us doing this.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> split_ll_bis.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> solve (goal <span class=" -ElpiVariable">Ctx</span> <span class=" -ElpiVariable">Trigger</span> <span class="si">{{</span> <span class="si">lp:</span><span class=" -ElpiVariable">A</span> /\ <span class="si">lp:</span><span class=" -ElpiVariable">B</span> <span class="si">}}</span> <span class=" -ElpiVariable">Proof</span> <span class="k k-ElpiKeyword">[]</span>) <span class=" -ElpiVariable">GL</span> <span class="k k-ElpiKeyword">:-</span> <span class="k k-ElpiKeyword">!,</span> @@ -764,14 +764,14 @@ <h2><a class="toc-backref" href="#toc-entry-8">Let's code <code class="highlight </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-tactic-v-chk3e" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-tactic-v-chk3e"><span class="nb">eexists</span>.</label><small class="alectryon-output"><div><div class="alectryon-goals"><blockquote class="alectryon-goal"><span class="goal-separator"><hr></span><div class="goal-conclusion"><span class="kt">True</span> /\ <span class="kt">True</span> /\ <span class="nl">?t</span></div></blockquote></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-coq-elpi-tactic-v-chk3f" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-coq-elpi-tactic-v-chk3f"><span class="kp">repeat</span> <span class="nb">elpi</span> split_ll_bis.</label><small class="alectryon-output"><div><div class="alectryon-goals"><blockquote class="alectryon-goal"><span class="goal-separator"><hr></span><div class="goal-conclusion"><span class="kt">True</span></div></blockquote><div class="alectryon-extra-goals"><blockquote class="alectryon-goal"><span class="goal-separator"><hr></span><div class="goal-conclusion"><span class="kt">True</span></div></blockquote><blockquote class="alectryon-goal"><span class="goal-separator"><hr></span><div class="goal-conclusion"><span class="nl">?elpi_evar</span></div></blockquote></div></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kp">all</span>: <span class="nb">elpi</span> blind.</span><span class="alectryon-wsp"> -</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Qed</span>.</span></span></pre><p>At the light of that, <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a> is simply:</p> +</span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Qed</span>.</span></span></pre><p>At the light of that, <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a> is simply:</p> <pre class="code elpi literal-block"> refine <span class="n-ElpiVariable">T</span> (goal <span class="n-ElpiVariable">_</span> <span class="n-ElpiVariable">RawEv</span> <span class="n-ElpiVariable">_</span> <span class="n-ElpiVariable">Ev</span> <span class="n-ElpiVariable">_</span><span class="o">)</span> <span class="n-ElpiVariable">GS</span> <span class="k-ElpiKeyword">:-</span> <span class="n-ElpiVariable">RawEv</span> <span class="k-ElpiKeyword">=</span> <span class="n-ElpiVariable">T</span><span class="k-ElpiKeyword">,</span> coq.ltac.collect-goals <span class="n-ElpiVariable">Ev</span> <span class="n-ElpiVariable">GS</span> <span class="n-ElpiVariable">_</span><span class="o">.</span> </pre> -<p>Now that we know the low level plumbing, we can use <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L8">refine</a> ;-)</p> +<p>Now that we know the low level plumbing, we can use <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L8">refine</a> ;-)</p> <p>The only detail we still have to explain is what exactly a -<a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L260">sealed-goal</a> is. A sealed goal wraps into a single object all +<a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L358">sealed-goal</a> is. A sealed goal wraps into a single object all the proof variables and the assumptions about them, making this object easy (or better, sound) to pass around.</p> <div class="section" id="multi-goal-tactics"> @@ -783,9 +783,9 @@ <h2><a class="toc-backref" href="#toc-entry-10">multi-goal tactics</a></h2> <li>if the tactic is a multi-goal one, it will receive all goals</li> </ul> <p>In Elpi you can implement a multi-goal tactic by providing a rule for -the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L47">msolve</a> predicate. Since such a tactic will need to manipulate +the <a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L166">msolve</a> predicate. Since such a tactic will need to manipulate multiple goals, potentially living in different proof context, it receives -a list of <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L260">sealed-goal</a>, a data type which seals a goal and +a list of <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L358">sealed-goal</a>, a data type which seals a goal and its proof context.</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Tactic</span> ngoals.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Accumulate</span> <span class="si">lp:{{</span> @@ -821,9 +821,9 @@ <h2><a class="toc-backref" href="#toc-entry-10">multi-goal tactics</a></h2> nabla c1 \ seal (goal <span class="k k-ElpiKeyword">[</span>decl c1 `Q` (sort prop)<span class="k k-ElpiKeyword">,</span> decl c0 `P` (sort prop)<span class="k k-ElpiKeyword">]</span> (<span class=" -ElpiVariable">X2</span> c0 c1) c1 - (<span class=" -ElpiVariable">X3</span> c0 c1) <span class="k k-ElpiKeyword">[]</span>)<span class="k k-ElpiKeyword">]</span></pre><p><a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L261">nabla</a> binds all proof variables, then <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L262">seal</a> + (<span class=" -ElpiVariable">X3</span> c0 c1) <span class="k k-ElpiKeyword">[]</span>)<span class="k k-ElpiKeyword">]</span></pre><p><a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L359">nabla</a> binds all proof variables, then <a class="constructor ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L360">seal</a> holds a regular goal, which in turn carries the proof context.</p> -<p>In order to operate inside a goal one can use the <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L80">coq.ltac.open</a> utility, +<p>In order to operate inside a goal one can use the <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L80">coq.ltac.open</a> utility, which postulates all proof variables using <code class="e elpi"><span class="k-ElpiKeyword">pi</span> <span class="n-ElpiVariable">x</span>\ </code> and loads the proof context using <code class="e elpi"><span class="k-ElpiKeyword">=></span></code>.</p> <p>Operating on multiple goals at the same time is doable, but not easy. @@ -896,7 +896,7 @@ <h2><a class="toc-backref" href="#toc-entry-11">LCF tacticals</a></h2> </pre> <p>A few tacticals can be fond in the <a class="reference external" href="https://github.com/LPCIC/coq-elpi/blob/master/elpi/elpi-ltac.elpi">elpi-ltac.elpi file</a>. -For example this is the code of <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L55">try</a>:</p> +For example this is the code of <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L55">try</a>:</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">pred</span> <span class="n-ElpiFunction">try</span> <span class="k-ElpiMode">i:</span><span class="kt">tactic</span>, <span class="k-ElpiMode">i:</span><span class="kt">sealed-goal</span>, <span class="k-ElpiMode">o:</span><span class="kt">list</span> <span class="kt">sealed-goal</span>. try <span class="n-ElpiVariable">T</span> <span class="n-ElpiVariable">G</span> <span class="n-ElpiVariable">GS</span> <span class="k-ElpiKeyword">:-</span> <span class="n-ElpiVariable">T</span> <span class="n-ElpiVariable">G</span> <span class="n-ElpiVariable">GS</span><span class="o">.</span> @@ -949,9 +949,9 @@ <h2><a class="toc-backref" href="#toc-entry-12">Setting arguments for a tactic</ <pre class="code elpi literal-block"> thenl <span class="k-ElpiKeyword">[</span> open (tac1 <span class="n-ElpiVariable">Datum</span><span class="o">)</span><span class="k-ElpiKeyword">,</span> open (tac2 <span class="n-ElpiVariable">Datum</span><span class="o">)</span> <span class="k-ElpiKeyword">]</span> </pre> -<p>but the binder structure of <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L260">sealed-goal</a> would prevent <code class="e elpi"><span class="n-ElpiVariable">Datum</span></code> +<p>but the binder structure of <a class="type ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L358">sealed-goal</a> would prevent <code class="e elpi"><span class="n-ElpiVariable">Datum</span></code> to mention proof variables, that would otherwise escape the sealing.</p> -<p>The utility <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi/elpi-ltac.elpi#L46">set-goal-arguments</a>:</p> +<p>The utility <a class="libtac ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi/elpi-ltac.elpi#L46">set-goal-arguments</a>:</p> <pre class="code elpi literal-block"> coq.ltac.set-goal-arguments <span class="n-ElpiVariable">Args</span> <span class="n-ElpiVariable">G</span> <span class="n-ElpiVariable">G1</span> <span class="n-ElpiVariable">G1wArgs</span> </pre> diff --git a/tutorial_elpi_lang.html b/tutorial_elpi_lang.html index 5385008a9..eaccf50ec 100644 --- a/tutorial_elpi_lang.html +++ b/tutorial_elpi_lang.html @@ -218,8 +218,8 @@ <h1><a class="toc-backref" href="#toc-entry-1">Logic programming</a></h1> is a mode declaration, which we will explain later (ignore it for now).</p> <div class="admonition note"> <p class="first admonition-title">Note</p> -<p><a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L17">int</a> is the built-in data type of integers</p> -<p class="last">Integers come with usual arithmetic operators, see the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L71">calc</a> built-in.</p> +<p><a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L17">int</a> is the built-in data type of integers</p> +<p class="last">Integers come with usual arithmetic operators, see the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L75">calc</a> built-in.</p> </div> <p>In order to run our program we have to write a query, i.e. a predicate expression containing variables such as:</p> @@ -247,14 +247,14 @@ <h1><a class="toc-backref" href="#toc-entry-1">Logic programming</a></h1> age alice <span class=" -ElpiVariable">A</span><span class="k k-ElpiKeyword">,</span> coq.say <span class="s2">"The age of alice is"</span> <span class=" -ElpiVariable">A</span> -<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">The age of alice <span class="kr">is</span> <span class="mi">20</span></blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">A = <span class="mi">20</span></blockquote></div></div></small></span></pre><p><a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/coq-builtin.elpi#L517">coq.say</a> is a built-in predicate provided by Coq-Elpi which +<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">The age of alice <span class="kr">is</span> <span class="mi">20</span></blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">A = <span class="mi">20</span></blockquote></div></div></small></span></pre><p><a class="builtin ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/coq-builtin.elpi#L529">coq.say</a> is a built-in predicate provided by Coq-Elpi which prints its arguments. You can look at the output buffer of Coq to see the value for <code class="e elpi"><span class="n-ElpiVariable">A</span></code> or hover or toggle the little bubble after <code class="highlight coq"><span class="o">}}.</span></code> if you are reading the tutorial with a web browser.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> -<p><a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L20">string</a> is a built-in data type</p> +<p><a class="stdtype ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L20">string</a> is a built-in data type</p> <p class="last">Strings are delimited by double quotes and <tt class="docutils literal">\</tt> is the escape symbol.</p> </div> <p>The predicate <code class="e elpi">age</code> represents a <em>relation</em> (in contrast to a function) @@ -872,8 +872,8 @@ <h2><a class="toc-backref" href="#toc-entry-10">Constraint Handling Rules</a></h <div class="section" id="spilling-relation-composition"> <h2><a class="toc-backref" href="#toc-entry-12">Spilling (relation composition)</a></h2> <p>Chaining "relations" can be painful, especially when -they look like functions. Here we use <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L503">std.append</a> -and <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L493">std.rev</a> to build a palindrome:</p> +they look like functions. Here we use <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L499">std.append</a> +and <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L489">std.rev</a> to build a palindrome:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Program</span> function <span class="si">lp:{{</span> <span class="k k-ElpiKeyword">pred</span> <span class=" -ElpiFunction">make-palindrome</span> <span class="k k-ElpiMode">i:</span><span class="kt">list</span> <span class="kt">A</span>, <span class="k k-ElpiMode">o:</span><span class="kt">list</span> <span class="kt">A</span>. @@ -926,20 +926,20 @@ <h2><a class="toc-backref" href="#toc-entry-12">Spilling (relation composition)< <div class="section" id="apis-for-built-in-data"> <h2><a class="toc-backref" href="#toc-entry-13">APIs for built-in data</a></h2> <p>Functions about built-in data types are available via the -<a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L71">calc</a> predicate or its infix version <code class="e elpi"><span class="k-ElpiKeyword">is</span></code>. Example:</p> +<a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L75">calc</a> predicate or its infix version <code class="e elpi"><span class="k-ElpiKeyword">is</span></code>. Example:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-elpi-lang-v-chk19" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-elpi-lang-v-chk19"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> calc ( <span class="s2">"result "</span> <span class="k k-ElpiKeyword">^</span> <span class="s2">"="</span> ) <span class=" -ElpiVariable">X</span><span class="k k-ElpiKeyword">,</span> <span class=" -ElpiVariable">Y</span> <span class="k k-ElpiKeyword">is</span> <span class="m m-ElpiInteger">3</span> <span class="k k-ElpiKeyword">+</span> <span class="m m-ElpiInteger">2</span><span class="k k-ElpiKeyword">,</span> coq.say <span class=" -ElpiVariable">X</span> <span class=" -ElpiVariable">Y</span> -<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">result = <span class="mi">5</span></blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">X = result =</blockquote><blockquote class="alectryon-message">Y = <span class="mi">5</span></blockquote></div></div></small></span></pre><p>The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L71">calc</a> predicate works nicely with spilling:</p> +<span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">result = <span class="mi">5</span></blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">X = result =</blockquote><blockquote class="alectryon-message">Y = <span class="mi">5</span></blockquote></div></div></small></span></pre><p>The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L75">calc</a> predicate works nicely with spilling:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-elpi-lang-v-chk1a" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-elpi-lang-v-chk1a"><span class="kn">Elpi</span> <span class="kn">Query</span> <span class="si">lp:{{</span> coq.say <span class="s2">"result ="</span> {calc (<span class="m m-ElpiInteger">2</span> <span class="k k-ElpiKeyword">+</span> <span class="m m-ElpiInteger">3</span>)} <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">result = <span class="mi">5</span></blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Spilled_1 = <span class="mi">5</span></blockquote></div></div></small></span></pre></div> <div class="section" id="allocation-of-variables"> <h2><a class="toc-backref" href="#toc-entry-14">Allocation of variables</a></h2> <p>The language let's one use λ-abstraction also to write anonymous rules but one has to be wary of where variables are bound (allocated really).</p> -<p>In our example we use the higher order predicate <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L550">std.map</a>:</p> +<p>In our example we use the higher order predicate <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L546">std.map</a>:</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">pred</span> <span class="n-ElpiFunction">std.map</span> <span class="k-ElpiMode">i:</span><span class="kt">list</span> <span class="kt">A</span>, <span class="k-ElpiMode">i:</span><span class="kt">(A</span> <span class="err">-</span><span class="kt">></span> <span class="kt">B</span> <span class="err">-</span><span class="kt">></span> <span class="kt">prop)</span>, <span class="k-ElpiMode">o:</span><span class="kt">list</span> <span class="kt">B</span>. </pre> @@ -983,7 +983,7 @@ <h2><a class="toc-backref" href="#toc-entry-14">Allocation of variables</a></h2> good2 <span class="k k-ElpiKeyword">[</span><span class="m m-ElpiInteger">1</span><span class="k k-ElpiKeyword">,</span><span class="m m-ElpiInteger">2</span><span class="k k-ElpiKeyword">,</span><span class="m m-ElpiInteger">3</span><span class="k k-ElpiKeyword">]</span> <span class=" -ElpiVariable">R3</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">R1 = X0</blockquote><blockquote class="alectryon-message">R2 = [<span class="mi">2</span>, <span class="mi">3</span>, <span class="mi">4</span>]</blockquote><blockquote class="alectryon-message">R3 = [<span class="mi">2</span>, <span class="mi">3</span>, <span class="mi">4</span>]</blockquote></div></div></small></span></pre><p>The problem with <code class="e elpi">bad</code> is that <code class="e elpi"><span class="n-ElpiVariable">TMP</span></code> is fresh each time the rule -is used, but not every time the anonymous rule passed to <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L550">map</a> +is used, but not every time the anonymous rule passed to <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L546">map</a> is used. Technically <code class="e elpi"><span class="n-ElpiVariable">TMP</span></code> is quantified (allocated) where <code class="e elpi"><span class="n-ElpiVariable">L</span></code> and <code class="e elpi"><span class="n-ElpiVariable">Result</span></code> are.</p> <p>There are two ways to quantify <code class="e elpi"><span class="n-ElpiVariable">TMP</span></code> correctly, that is inside the @@ -1143,90 +1143,90 @@ <h2><a class="toc-backref" href="#toc-entry-16">Trace browser</a></h2> of (<span class="k k-ElpiKeyword">fun</span> (<span class=" -ElpiVariable">x\</span> <span class="k k-ElpiKeyword">fun</span> <span class=" -ElpiVariable">y\</span> x)) <span class=" -ElpiVariable">Ty</span><span class="k k-ElpiKeyword">,</span> coq.say <span class=" -ElpiVariable">Ty</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">run <span class="mi">1</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">5</span> user:curgoal = , +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">6</span> user:curgoal = , of (<span class="kr">fun</span> <span class="nv">c0</span> \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0) X0 , coq.say X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">5</span> user:rule = <span class="kn">and</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">5</span> user:subgoal = <span class="mi">6</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">6</span> user:newgoal = of (<span class="kr">fun</span> <span class="nv">c0</span> \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0) X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">5</span> user:subgoal = <span class="mi">7</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">7</span> user:newgoal = coq.say X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">5</span> user:rule:<span class="kn">and</span> = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">6</span> user:rule = <span class="kn">and</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">6</span> user:subgoal = <span class="mi">7</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">7</span> user:newgoal = of (<span class="kr">fun</span> <span class="nv">c0</span> \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0) X0 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">6</span> user:subgoal = <span class="mi">8</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">8</span> user:newgoal = coq.say X0 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">1</span> gid:<span class="mi">6</span> user:rule:<span class="kn">and</span> = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">2</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">6</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">7</span> user:curgoal = of of (<span class="kr">fun</span> <span class="nv">c0</span> \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0) X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">6</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">6</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">7</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">7</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">3</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">6</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">7</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: (of (<span class="kr">fun</span> <span class="nv">A0</span>) (arr A1 A2)) :- ( pi (c0 \ (of c0 A1 => of (A0 c0) A2))). </blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">0</span> user:assign = A0 := c0 \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">0</span> user:assign = X0 := arr X1 X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">6</span> user:subgoal = <span class="mi">8</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">8</span> user:newgoal = pi c0 \ of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">8</span> user:rule:backchain = success -</blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">3</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">8</span> user:curgoal = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">7</span> user:subgoal = <span class="mi">9</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">9</span> user:newgoal = pi c0 \ of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">2</span> gid:<span class="mi">9</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">001</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">3</span> {{{ +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">9</span> user:curgoal = pi pi c0 \ of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">8</span> user:rule = pi -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">8</span> user:subgoal = <span class="mi">9</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">9</span> user:newgoal = of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">9</span> user:rule:pi = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">9</span> user:rule = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">9</span> user:subgoal = <span class="mi">10</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">10</span> user:newgoal = of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">3</span> gid:<span class="mi">10</span> user:rule:pi = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">4</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">9</span> user:curgoal = => - of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">9</span> user:rule = implication -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">9</span> user:subgoal = <span class="mi">10</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">10</span> user:newgoal = of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">10</span> user:rule:implication = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">10</span> user:curgoal = => + of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">10</span> user:rule = implication +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">10</span> user:subgoal = <span class="mi">11</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">11</span> user:newgoal = of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">4</span> gid:<span class="mi">11</span> user:rule:implication = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">10</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:curgoal = of of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">10</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">10</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">4</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">10</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: (of (<span class="kr">fun</span> <span class="nv">A0</span>) (arr A1 A2)) :- ( pi (c0 \ (of c0 A1 => of (A0 c0) A2))). </blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = A0 := c1 \ c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = X2 := arr X3 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">10</span> user:subgoal = <span class="mi">11</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:newgoal = pi c1 \ of c1 X3 => of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">11</span> user:subgoal = <span class="mi">12</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">12</span> user:newgoal = pi c1 \ of c1 X3 => of c0 X4 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">5</span> gid:<span class="mi">12</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">6</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">11</span> user:curgoal = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">12</span> user:curgoal = pi pi c1 \ of c1 X3 => of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">11</span> user:rule = pi -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">11</span> user:subgoal = <span class="mi">12</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">12</span> user:newgoal = of c1 X3 => of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">12</span> user:rule:pi = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">12</span> user:rule = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">12</span> user:subgoal = <span class="mi">13</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">13</span> user:newgoal = of c1 X3 => of c0 X4 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">6</span> gid:<span class="mi">13</span> user:rule:pi = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">7</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">12</span> user:curgoal = => +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">13</span> user:curgoal = => of c1 X3 => of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">12</span> user:rule = implication -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">12</span> user:subgoal = <span class="mi">13</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">13</span> user:newgoal = of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">13</span> user:rule:implication = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">13</span> user:rule = implication +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">13</span> user:subgoal = <span class="mi">14</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">14</span> user:newgoal = of c0 X4 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">7</span> gid:<span class="mi">14</span> user:rule:implication = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">8</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">13</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">14</span> user:curgoal = of of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">13</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">13</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">14</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">14</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">13</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">14</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: (of c0 X1) :- . </blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">0</span> user:assign = X1 := X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">13</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">8</span> gid:<span class="mi">14</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">9</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">7</span> user:curgoal = coq.say +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">8</span> user:curgoal = coq.say coq.say (arr X4 (arr X3 X4)) -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">7</span> user:rule = builtin -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">7</span> user:rule:builtin:name = coq.say -</blockquote><blockquote class="alectryon-message">arr X4 (arr X3 X4)</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">7</span> user:rule:builtin = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">8</span> user:rule = builtin +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">8</span> user:rule:builtin:name = coq.say +</blockquote><blockquote class="alectryon-message">arr X4 (arr X3 X4)</blockquote><blockquote class="alectryon-message">rid:<span class="mi">0</span> step:<span class="mi">9</span> gid:<span class="mi">8</span> user:rule:builtin = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Ty = arr X4 (arr X3 X4)</blockquote></div></div></small><span class="alectryon-wsp"> </span></span><span class="alectryon-wsp"> </span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-elpi-lang-v-chk22" style="display: none" type="checkbox"><label class="alectryon-input alectryon-failed" for="tutorial-elpi-lang-v-chk22"><span class="kn">Elpi</span> <span class="kn">Query</span> stlc <span class="si">lp:{{</span> @@ -1234,86 +1234,86 @@ <h2><a class="toc-backref" href="#toc-entry-16">Trace browser</a></h2> of (<span class="k k-ElpiKeyword">fun</span> (<span class=" -ElpiVariable">x\</span> <span class="k k-ElpiKeyword">app</span> x x)) <span class=" -ElpiVariable">Ty</span><span class="k k-ElpiKeyword">,</span> coq.say <span class=" -ElpiVariable">Ty</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">run <span class="mi">1</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">14</span> user:curgoal = , +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">15</span> user:curgoal = , of (<span class="kr">fun</span> <span class="nv">c0</span> \ app c0 c0) X0 , coq.say X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">14</span> user:rule = <span class="kn">and</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">14</span> user:subgoal = <span class="mi">15</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">15</span> user:newgoal = of (<span class="kr">fun</span> <span class="nv">c0</span> \ app c0 c0) X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">14</span> user:subgoal = <span class="mi">16</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">16</span> user:newgoal = coq.say X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">14</span> user:rule:<span class="kn">and</span> = success -</blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">001</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">2</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">15</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">15</span> user:rule = <span class="kn">and</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">15</span> user:subgoal = <span class="mi">16</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">16</span> user:newgoal = of (<span class="kr">fun</span> <span class="nv">c0</span> \ app c0 c0) X0 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">15</span> user:subgoal = <span class="mi">17</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">17</span> user:newgoal = coq.say X0 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">1</span> gid:<span class="mi">15</span> user:rule:<span class="kn">and</span> = success +</blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">2</span> {{{ +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">16</span> user:curgoal = of of (<span class="kr">fun</span> <span class="nv">c0</span> \ app c0 c0) X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">15</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">15</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">16</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">16</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">3</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">15</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">16</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: (of (<span class="kr">fun</span> <span class="nv">A0</span>) (arr A1 A2)) :- ( pi (c0 \ (of c0 A1 => of (A0 c0) A2))). </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">0</span> user:assign = A0 := c0 \ app c0 c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">0</span> user:assign = X0 := arr X1 X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">15</span> user:subgoal = <span class="mi">17</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">17</span> user:newgoal = pi c0 \ of c0 X1 => of (app c0 c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">17</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">16</span> user:subgoal = <span class="mi">18</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">18</span> user:newgoal = pi c0 \ of c0 X1 => of (app c0 c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">2</span> gid:<span class="mi">18</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">3</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">17</span> user:curgoal = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">18</span> user:curgoal = pi pi c0 \ of c0 X1 => of (app c0 c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">17</span> user:rule = pi -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">17</span> user:subgoal = <span class="mi">18</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">18</span> user:newgoal = of c0 X1 => of (app c0 c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">18</span> user:rule:pi = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">18</span> user:rule = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">18</span> user:subgoal = <span class="mi">19</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">19</span> user:newgoal = of c0 X1 => of (app c0 c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">3</span> gid:<span class="mi">19</span> user:rule:pi = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">4</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">18</span> user:curgoal = => +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">19</span> user:curgoal = => of c0 X1 => of (app c0 c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">18</span> user:rule = implication -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">18</span> user:subgoal = <span class="mi">19</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">19</span> user:newgoal = of (app c0 c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">19</span> user:rule:implication = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">19</span> user:rule = implication +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">19</span> user:subgoal = <span class="mi">20</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">20</span> user:newgoal = of (app c0 c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">4</span> gid:<span class="mi">20</span> user:rule:implication = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">19</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:curgoal = of of (app c0 c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">19</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">19</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">10</span>, column <span class="mi">3</span>, character <span class="mi">294</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">10</span>, column <span class="mi">3</span>, character <span class="mi">294</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">4</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">19</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">10</span>, column <span class="mi">3</span>, character <span class="mi">294</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">10</span>, column <span class="mi">3</span>, character <span class="mi">294</span>: (of (app A0 A1) A2) :- ( of A0 (arr A3 A2)), (of A1 A3). </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = A0 := c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = A1 := c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = A2 := X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">19</span> user:subgoal = <span class="mi">20</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:newgoal = of c0 (arr X3^<span class="mi">1</span> X2) </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:subgoal = <span class="mi">21</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">21</span> user:newgoal = of c0 X3^<span class="mi">1</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">20</span> user:rule:backchain = success -</blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">001</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">6</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">20</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">21</span> user:newgoal = of c0 (arr X3^<span class="mi">1</span> X2) +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">21</span> user:subgoal = <span class="mi">22</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">22</span> user:newgoal = of c0 X3^<span class="mi">1</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">5</span> gid:<span class="mi">21</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">6</span> {{{ +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">21</span> user:curgoal = of of c0 (arr X3^<span class="mi">1</span> X2) -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">20</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">20</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">21</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">21</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">20</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">21</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: (of c0 X1) :- . </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">0</span> user:assign:expand = X3^<span class="mi">1</span> := X4 c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">0</span> user:assign:restrict = <span class="mi">0</span> X4 c0 := c0 \ .X5 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">0</span> user:assign = X1 := arr X5 X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">20</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">6</span> gid:<span class="mi">21</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">7</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">21</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">22</span> user:curgoal = of of c0 X5 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">21</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">21</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">22</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">22</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">6</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">21</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">22</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: (of c0 (arr X5 X2)) :- . -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">21</span> user:backchain:<span class="kp">fail</span>-to = <span class="nb">unify</span> X5 <span class="kr">with</span> arr X5 X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">22</span> user:backchain:<span class="kp">fail</span>-to = <span class="nb">unify</span> X5 <span class="kr">with</span> arr X5 X2 </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">7</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">21</span> user:rule:backchain = <span class="kp">fail</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">1</span> step:<span class="mi">7</span> gid:<span class="mi">22</span> user:rule:backchain = <span class="kp">fail</span> </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">The <span class="nb">elpi</span> tactic/command stlc failed without giving a specific error message. Please report this inconvenience to the authors of the program.</blockquote></div></div></small></span></pre><p>The trace can be limited to a range of steps. Look at the @@ -1324,29 +1324,29 @@ <h2><a class="toc-backref" href="#toc-entry-16">Trace browser</a></h2> of (<span class="k k-ElpiKeyword">fun</span> (<span class=" -ElpiVariable">x\</span> <span class="k k-ElpiKeyword">fun</span> <span class=" -ElpiVariable">y\</span> x)) <span class=" -ElpiVariable">Ty</span><span class="k k-ElpiKeyword">,</span> coq.say <span class=" -ElpiVariable">Ty</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">run <span class="mi">6</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">28</span> user:curgoal = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">29</span> user:curgoal = pi pi c1 \ of c1 X0 => of c0 X1 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">28</span> user:rule = pi -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">28</span> user:subgoal = <span class="mi">29</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">29</span> user:newgoal = of c1 X0 => of c0 X1 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">29</span> user:rule:pi = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">29</span> user:rule = pi +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">29</span> user:subgoal = <span class="mi">30</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">30</span> user:newgoal = of c1 X0 => of c0 X1 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">6</span> gid:<span class="mi">30</span> user:rule:pi = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">7</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">29</span> user:curgoal = => +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">30</span> user:curgoal = => of c1 X0 => of c0 X1 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">29</span> user:rule = implication -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">29</span> user:subgoal = <span class="mi">30</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">30</span> user:newgoal = of c0 X1 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">30</span> user:rule:implication = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">30</span> user:rule = implication +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">30</span> user:subgoal = <span class="mi">31</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">31</span> user:newgoal = of c0 X1 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">7</span> gid:<span class="mi">31</span> user:rule:implication = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">8</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">30</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">31</span> user:curgoal = of of c0 X1 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">30</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">30</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">31</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">31</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">30</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">31</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: (of c0 X2) :- . </blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">0</span> user:assign = X2 := X1 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">30</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">2</span> step:<span class="mi">8</span> gid:<span class="mi">31</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">arr X1 (arr X0 X1)</blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Ty = arr X1 (arr X0 X1)</blockquote></div></div></small></span></pre><p>The trace can be limited to a (list of) predicates as follows:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Trace</span> <span class="s2">"of"</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-elpi-lang-v-chk24" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-elpi-lang-v-chk24"><span class="kn">Elpi</span> <span class="kn">Query</span> stlc <span class="si">lp:{{</span> @@ -1354,47 +1354,47 @@ <h2><a class="toc-backref" href="#toc-entry-16">Trace browser</a></h2> of (<span class="k k-ElpiKeyword">fun</span> (<span class=" -ElpiVariable">x\</span> <span class="k k-ElpiKeyword">fun</span> <span class=" -ElpiVariable">y\</span> x)) <span class=" -ElpiVariable">Ty</span><span class="k k-ElpiKeyword">,</span> coq.say <span class=" -ElpiVariable">Ty</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">run <span class="mi">2</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">32</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">33</span> user:curgoal = of of (<span class="kr">fun</span> <span class="nv">c0</span> \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0) X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">32</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">32</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">33</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">33</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">3</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">32</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">33</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: (of (<span class="kr">fun</span> <span class="nv">A0</span>) (arr A1 A2)) :- ( pi (c0 \ (of c0 A1 => of (A0 c0) A2))). </blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">0</span> user:assign = A0 := c0 \ <span class="kr">fun</span> <span class="nv">c1</span> \ c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">0</span> user:assign = X0 := arr X1 X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">32</span> user:subgoal = <span class="mi">34</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">34</span> user:newgoal = pi c0 \ of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">34</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">33</span> user:subgoal = <span class="mi">35</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">35</span> user:newgoal = pi c0 \ of c0 X1 => of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">2</span> gid:<span class="mi">35</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">36</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:curgoal = of of (<span class="kr">fun</span> <span class="nv">c1</span> \ c0) X2 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">36</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">36</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:rule:backchain:candidates = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">4</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">36</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(stdin)"</span>, line <span class="mi">15</span>, column <span class="mi">3</span>, character <span class="mi">459</span>: (of (<span class="kr">fun</span> <span class="nv">A0</span>) (arr A1 A2)) :- ( pi (c0 \ (of c0 A1 => of (A0 c0) A2))). </blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = A0 := c1 \ c0 </blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">0</span> user:assign = X2 := arr X3 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">36</span> user:subgoal = <span class="mi">37</span> -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:newgoal = pi c1 \ of c1 X3 => of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">37</span> user:subgoal = <span class="mi">38</span> +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">38</span> user:newgoal = pi c1 \ of c1 X3 => of c0 X4 +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">5</span> gid:<span class="mi">38</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">run <span class="mi">8</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">39</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">40</span> user:curgoal = of of c0 X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">39</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">39</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">40</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">40</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">39</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">40</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: (of c0 X1) :- . </blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">0</span> user:assign = X1 := X4 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">39</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">3</span> step:<span class="mi">8</span> gid:<span class="mi">40</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">arr X4 (arr X3 X4)</blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Ty = arr X4 (arr X3 X4)</blockquote></div></div></small></span></pre><p>One can combine the range of steps with the predicate:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Trace</span> <span class="mi">6</span> <span class="mi">8</span> <span class="s2">"of"</span>.</span><span class="alectryon-wsp"> </span></span><span class="alectryon-sentence"><input class="alectryon-toggle" id="tutorial-elpi-lang-v-chk25" style="display: none" type="checkbox"><label class="alectryon-input" for="tutorial-elpi-lang-v-chk25"><span class="kn">Elpi</span> <span class="kn">Query</span> stlc <span class="si">lp:{{</span> @@ -1402,15 +1402,15 @@ <h2><a class="toc-backref" href="#toc-entry-16">Trace browser</a></h2> of (<span class="k k-ElpiKeyword">fun</span> (<span class=" -ElpiVariable">x\</span> <span class="k k-ElpiKeyword">fun</span> <span class=" -ElpiVariable">y\</span> x)) <span class=" -ElpiVariable">Ty</span><span class="k k-ElpiKeyword">,</span> coq.say <span class=" -ElpiVariable">Ty</span> <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message">run <span class="mi">8</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">48</span> user:curgoal = of +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">49</span> user:curgoal = of of c0 X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">48</span> user:rule = backchain -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">48</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">49</span> user:rule = backchain +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">49</span> user:rule:backchain:candidates = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">select <span class="mi">5</span> {{{ -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">48</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">49</span> user:rule:backchain:<span class="kp">try</span> = File <span class="s2">"(context step_id:4)"</span>, line <span class="mi">1</span>, column <span class="mi">0</span>, character <span class="mi">0</span>: (of c0 X1) :- . </blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">0</span> user:assign = X1 := X0 -</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">48</span> user:rule:backchain = success +</blockquote><blockquote class="alectryon-message">rid:<span class="mi">4</span> step:<span class="mi">8</span> gid:<span class="mi">49</span> user:rule:backchain = success </blockquote><blockquote class="alectryon-message">}}} -> (<span class="mi">0</span>.<span class="mi">000</span>s)</blockquote><blockquote class="alectryon-message">arr X0 (arr X2 X0)</blockquote><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">Ty = arr X0 (arr X2 X0)</blockquote></div></div></small></span></pre><p>To switch traces off:</p> <pre class="alectryon-io highlight"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="kn">Elpi</span> <span class="kn">Trace</span> Off.</span></span></pre></div> <div class="section" id="good-old-print"> @@ -1470,7 +1470,7 @@ <h3><a class="toc-backref" href="#toc-entry-20">Precedence of <code class="e elp <span class="si">}}</span>.</label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="kn">Query</span> assignments:</blockquote><blockquote class="alectryon-message">A = X0</blockquote><blockquote class="alectryon-message">B = X0</blockquote><blockquote class="alectryon-message">C = X0</blockquote></div></div></small></span></pre></div> <div class="section" id="backtracking-1"> <h3><a class="toc-backref" href="#toc-entry-21">Backtracking</a></h3> -<p>Backtracking can lead to weird execution traces. The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L682">std.do!</a> predicate +<p>Backtracking can lead to weird execution traces. The <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L678">std.do!</a> predicate should be used to write non-backtracking code.</p> <pre class="code elpi literal-block"> <span class="k-ElpiKeyword">pred</span> <span class="n-ElpiFunction">not-a-backtracking-one</span>. @@ -1483,8 +1483,8 @@ <h3><a class="toc-backref" href="#toc-entry-21">Backtracking</a></h3> <p>In the example above once <code class="e elpi">condition</code> holds we start a sequence of steps which we will not reconsider. Locally, backtracking is still available, e.g. between <code class="e elpi">generate</code> and <code class="e elpi">test</code>. -See also the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L694">std.spy-do!</a> predicate which prints each and every step, -and the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/b92e2c85ecb6bb3d0eb0fbd57920d553b153e49c/elpi-builtin.elpi#L467">std.spy</a> one which can be used to spy on a single one.</p> +See also the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L690">std.spy-do!</a> predicate which prints each and every step, +and the <a class="stdlib ghref reference external" href="https://github.com/LPCIC/coq-elpi/blob/e66f2d6235d90a5e9099597c6c2aabf8d5fb8a84/elpi-builtin.elpi#L463">std.spy</a> one which can be used to spy on a single one.</p> </div> <div class="section" id="unification-variables-v-s-imperative-variables"> <h3><a class="toc-backref" href="#toc-entry-22">Unification variables v.s. Imperative variables</a></h3>