tri.avm 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # This module contains some functions for counting with trees according
  3. # to one possible enumeration (the fastest I can think of). There is a
  4. # one to one correspondence between trees and natural numbers, but
  5. # sometimes smallish trees can have extremely large ordinals. I'm not
  6. # convinced dendriform always works (the inverse of the ordinal
  7. # function) but have never found a counterexample.
  8. #
  9. # Copyright (C) 2007 Dennis Furey
  10. #
  11. # dendriform (4540)
  12. # ordinal (676)
  13. # tpred (118)
  14. # tsuc (118)
  15. #
  16. # compressed with granularity 159
  17. #
  18. #
  19. # This program is free software; you can redistribute it and/or modify
  20. # it under the terms of the GNU General Public License as published by
  21. # the Free Software Foundation; version 3.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU General Public License
  29. # along with this program; if not, write to the Free Software Foundation,
  30. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  31. #
  32. {kzoZhxssnsIxeXvoYIExwHnohaxjokHzNcxjhjyJyvtAwOeG{lkksYLU{D{HKOX`yM[[YfHAyGzNyP
  33. fVv_crSss@J[`KkOO^pipvlt[r[u[[L<@yIOQPHcP{L{H==j_=YvSu{O{OppGHoLPeIX@^z=cqyc{B[
  34. xdSdrhkLDiNmyxDy<MtyDB[h<M[nf[qPTXf@^n[yX_QEbq<?Aof[hLp@vQOEhsAQRYYOT\OS<caBUZv
  35. G{recHoDgOIFteOnPj=N<UzZ\FA{moFnefgNe`vsFItI<m[QLeJOhfdQPr<FpmIp`YHk\aqJh{oxT=H
  36. _njBBo^O^Gs^SIPD][?nNQ?P`oHS]X<wIRWadu{INgE=PfeS_gyQDEnyD<SQN]Pd<A_pz?nUENGS>Z\
  37. ]i@WPGpqKJ@>xvCWOHiLqQNxx^pl=HqMONi>>>aDrvhFBfGhzHLNZd^fCnGHb?S@QPn[bI?offToHnH
  38. YasQDE^MX{QQPMDVbQKpa=XI>aSQLvHJPqP{AQMQLxcOiQIOmjo>qFwwohdDKqRYkHjKDaVacQQGPwP
  39. iVaQ?PiW`gDyP<]\Y<PcOSSVVl^oeIhgq?RAODQPUF]QGsauF_=o[{PhaOqpqD?_qJ_GQo^kmPILnTx
  40. aLvoGPiQLDqGQu\>?OqZqXapgA{J>MhquECGqYAK?JJ_=Wqkpccqlx`Ctr__PoA{O`qF<cwyO<DUcy[
  41. ]=\=AtzApj[qoQ>>MZyWe\uzY[KK<D[yxj=TwHSjyYhikl>[s<ypqIPKE\S_chuhA_iNBWkV[hx=gQN
  42. ^Stsr`yNtBR><dSs{@xj]JiY^cx{?rd\{@vBSG\S^GJdD<x\{XjDB[c=hwPiXJPDHArcTOPeywLTu{V
  43. `p>={qlr\<N`ndYQUqpkWF\@gOIFtbeF<>fpfUKHfb<VpmD\=HjBBQEHnAPfv<=tyKQJFHboDD\