Imported Upstream version 3.09.3~rc1
authorJulien Cristau <julien.cristau@ens-lyon.org>
Sat, 2 Sep 2006 09:24:33 +0000 (09:24 +0000)
committerJulien Cristau <julien.cristau@ens-lyon.org>
Sat, 2 Sep 2006 09:24:33 +0000 (09:24 +0000)
400 files changed:
Changes
README
README.win32
asmcomp/amd64/reload.ml
asmcomp/i386/proc.ml
asmrun/i386.S
asmrun/signals.c
boot/ocamlc
boot/ocamllex
byterun/extern.c
byterun/io.c
byterun/memory.h
byterun/sys.c
config/Makefile.msvc
ocamldoc/Changes.txt
ocamldoc/Makefile
ocamldoc/odoc.ml
ocamldoc/odoc_args.ml
ocamldoc/odoc_args.mli
ocamldoc/odoc_ast.ml
ocamldoc/odoc_comments.ml
ocamldoc/odoc_comments.mli
ocamldoc/odoc_cross.ml
ocamldoc/odoc_cross.mli
ocamldoc/odoc_dot.ml
ocamldoc/odoc_html.ml
ocamldoc/odoc_info.mli
ocamldoc/odoc_latex.ml
ocamldoc/odoc_merge.ml
ocamldoc/odoc_messages.ml
ocamldoc/odoc_module.ml
ocamldoc/odoc_opt.ml
ocamldoc/odoc_texi.ml
otherlibs/systhreads/Tests/Makefile [new file with mode: 0644]
otherlibs/systhreads/Tests/Makefile.nt [new file with mode: 0644]
otherlibs/threads/Tests/.cvsignore [new file with mode: 0644]
otherlibs/threads/Tests/Makefile [new file with mode: 0644]
otherlibs/threads/Tests/close.ml [new file with mode: 0644]
otherlibs/threads/Tests/sieve.ml [new file with mode: 0644]
otherlibs/threads/Tests/sorts.ml [new file with mode: 0644]
otherlibs/threads/Tests/test1.ml [new file with mode: 0644]
otherlibs/threads/Tests/test2.ml [new file with mode: 0644]
otherlibs/threads/Tests/test3.ml [new file with mode: 0644]
otherlibs/threads/Tests/test4.ml [new file with mode: 0644]
otherlibs/threads/Tests/test5.ml [new file with mode: 0644]
otherlibs/threads/Tests/test6.ml [new file with mode: 0644]
otherlibs/threads/Tests/test7.ml [new file with mode: 0644]
otherlibs/threads/Tests/test8.ml [new file with mode: 0644]
otherlibs/threads/Tests/test9.ml [new file with mode: 0644]
otherlibs/threads/Tests/testA.ml [new file with mode: 0644]
otherlibs/threads/Tests/testexit.ml [new file with mode: 0644]
otherlibs/threads/Tests/testio.ml [new file with mode: 0644]
otherlibs/threads/Tests/testsieve.ml [new file with mode: 0644]
otherlibs/threads/Tests/testsignal.ml [new file with mode: 0644]
otherlibs/threads/Tests/testsignal2.ml [new file with mode: 0644]
otherlibs/threads/Tests/testsocket.ml [new file with mode: 0644]
otherlibs/threads/Tests/token1.ml [new file with mode: 0644]
otherlibs/threads/Tests/token2.ml [new file with mode: 0644]
otherlibs/threads/Tests/torture.ml [new file with mode: 0644]
otherlibs/unix/gethost.c
stdlib/camlinternalMod.ml
stdlib/sys.ml
test/.cvsignore [new file with mode: 0644]
test/.depend [new file with mode: 0644]
test/KB/equations.ml [new file with mode: 0644]
test/KB/equations.mli [new file with mode: 0644]
test/KB/kb.ml [new file with mode: 0644]
test/KB/kb.mli [new file with mode: 0644]
test/KB/kbmain.ml [new file with mode: 0644]
test/KB/orderings.ml [new file with mode: 0644]
test/KB/orderings.mli [new file with mode: 0644]
test/KB/terms.ml [new file with mode: 0644]
test/KB/terms.mli [new file with mode: 0644]
test/Lex/.cvsignore [new file with mode: 0644]
test/Lex/gram_aux.ml [new file with mode: 0644]
test/Lex/grammar.mly [new file with mode: 0644]
test/Lex/lexgen.ml [new file with mode: 0644]
test/Lex/main.ml [new file with mode: 0644]
test/Lex/output.ml [new file with mode: 0644]
test/Lex/scan_aux.ml [new file with mode: 0644]
test/Lex/scanner.mll [new file with mode: 0644]
test/Lex/syntax.ml [new file with mode: 0644]
test/Lex/testmain.ml [new file with mode: 0644]
test/Lex/testscanner.mll [new file with mode: 0644]
test/Makefile [new file with mode: 0644]
test/Moretest/.cvsignore [new file with mode: 0644]
test/Moretest/.depend [new file with mode: 0644]
test/Moretest/Makefile [new file with mode: 0644]
test/Moretest/arrays.ml [new file with mode: 0644]
test/Moretest/bigarrays.ml [new file with mode: 0644]
test/Moretest/bigarrf.f [new file with mode: 0644]
test/Moretest/bigarrfml.ml [new file with mode: 0644]
test/Moretest/bigarrfstub.c [new file with mode: 0644]
test/Moretest/bigints.ml [new file with mode: 0644]
test/Moretest/bounds.ml [new file with mode: 0644]
test/Moretest/boxedints.ml [new file with mode: 0644]
test/Moretest/callback.ml [new file with mode: 0644]
test/Moretest/callbackprim.c [new file with mode: 0644]
test/Moretest/cmcaml.ml [new file with mode: 0644]
test/Moretest/cmmain.c [new file with mode: 0644]
test/Moretest/cmstub.c [new file with mode: 0644]
test/Moretest/equality.ml [new file with mode: 0644]
test/Moretest/fftba.ml [new file with mode: 0644]
test/Moretest/float.ml [new file with mode: 0644]
test/Moretest/globroots.ml [new file with mode: 0644]
test/Moretest/globrootsprim.c [new file with mode: 0644]
test/Moretest/graph_example.ml [new file with mode: 0644]
test/Moretest/graph_test.ml [new file with mode: 0644]
test/Moretest/includestruct.ml [new file with mode: 0644]
test/Moretest/intext.ml [new file with mode: 0644]
test/Moretest/intextaux.c [new file with mode: 0644]
test/Moretest/io.ml [new file with mode: 0644]
test/Moretest/manyargs.ml [new file with mode: 0644]
test/Moretest/manyargsprim.c [new file with mode: 0644]
test/Moretest/md5.ml [new file with mode: 0644]
test/Moretest/morematch.ml [new file with mode: 0644]
test/Moretest/multdef.ml [new file with mode: 0644]
test/Moretest/multdef.mli [new file with mode: 0644]
test/Moretest/patmatch.ml [new file with mode: 0644]
test/Moretest/recmod.ml [new file with mode: 0644]
test/Moretest/recmod.mli [new file with mode: 0644]
test/Moretest/recvalues.ml [new file with mode: 0644]
test/Moretest/regexp.ml [new file with mode: 0644]
test/Moretest/sets.ml [new file with mode: 0644]
test/Moretest/signals.ml [new file with mode: 0644]
test/Moretest/stackoverflow.ml [new file with mode: 0644]
test/Moretest/syserror.ml [new file with mode: 0644]
test/Moretest/tailcalls.ml [new file with mode: 0644]
test/Moretest/testrandom.ml [new file with mode: 0644]
test/Moretest/tscanf.ml [new file with mode: 0644]
test/Moretest/tscanf2_io.ml [new file with mode: 0644]
test/Moretest/tscanf2_master.ml [new file with mode: 0644]
test/Moretest/tscanf2_slave.ml [new file with mode: 0644]
test/Moretest/usemultdef.ml [new file with mode: 0644]
test/Moretest/warnings.ml [new file with mode: 0644]
test/Moretest/wc.ml [new file with mode: 0644]
test/Results/almabench.fast.out [new file with mode: 0644]
test/Results/almabench.out [new file with mode: 0644]
test/Results/bdd.out [new file with mode: 0644]
test/Results/boyer.out [new file with mode: 0644]
test/Results/fft.fast.out [new file with mode: 0644]
test/Results/fft.out [new file with mode: 0644]
test/Results/fib.out [new file with mode: 0644]
test/Results/hamming.out [new file with mode: 0644]
test/Results/kb.out [new file with mode: 0644]
test/Results/nucleic.out [new file with mode: 0644]
test/Results/quicksort.fast.out [new file with mode: 0644]
test/Results/quicksort.out [new file with mode: 0644]
test/Results/sieve.out [new file with mode: 0644]
test/Results/soli.fast.out [new file with mode: 0644]
test/Results/soli.out [new file with mode: 0644]
test/Results/sorts.out [new file with mode: 0644]
test/Results/takc.out [new file with mode: 0644]
test/Results/taku.out [new file with mode: 0644]
test/alloc.ml [new file with mode: 0644]
test/almabench.ml [new file with mode: 0644]
test/bdd.ml [new file with mode: 0644]
test/boyer.ml [new file with mode: 0644]
test/fft.ml [new file with mode: 0644]
test/fib.ml [new file with mode: 0644]
test/hamming.ml [new file with mode: 0644]
test/nucleic.ml [new file with mode: 0644]
test/ocamldoc/Makefile [new file with mode: 0644]
test/ocamldoc/t1.ml [new file with mode: 0644]
test/quicksort.ml [new file with mode: 0644]
test/sieve.ml [new file with mode: 0644]
test/soli.ml [new file with mode: 0644]
test/sorts.ml [new file with mode: 0644]
test/takc.ml [new file with mode: 0644]
test/taku.ml [new file with mode: 0644]
test/testinterp/.cvsignore [new file with mode: 0644]
test/testinterp/coverage [new file with mode: 0644]
test/testinterp/lib.ml [new file with mode: 0644]
test/testinterp/no68k.rez [new file with mode: 0644]
test/testinterp/noppc.rez [new file with mode: 0644]
test/testinterp/t000.ml [new file with mode: 0644]
test/testinterp/t010-const0.ml [new file with mode: 0644]
test/testinterp/t010-const1.ml [new file with mode: 0644]
test/testinterp/t010-const2.ml [new file with mode: 0644]
test/testinterp/t010-const3.ml [new file with mode: 0644]
test/testinterp/t011-constint.ml [new file with mode: 0644]
test/testinterp/t020.ml [new file with mode: 0644]
test/testinterp/t021-pushconst1.ml [new file with mode: 0644]
test/testinterp/t021-pushconst2.ml [new file with mode: 0644]
test/testinterp/t021-pushconst3.ml [new file with mode: 0644]
test/testinterp/t022-pushconstint.ml [new file with mode: 0644]
test/testinterp/t040-makeblock1.ml [new file with mode: 0644]
test/testinterp/t040-makeblock2.ml [new file with mode: 0644]
test/testinterp/t040-makeblock3.ml [new file with mode: 0644]
test/testinterp/t041-makeblock.ml [new file with mode: 0644]
test/testinterp/t050-getglobal.ml [new file with mode: 0644]
test/testinterp/t050-pushgetglobal.ml [new file with mode: 0644]
test/testinterp/t051-getglobalfield.ml [new file with mode: 0644]
test/testinterp/t051-pushgetglobalfield.ml [new file with mode: 0644]
test/testinterp/t060-raise.ml [new file with mode: 0644]
test/testinterp/t070-branch.ml [new file with mode: 0644]
test/testinterp/t070-branchif.ml [new file with mode: 0644]
test/testinterp/t070-branchifnot.ml [new file with mode: 0644]
test/testinterp/t071-boolnot.ml [new file with mode: 0644]
test/testinterp/t080-eq.ml [new file with mode: 0644]
test/testinterp/t080-geint.ml [new file with mode: 0644]
test/testinterp/t080-gtint.ml [new file with mode: 0644]
test/testinterp/t080-leint.ml [new file with mode: 0644]
test/testinterp/t080-ltint.ml [new file with mode: 0644]
test/testinterp/t080-neq.ml [new file with mode: 0644]
test/testinterp/t090-acc0.ml [new file with mode: 0644]
test/testinterp/t090-acc1.ml [new file with mode: 0644]
test/testinterp/t090-acc2.ml [new file with mode: 0644]
test/testinterp/t090-acc3.ml [new file with mode: 0644]
test/testinterp/t090-acc4.ml [new file with mode: 0644]
test/testinterp/t090-acc5.ml [new file with mode: 0644]
test/testinterp/t090-acc6.ml [new file with mode: 0644]
test/testinterp/t090-acc7.ml [new file with mode: 0644]
test/testinterp/t091-acc.ml [new file with mode: 0644]
test/testinterp/t092-pushacc.ml [new file with mode: 0644]
test/testinterp/t092-pushacc0.ml [new file with mode: 0644]
test/testinterp/t092-pushacc1.ml [new file with mode: 0644]
test/testinterp/t092-pushacc2.ml [new file with mode: 0644]
test/testinterp/t092-pushacc3.ml [new file with mode: 0644]
test/testinterp/t092-pushacc4.ml [new file with mode: 0644]
test/testinterp/t092-pushacc5.ml [new file with mode: 0644]
test/testinterp/t092-pushacc6.ml [new file with mode: 0644]
test/testinterp/t092-pushacc7.ml [new file with mode: 0644]
test/testinterp/t093-pushacc.ml [new file with mode: 0644]
test/testinterp/t100-pushtrap.ml [new file with mode: 0644]
test/testinterp/t101-poptrap.ml [new file with mode: 0644]
test/testinterp/t110-addint.ml [new file with mode: 0644]
test/testinterp/t110-andint.ml [new file with mode: 0644]
test/testinterp/t110-asrint-1.ml [new file with mode: 0644]
test/testinterp/t110-asrint-2.ml [new file with mode: 0644]
test/testinterp/t110-divint-1.ml [new file with mode: 0644]
test/testinterp/t110-divint-2.ml [new file with mode: 0644]
test/testinterp/t110-divint-3.ml [new file with mode: 0644]
test/testinterp/t110-lslint.ml [new file with mode: 0644]
test/testinterp/t110-lsrint.ml [new file with mode: 0644]
test/testinterp/t110-modint-1.ml [new file with mode: 0644]
test/testinterp/t110-modint-2.ml [new file with mode: 0644]
test/testinterp/t110-mulint.ml [new file with mode: 0644]
test/testinterp/t110-negint.ml [new file with mode: 0644]
test/testinterp/t110-offsetint.ml [new file with mode: 0644]
test/testinterp/t110-orint.ml [new file with mode: 0644]
test/testinterp/t110-subint.ml [new file with mode: 0644]
test/testinterp/t110-xorint.ml [new file with mode: 0644]
test/testinterp/t120-getstringchar.ml [new file with mode: 0644]
test/testinterp/t121-setstringchar.ml [new file with mode: 0644]
test/testinterp/t130-getvectitem.ml [new file with mode: 0644]
test/testinterp/t130-vectlength.ml [new file with mode: 0644]
test/testinterp/t131-setvectitem.ml [new file with mode: 0644]
test/testinterp/t140-switch-1.ml [new file with mode: 0644]
test/testinterp/t140-switch-2.ml [new file with mode: 0644]
test/testinterp/t140-switch-3.ml [new file with mode: 0644]
test/testinterp/t140-switch-4.ml [new file with mode: 0644]
test/testinterp/t141-switch-5.ml [new file with mode: 0644]
test/testinterp/t141-switch-6.ml [new file with mode: 0644]
test/testinterp/t141-switch-7.ml [new file with mode: 0644]
test/testinterp/t142-switch-8.ml [new file with mode: 0644]
test/testinterp/t142-switch-9.ml [new file with mode: 0644]
test/testinterp/t142-switch-A.ml [new file with mode: 0644]
test/testinterp/t150-push-1.ml [new file with mode: 0644]
test/testinterp/t150-push-2.ml [new file with mode: 0644]
test/testinterp/t160-closure.ml [new file with mode: 0644]
test/testinterp/t161-apply1.ml [new file with mode: 0644]
test/testinterp/t162-return.ml [new file with mode: 0644]
test/testinterp/t163.ml [new file with mode: 0644]
test/testinterp/t164-apply2.ml [new file with mode: 0644]
test/testinterp/t164-apply3.ml [new file with mode: 0644]
test/testinterp/t165-apply.ml [new file with mode: 0644]
test/testinterp/t170-envacc2.ml [new file with mode: 0644]
test/testinterp/t170-envacc3.ml [new file with mode: 0644]
test/testinterp/t170-envacc4.ml [new file with mode: 0644]
test/testinterp/t171-envacc.ml [new file with mode: 0644]
test/testinterp/t172-pushenvacc1.ml [new file with mode: 0644]
test/testinterp/t172-pushenvacc2.ml [new file with mode: 0644]
test/testinterp/t172-pushenvacc3.ml [new file with mode: 0644]
test/testinterp/t172-pushenvacc4.ml [new file with mode: 0644]
test/testinterp/t173-pushenvacc.ml [new file with mode: 0644]
test/testinterp/t180-appterm1.ml [new file with mode: 0644]
test/testinterp/t180-appterm2.ml [new file with mode: 0644]
test/testinterp/t180-appterm3.ml [new file with mode: 0644]
test/testinterp/t181-appterm.ml [new file with mode: 0644]
test/testinterp/t190-makefloatblock-1.ml [new file with mode: 0644]
test/testinterp/t190-makefloatblock-2.ml [new file with mode: 0644]
test/testinterp/t190-makefloatblock-3.ml [new file with mode: 0644]
test/testinterp/t191-vectlength.ml [new file with mode: 0644]
test/testinterp/t192-getfloatfield-1.ml [new file with mode: 0644]
test/testinterp/t192-getfloatfield-2.ml [new file with mode: 0644]
test/testinterp/t193-setfloatfield-1.ml [new file with mode: 0644]
test/testinterp/t193-setfloatfield-2.ml [new file with mode: 0644]
test/testinterp/t200-getfield0.ml [new file with mode: 0644]
test/testinterp/t200-getfield1.ml [new file with mode: 0644]
test/testinterp/t200-getfield2.ml [new file with mode: 0644]
test/testinterp/t200-getfield3.ml [new file with mode: 0644]
test/testinterp/t201-getfield.ml [new file with mode: 0644]
test/testinterp/t210-setfield0.ml [new file with mode: 0644]
test/testinterp/t210-setfield1.ml [new file with mode: 0644]
test/testinterp/t210-setfield2.ml [new file with mode: 0644]
test/testinterp/t210-setfield3.ml [new file with mode: 0644]
test/testinterp/t211-setfield.ml [new file with mode: 0644]
test/testinterp/t220-assign.ml [new file with mode: 0644]
test/testinterp/t230-check_signals.ml [new file with mode: 0644]
test/testinterp/t240-c_call1.ml [new file with mode: 0644]
test/testinterp/t240-c_call2.ml [new file with mode: 0644]
test/testinterp/t240-c_call3.ml [new file with mode: 0644]
test/testinterp/t240-c_call4.ml [new file with mode: 0644]
test/testinterp/t240-c_call5.ml [new file with mode: 0644]
test/testinterp/t250-closurerec-1.ml [new file with mode: 0644]
test/testinterp/t250-closurerec-2.ml [new file with mode: 0644]
test/testinterp/t251-pushoffsetclosure0.ml [new file with mode: 0644]
test/testinterp/t251-pushoffsetclosure2.ml [new file with mode: 0644]
test/testinterp/t251-pushoffsetclosurem2.ml [new file with mode: 0644]
test/testinterp/t252-pushoffsetclosure.ml [new file with mode: 0644]
test/testinterp/t253-offsetclosure0.ml [new file with mode: 0644]
test/testinterp/t253-offsetclosure2.ml [new file with mode: 0644]
test/testinterp/t253-offsetclosurem2.ml [new file with mode: 0644]
test/testinterp/t254-offsetclosure.ml [new file with mode: 0644]
test/testinterp/t260-offsetref.ml [new file with mode: 0644]
test/testinterp/t270-push_retaddr.ml [new file with mode: 0644]
test/testinterp/t300-getmethod.ml [new file with mode: 0644]
test/testinterp/t301-object.ml [new file with mode: 0644]
test/testinterp/t310-alloc-1.ml [new file with mode: 0644]
test/testinterp/t310-alloc-2.ml [new file with mode: 0644]
test/testinterp/t320-gc-1.ml [new file with mode: 0644]
test/testinterp/t320-gc-2.ml [new file with mode: 0644]
test/testinterp/t320-gc-3.ml [new file with mode: 0644]
test/testinterp/t330-compact-1.ml [new file with mode: 0644]
test/testinterp/t330-compact-2.ml [new file with mode: 0644]
test/testinterp/t330-compact-3.ml [new file with mode: 0644]
test/testinterp/t330-compact-4.ml [new file with mode: 0644]
test/testinterp/t340-weak.ml [new file with mode: 0644]
test/testinterp/t350-heapcheck.ml [new file with mode: 0644]
test/testinterp/t360-stacks-1.ml [new file with mode: 0644]
test/testinterp/t360-stacks-2.ml [new file with mode: 0644]
testasmcomp/.cvsignore [new file with mode: 0644]
testasmcomp/.depend [new file with mode: 0644]
testasmcomp/Makefile [new file with mode: 0644]
testasmcomp/alpha.S [new file with mode: 0644]
testasmcomp/amd64.S [new file with mode: 0644]
testasmcomp/arith.cmm [new file with mode: 0644]
testasmcomp/arm.S [new file with mode: 0644]
testasmcomp/checkbound.cmm [new file with mode: 0644]
testasmcomp/fib.cmm [new file with mode: 0644]
testasmcomp/hppa.S [new file with mode: 0644]
testasmcomp/i386.S [new file with mode: 0644]
testasmcomp/i386nt.asm [new file with mode: 0644]
testasmcomp/ia64.S [new file with mode: 0644]
testasmcomp/integr.cmm [new file with mode: 0644]
testasmcomp/lexcmm.mli [new file with mode: 0644]
testasmcomp/lexcmm.mll [new file with mode: 0644]
testasmcomp/m68k.S [new file with mode: 0644]
testasmcomp/main.c [new file with mode: 0644]
testasmcomp/main.ml [new file with mode: 0644]
testasmcomp/mainarith.c [new file with mode: 0644]
testasmcomp/mips.s [new file with mode: 0644]
testasmcomp/parsecmm.mly [new file with mode: 0644]
testasmcomp/parsecmmaux.ml [new file with mode: 0644]
testasmcomp/parsecmmaux.mli [new file with mode: 0644]
testasmcomp/power-aix.S [new file with mode: 0644]
testasmcomp/power-elf.S [new file with mode: 0644]
testasmcomp/power-rhapsody.S [new file with mode: 0644]
testasmcomp/quicksort.cmm [new file with mode: 0644]
testasmcomp/quicksort2.cmm [new file with mode: 0644]
testasmcomp/soli.cmm [new file with mode: 0644]
testasmcomp/sparc.S [new file with mode: 0644]
testasmcomp/tagged-fib.cmm [new file with mode: 0644]
testasmcomp/tagged-integr.cmm [new file with mode: 0644]
testasmcomp/tagged-quicksort.cmm [new file with mode: 0644]
testasmcomp/tagged-tak.cmm [new file with mode: 0644]
testasmcomp/tak.cmm [new file with mode: 0644]
testlabl/.cvsignore [new file with mode: 0644]
testlabl/Makefile [new file with mode: 0644]
testlabl/bugs/yamagata021012.ml [new file with mode: 0644]
testlabl/dirs_multimatch [new file with mode: 0644]
testlabl/dirs_poly [new file with mode: 0644]
testlabl/fixedtypes.ml [new file with mode: 0644]
testlabl/mixin.ml [new file with mode: 0644]
testlabl/mixin2.ml [new file with mode: 0644]
testlabl/mixin3.ml [new file with mode: 0644]
testlabl/multimatch.ml [new file with mode: 0644]
testlabl/newlabels.ps [new file with mode: 0644]
testlabl/objvariant.ml [new file with mode: 0644]
testlabl/poly.exp [new file with mode: 0644]
testlabl/poly.exp2 [new file with mode: 0644]
testlabl/poly.ml [new file with mode: 0644]
testlabl/printers.ml [new file with mode: 0644]
testlabl/tests.ml [new file with mode: 0644]
testobjects/.cvsignore [new file with mode: 0644]
testobjects/Exemples.exp [new file with mode: 0644]
testobjects/Exemples.ml [new file with mode: 0644]
testobjects/Makefile [new file with mode: 0644]
testobjects/Tests.exp [new file with mode: 0644]
testobjects/Tests.ml [new file with mode: 0644]
tools/Makefile
tools/ocamldep.ml
tools/ocamlprof.ml
typing/ctype.ml
typing/includemod.ml
typing/includemod.mli
typing/typecore.ml
typing/typemod.ml
typing/typetexp.ml

diff --git a/Changes b/Changes
index 9f36cc535bba57d9a05120b16edca69e9216b268..f511346ce64326699e7468035839c1f6b0f0d20c 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,36 @@
+Objective Caml 3.09.3:
+----------------------
+
+Bug fixes:
+- ocamldoc: -using modtype constraint to filter module elements displayed
+    in doc PR#4016
+- ocamldoc: error in merging of top dependencies of modules PR#4007
+- ocamldoc: -dot-colors has no effect PR#3981
+- ocamdloc: missing crossref in text from intro files PR#4066
+- compilers: segfault with recursive modules PR#4008
+- compilers: infinite loop when compiling objects PR#4018
+- compilers: bad error message when signature mismatch PR#4001
+- compilers: infinite loop with -rectypes PR#3999
+- compilers: contravariance bug in private rows
+- compilers: unsafe cast with polymorphic exception PR#4002
+- native compiler: bad assembly code generated for AMD64 PR#4067
+- native compiler: stack alignment problems on MacOSX/i386 PR#4036
+- stdlib: crash in marshalling PR#4030
+- stdlib: crash when closing a channel twice PR#4039
+- stdlib: memory leak in Sys.readdir PR#4093
+- C interface: better definition of CAMLreturn PR#4068
+- otherlibs/unix: crash in gethostbyname PR#3043
+- tools: subtle problem with unset in makefile PR#4048
+
+New features:
+- ocamldoc: name resolution in cross-referencing {!name}: if name is not
+    found, then it is searched in the parent module/class, and in the parent
+    of the parent, and so on until it is found.
+- ocamldoc: new option -short-functors to use a short form to display
+    functors in html generator PR#4017
+- ocamlprof: added "-version" option
+
+
 Objective Caml 3.09.2:
 ----------------------
 
@@ -22,7 +55,7 @@ Bug fixes:
 - stdlib: Filename.dirname/basename wrong on Win32 PR#3933
 - stdlib: incomplete documentation of Pervasives.abs PR#3967
 - stdlib: Printf bugs PR#3902, PR#3955
-- tools/checkstack.c missing include
+- tools/checkstack.c: missing include
 - yacc: crash when given argument "-" PR#3956
 
 New features:
@@ -91,7 +124,7 @@ Both compilers:
 
 Native-code compiler (ocamlopt):
 * Revised implementation of the -pack option (packing of several compilation
-  units into one).  The .cmx files that are to be packed with 
+  units into one).  The .cmx files that are to be packed with
   "ocamlopt -pack -o P.cmx" must be compiled with "ocamlopt -for-pack P".
   In exchange for this additional constraint, ocamlopt -pack is now
   available on all platforms (no need for binutils).
@@ -311,7 +344,7 @@ Both compilers:
   .cmi / .cmo / .cmx files.
 
 Bytecode compiler:
-- Option -output-obj is now compatible with Dynlink and 
+- Option -output-obj is now compatible with Dynlink and
   with embedded toplevels.
 
 Native-code compiler:
@@ -394,7 +427,7 @@ Language features:
   (written with an 'l', 'n' or 'L' suffix respectively).
 
 Type-checking:
-- Allow polymorphic generalization of covariant parts of expansive 
+- Allow polymorphic generalization of covariant parts of expansive
   expressions.  For instance, if f: unit -> 'a list, "let x = f ()"
   gives "x" the generalized type forall 'a. 'a list, instead of '_a list
   as before.
@@ -453,7 +486,7 @@ Native-code compiler:
     Small performance tweaks for the Pentium 4.
     Fixed illegal "imul" instruction generated by reloading phase.
 - Sparc port:
-    Enhanced code generation for Sparc V8 (option -march=v8) and 
+    Enhanced code generation for Sparc V8 (option -march=v8) and
     Sparc V9 (option -march=v9).
     Profiling support added for Solaris.
 - PowerPC port:
@@ -611,7 +644,7 @@ Run-time system:
 - Better support for lazy data in the garbage collector.
 - Fixed issues with the heap compactor.
 - Fixed issues with finalized Caml values.
-- The type "int64" is now supported on all platforms: we use software 
+- The type "int64" is now supported on all platforms: we use software
   emulation if the C compiler doesn't support 64-bit integers.
 - Support for float formats that are neither big-endian nor little-endian
   (one known example: the ARM).
@@ -657,12 +690,12 @@ Standard library:
 
 Other libraries:
 - Bigarray:
-    support for bigarrays of complex numbers; 
+    support for bigarrays of complex numbers;
     added functions Genarray.dims,
       {Genarray,Array1,Array2,Array3}.{kind,layout}.
 - Dynlink: fixed bug with loading of mixed-mode Caml/C libraries.
 - LablTK:
-    now supports also the CamlTK API (no labels); 
+    now supports also the CamlTK API (no labels);
     support for Activate and Deactivate events;
     support for virtual events;
     added UTF conversion;
@@ -693,7 +726,7 @@ Windows port:
 - Graphics library: fixed several bugs in event handling.
 - Threads library: fixed preemption bug.
 - Unix library: better handling of the underlying differences between
-  sockets and regular file descriptors; 
+  sockets and regular file descriptors;
   added Unix.lockf and a better Unix.rename (thanks to Tracy Camp).
 - LablTk library: fixed a bug in Fileinput
 
@@ -739,15 +772,15 @@ Standard library:
 - Pervasives.float_of_string: now raises Failure on ill-formed input.
 - Pervasives: added useful float constants max_float, min_float, epsilon_float.
 - printf functions in Printf and Format: added % formats for int32, nativeint,
-  int64; "*" in width and precision specifications now supported 
+  int64; "*" in width and precision specifications now supported
   (contributed by Thorsten Ohl).
 - Added Hashtbl.copy, Stack.copy.
-- Hashtbl: revised resizing strategy to avoid quadratic behavior 
+- Hashtbl: revised resizing strategy to avoid quadratic behavior
   on Hashtbl.add.
 - New module MoreLabels providing labelized versions of modules
   Hashtbl, Map and Set.
 - Pervasives.output_value and Marshal.to_* : improved hashing strategy
-  for internal data structures, avoid excessive slowness on 
+  for internal data structures, avoid excessive slowness on
   quasi-linearly-allocated inputs.
 
 Other libraries:
@@ -860,7 +893,7 @@ Byte-code compiler:
   variables.
 
 Native-code compiler:
-- Removed re-sharing of string literals, causes too many surprises with 
+- Removed re-sharing of string literals, causes too many surprises with
   in-place string modifications.
 - Corrected wrong compilation of toplevel "include" statements.
 - Fixed bug in runtime function "callbackN_exn".
@@ -929,11 +962,11 @@ New ports:
 - Cygwin under MS Windows.  This port is an alternative to the earlier
   Windows port of OCaml, which relied on MS compilers; the Cygwin
   Windows port does not need MS Visual C++ nor MASM, runs faster
-  in bytecode, and has a better implementation of the Unix library, 
+  in bytecode, and has a better implementation of the Unix library,
   but currently lacks threads and COM component support.
 
 Type-checking:
-- Relaxed "monomorphic restriction" on type constructors in a 
+- Relaxed "monomorphic restriction" on type constructors in a
   mutually-recursive type definition, e.g. the following is again allowed
     type u = C of int t | D of string t and 'a t = ...
 - Fixed name-capture bug in "include SIG" and "SIG with ..." constructs.
@@ -947,7 +980,7 @@ Type-checking:
 Both compilers:
 - Revised compilation of pattern matching.
 - Option -I +<subdir> to search a subdirectory <subdir> of the standard
-  library directory (i.e. write "ocamlc -I +labltk" instead of 
+  library directory (i.e. write "ocamlc -I +labltk" instead of
   "ocamlc -I /usr/local/lib/ocaml/labltk").
 - Option -warn-error to turn warnings into errors.
 - Option -where to print the location of the standard library directory.
@@ -991,7 +1024,7 @@ Standard library:
 - Module Hashtbl: added Hashtbl.replace.
 - Module Int64: added bits_of_float, float_of_bits (access to IEEE 754
     representation of floats).
-- Module List:  List.partition now tail-rec; 
+- Module List:  List.partition now tail-rec;
     improved memory behavior of List.stable_sort.
 - Module Nativeint: added Nativeint.size (number of bits in a nativeint).
 - Module Obj: fixed incorrect resizing of float arrays in Obj.resize.
@@ -1128,7 +1161,7 @@ Other libraries:
 - Dbm: fixed bug with Dbm.iter on empty database.
 
 New or updated ports:
-- Alpha/Digital Unix: lifted 256M limitation on total memory space 
+- Alpha/Digital Unix: lifted 256M limitation on total memory space
   induced by -taso
 - Port to AIX 4.3 on PowerPC
 - Port to HPUX 10 on HPPA
@@ -1171,8 +1204,8 @@ Syntax:
   the equivalent "# LINENO" is still supported.
 
 Typing:
-- When an incomplete pattern-matching is detected, report also a 
-  value or value template that is not covered by the cases of 
+- When an incomplete pattern-matching is detected, report also a
+  value or value template that is not covered by the cases of
   the pattern-matching.
 - Several bugs in class type matching and in type error reporting fixed.
 - Added an option -rectypes to support general recursive types,
@@ -1541,7 +1574,7 @@ Objective Caml 1.06:
     in class type declared in module signature).
   - Objects can be compared using generic comparison functions.
   - Fixed compilation of partial application of object constructors.
+
 * Type system:
   - Occur-check now more strict (all recursions must traverse an object).
   - A few bugs fixed.
@@ -1656,7 +1689,7 @@ Objective Caml 1.04:
   - At toplevel, allow several phrases without intermediate ";;".
 
 * Typing:
-  - Allow constraints on datatype parameters, e.g. 
+  - Allow constraints on datatype parameters, e.g.
     type 'a foo = ... constraint 'a = 'b * 'c.
   - Fixed bug in signature matching in presence of free type variables '_a.
   - Extensive cleanup of internals of type inference.
@@ -1758,7 +1791,7 @@ Objective Caml 1.03:
 
 Objective Caml 1.02:
 --------------------
-* Typing: 
+* Typing:
   - fixed bug with type names escaping their scope via unification
     with non-generalized type variables '_a;
   - keep #class abbreviations longer;
@@ -1802,7 +1835,7 @@ Objective Caml 1.02:
   - added -thread option to select a thread-safe version of the
     standard library, the ThreadIO module is no longer needed.
 
-* The "graph" library: avoid invalid pixmaps when doing 
+* The "graph" library: avoid invalid pixmaps when doing
   open_graph/close_graph several times.
 
 * The "dynlink" library: support for "private" (no re-export) dynamic loading.
@@ -1815,7 +1848,7 @@ Objective Caml 1.02:
 
 Objective Caml 1.01:
 --------------------
-* Typing: better report of type incompatibilities; 
+* Typing: better report of type incompatibilities;
   non-generalizable type variables in a struct...end no longer flagged
   immediately as an error;
   name clashes during "open" avoided.
@@ -2022,7 +2055,7 @@ Caml Special Light 1.07:
 * Syntax: optional ;; allowed in compilation units and structures
 (back by popular demand)
 
-* cslopt: 
+* cslopt:
 generic handling of float arrays fixed
 direct function application when the function expr is not a path fixed
 compilation of "let rec" over values fixed
@@ -2038,4 +2071,4 @@ Caml Special Light 1.06:
 
 * First public release.
 
-$Id: Changes,v 1.156.2.6 2006/04/14 09:53:47 doligez Exp $
+$Id: Changes,v 1.156.2.15 2006/08/30 09:38:34 doligez Exp $
diff --git a/README b/README
index 17dc41d19a43ddc8ed2e5c9f7dc36248efbbcf31..0b621d03d55e76dd39932d95344378353109281c 100644 (file)
--- a/README
+++ b/README
@@ -22,10 +22,10 @@ native-code compiler currently runs on the following platforms:
 Tier 1 (actively used and maintained by the core Caml team):
 
     AMD64 (Opteron)    Linux
-    IA32 (Pentium)     Linux, FreeBSD, MS Windows
+    IA32 (Pentium)     Linux, FreeBSD, MacOS X, MS Windows
     PowerPC            MacOS X
 
-Tier 2 (maintained but less actively, with help from users):
+Tier 2 (maintained when possible, with help from users):
 
     Alpha              Digital Unix/Compaq Tru64, Linux, all BSD
     AMD64              FreeBSD, OpenBSD
@@ -78,7 +78,7 @@ CONTENTS:
 COPYRIGHT:
 
 All files marked "Copyright INRIA" in this distribution are copyright
-1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 Institut National de Recherche en Informatique et en Automatique
 (INRIA) and distributed under the conditions stated in file LICENSE.
 
@@ -112,11 +112,9 @@ Messages to the list should be sent to:
 
               caml-list@inria.fr
 
-If you wish to subscribe to this list, please send a message to:
+You can subscribe to this list via the Web interface at
 
-              caml-list-request@inria.fr
-
-with the single word "subscribe" in the body of the message.
+    http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
 
 Archives of the list are available on the Web site http://caml.inria.fr/
 
@@ -126,11 +124,7 @@ including Caml.
 
 BUG REPORTS AND USER FEEDBACK:
 
-Send your bug reports by E-mail to:
-
-              caml-bugs@inria.fr
-
-or report them using the Web interface to the bug-tracking system
+Please report bugs using the Web interface to the bug-tracking system
 at http://caml.inria.fr/bin/caml-bugs
 
 To be effective, bug reports should include a complete program
index 7263035e9a2321d2d0fc5f78ac8f0395368a1a63..9640c6e3549609c414c2f1e2d26cc2e850c15da7 100644 (file)
@@ -43,24 +43,20 @@ The remainder of this document gives more information on each port.
 REQUIREMENTS:
 
 This port runs under MS Windows NT, 2000 and XP.  
-Windows 95, 98 and ME are also supported, but less reliably.
+Windows 95, 98 and ME are no longer supported.
 
 The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...)
 runs without any additional tools.
 
 Statically linking Caml bytecode with C code (ocamlc -custom) requires the
-Microsoft Visual C++ compiler.  Dynamic loading of DLLs is
-supported out of the box, without additional software.
+Microsoft Visual C++ compiler (items [1] and [2] in the section
+"third-party software" below).  Dynamic loading of DLLs is supported
+out of the box, without additional software.
 
-The native-code compiler (ocamlopt) requires Visual C++ and the
-Microsoft assembler MASM version 6.11 or later.  MASM can be
-downloaded for free from Microsoft's Web site; for directions, see
-        http://www.easystreet.com/~jkirwan/pctools.html
-    or  http://www2.dgsys.com/~raymoon/faq/masm.html
-    or  the comp.lang.asm.x86 FAQ.
+The native-code compiler (ocamlopt) requires Visual C++ (items [1], [2])
+and the Microsoft assembler MASM (item [3]).
 
-The LablTk GUI requires Tcl/Tk 8.3.  Windows binaries are
-available from http://prdownloads.sourceforge.net/tcl/tcl832.exe.
+The LablTk GUI requires Tcl/Tk 8.3 (item [4]).
 
 
 INSTALLATION:
@@ -68,20 +64,6 @@ INSTALLATION:
 The binary distribution is a self-installing executable archive.
 Just run it and it should install OCaml automatically.
 
-If you are using Windows 95, 98 or ME, you need to adjust environment
-variables as follows:
-  - add the "bin" subdirectory of the OCaml installation directory
-    to the PATH variable;
-  - set the OCAMLLIB variable to the "lib" subdirectory of the
-    OCaml installation directory.
-For instance, if you installed OCaml in C:\Program Files\Objective Caml,
-add the following two lines at the end of C:\autoexec.bat:
-
-    set PATH=%PATH%;"C:\Program Files\Objective Caml\bin"
-    set OCAMLLIB=C:\Program Files\Objective Caml\lib
-
-No such tweaking of environment variables is needed under NT, 2000 and XP.
-
 To run programs that use the LablTK GUI, the directory where the
 DLLs tk83.dll and tcl83.dll were installed (by the Tcl/Tk
 installer) must be added to the PATH environment variable.
@@ -93,6 +75,23 @@ environment variable.  E.g. if Tcl/Tk was installed in C:\tcl, add
 "C:\tcl\lib" to the LIB environment variable.
 
 
+THIRD-PARTY SOFTWARE:
+
+[1] Visual C++ version 6 or later.  We use Visual C++ 2005 Express Edition,
+    which can be downloaded for free from http://www.microsoft.com/.
+
+[2] Windows header files and development libraries.  We found them in
+    the Microsoft Windows Server 2003 R2 Platform SDK, which can
+    be downloaded for free from http://www.microsoft.com/.
+
+[3] MASM version 6.11 or later. MASM can be
+    downloaded for free from Microsoft's Web site; for directions, see
+    http://users.easystreet.com/jkirwan/new/pctools.html. 
+
+[4] TCL/TK version 8.3.  Windows binaries are available from
+    http://prdownloads.sourceforge.net/tcl/tcl832.exe.
+
+
 RECOMPILATION FROM THE SOURCES:
 
 The command-line tools can be recompiled from the Unix source
@@ -100,11 +99,9 @@ distribution (ocaml-X.YZ.tar.gz), which also contains the files modified
 for Windows.
 
 You will need the following software components to perform the recompilation:
-- Windows NT, 2000, or XP (we advise against compiling under Windows 95/98/ME)
-- Visual C++ version 6 or 7
-- MASM version 6.11 (see above)
-- The Cygwin port of GNU tools, available from http://cygwin.com/
-- TCL/TK version 8.3 (for the LablTK GUI) (see above).
+- Windows NT, 2000, or XP.
+- Items [1], [2], [3] and [4] from the list of recommended software above.
+- The Cygwin port of GNU tools, available from http://www.cygwin.com/
 
 Remember to add the directory where the libraries tk83.lib and
 tcl83.lib were installed (by the Tcl/Tk installer) to the LIB variable
@@ -127,6 +124,7 @@ Finally, use "make -f Makefile.nt" to build the system, e.g.
         make -f Makefile.nt world
         make -f Makefile.nt bootstrap
         make -f Makefile.nt opt
+        make -f Makefile.nt opt.opt
         make -f Makefile.nt install
 
 
@@ -167,8 +165,9 @@ runs without any additional tools.
 The native-code compiler (ocamlopt), as well as static linking of
 Caml bytecode with C code (ocamlc -custom), require 
 the Cygwin development tools, available at
-        http://sources.redhat.com/cygwin/
-You will need to install at least the following Cygwin packages:
+        http://www.cygwin.com/
+You will need to install at least the following Cygwin packages (use
+the Setup tool from Cygwin):
 binutils, gcc-core, gcc-mingw-core, mingw-runtime, w32-api.
 
 Do *not* install the Mingw/MSYS development tools from www.mingw.org:
@@ -184,20 +183,6 @@ INSTALLATION:
 The binary distribution is a self-installing executable archive.
 Just run it and it should install OCaml automatically.
 
-If you are using Windows 95, 98 or ME, you need to adjust environment
-variables as follows:
-  - add the "bin" subdirectory of the OCaml installation directory
-    to the PATH variable;
-  - set the OCAMLLIB variable to the "lib" subdirectory of the
-    OCaml installation directory.
-For instance, if you installed OCaml in C:\Program Files\Objective Caml,
-add the following two lines at the end of C:\autoexec.bat:
-
-    set PATH=%PATH%;"C:\Program Files\Objective Caml\bin"
-    set OCAMLLIB=C:\Program Files\Objective Caml\lib
-
-No such tweaking of environment variables is needed under NT, 2000 and XP.
-
 To run programs that use the LablTK GUI, the directory where the
 DLLs tk83.dll and tcl83.dll were installed (by the Tcl/Tk
 installer) must be added to the PATH environment variable.
@@ -212,7 +197,7 @@ environment variable.  E.g. if Tcl/Tk was installed in C:\tcl, add
 RECOMPILATION FROM THE SOURCES:
 
 You will need the following software components to perform the recompilation:
-- Windows NT, 2000, or XP (we advise against compiling under Windows 95/98/ME)
+- Windows NT, 2000, or XP.
 - Cygwin: http://sourceware.cygnus.com/cygwin/
 - TCL/TK version 8.3 (see above).
 
@@ -258,15 +243,16 @@ REQUIREMENTS:
 
 This port requires the Cygwin environment from Cygnus/RedHat, which
 is freely available at:
-          http://sources.redhat.com/cygwin/
+          http://www.cygwin.com/
 
 This port runs under all versions of MS Windows supported by Cygwin.
 
 
 INSTALLATION:
 
-For technical reasons, no binary distribution of this port is available.
-You need to recompile from the source distribution.
+We do not distribute binaries for this port, but they can be found
+in the Cygwin distribution (use the Setup tool from Cygwin and select
+the OCaml packages).  Alternatively, recompile from the source distribution.
 
 
 RECOMPILATION FROM THE SOURCES:
index fa96e951836d88d8f7ff6de973255a24737ed66a..f4238a6b755e189602010d6abce86ab47c8f0f4b 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: reload.ml,v 1.2 2005/10/13 03:53:52 xleroy Exp $ *)
+(* $Id: reload.ml,v 1.2.2.1 2006/08/01 01:01:43 xleroy Exp $ *)
 
 open Cmm
 open Arch
@@ -73,11 +73,6 @@ method reload_operation op arg res =
       (* This add will be turned into a lea; args and results must be
          in registers *)
       super#reload_operation op arg res
-  | Iconst_symbol _ ->
-      if !pic_code
-      then super#reload_operation op arg res
-      else (arg, res)
-  | Iconst_int _
   | Iintop(Idiv | Imod | Ilsl | Ilsr | Iasr)
   | Iintop_imm(_, _) ->
       (* The argument(s) and results can be either in register or on stack *)
@@ -93,6 +88,14 @@ method reload_operation op arg res =
   | Ifloatofint | Iintoffloat ->
       (* Result must be in register, but argument can be on stack *)
       (arg, (if stackp res.(0) then [| self#makereg res.(0) |] else res))
+  | Iconst_int n ->
+      if n <= 0x7FFFFFFFn && n >= -0x80000000n
+      then (arg, res)
+      else super#reload_operation op arg res
+  | Iconst_symbol _ ->
+      if !pic_code
+      then super#reload_operation op arg res
+      else (arg, res)
   | _ -> (* Other operations: all args and results in registers *)
       super#reload_operation op arg res
 
index e8cc931a9ff9b07c480f23fd794ed3c318597d30..7dabd994881756f5393c0b7ce4bf4c5c733241d6 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: proc.ml,v 1.9 2004/08/12 13:37:12 xleroy Exp $ *)
+(* $Id: proc.ml,v 1.9.4.1 2006/07/25 08:31:56 xleroy Exp $ *)
 
 (* Description of the Intel 386 processor *)
 
@@ -124,7 +124,7 @@ let calling_conventions first_int last_int first_float last_float make_stack
           ofs := !ofs + size_float
         end
   done;
-  (loc, max 0 !ofs)
+  (loc, Misc.align stack_alignment (max 0 !ofs))
 
 let incoming ofs = Incoming ofs
 let outgoing ofs = Outgoing ofs
index 37bcca23f68e45e8f4bfea6181e2fbc97c01d038..37b03de33b2401637bfcffcb0df8641bedc9b453 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: i386.S,v 1.43.4.2 2006/03/29 14:49:19 doligez Exp $ */
+/* $Id: i386.S,v 1.43.4.3 2006/07/14 08:53:50 xleroy Exp $ */
 
 /* Asm part of the runtime system, Intel 386 processor */
 /* Must be preprocessed by cpp */
@@ -89,6 +89,7 @@ LBL(105):
         pushl   %ebx
         pushl   %eax
         movl    %esp, G(caml_gc_regs)
+        /* MacOSX note: 16-alignment of stack preserved at this point */
     /* Call the garbage collector */
         call    G(caml_garbage_collection)
     /* Restore all regs used by the code generator */
@@ -116,7 +117,13 @@ LBL(100):
         movl    %eax, G(caml_last_return_address)
         leal    4(%esp), %eax
         movl    %eax, G(caml_bottom_of_stack)
+#ifdef SYS_macosx
+        subl    $12, %esp       /* 16-alignment */
+#endif
         call    LBL(105)
+#ifdef SYS_macosx
+        addl    $12, %esp       /* undo 16-alignment */
+#endif
         jmp     G(caml_alloc1)
 
         .align  FUNCTION_ALIGN
@@ -133,7 +140,13 @@ LBL(101):
         movl    %eax, G(caml_last_return_address)
         leal    4(%esp), %eax
         movl    %eax, G(caml_bottom_of_stack)
+#ifdef SYS_macosx
+        subl    $12, %esp       /* 16-alignment */
+#endif
         call    LBL(105)
+#ifdef SYS_macosx
+        addl    $12, %esp       /* undo 16-alignment */
+#endif
         jmp     G(caml_alloc2)
 
         .align  FUNCTION_ALIGN
@@ -150,7 +163,13 @@ LBL(102):
         movl    %eax, G(caml_last_return_address)
         leal    4(%esp), %eax
         movl    %eax, G(caml_bottom_of_stack)
+#ifdef SYS_macosx
+        subl    $12, %esp       /* 16-alignment */
+#endif
         call    LBL(105)
+#ifdef SYS_macosx
+        addl    $12, %esp       /* undo 16-alignment */
+#endif
         jmp     G(caml_alloc3)
 
         .align  FUNCTION_ALIGN
@@ -171,7 +190,13 @@ LBL(103):
         movl    %eax, G(caml_last_return_address)
         leal    8(%esp), %eax
         movl    %eax, G(caml_bottom_of_stack)
+#ifdef SYS_macosx
+        subl    $8, %esp       /* 16-alignment */
+#endif
         call    LBL(105)
+#ifdef SYS_macosx
+        addl    $8, %esp       /* undo 16-alignment */
+#endif
         popl    %eax                    /* recover desired size */
         jmp     G(caml_allocN)
 
index 07fe99bd200481574a701fdab69ed624ae167fc4..448956496329557d55468246a0ca555d3a48e748 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: signals.c,v 1.93.2.1 2006/03/22 13:13:45 xleroy Exp $ */
+/* $Id: signals.c,v 1.93.2.2 2006/08/01 01:02:07 xleroy Exp $ */
 
 #if defined(TARGET_amd64) && defined (SYS_linux)
 #define _GNU_SOURCE
@@ -152,9 +152,6 @@ void caml_record_signal(int signal_number)
 
 void caml_garbage_collection(void)
 {
-  int signal_number;
-  intnat signal_state;
-
   caml_young_limit = caml_young_start;
   if (caml_young_ptr < caml_young_start || caml_force_major_slice) {
     caml_minor_collection();
index 159483667a967dc93ef4911d2b01640b80b43153..e35f03e8979b1303a9619fc6700467581d4028d9 100755 (executable)
Binary files a/boot/ocamlc and b/boot/ocamlc differ
index 937f6b8fd841de8debf7bec81646ad2c595ab7cf..f78a1e3c58b48c847bf82088aae5902e56204c23 100755 (executable)
Binary files a/boot/ocamllex and b/boot/ocamllex differ
index 51a8a2237bfb2be67653454b246ba692a307e3d0..496bf606f6e9d80574fdf5686c9b332ce57614e2 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: extern.c,v 1.58.2.1 2005/11/22 11:50:34 doligez Exp $ */
+/* $Id: extern.c,v 1.58.2.2 2006/06/10 09:02:40 xleroy Exp $ */
 
 /* Structured output */
 
@@ -536,17 +536,23 @@ CAMLprim value caml_output_value_to_string(value v, value flags)
 {
   intnat len, ofs;
   value res;
-  struct output_block * blk;
+  struct output_block * blk, * nextblk;
 
   init_extern_output();
   len = extern_value(v, flags);
+  /* PR#4030: it is prudent to save extern_output_first before allocating
+     the result, as in caml_output_val */
+  blk = extern_output_first;
   res = caml_alloc_string(len);
-  for (ofs = 0, blk = extern_output_first; blk != NULL; blk = blk->next) {
+  ofs = 0;
+  while (blk != NULL) {
     int n = blk->end - blk->data;
     memmove(&Byte(res, ofs), blk->data, n);
     ofs += n;
+    nextblk = blk->next;
+    free(blk);
+    blk = nextblk;
   }
-  free_extern_output();
   return res;
 }
 
index abf05fab911fd751b3b1fb26b3c5e6d3326f6407..4139a7ee347e041100a7f3b5471fcb0cb193632b 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: io.c,v 1.72.2.1 2006/03/22 12:59:58 doligez Exp $ */
+/* $Id: io.c,v 1.72.2.2 2006/06/08 14:57:59 xleroy Exp $ */
 
 /* Buffered input/output. */
 
@@ -534,7 +534,7 @@ CAMLprim value caml_ml_flush_partial(value vchannel)
   struct channel * channel = Channel(vchannel);
   int res;
 
-  if (channel->fd == -1) return Val_true;
+  if (channel->fd == -1) CAMLreturn (Val_true);
   Lock(channel);
   res = caml_flush_partial(channel);
   Unlock(channel);
@@ -546,7 +546,7 @@ CAMLprim value caml_ml_flush(value vchannel)
   CAMLparam1 (vchannel);
   struct channel * channel = Channel(vchannel);
 
-  if (channel->fd == -1) return Val_unit;
+  if (channel->fd == -1) CAMLreturn (Val_unit);
   Lock(channel);
   caml_flush(channel);
   Unlock(channel);
index 2da71d4d5837be51e489c0ec611551e299498a33..9a65e39e612bcf4efaf6a4db6e133324843ef32a 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: memory.h,v 1.54 2005/10/14 16:40:48 xleroy Exp $ */
+/* $Id: memory.h,v 1.54.2.3 2006/07/25 09:13:16 doligez Exp $ */
 
 /* Allocation macros and functions */
 
@@ -278,8 +278,9 @@ CAMLextern struct caml__roots_block *caml_local_roots;  /* defined in roots.c */
 }while (0)
 
 #define CAMLreturn(result) do{ \
+  value caml__temp_result = (result); \
   caml_local_roots = caml__frame; \
-  return (result); \
+  return (caml__temp_result); \
 }while(0)
 
 #define CAMLnoreturn ((void) caml__frame)
index 7715e292160ee5e3756f4cf7d805a1a941a5d71e..db84665a43277c15e7a5b2d86cc3441bef16d315 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: sys.c,v 1.78.2.1 2005/11/09 15:58:03 doligez Exp $ */
+/* $Id: sys.c,v 1.78.2.2 2006/08/30 09:37:57 doligez Exp $ */
 
 /* Basic system calls */
 
@@ -311,7 +311,10 @@ CAMLprim value caml_sys_read_directory(value path)
   struct ext_table tbl;
 
   caml_ext_table_init(&tbl, 50);
-  if (caml_read_directory(String_val(path), &tbl) == -1) caml_sys_error(path);
+  if (caml_read_directory(String_val(path), &tbl) == -1){
+    caml_ext_table_free(&tbl, 1);
+    caml_sys_error(path);
+  }
   caml_ext_table_add(&tbl, NULL);
   result = caml_copy_string_array((char const **) tbl.contents);
   caml_ext_table_free(&tbl, 1);
index 2d366ed27cef2efde96a78f1232acc6787ea29f1..f5104211349eba5ae3b86147389050822f6d9d9e 100644 (file)
@@ -11,7 +11,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile.msvc,v 1.14 2005/08/01 15:51:09 xleroy Exp $
+# $Id: Makefile.msvc,v 1.14.2.2 2006/07/27 16:10:37 xleroy Exp $
 
 # Configuration for Windows, Visual C++ compiler
 
@@ -45,7 +45,7 @@ EXE=.exe
 ########## Configuration for the bytecode compiler
 
 ### Which C compiler to use for the bytecode interpreter.
-BYTECC=cl /nologo
+BYTECC=cl /nologo -D_CRT_SECURE_NO_DEPRECATE
 
 ### Additional compile-time options for $(BYTECC).  (For static linking.)
 BYTECCCOMPOPTS=/Ox /MT
@@ -67,7 +67,7 @@ CPP=cl /nologo /EP
 MKDLL=link /nologo /dll /out:$(1) /implib:$(2) $(3)
 
 ### How to build a static library
-MKLIB=link /lib /nologo /debugtype:CV /out:$(1) $(2)
+MKLIB=link /lib /nologo /out:$(1) $(2)
 
 ### Canonicalize the name of a system library
 SYSLIB=$(1).lib
@@ -87,7 +87,7 @@ MODEL=default
 SYSTEM=win32
 
 ### Which C compiler to use for the native-code compiler.
-NATIVECC=cl /nologo
+NATIVECC=cl /nologo -D_CRT_SECURE_NO_DEPRECATE
 
 ### Additional compile-time options for $(NATIVECC).
 NATIVECCCOMPOPTS=/Ox /MT
@@ -96,7 +96,7 @@ NATIVECCCOMPOPTS=/Ox /MT
 NATIVECCLINKOPTS=/MT
 
 ### Build partially-linked object file
-PARTIALLD=lib /nologo /debugtype:cv
+PARTIALLD=lib /nologo
 PACKLD=ld -r --oformat pe-i386
 
 ############# Configuration for the contributed libraries
index 5f67b0cf44f597e469ea597d9278049a7e1f82c8..77f100de421fba585711ceffab5e21ac2b279e55 100644 (file)
@@ -1,9 +1,27 @@
 TODO:
  - need to fix display of type parameters for inherited classes/class types
+ - need to add an environment while generating to print correct links:
+   file foo.mli:
+     type u
+     module type M = sig type u end
+     module N : sig include M val f: u -> unit end
+   Here, in html for example, f in displayed being of type Foo.u instead of Foo.M.u
  - latex: types variant polymorphes dépassent de la page quand ils sont trop longs
  - utilisation nouvelles infos de Xavier: "début de rec", etc.
  - xml generator
 
+=====
+Release 3.09.3:
+- mod: PR#4017 new option -short-functors to use a short form to display
+  functors in html generator
+- fix: PR#4016 (using modtype constraint to filter module elements displayed in doc)
+- fix: PR#4066 (missing crossref in text from intro files)
+- fix: PR#4007 (error in merging of top dependencies of modules)
+- fix: PR#3981 (-dot-colors has no effect)
+- mod: name resolution in cross-referencing: {!name} if name is not
+  found, then it is searched in the parent module/class, and in the parent
+  of the parent, and so on until it is found.
+
 =====
 Release 3.09.1:
  - fix: remove .TP for generated man pages, use .sp instead
index c2b2dbe87dbbfc3b3ce36d0705599aefa77b6ddb..af563710c1c3cb70a64af3f24a2ef037463c9444 100644 (file)
@@ -9,7 +9,7 @@
 #(*                                                                     *)
 #(***********************************************************************)
 
-# $Id: Makefile,v 1.60.2.2 2005/11/10 14:44:36 guesdon Exp $
+# $Id: Makefile,v 1.60.2.5 2006/08/10 12:45:09 guesdon Exp $
 
 include ../config/Makefile
 
@@ -93,7 +93,6 @@ CMOFILES= odoc_config.cmo \
        odoc_parser.cmo\
        odoc_lexer.cmo\
        odoc_see_lexer.cmo\
-       odoc_comments.cmo\
        odoc_env.cmo\
        odoc_merge.cmo\
        odoc_sig.cmo\
@@ -103,6 +102,7 @@ CMOFILES= odoc_config.cmo \
        odoc_search.cmo\
        odoc_scan.cmo\
        odoc_cross.cmo\
+       odoc_comments.cmo\
        odoc_dep.cmo\
        odoc_analyse.cmo\
        odoc_info.cmo
@@ -211,6 +211,10 @@ $(OCAMLDOC_LIBCMXA): $(LIBCMXFILES)
 
 manpages: stdlib_man/Pervasives.3o
 
+dot: $(EXECMOFILES) odoc.cmo
+       $(OCAMLDOC_RUN) -dot -dot-reduce -o ocamldoc.dot $(INCLUDES) \
+       odoc*.ml
+
 # Parsers and lexers dependencies :
 ###################################
 odoc_text_parser.ml: odoc_text_parser.mly
index 9dc20fb6db88c28d593f513d728d2d5f9b61368b..b55aa7f8d7e0389c5fda9ef3d4974b7360fe3068 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc.ml,v 1.8 2004/07/13 12:25:11 xleroy Exp $ *)
+(* $Id: odoc.ml,v 1.8.4.1 2006/05/02 12:15:39 guesdon Exp $ *)
 
 (** Main module for bytecode. *)
 
@@ -21,7 +21,7 @@ open Typedtree
 
 module M = Odoc_messages
 
-let print_DEBUG s = print_string s ; print_newline () 
+let print_DEBUG s = print_string s ; print_newline ()
 
 (* we check if we must load a module given on the command line *)
 let arg_list = Array.to_list Sys.argv
@@ -42,7 +42,7 @@ let (cmo_or_cma_opt, paths) =
 
 let _ = print_DEBUG "Fin analyse des arguments pour le dynamic load"
 
-(** Return the real name of the file to load, 
+(** Return the real name of the file to load,
    searching it in the paths if it is
    a simple name and not in the current directory. *)
 let get_real_filename name =
@@ -74,16 +74,16 @@ let _ =
         let real_file = get_real_filename file in
         ignore(Dynlink.loadfile real_file)
       with
-        Dynlink.Error e -> 
+        Dynlink.Error e ->
           prerr_endline (Odoc_messages.load_file_error file (Dynlink.error_message e)) ;
           exit 1
       | Not_found ->
           prerr_endline (Odoc_messages.load_file_error file "Not_found");
-          exit 1  
+          exit 1
       | Sys_error s
       |        Failure s ->
           prerr_endline (Odoc_messages.load_file_error file s);
-          exit 1  
+          exit 1
 
 let _ = print_DEBUG "Fin du chargement dynamique Ã©ventuel"
 
@@ -101,16 +101,16 @@ let _ = Odoc_args.parse
 
 
 let loaded_modules =
-  List.flatten 
-    (List.map 
+  List.flatten
+    (List.map
        (fun f ->
          Odoc_info.verbose (Odoc_messages.loading f);
-         try 
+         try
            let l = Odoc_analyse.load_modules f in
            Odoc_info.verbose Odoc_messages.ok;
            l
-         with Failure s -> 
-           prerr_endline s ; 
+         with Failure s ->
+           prerr_endline s ;
            incr Odoc_global.errors ;
            []
        )
@@ -124,20 +124,20 @@ let _ =
     None -> ()
   | Some f ->
       try Odoc_analyse.dump_modules f modules
-      with Failure s -> 
+      with Failure s ->
         prerr_endline s ;
         incr Odoc_global.errors
 
-let _ = 
+let _ =
   match !Odoc_args.doc_generator with
     None ->
       ()
-  | Some gen -> 
+  | Some gen ->
       Odoc_info.verbose Odoc_messages.generating_doc;
       gen#generate modules;
       Odoc_info.verbose Odoc_messages.ok
 
-let _ = 
+let _ =
   if !Odoc_global.errors > 0 then
   (
    prerr_endline (Odoc_messages.errors_occured !Odoc_global.errors) ;
@@ -145,6 +145,6 @@ let _ =
   )
   else
     exit 0
-  
 
-(* eof $Id: odoc.ml,v 1.8 2004/07/13 12:25:11 xleroy Exp $ *)
+
+(* eof $Id: odoc.ml,v 1.8.4.1 2006/05/02 12:15:39 guesdon Exp $ *)
index a1978cfadfea0b27811aabc1cd2eadaaf6926bfc..87df0335693d08d6c046dca8d6198d846f73db7e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* cvsid $Id: odoc_args.ml,v 1.18.4.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* cvsid $Id: odoc_args.ml,v 1.18.4.2 2006/08/10 12:34:02 guesdon Exp $ *)
 
 (** Command-line arguments. *)
 
@@ -124,6 +124,8 @@ let index_only = ref false
 
 let colorize_code = ref false
 
+let html_short_functors = ref false
+
 let with_header = ref true
 
 let with_trailer = ref true
@@ -256,7 +258,8 @@ let options = ref [
   "-all-params", Arg.Set with_parameter_list, M.with_parameter_list ;
   "-css-style", Arg.String (fun s -> css_style := Some s), M.css_style ;
   "-index-only", Arg.Set index_only, M.index_only ;
-  "-colorize-code", Arg.Set colorize_code, M.colorize_code ^
+  "-colorize-code", Arg.Set colorize_code, M.colorize_code ;
+  "-short-functors", Arg.Set html_short_functors, M.html_short_functors ^
   "\n\n *** LaTeX options ***\n";
 
 (* latex only options *)
index 583c49802b9a2b51d8b1404345e813d0bd29f896..43e880c3fab366ea2c9cf116d5c4012e05bd1da6 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_args.mli,v 1.14.4.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* $Id: odoc_args.mli,v 1.14.4.2 2006/08/10 12:34:02 guesdon Exp $ *)
 
 (** Analysis of the command line arguments. *)
 
@@ -94,6 +94,10 @@ val index_only : bool ref
 (** To colorize code in HTML generated documentation pages, not code pages. *)
 val colorize_code : bool ref
 
+(** To display functors in short form rather than with "functor ... -> ",
+   in HTML generated documentation. *)
+val html_short_functors : bool ref
+
 (** The flag which indicates if we must generate a header (for LaTeX). *)
 val with_header : bool ref
 
index 09edb003ab44224100ddbb85dae61b68cbcaad01..ef5bc28976ff0a1bdd9fa35590319ed6994fd02b 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_ast.ml,v 1.26.4.1 2005/11/10 14:44:36 guesdon Exp $ *)
+(* $Id: odoc_ast.ml,v 1.26.4.3 2006/08/10 11:29:54 guesdon Exp $ *)
 
 (** Analysis of implementation files. *)
 open Misc
@@ -33,10 +33,10 @@ open Odoc_types
 
 (** This variable contains the regular expression representing a blank.*)
 let blank = "[ \010\013\009\012']"
+
 (** This variable contains the regular expression representing a blank but not a '\n'.*)
 let simple_blank = "[ \013\009\012]"
 
-
 (** This module is used to search for structure items by name in a Typedtree.structure.
    One function creates two hash tables, which can then be used to search for elements.
    Class elements do not use tables.
@@ -849,6 +849,94 @@ module Analyser =
       in
       f (module_elements, included_modules)
 
+    (** This function removes the elements of the module which does not
+       belong to the given module type, if the module type is expanded
+       and the module has a "structure" kind. *)
+    let rec filter_module_with_module_type_constraint m mt =
+      match m.m_kind, mt with
+       Module_struct l, Types.Tmty_signature lsig ->
+          m.m_kind <- Module_struct (filter_module_elements_with_module_type_constraint l lsig);
+         m.m_type <- mt;
+      | _ -> ()
+
+    (** This function removes the elements of the module type which does not
+       belong to the given module type, if the module type is expanded
+       and the module type has a "structure" kind. *)
+    and filter_module_type_with_module_type_constraint mtyp mt =
+      match mtyp.mt_kind, mt with
+       Some Module_type_struct l, Types.Tmty_signature lsig ->
+          mtyp.mt_kind <- Some (Module_type_struct (filter_module_elements_with_module_type_constraint l lsig));
+         mtyp.mt_type <- Some mt;
+      | _ -> ()
+
+    and filter_module_elements_with_module_type_constraint l lsig =
+      let pred ele =
+        let f = match ele with
+          Element_module m ->
+           (function
+                Types.Tsig_module (ident,t,_) ->
+                  let n1 = Name.simple m.m_name
+                  and n2 = Ident.name ident in
+                  (
+                   match n1 = n2 with
+                     true -> filter_module_with_module_type_constraint m t; true
+                   | false -> false
+                  )
+              | _ -> false)
+       | Element_module_type mt ->
+           (function
+                Types.Tsig_modtype (ident,Types.Tmodtype_manifest t) ->
+                  let n1 = Name.simple mt.mt_name
+                  and n2 = Ident.name ident in
+                  (
+                   match n1 = n2 with
+                     true -> filter_module_type_with_module_type_constraint mt t; true
+                   | false -> false
+                  )
+              | _ -> false)
+       | Element_value v ->
+           (function
+                Types.Tsig_value (ident,_) ->
+                  let n1 = Name.simple v.val_name
+                  and n2 = Ident.name ident in
+                  n1 = n2
+              | _ -> false)
+       | Element_type t ->
+            (function
+                Types.Tsig_type (ident,_,_) ->
+                 (* A VOIR: il est possible que le détail du type soit caché *)
+                  let n1 = Name.simple t.ty_name
+                  and n2 = Ident.name ident in
+                  n1 = n2
+               | _ -> false)
+       | Element_exception e ->
+           (function
+                Types.Tsig_exception (ident,_) ->
+                  let n1 = Name.simple e.ex_name
+                  and n2 = Ident.name ident in
+                  n1 = n2
+              | _ -> false)
+       | Element_class c ->
+           (function
+                Types.Tsig_class (ident,_,_) ->
+                  let n1 = Name.simple c.cl_name
+                  and n2 = Ident.name ident in
+                  n1 = n2
+              | _ -> false)
+       | Element_class_type ct ->
+           (function
+                Types.Tsig_cltype (ident,_,_) ->
+                  let n1 = Name.simple ct.clt_name
+                  and n2 = Ident.name ident in
+                  n1 = n2
+              | _ -> false)
+        | Element_module_comment _ -> fun _ -> true
+       | Element_included_module _ -> fun _ -> true
+        in
+        List.exists f lsig
+      in
+      List.filter pred l
+
     (** Analysis of a parse tree structure with a typed tree, to return module elements.*)
     let rec analyse_structure env current_module_name last_pos pos_limit parsetree typedtree =
       print_DEBUG "Odoc_ast:analyse_struture";
@@ -1162,7 +1250,7 @@ module Analyser =
           )
 
       | Parsetree.Pstr_recmodule mods ->
-         (* A VOIR ICI ca merde avec /work/tmp/graph.ml: pas de lien avec les module type
+         (* A VOIR ICI pb: pas de lien avec les module type
             dans les contraintes sur les modules *)
          let new_env =
             List.fold_left
@@ -1481,11 +1569,6 @@ module Analyser =
       | (Parsetree.Pmod_constraint (p_module_expr2, p_modtype),
          Typedtree.Tmod_constraint (tt_module_expr2, tt_modtype, _)) ->
          print_DEBUG ("Odoc_ast: case Parsetree.Pmod_constraint + Typedtree.Tmod_constraint "^module_name);
-
-          (* we create the module with p_module_expr2 and tt_module_expr2
-             but we change its type according to the constraint.
-             A VOIR : est-ce que c'est bien ?
-          *)
           let m_base2 = analyse_module
               env
               current_module_name
@@ -1494,20 +1577,16 @@ module Analyser =
               p_module_expr2
               tt_module_expr2
           in
-          let mtkind = Sig.analyse_module_type_kind
-              env
+          let mtkind = Sig.analyse_module_type_kind env
               (Name.concat current_module_name "??")
               p_modtype tt_modtype
           in
+         let tt_modtype = Odoc_env.subst_module_type env tt_modtype in
+         filter_module_with_module_type_constraint m_base2 tt_modtype;
           {
             m_base with
-            m_type = Odoc_env.subst_module_type env tt_modtype ;
-            m_kind = Module_constraint (m_base2.m_kind,
-                                        mtkind)
-
-(*                                      Module_type_alias { mta_name = "Not analyzed" ;
-                                                            mta_module = None })
-*)
+            m_type = tt_modtype ;
+            m_kind = Module_constraint (m_base2.m_kind, mtkind) ;
           }
 
       | (Parsetree.Pmod_structure p_structure,
@@ -1593,4 +1672,4 @@ module Analyser =
 
 
 
-(* eof $Id: odoc_ast.ml,v 1.26.4.1 2005/11/10 14:44:36 guesdon Exp $ *)
+(* eof $Id: odoc_ast.ml,v 1.26.4.3 2006/08/10 11:29:54 guesdon Exp $ *)
index 137cbed3663734c72a0a0a18d7dffd81ca112a07..01a3638054f9ba4ba69a4f97ca135fb4927b90f3 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_comments.ml,v 1.4.12.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* $Id: odoc_comments.ml,v 1.4.12.2 2006/07/31 14:19:35 guesdon Exp $ *)
 
 (** Analysis of comments. *)
 
@@ -333,12 +333,13 @@ let info_of_string s =
     None -> dummy
   | Some i -> i
 
-let info_of_comment_file f =
+let info_of_comment_file modlist f =
   try
     let s = Odoc_misc.input_file_as_string f in
-    info_of_string s
+    let i = info_of_string s in
+    Odoc_cross.assoc_comments_info "" modlist i
   with
     Sys_error s ->
       failwith s
 
-(* eof $Id: odoc_comments.ml,v 1.4.12.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* eof $Id: odoc_comments.ml,v 1.4.12.2 2006/07/31 14:19:35 guesdon Exp $ *)
index d9bf2a7dd5a35fd01b1547cd2e224c41cb4263e4..63362192dd6493b8e8268b7357a34dfefa76dea6 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_comments.mli,v 1.3.12.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* $Id: odoc_comments.mli,v 1.3.12.2 2006/07/31 14:19:35 guesdon Exp $ *)
 
 (** Analysis of comments. *)
 
@@ -66,7 +66,9 @@ val info_of_string : string -> Odoc_types.info
 (** [info_of_comment_file file] parses the given file
    and return an {!Odoc_types.info} structure. The content of the
    file must have the same syntax as the content of a special comment.
+   The given module list is used for cross reference.
    @raise Failure is the file could not be opened or there is a
    syntax error.
 *)
-val info_of_comment_file : string -> Odoc_types.info
+val info_of_comment_file :
+    Odoc_module.t_module list -> string -> Odoc_types.info
index fca4684223b33f567bb297f0923d1a6cbfc5caa2..eb77f97c643fe9fcdf68435d9e08822f598b39dc 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_cross.ml,v 1.15.10.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* $Id: odoc_cross.ml,v 1.15.10.3 2006/05/03 15:00:24 guesdon Exp $ *)
 
 (** Cross referencing. *)
 
@@ -169,7 +169,7 @@ let add_known_element name k =
     Not_found ->
       known_elements := Ele_map.add name [k] !known_elements
 
-let get_known_elements name =
+let rec get_known_elements name =
   try Ele_map.find name !known_elements
   with Not_found -> []
 
@@ -576,118 +576,165 @@ and associate_in_class_type module_list (acc_b_modif, acc_incomplete_top_module_
 
 let ao = Odoc_misc.apply_opt
 
-let rec assoc_comments_text_elements module_list t_ele =
+let not_found_of_kind kind name =
+  (match kind with
+    RK_module -> Odoc_messages.cross_module_not_found
+  | RK_module_type -> Odoc_messages.cross_module_type_not_found
+  | RK_class -> Odoc_messages.cross_class_not_found
+  | RK_class_type -> Odoc_messages.cross_class_type_not_found
+  | RK_value -> Odoc_messages.cross_value_not_found
+  | RK_type -> Odoc_messages.cross_type_not_found
+  | RK_exception -> Odoc_messages.cross_exception_not_found
+  | RK_attribute -> Odoc_messages.cross_attribute_not_found
+  | RK_method -> Odoc_messages.cross_method_not_found
+  | RK_section _ -> Odoc_messages.cross_section_not_found
+  ) name
+
+let rec assoc_comments_text_elements parent_name module_list t_ele =
   match t_ele with
   | Raw _
   | Code _
   | CodePre _
   | Latex _
   | Verbatim _ -> t_ele
-  | Bold t -> Bold (assoc_comments_text module_list t)
-  | Italic t -> Italic (assoc_comments_text module_list t)
-  | Center t -> Center (assoc_comments_text module_list t)
-  | Left t -> Left (assoc_comments_text module_list t)
-  | Right t -> Right (assoc_comments_text module_list t)
-  | Emphasize t -> Emphasize (assoc_comments_text module_list t)
-  | List l -> List (List.map (assoc_comments_text module_list) l)
-  | Enum l -> Enum (List.map (assoc_comments_text module_list) l)
+  | Bold t -> Bold (assoc_comments_text parent_name module_list t)
+  | Italic t -> Italic (assoc_comments_text parent_name module_list t)
+  | Center t -> Center (assoc_comments_text parent_name module_list t)
+  | Left t -> Left (assoc_comments_text parent_name module_list t)
+  | Right t -> Right (assoc_comments_text parent_name module_list t)
+  | Emphasize t -> Emphasize (assoc_comments_text parent_name module_list t)
+  | List l -> List (List.map (assoc_comments_text parent_name module_list) l)
+  | Enum l -> Enum (List.map (assoc_comments_text parent_name module_list) l)
   | Newline -> Newline
-  | Block t -> Block (assoc_comments_text module_list t)
-  | Superscript t -> Superscript (assoc_comments_text module_list t)
-  | Subscript t -> Subscript (assoc_comments_text module_list t)
-  | Title (n, l_opt, t) -> Title (n, l_opt, (assoc_comments_text module_list t))
-  | Link (s, t) -> Link (s, (assoc_comments_text module_list t))
-  | Ref (name, None) ->
+  | Block t -> Block (assoc_comments_text parent_name module_list t)
+  | Superscript t -> Superscript (assoc_comments_text parent_name module_list t)
+  | Subscript t -> Subscript (assoc_comments_text parent_name module_list t)
+  | Title (n, l_opt, t) -> Title (n, l_opt, (assoc_comments_text parent_name module_list t))
+  | Link (s, t) -> Link (s, (assoc_comments_text parent_name module_list t))
+  | Ref (initial_name, None) ->
       (
-       match get_known_elements name with
-        [] ->
-          (
-           try
-             let re = Str.regexp ("^"^(Str.quote name)^"$") in
-             let t = Odoc_search.find_section module_list re in
-             let v2 = (name, Some (RK_section t)) in
-             add_verified v2 ;
-             Ref (name, Some (RK_section t))
-           with
-             Not_found ->
-               Odoc_messages.pwarning (Odoc_messages.cross_element_not_found name);
-               Ref (name, None)
-          )
-       | ele :: _ ->
+       let rec iter_parent ?parent_name name =
+        let res =
+          match get_known_elements name with
+            [] ->
+              (
+               try
+                 let re = Str.regexp ("^"^(Str.quote name)^"$") in
+                 let t = Odoc_search.find_section module_list re in
+                 let v2 = (name, Some (RK_section t)) in
+                 add_verified v2 ;
+                 (name, Some (RK_section t))
+             with
+                 Not_found ->
+                   (name, None)
+              )
+          | ele :: _ ->
           (* we look for the first element with this name *)
-           let kind =
-             match ele with
-               Odoc_search.Res_module _ -> RK_module
-             | Odoc_search.Res_module_type _ -> RK_module_type
-             | Odoc_search.Res_class _ -> RK_class
-             | Odoc_search.Res_class_type _ -> RK_class_type
-             | Odoc_search.Res_value _ -> RK_value
-             | Odoc_search.Res_type _ -> RK_type
-             | Odoc_search.Res_exception _ -> RK_exception
-             | Odoc_search.Res_attribute _ -> RK_attribute
-             | Odoc_search.Res_method _ -> RK_method
-             | Odoc_search.Res_section (_ ,t)-> assert false
-           in
-           add_verified (name, Some kind) ;
-          Ref (name, Some kind)
+               let (name, kind) =
+                match ele with
+                  Odoc_search.Res_module m -> (m.m_name, RK_module)
+                | Odoc_search.Res_module_type mt -> (mt.mt_name, RK_module_type)
+                | Odoc_search.Res_class c -> (c.cl_name, RK_class)
+                | Odoc_search.Res_class_type ct -> (ct.clt_name, RK_class_type)
+                | Odoc_search.Res_value v -> (v.val_name, RK_value)
+                | Odoc_search.Res_type t -> (t.ty_name, RK_type)
+                | Odoc_search.Res_exception e -> (e.ex_name, RK_exception)
+                | Odoc_search.Res_attribute a -> (a.att_value.val_name, RK_attribute)
+                | Odoc_search.Res_method m -> (m.met_value.val_name, RK_method)
+                | Odoc_search.Res_section (_ ,t)-> assert false
+               in
+               add_verified (name, Some kind) ;
+              (name, Some kind)
+        in
+        match res with
+        | (name, Some k) -> Ref (name, Some k)
+        | (_, None) ->
+            match parent_name with
+              None ->
+                Odoc_messages.pwarning (Odoc_messages.cross_element_not_found initial_name);
+                Ref (initial_name, None)
+            | Some p ->
+                let parent_name =
+                  match Name.father p with
+                    "" -> None
+                  | s -> Some s
+                in
+                iter_parent ?parent_name (Name.concat p initial_name)
+       in
+       iter_parent ~parent_name initial_name
       )
-  | Ref (name, Some kind) ->
+  | Ref (initial_name, Some kind) ->
       (
-       let v = (name, Some kind) in
-       if was_verified v then
-        Ref (name, Some kind)
-       else
-        match kind with
-        | RK_section _ ->
-            (
-              (** we just verify that we find an element of this kind with this name *)
-             try
-               let re = Str.regexp ("^"^(Str.quote name)^"$") in
-               let t = Odoc_search.find_section module_list re in
-               let v2 = (name, Some (RK_section t)) in
-               add_verified v2 ;
-               Ref (name, Some (RK_section t))
-             with
-               Not_found ->
-                 Odoc_messages.pwarning (Odoc_messages.cross_section_not_found name);
-                 Ref (name, None)
-            )
-        | _ ->
-            let (f,f_mes) =
-              match kind with
-                RK_module -> module_exists, Odoc_messages.cross_module_not_found
-              | RK_module_type -> module_type_exists, Odoc_messages.cross_module_type_not_found
-              | RK_class -> class_exists, Odoc_messages.cross_class_not_found
-              | RK_class_type -> class_type_exists, Odoc_messages.cross_class_type_not_found
-              | RK_value -> value_exists, Odoc_messages.cross_value_not_found
-              | RK_type -> type_exists, Odoc_messages.cross_type_not_found
-              | RK_exception -> exception_exists, Odoc_messages.cross_exception_not_found
-              | RK_attribute -> attribute_exists, Odoc_messages.cross_attribute_not_found
-              | RK_method -> method_exists, Odoc_messages.cross_method_not_found
-              | RK_section _ -> assert false
-            in
-            if f name then
-              (
-               add_verified v ;
-               Ref (name, Some kind)
-              )
-            else
-              (
-               Odoc_messages.pwarning (f_mes name);
-               Ref (name, None)
-              )
+       let rec iter_parent ?parent_name name =
+        let v = (name, Some kind) in
+        if was_verified v then
+          Ref (name, Some kind)
+        else
+          let res =
+            match kind with
+            | RK_section _ ->
+                (
+                 (** we just verify that we find an element of this kind with this name *)
+                 try
+                   let re = Str.regexp ("^"^(Str.quote name)^"$") in
+                   let t = Odoc_search.find_section module_list re in
+                   let v2 = (name, Some (RK_section t)) in
+                   add_verified v2 ;
+                   (name, Some (RK_section t))
+                 with
+                   Not_found ->
+                     (name, None)
+                )
+            | _ ->
+                let f =
+                  match kind with
+                    RK_module -> module_exists
+                  | RK_module_type -> module_type_exists
+                  | RK_class -> class_exists
+                  | RK_class_type -> class_type_exists
+                  | RK_value -> value_exists
+                  | RK_type -> type_exists
+                  | RK_exception -> exception_exists
+                  | RK_attribute -> attribute_exists
+                  | RK_method -> method_exists
+                  | RK_section _ -> assert false
+                in
+                if f name then
+                  (
+                   add_verified v ;
+                   (name, Some kind)
+                  )
+                else
+                  (name, None)
+          in
+          match res with
+          | (name, Some k) -> Ref (name, Some k)
+          | (_, None) ->
+              match parent_name with
+                None ->
+                  Odoc_messages.pwarning (not_found_of_kind kind initial_name);
+                  Ref (initial_name, None)
+              | Some p ->
+                  let parent_name =
+                    match Name.father p with
+                      "" -> None
+                    | s -> Some s
+                  in
+                  iter_parent ?parent_name (Name.concat p initial_name)
+       in
+       iter_parent ~parent_name initial_name
       )
   | Module_list l ->
       Module_list l
   | Index_list ->
       Index_list
-  | Custom (s,t) -> Custom (s, (assoc_comments_text module_list t))
+  | Custom (s,t) -> Custom (s, (assoc_comments_text parent_name module_list t))
 
-and assoc_comments_text module_list text =
-  List.map (assoc_comments_text_elements module_list) text
+and assoc_comments_text parent_name module_list text =
+  List.map (assoc_comments_text_elements parent_name module_list) text
 
-and assoc_comments_info module_list i =
-  let ft = assoc_comments_text module_list in
+and assoc_comments_info parent_name module_list i =
+  let ft = assoc_comments_text parent_name module_list in
   {
     i with
     i_desc = ao ft i.i_desc ;
@@ -700,133 +747,155 @@ and assoc_comments_info module_list i =
   }
 
 
-let rec assoc_comments_module_element module_list m_ele =
+let rec assoc_comments_module_element parent_name module_list m_ele =
   match m_ele with
-    Element_module m -> Element_module (assoc_comments_module module_list m)
-  | Element_module_type mt -> Element_module_type (assoc_comments_module_type module_list mt)
-  | Element_included_module _ -> m_ele (* don't go down into the aliases *)
-  | Element_class c -> Element_class (assoc_comments_class module_list c)
-  | Element_class_type ct -> Element_class_type (assoc_comments_class_type module_list ct)
-  | Element_value v -> Element_value (assoc_comments_value module_list v)
-  | Element_exception e -> Element_exception (assoc_comments_exception module_list e)
-  | Element_type t -> Element_type (assoc_comments_type module_list t)
-  | Element_module_comment t -> Element_module_comment (assoc_comments_text module_list t)
-
-and assoc_comments_class_element module_list c_ele =
+    Element_module m ->
+      Element_module (assoc_comments_module module_list m)
+  | Element_module_type mt ->
+      Element_module_type (assoc_comments_module_type module_list mt)
+  | Element_included_module _ ->
+      m_ele (* don't go down into the aliases *)
+  | Element_class c ->
+      Element_class (assoc_comments_class module_list c)
+  | Element_class_type ct ->
+      Element_class_type (assoc_comments_class_type module_list ct)
+  | Element_value v ->
+      Element_value (assoc_comments_value module_list v)
+  | Element_exception e ->
+      Element_exception (assoc_comments_exception module_list e)
+  | Element_type t ->
+      Element_type (assoc_comments_type module_list t)
+  | Element_module_comment t ->
+      Element_module_comment (assoc_comments_text parent_name module_list t)
+
+and assoc_comments_class_element parent_name module_list c_ele =
   match c_ele with
-    Class_attribute a -> Class_attribute (assoc_comments_attribute module_list a)
-  | Class_method m -> Class_method (assoc_comments_method module_list m)
-  | Class_comment t -> Class_comment (assoc_comments_text module_list t)
-
-and assoc_comments_module_kind module_list mk =
+    Class_attribute a ->
+      Class_attribute (assoc_comments_attribute module_list a)
+  | Class_method m ->
+      Class_method (assoc_comments_method module_list m)
+  | Class_comment t ->
+      Class_comment (assoc_comments_text parent_name module_list t)
+
+and assoc_comments_module_kind parent_name module_list mk =
   match mk with
   | Module_struct eles ->
-      Module_struct (List.map (assoc_comments_module_element module_list) eles)
+      Module_struct
+       (List.map (assoc_comments_module_element parent_name module_list) eles)
   | Module_alias _
   | Module_functor _ ->
       mk
   | Module_apply (mk1, mk2) ->
-      Module_apply (assoc_comments_module_kind module_list mk1,
-                    assoc_comments_module_kind module_list mk2)
+      Module_apply (assoc_comments_module_kind parent_name module_list mk1,
+                    assoc_comments_module_kind parent_name module_list mk2)
   | Module_with (mtk, s) ->
-      Module_with (assoc_comments_module_type_kind module_list mtk, s)
+      Module_with (assoc_comments_module_type_kind parent_name module_list mtk, s)
   | Module_constraint (mk1, mtk) ->
-      Module_constraint (assoc_comments_module_kind module_list mk1,
-                         assoc_comments_module_type_kind module_list mtk)
+      Module_constraint
+       (assoc_comments_module_kind parent_name module_list mk1,
+         assoc_comments_module_type_kind parent_name module_list mtk)
 
-and assoc_comments_module_type_kind module_list mtk =
+and assoc_comments_module_type_kind parent_name module_list mtk =
   match mtk with
   | Module_type_struct eles ->
-      Module_type_struct (List.map (assoc_comments_module_element module_list) eles)
+      Module_type_struct
+       (List.map (assoc_comments_module_element parent_name module_list) eles)
   | Module_type_functor (params, mtk1) ->
-      Module_type_functor (params, assoc_comments_module_type_kind module_list mtk1)
+      Module_type_functor
+       (params, assoc_comments_module_type_kind parent_name module_list mtk1)
   | Module_type_alias _ ->
       mtk
   | Module_type_with (mtk1, s) ->
-      Module_type_with (assoc_comments_module_type_kind module_list mtk1, s)
+      Module_type_with
+       (assoc_comments_module_type_kind parent_name module_list mtk1, s)
 
-and assoc_comments_class_kind module_list ck =
+and assoc_comments_class_kind parent_name module_list ck =
   match ck with
     Class_structure (inher, eles) ->
       let inher2 =
         List.map
-          (fun ic -> { ic with
-                       ic_text = ao (assoc_comments_text module_list) ic.ic_text })
+          (fun ic ->
+           { ic with
+              ic_text = ao (assoc_comments_text parent_name module_list) ic.ic_text })
           inher
       in
-      Class_structure (inher2, List.map (assoc_comments_class_element module_list) eles)
+      Class_structure
+       (inher2, List.map (assoc_comments_class_element parent_name module_list) eles)
 
   | Class_apply _
   | Class_constr _ -> ck
   | Class_constraint (ck1, ctk) ->
-      Class_constraint (assoc_comments_class_kind module_list ck1,
-                        assoc_comments_class_type_kind module_list ctk)
+      Class_constraint (assoc_comments_class_kind parent_name module_list ck1,
+                        assoc_comments_class_type_kind parent_name module_list ctk)
 
-and assoc_comments_class_type_kind module_list ctk =
+and assoc_comments_class_type_kind parent_name module_list ctk =
   match ctk with
     Class_signature (inher, eles) ->
       let inher2 =
         List.map
           (fun ic -> { ic with
-                       ic_text = ao (assoc_comments_text module_list) ic.ic_text })
+                       ic_text = ao (assoc_comments_text parent_name module_list) ic.ic_text })
           inher
       in
-      Class_signature (inher2, List.map (assoc_comments_class_element module_list) eles)
+      Class_signature (inher2, List.map (assoc_comments_class_element parent_name module_list) eles)
 
   | Class_type _ -> ctk
 
 
 and assoc_comments_module module_list m =
-  m.m_info <- ao (assoc_comments_info module_list) m.m_info ;
-  m.m_kind <- assoc_comments_module_kind module_list m.m_kind ;
+  m.m_info <- ao (assoc_comments_info m.m_name module_list) m.m_info ;
+  m.m_kind <- assoc_comments_module_kind m.m_name module_list m.m_kind ;
   m
 
 and assoc_comments_module_type module_list mt =
-  mt.mt_info <- ao (assoc_comments_info module_list) mt.mt_info ;
-  mt.mt_kind <- ao (assoc_comments_module_type_kind module_list) mt.mt_kind ;
+  mt.mt_info <- ao (assoc_comments_info mt.mt_name module_list) mt.mt_info ;
+  mt.mt_kind <- ao (assoc_comments_module_type_kind mt.mt_name module_list) mt.mt_kind ;
   mt
 
 and assoc_comments_class module_list c =
-  c.cl_info <- ao (assoc_comments_info module_list) c.cl_info ;
-  c.cl_kind <- assoc_comments_class_kind module_list c.cl_kind ;
-  assoc_comments_parameter_list module_list c.cl_parameters;
+  c.cl_info <- ao (assoc_comments_info c.cl_name module_list) c.cl_info ;
+  c.cl_kind <- assoc_comments_class_kind c.cl_name module_list c.cl_kind ;
+  assoc_comments_parameter_list c.cl_name module_list c.cl_parameters;
   c
 
 and assoc_comments_class_type module_list ct =
-  ct.clt_info <- ao (assoc_comments_info module_list) ct.clt_info ;
-  ct.clt_kind <- assoc_comments_class_type_kind module_list ct.clt_kind ;
+  ct.clt_info <- ao (assoc_comments_info ct.clt_name module_list) ct.clt_info ;
+  ct.clt_kind <- assoc_comments_class_type_kind ct.clt_name module_list ct.clt_kind ;
   ct
 
-and assoc_comments_parameter module_list p =
+and assoc_comments_parameter parent_name module_list p =
   match p with
     Simple_name sn ->
-      sn.sn_text <- ao (assoc_comments_text module_list) sn.sn_text
+      sn.sn_text <- ao (assoc_comments_text parent_name module_list) sn.sn_text
   | Tuple (l, t) ->
-      List.iter (assoc_comments_parameter module_list) l
+      List.iter (assoc_comments_parameter parent_name module_list) l
 
-and assoc_comments_parameter_list module_list pl =
-  List.iter (assoc_comments_parameter module_list) pl
+and assoc_comments_parameter_list parent_name module_list pl =
+  List.iter (assoc_comments_parameter parent_name module_list) pl
 
 and assoc_comments_value module_list v =
-  v.val_info <- ao (assoc_comments_info module_list) v.val_info ;
-  assoc_comments_parameter_list module_list v.val_parameters;
+  let parent = Name.father v.val_name in
+  v.val_info <- ao (assoc_comments_info parent module_list) v.val_info ;
+  assoc_comments_parameter_list parent module_list v.val_parameters;
   v
 
 and assoc_comments_exception module_list e =
-  e.ex_info <- ao (assoc_comments_info module_list) e.ex_info ;
+  let parent = Name.father e.ex_name in
+  e.ex_info <- ao (assoc_comments_info parent module_list) e.ex_info ;
   e
 
 and assoc_comments_type module_list t =
-  t.ty_info <- ao (assoc_comments_info module_list) t.ty_info ;
+  let parent = Name.father t.ty_name in
+  t.ty_info <- ao (assoc_comments_info parent module_list) t.ty_info ;
   (match t.ty_kind with
     Type_abstract -> ()
   | Type_variant (vl, _) ->
       List.iter
-        (fun vc -> vc.vc_text <- ao (assoc_comments_text module_list) vc.vc_text)
+        (fun vc -> vc.vc_text <- ao (assoc_comments_text parent module_list) vc.vc_text)
         vl
   | Type_record (fl, _) ->
       List.iter
-        (fun rf -> rf.rf_text <- ao (assoc_comments_text module_list) rf.rf_text)
+        (fun rf -> rf.rf_text <- ao (assoc_comments_text parent module_list) rf.rf_text)
         fl
   );
   t
@@ -836,8 +905,9 @@ and assoc_comments_attribute module_list a =
   a
 
 and assoc_comments_method module_list m =
+  let parent_name = Name.father m.met_value.val_name in
   let _ = assoc_comments_value module_list m.met_value in
-  assoc_comments_parameter_list module_list m.met_value.val_parameters;
+  assoc_comments_parameter_list parent_name module_list m.met_value.val_parameters;
   m
 
 
@@ -899,4 +969,4 @@ let associate module_list =
   ignore (associate_type_of_elements_in_comments module_list)
 
 
-(* eof $Id: odoc_cross.ml,v 1.15.10.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* eof $Id: odoc_cross.ml,v 1.15.10.3 2006/05/03 15:00:24 guesdon Exp $ *)
index 51d0823f106e978f69474592a9a3c7e07c0a1fb7..56f025ca7bb8ec45d0370e0d8791688ebd5eb011 100644 (file)
@@ -9,9 +9,12 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_cross.mli,v 1.2 2003/11/24 10:39:30 starynke Exp $ *)
+(* $Id: odoc_cross.mli,v 1.2.12.1 2006/07/31 14:19:35 guesdon Exp $ *)
 
 (** Cross-referencing. *)
 
 val associate : Odoc_module.t_module list -> unit
 
+val assoc_comments_info :
+    string -> Odoc_module.t_module list ->
+      Odoc_types.info -> Odoc_types.info
index 99f9a9650e76dc3aeeea313abe68deed02fae580..225350e4dfbdcb112221ccf440329013544656ab 100644 (file)
@@ -9,9 +9,9 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_dot.ml,v 1.6 2003/11/24 10:39:31 starynke Exp $ *)
+(* $Id: odoc_dot.ml,v 1.6.12.1 2006/05/02 12:15:39 guesdon Exp $ *)
 
-(** Definition of a class which outputs a dot file showing 
+(** Definition of a class which outputs a dot file showing
    top modules dependencies.*)
 
 open Odoc_info
@@ -32,7 +32,7 @@ class dot =
     val mutable colors = !Args.dot_colors
 
     (** Graph header. *)
-    method header = 
+    method header =
       "digraph G {\n"^
       "  size=\"10,7.5\";\n"^
       "  ratio=\"fill\";\n"^
@@ -43,14 +43,14 @@ class dot =
     method get_one_color =
       match colors with
         [] -> None
-      | h :: q -> 
+      | h :: q ->
           colors <- q ;
           Some h
 
     method node_color s =
       try Some (List.assoc s loc_colors)
       with
-        Not_found -> 
+        Not_found ->
           match self#get_one_color with
             None -> None
           | Some c ->
@@ -71,10 +71,10 @@ class dot =
       F.fprintf fmt "\"%s\" -> \"%s\";\n" src dest
 
     method generate_for_module fmt m =
-      let l = List.filter 
-          (fun n -> 
-            !Args.dot_include_all or 
-            (List.exists (fun m -> m.Module.m_name = n) modules)) 
+      let l = List.filter
+          (fun n ->
+            !Args.dot_include_all or
+            (List.exists (fun m -> m.Module.m_name = n) modules))
           m.Module.m_top_deps
       in
       self#print_module_atts fmt m;
@@ -91,9 +91,9 @@ class dot =
         let oc = open_out !Args.out_file in
         let fmt = F.formatter_of_out_channel oc in
         F.fprintf fmt "%s" self#header;
-        let graph = Odoc_info.Dep.deps_of_types 
+        let graph = Odoc_info.Dep.deps_of_types
             ~kernel: !Args.dot_reduce
-            types 
+            types
         in
         List.iter (self#generate_for_type fmt) graph;
         F.fprintf fmt "}\n" ;
@@ -103,14 +103,14 @@ class dot =
         Sys_error s ->
           raise (Failure s)
 
-    method generate_modules modules_list = 
+    method generate_modules modules_list =
       try
         modules <- modules_list ;
         let oc = open_out !Args.out_file in
         let fmt = F.formatter_of_out_channel oc in
         F.fprintf fmt "%s" self#header;
 
-        if !Args.dot_reduce then 
+        if !Args.dot_reduce then
           Odoc_info.Dep.kernel_deps_of_modules modules_list;
 
         List.iter (self#generate_for_module fmt) modules_list;
@@ -123,6 +123,7 @@ class dot =
 
     (** Generate the dot code in the file {!Odoc_info.Args.out_file}. *)
     method generate (modules_list : Odoc_info.Module.t_module list) =
+      colors <- !Args.dot_colors;
       if !Args.dot_types then
         self#generate_types (Odoc_info.Search.types modules_list)
       else
index 411cfdb35c5b328810c48159fd64bdac611a0be2..83db96ae32f772e288c6d2e972991cfef23126e3 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_html.ml,v 1.58.2.3 2005/11/10 14:44:36 guesdon Exp $ *)
+(* $Id: odoc_html.ml,v 1.58.2.5 2006/08/10 12:34:02 guesdon Exp $ *)
 
 (** Generation of html documentation.*)
 
@@ -1168,10 +1168,21 @@ class html =
           bs b (self#create_fully_qualified_module_idents_links father a.ma_name);
           bs b "</code>"
       | Module_functor (p, k) ->
-          bs b "<div class=\"sig_block\">";
+         if !Odoc_info.Args.html_short_functors then
+           bs b " "
+         else
+            bs b "<div class=\"sig_block\">";
           self#html_of_module_parameter b father p;
+         (
+          match k with
+            Module_functor _ -> ()
+          | _ when !Odoc_info.Args.html_short_functors ->
+              bs b ": "
+          | _ -> ()
+         );
           self#html_of_module_kind b father ?modu k;
-          bs b "</div>"
+          if not !Odoc_info.Args.html_short_functors then
+           bs b "</div>"
       | Module_apply (k1, k2) ->
           (* TODO: l'application n'est pas correcte dans un .mli.
              Que faire ? -> afficher le module_type du typedtree  *)
@@ -1190,14 +1201,20 @@ class html =
           self#html_of_module_kind b father ?modu k
 
     method html_of_module_parameter b father p =
+      let (s_functor,s_arrow) =
+       if !Odoc_info.Args.html_short_functors then
+         "", ""
+       else
+         "functor ", "-> "
+      in
       self#html_of_text b
         [
-          Code "functor (";
+          Code (s_functor^"(");
           Code p.mp_name ;
           Code " : ";
         ] ;
       self#html_of_module_type_kind b father p.mp_kind;
-      self#html_of_text b [ Code ") -> "]
+      self#html_of_text b [ Code (") "^s_arrow)]
 
     method html_of_module_element b father ele =
       match ele with
@@ -1628,7 +1645,12 @@ class html =
        else
          bs b (Name.simple m.m_name)
       );
-      bs b ": ";
+      (
+       match m.m_kind with
+        Module_functor _ when !Odoc_info.Args.html_short_functors  ->
+          ()
+       | _ -> bs b ": "
+      );
       self#html_of_module_kind b father ~modu: m m.m_kind;
       bs b "</pre>";
       if info then
@@ -2290,7 +2312,8 @@ class html =
         bs b title;
         bs b "</h1></center>\n" ;
         let info = Odoc_info.apply_opt
-            Odoc_info.info_of_comment_file !Odoc_info.Args.intro_file
+            (Odoc_info.info_of_comment_file module_list)
+           !Odoc_info.Args.intro_file
         in
         (
          match info with
index fd45cdd0c9201e9ce2cdd58a2c7e99c417065516..ad37fc6f76fc66a942309d20891383f2682c79fe 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_info.mli,v 1.38.4.2 2005/11/10 14:44:36 guesdon Exp $ *)
+(* $Id: odoc_info.mli,v 1.38.4.5 2006/08/10 12:34:02 guesdon Exp $ *)
 
 (** Interface to the information collected in source files. *)
 
@@ -444,7 +444,7 @@ module Module :
     and t_module = Odoc_module.t_module =
         {
           m_name : Name.t ; (** Complete name of the module. *)
-          m_type : Types.module_type ; (** The type of the module. *)
+          mutable m_type : Types.module_type ; (** The type of the module. *)
           mutable m_info : info option ; (** Information found in the optional associated comment. *)
           m_is_interface : bool ; (** [true] for modules read from interface files *)
           m_file : string ; (** The file the module is defined in. *)
@@ -477,7 +477,7 @@ module Module :
         {
           mt_name : Name.t ; (** Complete name of the module type. *)
           mutable mt_info : info option ; (** Information found in the optional associated comment. *)
-          mt_type : Types.module_type option ; (** [None] means that the module type is abstract. *)
+          mutable mt_type : Types.module_type option ; (** [None] means that the module type is abstract. *)
           mt_is_interface : bool ; (** [true] for modules read from interface files. *)
           mt_file : string ; (** The file the module type is defined in. *)
           mutable mt_kind : module_type_kind option ;
@@ -750,10 +750,11 @@ val info_string_of_info : info -> string
 (** [info_of_comment_file file] parses the given file
    and return an {!Odoc_info.info} structure. The content of the
    file must have the same syntax as the content of a special comment.
+   The given module list is used for cross reference.
    @raise Failure is the file could not be opened or there is a
    syntax error.
 *)
-val info_of_comment_file : string -> info
+val info_of_comment_file : Module.t_module list -> string -> info
 
 (** [remove_ending_newline s] returns [s] without the optional ending newline. *)
 val remove_ending_newline : string -> string
@@ -961,6 +962,10 @@ module Args :
       (** To colorize code in HTML generated documentation pages, not code pages. *)
       val colorize_code : bool ref
 
+      (** To display functors in short form rather than with "functor ... -> ",
+        in HTML generated documentation. *)
+      val html_short_functors : bool ref
+
       (** The flag which indicates if we must generate a header (for LaTeX). *)
       val with_header : bool ref
 
index e5ac21b3918e0739a666ee61ba07e7f8003b6979..21dfd04712f8b1759fdfe93e473673c853ee9789 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_latex.ml,v 1.38.4.2 2005/11/10 14:44:36 guesdon Exp $ *)
+(* $Id: odoc_latex.ml,v 1.38.4.3 2006/07/31 14:19:35 guesdon Exp $ *)
 
 (** Generation of LaTeX documentation. *)
 
@@ -1044,7 +1044,7 @@ class latex =
         (Module.module_elements ~trans: false m)
 
     (** Print the header of the TeX document. *)
-    method latex_header fmt =
+    method latex_header fmt module_list =
       ps fmt "\\documentclass[11pt]{article} \n";
       ps fmt "\\usepackage[latin1]{inputenc} \n";
       ps fmt "\\usepackage[T1]{fontenc} \n";
@@ -1067,7 +1067,8 @@ class latex =
       if !Args.with_toc then ps fmt "\\tableofcontents\n";
       (
        let info = Odoc_info.apply_opt
-           Odoc_info.info_of_comment_file !Odoc_info.Args.intro_file
+           (Odoc_info.info_of_comment_file module_list)
+          !Odoc_info.Args.intro_file
        in
        (match info with None -> () | Some _ -> ps fmt "\\vspace{0.2cm}");
        self#latex_of_info fmt info;
@@ -1123,7 +1124,7 @@ class latex =
       try
         let chanout = open_out main_file in
         let fmt = Format.formatter_of_out_channel chanout in
-        if !Args.with_header then self#latex_header fmt;
+        if !Args.with_header then self#latex_header fmt module_list;
         List.iter
           (fun m ->
             if !Args.separate_files then
index 6d5e3ed3fa6192da39d939ee5f7d1519bca95a37..f07b93bcd98b4c1c1be57bd11b8a23803917655c 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_merge.ml,v 1.10 2004/01/18 14:26:14 guesdon Exp $ *)
+(* $Id: odoc_merge.ml,v 1.10.12.2 2006/08/10 12:34:02 guesdon Exp $ *)
 
 (** Merge of information from [.ml] and [.mli] for a module.*)
 
@@ -28,7 +28,7 @@ open Odoc_module
    The merge treatment depends on a given merge_option list.
    @return the new info structure.*)
 let merge_info merge_options (m1 : info) (m2 : info) =
-  let new_desc_opt = 
+  let new_desc_opt =
     match m1.i_desc, m2.i_desc with
       None, None -> None
     | None, Some d
@@ -39,7 +39,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           Some d1
   in
-  let new_authors = 
+  let new_authors =
     match m1.i_authors, m2.i_authors with
       [], [] -> []
     | l, []
@@ -50,7 +50,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           l1
   in
-  let new_version = 
+  let new_version =
     match m1.i_version , m2.i_version with
       None, None -> None
     | Some v, None
@@ -61,7 +61,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           Some v1
   in
-  let new_sees = 
+  let new_sees =
     match m1.i_sees, m2.i_sees with
       [], [] -> []
     | l, []
@@ -72,7 +72,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           l1
   in
-  let new_since = 
+  let new_since =
     match m1.i_since, m2.i_since with
       None, None -> None
     | Some v, None
@@ -83,7 +83,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           Some v1
   in
-  let new_dep = 
+  let new_dep =
     match m1.i_deprecated, m2.i_deprecated with
       None, None -> None
     | None, Some t
@@ -94,7 +94,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           Some t1
   in
-  let new_params = 
+  let new_params =
     match m1.i_params, m2.i_params with
       [], [] -> []
     | l, []
@@ -118,7 +118,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           l1
   in
-  let new_raised_exceptions = 
+  let new_raised_exceptions =
     match m1.i_raised_exceptions, m2.i_raised_exceptions with
       [], [] -> []
     | l, []
@@ -142,7 +142,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
         else
           l1
   in
-  let new_rv = 
+  let new_rv =
     match m1.i_return_value, m2.i_return_value with
       None, None -> None
     | None, Some t
@@ -156,7 +156,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
   let new_custom =
     match m1.i_custom, m2.i_custom with
       [], [] -> []
-    | [], l 
+    | [], l
     | l, [] -> l
     | l1, l2 ->
         if List.mem Merge_custom merge_options then
@@ -175,7 +175,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
     Odoc_types.i_raised_exceptions = new_raised_exceptions ;
     Odoc_types.i_return_value = new_rv ;
     Odoc_types.i_custom = new_custom ;
-  } 
+  }
 
 (** Merge of two optional info structures. *)
 let merge_info_opt merge_options mli_opt ml_opt =
@@ -203,7 +203,7 @@ let merge_types merge_options mli ml =
               (fun c2 -> c2.vc_name = cons.vc_name)
               l2
           in
-          let new_desc = 
+          let new_desc =
             match cons.vc_text, cons2.vc_text with
               None, None -> None
             | Some d, None
@@ -231,7 +231,7 @@ let merge_types merge_options mli ml =
               (fun r -> r.rf_name = record.rf_name)
               l2
           in
-          let new_desc = 
+          let new_desc =
             match record.rf_text, record2.rf_text with
               None, None -> None
             | Some d, None
@@ -258,7 +258,7 @@ let merge_types merge_options mli ml =
       else
         raise (Failure (Odoc_messages.different_types mli.ty_name))
 
-(** Merge of two param_info, one from a .mli, one from a .ml. 
+(** Merge of two param_info, one from a .mli, one from a .ml.
    The text fields are not handled but will be recreated from the
    i_params field of the info structure.
    Here, if a parameter in the .mli has no name, we take the one
@@ -277,7 +277,7 @@ let rec merge_param_info pi_mli pi_ml =
       (* if we're here, then the tuple in the .mli has no parameter names ;
          then we take the name of the parameter of the .ml and the type of the .mli. *)
       Simple_name { sn_ml with sn_type = t_mli }
-      
+
   | (Tuple (l_mli, t_mli), Tuple (l_ml, _)) ->
       (* if the two tuples have different lengths
          (which should not occurs), we return the pi_mli,
@@ -313,15 +313,15 @@ let merge_classes merge_options mli ml =
     (fun a ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Class_attribute a2 -> 
+                Class_attribute a2 ->
                   if a2.att_value.val_name = a.att_value.val_name then
                     (
-                     a.att_value.val_info <- merge_info_opt merge_options 
+                     a.att_value.val_info <- merge_info_opt merge_options
                          a.att_value.val_info a2.att_value.val_info;
                      a.att_value.val_loc <- { a.att_value.val_loc with loc_impl = a2.att_value.val_loc.loc_impl } ;
-                     if !Odoc_args.keep_code then 
+                     if !Odoc_args.keep_code then
                        a.att_value.val_code <- a2.att_value.val_code;
                      true
                     )
@@ -344,23 +344,23 @@ let merge_classes merge_options mli ml =
     (fun m ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Class_method m2 -> 
+                Class_method m2 ->
                   if m2.met_value.val_name = m.met_value.val_name then
                     (
                      m.met_value.val_info <- merge_info_opt
                          merge_options m.met_value.val_info m2.met_value.val_info;
                      m.met_value.val_loc <- { m.met_value.val_loc with loc_impl = m2.met_value.val_loc.loc_impl } ;
                      (* merge the parameter names *)
-                     m.met_value.val_parameters <- (merge_parameters 
+                     m.met_value.val_parameters <- (merge_parameters
                                                       m.met_value.val_parameters
                                                       m2.met_value.val_parameters) ;
                      (* we must reassociate comments in @param to the corresponding
                         parameters because the associated comment of a parameter may have been changed by the merge.*)
                      Odoc_value.update_value_parameters_text m.met_value;
 
-                     if !Odoc_args.keep_code then 
+                     if !Odoc_args.keep_code then
                        m.met_value.val_code <- m2.met_value.val_code;
 
                      true
@@ -385,20 +385,20 @@ let merge_classes merge_options mli ml =
 let merge_class_types merge_options mli ml =
   mli.clt_info <- merge_info_opt merge_options  mli.clt_info ml.clt_info;
   mli.clt_loc <- { mli.clt_loc with loc_impl = ml.clt_loc.loc_impl } ;
-  (* merge values *) 
+  (* merge values *)
   List.iter
     (fun a ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Class_attribute a2 -> 
+                Class_attribute a2 ->
                   if a2.att_value.val_name = a.att_value.val_name then
                     (
-                     a.att_value.val_info <- merge_info_opt merge_options 
+                     a.att_value.val_info <- merge_info_opt merge_options
                          a.att_value.val_info a2.att_value.val_info;
                      a.att_value.val_loc <- { a.att_value.val_loc with loc_impl = a2.att_value.val_loc.loc_impl } ;
-                     if !Odoc_args.keep_code then 
+                     if !Odoc_args.keep_code then
                        a.att_value.val_code <- a2.att_value.val_code;
 
                      true
@@ -422,22 +422,22 @@ let merge_class_types merge_options mli ml =
     (fun m ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Class_method m2 -> 
+                Class_method m2 ->
                   if m2.met_value.val_name = m.met_value.val_name then
                     (
                      m.met_value.val_info <- merge_info_opt
                          merge_options m.met_value.val_info m2.met_value.val_info;
                      m.met_value.val_loc <- { m.met_value.val_loc with loc_impl = m2.met_value.val_loc.loc_impl } ;
-                     m.met_value.val_parameters <- (merge_parameters 
+                     m.met_value.val_parameters <- (merge_parameters
                                                       m.met_value.val_parameters
                                                       m2.met_value.val_parameters) ;
                      (* we must reassociate comments in @param to the the corresponding
                         parameters because the associated comment of a parameter may have been changed y the merge.*)
                      Odoc_value.update_value_parameters_text m.met_value;
-                     
-                     if !Odoc_args.keep_code then 
+
+                     if !Odoc_args.keep_code then
                        m.met_value.val_code <- m2.met_value.val_code;
 
                      true
@@ -468,9 +468,9 @@ let rec merge_module_types merge_options mli ml =
     (fun ex ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_exception ex2 -> 
+                Element_exception ex2 ->
                   if ex2.ex_name = ex.ex_name then
                     (
                      ex.ex_info <- merge_info_opt merge_options ex.ex_info ex2.ex_info;
@@ -497,9 +497,9 @@ let rec merge_module_types merge_options mli ml =
     (fun ty ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_type ty2 -> 
+                Element_type ty2 ->
                   if ty2.ty_name = ty.ty_name then
                     (
                      merge_types merge_options ty ty2;
@@ -524,12 +524,12 @@ let rec merge_module_types merge_options mli ml =
     (fun m ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_module m2 -> 
+                Element_module m2 ->
                   if m2.m_name = m.m_name then
                     (
-                     merge_modules merge_options m m2 ;
+                     ignore(merge_modules merge_options m m2);
 (*
                      m.m_info <- merge_info_opt merge_options m.m_info m2.m_info;
                      m.m_loc <- { m.m_loc with loc_impl = m2.m_loc.loc_impl } ;
@@ -556,9 +556,9 @@ let rec merge_module_types merge_options mli ml =
     (fun m ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_module_type m2 -> 
+                Element_module_type m2 ->
                   if m2.mt_name = m.mt_name then
                     (
                      merge_module_types merge_options m m2;
@@ -586,9 +586,9 @@ let rec merge_module_types merge_options mli ml =
     (fun v ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_value v2 -> 
+                Element_value v2 ->
                   if v2.val_name = v.val_name then
                     (
                      v.val_info <- merge_info_opt merge_options v.val_info v2.val_info ;
@@ -601,7 +601,7 @@ let rec merge_module_types merge_options mli ml =
                         parameters because the associated comment of a parameter may have been changed y the merge.*)
                      Odoc_value.update_value_parameters_text v;
 
-                     if !Odoc_args.keep_code then 
+                     if !Odoc_args.keep_code then
                        v.val_code <- v2.val_code;
 
                      true
@@ -626,9 +626,9 @@ let rec merge_module_types merge_options mli ml =
     (fun c ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_class c2 -> 
+                Element_class c2 ->
                   if c2.cl_name = c.cl_name then
                     (
                      merge_classes merge_options c c2;
@@ -654,9 +654,9 @@ let rec merge_module_types merge_options mli ml =
     (fun c ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_class_type c2 -> 
+                Element_class_type c2 ->
                   if c2.clt_name = c.clt_name then
                     (
                      merge_class_types merge_options c c2;
@@ -682,10 +682,15 @@ let rec merge_module_types merge_options mli ml =
 and merge_modules merge_options mli ml =
   mli.m_info <- merge_info_opt merge_options mli.m_info ml.m_info;
   mli.m_loc <- { mli.m_loc with loc_impl = ml.m_loc.loc_impl } ;
-  (* More dependencies in the .ml file. *)
-  mli.m_top_deps <- ml.m_top_deps ;
-  
-  let code = 
+  let rec remove_doubles acc = function
+      [] -> acc
+    | h :: q ->
+        if List.mem h acc then remove_doubles acc q
+        else remove_doubles (h :: acc) q
+  in
+  mli.m_top_deps <- remove_doubles mli.m_top_deps ml.m_top_deps ;
+
+  let code =
     if !Odoc_args.keep_code then
       match mli.m_code, ml.m_code with
        Some s, _ -> Some s
@@ -694,7 +699,7 @@ and merge_modules merge_options mli ml =
     else
       None
   in
-  let code_intf = 
+  let code_intf =
     if !Odoc_args.keep_code then
       match mli.m_code_intf, ml.m_code_intf with
        Some s, _ -> Some s
@@ -711,9 +716,9 @@ and merge_modules merge_options mli ml =
     (fun ex ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_exception ex2 -> 
+                Element_exception ex2 ->
                   if ex2.ex_name = ex.ex_name then
                     (
                      ex.ex_info <- merge_info_opt merge_options ex.ex_info ex2.ex_info;
@@ -740,9 +745,9 @@ and merge_modules merge_options mli ml =
     (fun ty ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_type ty2 -> 
+                Element_type ty2 ->
                   if ty2.ty_name = ty.ty_name then
                     (
                      merge_types merge_options ty ty2;
@@ -767,12 +772,12 @@ and merge_modules merge_options mli ml =
     (fun m ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_module m2 -> 
+                Element_module m2 ->
                   if m2.m_name = m.m_name then
                     (
-                     merge_modules merge_options m m2 ;
+                     ignore(merge_modules merge_options m m2);
 (*
                      m.m_info <- merge_info_opt merge_options m.m_info m2.m_info;
                      m.m_loc <- { m.m_loc with loc_impl = m2.m_loc.loc_impl } ;
@@ -799,9 +804,9 @@ and merge_modules merge_options mli ml =
     (fun m ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_module_type m2 -> 
+                Element_module_type m2 ->
                   if m2.mt_name = m.mt_name then
                     (
                      merge_module_types merge_options m m2;
@@ -841,8 +846,8 @@ and merge_modules merge_options mli ml =
                  (* we must reassociate comments in @param to the the corresponding
                     parameters because the associated comment of a parameter may have been changed y the merge.*)
                  Odoc_value.update_value_parameters_text v;
-                 
-                 if !Odoc_args.keep_code then 
+
+                 if !Odoc_args.keep_code then
                    v.val_code <- v2.val_code;
                  true
                 )
@@ -864,9 +869,9 @@ and merge_modules merge_options mli ml =
     (fun c ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_class c2 -> 
+                Element_class c2 ->
                   if c2.cl_name = c.cl_name then
                     (
                      merge_classes merge_options c c2;
@@ -892,9 +897,9 @@ and merge_modules merge_options mli ml =
     (fun c ->
       try
         let _ = List.find
-            (fun ele -> 
+            (fun ele ->
               match ele with
-                Element_class_type c2 -> 
+                Element_class_type c2 ->
                   if c2.clt_name = c.clt_name then
                     (
                      merge_class_types merge_options c c2;
@@ -914,7 +919,7 @@ and merge_modules merge_options mli ml =
           ()
     )
     (Odoc_module.module_class_types mli);
-  
+
   mli
 
 let merge merge_options modules_list =
@@ -932,13 +937,13 @@ let merge merge_options modules_list =
             m :: (iter l_others)
         | m2 :: [] ->
             (
-             (* we can merge m with m2 if there is an implementation 
+             (* we can merge m with m2 if there is an implementation
                 and an interface.*)
              let f b = if !Odoc_args.inverse_merge_ml_mli then not b else b in
              match f m.m_is_interface, f m2.m_is_interface with
                true, false -> (merge_modules merge_options m m2) :: (iter l_others)
              | false, true -> (merge_modules merge_options m2 m) :: (iter l_others)
-             | false, false ->                 
+             | false, false ->
                  if !Odoc_args.inverse_merge_ml_mli then
                    (* two Module.ts for the .mli ! *)
                    raise (Failure (Odoc_messages.two_interfaces m.m_name))
@@ -959,5 +964,5 @@ let merge merge_options modules_list =
 
   in
   iter modules_list
-  
-(* eof $Id: odoc_merge.ml,v 1.10 2004/01/18 14:26:14 guesdon Exp $ *)
+
+(* eof $Id: odoc_merge.ml,v 1.10.12.2 2006/08/10 12:34:02 guesdon Exp $ *)
index d7d053d1ae33820e48c9a4d18f7dc7691ec454c3..cf164b7889bba14a84f81b3d5a89a165f9b33a5e 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_messages.ml,v 1.28.2.1 2005/11/07 15:59:04 doligez Exp $ *)
+(* $Id: odoc_messages.ml,v 1.28.2.3 2006/08/10 12:34:02 guesdon Exp $ *)
 
 (** The messages of the application. *)
 
@@ -52,6 +52,7 @@ let load = "<file>\tLoad information from <file> ; may be used several times"
 let css_style = "<file>\n\t\tUse content of <file> as CSS style definition "^html_only
 let index_only = "\tGenerate index files only "^html_only
 let colorize_code = "\n\t\tColorize code even in documentation pages "^html_only
+let html_short_functors = "\n\t\tUse short form to display functor types "^html_only
 let generate_html = "\tGenerate HTML documentation"
 let generate_latex = "\tGenerate LaTeX documentation"
 let generate_texinfo = "\tGenerate TeXinfo documentation"
@@ -144,7 +145,7 @@ let latex_class_prefix =
   "\t\t(default is \""^default_latex_class_prefix^"\")"
 
 let default_latex_class_type_prefix = "classtype:"
-let latex_class_type_prefix = 
+let latex_class_type_prefix =
   "<string>\n\t\tUse <string> as prefix for the LaTeX labels of class types.\n"^
   "\t\t(default is \""^default_latex_class_type_prefix^"\")"
 
@@ -286,7 +287,7 @@ let cross_element_not_found n = "Element "^n^" not found"
 let cross_method_not_found n = "Method "^n^" not found"
 let cross_attribute_not_found n = "Attribute "^n^" not found"
 let cross_section_not_found n = "Section "^n^" not found"
-let cross_value_not_found n = "Attribute "^n^" not found"
+let cross_value_not_found n = "Value "^n^" not found"
 let cross_type_not_found n = "Type "^n^" not found"
 
 let object_end = "object ... end"
index 1e450cd126223cf30df02f794963954559b201a5..62f19014f1446bdb86e1b401516da96a0e3ef749 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_module.ml,v 1.10.4.1 2005/11/10 14:44:36 guesdon Exp $ *)
+(* $Id: odoc_module.ml,v 1.10.4.2 2006/08/10 11:21:36 guesdon Exp $ *)
 
 (** Representation and manipulation of modules and module types. *)
 
@@ -64,7 +64,7 @@ and module_kind =
 (** Representation of a module. *)
 and t_module = {
     m_name : Name.t ;
-    m_type : Types.module_type ;
+    mutable m_type : Types.module_type ;
     mutable m_info : Odoc_types.info option ;
     m_is_interface : bool ; (** true for modules read from interface files *)
     m_file : string ; (** the file the module is defined in. *)
@@ -92,7 +92,7 @@ and module_type_kind =
 and t_module_type = {
     mt_name : Name.t ;
     mutable mt_info : Odoc_types.info option ;
-    mt_type : Types.module_type option ; (** [None] = abstract module type *)
+    mutable mt_type : Types.module_type option ; (** [None] = abstract module type *)
     mt_is_interface : bool ; (** true for modules read from interface files *)
     mt_file : string ; (** the file the module type is defined in. *)
     mutable mt_kind : module_type_kind option ; (** [None] = abstract module type if mt_type = None ;
index fe15b43c6fbf9807b883fc46fc18f47f60c1884a..ffcf38198208f28841f5093adea5211b6048b51a 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_opt.ml,v 1.5 2002/08/13 14:09:23 guesdon Exp $ *)
+(* $Id: odoc_opt.ml,v 1.5.14.1 2006/05/02 12:15:39 guesdon Exp $ *)
 
 (** Main module for native version.*)
 
@@ -35,16 +35,16 @@ let _ = Odoc_args.parse
     (default_dot_generator :> Odoc_args.doc_generator)
 
 let loaded_modules =
-  List.flatten 
-    (List.map 
+  List.flatten
+    (List.map
        (fun f ->
          Odoc_info.verbose (Odoc_messages.loading f);
-         try 
+         try
            let l = Odoc_analyse.load_modules f in
            Odoc_info.verbose Odoc_messages.ok;
            l
-         with Failure s -> 
-           prerr_endline s ; 
+         with Failure s ->
+           prerr_endline s ;
            incr Odoc_global.errors ;
            []
        )
@@ -58,11 +58,11 @@ let _ =
     None -> ()
   | Some f ->
       try Odoc_analyse.dump_modules f modules
-      with Failure s -> 
+      with Failure s ->
         prerr_endline s ;
         incr Odoc_global.errors
 
-let _ = 
+let _ =
   match !Odoc_args.doc_generator with
     None ->
       ()
@@ -71,7 +71,7 @@ let _ =
       gen#generate modules;
       Odoc_info.verbose Odoc_messages.ok
 
-let _ = 
+let _ =
   if !Odoc_global.errors > 0 then
   (
    prerr_endline (Odoc_messages.errors_occured !Odoc_global.errors) ;
@@ -79,4 +79,3 @@ let _ =
   )
   else
     exit 0
-  
index 9c4081d972506fe7cba8dc7201a9ab551cb2cc01..8255bcb5f6bd995dd614361363f47172eeeb3fe3 100644 (file)
@@ -8,7 +8,7 @@
 (*  under the terms of the Q Public License version 1.0.               *)
 (***********************************************************************)
 
-(* $Id: odoc_texi.ml,v 1.19.4.2 2005/11/10 14:44:36 guesdon Exp $ *)
+(* $Id: odoc_texi.ml,v 1.19.4.3 2006/07/31 14:19:35 guesdon Exp $ *)
 
 (** Generation of Texinfo documentation. *)
 
@@ -1105,7 +1105,8 @@ class texi =
         | Some f ->
             nl chan ;
             puts_nl chan
-              (self#texi_of_info (Some (Odoc_info.info_of_comment_file f)))
+              (self#texi_of_info
+                (Some (Odoc_info.info_of_comment_file m_list f)))
       end ;
 
       (* write a top menu *)
diff --git a/otherlibs/systhreads/Tests/Makefile b/otherlibs/systhreads/Tests/Makefile
new file mode 100644 (file)
index 0000000..7745fdc
--- /dev/null
@@ -0,0 +1,44 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the GNU Library General Public License, with     #
+#   the special exception on linking described in file ../../../LICENSE.#
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.11 2003/06/16 12:31:14 xleroy Exp $
+
+PROGS=test1.byt test2.byt test3.byt test4.byt test5.byt test6.byt \
+  test7.byt test8.byt test9.byt testA.byt sieve.byt \
+  testio.byt testsocket.byt testsignal.byt testsignal2.byt \
+  torture.byt
+
+include ../../../config/Makefile
+
+CAMLC=../../../boot/ocamlrun ../../../ocamlc -I .. -I ../../unix -I ../../../stdlib 
+
+CAMLOPT=../../../boot/ocamlrun ../../../ocamlopt -I .. -I ../../unix -I ../../../stdlib 
+
+all: $(PROGS)
+
+allopt: $(PROGS:.byt=.out)
+
+clean:
+       rm -f *.cm* *.byt *.out
+       rm -f $(PROGS:.byt=.ml)
+
+%.byt: ../../threads/Tests/%.ml
+       cp ../../threads/Tests/$*.ml $*.ml
+       $(CAMLC) -custom -o $*.byt unix.cma threads.cma $*.ml ../libthreads.a ../../unix/libunix.a -cclib -lpthread
+
+%.out: ../../threads/Tests/%.ml
+       cp ../../threads/Tests/$*.ml $*.ml
+       $(CAMLOPT) -o $*.out unix.cmxa threads.cmxa $*.ml ../libthreadsnat.a ../../unix/libunix.a -cclib -lpthread
+
+$(PROGS): ../threads.cma ../libthreads.a
+$(PROGS:.byt=.out): ../threads.cmxa ../libthreadsnat.a
diff --git a/otherlibs/systhreads/Tests/Makefile.nt b/otherlibs/systhreads/Tests/Makefile.nt
new file mode 100644 (file)
index 0000000..3049de7
--- /dev/null
@@ -0,0 +1,43 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the GNU Library General Public License, with     #
+#   the special exception on linking described in file ../../../LICENSE.#
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile.nt,v 1.8 2002/06/11 08:30:19 xleroy Exp $
+
+PROGS=test1.byt test2.byt test3.byt test4.byt test5.byt test6.byt \
+  test7.byt test8.byt test9.byt testA.byt sieve.byt \
+  testio.byt testsocket.byt testwait.byt testsignal.byt testsignal2.byt \
+  torture.byt
+
+include ../../../config/Makefile
+
+CAMLC=../../../boot/ocamlrun ../../../ocamlc -I .. -I ../../unix -I ../../../stdlib 
+
+CAMLOPT=../../../boot/ocamlrun ../../../ocamlopt -I .. -I ../../unix -I ../../../stdlib 
+
+all: $(PROGS)
+
+allopt: $(PROGS:.byt=.out)
+
+clean:
+       rm -f *.cm* *.byt *.out
+       rm -f $(PROGS:.byt=.ml)
+
+%.byt: ../../threads/Tests/%.ml
+       cp ../../threads/Tests/$*.ml $*.ml
+       $(CAMLC) -custom -o $*.byt unix.cma threads.cma $*.ml ../libthreads.$(A) ../../unix/libunix.$(A)
+
+%.out: ../../threads/Tests/%.ml
+       cp ../../threads/Tests/$*.ml $*.ml
+       $(CAMLOPT) -o $*.out unix.cmxa threads.cmxa $*.ml ../libthreadsnat.$(A) ../../unix/libunix.$(A) -cclib -lpthread
+
+$(PROGS): ../threads.cma ../libthreads.$(A)
diff --git a/otherlibs/threads/Tests/.cvsignore b/otherlibs/threads/Tests/.cvsignore
new file mode 100644 (file)
index 0000000..e6d9e45
--- /dev/null
@@ -0,0 +1 @@
+*.byt
diff --git a/otherlibs/threads/Tests/Makefile b/otherlibs/threads/Tests/Makefile
new file mode 100644 (file)
index 0000000..8d3e3eb
--- /dev/null
@@ -0,0 +1,38 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the GNU Library General Public License, with     #
+#   the special exception on linking described in file ../../../LICENSE.#
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.15 2001/12/07 13:40:23 xleroy Exp $
+
+PROGS=test1.byt test2.byt test3.byt test4.byt test5.byt test6.byt \
+  test7.byt test8.byt test9.byt testA.byt sieve.byt \
+  testio.byt testsocket.byt testwait.byt testsignal.byt testsignal2.byt \
+  testsieve.byt token1.byt token2.byt
+
+CAMLC=../../../boot/ocamlrun ../../../ocamlc -I .. -I ../../../stdlib -I ../../unix
+
+include ../../../config/Makefile
+
+all: $(PROGS)
+
+clean:
+       rm -f *.cm* *.byt
+
+sorts.byt: sorts.ml
+       $(CAMLC) -o sorts.byt -I ../../graph threads.cma graphics.cma sorts.ml $(LIBS) $(X11_LINK)
+
+.SUFFIXES: .ml .byt
+
+.ml.byt:
+       $(CAMLC) -o $*.byt unix.cma threads.cma $*.ml $(LIBS)
+
+$(PROGS): ../threads.cma ../libthreads.a
diff --git a/otherlibs/threads/Tests/close.ml b/otherlibs/threads/Tests/close.ml
new file mode 100644 (file)
index 0000000..21ebb44
--- /dev/null
@@ -0,0 +1,14 @@
+let main () =
+  let (rd, wr) = Unix.pipe() in
+  Thread.create
+    (fun () ->
+      Thread.delay 3.0;
+      prerr_endline "closing fd...";
+      Unix.close rd)
+    ();
+  let buf = String.create 10 in
+  prerr_endline "reading...";
+  Unix.read rd buf 0 10;
+  prerr_endline "read returned"
+
+let _ = Unix.handle_unix_error main ()
diff --git a/otherlibs/threads/Tests/sieve.ml b/otherlibs/threads/Tests/sieve.ml
new file mode 100644 (file)
index 0000000..72e2656
--- /dev/null
@@ -0,0 +1,33 @@
+open Printf
+open Thread
+
+let rec integers n ch =
+  Event.sync (Event.send ch n);
+  integers (n+1) ch
+
+let rec sieve n chin chout =
+  let m = Event.sync (Event.receive chin)
+  in if m mod n = 0
+     then sieve n chin chout
+     else Event.sync (Event.send chout m);
+          sieve n chin chout
+
+let rec print_primes ch max =
+  let n = Event.sync (Event.receive ch)
+  in if n > max
+     then ()
+     else begin
+            printf "%d\n" n; flush stdout;
+            let ch_after_n = Event.new_channel ()
+            in Thread.create (sieve n ch) ch_after_n;
+               print_primes ch_after_n max
+          end
+
+let go max =
+  let ch = Event.new_channel ()
+  in Thread.create (integers 2) ch;
+     print_primes ch max;;
+
+let _ = go 1000
+
+;;
diff --git a/otherlibs/threads/Tests/sorts.ml b/otherlibs/threads/Tests/sorts.ml
new file mode 100644 (file)
index 0000000..abc8dc1
--- /dev/null
@@ -0,0 +1,228 @@
+(* Animation of sorting algorithms. *)
+
+open Graphics
+
+(* Information on a given sorting process *)
+
+type graphic_context =
+  { array: int array;                   (* Data to sort *)
+    x0: int;                            (* X coordinate, lower left corner *)
+    y0: int;                            (* Y coordinate, lower left corner *)
+    width: int;                         (* Width in pixels *)
+    height: int;                        (* Height in pixels *)
+    nelts: int;                         (* Number of elements in the array *)
+    maxval: int;                        (* Max val in the array + 1 *)
+    rad: int                            (* Dimension of the rectangles *)
+  }
+
+(* Array assignment and exchange with screen update *)
+
+let screen_mutex = Mutex.create()
+
+let draw gc i v =
+  fill_rect (gc.x0 + (gc.width * i) / gc.nelts)
+            (gc.y0 + (gc.height * v) / gc.maxval)
+            gc.rad gc.rad
+
+let assign gc i v =
+  Mutex.lock screen_mutex;
+  set_color background; draw gc i gc.array.(i);
+  set_color foreground; draw gc i v;
+  gc.array.(i) <- v;
+  Mutex.unlock screen_mutex
+
+let exchange gc i j =
+  let val_i = gc.array.(i) in
+  assign gc i gc.array.(j);
+  assign gc j val_i
+
+(* Construction of a graphic context *)
+
+let initialize name array maxval x y w h =
+  let (_, label_height) = text_size name in
+  let rad = (w - 2) / (Array.length array) - 1 in
+  let gc =
+    { array = Array.copy array;
+      x0 = x + 1;                       (* Leave one pixel left for Y axis *)
+      y0 = y + 1;                       (* Leave one pixel below for X axis *)
+      width = w - 2;                    (* 1 pixel left, 1 pixel right *)
+      height = h - 1 - label_height - rad;
+      nelts = Array.length array;
+      maxval = maxval;
+      rad = rad } in
+  moveto (gc.x0 - 1) (gc.y0 + gc.height);
+  lineto (gc.x0 - 1) (gc.y0 - 1);
+  lineto (gc.x0 + gc.width) (gc.y0 - 1);
+  moveto (gc.x0 - 1) (gc.y0 + gc.height);
+  draw_string name;
+  for i = 0 to Array.length array - 1 do
+    draw gc i array.(i)
+  done;
+  gc
+
+(* Main animation function *)
+
+let display functs nelts maxval =
+  let a = Array.create nelts 0 in
+  for i = 0 to nelts - 1 do
+    a.(i) <- Random.int maxval
+  done;
+  let num_finished = ref 0 in
+  let lock_finished = Mutex.create() in
+  let cond_finished = Condition.create() in
+  for i = 0 to Array.length functs - 1 do
+    let (name, funct, x, y, w, h) = functs.(i) in
+    let gc = initialize name a maxval x y w h in
+    Thread.create
+      (fun () ->
+        funct gc;
+        Mutex.lock lock_finished;
+        incr num_finished;
+        Mutex.unlock lock_finished;
+        Condition.signal cond_finished)
+      ()
+  done;
+  Mutex.lock lock_finished;
+  while !num_finished < Array.length functs do
+    Condition.wait cond_finished lock_finished
+  done;
+  Mutex.unlock lock_finished;
+  read_key()
+
+(*****
+  let delay = ref 0 in
+  try
+    while true do
+      let gc = Queue.take q in
+        begin match gc.action with
+          Finished -> ()
+        | Pause f ->
+            gc.action <- f ();
+            for i = 0 to !delay do () done;
+            Queue.add gc q
+        end;
+      if key_pressed() then begin
+        match read_key() with
+          'q'|'Q' ->
+            raise Exit
+        | '0'..'9' as c ->
+            delay := (Char.code c - 48) * 500
+        | _ ->
+            ()
+      end
+    done
+  with Exit -> ()
+     | Queue.Empty -> read_key(); ()
+*****)
+
+(* The sorting functions. *)
+
+(* Bubble sort *)
+
+let bubble_sort gc =
+  let ordered = ref false in
+  while not !ordered do
+    ordered := true;
+    for i = 0 to Array.length gc.array - 2 do
+      if gc.array.(i+1) < gc.array.(i) then begin
+        exchange gc i (i+1);
+        ordered := false
+      end
+    done
+  done
+
+(* Insertion sort *)
+
+let insertion_sort gc =
+  for i = 1 to Array.length gc.array - 1 do
+    let val_i = gc.array.(i) in
+    let j = ref (i - 1) in
+    while !j >= 0 && val_i < gc.array.(!j) do
+      assign gc (!j + 1) gc.array.(!j);
+      decr j
+    done;
+    assign gc (!j + 1) val_i
+  done
+
+(* Selection sort *)
+
+let selection_sort gc =
+  for i = 0 to Array.length gc.array - 1 do
+    let min = ref i in
+    for j = i+1 to Array.length gc.array - 1 do
+      if gc.array.(j) < gc.array.(!min) then min := j
+    done;
+    exchange gc i !min
+  done
+
+(* Quick sort *)
+
+let quick_sort gc =
+  let rec quick lo hi =
+    if lo < hi then begin
+      let i = ref lo in
+      let j = ref hi in
+      let pivot = gc.array.(hi) in
+      while !i < !j do
+        while !i < hi && gc.array.(!i) <= pivot do incr i done;
+        while !j > lo && gc.array.(!j) >= pivot do decr j done;
+        if !i < !j then exchange gc !i !j
+      done;
+      exchange gc !i hi;
+      quick lo (!i-1);
+      quick (!i+1) hi
+    end
+  in quick 0 (Array.length gc.array - 1)
+
+(* Merge sort *)
+
+let merge_sort gc =
+  let rec merge i l1 l2 =
+    match (l1, l2) with
+      ([], []) ->
+        ()
+    | ([], v2::r2) ->
+        assign gc i v2; merge (i+1) l1 r2
+    | (v1::r1, []) ->
+        assign gc i v1; merge (i+1) r1 l2
+    | (v1::r1, v2::r2) ->
+        if v1 < v2
+        then begin assign gc i v1; merge (i+1) r1 l2 end
+        else begin assign gc i v2; merge (i+1) l1 r2 end in
+  let rec msort start len =
+    if len < 2 then () else begin
+      let m = len / 2 in
+      msort start m;
+      msort (start+m) (len-m);
+      merge start
+            (Array.to_list (Array.sub gc.array start m))
+            (Array.to_list (Array.sub gc.array (start+m) (len-m)))
+    end in
+  msort 0 (Array.length gc.array)
+
+(* Main program *)
+
+let animate() =
+  open_graph "";
+  moveto 0 0; draw_string "Press a key to start...";
+  let seed = ref 0 in
+  while not (key_pressed()) do incr seed done;
+  read_key();
+  Random.init !seed;
+  clear_graph();
+  let prompt = "0: fastest ... 9: slowest, press 'q' to quit" in
+  moveto 0 0; draw_string prompt;
+  let (_, h) = text_size prompt in
+  let sx = size_x() / 2 and sy = (size_y() - h) / 3 in
+  display [| "Bubble", bubble_sort, 0, h, sx, sy;
+             "Insertion", insertion_sort, 0, h+sy, sx, sy;
+             "Selection", selection_sort, 0, h+2*sy, sx, sy;
+             "Quicksort", quick_sort, sx, h, sx, sy;
+             (** "Heapsort", heap_sort, sx, h+sy, sx, sy; **)
+             "Mergesort", merge_sort, sx, h+2*sy, sx, sy |]
+          100 1000;
+  close_graph()
+
+let _ = if !Sys.interactive then () else begin animate(); exit 0 end
+
+;;
diff --git a/otherlibs/threads/Tests/test1.ml b/otherlibs/threads/Tests/test1.ml
new file mode 100644 (file)
index 0000000..9d2cf0a
--- /dev/null
@@ -0,0 +1,57 @@
+(* Classic producer-consumer *)
+
+type 'a prodcons =
+  { buffer: 'a array;
+    lock: Mutex.t;
+    mutable readpos: int;
+    mutable writepos: int;
+    notempty: Condition.t;
+    notfull: Condition.t }
+
+let create size init =
+  { buffer = Array.create size init;
+    lock = Mutex.create();
+    readpos = 0;
+    writepos = 0;
+    notempty = Condition.create();
+    notfull = Condition.create() }
+
+let put p data =
+  Mutex.lock p.lock;
+  while (p.writepos + 1) mod Array.length p.buffer = p.readpos do
+    Condition.wait p.notfull p.lock
+  done;
+  p.buffer.(p.writepos) <- data;
+  p.writepos <- (p.writepos + 1) mod Array.length p.buffer;
+  Condition.signal p.notempty;
+  Mutex.unlock p.lock
+
+let get p =
+  Mutex.lock p.lock;
+  while p.writepos = p.readpos do
+    Condition.wait p.notempty p.lock
+  done;
+  let data = p.buffer.(p.readpos) in
+  p.readpos <- (p.readpos + 1) mod Array.length p.buffer;
+  Condition.signal p.notfull;
+  Mutex.unlock p.lock;
+  data
+
+(* Test *)
+
+let buff = create 20 0
+
+let rec produce n =
+  print_int n; print_string "-->"; print_newline();
+  put buff n;
+  if n < 10000 then produce (n+1)
+
+let rec consume () =
+  let n = get buff in
+  print_string "-->"; print_int n; print_newline();
+  if n < 10000 then consume ()
+
+let t1 = Thread.create produce 0
+let _ = consume ()
+
+;;
diff --git a/otherlibs/threads/Tests/test2.ml b/otherlibs/threads/Tests/test2.ml
new file mode 100644 (file)
index 0000000..926f090
--- /dev/null
@@ -0,0 +1,15 @@
+let yield = ref false
+
+let print_message c =
+  for i = 1 to 10000 do
+    print_char c; flush stdout;
+    if !yield then Thread.yield()
+  done
+
+let _ = yield := (Array.length Sys.argv > 1)
+let t1 = Thread.create print_message 'a'
+let t2 = Thread.create print_message 'b'
+let _ = Thread.join t1
+let _ = Thread.join t2
+
+;;
diff --git a/otherlibs/threads/Tests/test3.ml b/otherlibs/threads/Tests/test3.ml
new file mode 100644 (file)
index 0000000..c6df332
--- /dev/null
@@ -0,0 +1,8 @@
+let print_message delay c =
+  while true do
+    print_char c; flush stdout; Thread.delay delay
+  done
+
+let _ =
+  Thread.create (print_message 0.6666666666) 'a';
+  print_message 1.0 'b'
diff --git a/otherlibs/threads/Tests/test4.ml b/otherlibs/threads/Tests/test4.ml
new file mode 100644 (file)
index 0000000..ff84961
--- /dev/null
@@ -0,0 +1,13 @@
+let rec fib n = if n <= 2 then 1 else fib(n-1) + fib(n-2)
+
+let fibtask n =
+  while true do
+    print_int(fib n); print_newline()
+  done
+
+let _ =
+  Thread.create fibtask 28;
+  while true do
+    let l = read_line () in
+    print_string ">> "; print_string l; print_newline()
+  done
diff --git a/otherlibs/threads/Tests/test5.ml b/otherlibs/threads/Tests/test5.ml
new file mode 100644 (file)
index 0000000..2baffe0
--- /dev/null
@@ -0,0 +1,21 @@
+open Event
+
+let ch = (new_channel() : string channel)
+
+let rec sender msg =
+  sync (send ch msg);
+  sender msg
+
+let rec receiver name =
+  print_string (name ^ ": " ^ sync (receive ch) ^ "\n");
+  flush stdout;
+  receiver name
+
+let _ =
+  Thread.create sender "hello";
+  Thread.create sender "world";
+  Thread.create receiver "A";
+  receiver "B";
+  exit 0
+
+
diff --git a/otherlibs/threads/Tests/test6.ml b/otherlibs/threads/Tests/test6.ml
new file mode 100644 (file)
index 0000000..b846858
--- /dev/null
@@ -0,0 +1,17 @@
+open Event
+
+let ch = (new_channel() : string channel)
+
+let rec f tag msg =
+  select [
+    send ch msg;
+    wrap (receive ch) (fun x -> print_string(tag ^ ": " ^ x); print_newline())
+  ];
+  f tag msg
+
+let _ =
+  Thread.create (f "A") "hello";
+  f "B" "world";
+  exit 0
+
+
diff --git a/otherlibs/threads/Tests/test7.ml b/otherlibs/threads/Tests/test7.ml
new file mode 100644 (file)
index 0000000..e6bd1d8
--- /dev/null
@@ -0,0 +1,28 @@
+open Event
+
+let add_ch = new_channel()
+let sub_ch = new_channel()
+let read_ch = new_channel()
+
+let rec accu n =
+  select [
+    wrap (receive add_ch) (fun x -> accu (n+x));
+    wrap (receive sub_ch) (fun x -> accu (n-x));
+    wrap (send read_ch n) (fun () -> accu n)
+  ]
+
+let rec sender chan value =
+  sync(send chan value); sender chan value
+
+let read () =
+  print_int(sync(receive read_ch)); print_newline()
+
+let main () =
+  Thread.create accu 0;
+  Thread.create (sender add_ch) 1;
+  Thread.create (sender sub_ch) 1;
+  while true do read() done
+
+let _ = Printexc.catch main ()
+
+  
diff --git a/otherlibs/threads/Tests/test8.ml b/otherlibs/threads/Tests/test8.ml
new file mode 100644 (file)
index 0000000..cc587b0
--- /dev/null
@@ -0,0 +1,46 @@
+open Event
+
+type 'a buffer_channel = { input: 'a channel; output: 'a channel }
+
+let new_buffer_channel() =
+  let ic = new_channel() in
+  let oc = new_channel() in
+  let buff = Queue.create() in
+  let rec buffer_process front rear =
+    match (front, rear) with
+      ([], []) -> buffer_process [sync(receive ic)] []
+    | (hd::tl, _) ->
+        select [
+          wrap (receive ic) (fun x -> buffer_process front (x::rear));
+          wrap (send oc hd) (fun () -> buffer_process tl rear)
+        ]
+    | ([], _) -> buffer_process (List.rev rear) [] in
+  Thread.create (buffer_process []) [];
+  { input = ic; output = oc }
+
+let buffer_send bc data =
+  sync(send bc.input data)
+
+let buffer_receive bc =
+  receive bc.output
+
+(* Test *)
+
+let box = new_buffer_channel()
+let ch = new_channel()
+
+let f () =
+  buffer_send box "un";
+  buffer_send box "deux";
+  sync (send ch 3)
+
+let g () =
+  print_int (sync(receive ch)); print_newline();
+  print_string (sync(buffer_receive box)); print_newline();
+  print_string (sync(buffer_receive box)); print_newline()
+
+let _ =
+  Thread.create f ();
+  g()
+
+
diff --git a/otherlibs/threads/Tests/test9.ml b/otherlibs/threads/Tests/test9.ml
new file mode 100644 (file)
index 0000000..1f80beb
--- /dev/null
@@ -0,0 +1,26 @@
+open Event
+
+type 'a swap_chan = ('a * 'a channel) channel
+
+let swap msg_out ch =
+  guard (fun () ->
+    let ic = new_channel() in
+    choose [
+      wrap (receive ch) (fun (msg_in, oc) -> sync (send oc msg_out); msg_in);
+      wrap (send ch (msg_out, ic)) (fun () -> sync (receive ic))
+    ])
+
+let ch = new_channel()
+
+let f () =
+  let res = sync (swap "F" ch) in
+  print_string "f "; print_string res; print_newline()
+
+let g () =
+  let res = sync (swap "G" ch) in
+  print_string "g "; print_string res; print_newline()
+
+let _ =
+  let id = Thread.create f () in
+  g ();
+  Thread.join id
diff --git a/otherlibs/threads/Tests/testA.ml b/otherlibs/threads/Tests/testA.ml
new file mode 100644 (file)
index 0000000..b1999b8
--- /dev/null
@@ -0,0 +1,24 @@
+let private_data = (Hashtbl.create 17 : (Thread.t, string) Hashtbl.t)
+let private_data_lock = Mutex.create()
+
+let set_private_data data =
+  Mutex.lock private_data_lock;
+  Hashtbl.add private_data (Thread.self()) data;
+  Mutex.unlock private_data_lock
+
+let get_private_data () =
+  Hashtbl.find private_data (Thread.self())
+
+let process id data =
+  set_private_data data;
+  print_int id; print_string " --> "; print_string(get_private_data());
+  print_newline()
+
+let _ =
+  let t1 = Thread.create (process 1) "un" in
+  let t2 = Thread.create (process 2) "deux" in
+  let t3 = Thread.create (process 3) "trois" in
+  let t4 = Thread.create (process 4) "quatre" in
+  let t5 = Thread.create (process 5) "cinq" in
+  List.iter Thread.join [t1;t2;t3;t4;t5]
+
diff --git a/otherlibs/threads/Tests/testexit.ml b/otherlibs/threads/Tests/testexit.ml
new file mode 100644 (file)
index 0000000..2045c25
--- /dev/null
@@ -0,0 +1,22 @@
+(* Test Thread.exit *)
+
+let somethread (name, limit, last) =
+  let counter = ref 0 in
+  while true do
+    incr counter;
+    if !counter >= limit then begin
+      print_string (name ^ " exiting\n");
+      flush stdout;
+      if last then exit 0 else Thread.exit()
+    end;
+    print_string (name ^ ": " ^ string_of_int !counter ^ "\n");
+    flush stdout;
+    Thread.delay 0.5
+  done
+
+let _ =
+  let _ = Thread.create somethread ("A", 5, false) in
+  let _ = Thread.create somethread ("B", 8, false) in
+  let _ = Thread.create somethread ("C", 11, true) in
+  somethread ("Main", 3, false)
+
diff --git a/otherlibs/threads/Tests/testio.ml b/otherlibs/threads/Tests/testio.ml
new file mode 100644 (file)
index 0000000..95064a6
--- /dev/null
@@ -0,0 +1,120 @@
+(* Test a file copy function *)
+
+let test msg producer consumer src dst =
+  print_string msg; print_newline();
+  let ic = open_in_bin src in
+  let oc = open_out_bin dst in
+  let (in_fd, out_fd) = Unix.pipe() in
+  let ipipe = Unix.in_channel_of_descr in_fd in
+  let opipe = Unix.out_channel_of_descr out_fd in
+  let prod = Thread.create producer (ic, opipe) in
+  let cons = Thread.create consumer (ipipe, oc) in
+  Thread.join prod;
+  Thread.join cons;
+  if Unix.system ("cmp " ^ src ^ " " ^ dst) = Unix.WEXITED 0
+  then print_string "passed"
+  else print_string "FAILED";
+  print_newline()
+
+(* File copy with constant-sized chunks *)
+
+let copy_file sz (ic, oc) =
+  let buffer = String.create sz in
+  let rec copy () =
+    let n = input ic buffer 0 sz in
+    if n = 0 then () else begin
+      output oc buffer 0 n;
+      copy ()
+    end in
+  copy();
+  close_in ic;
+  close_out oc
+
+(* File copy with random-sized chunks *)
+
+let copy_random sz (ic, oc) =
+  let buffer = String.create sz in
+  let rec copy () =
+    let s = 1 + Random.int sz in
+    let n = input ic buffer 0 s in
+    if n = 0 then () else begin
+      output oc buffer 0 n;
+      copy ()
+    end in
+  copy();
+  close_in ic;
+  close_out oc
+
+(* File copy line per line *)
+
+let copy_line (ic, oc) =
+  try
+    while true do
+      output_string oc (input_line ic); output_char oc '\n'
+    done
+  with End_of_file ->
+    close_in ic;
+    close_out oc
+
+(* Create long lines of text *)
+
+let make_lines ofile =
+  let oc = open_out ofile in
+  for i = 1 to 256 do
+    output_string oc (String.make (i*16) '.'); output_char oc '\n'
+  done;
+  close_out oc
+
+(* Test input_line on truncated lines *)
+
+let test_trunc_line ofile =
+  print_string "truncated line"; print_newline();
+  let oc = open_out ofile in
+  output_string oc "A line without newline!";
+  close_out oc;
+  try
+    let ic = open_in ofile in
+    let s = input_line ic in
+    close_in ic;
+    if s = "A line without newline!"
+    then print_string "passed"
+    else print_string "FAILED";
+    print_newline()
+  with End_of_file ->
+    print_string "FAILED"; print_newline()  
+
+(* The test *)
+
+let main() =
+  let ifile = Sys.argv.(1) in
+  let ofile = Filename.temp_file "testio" "" in
+  test "256-byte chunks, 256-byte chunks"
+       (copy_file 256) (copy_file 256) ifile ofile;
+  test "4096-byte chunks, 4096-byte chunks"
+       (copy_file 4096) (copy_file 4096) ifile ofile;
+  test "65536-byte chunks, 65536-byte chunks"
+       (copy_file 65536) (copy_file 65536) ifile ofile;
+  test "256-byte chunks, 4096-byte chunks"
+       (copy_file 256) (copy_file 4096) ifile ofile;
+  test "4096-byte chunks, 256-byte chunks"
+       (copy_file 4096) (copy_file 256) ifile ofile;
+  test "4096-byte chunks, 65536-byte chunks"
+       (copy_file 4096) (copy_file 65536) ifile ofile;
+  test "263-byte chunks, 4011-byte chunks"
+       (copy_file 263) (copy_file 4011) ifile ofile;
+  test "613-byte chunks, 1027-byte chunks"
+       (copy_file 613) (copy_file 1027) ifile ofile;
+  test "0...8192 byte chunks"
+       (copy_random 8192) (copy_random 8192) ifile ofile;
+  test "line per line, short lines"
+       copy_line copy_line "/etc/hosts" ofile;
+  let linesfile = Filename.temp_file "lines" "" in
+  make_lines linesfile;
+  test "line per line, short and long lines"
+       copy_line copy_line linesfile ofile;
+  test_trunc_line ofile;
+  Sys.remove linesfiles;
+  Sys.remove ofile;
+  exit 0
+
+let _ = Unix.handle_unix_error main (); exit 0
diff --git a/otherlibs/threads/Tests/testsieve.ml b/otherlibs/threads/Tests/testsieve.ml
new file mode 100644 (file)
index 0000000..6079d8a
--- /dev/null
@@ -0,0 +1,42 @@
+let sieve primes=
+  Event.sync (Event.send primes 0);
+  Event.sync (Event.send primes 1);
+  Event.sync (Event.send primes 2);
+  let integers = Event.new_channel () in
+  let rec enumerate n=
+    Event.sync (Event.send integers n);
+    enumerate (n + 2)
+  and filter inpout =
+    let n = Event.sync (Event.receive inpout)
+    (* On prepare le terrain pour l'appel recursif *)
+    and output = Event.new_channel () in
+    (* Celui qui etait en tete du crible est premier *)
+    Event.sync (Event.send primes n);
+    Thread.create filter output;
+    (* On elimine de la sortie ceux qui sont des multiples de n *)
+    while true do
+        let m = Event.sync (Event.receive inpout) in
+        (* print_int n; print_string ": "; print_int m; print_newline(); *)
+        if (m mod n) = 0
+        then ()
+        else ((Event.sync (Event.send output m));())
+      done in
+  Thread.create filter integers;
+  Thread.create enumerate 3
+
+let premiers = Event.new_channel ()
+
+let main _ =
+  Thread.create sieve premiers;
+  while true do
+    for i = 1 to 100 do
+      let n = Event.sync (Event.receive premiers) in
+      print_int n; print_newline()
+    done;
+    exit 0
+    done
+
+
+let _ =
+  try main ()
+  with _ -> exit 0;;
diff --git a/otherlibs/threads/Tests/testsignal.ml b/otherlibs/threads/Tests/testsignal.ml
new file mode 100644 (file)
index 0000000..7781f33
--- /dev/null
@@ -0,0 +1,13 @@
+let sighandler _ =
+  print_string "Got ctrl-C, exiting..."; print_newline();
+  exit 0
+
+let print_message delay c =
+  while true do
+    print_char c; flush stdout; Thread.delay delay
+  done
+
+let _ =
+  Sys.signal Sys.sigint (Sys.Signal_handle sighandler);
+  Thread.create (print_message 0.6666666666) 'a';
+  print_message 1.0 'b'
diff --git a/otherlibs/threads/Tests/testsignal2.ml b/otherlibs/threads/Tests/testsignal2.ml
new file mode 100644 (file)
index 0000000..1f7fc0f
--- /dev/null
@@ -0,0 +1,10 @@
+let print_message delay c =
+  while true do
+    print_char c; flush stdout; Thread.delay delay
+  done
+
+let _ =
+  let th1 = Thread.create (print_message 0.6666666666) 'a' in
+  let th2 = Thread.create (print_message 1.0) 'b' in
+  let s = Thread.wait_signal [Sys.sigint; Sys.sigterm] in
+  Printf.printf "Got signal %d, exiting...\n" s
diff --git a/otherlibs/threads/Tests/testsocket.ml b/otherlibs/threads/Tests/testsocket.ml
new file mode 100644 (file)
index 0000000..d0f14cb
--- /dev/null
@@ -0,0 +1,31 @@
+open Unix
+
+let engine number address =
+  print_int number; print_string "> connecting"; print_newline();
+  let (ic, oc) = open_connection (ADDR_INET(address, 80)) in
+  print_int number; print_string "> connected"; print_newline();
+  output_string oc "GET / HTTP1.0\r\n\r\n"; flush oc;
+  try
+    while true do
+      let s = input_line ic in
+      print_int number; print_string ">"; print_string s; print_newline()
+    done
+  with End_of_file ->
+    close_out oc
+
+let main() =
+  let addresses = Array.create (Array.length Sys.argv - 1) inet_addr_any in
+  for i = 1 to Array.length Sys.argv - 1 do
+    addresses.(i - 1) <- (gethostbyname Sys.argv.(i)).h_addr_list.(0)
+  done;
+  let processes = Array.create (Array.length addresses) (Thread.self()) in
+  for i = 0 to Array.length addresses - 1 do
+    processes.(i) <- Thread.create (engine i) addresses.(i)
+  done;
+  for i = 0 to Array.length processes - 1 do
+    Thread.join processes.(i)
+  done
+
+let _ = Printexc.catch main (); exit 0
+
+    
diff --git a/otherlibs/threads/Tests/token1.ml b/otherlibs/threads/Tests/token1.ml
new file mode 100644 (file)
index 0000000..fb0ddb2
--- /dev/null
@@ -0,0 +1,36 @@
+(* Performance test for mutexes and conditions *)
+
+let mut = Mutex.create()
+
+let niter = ref 0
+
+let token = ref 0
+
+let process (n, conds, nprocs) =
+  while true do
+    Mutex.lock mut;
+    while !token <> n do 
+      (* Printf.printf "Thread %d waiting (token = %d)\n" n !token; *)
+      Condition.wait conds.(n) mut
+    done;
+    (* Printf.printf "Thread %d got token %d\n" n !token; *)
+    incr token;
+    if !token >= nprocs then token := 0;
+    if n = 0 then begin
+      decr niter;
+      if !niter <= 0 then exit 0
+    end;
+    Condition.signal conds.(!token);
+    Mutex.unlock mut
+  done
+
+let main() =
+  let nprocs = int_of_string Sys.argv.(1) in
+  let iter = int_of_string Sys.argv.(2) in
+  let conds = Array.create nprocs (Condition.create()) in
+  for i = 1 to nprocs - 1 do conds.(i) <- Condition.create() done;
+  niter := iter;
+  for i = 0 to nprocs - 1 do Thread.create process (i, conds, nprocs) done;
+  Thread.delay 3600.
+
+let _ = main()
diff --git a/otherlibs/threads/Tests/token2.ml b/otherlibs/threads/Tests/token2.ml
new file mode 100644 (file)
index 0000000..32b897d
--- /dev/null
@@ -0,0 +1,36 @@
+(* Performance test for I/O scheduling *)
+
+let mut = Mutex.create()
+
+let niter = ref 0
+
+let token = ref 0
+
+let process (n, ins, outs, nprocs) =
+  let buf = String.create 1 in
+  while true do
+    Unix.read ins.(n) buf 0 1;
+    (* Printf.printf "Thread %d got the token\n" n; *)
+    if n = 0 then begin
+      decr niter;
+      if !niter <= 0 then exit 0
+    end;
+    let next = if n + 1 >= nprocs then 0 else n + 1 in
+    (* Printf.printf "Thread %d sending token to thread %d\n" n next; *)
+    Unix.write outs.(next) buf 0 1
+  done
+
+let main() =
+  let nprocs = int_of_string Sys.argv.(1) in
+  let iter = int_of_string Sys.argv.(2) in
+  let ins = Array.create nprocs Unix.stdin in
+  let outs = Array.create nprocs Unix.stdout in
+  for n = 0 to nprocs - 1 do
+    let (i, o) = Unix.pipe() in ins.(n) <- i; outs.(n) <- o
+  done;
+  niter := iter;
+  for i = 0 to nprocs - 1 do Thread.create process (i, ins, outs, nprocs) done;
+  Unix.write outs.(0) "X" 0 1;
+  Thread.delay 3600.
+
+let _ = main()
diff --git a/otherlibs/threads/Tests/torture.ml b/otherlibs/threads/Tests/torture.ml
new file mode 100644 (file)
index 0000000..b52766d
--- /dev/null
@@ -0,0 +1,46 @@
+(* Torture test - lots of GC *)
+
+let gc_thread () =
+  while true do
+(*    print_string "gc"; print_newline(); *)
+    Gc.minor();
+    Thread.yield()
+  done
+
+let stdin_thread () =
+  while true do
+    print_string "> "; flush stdout;
+    let s = read_line() in
+    print_string ">>> "; print_string s; print_newline()
+  done
+
+let writer_thread (oc, size) =
+  while true do
+(*    print_string "writer "; print_int size; print_newline(); *)
+    let buff = String.make size 'a' in
+    Unix.write oc buff 0 size
+  done
+
+let reader_thread (ic, size) =
+  while true do
+(*    print_string "reader "; print_int size; print_newline(); *)
+    let buff = String.create size in
+    let n = Unix.read ic buff 0 size in
+(*    print_string "reader "; print_int n; print_newline(); *)
+    for i = 0 to n-1 do
+      if buff.[i] <> 'a' then prerr_endline "error in reader_thread"
+    done
+  done
+
+let main() =
+  Thread.create gc_thread ();
+  let (out1, in1) = Unix.pipe() in
+  Thread.create writer_thread (in1, 4096);
+  Thread.create reader_thread (out1, 4096);
+  let (out2, in2) = Unix.pipe() in
+  Thread.create writer_thread (in2, 16);
+  Thread.create reader_thread (out2, 16);
+  stdin_thread()
+
+let _ = main()
+
index 48d2c07d2cb37c0adea24cfa94b91c613a5c1a80..54b060e7bf3a4d163d0cfba062035ca784651a16 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: gethost.c,v 1.26 2005/10/13 14:50:37 xleroy Exp $ */
+/* $Id: gethost.c,v 1.26.2.1 2006/06/10 09:10:41 xleroy Exp $ */
 
 #include <string.h>
 #include <mlvalues.h>
@@ -62,7 +62,12 @@ static value alloc_host_entry(struct hostent *entry)
 
   Begin_roots4 (name, aliases, addr_list, adr);
     name = copy_string((char *)(entry->h_name));
-    aliases = copy_string_array((const char**)entry->h_aliases);
+    /* PR#4043: protect against buggy implementations of gethostbyname()
+       that return a NULL pointer in h_aliases */
+    if (entry->h_aliases)
+      aliases = copy_string_array((const char**)entry->h_aliases);
+    else
+      aliases = Atom(0);
     entry_h_length = entry->h_length;
 #ifdef h_addr
     addr_list = alloc_array(alloc_one_addr, (const char**)entry->h_addr_list);
index 015a10a7ea93e97638e8e27b4fbd8cb839960d2c..3b477e0e5dfad9e1f026fbbd6e306fe635d85c4a 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: camlinternalMod.ml,v 1.4 2005/10/25 18:34:07 doligez Exp $ *)
+(* $Id: camlinternalMod.ml,v 1.4.2.1 2006/05/06 07:27:40 xleroy Exp $ *)
 
 type shape =
   | Function
@@ -45,7 +45,7 @@ let rec update_mod shape o n =
   match shape with
   | Function ->
       if Obj.tag n = Obj.closure_tag && Obj.size n <= Obj.size o
-      then overwrite o n
+      then begin overwrite o n; Obj.truncate o (Obj.size n) (* PR #4008 *) end
       else overwrite o (Obj.repr (fun x -> (Obj.obj n : _ -> _) x))
   | Lazy ->
       assert (Obj.tag n = Obj.lazy_tag);
index b9875b65f8e16cb3f246f72038944198aaaa1809..f2443a918773a38b2c1f106dc2fae1273f67496e 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: sys.ml,v 1.138.2.19 2006/04/14 09:53:48 doligez Exp $ *)
+(* $Id: sys.ml,v 1.138.2.22 2006/08/30 09:38:44 doligez Exp $ *)
 
 (* System interface *)
 
@@ -78,4 +78,4 @@ let catch_break on =
 
 (* OCaml version string, must be in the format described in sys.mli. *)
 
-let ocaml_version = "3.09.2";;
+let ocaml_version = "3.09.3+rc1";;
diff --git a/test/.cvsignore b/test/.cvsignore
new file mode 100644 (file)
index 0000000..66d34d7
--- /dev/null
@@ -0,0 +1,2 @@
+*.byt
+*.out
diff --git a/test/.depend b/test/.depend
new file mode 100644 (file)
index 0000000..ac5de61
--- /dev/null
@@ -0,0 +1,28 @@
+KB/equations.cmi: KB/terms.cmi 
+KB/kb.cmi: KB/equations.cmi KB/terms.cmi 
+KB/orderings.cmi: KB/terms.cmi 
+KB/equations.cmo: KB/equations.cmi KB/terms.cmi 
+KB/equations.cmx: KB/equations.cmi KB/terms.cmx 
+KB/kb.cmo: KB/kb.cmi KB/equations.cmi KB/terms.cmi 
+KB/kb.cmx: KB/kb.cmi KB/equations.cmx KB/terms.cmx 
+KB/kbmain.cmo: KB/kb.cmi KB/orderings.cmi KB/equations.cmi KB/terms.cmi 
+KB/kbmain.cmx: KB/kb.cmx KB/orderings.cmx KB/equations.cmx KB/terms.cmx 
+KB/orderings.cmo: KB/orderings.cmi KB/terms.cmi 
+KB/orderings.cmx: KB/orderings.cmi KB/terms.cmx 
+KB/terms.cmo: KB/terms.cmi 
+KB/terms.cmx: KB/terms.cmi 
+Lex/grammar.cmi: Lex/syntax.cmo 
+Lex/gram_aux.cmo: Lex/syntax.cmo 
+Lex/gram_aux.cmx: Lex/syntax.cmx 
+Lex/grammar.cmo: Lex/grammar.cmi Lex/gram_aux.cmo Lex/syntax.cmo 
+Lex/grammar.cmx: Lex/grammar.cmi Lex/gram_aux.cmx Lex/syntax.cmx 
+Lex/lexgen.cmo: Lex/syntax.cmo 
+Lex/lexgen.cmx: Lex/syntax.cmx 
+Lex/main.cmo: Lex/lexgen.cmo Lex/output.cmo Lex/grammar.cmi \
+    Lex/scanner.cmo Lex/syntax.cmo Lex/scan_aux.cmo 
+Lex/main.cmx: Lex/lexgen.cmx Lex/output.cmx Lex/grammar.cmx \
+    Lex/scanner.cmx Lex/syntax.cmx Lex/scan_aux.cmx 
+Lex/output.cmo: Lex/syntax.cmo 
+Lex/output.cmx: Lex/syntax.cmx 
+Lex/scanner.cmo: Lex/syntax.cmo Lex/scan_aux.cmo Lex/grammar.cmi 
+Lex/scanner.cmx: Lex/syntax.cmx Lex/scan_aux.cmx Lex/grammar.cmx 
diff --git a/test/KB/equations.ml b/test/KB/equations.ml
new file mode 100644 (file)
index 0000000..b041aaa
--- /dev/null
@@ -0,0 +1,115 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: equations.ml,v 1.5 1999/11/17 18:58:35 xleroy Exp $ *)
+
+(****************** Equation manipulations *************)
+
+open Terms
+
+type rule = 
+  { number: int;
+    numvars: int;
+    lhs: term;
+    rhs: term }
+
+(* standardizes an equation so its variables are 1,2,... *)
+
+let mk_rule num m n =
+  let all_vars = union (vars m) (vars n) in
+  let counter = ref 0 in
+  let subst =
+    List.map (fun v -> incr counter; (v, Var !counter)) (List.rev all_vars) in
+  { number = num;
+    numvars = !counter;
+    lhs = substitute subst m;
+    rhs = substitute subst n }
+
+
+(* checks that rules are numbered in sequence and returns their number *)
+
+let check_rules rules =
+  let counter = ref 0 in
+  List.iter (fun r -> incr counter;
+                 if r.number <> !counter
+                 then failwith "Rule numbers not in sequence")
+       rules;
+  !counter
+
+
+let pretty_rule rule =
+  print_int rule.number; print_string " : ";
+  pretty_term rule.lhs; print_string " = "; pretty_term rule.rhs;
+  print_newline()
+
+
+let pretty_rules rules = List.iter pretty_rule rules
+(****************** Rewriting **************************)
+
+(* Top-level rewriting. Let eq:L=R be an equation, M be a term such that L<=M.
+   With sigma = matching L M, we define the image of M by eq as sigma(R) *)
+let reduce l m r =
+  substitute (matching l m) r
+
+(* Test whether m can be reduced by l, i.e. m contains an instance of l. *)
+
+let can_match l m =
+  try let _ = matching l m in true
+  with Failure _ -> false
+
+let rec reducible l m =
+  can_match l m ||
+   (match m with
+    | Term(_,sons) -> List.exists (reducible l) sons
+    |         _     -> false)
+
+(* Top-level rewriting with multiple rules. *)
+
+let rec mreduce rules m =
+  match rules with
+    [] -> failwith "mreduce"
+  | rule::rest ->
+      try
+        reduce rule.lhs m rule.rhs
+      with Failure _ ->
+        mreduce rest m
+
+
+(* One step of rewriting in leftmost-outermost strategy,
+   with multiple rules. Fails if no redex is found *)
+
+let rec mrewrite1 rules m =
+  try
+    mreduce rules m
+  with Failure _ ->
+    match m with
+      Var n -> failwith "mrewrite1"
+    | Term(f, sons) -> Term(f, mrewrite1_sons rules sons)
+
+and mrewrite1_sons rules = function
+    [] -> failwith "mrewrite1"
+  | son::rest ->
+      try
+        mrewrite1 rules son :: rest
+      with Failure _ ->
+        son :: mrewrite1_sons rules rest
+
+
+(* Iterating rewrite1. Returns a normal form. May loop forever *)
+
+let rec mrewrite_all rules m =
+  try
+    mrewrite_all rules (mrewrite1 rules m)
+  with Failure _ ->
+    m
+
diff --git a/test/KB/equations.mli b/test/KB/equations.mli
new file mode 100644 (file)
index 0000000..8030f5b
--- /dev/null
@@ -0,0 +1,32 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: equations.mli,v 1.5 1999/11/17 18:58:35 xleroy Exp $ *)
+
+open Terms
+
+type rule = 
+  { number: int;
+    numvars: int;
+    lhs: term;
+    rhs: term }
+
+val mk_rule: int -> term -> term -> rule
+val check_rules: rule list -> int
+val pretty_rule: rule -> unit
+val pretty_rules: rule list -> unit
+val reduce: term -> term -> term -> term
+val reducible: term -> term -> bool
+val mreduce: rule list -> term -> term
+val mrewrite1: rule list -> term -> term
+val mrewrite1_sons: rule list -> term list -> term list
+val mrewrite_all: rule list -> term -> term
diff --git a/test/KB/kb.ml b/test/KB/kb.ml
new file mode 100644 (file)
index 0000000..6b729d5
--- /dev/null
@@ -0,0 +1,188 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: kb.ml,v 1.5 1999/11/17 18:58:35 xleroy Exp $ *)
+
+open Terms
+open Equations
+
+(****************** Critical pairs *********************)
+
+(* All (u,subst) such that N/u (&var) unifies with M,
+   with principal unifier subst *)
+
+let rec super m = function
+    Term(_,sons) as n ->
+      let rec collate n = function
+        [] -> []
+      | son::rest ->
+          List.map (fun (u, subst) -> (n::u, subst)) (super m son)
+          @ collate (n+1) rest in
+      let insides = collate 1 sons in
+        begin try
+          ([], unify m n) :: insides
+        with Failure _ ->
+          insides
+        end
+  | _ -> []
+
+
+(* Ex :
+let (m,_) = <<F(A,B)>> 
+and (n,_) = <<H(F(A,x),F(x,y))>> in super m n
+==> [[1],[2,Term ("B",[])];                      x <- B
+     [2],[2,Term ("A",[]); 1,Term ("B",[])]]     x <- A  y <- B
+*)
+
+(* All (u,subst), u&[], such that n/u unifies with m *)
+
+let super_strict m = function
+    Term(_,sons) ->
+      let rec collate n = function
+        [] -> []
+      | son::rest ->
+          List.map (fun (u, subst) -> (n::u, subst)) (super m son)
+          @ collate (n+1) rest in
+      collate 1 sons
+    | _ -> []
+
+
+(* Critical pairs of l1=r1 with l2=r2 *)
+(* critical_pairs : term_pair -> term_pair -> term_pair list *)
+let critical_pairs (l1,r1) (l2,r2) =
+  let mk_pair (u,subst) =
+     substitute subst (replace l2 u r1), substitute subst r2 in
+  List.map mk_pair (super l1 l2)
+
+(* Strict critical pairs of l1=r1 with l2=r2 *)
+(* strict_critical_pairs : term_pair -> term_pair -> term_pair list *)
+let strict_critical_pairs (l1,r1) (l2,r2) =
+  let mk_pair (u,subst) =
+    substitute subst (replace l2 u r1), substitute subst r2 in
+  List.map mk_pair (super_strict l1 l2)
+
+
+(* All critical pairs of eq1 with eq2 *)
+let mutual_critical_pairs eq1 eq2 =
+  (strict_critical_pairs eq1 eq2) @ (critical_pairs eq2 eq1)
+
+(* Renaming of variables *)
+
+let rename n (t1,t2) =
+  let rec ren_rec = function
+    Var k -> Var(k+n)
+  | Term(op,sons) -> Term(op, List.map ren_rec sons) in
+  (ren_rec t1, ren_rec t2)
+
+
+(************************ Completion ******************************)
+
+let deletion_message rule =
+  print_string "Rule ";print_int rule.number; print_string " deleted";
+  print_newline()
+
+
+(* Generate failure message *)
+let non_orientable (m,n) =
+    pretty_term m; print_string " = "; pretty_term n; print_newline()
+
+
+let rec partition p = function
+    [] -> ([], [])
+  | x::l -> let (l1, l2) = partition p l in
+            if p x then (x::l1, l2) else (l1, x::l2)
+
+
+let rec get_rule n = function
+    [] -> raise Not_found
+  | r::l -> if n = r.number then r else get_rule n l
+
+
+(* Improved Knuth-Bendix completion procedure *)
+
+let kb_completion greater = 
+  let rec kbrec j rules =
+  let rec process failures (k,l) eqs =
+(****
+     print_string "***kb_completion "; print_int j; print_newline();
+     pretty_rules rules;
+     List.iter non_orientable failures;
+     print_int k; print_string " "; print_int l; print_newline();
+     List.iter non_orientable eqs;
+***)
+    match eqs with
+      [] ->
+        if k<l then next_criticals failures (k+1,l) else
+        if l<j then next_criticals failures (1,l+1) else
+        begin match failures with
+            [] -> rules (* successful completion *)
+          | _  -> print_string "Non-orientable equations :"; print_newline();
+                  List.iter non_orientable failures;
+                  failwith "kb_completion"
+        end
+    | (m,n)::eqs ->
+        let m' = mrewrite_all rules m
+        and n' = mrewrite_all rules n
+        and enter_rule(left,right) =
+          let new_rule = mk_rule (j+1) left right in
+          pretty_rule new_rule;
+          let left_reducible rule = reducible left rule.lhs in
+          let (redl,irredl) = partition left_reducible rules in
+          List.iter deletion_message redl;
+          let right_reduce rule =
+            mk_rule rule.number rule.lhs
+                    (mrewrite_all (new_rule::rules) rule.rhs) in
+          let irreds = List.map right_reduce irredl in
+          let eqs' = List.map (fun rule -> (rule.lhs, rule.rhs)) redl in
+          kbrec (j+1) (new_rule::irreds) [] (k,l) (eqs @ eqs' @ failures) in
+(***
+        print_string "--- Considering "; non_orientable (m', n');
+***)
+        if m' = n' then process failures (k,l) eqs else
+        if greater(m',n') then enter_rule(m',n') else
+        if greater(n',m') then enter_rule(n',m') else
+        process ((m',n')::failures) (k,l) eqs
+
+  and next_criticals failures (k,l) =
+(****
+    print_string "***next_criticals ";
+    print_int k; print_string " "; print_int l ; print_newline();
+****)
+    try
+      let rl = get_rule l rules in
+      let el = (rl.lhs, rl.rhs) in
+        if k=l then
+          process failures (k,l)
+                  (strict_critical_pairs el (rename rl.numvars el))
+        else
+          try
+            let rk = get_rule k rules in 
+            let ek = (rk.lhs, rk.rhs) in
+              process failures (k,l)
+                      (mutual_critical_pairs el (rename rl.numvars ek))
+          with Not_found -> next_criticals failures (k+1,l)
+    with Not_found -> next_criticals failures (1,l+1)
+  in process
+  in kbrec
+
+
+(* complete_rules is assumed locally confluent, and checked Noetherian with
+  ordering greater, rules is any list of rules *)
+
+let kb_complete greater complete_rules rules =
+    let n = check_rules complete_rules
+    and eqs = List.map (fun rule -> (rule.lhs, rule.rhs)) rules in
+    let completed_rules =
+      kb_completion greater n complete_rules [] (n,n) eqs in
+    print_string "Canonical set found :"; print_newline();
+    pretty_rules (List.rev completed_rules)
+
diff --git a/test/KB/kb.mli b/test/KB/kb.mli
new file mode 100644 (file)
index 0000000..4969b10
--- /dev/null
@@ -0,0 +1,29 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: kb.mli,v 1.4 1999/11/17 18:58:35 xleroy Exp $ *)
+
+open Terms
+open Equations
+
+val super: term -> term -> (int list * (int * term) list) list
+val super_strict: term -> term -> (int list * (int * term) list) list
+val critical_pairs: term * term -> term * term -> (term * term) list
+val strict_critical_pairs: term * term -> term * term -> (term * term) list
+val mutual_critical_pairs: term * term -> term * term -> (term * term) list
+val rename: int -> term * term -> term * term
+val deletion_message: rule -> unit
+val non_orientable: term * term -> unit
+val partition: ('a -> bool) -> 'a list -> 'a list * 'a list
+val get_rule: int -> rule list -> rule
+val kb_completion: (term * term -> bool) -> int -> rule list -> (term * term) list -> int * int -> (term * term) list -> rule list
+val kb_complete: (term * term -> bool) -> rule list -> rule list -> unit
diff --git a/test/KB/kbmain.ml b/test/KB/kbmain.ml
new file mode 100644 (file)
index 0000000..b2979fc
--- /dev/null
@@ -0,0 +1,82 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: kbmain.ml,v 1.6 2005/08/12 09:22:04 xleroy Exp $ *)
+
+open Terms
+open Equations
+open Orderings
+open Kb
+
+(****
+let group_rules = [
+  { number = 1; numvars = 1;
+    lhs = Term("*", [Term("U",[]); Var 1]); rhs = Var 1 };
+  { number = 2; numvars = 1;
+    lhs = Term("*", [Term("I",[Var 1]); Var 1]); rhs = Term("U",[]) };
+  { number = 3; numvars = 3;
+    lhs = Term("*", [Term("*", [Var 1; Var 2]); Var 3]);
+    rhs = Term("*", [Var 1; Term("*", [Var 2; Var 3])]) }
+]
+****)
+
+let geom_rules = [
+  { number = 1; numvars = 1;
+    lhs = Term ("*",[(Term ("U",[])); (Var 1)]);
+    rhs = Var 1 };
+  { number = 2; numvars = 1;
+    lhs = Term ("*",[(Term ("I",[(Var 1)])); (Var 1)]);
+    rhs = Term ("U",[]) };
+  { number = 3; numvars = 3;
+    lhs = Term ("*",[(Term ("*",[(Var 1); (Var 2)])); (Var 3)]);
+    rhs = Term ("*",[(Var 1); (Term ("*",[(Var 2); (Var 3)]))]) };
+  { number = 4; numvars = 0;
+    lhs = Term ("*",[(Term ("A",[])); (Term ("B",[]))]);
+    rhs = Term ("*",[(Term ("B",[])); (Term ("A",[]))]) };
+  { number = 5; numvars = 0;
+    lhs = Term ("*",[(Term ("C",[])); (Term ("C",[]))]);
+    rhs = Term ("U",[]) };
+  { number = 6; numvars = 0;
+    lhs = Term("*",
+            [(Term ("C",[]));
+             (Term ("*",[(Term ("A",[])); (Term ("I",[(Term ("C",[]))]))]))]);
+    rhs = Term ("I",[(Term ("A",[]))]) };
+  { number = 7; numvars = 0;
+    lhs = Term("*",
+            [(Term ("C",[]));
+             (Term ("*",[(Term ("B",[])); (Term ("I",[(Term ("C",[]))]))]))]);
+    rhs = Term ("B",[]) }
+]
+
+let group_rank = function
+    "U" -> 0
+  | "*" -> 1
+  | "I" -> 2
+  | "B" -> 3
+  | "C" -> 4
+  | "A" -> 5
+  | _ -> assert false
+
+let group_precedence op1 op2 =
+  let r1 = group_rank op1
+  and r2 = group_rank op2 in
+    if r1 = r2 then Equal else
+    if r1 > r2 then Greater else NotGE
+
+let group_order = rpo group_precedence lex_ext 
+
+let greater pair =
+  match group_order pair with Greater -> true | _ -> false
+
+let _ =
+  for i = 1 to 20 do kb_complete greater [] geom_rules done
+
diff --git a/test/KB/orderings.ml b/test/KB/orderings.ml
new file mode 100644 (file)
index 0000000..7e6604a
--- /dev/null
@@ -0,0 +1,99 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: orderings.ml,v 1.4 1999/11/17 18:58:36 xleroy Exp $ *)
+
+(*********************** Recursive Path Ordering ****************************)
+
+open Terms
+
+type ordering = 
+    Greater
+  | Equal
+  | NotGE
+
+let ge_ord order pair = match order pair with NotGE -> false | _ -> true
+and gt_ord order pair = match order pair with Greater -> true | _ -> false
+and eq_ord order pair = match order pair with Equal -> true | _ -> false
+
+
+let rec rem_eq equiv x = function
+     []  -> failwith "rem_eq"
+  | y::l -> if equiv (x,y) then l else y :: rem_eq equiv x l
+
+
+let diff_eq equiv (x,y) =
+  let rec diffrec = function
+      ([],_) as p -> p
+    | (h::t, y)   -> try
+                       diffrec (t, rem_eq equiv h y)
+                     with Failure _ ->
+                       let (x',y') = diffrec (t,y) in (h::x',y') in
+  if List.length x > List.length y then diffrec(y,x) else diffrec(x,y)
+
+
+(* Multiset extension of order *)
+
+let mult_ext order = function
+    Term(_,sons1), Term(_,sons2) ->
+      begin match diff_eq (eq_ord order) (sons1,sons2) with
+        ([],[]) -> Equal
+      | (l1,l2) ->
+           if List.for_all
+                (fun n -> List.exists (fun m -> gt_ord order (m,n)) l1) l2
+           then Greater else NotGE
+      end
+  | _ -> failwith "mult_ext"
+
+
+(* Lexicographic extension of order *)
+
+let lex_ext order = function
+    (Term(_,sons1) as m), (Term(_,sons2) as n) ->
+      let rec lexrec = function
+        ([] , []) -> Equal
+      | ([] , _ ) -> NotGE
+      | ( _ , []) -> Greater
+      | (x1::l1, x2::l2) ->
+          match order (x1,x2) with
+            Greater -> if List.for_all (fun n' -> gt_ord order (m,n')) l2 
+                       then Greater else NotGE
+          | Equal -> lexrec (l1,l2)
+          | NotGE -> if List.exists (fun m' -> ge_ord order (m',n)) l1 
+                     then Greater else NotGE in
+      lexrec (sons1, sons2)
+  | _ -> failwith "lex_ext"
+
+
+(* Recursive path ordering *)
+
+let rpo op_order ext = 
+  let rec rporec (m,n) =
+    if m = n then Equal else 
+      match m with
+          Var vm -> NotGE
+        | Term(op1,sons1) ->
+            match n with
+                Var vn ->
+                  if occurs vn m then Greater else NotGE
+              | Term(op2,sons2) ->
+                  match (op_order op1 op2) with
+                      Greater ->
+                        if List.for_all (fun n' -> gt_ord rporec (m,n')) sons2
+                        then Greater else NotGE
+                    | Equal ->
+                        ext rporec (m,n)
+                    | NotGE ->
+                        if List.exists (fun m' -> ge_ord rporec (m',n)) sons1
+                        then Greater else NotGE
+  in rporec
+
diff --git a/test/KB/orderings.mli b/test/KB/orderings.mli
new file mode 100644 (file)
index 0000000..460ee64
--- /dev/null
@@ -0,0 +1,31 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: orderings.mli,v 1.4 1999/11/17 18:58:37 xleroy Exp $ *)
+
+open Terms
+
+type ordering = 
+    Greater
+  | Equal
+  | NotGE
+
+val ge_ord: ('a -> ordering) -> 'a -> bool
+val gt_ord: ('a -> ordering) -> 'a -> bool
+val eq_ord: ('a -> ordering) -> 'a -> bool
+val rem_eq: ('a * 'b -> bool) -> 'a -> 'b list -> 'b list
+val diff_eq: ('a * 'a -> bool) -> 'a list * 'a list -> 'a list * 'a list
+val mult_ext: (term * term -> ordering) -> term * term -> ordering
+val lex_ext: (term * term -> ordering) -> term * term -> ordering
+val rpo: (string -> string -> ordering) ->
+         ((term * term -> ordering) -> term * term -> ordering) ->
+         term * term -> ordering
diff --git a/test/KB/terms.ml b/test/KB/terms.ml
new file mode 100644 (file)
index 0000000..91b3bf5
--- /dev/null
@@ -0,0 +1,137 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: terms.ml,v 1.5 1999/11/17 18:58:37 xleroy Exp $ *)
+
+(****************** Term manipulations *****************)
+
+type term = 
+    Var of int
+  | Term of string * term list
+
+let rec union l1 l2 =
+  match l1 with
+    []   -> l2
+  | a::r -> if List.mem a l2 then union r l2 else a :: union r l2
+  
+
+let rec vars = function
+    Var n -> [n]
+  | Term(_,l) -> vars_of_list l
+and vars_of_list = function
+    [] -> []
+  | t::r -> union (vars t) (vars_of_list r)
+
+
+let rec substitute subst = function
+    Term(oper,sons) -> Term(oper, List.map (substitute subst) sons)
+  | Var(n) as t     -> try List.assoc n subst with Not_found -> t
+
+
+(* Term replacement: replace M u N is M[u<-N]. *)
+
+let rec replace m u n =
+  match (u, m) with
+    [], _ -> n
+  | i::u, Term(oper, sons) -> Term(oper, replace_nth i sons u n)
+  | _ -> failwith "replace"
+
+and replace_nth i sons u n =
+  match sons with
+    s::r -> if i = 1
+            then replace s u n :: r
+            else s :: replace_nth (i-1) r u n
+  | []   -> failwith "replace_nth"
+
+
+(* Term matching. *)
+
+let matching term1 term2 =
+  let rec match_rec subst t1 t2 =
+    match (t1, t2) with
+      Var v, _ ->
+        if List.mem_assoc v subst then
+          if t2 = List.assoc v subst then subst else failwith "matching"
+        else
+          (v, t2) :: subst
+    | Term(op1,sons1), Term(op2,sons2) ->
+        if op1 = op2
+        then List.fold_left2 match_rec subst sons1 sons2
+        else failwith "matching"
+    | _ -> failwith "matching" in
+  match_rec [] term1 term2
+
+
+(* A naive unification algorithm. *)
+
+let compsubst subst1 subst2 = 
+  (List.map (fun (v,t) -> (v, substitute subst1 t)) subst2) @ subst1
+
+
+let rec occurs n = function
+    Var m -> m = n
+  | Term(_,sons) -> List.exists (occurs n) sons
+
+
+let rec unify term1 term2 =
+  match (term1, term2) with
+    Var n1, _ ->
+      if term1 = term2 then []
+      else if occurs n1 term2 then failwith "unify"
+      else [n1, term2]
+  | term1, Var n2 ->
+      if occurs n2 term1 then failwith "unify"
+      else [n2, term1]
+  | Term(op1,sons1), Term(op2,sons2) ->
+      if op1 = op2 then
+        List.fold_left2 (fun s t1 t2 -> compsubst (unify (substitute s t1)
+                                                         (substitute s t2)) s)
+                   [] sons1 sons2
+      else failwith "unify"
+
+
+(* We need to print terms with variables independently from input terms
+  obtained by parsing. We give arbitrary names v1,v2,... to their variables.
+*)
+
+let infixes = ["+";"*"]
+
+let rec pretty_term = function
+    Var n ->
+      print_string "v"; print_int n
+  | Term (oper,sons) ->
+      if List.mem oper infixes then begin
+        match sons with
+            [s1;s2] ->
+              pretty_close s1; print_string oper; pretty_close s2
+          | _ ->
+              failwith "pretty_term : infix arity <> 2"
+      end else begin
+        print_string oper;
+        match sons with
+             []   -> ()
+          | t::lt -> print_string "(";
+                     pretty_term t;
+                     List.iter (fun t -> print_string ","; pretty_term t) lt;
+                     print_string ")"
+      end
+
+and pretty_close = function
+    Term(oper, _) as m ->
+      if List.mem oper infixes then begin
+        print_string "("; pretty_term m; print_string ")"
+      end else
+        pretty_term m
+  | m ->
+      pretty_term m
+
+
diff --git a/test/KB/terms.mli b/test/KB/terms.mli
new file mode 100644 (file)
index 0000000..004895e
--- /dev/null
@@ -0,0 +1,31 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: terms.mli,v 1.4 1999/11/17 18:58:38 xleroy Exp $ *)
+
+type term = 
+    Var of int
+  | Term of string * term list
+
+val union: 'a list -> 'a list -> 'a list
+val vars: term -> int list
+val vars_of_list: term list -> int list
+val substitute: (int * term) list -> term -> term
+val replace: term -> int list -> term -> term
+val replace_nth: int -> term list -> int list -> term -> term list
+val matching: term -> term -> (int * term) list
+val compsubst: (int * term) list -> (int * term) list -> (int * term) list
+val occurs: int -> term -> bool
+val unify: term -> term -> (int * term) list
+val infixes: string list
+val pretty_term: term -> unit
+val pretty_close: term -> unit
diff --git a/test/Lex/.cvsignore b/test/Lex/.cvsignore
new file mode 100644 (file)
index 0000000..ed941f6
--- /dev/null
@@ -0,0 +1,5 @@
+grammar.ml
+grammar.mli
+scanner.ml
+testscanner.ml
+grammar.output
diff --git a/test/Lex/gram_aux.ml b/test/Lex/gram_aux.ml
new file mode 100644 (file)
index 0000000..6b23b5e
--- /dev/null
@@ -0,0 +1,47 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: gram_aux.ml,v 1.4 1999/11/17 18:58:38 xleroy Exp $ *)
+
+(* Auxiliaries for the parser. *)
+
+open Syntax
+
+let regexp_for_string s =
+  let l = String.length s in
+  if l = 0 then
+    Epsilon
+  else begin
+    let re = ref(Characters [String.get s (l - 1)]) in
+    for i = l - 2 downto 0 do
+      re := Sequence(Characters [String.get s i], !re)
+    done;
+    !re
+  end
+
+
+let char_class c1 c2 =
+  let cl = ref [] in
+  for i = Char.code c2 downto Char.code c1 do
+    cl := Char.chr i :: !cl
+  done;
+  !cl
+
+
+let all_chars = char_class '\001' '\255'
+
+
+let rec subtract l1 l2 =
+  match l1 with
+    [] -> []
+  | a::l -> if List.mem a l2 then subtract l l2 else a :: subtract l l2
+
diff --git a/test/Lex/grammar.mly b/test/Lex/grammar.mly
new file mode 100644 (file)
index 0000000..ee5a8d2
--- /dev/null
@@ -0,0 +1,114 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: grammar.mly,v 1.4 1999/11/17 18:58:38 xleroy Exp $ */
+
+/* The grammar for lexer definitions */
+
+%{
+open Syntax
+open Gram_aux
+%}
+
+%token <string> Tident
+%token <char> Tchar
+%token <string> Tstring
+%token <Syntax.location> Taction
+%token Trule Tparse Tand Tequal Tend Tor Tunderscore Teof Tlbracket Trbracket
+%token Tstar Tmaybe Tplus Tlparen Trparen Tcaret Tdash
+
+%left Tor
+%left CONCAT
+%nonassoc Tmaybe
+%left Tstar
+%left Tplus
+
+%start lexer_definition
+%type <Syntax.lexer_definition> lexer_definition
+
+%%
+
+lexer_definition:
+    header Trule definition other_definitions Tend
+        { Lexdef($1, $3::(List.rev $4)) }
+;
+header:
+    Taction
+        { $1 }
+  |
+        { Location(0,0) }
+;
+other_definitions:
+    other_definitions Tand definition
+        { $3::$1 }
+  |     
+        { [] }
+;
+definition:
+    Tident Tequal entry
+        { ($1,$3) }
+;
+entry:
+    Tparse case rest_of_entry
+        { $2 :: List.rev $3 }
+;
+rest_of_entry:
+    rest_of_entry Tor case
+        { $3::$1 }
+  |
+        { [] }
+;
+case:
+    regexp Taction
+        { ($1,$2) }
+;
+regexp:
+    Tunderscore
+        { Characters all_chars }
+  | Teof
+        { Characters ['\000'] }
+  | Tchar
+        { Characters [$1] }
+  | Tstring
+        { regexp_for_string $1 }
+  | Tlbracket char_class Trbracket
+        { Characters $2 }
+  | regexp Tstar
+        { Repetition $1 }
+  | regexp Tmaybe
+        { Alternative($1, Epsilon) }
+  | regexp Tplus
+        { Sequence($1, Repetition $1) }
+  | regexp Tor regexp
+        { Alternative($1,$3) }
+  | regexp regexp %prec CONCAT
+        { Sequence($1,$2) }
+  | Tlparen regexp Trparen
+        { $2 }
+;
+char_class:
+    Tcaret char_class1
+        { subtract all_chars $2 }
+  | char_class1
+        { $1 }
+;
+char_class1:
+    Tchar Tdash Tchar
+        { char_class $1 $3 }
+  | Tchar
+        { [$1] }
+  | char_class char_class %prec CONCAT
+        { $1 @ $2 }
+;
+
+%%
+
diff --git a/test/Lex/lexgen.ml b/test/Lex/lexgen.ml
new file mode 100644 (file)
index 0000000..d17a74c
--- /dev/null
@@ -0,0 +1,266 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: lexgen.ml,v 1.5 2000/12/28 13:06:39 weis Exp $ *)
+
+(* Compiling a lexer definition *)
+
+open Syntax
+
+(* Deep abstract syntax for regular expressions *)
+
+type regexp =
+    Empty
+  | Chars of int
+  | Action of int
+  | Seq of regexp * regexp
+  | Alt of regexp * regexp
+  | Star of regexp
+
+(* From shallow to deep syntax *)
+
+(***
+
+let print_char_class c =
+  let print_interval low high =
+    prerr_int low;
+    if high - 1 > low then begin
+      prerr_char '-';
+      prerr_int (high-1)
+    end;
+    prerr_char ' ' in
+  let rec print_class first next = function
+    [] -> print_interval first next
+  | c::l ->
+      if char.code c = next
+      then print_class first (next+1) l
+      else begin
+        print_interval first next;
+        print_class (char.code c) (char.code c + 1) l
+      end in
+  match c with
+    [] -> prerr_newline()
+  | c::l -> print_class (char.code c) (char.code c + 1) l; prerr_newline()
+
+
+let rec print_regexp = function
+    Empty -> prerr_string "Empty"
+  | Chars n -> prerr_string "Chars "; prerr_int n
+  | Action n -> prerr_string "Action "; prerr_int n
+  | Seq(r1,r2) -> print_regexp r1; prerr_string "; "; print_regexp r2
+  | Alt(r1,r2) -> prerr_string "("; print_regexp r1; prerr_string " | "; print_regexp r2; prerr_string ")"
+  | Star r -> prerr_string "("; print_regexp r; prerr_string ")*"
+
+***)
+
+let chars = ref ([] : char list list)
+let chars_count = ref 0
+let actions = ref ([] : (int * location) list)
+let actions_count = ref 0
+
+let rec encode_regexp = function
+    Epsilon -> Empty
+  | Characters cl ->
+      let n = !chars_count in
+(***      prerr_int n; prerr_char ' '; print_char_class cl; ***)
+      chars := cl :: !chars;
+      chars_count := !chars_count + 1;
+      Chars(n)
+  | Sequence(r1,r2) ->
+      Seq(encode_regexp r1, encode_regexp r2)
+  | Alternative(r1,r2) ->
+      Alt(encode_regexp r1, encode_regexp r2)
+  | Repetition r ->
+      Star (encode_regexp r)
+
+
+let encode_casedef =
+  List.fold_left
+   (fun reg (expr,act) ->
+     let act_num = !actions_count in
+     actions_count := !actions_count + 1;
+     actions := (act_num, act) :: !actions;
+     Alt(reg, Seq(encode_regexp expr, Action act_num)))
+  Empty
+
+
+let encode_lexdef (Lexdef(_, ld)) =
+  chars := [];
+  chars_count := 0;
+  actions := [];
+  actions_count := 0;
+  let name_regexp_list =
+    List.map (fun (name, casedef) -> (name, encode_casedef casedef)) ld in
+(*  List.iter print_char_class chars; *)
+  let chr = Array.of_list (List.rev !chars)
+  and act = !actions in
+  chars := [];
+  actions := [];
+  (chr, name_regexp_list, act)
+
+
+(* To generate directly a NFA from a regular expression.
+   Confer Aho-Sethi-Ullman, dragon book, chap. 3 *)
+
+type transition =
+    OnChars of int
+  | ToAction of int
+
+
+let rec merge_trans l1 l2 =
+  match (l1, l2) with
+    ([], s2) -> s2
+  | (s1, []) -> s1
+  | ((OnChars n1 as t1) :: r1 as s1), ((OnChars n2 as t2) :: r2 as s2) ->
+      if n1 = n2 then t1 :: merge_trans r1 r2 else
+      if n1 < n2 then t1 :: merge_trans r1 s2 else
+                      t2 :: merge_trans s1 r2
+  | ((ToAction n1 as t1) :: r1 as s1), ((ToAction n2 as t2) :: r2 as s2) ->
+      if n1 = n2 then t1 :: merge_trans r1 r2 else
+      if n1 < n2 then t1 :: merge_trans r1 s2 else
+                      t2 :: merge_trans s1 r2
+  | ((OnChars n1 as t1) :: r1 as s1), ((ToAction n2 as t2) :: r2 as s2) ->
+      t1 :: merge_trans r1 s2
+  | ((ToAction n1 as t1) :: r1 as s1), ((OnChars n2 as t2) :: r2 as s2) ->
+      t2 :: merge_trans s1 r2
+
+
+let rec nullable = function
+    Empty      -> true
+  | Chars _    -> false
+  | Action _   -> false
+  | Seq(r1,r2) -> nullable r1 && nullable r2
+  | Alt(r1,r2) -> nullable r1 || nullable r2
+  | Star r     -> true
+
+
+let rec firstpos = function
+    Empty      -> []
+  | Chars pos  -> [OnChars pos]
+  | Action act -> [ToAction act]
+  | Seq(r1,r2) -> if nullable r1
+                  then merge_trans (firstpos r1) (firstpos r2)
+                  else firstpos r1
+  | Alt(r1,r2) -> merge_trans (firstpos r1) (firstpos r2)
+  | Star r     -> firstpos r
+
+
+let rec lastpos = function
+    Empty      -> []
+  | Chars pos  -> [OnChars pos]
+  | Action act -> [ToAction act]
+  | Seq(r1,r2) -> if nullable r2
+                  then merge_trans (lastpos r1) (lastpos r2)
+                  else lastpos r2
+  | Alt(r1,r2) -> merge_trans (lastpos r1) (lastpos r2)
+  | Star r     -> lastpos r
+
+
+let followpos size name_regexp_list =
+  let v = Array.create size [] in
+    let fill_pos first = function
+        OnChars pos -> v.(pos) <- merge_trans first v.(pos); ()
+      | ToAction _  -> () in
+    let rec fill = function
+        Seq(r1,r2) ->
+          fill r1; fill r2;
+          List.iter (fill_pos (firstpos r2)) (lastpos r1)
+      | Alt(r1,r2) ->
+          fill r1; fill r2
+      | Star r ->
+          fill r;
+          List.iter (fill_pos (firstpos r)) (lastpos r)
+      | _ -> () in
+    List.iter (fun (name, regexp) -> fill regexp) name_regexp_list;
+    v
+
+
+let no_action = 0x3FFFFFFF
+
+let split_trans_set =
+  List.fold_left
+    (fun (act, pos_set as act_pos_set) trans ->
+       match trans with
+         OnChars pos   -> (act, pos :: pos_set)
+       | ToAction act1 -> if act1 < act then (act1, pos_set)
+                                             else act_pos_set)
+    (no_action, [])
+
+
+let memory = (Hashtbl.create 131 : (transition list, int) Hashtbl.t)
+let todo = ref ([] : (transition list * int) list)
+let next = ref 0
+
+let get_state st = 
+  try
+    Hashtbl.find memory st
+  with Not_found ->
+    let nbr = !next in
+    next := !next + 1;
+    Hashtbl.add memory st nbr;
+    todo := (st, nbr) :: !todo;
+    nbr
+
+let rec map_on_states f =
+  match !todo with
+    []  -> []
+  | (st,i)::r -> todo := r; let res = f st in (res,i) :: map_on_states f
+
+let number_of_states () = !next
+
+let goto_state = function
+    [] -> Backtrack
+  | ps -> Goto (get_state ps)
+
+
+let transition_from chars follow pos_set = 
+  let tr = Array.create 256 []
+  and shift = Array.create 256 Backtrack in
+    List.iter
+      (fun pos ->
+        List.iter
+          (fun c ->
+             tr.(Char.code c) <-
+               merge_trans tr.(Char.code c) follow.(pos))
+          chars.(pos))
+      pos_set;
+    for i = 0 to 255 do
+      shift.(i) <- goto_state tr.(i)
+    done;
+    shift
+
+
+let translate_state chars follow state =
+  match split_trans_set state with
+    n, [] -> Perform n
+  | n, ps -> Shift( (if n = no_action then No_remember else Remember n),
+                    transition_from chars follow ps)
+
+
+let make_dfa lexdef =
+  let (chars, name_regexp_list, actions) =
+    encode_lexdef lexdef in
+(**
+  List.iter (fun (name, regexp) -> prerr_string name; prerr_string " = "; print_regexp regexp; prerr_newline()) name_regexp_list;
+**)
+  let follow =
+    followpos (Array.length chars) name_regexp_list in
+  let initial_states =
+    List.map (fun (name, regexp) -> (name, get_state(firstpos regexp)))
+             name_regexp_list in
+  let states =
+    map_on_states (translate_state chars follow) in
+  let v =
+    Array.create (number_of_states()) (Perform 0) in
+  List.iter (fun (auto, i) -> v.(i) <- auto) states;
+  (initial_states, v, actions)
+
diff --git a/test/Lex/main.ml b/test/Lex/main.ml
new file mode 100644 (file)
index 0000000..f0dc8b5
--- /dev/null
@@ -0,0 +1,118 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: main.ml,v 1.4 1999/11/17 18:58:39 xleroy Exp $ *)
+
+(* The lexer generator. Command-line parsing. *)
+
+open Syntax
+open Scanner
+open Grammar
+open Lexgen
+open Output
+
+let main () =
+  if Array.length Sys.argv <> 2 then begin
+    prerr_string "Usage: camllex <input file>\n";
+    exit 2
+  end;
+  let source_name = Sys.argv.(1) in
+  let dest_name =
+    if Filename.check_suffix source_name ".mll" then
+      Filename.chop_suffix source_name ".mll" ^ ".ml"
+    else
+      source_name ^ ".ml" in
+  ic := open_in source_name;
+  oc := open_out dest_name;
+  let lexbuf = Lexing.from_channel !ic in
+  let (Lexdef(header,_) as def) =
+    try
+      Grammar.lexer_definition Scanner.main lexbuf
+    with
+      Parsing.Parse_error ->
+        prerr_string "Syntax error around char ";
+        prerr_int (Lexing.lexeme_start lexbuf);
+        prerr_endline ".";
+        exit 2
+    | Scan_aux.Lexical_error s ->
+        prerr_string "Lexical error around char ";
+        prerr_int (Lexing.lexeme_start lexbuf);
+        prerr_string ": ";
+        prerr_string s;
+        prerr_endline ".";
+        exit 2 in
+  let ((init, states, acts) as dfa) = make_dfa def in
+  output_lexdef header dfa;
+  close_in !ic;
+  close_out !oc
+
+let _ = main(); exit 0
+
+
+(*****
+let main () =
+  ic := stdin;
+  oc := stdout;
+  let lexbuf = lexing.from_channel ic in
+  let (Lexdef(header,_) as def) =
+    try
+      grammar.lexer_definition scanner.main lexbuf
+    with
+      parsing.Parse_error x ->
+        prerr_string "Syntax error around char ";
+        prerr_int (lexing.lexeme_start lexbuf);
+        prerr_endline ".";
+        sys.exit 2
+    | scan_aux.Lexical_error s ->
+        prerr_string "Lexical error around char ";
+        prerr_int (lexing.lexeme_start lexbuf);
+        prerr_string ": ";
+        prerr_string s;
+        prerr_endline ".";
+        sys.exit 2 in
+  let ((init, states, acts) as dfa) = make_dfa def in
+  output_lexdef header dfa
+
+****)
+
+(****
+let debug_scanner lexbuf =
+  let tok = scanner.main lexbuf in
+  begin match tok with
+    Tident s -> prerr_string "Tident "; prerr_string s
+  | Tchar c -> prerr_string "Tchar "; prerr_char c
+  | Tstring s -> prerr_string "Tstring "; prerr_string s
+  | Taction(Location(i1,i2)) ->
+      prerr_string "Taction "; prerr_int i1; prerr_string "-";
+      prerr_int i2
+  | Trule -> prerr_string "Trule"
+  | Tparse -> prerr_string "Tparse"
+  | Tand -> prerr_string "Tand"
+  | Tequal -> prerr_string "Tequal"
+  | Tend -> prerr_string "Tend"
+  | Tor -> prerr_string "Tor"
+  | Tunderscore -> prerr_string "Tunderscore"
+  | Teof -> prerr_string "Teof"
+  | Tlbracket -> prerr_string "Tlbracket"
+  | Trbracket -> prerr_string "Trbracket"
+  | Tstar -> prerr_string "Tstar"
+  | Tmaybe -> prerr_string "Tmaybe"
+  | Tplus -> prerr_string "Tplus"
+  | Tlparen -> prerr_string "Tlparen"
+  | Trparen -> prerr_string "Trparen"
+  | Tcaret -> prerr_string "Tcaret"
+  | Tdash -> prerr_string "Tdash"
+  end;
+  prerr_newline();
+  tok
+
+****)
diff --git a/test/Lex/output.ml b/test/Lex/output.ml
new file mode 100644 (file)
index 0000000..1107b5a
--- /dev/null
@@ -0,0 +1,169 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: output.ml,v 1.5 2000/12/28 13:06:41 weis Exp $ *)
+
+(* Generating a DFA as a set of mutually recursive functions *)
+
+open Syntax
+
+let ic = ref stdin
+let oc = ref stdout
+
+(* 1- Generating the actions *)
+
+let copy_buffer = String.create 1024
+
+let copy_chunk (Location(start,stop)) =
+  seek_in !ic start;
+  let tocopy = ref(stop - start) in
+  while !tocopy > 0 do
+    let m =
+      input !ic copy_buffer 0 (min !tocopy (String.length copy_buffer)) in
+    output !oc copy_buffer 0 m;
+    tocopy := !tocopy - m
+  done
+
+
+let output_action (i,act) =
+  output_string !oc ("action_" ^ string_of_int i ^ " lexbuf = (\n");
+  copy_chunk act;
+  output_string !oc ")\nand "
+
+
+(* 2- Generating the states *)
+
+let states = ref ([||] : automata array)
+
+type occurrence =
+  { mutable pos: int list;
+    mutable freq: int }
+
+let enumerate_vect v =
+  let env = ref [] in
+  for pos = 0 to Array.length v - 1 do
+    try
+      let occ = List.assoc v.(pos) !env in
+      occ.pos <- pos :: occ.pos;
+      occ.freq <- occ.freq + 1
+    with Not_found ->
+      env := (v.(pos), {pos = [pos]; freq = 1 }) :: !env
+  done;
+  Sort.list (fun (e1, occ1) (e2, occ2) -> occ1.freq >= occ2.freq) !env
+
+
+let output_move = function
+    Backtrack ->
+      output_string !oc "lexing.backtrack lexbuf"
+  | Goto dest ->
+      match !states.(dest) with
+        Perform act_num ->
+          output_string !oc ("action_" ^ string_of_int act_num ^ " lexbuf")
+      | _ ->
+          output_string !oc ("state_" ^ string_of_int dest ^ " lexbuf")
+
+
+(* Cannot use standard char_for_read because the characters to escape
+   are not the same in CL6 and CL1999. *)
+
+let output_char_lit oc = function
+    '\'' -> output_string oc "\\'"
+  | '\\' -> output_string oc "\\\\"
+  | '\n' -> output_string oc "\\n"
+  | '\t' -> output_string oc "\\t"
+  | c ->  if Char.code c >= 32 && Char.code c < 128 then
+            output_char oc c
+          else begin
+            let n = Char.code c in
+            output_char oc '\\';
+            output_char oc (Char.chr (48 + n / 100));
+            output_char oc (Char.chr (48 + (n / 10) mod 10));
+            output_char oc (Char.chr (48 + n mod 10))
+          end
+
+let rec output_chars = function
+    [] ->
+      failwith "output_chars"
+  | [c] ->
+      output_string !oc "'";
+      output_char_lit !oc (Char.chr c);
+      output_string !oc "'"
+  | c::cl ->
+      output_string !oc "'";
+      output_char_lit !oc (Char.chr c);
+      output_string !oc "'|";
+      output_chars cl
+
+let output_one_trans (dest, occ) =
+  output_chars occ.pos;
+  output_string !oc " -> ";
+  output_move dest;
+  output_string !oc "\n |  "
+
+let output_all_trans trans =
+  output_string !oc "  match lexing.next_char lexbuf with\n    ";
+  match enumerate_vect trans with
+    [] ->
+      failwith "output_all_trans"
+  | (default, _) :: rest ->
+      List.iter output_one_trans rest;
+      output_string !oc "_ -> ";
+      output_move default;
+      output_string !oc "\nand "
+
+let output_state state_num = function
+    Perform i ->
+      ()
+  | Shift(what_to_do, moves) ->
+      output_string !oc
+        ("state_"  ^ string_of_int state_num ^ " lexbuf =\n");
+      begin match what_to_do with
+        No_remember -> ()
+      | Remember i ->
+          output_string !oc
+            ("  Lexing.set_backtrack lexbuf action_" ^
+             string_of_int i ^ ";\n")
+      end;
+      output_all_trans moves
+
+
+(* 3- Generating the entry points *)
+          
+let rec output_entries = function
+    [] -> failwith "output_entries"
+  | (name,state_num) :: rest ->
+      output_string !oc (name ^ " lexbuf =\n");
+      output_string !oc "  Lexing.init lexbuf;\n";
+      output_string !oc ("  state_" ^ string_of_int state_num ^
+                        " lexbuf\n");
+      match rest with
+        [] -> output_string !oc "\n"; ()
+      | _  -> output_string !oc "\nand "; output_entries rest
+
+
+(* All together *)
+
+let output_lexdef header (initial_st, st, actions) =
+  prerr_int (Array.length st); prerr_string " states, ";
+  prerr_int (List.length actions); prerr_string " actions.";
+  prerr_newline();
+  copy_chunk header;
+  output_string !oc "\nlet rec ";
+  states := st;
+  List.iter output_action actions;
+  for i = 0 to Array.length st - 1 do
+    output_state i st.(i)
+  done;
+  output_entries initial_st
+
+
+
diff --git a/test/Lex/scan_aux.ml b/test/Lex/scan_aux.ml
new file mode 100644 (file)
index 0000000..172d6f4
--- /dev/null
@@ -0,0 +1,60 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: scan_aux.ml,v 1.4 1999/11/17 18:58:39 xleroy Exp $ *)
+
+(* Auxiliaries for the lexical analyzer *)
+
+let brace_depth = ref 0
+let comment_depth = ref 0
+
+exception Lexical_error of string
+
+let initial_string_buffer = String.create 256
+let string_buff = ref initial_string_buffer
+let string_index = ref 0
+
+let reset_string_buffer () =
+  string_buff := initial_string_buffer;
+  string_index := 0
+
+
+let store_string_char c =
+  begin
+    if !string_index >= String.length !string_buff then begin
+      let new_buff = String.create (String.length !string_buff * 2) in
+      String.blit new_buff 0 !string_buff 0 (String.length !string_buff);
+      string_buff := new_buff
+    end
+  end;
+  String.unsafe_set !string_buff !string_index c;
+  incr string_index
+
+let get_stored_string () =
+  let s = String.sub !string_buff 0 !string_index in
+  string_buff := initial_string_buffer;
+  s
+
+
+let char_for_backslash = function
+    'n' -> '\010' (* '\n' when bootstrapped *)
+  | 't' -> '\009' (* '\t' *)
+  | 'b' -> '\008' (* '\b' *)
+  | 'r' -> '\013' (* '\r' *)
+  | c   -> c
+
+
+let char_for_decimal_code lexbuf i =
+  Char.chr(100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
+            10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
+                 (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48))
+
diff --git a/test/Lex/scanner.mll b/test/Lex/scanner.mll
new file mode 100644 (file)
index 0000000..c7d74b0
--- /dev/null
@@ -0,0 +1,132 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: scanner.mll,v 1.5 1999/11/17 18:58:39 xleroy Exp $ *)
+
+(* The lexical analyzer for lexer definitions. *)
+
+{
+open Syntax
+open Grammar
+open Scan_aux
+}
+
+rule main = parse
+    [' ' '\010' '\013' '\009' ] + 
+    { main lexbuf }
+  | "(*" 
+    { comment_depth := 1;
+      comment lexbuf;
+      main lexbuf }
+  | (['A'-'Z' 'a'-'z'] | '_' ['A'-'Z' 'a'-'z' '\'' '0'-'9'])
+    ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) * 
+    { match Lexing.lexeme lexbuf with
+        "rule" -> Trule
+      | "parse" -> Tparse
+      | "and" -> Tand
+      | "eof" -> Teof
+      | s -> Tident s }
+  | '"' 
+    { reset_string_buffer();
+      string lexbuf;
+      Tstring(get_stored_string()) }
+  | "'" 
+    { Tchar(char lexbuf) }
+  | '{' 
+    { let n1 = Lexing.lexeme_end lexbuf in
+        brace_depth := 1;
+        let n2 = action lexbuf in
+          Taction(Location(n1, n2)) }
+  | '='  { Tequal }
+  | ";;"  { Tend }
+  | '|'  { Tor }
+  | '_'  { Tunderscore }
+  | "eof"  { Teof }
+  | '['  { Tlbracket }
+  | ']'  { Trbracket }
+  | '*'  { Tstar }
+  | '?'  { Tmaybe }
+  | '+'  { Tplus }
+  | '('  { Tlparen }
+  | ')'  { Trparen }
+  | '^'  { Tcaret }
+  | '-'  { Tdash }
+  | eof
+    { raise(Lexical_error "unterminated lexer definition") }
+  | _
+    { raise(Lexical_error("illegal character " ^ Lexing.lexeme lexbuf)) }
+
+and action = parse
+    '{' 
+    { incr brace_depth;
+      action lexbuf }
+  | '}' 
+    { decr brace_depth;
+      if !brace_depth = 0 then Lexing.lexeme_start lexbuf else action lexbuf }
+  | '"' 
+    { reset_string_buffer();
+      string lexbuf;
+      reset_string_buffer();
+      action lexbuf }
+  | '\''
+    { let _ = char lexbuf in action lexbuf }
+  | "(*" 
+    { comment_depth := 1;
+      comment lexbuf;
+      action lexbuf }
+  | eof 
+    { raise (Lexical_error "unterminated action") }
+  | _ 
+    { action lexbuf }
+      
+and string = parse
+    '"' 
+    { () }
+  | '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
+    { string lexbuf }
+  | '\\' ['\\' '"' 'n' 't' 'b' 'r'] 
+    { store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
+      string lexbuf }
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] 
+    { store_string_char(char_for_decimal_code lexbuf 1);
+      string lexbuf }
+  | eof 
+    { raise(Lexical_error "unterminated string") }
+  | _ 
+    { store_string_char(Lexing.lexeme_char lexbuf 0);
+      string lexbuf }
+
+and char = parse
+    [^ '\\'] "'" 
+    { Lexing.lexeme_char lexbuf 0 }
+  | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'" 
+    { char_for_backslash (Lexing.lexeme_char lexbuf 1) }
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" 
+    { char_for_decimal_code lexbuf 1 }
+  | _ 
+    { raise(Lexical_error "bad character constant") }
+
+and comment = parse
+    "(*" 
+    { incr comment_depth; comment lexbuf }
+  | "*)" 
+    { decr comment_depth;
+      if !comment_depth = 0 then () else comment lexbuf }
+  | '"' 
+    { reset_string_buffer();
+      string lexbuf;
+      reset_string_buffer();
+      comment lexbuf }
+  | eof 
+    { raise(Lexical_error "unterminated comment") }
+  | _ 
+    { comment lexbuf }
diff --git a/test/Lex/syntax.ml b/test/Lex/syntax.ml
new file mode 100644 (file)
index 0000000..14d2987
--- /dev/null
@@ -0,0 +1,40 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: syntax.ml,v 1.4 1999/11/17 18:58:39 xleroy Exp $ *)
+
+(* The shallow abstract syntax *)
+
+type location =
+    Location of int * int
+
+type regular_expression =
+    Epsilon
+  | Characters of char list
+  | Sequence of regular_expression * regular_expression
+  | Alternative of regular_expression * regular_expression
+  | Repetition of regular_expression
+
+type lexer_definition =
+    Lexdef of location * (string * (regular_expression * location) list) list
+
+(* Representation of automata *)
+
+type automata =
+    Perform of int
+  | Shift of automata_trans * automata_move array
+and automata_trans =
+    No_remember
+  | Remember of int
+and automata_move =
+    Backtrack
+  | Goto of int
diff --git a/test/Lex/testmain.ml b/test/Lex/testmain.ml
new file mode 100644 (file)
index 0000000..ab9e436
--- /dev/null
@@ -0,0 +1,48 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: testmain.ml,v 1.4 1999/11/17 18:58:39 xleroy Exp $ *)
+
+(* The lexer generator. Command-line parsing. *)
+
+#open "syntax";;
+#open "testscanner";;
+#open "grammar";;
+#open "lexgen";;
+#open "output";;
+
+let main () =
+  ic := stdin;
+  oc := stdout;
+  let lexbuf = lexing.from_channel ic in
+  let (Lexdef(header,_) as def) =
+    try
+      grammar.lexer_definition testscanner.main lexbuf
+    with
+      parsing.Parse_error x ->
+        prerr_string "Syntax error around char ";
+        prerr_int (lexing.lexeme_start lexbuf);
+        prerr_endline ".";
+        sys.exit 2
+    | scan_aux.Lexical_error s ->
+        prerr_string "Lexical error around char ";
+        prerr_int (lexing.lexeme_start lexbuf);
+        prerr_string ": ";
+        prerr_string s;
+        prerr_endline ".";
+        sys.exit 2 in
+  let ((init, states, acts) as dfa) = make_dfa def in
+  output_lexdef header dfa
+;;
+
+main(); sys.exit 0
+;;
diff --git a/test/Lex/testscanner.mll b/test/Lex/testscanner.mll
new file mode 100644 (file)
index 0000000..1f2ffe6
--- /dev/null
@@ -0,0 +1,135 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: testscanner.mll,v 1.4 1999/11/17 18:58:39 xleroy Exp $ *)
+
+(* The lexical analyzer for lexer definitions. *)
+
+{
+#open "syntax";;
+#open "grammar";;
+#open "scan_aux";;
+}
+
+rule main = parse
+    _ * "qwertyuiopasdfghjklzxcvbnm0123456789!@#$%^&*()"
+    { main lexbuf }
+  | [' ' '\010' '\013' '\009' ] + 
+    { main lexbuf }
+  | "(*" 
+    { comment_depth := 1;
+      comment lexbuf;
+      main lexbuf }
+  | (['A'-'Z' 'a'-'z'] | '_' ['A'-'Z' 'a'-'z' '\'' '0'-'9'])
+    ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) * 
+    { match lexing.lexeme lexbuf with
+        "rule" -> Trule
+      | "parse" -> Tparse
+      | "and" -> Tand
+      | "eof" -> Teof
+      | s -> Tident s }
+  | '"' 
+    { reset_string_buffer();
+      string lexbuf;
+      Tstring(get_stored_string()) }
+  | "'" 
+    { Tchar(char lexbuf) }
+  | '{' 
+    { let n1 = lexing.lexeme_end lexbuf in
+        brace_depth := 1;
+        let n2 = action lexbuf in
+          Taction(Location(n1, n2)) }
+  | '='  { Tequal }
+  | ";;"  { Tend }
+  | '|'  { Tor }
+  | '_'  { Tunderscore }
+  | "eof"  { Teof }
+  | '['  { Tlbracket }
+  | ']'  { Trbracket }
+  | '*'  { Tstar }
+  | '?'  { Tmaybe }
+  | '+'  { Tplus }
+  | '('  { Tlparen }
+  | ')'  { Trparen }
+  | '^'  { Tcaret }
+  | '-'  { Tdash }
+  | eof
+    { raise(Lexical_error "unterminated lexer definition") }
+  | _
+    { raise(Lexical_error("illegal character " ^ lexing.lexeme lexbuf)) }
+
+and action = parse
+    '{' 
+    { brace_depth := brace_depth + 1;
+      action lexbuf }
+  | '}' 
+    { brace_depth := brace_depth - 1;
+      if brace_depth = 0 then lexing.lexeme_start lexbuf else action lexbuf }
+  | '"' 
+    { reset_string_buffer();
+      string lexbuf;
+      reset_string_buffer();
+      action lexbuf }
+  | '\''
+    { char lexbuf; action lexbuf }
+  | "(*" 
+    { comment_depth := 1;
+      comment lexbuf;
+      action lexbuf }
+  | eof 
+    { raise (Lexical_error "unterminated action") }
+  | _ 
+    { action lexbuf }
+      
+and string = parse
+    '"' 
+    { () }
+  | '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
+    { string lexbuf }
+  | '\\' ['\\' '"' 'n' 't' 'b' 'r'] 
+    { store_string_char(char_for_backslash(lexing.lexeme_char lexbuf 1));
+      string lexbuf }
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] 
+    { store_string_char(char_for_decimal_code lexbuf 1);
+      string lexbuf }
+  | eof 
+    { raise(Lexical_error "unterminated string") }
+  | _ 
+    { store_string_char(lexing.lexeme_char lexbuf 0);
+      string lexbuf }
+
+and char = parse
+    [^ '\\'] "'" 
+    { lexing.lexeme_char lexbuf 0 }
+  | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'" 
+    { char_for_backslash (lexing.lexeme_char lexbuf 1) }
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" 
+    { char_for_decimal_code lexbuf 1 }
+  | _ 
+    { raise(Lexical_error "bad character constant") }
+
+and comment = parse
+    "(*" 
+    { comment_depth := comment_depth + 1; comment lexbuf }
+  | "*)" 
+    { comment_depth := comment_depth - 1;
+      if comment_depth = 0 then () else comment lexbuf }
+  | '"' 
+    { reset_string_buffer();
+      string lexbuf;
+      reset_string_buffer();
+      comment lexbuf }
+  | eof 
+    { raise(Lexical_error "unterminated comment") }
+  | _ 
+    { comment lexbuf }
+;;
diff --git a/test/Makefile b/test/Makefile
new file mode 100644 (file)
index 0000000..a12a651
--- /dev/null
@@ -0,0 +1,179 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the Q Public License version 1.0.                #
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.32 2005/08/12 09:22:04 xleroy Exp $
+
+include ../config/Makefile
+
+CAMLC=../boot/ocamlrun ../ocamlc
+CAMLOPT=../boot/ocamlrun ../ocamlopt
+COMPFLAGS=-nostdlib -I ../stdlib -I KB -I Lex
+OPTFLAGS=-S
+CAMLYACC=../yacc/ocamlyacc
+YACCFLAGS=-v
+CAMLLEX=../boot/ocamlrun ../lex/ocamllex
+CAMLDEP=../boot/ocamlrun ../tools/ocamldep
+CAMLRUN=../byterun/ocamlrun
+CODERUNPARAMS=OCAMLRUNPARAM='o=100'
+
+BYTE_EXE=fib.byt takc.byt taku.byt sieve.byt quicksort.byt quicksort.fast.byt \
+  fft.byt fft.fast.byt soli.byt soli.fast.byt boyer.byt kb.byt \
+  nucleic.byt bdd.byt hamming.byt sorts.byt \
+  almabench.byt almabench.fast.byt
+
+CODE_EXE=$(BYTE_EXE:.byt=.out)
+
+default: all codetest bytetest
+
+all: $(BYTE_EXE) $(CODE_EXE)
+
+# Nucleic
+
+nucleic.out: nucleic.ml
+       case $(ARCH) in \
+          i386) sed -e '/<HAND_CSE>/,/<\/HAND_CSE>/d' -e '/NO_CSE>/d' \
+                nucleic.ml > nucleic.mlt; \
+               $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -o nucleic.out nucleic.mlt;\
+               rm -f nucleic.mlt;; \
+             *) $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -o nucleic.out nucleic.ml; \
+        esac
+
+# KB
+
+BYTE_KB=KB/terms.cmo KB/equations.cmo KB/kb.cmo KB/orderings.cmo KB/kbmain.cmo
+CODE_KB=$(BYTE_KB:.cmo=.cmx)
+
+kb.byt: $(BYTE_KB)
+       $(CAMLC) $(COMPFLAGS) $(BYTE_KB) -o kb.byt
+kb.out: $(CODE_KB)
+       $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) $(CODE_KB) -o kb.out
+
+clean::
+       rm -f KB/*.cm[iox] KB/*.[os]
+       rm -f KB/*~
+
+# Genlex
+
+BYTE_GENLEX=Lex/syntax.cmo Lex/scan_aux.cmo Lex/scanner.cmo Lex/gram_aux.cmo \
+  Lex/grammar.cmo Lex/lexgen.cmo Lex/output.cmo Lex/main.cmo
+CODE_GENLEX=$(BYTE_GENLEX:.cmo=.cmx)
+
+genlex.byt: $(BYTE_GENLEX)
+       $(CAMLC) $(COMPFLAGS) $(BYTE_GENLEX) -o genlex.byt
+genlex.out: $(CODE_GENLEX)
+       $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) $(CODE_GENLEX) -o genlex.out
+
+clean::
+       rm -f Lex/*.cm[iox] Lex/*.[os]
+       rm -f Lex/*~
+       rm -f Lex/grammar.output
+
+Lex/grammar.ml Lex/grammar.mli: Lex/grammar.mly ../yacc/ocamlyacc$(EXE)
+       $(CAMLYACC) $(YACCFLAGS) Lex/grammar.mly
+
+clean::
+       rm -f Lex/grammar.ml Lex/grammar.mli
+beforedepend:: Lex/grammar.ml Lex/grammar.mli
+
+Lex/scanner.ml: Lex/scanner.mll ../lex/ocamllex
+       $(CAMLLEX) Lex/scanner.mll
+
+clean::
+       rm -f Lex/scanner.ml
+beforedepend:: Lex/scanner.ml
+
+# Common rules
+
+.SUFFIXES:
+.SUFFIXES: .mli .ml .cmi .cmo .cmx .byt .fast.byt .out .fast.out
+
+.ml.byt:
+       $(CAMLC) $(COMPFLAGS) -o $*.byt $<
+
+.ml.fast.byt:
+       cp $*.ml $*_fast.ml
+       $(CAMLC) $(COMPFLAGS) -unsafe -o $*.fast.byt $*_fast.ml
+       rm -f $*_fast.ml
+
+.ml.out:
+       $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -o $*.out $<
+
+.ml.fast.out:
+       cp $*.ml $*_fast.ml
+       $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -unsafe -o $*.fast.out $*_fast.ml
+       rm -f $*_fast.ml
+
+.mli.cmi:
+       $(CAMLC) $(COMPFLAGS) -c $<
+
+.ml.cmo:
+       $(CAMLC) $(COMPFLAGS) -c $<
+
+.ml.cmx:
+       $(CAMLOPT) $(COMPFLAGS) $(OPTFLAGS) -c $<
+
+$(BYTE_EXE) $(BYTE_KB) $(BYTE_GENLEX): ../ocamlc
+$(BYTE_EXE): ../stdlib/stdlib.cma
+$(CODE_EXE) $(CODE_KB) $(CODE_GENLEX): ../ocamlopt
+$(CODE_EXE): ../stdlib/stdlib.cmxa ../stdlib/libasmrun.a
+
+clean::
+       rm -f *.byt *.out
+       rm -f *.cm[iox] *.[os]
+       rm -f *~
+
+# Regression test
+
+test: codetest
+
+bytetest:
+       set -e; \
+        for prog in $(BYTE_EXE:.byt=); do \
+          echo $$prog; \
+          $(CAMLRUN) $$prog.byt | cmp - Results/$$prog.out; \
+        done
+
+codetest:
+       set -e; \
+        for prog in $(CODE_EXE:.out=); do \
+          echo $$prog; \
+          ./$$prog.out | cmp - Results/$$prog.out; \
+        done
+
+clean::
+       rm -f Lex/testscanner.ml
+
+# Benchmark
+
+bench: codebench
+
+bytebench:
+       set -e; \
+        for prog in $(BYTE_EXE:.byt=); do \
+          echo "$$prog                " | cut -c 1-16 | tr -d '\012'; \
+          xtime -mintime 5 -o /dev/null -e /dev/null $(CAMLRUN) $$prog.byt; \
+        done
+
+codebench:
+       set -e; \
+        for prog in $(CODE_EXE:.out=); do \
+          echo "$$prog                " | cut -c 1-16 | tr -d '\012'; \
+          $(CODERUNPARAMS) xtime -mintime 5 -o /dev/null -e /dev/null ./$$prog.out; \
+        done
+
+# Dependencies
+
+depend: beforedepend
+       $(CAMLDEP) -I KB -I Lex *.mli *.ml KB/*.mli KB/*.ml Lex/*.mli Lex/*.ml > .depend
+
+include .depend
+
diff --git a/test/Moretest/.cvsignore b/test/Moretest/.cvsignore
new file mode 100644 (file)
index 0000000..55c27ce
--- /dev/null
@@ -0,0 +1,2 @@
+*.out
+*.byt
diff --git a/test/Moretest/.depend b/test/Moretest/.depend
new file mode 100644 (file)
index 0000000..ad8f4f1
--- /dev/null
@@ -0,0 +1,8 @@
+cmcaml.cmo: callback.cmo 
+cmcaml.cmx: callback.cmx 
+multdef.cmo: multdef.cmi 
+multdef.cmx: multdef.cmi 
+recmod.cmo: recmod.cmi 
+recmod.cmx: recmod.cmi 
+usemultdef.cmo: multdef.cmi 
+usemultdef.cmx: multdef.cmx 
diff --git a/test/Moretest/Makefile b/test/Moretest/Makefile
new file mode 100644 (file)
index 0000000..678a9b4
--- /dev/null
@@ -0,0 +1,195 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the Q Public License version 1.0.                #
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.32 2005/07/01 12:39:43 weis Exp $
+
+include ../../config/Makefile
+
+CAMLC=../../boot/ocamlrun ../../ocamlc -I ../../stdlib
+CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib
+OPTFLAGS=-S
+CAMLDEP=../../boot/ocamlrun ../../tools/ocamldep
+CAMLRUN=../../byterun/ocamlrun
+CODERUNPARAMS=OCAMLRUNPARAM='o=100'
+
+callback.byt: callback.cmo callbackprim.o
+       $(CAMLC) -o callback.byt -custom callback.cmo callbackprim.o ../../otherlibs/unix/libunix.a
+callback.out: callback.cmx callbackprim.o
+       $(CAMLOPT) -o callback.out callback.cmx callbackprim.o ../../otherlibs/unix/libunix.a
+
+manyargs.byt: manyargs.cmo manyargsprim.o
+       $(CAMLC) -o manyargs.byt -custom manyargs.cmo manyargsprim.o
+manyargs.out: manyargs.cmx manyargsprim.o
+       $(CAMLOPT) -inline 0 -o manyargs.out manyargs.cmx manyargsprim.o
+
+multdef.out: multdef.cmx usemultdef.cmx
+       $(CAMLOPT) -o multdef.out multdef.cmx usemultdef.cmx
+
+cm.byt: cmcaml.ml cmstub.c cmmain.c
+       $(CAMLC) -custom -o cm.byt cmcaml.ml cmstub.c cmmain.c
+
+cmlinked.out: cmcaml.ml cmstub.c cmmain.c
+       $(CAMLC) -output-obj -o cm.o cmcaml.ml
+       $(BYTECC) -g -o cmlinked.out cm.o -I../../byterun -DNO_BYTECODE_FILE cmstub.c cmmain.c ../../byterun/libcamlrun.a $(BYTECCLIBS)
+
+cm.out: cmcaml.ml cmstub.c cmmain.c
+       $(CAMLOPT) -output-obj -o cm.o cmcaml.ml
+       $(NATIVECC) -g -o cm.out cm.o -I$(LIBDIR) -DNO_BYTECODE_FILE cmstub.c cmmain.c ../../asmrun/libasmrun.a $(NATIVECCLIBS)
+
+bigarrays.byt: ../../otherlibs/bigarray/bigarray.cma \
+               ../../otherlibs/bigarray/libbigarray.a bigarrays.ml
+       $(CAMLC) -custom -o bigarrays.byt \
+                -I ../../otherlibs/bigarray \
+                -I ../../otherlibs/unix \
+                unix.cma bigarray.cma bigarrays.ml
+
+bigarrays.out: ../../otherlibs/bigarray/bigarray.cmxa \
+               ../../otherlibs/bigarray/libbigarray.a bigarrays.ml
+       $(CAMLOPT) $(OPTFLAGS) -o bigarrays.out \
+                -I ../../otherlibs/bigarray \
+                -I ../../otherlibs/unix \
+                unix.cmxa bigarray.cmxa bigarrays.ml
+
+bigarrf.byt: bigarrf.o bigarrfstub.o \
+               ../../otherlibs/bigarray/bigarray.cma \
+               ../../otherlibs/bigarray/libbigarray.a bigarrfml.ml
+       $(CAMLC) -custom -o bigarrf.byt \
+                -I ../../otherlibs/bigarray \
+                -I ../../otherlibs/unix \
+                unix.cma bigarray.cma bigarrf.ml \
+                bigarrf.o bigarrfstub.o \
+                ../../byterun/libcamlrun.a -cclib -lg2c
+
+bigarrf.out: bigarrf.o bigarrfstub.o \
+               ../../otherlibs/bigarray/bigarray.cma \
+               ../../otherlibs/bigarray/libbigarray.a bigarrfml.ml
+       $(CAMLOPT) $(OPTFLAGS) -o bigarrf.out \
+                -I ../../otherlibs/bigarray \
+                -I ../../otherlibs/unix \
+                unix.cma bigarray.cma bigarrf.ml \
+                bigarrf.o bigarrfstub.o \
+                ../../byterun/libcamlrun.a -cclib -lg2c
+
+bigarrf.o: bigarrf.f
+       g77 -c bigarrf.f
+
+bigarrfstub.o: bigarrfstub.c
+       $(NATIVECC) $(NATIVECCCOMPOPTS) -I../../byterun -I../../otherlibs/bigarray -c bigarrfstub.c
+
+fftba.byt: fftba.ml
+       $(CAMLC) -o fftba.byt -I ../../otherlibs/bigarray \
+          bigarray.cma fftba.ml
+
+fftba.out: fftba.ml
+       $(CAMLOPT) $(OPTFLAGS) -o fftba.out -I ../../otherlibs/bigarray \
+          bigarray.cmxa fftba.ml
+
+globroots.byt: globroots.ml globrootsprim.o
+       $(CAMLC) -custom -o globroots.byt globroots.ml globrootsprim.o
+
+globroots.out: globroots.ml globrootsprim.o
+       $(CAMLOPT) -o globroots.out globroots.ml globrootsprim.o
+
+globrootsprim.o: globrootsprim.c
+       $(BYTECC) $(BYTECCCOMPOPTS) -I../../byterun -c globrootsprim.c
+
+float.byt: float.cmo
+       ${CAMLC} -o float.byt float.cmo
+float.out: float.cmx
+       ${CAMLOPT} -o float.out float.cmx
+
+intext.byt: intext.cmo intextaux.o
+       ${CAMLC} -o intext.byt -custom intext.cmo intextaux.o
+intext.out: intext.cmx intextaux.o
+       ${CAMLOPT} -o intext.out intext.cmx intextaux.o
+
+tscanf.byt: tscanf.cmo
+       ${CAMLC} -o tscanf.byt tscanf.cmo
+tscanf.out: tscanf.cmx
+       ${CAMLOPT} -o tscanf.out tscanf.cmx
+
+tscanf2.byt: tscanf2_io.cmo tscanf2_slave.cmo tscanf2_master.cmo
+       ${CAMLC} -o tscanf2_slave.byt tscanf2_io.cmo tscanf2_slave.cmo
+       ${CAMLC} -o tscanf2_master.byt unix.cma \
+               tscanf2_io.cmo tscanf2_master.cmo
+
+tscanf2.out: tscanf2_io.cmx tscanf2_slave.cmx tscanf2_master.cmx
+       ${CAMLOPT} -o tscanf2_slave.out tscanf2_io.cmx tscanf2_slave.cmx
+       ${CAMLOPT} -o tscanf2_master.out unix.cmxa \
+               tscanf2_io.cmx tscanf2_master.cmx
+
+scanf: tscanf.byt tscanf.out tscanf2.byt tscanf2.out
+       ./tscanf.byt
+       ./tscanf.out
+       ./tscanf2_master.byt ./tscanf2_slave.byt
+       ./tscanf2_master.out ./tscanf2_slave.out
+
+regexp.byt: ../../otherlibs/str/str.cma regexp.ml
+       $(CAMLC) -custom -I ../../otherlibs/str -o regexp.byt str.cma regexp.ml
+regexp.opt: ../../otherlibs/str/str.cmxa regexp.ml
+       $(CAMLOPT) -I ../../otherlibs/str -o regexp.opt str.cmxa regexp.ml
+
+md5.out: md5.ml
+       $(CAMLOPT) -unsafe -inline 100 -o md5.out md5.ml
+
+recmod.byt: recmod.cmo
+       $(CAMLC) -o recmod.byt recmod.cmo
+
+recmod.out: recmod.cmx
+       $(CAMLOPT) -o recmod.out recmod.cmx
+
+# Common rules
+
+.SUFFIXES:
+.SUFFIXES: .mli .ml .cmi .cmo .cmx .byt .fast.byt .out .fast.out .c .o
+
+.ml.byt:
+       $(CAMLC) -o $*.byt $<
+
+.ml.fast.byt:
+       cp $*.ml $*_fast.ml
+       $(CAMLC) -unsafe -o $*.fast.byt $*_fast.ml
+       rm -f $*_fast.ml
+
+.ml.out:
+       $(CAMLOPT) $(OPTFLAGS) -o $*.out $<
+
+.ml.fast.out:
+       cp $*.ml $*_fast.ml
+       $(CAMLOPT) $(OPTFLAGS) -unsafe -o $*.fast.out $*_fast.ml
+       rm -f $*_fast.ml
+
+.mli.cmi:
+       $(CAMLC) -c $<
+
+.ml.cmo:
+       $(CAMLC) -c $<
+
+.ml.cmx:
+       $(CAMLOPT) $(OPTFLAGS) -c $<
+
+.c.o:
+       $(NATIVECC) $(NATIVECCCOMPOPTS) -I../../byterun -c $<
+
+clean::
+       rm -f *.byt *.out
+       rm -f *.cm[iox] *.[os]
+       rm -f *~
+       rm -f intext.data
+
+# Dependencies
+
+depend:
+       $(CAMLDEP) *.mli *.ml > .depend
+
+include .depend
+
diff --git a/test/Moretest/arrays.ml b/test/Moretest/arrays.ml
new file mode 100644 (file)
index 0000000..bbe8be3
--- /dev/null
@@ -0,0 +1,86 @@
+let bigarray n = [|
+n+0; n+1; n+2; n+3; n+4; n+5; n+6; n+7; n+8; n+9; n+10; n+11; n+12;
+n+13; n+14; n+15; n+16; n+17; n+18; n+19; n+20; n+21; n+22; n+23;
+n+24; n+25; n+26; n+27; n+28; n+29; n+30; n+31; n+32; n+33; n+34;
+n+35; n+36; n+37; n+38; n+39; n+40; n+41; n+42; n+43; n+44; n+45;
+n+46; n+47; n+48; n+49; n+50; n+51; n+52; n+53; n+54; n+55; n+56;
+n+57; n+58; n+59; n+60; n+61; n+62; n+63; n+64; n+65; n+66; n+67;
+n+68; n+69; n+70; n+71; n+72; n+73; n+74; n+75; n+76; n+77; n+78;
+n+79; n+80; n+81; n+82; n+83; n+84; n+85; n+86; n+87; n+88; n+89;
+n+90; n+91; n+92; n+93; n+94; n+95; n+96; n+97; n+98; n+99; n+100;
+n+101; n+102; n+103; n+104; n+105; n+106; n+107; n+108; n+109; n+110;
+n+111; n+112; n+113; n+114; n+115; n+116; n+117; n+118; n+119; n+120;
+n+121; n+122; n+123; n+124; n+125; n+126; n+127; n+128; n+129; n+130;
+n+131; n+132; n+133; n+134; n+135; n+136; n+137; n+138; n+139; n+140;
+n+141; n+142; n+143; n+144; n+145; n+146; n+147; n+148; n+149; n+150;
+n+151; n+152; n+153; n+154; n+155; n+156; n+157; n+158; n+159; n+160;
+n+161; n+162; n+163; n+164; n+165; n+166; n+167; n+168; n+169; n+170;
+n+171; n+172; n+173; n+174; n+175; n+176; n+177; n+178; n+179; n+180;
+n+181; n+182; n+183; n+184; n+185; n+186; n+187; n+188; n+189; n+190;
+n+191; n+192; n+193; n+194; n+195; n+196; n+197; n+198; n+199; n+200;
+n+201; n+202; n+203; n+204; n+205; n+206; n+207; n+208; n+209; n+210;
+n+211; n+212; n+213; n+214; n+215; n+216; n+217; n+218; n+219; n+220;
+n+221; n+222; n+223; n+224; n+225; n+226; n+227; n+228; n+229; n+230;
+n+231; n+232; n+233; n+234; n+235; n+236; n+237; n+238; n+239; n+240;
+n+241; n+242; n+243; n+244; n+245; n+246; n+247; n+248; n+249; n+250;
+n+251; n+252; n+253; n+254; n+255; n+256; n+257; n+258; n+259; n+260;
+n+261; n+262; n+263; n+264; n+265; n+266; n+267; n+268; n+269; n+270;
+n+271; n+272; n+273; n+274; n+275; n+276; n+277; n+278; n+279; n+280;
+n+281; n+282; n+283; n+284; n+285; n+286; n+287; n+288; n+289; n+290;
+n+291; n+292; n+293; n+294; n+295; n+296; n+297; n+298; n+299
+|]
+
+let test1 () =
+  let a = bigarray 12345 in
+  Gc.full_major();
+  for i = 0 to Array.length a - 1 do
+    if a.(i) <> 12345 + i then print_string "Test1: error\n"
+  done
+
+let testcopy a =
+  Array.copy a = a
+
+let test2 () =
+  if not (testcopy [|1;2;3;4;5|]) then
+    print_string "Test2: failed on int array\n";
+  if not (testcopy [|1.2;2.3;3.4;4.5|]) then
+    print_string "Test2: failed on float array\n";
+  if not (testcopy [|"un"; "deux"; "trois"|]) then
+    print_string "Test2: failed on string array\n"
+
+module AbstractFloat =
+  (struct
+    type t = float
+    let to_float x = x
+    let from_float x = x
+   end :
+   sig
+    type t
+    val to_float: t -> float
+    val from_float: float -> t
+   end)
+
+let test3 () =
+  let t1 = AbstractFloat.from_float 1.0
+  and t2 = AbstractFloat.from_float 2.0
+  and t3 = AbstractFloat.from_float 3.0 in
+  let v = [|t1;t2;t3|] in
+  let w = Array.create 2 t1 in
+  let u = Array.copy v in
+  if not (AbstractFloat.to_float v.(0) = 1.0 &&
+          AbstractFloat.to_float v.(1) = 2.0 &&
+          AbstractFloat.to_float v.(2) = 3.0) then
+    print_string "Test3: failed on v\n";
+  if not (AbstractFloat.to_float w.(0) = 1.0 &&
+          AbstractFloat.to_float w.(1) = 1.0) then
+    print_string "Test3: failed on w\n";
+  if not (AbstractFloat.to_float u.(0) = 1.0 &&
+          AbstractFloat.to_float u.(1) = 2.0 &&
+          AbstractFloat.to_float u.(2) = 3.0) then
+    print_string "Test3: failed on u\n"
+
+let _ =
+  test1();
+  test2();
+  test3();
+  exit 0
diff --git a/test/Moretest/bigarrays.ml b/test/Moretest/bigarrays.ml
new file mode 100644 (file)
index 0000000..302ade9
--- /dev/null
@@ -0,0 +1,720 @@
+open Bigarray
+open Printf
+open Complex
+
+(* Test harness *)
+
+let error_occurred = ref false
+
+let function_tested = ref ""
+
+let testing_function s =
+    function_tested := s;
+    print_newline();
+    print_string s;
+    print_newline()
+
+let test test_number answer correct_answer =
+ flush stdout;
+ flush stderr;
+ if answer <> correct_answer then begin
+   eprintf "*** Bad result (%s, test %d)\n" !function_tested test_number;
+   flush stderr;
+   error_occurred := true
+ end else begin
+   printf " %d..." test_number
+ end
+
+(* One-dimensional arrays *)
+
+let _ =
+  testing_function "------ Array1 --------";
+  testing_function "create/set/get";
+  let test_setget kind vals =
+    let rec set a i = function
+        [] -> ()
+      | (v1, v2) :: tl -> a.{i} <- v1; set a (i+1) tl in
+    let rec test a i = function
+        [] -> true
+      | (v1, v2) :: tl -> a.{i} = v2 && test a (i+1) tl in
+    let ca = Array1.create kind c_layout (List.length vals) in
+    let fa = Array1.create kind fortran_layout (List.length vals) in
+    set ca 0 vals;
+    set fa 1 vals;
+    test ca 0 vals && test fa 1 vals in
+  test 1 true
+    (test_setget int8_signed
+                 [0, 0;
+                  123, 123;
+                  -123, -123;
+                  456, -56;
+                  0x101, 1]);
+  test 2 true
+    (test_setget int8_unsigned
+                 [0, 0;
+                  123, 123;
+                  -123, 133;
+                  456, 0xc8;
+                  0x101, 1]);
+  test 3 true
+    (test_setget int16_signed
+                 [0, 0;
+                  123, 123;
+                  -123, -123;
+                  31456, 31456;
+                  -31456, -31456;
+                  65432, -104;
+                  0x10001, 1]);
+  test 4 true
+    (test_setget int16_unsigned
+                 [0, 0;
+                  123, 123;
+                  -123, 65413;
+                  31456, 31456;
+                  -31456, 34080;
+                  65432, 65432;
+                  0x10001, 1]);
+  test 5 true
+    (test_setget int
+                 [0, 0;
+                  123, 123;
+                  -456, -456;
+                  max_int, max_int;
+                  min_int, min_int;
+                  0x12345678, 0x12345678;
+                  -0x12345678, -0x12345678]);
+  test 6 true
+    (test_setget int32
+                 [Int32.zero, Int32.zero;
+                  Int32.of_int 123, Int32.of_int 123;
+                  Int32.of_int (-456), Int32.of_int (-456);
+                  Int32.max_int, Int32.max_int;
+                  Int32.min_int, Int32.min_int;
+                  Int32.of_string "0x12345678", Int32.of_string "0x12345678"]);
+  test 7 true
+    (test_setget int64
+                 [Int64.zero, Int64.zero;
+                  Int64.of_int 123, Int64.of_int 123;
+                  Int64.of_int (-456), Int64.of_int (-456);
+                  Int64.max_int, Int64.max_int;
+                  Int64.min_int, Int64.min_int;
+                  Int64.of_string "0x123456789ABCDEF0",
+                     Int64.of_string "0x123456789ABCDEF0"]);
+  test 8 true
+    (test_setget nativeint
+                 [Nativeint.zero, Nativeint.zero;
+                  Nativeint.of_int 123, Nativeint.of_int 123;
+                  Nativeint.of_int (-456), Nativeint.of_int (-456);
+                  Nativeint.max_int, Nativeint.max_int;
+                  Nativeint.min_int, Nativeint.min_int;
+                  Nativeint.of_string "0x12345678",
+                    Nativeint.of_string "0x12345678"]);
+  test 9 true
+    (test_setget float32
+                 [0.0, 0.0;
+                  4.0, 4.0;
+                  -0.5, -0.5;
+                  655360.0, 655360.0]);
+  test 10 true
+    (test_setget float64
+                 [0.0, 0.0;
+                  4.0, 4.0;
+                  -0.5, -0.5;
+                  1.2345678, 1.2345678;
+                  3.1415e10, 3.1415e10]);
+  test 11 true
+    (test_setget complex32
+                 [Complex.zero, Complex.zero;
+                  Complex.one, Complex.one;
+                  Complex.i, Complex.i;
+                  {im = 0.5; re = -2.0}, {im = 0.5; re = -2.0}]);
+  test 12 true
+    (test_setget complex64
+                 [Complex.zero, Complex.zero;
+                  Complex.one, Complex.one;
+                  Complex.i, Complex.i;
+                  {im=0.5;re= -2.0}, {im=0.5;re= -2.0};
+                  {im=3.1415;re=1.2345678}, {im=3.1415;re=1.2345678}]);
+
+  let from_list kind vals =
+    let a = Array1.create kind c_layout (List.length vals) in
+    let rec set i = function
+        [] -> () 
+      | hd :: tl -> a.{i} <- hd; set (i+1) tl in
+    set 0 vals;
+    a in
+  let from_list_fortran kind vals =
+    let a = Array1.create kind fortran_layout (List.length vals) in
+    let rec set i = function
+        [] -> () 
+      | hd :: tl -> a.{i} <- hd; set (i+1) tl in
+    set 1 vals;
+    a in
+
+  testing_function "set/get (specialized)";
+  let a = Array1.create int c_layout 3 in
+  for i = 0 to 2 do a.{i} <- i done;
+  for i = 0 to 2 do test (i+1) a.{i} i done;
+  test 4 true (try a.{3}; false with Invalid_argument _ -> true);
+  test 5 true (try a.{-1}; false with Invalid_argument _ -> true);
+    
+  let b = Array1.create float64 fortran_layout 3 in
+  for i = 1 to 3 do b.{i} <- float i done;
+  for i = 1 to 3 do test (5 + i) b.{i} (float i) done;
+  test 8 true (try b.{4}; false with Invalid_argument _ -> true);
+  test 9 true (try b.{0}; false with Invalid_argument _ -> true);
+
+  let c = Array1.create complex64 c_layout 3 in
+  for i = 0 to 2 do c.{i} <- {re=float i; im=0.0} done;
+  for i = 0 to 2 do test (10 + i) c.{i} {re=float i; im=0.0} done;
+  test 13 true (try c.{3}; false with Invalid_argument _ -> true);
+  test 14 true (try c.{-1}; false with Invalid_argument _ -> true);
+
+  let d = Array1.create complex32 fortran_layout 3 in
+  for i = 1 to 3 do d.{i} <- {re=float i; im=0.0} done;
+  for i = 1 to 3 do test (14 + i) d.{i} {re=float i; im=0.0} done;
+  test 18 true (try d.{4}; false with Invalid_argument _ -> true);
+  test 19 true (try d.{0}; false with Invalid_argument _ -> true);
+
+  testing_function "comparisons";
+  let normalize_comparison n =
+    if n = 0 then 0 else if n < 0 then -1 else 1 in
+  test 1 0 (normalize_comparison (compare
+     (from_list int8_signed [1;2;3;-4;127;-128])
+     (from_list int8_signed [1;2;3;-4;127;-128])));
+  test 2 (-1) (normalize_comparison (compare
+     (from_list int8_signed [1;2;3;-4;127;-128])
+     (from_list int8_signed [1;2;3;4;127;-128])));
+  test 3 1 (normalize_comparison (compare
+     (from_list int8_signed [1;2;3;-4;127;-128])
+     (from_list int8_signed [1;2;3;-4;42;-128])));
+  test 4 (-1) (normalize_comparison (compare
+     (from_list int8_signed [1;2;3;-4])
+     (from_list int8_signed [1;2;3;4;127;-128])));
+  test 5 1 (normalize_comparison (compare
+     (from_list int8_signed [1;2;3;4;127;-128])
+     (from_list int8_signed [1;2;3;-4])));
+
+  test 6 0 (normalize_comparison (compare
+     (from_list int8_unsigned [1;2;3;-4;127;-128])
+     (from_list int8_unsigned [1;2;3;-4;127;-128])));
+  test 7 1 (normalize_comparison (compare
+     (from_list int8_unsigned [1;2;3;-4;127;-128])
+     (from_list int8_unsigned [1;2;3;4;127;-128])));
+  test 8 1 (normalize_comparison (compare
+     (from_list int8_unsigned [1;2;3;-4;127;-128])
+     (from_list int8_unsigned [1;2;3;-4;42;-128])));
+
+  test 9 0 (normalize_comparison (compare
+     (from_list int16_signed [1;2;3;-4;127;-128])
+     (from_list int16_signed [1;2;3;-4;127;-128])));
+  test 10 (-1) (normalize_comparison (compare
+     (from_list int16_signed [1;2;3;-4;127;-128])
+     (from_list int16_signed [1;2;3;4;127;-128])));
+  test 11 1 (normalize_comparison (compare
+     (from_list int16_signed [1;2;3;-4;127;-128])
+     (from_list int16_signed [1;2;3;-4;42;-128])));
+
+  test 12 0 (normalize_comparison (compare
+     (from_list int16_unsigned [1;2;3;-4;127;-128])
+     (from_list int16_unsigned [1;2;3;-4;127;-128])));
+  test 13 (-1) (normalize_comparison (compare
+     (from_list int16_unsigned [1;2;3;4;127;-128])
+     (from_list int16_unsigned [1;2;3;0xFFFF;127;-128])));
+  test 14 1 (normalize_comparison (compare
+     (from_list int16_unsigned [1;2;3;-4;127;-128])
+     (from_list int16_unsigned [1;2;3;-4;42;-128])));
+
+  test 15 0 (normalize_comparison (compare
+     (from_list int [1;2;3;-4;127;-128])
+     (from_list int [1;2;3;-4;127;-128])));
+  test 16 (-1) (normalize_comparison (compare
+     (from_list int [1;2;3;-4;127;-128])
+     (from_list int [1;2;3;4;127;-128])));
+  test 17 1 (normalize_comparison (compare
+     (from_list int [1;2;3;-4;127;-128])
+     (from_list int [1;2;3;-4;42;-128])));
+
+  test 18 0 (normalize_comparison (compare
+     (from_list int32 (List.map Int32.of_int [1;2;3;-4;127;-128]))
+     (from_list int32 (List.map Int32.of_int [1;2;3;-4;127;-128]))));
+  test 19 (-1) (normalize_comparison (compare
+     (from_list int32 (List.map Int32.of_int [1;2;3;-4;127;-128]))
+     (from_list int32 (List.map Int32.of_int [1;2;3;4;127;-128]))));
+  test 20 1 (normalize_comparison (compare
+     (from_list int32 (List.map Int32.of_int [1;2;3;-4;127;-128]))
+     (from_list int32 (List.map Int32.of_int [1;2;3;-4;42;-128]))));
+
+  test 21 0 (normalize_comparison (compare
+     (from_list int64 (List.map Int64.of_int [1;2;3;-4;127;-128]))
+     (from_list int64 (List.map Int64.of_int [1;2;3;-4;127;-128]))));
+  test 22 (-1) (normalize_comparison (compare
+     (from_list int64 (List.map Int64.of_int [1;2;3;-4;127;-128]))
+     (from_list int64 (List.map Int64.of_int [1;2;3;4;127;-128]))));
+  test 23 1 (normalize_comparison (compare
+     (from_list int64 (List.map Int64.of_int [1;2;3;-4;127;-128]))
+     (from_list int64 (List.map Int64.of_int [1;2;3;-4;42;-128]))));
+
+  test 24 0 (normalize_comparison (compare
+     (from_list nativeint (List.map Nativeint.of_int [1;2;3;-4;127;-128]))
+     (from_list nativeint (List.map Nativeint.of_int [1;2;3;-4;127;-128]))));
+  test 25 (-1) (normalize_comparison (compare
+     (from_list nativeint (List.map Nativeint.of_int [1;2;3;-4;127;-128]))
+     (from_list nativeint (List.map Nativeint.of_int [1;2;3;4;127;-128]))));
+  test 26 1 (normalize_comparison (compare
+     (from_list nativeint (List.map Nativeint.of_int [1;2;3;-4;127;-128]))
+     (from_list nativeint (List.map Nativeint.of_int [1;2;3;-4;42;-128]))));
+
+  test 27 0 (normalize_comparison (compare
+     (from_list float32 [0.0; 0.25; -4.0; 3.141592654])
+     (from_list float32 [0.0; 0.25; -4.0; 3.141592654])));
+  test 28 (-1) (normalize_comparison (compare
+     (from_list float32 [0.0; 0.25; -4.0])
+     (from_list float32 [0.0; 0.25; 3.14159])));
+  test 29 1 (normalize_comparison (compare
+     (from_list float32 [0.0; 2.718; -4.0])
+     (from_list float32 [0.0; 0.25; 3.14159])));
+
+  test 30 0 (normalize_comparison (compare
+     (from_list float64 [0.0; 0.25; -4.0; 3.141592654])
+     (from_list float64 [0.0; 0.25; -4.0; 3.141592654])));
+  test 31 (-1) (normalize_comparison (compare
+     (from_list float64 [0.0; 0.25; -4.0])
+     (from_list float64 [0.0; 0.25; 3.14159])));
+  test 32 1 (normalize_comparison (compare
+     (from_list float64 [0.0; 2.718; -4.0])
+     (from_list float64 [0.0; 0.25; 3.14159])));
+
+  test 44 0 (normalize_comparison (compare
+     (from_list complex32 [Complex.zero; Complex.one; Complex.i])
+     (from_list complex32 [Complex.zero; Complex.one; Complex.i])));
+  test 45 (-1) (normalize_comparison (compare
+     (from_list complex32 [Complex.zero; Complex.one; Complex.i])
+     (from_list complex32 [Complex.zero; Complex.one; Complex.one])));
+  test 46 1 (normalize_comparison (compare
+     (from_list complex32 [Complex.zero; Complex.one; Complex.one])
+     (from_list complex32 [Complex.zero; Complex.one; Complex.i])));
+
+  test 47 0 (normalize_comparison (compare
+     (from_list complex64 [Complex.zero; Complex.one; Complex.i])
+     (from_list complex64 [Complex.zero; Complex.one; Complex.i])));
+  test 48 (-1) (normalize_comparison (compare
+     (from_list complex64 [Complex.zero; Complex.one; Complex.i])
+     (from_list complex64 [Complex.zero; Complex.one; Complex.one])));
+  test 49 1 (normalize_comparison (compare
+     (from_list complex64 [Complex.zero; Complex.one; Complex.one])
+     (from_list complex64 [Complex.zero; Complex.one; Complex.i])));
+
+  testing_function "dim";
+  test 1 (Array1.dim (from_list int [1;2;3;4;5])) 5;
+  test 2 (Array1.dim (from_list_fortran int [1;2;3])) 3;
+
+  testing_function "kind & layout";
+  let a = from_list int [1;2;3] in
+  test 1 (Array1.kind a) int;
+  test 2 (Array1.layout a) c_layout;
+  let a = from_list_fortran float32 [1.0;2.0;3.0] in
+  test 1 (Array1.kind a) float32;
+  test 2 (Array1.layout a) fortran_layout;
+
+  testing_function "sub";
+  let a = from_list int [1;2;3;4;5;6;7;8] in
+  test 1 (Array1.sub a 2 5)
+         (from_list int [3;4;5;6;7]);
+  test 2 (Array1.sub a 0 2)
+         (from_list int [1;2]);
+  test 3 (Array1.sub a 0 8)
+         (from_list int [1;2;3;4;5;6;7;8]);
+  let a = from_list float64 [1.0;2.0;3.0;4.0;5.0;6.0;7.0;8.0] in
+  test 4 (Array1.sub a 2 5)
+         (from_list float64 [3.0;4.0;5.0;6.0;7.0]);
+  test 5 (Array1.sub a 0 2)
+         (from_list float64 [1.0;2.0]);
+  test 6 (Array1.sub a 0 8)
+         (from_list float64 [1.0;2.0;3.0;4.0;5.0;6.0;7.0;8.0]);
+  let a = from_list_fortran float64 [1.0;2.0;3.0;4.0;5.0;6.0;7.0;8.0] in
+  test 7 (Array1.sub a 2 5)
+         (from_list_fortran float64 [2.0;3.0;4.0;5.0;6.0]);
+  test 8 (Array1.sub a 1 2)
+         (from_list_fortran float64 [1.0;2.0]);
+  test 9 (Array1.sub a 1 8)
+         (from_list_fortran float64 [1.0;2.0;3.0;4.0;5.0;6.0;7.0;8.0]);
+  Gc.full_major();  (* test GC of proxies *)
+
+  testing_function "blit, fill";
+  let test_blit_fill kind data initval ofs len =
+    let a = from_list kind data in
+    let b = Array1.create kind c_layout (List.length data) in
+    Array1.blit a b;
+    (a = b) &&
+    (Array1.fill (Array1.sub b ofs len) initval;
+     let rec check i = function
+         [] -> true
+       | hd :: tl -> b.{i} = (if i >= ofs && i < ofs + len
+                                       then initval else hd)
+                     && check (i+1) tl
+     in check 0 data) in
+  test 1 true (test_blit_fill int8_signed [1;2;5;8;-100;127] 7 3 2);
+  test 2 true (test_blit_fill int8_unsigned [1;2;5;8;-100;212] 7 3 2);
+  test 3 true (test_blit_fill int16_signed [1;2;5;8;-100;212] 7 3 2);
+  test 4 true (test_blit_fill int16_unsigned [1;2;5;8;-100;212] 7 3 2);
+  test 5 true (test_blit_fill int [1;2;5;8;-100;212] 7 3 2);
+  test 6 true (test_blit_fill int32 (List.map Int32.of_int [1;2;5;8;-100;212])
+                                    (Int32.of_int 7) 3 2);
+  test 7 true (test_blit_fill int64 (List.map Int64.of_int [1;2;5;8;-100;212])
+                                    (Int64.of_int 7) 3 2);
+  test 8 true (test_blit_fill nativeint
+                             (List.map Nativeint.of_int [1;2;5;8;-100;212])
+                             (Nativeint.of_int 7) 3 2);
+  test 9 true (test_blit_fill float32 [1.0;2.0;0.5;0.125;256.0;512.0]
+                             0.25 3 2);
+  test 10 true (test_blit_fill float64 [1.0;2.0;5.0;8.123;-100.456;212e19]
+                             3.1415 3 2);
+  test 11 true (test_blit_fill complex32 [Complex.zero; Complex.one; Complex.i]
+                             Complex.i 1 1);
+  test 12 true (test_blit_fill complex64 [Complex.zero; Complex.one; Complex.i]
+                             Complex.i 1 1);
+
+(* Bi-dimensional arrays *)
+
+  print_newline();
+  testing_function "------ Array2 --------";
+  testing_function "create/set/get";
+  let make_array2 kind layout ind0 dim1 dim2 fromint =
+    let a = Array2.create kind layout dim1 dim2 in
+    for i = ind0 to dim1 - 1 + ind0 do
+      for j = ind0 to dim2 - 1 + ind0 do
+        a.{i,j} <- (fromint (i * 1000 + j))
+      done
+    done;
+    a in
+  let check_array2 a ind0 dim1 dim2 fromint =
+    try
+      for i = ind0 to dim1 - 1 + ind0 do
+        for j = ind0 to dim2 - 1 + ind0 do
+          if a.{i,j} <> (fromint (i * 1000 + j)) then raise Exit
+        done
+      done;
+      true
+    with Exit -> false in
+  let id x = x in
+  test 1 true
+    (check_array2 (make_array2 int16_signed c_layout 0 10 20 id) 0 10 20 id);
+  test 2 true
+    (check_array2 (make_array2 int c_layout 0 10 20 id) 0 10 20 id);
+  test 3 true
+    (check_array2 (make_array2 int32 c_layout 0 10 20 Int32.of_int)
+                  0 10 20 Int32.of_int);
+  test 4 true
+    (check_array2 (make_array2 float32 c_layout 0 10 20 float)
+                  0 10 20 float);
+  test 5 true
+    (check_array2 (make_array2 float64 c_layout 0 10 20 float)
+                  0 10 20 float);
+  test 6 true
+    (check_array2 (make_array2 int16_signed fortran_layout 1 10 20 id) 1 10 20 id);
+  test 7 true
+    (check_array2 (make_array2 int fortran_layout 1 10 20 id) 1 10 20 id);
+  test 8 true
+    (check_array2 (make_array2 int32 fortran_layout 1 10 20 Int32.of_int)
+                  1 10 20 Int32.of_int);
+  test 9 true
+    (check_array2 (make_array2 float32 fortran_layout 1 10 20 float)
+                  1 10 20 float);
+  test 10 true
+    (check_array2 (make_array2 float64 fortran_layout 1 10 20 float)
+                  1 10 20 float);
+  let makecomplex i = {re = float i; im = float (-i)} in
+  test 11 true
+    (check_array2 (make_array2 complex32 c_layout 0 10 20 makecomplex)
+                  0 10 20 makecomplex);
+  test 12 true
+    (check_array2 (make_array2 complex64 c_layout 0 10 20 makecomplex)
+                  0 10 20 makecomplex);
+  test 13 true
+    (check_array2 (make_array2 complex32 fortran_layout 1 10 20 makecomplex)
+                  1 10 20 makecomplex);
+  test 14 true
+    (check_array2 (make_array2 complex64 fortran_layout 1 10 20 makecomplex)
+                  1 10 20 makecomplex);
+
+  testing_function "set/get (specialized)";
+  let a = Array2.create int16_signed c_layout 3 3 in
+  for i = 0 to 2 do for j = 0 to 2 do a.{i,j} <- i-j done done;
+  let ok = ref true in
+  for i = 0 to 2 do
+    for j = 0 to 2 do if a.{i,j} <> i-j then ok := false done
+  done;
+  test 1 true !ok;
+  test 2 true (try a.{3,0}; false with Invalid_argument _ -> true);
+  test 3 true (try a.{-1,0}; false with Invalid_argument _ -> true);
+  test 4 true (try a.{0,3}; false with Invalid_argument _ -> true);
+  test 5 true (try a.{0,-1}; false with Invalid_argument _ -> true);
+    
+  let b = Array2.create float32 fortran_layout 3 3 in
+  for i = 1 to 3 do for j = 1 to 3 do b.{i,j} <- float(i-j) done done;
+  let ok = ref true in
+  for i = 1 to 3 do
+    for j = 1 to 3 do if b.{i,j} <> float(i-j) then ok := false done
+  done;
+  test 6 true !ok;
+  test 7 true (try b.{4,1}; false with Invalid_argument _ -> true);
+  test 8 true (try b.{0,1}; false with Invalid_argument _ -> true);
+  test 9 true (try b.{1,4}; false with Invalid_argument _ -> true);
+  test 10 true (try b.{1,0}; false with Invalid_argument _ -> true);
+
+  testing_function "dim";
+  let a = (make_array2 int c_layout 0 4 6 id) in
+  test 1 (Array2.dim1 a) 4;
+  test 2 (Array2.dim2 a) 6;
+  let b =  (make_array2 int fortran_layout 1 4 6 id) in
+  test 3 (Array2.dim1 b) 4;
+  test 4 (Array2.dim2 b) 6;
+
+  testing_function "sub";
+  let a = make_array2 int c_layout 0 5 3 id in
+  let b = Array2.sub_left a 2 2 in
+  test 1 true
+         (b.{0,0} = 2000 &&
+          b.{0,1} = 2001 &&
+          b.{0,2} = 2002 &&
+          b.{1,0} = 3000 &&
+          b.{1,1} = 3001 &&
+          b.{1,2} = 3002);
+  let a = make_array2 int fortran_layout 1 5 3 id in
+  let b = Array2.sub_right a 2 2 in
+  test 2 true
+         (b.{1,1} = 1002 &&
+          b.{1,2} = 1003 &&
+          b.{2,1} = 2002 &&
+          b.{2,2} = 2003 &&
+          b.{3,1} = 3002 &&
+          b.{3,2} = 3003 &&
+          b.{4,1} = 4002 &&
+          b.{4,2} = 4003 &&
+          b.{5,1} = 5002 &&
+          b.{5,2} = 5003);
+
+  testing_function "slice";
+  let a = make_array2 int c_layout 0 5 3 id in
+  test 1 (Array2.slice_left a 0) (from_list int [0;1;2]);
+  test 2 (Array2.slice_left a 1) (from_list int [1000;1001;1002]);
+  test 3 (Array2.slice_left a 2) (from_list int [2000;2001;2002]);
+  test 4 (Array2.slice_left a 3) (from_list int [3000;3001;3002]);
+  test 5 (Array2.slice_left a 4) (from_list int [4000;4001;4002]);
+  let a = make_array2 int fortran_layout 1 5 3 id in
+  test 6 (Array2.slice_right a 1) (from_list_fortran int [1001;2001;3001;4001;5001]);
+  test 7 (Array2.slice_right a 2) (from_list_fortran int [1002;2002;3002;4002;5002]);
+  test 8 (Array2.slice_right a 3) (from_list_fortran int [1003;2003;3003;4003;5003]);
+
+(* Tri-dimensional arrays *)
+
+  print_newline();
+  testing_function "------ Array3 --------";
+  testing_function "create/set/get";
+  let make_array3 kind layout ind0 dim1 dim2 dim3 fromint =
+    let a = Array3.create kind layout dim1 dim2 dim3 in
+    for i = ind0 to dim1 - 1 + ind0 do
+      for j = ind0 to dim2 - 1 + ind0 do
+        for k = ind0 to dim3 - 1 + ind0 do
+          a.{i, j, k} <- (fromint (i * 100 + j * 10 + k))
+        done
+      done
+    done;
+    a in
+  let check_array3 a ind0 dim1 dim2 dim3 fromint =
+    try
+      for i = ind0 to dim1 - 1 + ind0 do
+        for j = ind0 to dim2 - 1 + ind0 do
+          for k = ind0 to dim3 - 1 + ind0 do
+            if a.{i, j, k} <> (fromint (i * 100 + j * 10 + k))
+            then raise Exit
+          done
+        done
+      done;
+      true
+    with Exit -> false in
+  let id x = x in
+  test 1 true
+    (check_array3 (make_array3 int16_signed c_layout 0 4 5 6 id) 0 4 5 6 id);
+  test 2 true
+    (check_array3 (make_array3 int c_layout 0 4 5 6 id) 0 4 5 6 id);
+  test 3 true
+    (check_array3 (make_array3 int32 c_layout 0 4 5 6 Int32.of_int)
+                  0 4 5 6 Int32.of_int);
+  test 4 true
+    (check_array3 (make_array3 float32 c_layout 0 4 5 6 float)
+                  0 4 5 6 float);
+  test 5 true
+    (check_array3 (make_array3 float64 c_layout 0 4 5 6 float)
+                  0 4 5 6 float);
+  test 6 true
+    (check_array3 (make_array3 int16_signed fortran_layout 1 4 5 6 id) 1 4 5 6 id);
+  test 7 true
+    (check_array3 (make_array3 int fortran_layout 1 4 5 6 id) 1 4 5 6 id);
+  test 8 true
+    (check_array3 (make_array3 int32 fortran_layout 1 4 5 6 Int32.of_int)
+                  1 4 5 6 Int32.of_int);
+  test 9 true
+    (check_array3 (make_array3 float32 fortran_layout 1 4 5 6 float)
+                  1 4 5 6 float);
+  test 10 true
+    (check_array3 (make_array3 float64 fortran_layout 1 4 5 6 float)
+                  1 4 5 6 float);
+  test 11 true
+    (check_array3 (make_array3 complex32 c_layout 0 4 5 6 makecomplex)
+                  0 4 5 6 makecomplex);
+  test 12 true
+    (check_array3 (make_array3 complex64 c_layout 0 4 5 6 makecomplex)
+                  0 4 5 6 makecomplex);
+  test 13 true
+    (check_array3 (make_array3 complex32 fortran_layout 1 4 5 6 makecomplex)
+                  1 4 5 6 makecomplex);
+  test 14 true
+    (check_array3 (make_array3 complex64 fortran_layout 1 4 5 6 makecomplex)
+                  1 4 5 6 makecomplex);
+
+
+  testing_function "set/get (specialized)";
+  let a = Array3.create int32 c_layout 2 3 4 in
+  for i = 0 to 1 do for j = 0 to 2 do for k = 0 to 3 do
+     a.{i,j,k} <- Int32.of_int((i lsl 4) + (j lsl 2) + k)
+  done done done;
+  let ok = ref true in
+  for i = 0 to 1 do for j = 0 to 2 do for k = 0 to 3 do
+     if Int32.to_int a.{i,j,k} <> (i lsl 4) + (j lsl 2) + k then ok := false
+  done done done;
+  test 1 true !ok;
+    
+  let b = Array3.create int64 fortran_layout 2 3 4 in
+  for i = 1 to 2 do for j = 1 to 3 do for k = 1 to 4 do
+     b.{i,j,k} <- Int64.of_int((i lsl 4) + (j lsl 2) + k)
+  done done done;
+  let ok = ref true in
+  for i = 1 to 2 do for j = 1 to 3 do for k = 1 to 4 do
+     if Int64.to_int b.{i,j,k} <> (i lsl 4) + (j lsl 2) + k then ok := false
+  done done done;
+  test 2 true !ok;
+
+  testing_function "dim";
+  let a = (make_array3 int c_layout 0 4 5 6 id) in
+  test 1 (Array3.dim1 a) 4;
+  test 2 (Array3.dim2 a) 5;
+  test 3 (Array3.dim3 a) 6;
+  let b =  (make_array3 int fortran_layout 1 4 5 6 id) in
+  test 4 (Array3.dim1 b) 4;
+  test 5 (Array3.dim2 b) 5;
+  test 6 (Array3.dim3 b) 6;
+
+  testing_function "slice1";
+  let a = make_array3 int c_layout 0 3 3 3 id in
+  test 1 (Array3.slice_left_1 a 0 0) (from_list int [0;1;2]);
+  test 2 (Array3.slice_left_1 a 0 1) (from_list int [10;11;12]);
+  test 3 (Array3.slice_left_1 a 0 2) (from_list int [20;21;22]);
+  test 4 (Array3.slice_left_1 a 1 1) (from_list int [110;111;112]);
+  test 5 (Array3.slice_left_1 a 2 1) (from_list int [210;211;212]);
+  let a = make_array3 int fortran_layout 1 3 3 3 id in
+  test 6 (Array3.slice_right_1 a 1 2) (from_list_fortran int [112;212;312]);
+  test 7 (Array3.slice_right_1 a 3 1) (from_list_fortran int [131;231;331]);
+
+(* Reshaping *)
+  print_newline();
+  testing_function "------ Reshaping --------";
+  testing_function "reshape_1";
+  let a = make_array2 int c_layout 0 3 4 id in
+  let b = make_array2 int fortran_layout 1 3 4 id in
+  let c = reshape_1 (genarray_of_array2 a) 12 in
+  test 1 c (from_list int [0;1;2;3;1000;1001;1002;1003;2000;2001;2002;2003]);
+  let d = reshape_1 (genarray_of_array2 b) 12 in
+  test 2 d (from_list_fortran int [1001;2001;3001;1002;2002;3002;1003;2003;3003;1004;2004;3004]);
+  testing_function "reshape_2";
+  let c = reshape_2 (genarray_of_array2 a) 4 3 in
+  test 1 (Array2.slice_left c 0) (from_list int [0;1;2]);
+  test 2 (Array2.slice_left c 1) (from_list int [3;1000;1001]);
+  test 3 (Array2.slice_left c 2) (from_list int [1002;1003;2000]);
+  test 4 (Array2.slice_left c 3) (from_list int [2001;2002;2003]);
+  let d = reshape_2 (genarray_of_array2 b) 4 3 in
+  test 5 (Array2.slice_right d 1) (from_list_fortran int [1001;2001;3001;1002]);
+  test 6 (Array2.slice_right d 2) (from_list_fortran int [2002;3002;1003;2003]);
+  test 7 (Array2.slice_right d 3) (from_list_fortran int [3003;1004;2004;3004]);
+
+(* I/O *)
+
+  print_newline();
+  testing_function "------ I/O --------";
+  testing_function "output_value/input_value";
+  let test_structured_io testno value =
+    let tmp = Filename.temp_file "bigarray" ".data" in
+    let oc = open_out_bin tmp in
+    output_value oc value;
+    close_out oc;
+    let ic = open_in_bin tmp in
+    let value' = input_value ic in
+    close_in ic;
+    Sys.remove tmp;
+    test testno value value' in
+  test_structured_io 1 (from_list int8_signed [1;2;3;-4;127;-128]);
+  test_structured_io 2 (from_list int16_signed [1;2;3;-4;127;-128]);
+  test_structured_io 3 (from_list int [1;2;3;-4;127;-128]);
+  test_structured_io 4
+    (from_list int32 (List.map Int32.of_int [1;2;3;-4;127;-128]));
+  test_structured_io 5
+    (from_list int64 (List.map Int64.of_int [1;2;3;-4;127;-128]));
+  test_structured_io 6
+    (from_list nativeint (List.map Nativeint.of_int [1;2;3;-4;127;-128]));
+  test_structured_io 7 (from_list float32 [0.0; 0.25; -4.0; 3.141592654]);
+  test_structured_io 8 (from_list float64 [0.0; 0.25; -4.0; 3.141592654]);
+  test_structured_io 9 (make_array2 int c_layout 0 100 100 id);
+  test_structured_io 10 (make_array2 float64 fortran_layout 1 200 200 float);
+  test_structured_io 11 (make_array3 int32 c_layout 0 20 30 40 Int32.of_int);
+  test_structured_io 12 (make_array3 float32 fortran_layout 1 10 50 100 float);
+  test_structured_io 13 (make_array2 complex32 c_layout 0 100 100 makecomplex);
+  test_structured_io 14 (make_array3 complex64 fortran_layout 1 10 20 30 makecomplex);
+
+  testing_function "map_file";
+  let mapped_file = Filename.temp_file "bigarray" ".data" in
+  begin
+    let fd =
+     Unix.openfile mapped_file
+                   [Unix.O_RDWR; Unix.O_TRUNC; Unix.O_CREAT] 0o666 in
+    let a = Array1.map_file fd float64 c_layout true 10000 in
+    Unix.close fd;
+    for i = 0 to 9999 do a.{i} <- float i done;
+    let fd = Unix.openfile mapped_file [Unix.O_RDONLY] 0 in
+    let b = Array2.map_file fd float64 fortran_layout false 100 (-1) in
+    Unix.close fd;
+    let ok = ref true in
+    for i = 0 to 99 do
+      for j = 0 to 99 do
+        if b.{j+1,i+1} <> float (100 * i + j) then ok := false
+      done
+    done;
+    test 1 !ok true;
+    b.{50,50} <- (-1.0);
+    let fd = Unix.openfile mapped_file [Unix.O_RDONLY] 0 in
+    let c = Array2.map_file fd float64 c_layout false (-1) 100 in
+    Unix.close fd;
+    let ok = ref true in
+    for i = 0 to 99 do
+      for j = 0 to 99 do
+        if c.{i,j} <> float (100 * i + j) then ok := false
+      done
+    done;
+    test 2 !ok true
+  end;
+  (* Force garbage collection of the mapped bigarrays above, otherwise
+     Win32 doesn't let us erase the file.  Notice the begin...end above
+     so that the VM doesn't keep stack references to the mapped bigarrays. *)
+  Gc.full_major();
+  Sys.remove mapped_file;
+
+  ()
+                  
+(********* End of test *********)
+
+let _ =
+  print_newline();
+  if !error_occurred then begin
+    prerr_endline "************* TEST FAILED ****************"; exit 2
+  end else
+    exit 0
diff --git a/test/Moretest/bigarrf.f b/test/Moretest/bigarrf.f
new file mode 100644 (file)
index 0000000..734863a
--- /dev/null
@@ -0,0 +1,26 @@
+       subroutine filltab()
+
+       parameter (dimx = 8, dimy = 6)
+       real ftab(dimx, dimy)
+       common /ftab/ ftab
+       integer x, y
+
+       do 100 x = 1, dimx
+          do 110 y = 1, dimy
+             ftab(x, y) = x * 100 + y
+ 110      continue
+ 100   continue
+       end
+
+       subroutine printtab(tab, dimx, dimy)
+
+       integer dimx, dimy
+       real tab(dimx, dimy)
+       integer x, y
+
+       do 200 x = 1, dimx
+          print 300, x, (tab(x, y), y = 1, dimy)
+ 300      format(/1X, I3, 2X, 10F6.1/)
+ 200   continue
+       end
+
diff --git a/test/Moretest/bigarrfml.ml b/test/Moretest/bigarrfml.ml
new file mode 100644 (file)
index 0000000..c915622
--- /dev/null
@@ -0,0 +1,63 @@
+open Bigarray
+open Printf
+
+(* Test harness *)
+
+let error_occurred = ref false
+
+let function_tested = ref ""
+
+let testing_function s =
+    function_tested := s;
+    print_newline();
+    print_string s;
+    print_newline()
+
+let test test_number answer correct_answer =
+ flush stdout;
+ flush stderr;
+ if answer <> correct_answer then begin
+   eprintf "*** Bad result (%s, test %d)\n" !function_tested test_number;
+   flush stderr;
+   error_occurred := true
+ end else begin
+   printf " %d..." test_number
+ end
+
+(* External C and Fortran functions *)
+
+external c_filltab : unit -> (float, float64_elt, c_layout) Array2.t = "c_filltab"
+external c_printtab : (float, float64_elt, c_layout) Array2.t -> unit = "c_printtab"
+external fortran_filltab : unit -> (float, float32_elt, fortran_layout) Array2.t = "fortran_filltab"
+external fortran_printtab : (float, float32_elt, fortran_layout) Array2.t -> unit = "fortran_printtab"
+
+let _ =
+
+  let make_array2 kind layout ind0 dim1 dim2 fromint =
+    let a = Array2.create kind layout dim1 dim2 in
+    for i = ind0 to dim1 - 1 + ind0 do
+      for j = ind0 to dim2 - 1 + ind0 do
+        a.{i,j} <- (fromint (i * 1000 + j))
+      done
+    done;
+    a in
+
+  print_newline();
+  testing_function "------ Foreign function interface --------";
+  testing_function "Passing an array to C";
+  c_printtab (make_array2 float64 c_layout 0 6 8 float);
+  testing_function "Accessing a C array";
+  let a = c_filltab () in
+  test 1 a.{0,0} 0.0;
+  test 2 a.{1,0} 100.0;
+  test 3 a.{0,1} 1.0;
+  test 4 a.{5,4} 504.0;
+  testing_function "Passing an array to Fortran";
+  fortran_printtab (make_array2 float32 fortran_layout 1 5 4 float);
+  testing_function "Accessing a Fortran array";
+  let a = fortran_filltab () in
+  test 1 a.{1,1} 101.0;
+  test 2 a.{2,1} 201.0;
+  test 3 a.{1,2} 102.0;
+  test 4 a.{5,4} 504.0;
+
diff --git a/test/Moretest/bigarrfstub.c b/test/Moretest/bigarrfstub.c
new file mode 100644 (file)
index 0000000..87bd67b
--- /dev/null
@@ -0,0 +1,60 @@
+#include <stdio.h>
+#include <mlvalues.h>
+#include <bigarray.h>
+
+extern void filltab_(void);
+extern void printtab_(float * data, int * dimx, int * dimy);
+extern float ftab_[];
+
+#define DIMX 6
+#define DIMY 8
+
+double ctab[DIMX][DIMY];
+
+void filltab(void)
+{
+  int x, y;
+  for (x = 0; x < DIMX; x++)
+    for (y = 0; y < DIMY; y++)
+      ctab[x][y] = x * 100 + y;
+}
+
+void printtab(double tab[DIMX][DIMY])
+{
+  int x, y;
+  for (x = 0; x < DIMX; x++) {
+    printf("%3d", x);
+    for (y = 0; y < DIMY; y++)
+      printf("  %6.1f", tab[x][y]);
+    printf("\n");
+  }
+}
+
+value c_filltab(value unit)
+{
+  filltab();
+  return alloc_bigarray_dims(BIGARRAY_FLOAT64 | BIGARRAY_C_LAYOUT,
+                             2, ctab, DIMX, DIMY);
+}
+
+value c_printtab(value ba)
+{
+  printtab(Data_bigarray_val(ba));
+  return Val_unit;
+}
+
+value fortran_filltab(value unit)
+{
+  filltab_();
+  return alloc_bigarray_dims(BIGARRAY_FLOAT32 | BIGARRAY_FORTRAN_LAYOUT,
+                             2, ftab_, 8, 6);
+}
+
+value fortran_printtab(value ba)
+{
+  int dimx = Bigarray_val(ba)->dim[0];
+  int dimy = Bigarray_val(ba)->dim[1];
+  printtab_(Data_bigarray_val(ba), &dimx, &dimy);
+  return Val_unit;
+}
+
diff --git a/test/Moretest/bigints.ml b/test/Moretest/bigints.ml
new file mode 100644 (file)
index 0000000..0b101ff
--- /dev/null
@@ -0,0 +1,12 @@
+let _ =
+  print_int 1000000000; print_newline();
+  print_int 10000000000; print_newline();
+  print_int 100000000000; print_newline();
+  print_int 1000000000000; print_newline();
+  print_int 10000000000000; print_newline();
+  print_int 100000000000000; print_newline();
+  print_int 1000000000000000; print_newline();
+  print_int 10000000000000000; print_newline();
+  print_int 100000000000000000; print_newline();
+  print_int 1000000000000000000; print_newline()
+
diff --git a/test/Moretest/bounds.ml b/test/Moretest/bounds.ml
new file mode 100644 (file)
index 0000000..a785c3c
--- /dev/null
@@ -0,0 +1,28 @@
+(* Test bound checks with ocamlopt *)
+
+let a = [| 0; 1; 2 |]
+
+let trail = ref []
+
+let test n =
+  let result =
+    try
+      trail := n :: !trail; a.(n); "doesn't fail"
+    with Invalid_argument s ->
+           (* Check well-formedness of s *)
+           if String.length s = 19
+           && s = "index out of bounds"
+           then "fails"
+           else "bad Invalid_argument"
+       | _ -> "bad exception"
+  in
+    print_int n; print_string ": "; print_string result; print_newline()
+
+let _ =
+  test 0; test 1; test 2; test 3; test 4; test (-1);
+  Gc.full_major();
+  print_string "Trail:";
+  List.iter (fun n -> print_string " "; print_int n) !trail;
+  print_newline()
+
+
diff --git a/test/Moretest/boxedints.ml b/test/Moretest/boxedints.ml
new file mode 100644 (file)
index 0000000..ed97513
--- /dev/null
@@ -0,0 +1,568 @@
+(* Test the types nativeint, int32, int64 *)
+
+open Printf
+
+let error_occurred = ref false
+
+let function_tested = ref ""
+
+let testing_function s =
+    function_tested := s;
+    print_newline();
+    print_string s;
+    print_newline()
+
+let test test_number answer correct_answer =
+ flush stdout;
+ flush stderr;
+ if answer <> correct_answer then begin
+   eprintf "*** Bad result (%s, test %d)\n" !function_tested test_number;
+   flush stderr;
+   error_occurred := true
+ end else begin
+   printf " %d..." test_number
+ end
+
+(***** Tests on 32 bit arithmetic *****)
+
+module type TESTSIG = sig
+  type t
+  module Ops : sig
+    val neg: t -> t 
+    val add: t -> t -> t 
+    val sub: t -> t -> t 
+    val mul: t -> t -> t 
+    val div: t -> t -> t 
+    val rem: t -> t -> t 
+    val logand: t -> t -> t 
+    val logor: t -> t -> t 
+    val logxor: t -> t -> t 
+    val shift_left: t -> int -> t 
+    val shift_right: t -> int -> t 
+    val shift_right_logical: t -> int -> t 
+    val of_int: int -> t 
+    val to_int: t -> int 
+    val of_float: float -> t 
+    val to_float: t -> float
+    val zero: t
+    val one: t
+    val minus_one: t
+    val min_int: t
+    val max_int: t
+    val format : string -> t -> string 
+    val to_string: t -> string
+    val of_string: string -> t 
+  end
+  val testcomp: t -> t -> bool*bool*bool*bool*bool*bool*int
+end
+
+module Test32(M: TESTSIG) =
+struct
+  open M
+  open Ops
+
+  let _ =
+    testing_function "of_int, to_int";
+    test 1 (to_int (of_int 0)) 0;
+    test 2 (to_int (of_int 123)) 123;
+    test 3 (to_int (of_int (-456))) (-456);
+    test 4 (to_int (of_int 0x3FFFFFFF)) 0x3FFFFFFF;
+    test 5 (to_int (of_int (-0x40000000))) (-0x40000000);
+
+    testing_function "of_string";
+    test 1 (of_string "0") (of_int 0);
+    test 2 (of_string "123") (of_int 123);
+    test 3 (of_string "-456") (of_int (-456));
+    test 4 (of_string "123456789") (of_int 123456789);
+    test 5 (of_string "0xABCDEF") (of_int 0xABCDEF);
+    test 6 (of_string "-0o1234567012") (of_int (- 0o1234567012));
+    test 7 (of_string "0b01010111111000001100")
+           (of_int 0b01010111111000001100);
+    test 8 (of_string "0x7FFFFFFF") max_int;
+    test 9 (of_string "-0x80000000") min_int;
+    test 10 (of_string "0x80000000") min_int;
+    test 11 (of_string "0xFFFFFFFF") minus_one;
+
+    testing_function "to_string, format";
+    List.iter (fun (n, s) -> test n (to_string (of_string s)) s)
+      [1, "0"; 2, "123"; 3, "-456"; 4, "1234567890";
+       5, "2147483647"; 6, "-2147483648"];
+    List.iter (fun (n, s) -> test n (format "0x%X" (of_string s)) s)
+      [7, "0x0"; 8, "0x123"; 9, "0xABCDEF"; 10, "0x12345678";
+       11, "0x7FFFFFFF"; 12, "0x80000000"; 13, "0xFFFFFFFF"];
+    test 14 (to_string max_int) "2147483647";
+    test 15 (to_string min_int) "-2147483648";
+    test 16 (to_string zero) "0";
+    test 17 (to_string one) "1";
+    test 18 (to_string minus_one) "-1";
+
+    testing_function "neg";
+    test 1 (neg (of_int 0)) (of_int 0);
+    test 2 (neg (of_int 123)) (of_int (-123));
+    test 3 (neg (of_int (-456))) (of_int 456);
+    test 4 (neg (of_int 123456789)) (of_int (-123456789));
+    test 5 (neg max_int) (of_string "-0x7FFFFFFF");
+    test 6 (neg min_int) min_int;
+
+    testing_function "add";
+    test 1 (add (of_int 0) (of_int 0)) (of_int 0);
+    test 2 (add (of_int 123) (of_int 0)) (of_int 123);
+    test 3 (add (of_int 0) (of_int 456)) (of_int 456);
+    test 4 (add (of_int 123) (of_int 456)) (of_int 579);
+    test 5 (add (of_int (-123)) (of_int 456)) (of_int 333);
+    test 6 (add (of_int 123) (of_int (-456))) (of_int (-333));
+    test 7 (add (of_int (-123)) (of_int (-456))) (of_int (-579));
+    test 8 (add (of_string "0x12345678") (of_string "0x9ABCDEF"))
+           (of_string "0x1be02467");
+    test 9 (add max_int max_int) (of_int (-2));
+    test 10 (add min_int min_int) zero;
+    test 11 (add max_int one) min_int;
+    test 12 (add min_int minus_one) max_int;
+    test 13 (add max_int min_int) minus_one;
+
+    testing_function "sub";
+    test 1 (sub (of_int 0) (of_int 0)) (of_int 0);
+    test 2 (sub (of_int 123) (of_int 0)) (of_int 123);
+    test 3 (sub (of_int 0) (of_int 456)) (of_int (-456));
+    test 4 (sub (of_int 123) (of_int 456)) (of_int (-333));
+    test 5 (sub (of_int (-123)) (of_int 456)) (of_int (-579));
+    test 6 (sub (of_int 123) (of_int (-456))) (of_int 579);
+    test 7 (sub (of_int (-123)) (of_int (-456))) (of_int 333);
+    test 8 (sub (of_string "0x12345678") (of_string "0x9ABCDEF"))
+           (of_string "0x8888889");
+    test 9 (sub max_int min_int) minus_one;
+    test 10 (sub min_int max_int) one;
+    test 11 (sub min_int one) max_int;
+    test 12 (sub max_int minus_one) min_int;
+
+    testing_function "mul";
+    test 1 (mul (of_int 0) (of_int 0)) (of_int 0);
+    test 2 (mul (of_int 123) (of_int 0)) (of_int 0);
+    test 3 (mul (of_int 0) (of_int (-456))) (of_int 0);
+    test 4 (mul (of_int 123) (of_int 1)) (of_int 123);
+    test 5 (mul (of_int 1) (of_int (-456))) (of_int (-456));
+    test 6 (mul (of_int 123) (of_int (-1))) (of_int (-123));
+    test 7 (mul (of_int (-1)) (of_int (-456))) (of_int 456);
+    test 8 (mul (of_int 123) (of_int 456)) (of_int 56088);
+    test 9 (mul (of_int (-123)) (of_int 456)) (of_int (-56088));
+    test 10 (mul (of_int 123) (of_int (-456))) (of_int (-56088));
+    test 11 (mul (of_int (-123)) (of_int (-456))) (of_int 56088);
+    test 12 (mul (of_string "0x12345678") (of_string "0x9ABCDEF"))
+            (of_string "0xe242d208");
+    test 13 (mul max_int max_int) one;
+
+    testing_function "div";
+    List.iter
+      (fun (n, a, b) -> test n (div (of_int a) (of_int b)) (of_int (a / b)))
+      [1, 0, 2;
+       2, 123, 1;
+       3, -123, 1;
+       4, 123, -1;
+       5, -123, -1;
+       6, 127531236, 365;
+       7, 16384, 256;
+       8, -127531236, 365;
+       9, 127531236, -365;
+       10, 1234567, 12345678;
+       11, 1234567, -12345678];
+
+    testing_function "mod";
+    List.iter
+      (fun (n, a, b) -> test n (rem (of_int a) (of_int b)) (of_int (a mod b)))
+      [1, 0, 2;
+       2, 123, 1;
+       3, -123, 1;
+       4, 123, -1;
+       5, -123, -1;
+       6, 127531236, 365;
+       7, 16384, 256;
+       8, -127531236, 365;
+       9, 127531236, -365;
+       10, 1234567, 12345678;
+       11, 1234567, -12345678];
+
+    testing_function "and";
+    List.iter
+      (fun (n, a, b, c) -> test n (logand (of_string a) (of_string b))
+                                  (of_string c))
+      [1, "0x12345678", "0x9abcdef0", "0x12345670";
+       2, "0x12345678", "0x0fedcba9", "0x2244228";
+       3, "0xFFFFFFFF", "0x12345678", "0x12345678";
+       4, "0", "0x12345678", "0";
+       5, "0x55555555", "0xAAAAAAAA", "0"];
+
+    testing_function "or";
+    List.iter
+      (fun (n, a, b, c) -> test n (logor (of_string a) (of_string b))
+                                  (of_string c))
+      [1, "0x12345678", "0x9abcdef0", "0x9abcdef8";
+       2, "0x12345678", "0x0fedcba9", "0x1ffddff9";
+       3, "0xFFFFFFFF", "0x12345678", "0xFFFFFFFF";
+       4, "0", "0x12345678", "0x12345678";
+       5, "0x55555555", "0xAAAAAAAA", "0xFFFFFFFF"];
+
+    testing_function "xor";
+    List.iter
+      (fun (n, a, b, c) -> test n (logxor (of_string a) (of_string b))
+                                  (of_string c))
+      [1, "0x12345678", "0x9abcdef0", "0x88888888";
+       2, "0x12345678", "0x0fedcba9", "0x1dd99dd1";
+       3, "0xFFFFFFFF", "0x12345678", "0xedcba987";
+       4, "0", "0x12345678", "0x12345678";
+       5, "0x55555555", "0xAAAAAAAA", "0xFFFFFFFF"];
+
+    testing_function "shift_left";
+    List.iter
+      (fun (n, a, b, c) -> test n (shift_left (of_string a) b) (of_string c))
+      [1, "1", 1, "2";
+       2, "1", 2, "4";
+       3, "1", 4, "0x10";
+       4, "1", 30, "0x40000000";
+       5, "1", 31, "0x80000000";
+       6, "0x16236", 7, "0xb11b00";
+       7, "0x10", 27, "0x80000000";
+       8, "0x10", 28, "0"];
+
+    testing_function "shift_right";
+    List.iter
+      (fun (n, a, b, c) -> test n (shift_right (of_string a) b) (of_string c))
+      [1, "2", 1, "1";
+       2, "4", 2, "1";
+       3, "0x10", 4, "1";
+       4, "0x40000000", 10, "0x100000";
+       5, "0x80000000", 31, "-1";
+       6, "0xb11b00", 7, "0x16236";
+       7, "-0xb11b00", 7, "-90678"];
+
+    testing_function "shift_right_logical";
+    List.iter
+      (fun (n, a, b, c) -> test n (shift_right_logical (of_string a) b)
+                                  (of_string c))
+      [1, "2", 1, "1";
+       2, "4", 2, "1";
+       3, "0x10", 4, "1";
+       4, "0x40000000", 10, "0x100000";
+       5, "0x80000000", 31, "1";
+       6, "0xb11b00", 7, "0x16236";
+       7, "-0xb11b00", 7, "0x1fe9dca"];
+
+    testing_function "of_float";
+    test 1 (of_float 0.0) (of_int 0);
+    test 2 (of_float 123.0) (of_int 123);
+    test 3 (of_float 123.456) (of_int 123);
+    test 4 (of_float 123.999) (of_int 123);
+    test 5 (of_float (-456.0)) (of_int (-456));
+    test 6 (of_float (-456.123)) (of_int (-456));
+    test 7 (of_float (-456.789)) (of_int (-456));
+
+    testing_function "to_float";
+    test 1 (to_float (of_int 0)) 0.0;
+    test 2 (to_float (of_int 123)) 123.0;
+    test 3 (to_float (of_int (-456))) (-456.0);
+    test 4 (to_float (of_int 0x3FFFFFFF)) 1073741823.0;
+    test 5 (to_float (of_int (-0x40000000))) (-1073741824.0);
+
+    testing_function "Comparisons";
+    test 1 (testcomp (of_int 0) (of_int 0))
+           (true,false,false,false,true,true,0);
+    test 2 (testcomp (of_int 1234567) (of_int 1234567))
+           (true,false,false,false,true,true,0);
+    test 3 (testcomp (of_int 0) (of_int 1))
+           (false,true,true,false,true,false,-1);
+    test 4 (testcomp (of_int (-1)) (of_int 0))
+           (false,true,true,false,true,false,-1);
+    test 5 (testcomp (of_int 1) (of_int 0))
+           (false,true,false,true,false,true,1);
+    test 6 (testcomp (of_int 0) (of_int (-1)))
+           (false,true,false,true,false,true,1);
+    test 7 (testcomp max_int min_int)
+           (false,true,false,true,false,true,1);
+
+    ()
+end
+
+(********* Tests on 64-bit arithmetic ***********)
+
+module Test64(M: TESTSIG) =
+struct
+  open M
+  open Ops
+
+  let _ =
+    testing_function "of_int, to_int";
+    test 1 (to_int (of_int 0)) 0;
+    test 2 (to_int (of_int 123)) 123;
+    test 3 (to_int (of_int (-456))) (-456);
+    test 4 (to_int (of_int 0x3FFFFFFF)) 0x3FFFFFFF;
+    test 5 (to_int (of_int (-0x40000000))) (-0x40000000);
+
+    testing_function "of_string";
+    test 1 (of_string "0") (of_int 0);
+    test 2 (of_string "123") (of_int 123);
+    test 3 (of_string "-456") (of_int (-456));
+    test 4 (of_string "123456789") (of_int 123456789);
+    test 5 (of_string "0xABCDEF") (of_int 0xABCDEF);
+    test 6 (of_string "-0o1234567012") (of_int (- 0o1234567012));
+    test 7 (of_string "0b01010111111000001100")
+           (of_int 0b01010111111000001100);
+    test 8 (of_string "0x7FFFFFFFFFFFFFFF") max_int;
+    test 9 (of_string "-0x8000000000000000") min_int;
+    test 10 (of_string "0x8000000000000000") min_int;
+    test 11 (of_string "0xFFFFFFFFFFFFFFFF") minus_one;
+
+    testing_function "to_string, format";
+    List.iter (fun (n, s) -> test n (to_string (of_string s)) s)
+      [1, "0"; 2, "123"; 3, "-456"; 4, "1234567890";
+       5, "1234567890123456789";
+       6, "9223372036854775807";
+       7, "-9223372036854775808"];
+    List.iter (fun (n, s) -> test n ("0x" ^ format "%X" (of_string s)) s)
+      [7, "0x0"; 8, "0x123"; 9, "0xABCDEF"; 10, "0x1234567812345678";
+       11, "0x7FFFFFFFFFFFFFFF"; 12, "0x8000000000000000";
+       13, "0xFFFFFFFFFFFFFFFF"];
+    test 14 (to_string max_int) "9223372036854775807";
+    test 15 (to_string min_int) "-9223372036854775808";
+    test 16 (to_string zero) "0";
+    test 17 (to_string one) "1";
+    test 18 (to_string minus_one) "-1";
+
+    testing_function "neg";
+    test 1 (neg (of_int 0)) (of_int 0);
+    test 2 (neg (of_int 123)) (of_int (-123));
+    test 3 (neg (of_int (-456))) (of_int 456);
+    test 4 (neg (of_int 123456789)) (of_int (-123456789));
+    test 5 (neg max_int) (of_string "-0x7FFFFFFFFFFFFFFF");
+    test 6 (neg min_int) min_int;
+
+    testing_function "add";
+    test 1 (add (of_int 0) (of_int 0)) (of_int 0);
+    test 2 (add (of_int 123) (of_int 0)) (of_int 123);
+    test 3 (add (of_int 0) (of_int 456)) (of_int 456);
+    test 4 (add (of_int 123) (of_int 456)) (of_int 579);
+    test 5 (add (of_int (-123)) (of_int 456)) (of_int 333);
+    test 6 (add (of_int 123) (of_int (-456))) (of_int (-333));
+    test 7 (add (of_int (-123)) (of_int (-456))) (of_int (-579));
+    test 8 (add (of_string "0x1234567812345678") 
+                (of_string "0x9ABCDEF09ABCDEF"))
+           (of_string "0x1be024671be02467");
+    test 9 (add max_int max_int) (of_int (-2));
+    test 10 (add min_int min_int) zero;
+    test 11 (add max_int one) min_int;
+    test 12 (add min_int minus_one) max_int;
+    test 13 (add max_int min_int) minus_one;
+
+    testing_function "sub";
+    test 1 (sub (of_int 0) (of_int 0)) (of_int 0);
+    test 2 (sub (of_int 123) (of_int 0)) (of_int 123);
+    test 3 (sub (of_int 0) (of_int 456)) (of_int (-456));
+    test 4 (sub (of_int 123) (of_int 456)) (of_int (-333));
+    test 5 (sub (of_int (-123)) (of_int 456)) (of_int (-579));
+    test 6 (sub (of_int 123) (of_int (-456))) (of_int 579);
+    test 7 (sub (of_int (-123)) (of_int (-456))) (of_int 333);
+    test 8 (sub (of_string "0x1234567812345678") 
+                (of_string "0x9ABCDEF09ABCDEF"))
+           (of_string "0x888888908888889");
+    test 9 (sub max_int min_int) minus_one;
+    test 10 (sub min_int max_int) one;
+    test 11 (sub min_int one) max_int;
+    test 12 (sub max_int minus_one) min_int;
+
+    testing_function "mul";
+    test 1 (mul (of_int 0) (of_int 0)) (of_int 0);
+    test 2 (mul (of_int 123) (of_int 0)) (of_int 0);
+    test 3 (mul (of_int 0) (of_int (-456))) (of_int 0);
+    test 4 (mul (of_int 123) (of_int 1)) (of_int 123);
+    test 5 (mul (of_int 1) (of_int (-456))) (of_int (-456));
+    test 6 (mul (of_int 123) (of_int (-1))) (of_int (-123));
+    test 7 (mul (of_int (-1)) (of_int (-456))) (of_int 456);
+    test 8 (mul (of_int 123) (of_int 456)) (of_int 56088);
+    test 9 (mul (of_int (-123)) (of_int 456)) (of_int (-56088));
+    test 10 (mul (of_int 123) (of_int (-456))) (of_int (-56088));
+    test 11 (mul (of_int (-123)) (of_int (-456))) (of_int 56088);
+    test 12 (mul (of_string "0x12345678") (of_string "0x9ABCDEF"))
+           (of_string "0xb00ea4e242d208");
+    test 13 (mul max_int max_int) one;
+
+    testing_function "div";
+    List.iter
+      (fun (n, a, b) -> test n (div (of_int a) (of_int b)) (of_int (a / b)))
+      [1, 0, 2;
+       2, 123, 1;
+       3, -123, 1;
+       4, 123, -1;
+       5, -123, -1;
+       6, 127531236, 365;
+       7, 16384, 256;
+       8, -127531236, 365;
+       9, 127531236, -365;
+       10, 1234567, 12345678;
+       11, 1234567, -12345678];
+
+    testing_function "mod";
+    List.iter
+      (fun (n, a, b) -> test n (rem (of_int a) (of_int b)) (of_int (a mod b)))
+      [1, 0, 2;
+       2, 123, 1;
+       3, -123, 1;
+       4, 123, -1;
+       5, -123, -1;
+       6, 127531236, 365;
+       7, 16384, 256;
+       8, -127531236, 365;
+       9, 127531236, -365;
+       10, 1234567, 12345678;
+       11, 1234567, -12345678];
+
+    testing_function "and";
+    List.iter
+      (fun (n, a, b, c) -> test n (logand (of_string a) (of_string b))
+                                  (of_string c))
+      [1, "0x1234567812345678", "0x9abcdef09abcdef0", "0x1234567012345670";
+       2, "0x1234567812345678", "0x0fedcba90fedcba9", "0x224422802244228";
+       3, "0xFFFFFFFFFFFFFFFF", "0x1234000012345678", "0x1234000012345678";
+       4, "0", "0x1234567812345678", "0";
+       5, "0x5555555555555555", "0xAAAAAAAAAAAAAAAA", "0"];
+
+    testing_function "or";
+    List.iter
+      (fun (n, a, b, c) -> test n (logor (of_string a) (of_string b))
+                                  (of_string c))
+      [1, "0x1234567812345678", "0x9abcdef09abcdef0", "0x9abcdef89abcdef8";
+       2, "0x1234567812345678", "0x0fedcba90fedcba9", "0x1ffddff91ffddff9";
+       3, "0xFFFFFFFFFFFFFFFF", "0x12345678", "0xFFFFFFFFFFFFFFFF";
+       4, "0", "0x1234567812340000", "0x1234567812340000";
+       5, "0x5555555555555555", "0xAAAAAAAAAAAAAAAA", "0xFFFFFFFFFFFFFFFF"];
+
+    testing_function "xor";
+    List.iter
+      (fun (n, a, b, c) -> test n (logxor (of_string a) (of_string b))
+                                  (of_string c))
+      [1, "0x1234567812345678", "0x9abcdef09abcdef0", "0x8888888888888888";
+       2, "0x1234567812345678", "0x0fedcba90fedcba9", "0x1dd99dd11dd99dd1";
+       3, "0xFFFFFFFFFFFFFFFF", "0x123456789ABCDEF", "0xfedcba9876543210";
+       4, "0", "0x1234567812340000", "0x1234567812340000";
+       5, "0x5555555555555555", "0xAAAAAAAAAAAAAAAA", "0xFFFFFFFFFFFFFFFF"];
+
+    testing_function "shift_left";
+    List.iter
+      (fun (n, a, b, c) -> test n (shift_left (of_string a) b) (of_string c))
+      [1, "1", 1, "2";
+       2, "1", 2, "4";
+       3, "1", 4, "0x10";
+       4, "1", 62, "0x4000000000000000";
+       5, "1", 63, "0x8000000000000000";
+       6, "0x16236ABD45673", 7, "0xb11b55ea2b3980";
+       7, "0x10", 59, "0x8000000000000000";
+       8, "0x10", 60, "0"];
+
+    testing_function "shift_right";
+    List.iter
+      (fun (n, a, b, c) -> test n (shift_right (of_string a) b) (of_string c))
+      [1, "2", 1, "1";
+       2, "4", 2, "1";
+       3, "0x10", 4, "1";
+       4, "0x40000000", 10, "0x100000";
+       5, "0x8000000000000000", 63, "-1";
+       6, "0xb11b55ea2b3980", 7, "0x16236ABD45673";
+       7, "-0xb11b55ea2b3980", 7, "-389461927286387"];
+
+    testing_function "shift_right_logical";
+    List.iter
+      (fun (n, a, b, c) -> test n (shift_right_logical (of_string a) b)
+                                  (of_string c))
+      [1, "2", 1, "1";
+       2, "4", 2, "1";
+       3, "0x10", 4, "1";
+       4, "0x40000000", 10, "0x100000";
+       5, "0x8000000000000000", 63, "1";
+       6, "0xb11b55ea2b3980", 7, "0x16236ABD45673";
+       7, "-0xb11b55ea2b3980", 7, "0x1fe9dc9542ba98d"];
+
+    testing_function "Comparisons";
+    test 1 (testcomp (of_int 0) (of_int 0))
+           (true,false,false,false,true,true,0);
+    test 2 (testcomp (of_int 1234567) (of_int 1234567))
+           (true,false,false,false,true,true,0);
+    test 3 (testcomp (of_int 0) (of_int 1))
+           (false,true,true,false,true,false,-1);
+    test 4 (testcomp (of_int (-1)) (of_int 0))
+           (false,true,true,false,true,false,-1);
+    test 5 (testcomp (of_int 1) (of_int 0))
+           (false,true,false,true,false,true,1);
+    test 6 (testcomp (of_int 0) (of_int (-1)))
+           (false,true,false,true,false,true,1);
+    test 7 (testcomp max_int min_int)
+           (false,true,false,true,false,true,1);
+
+    ()
+end
+
+(******** The test proper **********)
+
+let testcomp_int32 (a : int32) (b : int32) =
+  (a = b, a <> b, a < b, a > b, a <= b, a >= b, compare a b)
+let testcomp_int64 (a : int64) (b : int64) =
+  (a = b, a <> b, a < b, a > b, a <= b, a >= b, compare a b)
+let testcomp_nativeint (a : nativeint) (b : nativeint) =
+  (a = b, a <> b, a < b, a > b, a <= b, a >= b, compare a b)
+
+let _ =
+  testing_function "-------- Int32 --------";
+  let module A = Test32(struct type t = int32
+                               module Ops = Int32
+                               let testcomp = testcomp_int32 end) in
+  print_newline(); testing_function "-------- Int64 --------";
+  let module B = Test64(struct type t = int64
+                               module Ops = Int64
+                               let testcomp = testcomp_int64 end) in
+  print_newline(); testing_function "-------- Nativeint --------";
+  begin match Sys.word_size with
+    32 ->
+      let module C =
+        Test32(struct type t = nativeint 
+                      module Ops = Nativeint
+                      let testcomp = testcomp_nativeint end)
+      in ()
+  | 64 ->
+      let module C =
+        Test64(struct type t = nativeint
+                      module Ops = Nativeint
+                      let testcomp = testcomp_nativeint end)
+      in ()
+  | _ ->
+      assert false
+  end;
+  print_newline(); testing_function "--------- Conversions -----------";
+  testing_function "nativeint of/to int32";
+  test 1 (Nativeint.of_int32 (Int32.of_string "0x12345678"))
+         (Nativeint.of_string "0x12345678");
+  test 2 (Nativeint.to_int32 (Nativeint.of_string "0x12345678"))
+         (Int32.of_string "0x12345678");
+  if Sys.word_size = 64 then
+  test 3 (Nativeint.to_int32 (Nativeint.of_string "0x123456789ABCDEF0"))
+         (Int32.of_string "0x9ABCDEF0");
+  testing_function "int64 of/to int32";
+  test 1 (Int64.of_int32 (Int32.of_string "-0x12345678"))
+         (Int64.of_string "-0x12345678");
+  test 2 (Int64.to_int32 (Int64.of_string "-0x12345678"))
+         (Int32.of_string "-0x12345678");
+  test 3 (Int64.to_int32 (Int64.of_string "0x123456789ABCDEF0"))
+         (Int32.of_string "0x9ABCDEF0");
+  testing_function "int64 of/to nativeint";
+  test 1 (Int64.of_nativeint (Nativeint.of_string "0x12345678"))
+         (Int64.of_string "0x12345678");
+  test 2 (Int64.to_nativeint (Int64.of_string "-0x12345678"))
+         (Nativeint.of_string "-0x12345678");
+  test 3 (Int64.to_nativeint (Int64.of_string "0x123456789ABCDEF0"))
+         (if Sys.word_size = 64
+          then Nativeint.of_string "0x123456789ABCDEF0"
+          else Nativeint.of_string "0x9ABCDEF0")
+
+(********* End of test *********)
+
+let _ =
+  print_newline();
+  if !error_occurred then begin
+    prerr_endline "************* TEST FAILED ****************"; exit 2
+  end else
+    exit 0
diff --git a/test/Moretest/callback.ml b/test/Moretest/callback.ml
new file mode 100644 (file)
index 0000000..025c7a4
--- /dev/null
@@ -0,0 +1,69 @@
+external mycallback1 : ('a -> 'b) -> 'a -> 'b = "mycallback1"
+external mycallback2 : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c = "mycallback2"
+external mycallback3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd = "mycallback3"
+external mycallback4 : ('a -> 'b -> 'c -> 'd -> 'e) -> 'a -> 'b -> 'c -> 'd -> 'e = "mycallback4"
+
+let rec tak (x, y, z as tuple) =
+  if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y))
+           else z
+
+let tak2 x (y, z) = tak (x, y, z)
+
+let tak3 x y z = tak (x, y, z)
+
+let tak4 x y z u = tak (x, y, z + u)
+
+let raise_exit () = (raise Exit : unit)
+
+let trapexit () =
+  begin try
+    mycallback1 raise_exit ()
+  with Exit ->
+    ()
+  end;
+  tak (18, 12, 6)
+
+external mypushroot : 'a -> ('b -> 'c) -> 'b -> 'a = "mypushroot"
+external mycamlparam : 'a -> ('b -> 'c) -> 'b -> 'a = "mycamlparam"
+
+let tripwire f =
+  let s = String.make 5 'a' in
+  f s trapexit ()
+
+(* Test callbacks performed to handle signals *)
+
+let sighandler signo =
+(*
+  print_string "Got signal, triggering garbage collection...";
+  print_newline();
+*)
+  (* Thoroughly wipe the minor heap *)
+  tak (18, 12, 6);
+  ()
+
+external unix_getpid : unit -> int = "unix_getpid" "noalloc"
+external unix_kill : int -> int -> unit = "unix_kill" "noalloc"
+
+let callbacksig () =
+  let pid = unix_getpid() in
+  (* Allocate a block in the minor heap *)
+  let s = String.make 5 'b' in
+  (* Send a signal to self.  We want s to remain in a register and
+     not be spilled on the stack, hence we declare unix_kill
+     "noalloc". *)
+  unix_kill pid Sys.sigusr1;
+  (* Allocate some more so that the signal will be tested *)
+  let u = (s, s) in
+  fst u
+
+let _ =
+  print_int(mycallback1 tak (18, 12, 6)); print_newline();
+  print_int(mycallback2 tak2 18 (12, 6)); print_newline();
+  print_int(mycallback3 tak3 18 12 6); print_newline();
+  print_int(mycallback4 tak4 18 12 3 3); print_newline();
+  print_int(trapexit ()); print_newline();
+  print_string(tripwire mypushroot); print_newline();
+  print_string(tripwire mycamlparam); print_newline();
+  Sys.signal Sys.sigusr1 (Sys.Signal_handle sighandler);
+  print_string(callbacksig ()); print_newline()
+
diff --git a/test/Moretest/callbackprim.c b/test/Moretest/callbackprim.c
new file mode 100644 (file)
index 0000000..f1a4ccf
--- /dev/null
@@ -0,0 +1,54 @@
+#include "mlvalues.h"
+#include "memory.h"
+#include "callback.h"
+
+value mycallback1(value fun, value arg)
+{
+  value res;
+  res = callback(fun, arg);
+  return res;
+}
+
+value mycallback2(value fun, value arg1, value arg2)
+{
+  value res;
+  res = callback2(fun, arg1, arg2);
+  return res;
+}
+
+value mycallback3(value fun, value arg1, value arg2, value arg3)
+{
+  value res;
+  res = callback3(fun, arg1, arg2, arg3);
+  return res;
+}
+
+value mycallback4(value fun, value arg1, value arg2, value arg3, value arg4)
+{
+  value args[4];
+  value res;
+  args[0] = arg1;
+  args[1] = arg2;
+  args[2] = arg3;
+  args[3] = arg4;
+  res = callbackN(fun, 4, args);
+  return res;
+}
+
+value mypushroot(value v, value fun, value arg)
+{
+  Begin_root(v)
+    callback(fun, arg);
+  End_roots();
+  return v;
+}
+
+value mycamlparam (value v, value fun, value arg)
+{
+  CAMLparam3 (v, fun, arg);
+  CAMLlocal2 (x, y);
+  x = v;
+  y = callback (fun, arg);
+  v = x;
+  CAMLreturn (v);
+}
diff --git a/test/Moretest/cmcaml.ml b/test/Moretest/cmcaml.ml
new file mode 100644 (file)
index 0000000..a7e1cf5
--- /dev/null
@@ -0,0 +1,17 @@
+(* Caml part of the code *)
+
+let rec fib n =
+  if n < 2 then 1 else fib(n-1) + fib(n-2)
+
+let format_result n =
+  let r = "Result = " ^ string_of_int n in
+  (* Allocate gratuitously to test GC *)
+  for i = 1 to 1500 do String.create 256 done;
+  r
+
+(* Registration *)
+
+let _ =
+  Callback.register "fib" fib;
+  Callback.register "format_result" format_result
+
diff --git a/test/Moretest/cmmain.c b/test/Moretest/cmmain.c
new file mode 100644 (file)
index 0000000..4894361
--- /dev/null
@@ -0,0 +1,21 @@
+/* Main program -- in C */
+
+#include <stdlib.h>
+#include <caml/callback.h>
+
+extern int fib(int n);
+extern char * format_result(int n);
+
+int main(int argc, char ** argv)
+{
+  printf("Initializing Caml code...\n");
+#ifdef NO_BYTECODE_FILE
+  caml_startup(argv);
+#else
+  caml_main(argv);
+#endif
+  printf("Back in C code...\n");
+  printf("Computing fib(20)...\n");
+  printf("%s\n", format_result(fib(20)));
+  return 0;
+}
diff --git a/test/Moretest/cmstub.c b/test/Moretest/cmstub.c
new file mode 100644 (file)
index 0000000..56cd694
--- /dev/null
@@ -0,0 +1,17 @@
+#include <string.h>
+#include <caml/mlvalues.h>
+#include <caml/callback.h>
+
+/* Functions callable directly from C */
+
+int fib(int n)
+{
+  value * fib_closure = caml_named_value("fib");
+  return Int_val(callback(*fib_closure, Val_int(n)));
+}
+
+char * format_result(int n)
+{
+  value * format_result_closure = caml_named_value("format_result");
+  return strdup(String_val(callback(*format_result_closure, Val_int(n))));
+}
diff --git a/test/Moretest/equality.ml b/test/Moretest/equality.ml
new file mode 100644 (file)
index 0000000..05e6512
--- /dev/null
@@ -0,0 +1,71 @@
+let test n exp res =
+  prerr_string "Test "; prerr_int n;
+  if exp = res then prerr_string " passed.\n" else prerr_string " FAILED.\n";
+  flush stderr
+
+let x = [1;2;3]
+
+let f x = 1 :: 2 :: 3 :: x
+
+let mklist len =
+  let l = ref [] in
+  for i = 1 to len do l := i :: !l done;
+  !l
+
+type tree = Dummy | Leaf | Node of tree * tree
+
+let rec mktree depth =
+  if depth <= 0 then Leaf else Node(mktree(depth - 1), mktree(depth - 1))
+
+type 'a leftlist = Nil | Cons of 'a leftlist * 'a
+
+let mkleftlist len =
+  let l = ref Nil in
+  for i = 1 to len do l := Cons(!l, i) done;
+  !l
+
+let _ =
+  test 1 0 (compare 0 0);
+  test 2 (-1) (compare 0 1);
+  test 3 1 (compare 1 0);
+  test 4 0 (compare max_int max_int);
+  test 5 (-1) (compare min_int max_int);
+  test 6 1 (compare max_int min_int);
+  test 7 0 (compare "foo" "foo");
+  test 8 (-1) (compare "foo" "zorglub");
+  test 9 (-1) (compare "abcdef" "foo");
+  test 10 (-1) (compare "abcdefghij" "abcdefghijkl");
+  test 11 1 (compare "abcdefghij" "abcdefghi");
+  test 12 0 (compare (0,1) (0,1));
+  test 13 (-1) (compare (0,1) (0,2));
+  test 14 (-1) (compare (0,1) (1,0));
+  test 15 1 (compare (0,1) (0,0));
+  test 16 1 (compare (1,0) (0,1));
+  test 17 0 (compare 0.0 0.0);
+  test 18 (-1) (compare 0.0 1.0);
+  test 19 (-1) (compare (-1.0) 0.0);
+  test 20 0 (compare [| 0.0; 1.0; 2.0 |] [| 0.0; 1.0; 2.0 |]);
+  test 21 (-1) (compare [| 0.0; 1.0; 2.0 |] [| 0.0; 1.0; 3.0 |]);
+  test 22 1 (compare [| 0.0; 5.0; 2.0 |] [| 0.0; 1.0; 2.0 |]);
+  test 23 0 (compare [1;2;3;4] [1;2;3;4]);
+  test 24 (-1) (compare [1;2;3;4] [1;2;5;6]);
+  test 25 (-1) (compare [1;2;3;4] [1;2;3;4;5]);
+  test 26 1 (compare [1;2;3;4] [1;2;3]);
+  test 27 1 (compare [1;2;3;4] [1;2;0;4]);
+  test 28 0 (compare (mklist 1000) (mklist 1000));
+  test 29 0 (compare (mkleftlist 1000) (mkleftlist 1000));
+  test 30 0 (compare (mktree 12) (mktree 12));
+  test 31 true (x = f []);
+  test 32 true (stdout <> stderr);
+  test 33 (-1) (compare nan 0.0);
+  test 34 (-1) (compare nan neg_infinity);
+  test 35 0 (compare nan nan);
+  test 36 (-1) (compare (0.0, nan) (0.0, 0.0));
+  test 37 (-1) (compare (0.0, nan) (0.0, neg_infinity));
+  test 38 0 (compare (nan, 0.0) (nan, 0.0));
+  let cmpgen x y = (x=y, x<>y, x<y, x<=y, x>y, x>=y) in
+  let cmpfloat (x:float) (y:float) = (x=y, x<>y, x<y, x<=y, x>y, x>=y) in
+  test 39 (false,true,false,false,false,false) (cmpgen nan nan);
+  test 40 (false,true,false,false,false,false) (cmpgen nan 0.0);
+  test 41 (false,true,false,false,false,false) (cmpfloat nan nan);
+  test 42 (false,true,false,false,false,false) (cmpfloat nan 0.0)
diff --git a/test/Moretest/fftba.ml b/test/Moretest/fftba.ml
new file mode 100644 (file)
index 0000000..799380c
--- /dev/null
@@ -0,0 +1,191 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: fftba.ml,v 1.1 2000/03/10 14:54:41 xleroy Exp $ *)
+
+open Bigarray
+
+let pi = 3.14159265358979323846
+
+let tpi = 2.0 *. pi
+
+let fft (px : (float, float64_elt, c_layout) Array1.t)
+        (py : (float, float64_elt, c_layout) Array1.t) np =
+  let i = ref 2 in
+  let m = ref 1 in
+  
+  while (!i < np) do
+    i := !i + !i; 
+    m := !m + 1
+  done;
+
+  let n = !i in  
+  
+  if n <> np then begin
+    for i = np+1 to n do
+      px.{i} <- 0.0; 
+      py.{i} <- 0.0
+    done;
+    print_string "Use "; print_int n;
+    print_string " point fft"; print_newline()
+  end;
+
+  let n2 = ref(n+n) in
+  for k = 1 to !m-1 do
+    n2 := !n2 / 2; 
+    let n4 = !n2 / 4 in
+    let e  = tpi /. float !n2 in
+
+    for j = 1 to n4 do
+      let a = e *. float(j - 1) in
+      let a3 = 3.0 *. a in
+      let cc1 = cos(a) in
+      let ss1 = sin(a) in
+      let cc3 = cos(a3) in
+      let ss3 = sin(a3) in
+      let is = ref j in
+      let id = ref(2 * !n2) in
+  
+        while !is < n do
+          let i0r = ref !is in
+          while !i0r < n do
+             let i0 = !i0r in
+             let i1 = i0 + n4 in
+             let i2 = i1 + n4 in
+             let i3 = i2 + n4 in
+             let r1 = px.{i0} -. px.{i2} in
+             px.{i0} <- px.{i0} +. px.{i2};
+             let r2 = px.{i1} -. px.{i3} in
+             px.{i1} <- px.{i1} +. px.{i3};
+             let s1 = py.{i0} -. py.{i2} in
+             py.{i0} <- py.{i0} +. py.{i2};
+             let s2 = py.{i1} -. py.{i3} in
+             py.{i1} <- py.{i1} +. py.{i3};
+             let s3 = r1 -. s2 in
+             let r1 = r1 +. s2 in
+             let s2 = r2 -. s1 in
+             let r2 = r2 +. s1 in
+             px.{i2} <- r1*.cc1 -. s2*.ss1; 
+             py.{i2} <- -.s2*.cc1 -. r1*.ss1;
+             px.{i3} <- s3*.cc3 +. r2*.ss3;
+             py.{i3} <- r2*.cc3 -. s3*.ss3;
+             i0r := i0 + !id
+          done;
+          is := 2 * !id - !n2 + j; 
+          id := 4 * !id
+        done
+    done
+  done;
+
+(************************************)
+(*  Last stage, length=2 butterfly  *)
+(************************************)
+
+  let is = ref 1 in
+  let id = ref 4 in
+  
+  while !is < n do
+    let i0r = ref !is in
+    while !i0r <= n do
+      let i0 = !i0r in
+      let i1 = i0 + 1 in
+      let r1 = px.{i0} in
+      px.{i0} <- r1 +. px.{i1};
+      px.{i1} <- r1 -. px.{i1};
+      let r1 = py.{i0} in
+      py.{i0} <- r1 +. py.{i1};
+      py.{i1} <- r1 -. py.{i1};
+      i0r := i0 + !id
+    done;
+    is := 2 * !id - 1; 
+    id := 4 * !id
+  done;
+
+(*************************)
+(*  Bit reverse counter  *)
+(*************************)
+
+  let j = ref 1 in
+  
+  for i = 1 to n - 1 do
+    if i < !j then begin
+      let xt = px.{!j} in
+      px.{!j} <- px.{i}; 
+      px.{i} <- xt;
+      let xt = py.{!j} in
+      py.{!j} <- py.{i};
+      py.{i} <- xt
+    end;
+    let k = ref(n / 2) in
+    while !k < !j do
+      j := !j - !k; 
+      k := !k / 2
+    done;
+    j := !j + !k
+  done;
+
+  n
+
+
+let test np =
+  print_int np; print_string "... "; flush stdout;
+  let enp = float np in
+  let npm = np / 2 - 1 in
+  let pxr = Array1.create float64 c_layout (np+2)
+  and pxi = Array1.create float64 c_layout (np+2) in
+  let t = pi /. enp in
+  pxr.{1} <- (enp -. 1.0) *. 0.5;
+  pxi.{1} <- 0.0;
+  let n2 = np / 2 in
+  pxr.{n2+1} <- -0.5;
+  pxi.{n2+1} <-  0.0;
+
+  for i = 1 to npm do
+      let j = np - i in
+      pxr.{i+1} <- -0.5;
+      pxr.{j+1} <- -0.5;
+      let z = t *. float i in
+      let y = -0.5 *. (cos(z)/.sin(z)) in
+      pxi.{i+1} <- y;
+      pxi.{j+1} <- -.y
+  done;
+(**
+  print_newline();
+  for i=0 to 15 do Printf.printf "%d  %f  %f\n" i pxr.{i+1} pxi.{i+1} done;
+**)
+  let _ = fft pxr pxi np in
+(**
+  for i=0 to 15 do Printf.printf "%d  %f  %f\n" i pxr.{i+1} pxi.{i+1} done;
+**)
+  let zr = ref 0.0 in
+  let zi = ref 0.0 in
+  let kr = ref 0 in
+  let ki = ref 0 in
+  for i = 0 to np-1 do
+      let a = abs_float(pxr.{i+1} -. float i) in
+      if !zr < a then begin
+         zr := a; 
+         kr := i
+      end;
+      let a = abs_float(pxi.{i+1}) in
+      if !zi < a then begin
+         zi := a; 
+         ki := i
+      end
+  done;
+  let zm = if abs_float !zr < abs_float !zi then !zi else !zr in
+  print_float zm; print_newline()
+
+
+let _ =
+  let np = ref 16 in for i = 1 to 13 do test !np; np := !np*2 done
+
diff --git a/test/Moretest/float.ml b/test/Moretest/float.ml
new file mode 100644 (file)
index 0000000..9ebabbc
--- /dev/null
@@ -0,0 +1 @@
+Printf.printf "1./.0. = %f\n" (1.0 /. 0.0);;
diff --git a/test/Moretest/globroots.ml b/test/Moretest/globroots.ml
new file mode 100644 (file)
index 0000000..4d1ba4d
--- /dev/null
@@ -0,0 +1,25 @@
+type t
+
+external register: string -> t = "gb_register"
+external get: t -> string = "gb_get"
+external remove: t -> unit = "gb_remove"
+
+let size = 1024
+
+let _ =
+  let a = Array.init size (fun i -> register (string_of_int i)) in
+  while true do
+    (* Check data *)
+    for i = 0 to size - 1 do
+      if get a.(i) <> string_of_int i then begin
+        print_string "Error on "; print_int i; print_string ": ";
+        print_string (String.escaped (get a.(i))); print_newline()
+      end
+    done;
+    (* Change it randomly *)
+    let i = Random.int size in
+    remove a.(i);
+    a.(i) <- register (string_of_int i);
+    Gc.full_major();
+    print_string "."; flush stdout
+  done
diff --git a/test/Moretest/globrootsprim.c b/test/Moretest/globrootsprim.c
new file mode 100644 (file)
index 0000000..711f47a
--- /dev/null
@@ -0,0 +1,29 @@
+/* For testing global root registration */
+
+#include "mlvalues.h"
+#include "memory.h"
+#include "alloc.h"
+
+struct block { value v; };
+
+#define Block_val(v) ((struct block *) (v))
+
+value gb_register(value v)
+{
+  struct block * b = stat_alloc(sizeof(struct block));
+  b->v = v;
+  register_global_root(&(b->v));
+  return (value) b;
+}
+
+value gb_get(value vblock)
+{
+  return Block_val(vblock)->v;
+}
+
+value gb_remove(value vblock)
+{
+  remove_global_root(&(Block_val(vblock)->v));
+  return Val_unit;
+}
+
diff --git a/test/Moretest/graph_example.ml b/test/Moretest/graph_example.ml
new file mode 100644 (file)
index 0000000..6fbe988
--- /dev/null
@@ -0,0 +1,131 @@
+(* To run this example:
+   ********************
+   1. Select all the text in this window.
+   2. Drag it to the toplevel window.
+   3. Watch the colors.
+   4. Drag the mouse over the graphics window and click here and there.
+   5. Type any key to the graphics window to stop the program.
+*)
+
+open Graphics;;
+open_graph " 480x270";;
+
+let xr = size_x () / 2 - 30
+and yr = size_y () / 2 - 26
+and xg = size_x () / 2 + 30
+and yg = size_y () / 2 - 26
+and xb = size_x () / 2
+and yb = size_y () / 2 + 26
+;;
+
+let point x y =
+  let dr = (x-xr)*(x-xr) + (y-yr)*(y-yr)
+  and dg = (x-xg)*(x-xg) + (y-yg)*(y-yg)
+  and db = (x-xb)*(x-xb) + (y-yb)*(y-yb)
+  in
+  if dr > dg && dr > db then set_color (rgb 255 (255*dg/dr) (255*db/dr))
+  else if dg > db then set_color (rgb (255*dr/dg) 255 (255*db/dg))
+  else set_color (rgb (255*dr/db) (255*dg/db) 255);
+  fill_rect x y 2 2;
+;;
+
+for y = (size_y () - 1) / 2 downto 0 do
+  for x = 0 to (size_x () - 1) / 2 do
+    point (2*x) (2*y);
+  done
+done
+;;
+
+let n = 0x000000
+and w = 0xFFFFFF
+and b = 0xFFCC99
+and y = 0xFFFF00
+and o = 0xCC9966
+and v = 0x00BB00
+and g = 0x888888
+and c = 0xDDDDDD
+and t = transp
+;;
+
+let caml = make_image [|
+  [|t;t;t;t;t;t;t;t;t;t;t;n;n;n;n;n;n;t;t;t;t;t;t;t;t;t;t;t;t;t;t;t;|];
+  [|t;t;t;t;t;t;t;t;t;t;n;n;n;n;n;n;n;n;n;t;t;t;t;t;t;t;t;t;t;t;t;t;|];
+  [|t;t;t;t;t;t;t;t;n;n;n;n;n;n;n;n;n;n;n;n;t;t;t;t;t;t;t;t;t;t;t;t;|];
+  [|n;n;n;n;n;n;t;n;n;n;n;n;b;b;b;b;b;b;b;n;n;t;t;t;t;t;n;n;n;n;n;t;|];
+  [|n;o;o;o;o;o;n;n;n;n;b;b;b;b;b;b;b;b;b;b;b;n;n;n;n;n;n;n;n;n;n;t;|];
+  [|n;o;o;o;o;o;o;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;t;|];
+  [|n;o;o;o;o;o;o;o;n;n;n;g;g;g;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;t;t;|];
+  [|n;n;o;o;o;o;o;o;o;n;n;n;c;c;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;t;t;|];
+  [|t;n;n;o;o;o;o;o;o;o;n;n;n;c;n;n;n;n;n;n;n;b;b;n;n;n;n;n;n;t;t;t;|];
+  [|t;t;n;n;n;o;o;o;o;o;o;n;n;n;n;n;n;n;n;n;b;b;b;b;n;n;n;n;t;t;t;t;|];
+  [|t;t;t;t;n;n;o;o;o;o;o;o;n;n;n;n;n;n;n;n;b;b;b;b;b;b;n;n;t;t;t;t;|];
+  [|t;t;t;t;t;n;n;o;o;o;o;o;o;n;n;n;n;n;n;o;o;b;b;b;b;b;b;n;n;t;t;t;|];
+  [|t;t;t;t;t;n;n;o;o;o;o;o;o;b;b;b;b;b;n;n;o;o;b;b;b;b;b;b;n;n;t;t;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;o;b;b;b;b;b;b;b;n;n;o;o;b;b;b;b;b;b;n;n;t;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;b;b;b;b;b;b;b;b;b;n;n;o;o;b;b;b;b;b;b;n;n;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;b;b;b;b;b;n;n;b;b;b;n;n;o;o;b;b;b;b;b;n;n;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;b;b;b;b;b;n;n;b;b;b;b;n;n;o;o;b;o;b;b;n;n;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;b;b;b;b;b;n;n;b;b;b;b;b;n;n;o;o;o;o;o;n;n;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;b;b;b;b;b;n;n;b;b;b;b;b;b;n;n;o;o;o;o;n;n;|];
+  [|t;t;t;t;n;n;n;o;o;o;o;o;b;b;b;b;n;n;b;b;b;b;b;b;b;n;n;o;o;n;n;n;|];
+  [|t;t;t;t;n;n;n;n;o;o;o;o;o;b;b;b;n;n;n;b;b;b;b;b;b;b;n;n;o;n;b;n;|];
+  [|t;t;t;t;t;n;n;n;o;o;o;o;o;o;b;b;n;n;n;b;b;b;b;b;b;b;b;n;n;n;b;n;|];
+  [|t;t;t;t;t;t;n;n;o;o;o;o;o;o;o;y;v;y;n;b;b;b;b;b;b;b;b;n;n;b;b;n;|];
+  [|t;t;t;t;t;t;t;n;o;o;o;o;o;v;y;o;o;n;n;n;b;b;b;b;b;b;b;n;n;b;b;n;|];
+  [|t;t;t;t;t;t;t;n;o;o;o;y;v;o;o;o;o;n;n;n;n;b;b;b;b;b;b;n;n;b;b;n;|];
+  [|t;t;t;t;t;t;n;n;o;v;y;o;y;o;o;o;o;o;o;n;n;n;b;b;b;b;b;n;n;b;b;n;|];
+  [|t;t;t;t;t;t;n;o;y;y;o;o;v;o;o;o;o;o;o;o;n;n;n;b;b;b;n;n;n;b;n;t;|];
+  [|t;t;t;t;t;n;n;v;o;v;o;o;o;o;o;o;o;o;o;o;o;n;n;n;b;n;n;n;n;b;n;t;|];
+  [|t;t;t;t;t;n;v;o;o;v;o;o;o;o;o;o;o;o;o;o;o;o;n;n;n;n;n;n;n;n;t;t;|];
+  [|t;t;t;t;n;n;o;o;o;o;o;o;o;o;o;o;o;o;o;o;o;n;n;n;n;n;n;t;t;t;t;t;|];
+  [|t;t;t;t;n;o;o;o;o;o;o;o;o;o;o;o;o;o;o;o;n;n;t;t;t;t;t;t;t;t;t;t;|];
+  [|t;t;t;t;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;t;t;t;t;t;t;t;t;t;t;t;|];
+|];;
+
+(*
+let x = ref 0 and y = ref 0;;
+let bg = get_image !x !y 32 32;;
+while true do
+  let st = wait_next_event [Mouse_motion; Button_down] in
+  if not st.button then draw_image bg !x !y;
+  x := st.mouse_x;
+  y := st.mouse_y;
+  blit_image bg !x !y;
+  draw_image caml !x !y;
+done;;
+*)
+set_color (rgb 0 0 0);
+remember_mode false;
+try while true do
+  let st = wait_next_event [Mouse_motion; Button_down; Key_pressed] in
+  synchronize ();
+  if st.keypressed then raise Exit;
+  if st.button then begin
+    remember_mode true;
+    draw_image caml st.mouse_x st.mouse_y;
+    remember_mode false;
+  end;
+  let x = st.mouse_x + 16 and y = st.mouse_y + 16 in
+
+  moveto 0 y;
+  lineto (x - 25) y;
+  moveto 10000 y;
+  lineto (x + 25) y;
+
+  moveto x 0;
+  lineto x (y - 25);
+  moveto x 10000;
+  lineto x (y + 25);
+
+  draw_image caml st.mouse_x st.mouse_y;
+done with Exit -> ()
+;;
+
+(* To run this example:
+   ********************
+   1. Select all the text in this window.
+   2. Drag it to the toplevel window.
+   3. Watch the colors.
+   4. Drag the mouse over the graphics window and click here and there.
+   5. Type any key to the graphics window to stop the program.
+*)
diff --git a/test/Moretest/graph_test.ml b/test/Moretest/graph_test.ml
new file mode 100644 (file)
index 0000000..cd4c081
--- /dev/null
@@ -0,0 +1,288 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Pierre Weis, projet Cristal, INRIA Rocquencourt          *)
+(*                                                                     *)
+(*  Copyright 2000 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the GNU Library General Public License, with    *)
+(*  the special exception on linking described in file ../../LICENSE.  *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* graph_test.ml : tests various drawing and filling primitives of the
+   Graphics library. *)
+
+(* To run this example just load this file into a suitable toplevel.
+   Alternatively execute
+   ocamlc graphics.cma graph_test.ml *)
+
+open Graphics;;
+
+auto_synchronize false;;
+display_mode false;;
+remember_mode true;;
+
+let sz = 450;;
+
+open_graph (Printf.sprintf " %ix%i" sz sz);;
+
+(* To be defined for older versions of O'Caml
+   Lineto, moveto and draw_rect.
+
+let rlineto x y =
+ let xc, yc = current_point () in
+ lineto (x + xc) (y + yc);;
+
+let rmoveto x y =
+ let xc, yc = current_point () in
+ moveto (x + xc) (y + yc);;
+
+let draw_rect x y w h =
+ let x0, y0 = current_point () in
+ moveto x y;
+ rlineto w 0;
+ rlineto 0 h;
+ rlineto (- w) 0;
+ rlineto 0 (-h);
+ moveto x0 y0;;
+*)
+
+(* A set of points. *)
+
+set_color foreground;;
+
+let dashes y =
+ for i = 1 to 100 do
+  plot y (2 * i);
+  plot y (3 * i);
+  plot y (4 * i);
+ done;;
+
+dashes 3;;
+
+set_line_width 20;;
+dashes (sz - 20);;
+
+(* Drawing chars *)
+
+draw_char 'C';
+draw_char 'a';
+draw_char 'm';
+draw_char 'l';;
+
+(* More and more red enlarging squares *)
+moveto 10 10;;
+set_line_width 5;;
+
+let carre c =
+ rlineto 0 c;
+ rlineto c 0;
+ rlineto 0 (- c);
+ rlineto (- c) 0;;
+
+for i = 1 to 10 do
+ moveto (10 * i) (10 * i);
+ set_color (rgb (155 + 10 * i) 0 0);
+ carre (10 * i)
+done;;
+
+(* Blue squares in arithmetic progression *)
+moveto 10 210;;
+set_color blue;;
+set_line_width 1;;
+
+for i = 1 to 10 do
+ carre (10 * i)
+done;;
+
+(* Tiny circles filled or not *)
+rmoveto 0 120;;
+(* Must not change the current point *)
+fill_circle 20 190 10;;
+set_color green;;
+rlineto 0 10;;
+rmoveto 50 10;;
+let x, y = current_point () in
+(* Must not change the current point *)
+draw_circle x y 20;;
+set_color black;;
+rlineto 0 20;;
+
+(* Cyan rectangles as a kind of graphical representation *)
+set_color cyan;;
+
+let lw = 15;;
+set_line_width lw;;
+let go_caption l = moveto 210 (130 - lw + l);;
+let go_legend () = go_caption (- 3 * lw);;
+
+go_caption 0;;
+fill_rect 210 130 5 10;;
+fill_rect 220 130 10 20;;
+fill_rect 235 130 15 40;;
+fill_rect 255 130 20 80;;
+fill_rect 280 130 25 160;;
+(* A green rectangle below the graph. *)
+set_color green;;
+rlineto 50 0;;
+
+(* A black frame for each of our rectangles *)
+set_color black;;
+set_line_width (lw / 4);;
+
+draw_rect 210 130 5 10;;
+draw_rect 220 130 10 20;;
+draw_rect 235 130 15 40;;
+draw_rect 255 130 20 80;;
+draw_rect 280 130 25 160;;
+
+(* A black rectangle after the green one, below the graph. *)
+set_line_width lw;;
+rlineto 50 0;;
+
+(* Write a text in yellow on a blue background. *)
+(* x = 210, y = 70 *)
+go_legend ();;
+set_text_size 10;;
+set_color (rgb 150 100 250);;
+let x,y = current_point () in
+fill_rect x (y - 5) (8 * 20) 25;;
+set_color yellow;;
+go_legend ();;
+draw_string "Graphics (Caml)";;
+
+(* Pie parts in different colors. *)
+let draw_green_string s = set_color green; draw_string s;;
+let draw_red_string s = set_color red; draw_string s;;
+
+moveto 120 210;;
+set_color red;;
+fill_arc 150 260 25 25 60 300;
+draw_green_string "A ";
+draw_red_string "red";
+draw_green_string " pie.";
+
+set_text_size 5;
+moveto 180 240;
+draw_red_string "A "; draw_green_string "green"; draw_red_string " slice.";;
+set_color green;
+fill_arc 200 260 25 25 0 60;
+set_color black;
+set_line_width 2;
+draw_arc 200 260 27 27 0 60;;
+
+(* Should do nothing since this is a line *)
+set_color red;;
+fill_poly [| (40, 10); (150, 70); (150, 10); (40, 10) |];;
+set_color blue;;
+
+(* Drawing polygones. *)
+(* Redefining the draw_poly primitive for the usual library. *)
+let draw_poly v =
+ let l = Array.length v in
+  if l > 0 then begin
+  let x0, y0 = current_point () in
+  let p0 = v.(0) in
+  let x, y = p0 in moveto x y;
+  for i = 1 to l - 1 do
+   let x, y = v.(i) in lineto x y
+  done;
+  lineto x y;
+  moveto x0 y0
+ end;;
+
+draw_poly [| (150, 10); (150, 70); (260, 10); (150, 10) |];;
+
+(* Filling polygones. *)
+(* Two equilateral triangles, one red and one blue, and their inside
+   filled in black. *)
+let equi x y l =
+ [| (x - l / 2, y);
+    (x, y + int_of_float (float_of_int l *. (sqrt 3.0 /. 2.0)));
+    (x + l / 2, y) |];;
+
+set_color black;;
+fill_poly (Array.append (equi 300 20 40) (equi 300 44 (- 40)));;
+
+set_line_width 1;;
+set_color cyan;;
+draw_poly (equi 300 20 40);;
+set_color red;;
+draw_poly (equi 300 44 (- 40));;
+
+(* Drawing and filling ellipses. *)
+let x, y = current_point () in
+rlineto 10 10; moveto x y;
+
+moveto 395 100;;
+
+let x, y = current_point () in
+fill_ellipse x y 25 15;;
+
+set_color (rgb 0xFF 0x00 0xFF);;
+rmoveto 0 (- 50);;
+
+let x, y = current_point () in
+fill_ellipse x y 15 30;;
+
+rmoveto (- 45) 0;;
+let x, y = current_point () in
+draw_ellipse x y 25 10;;
+
+(* Drawing and filling arcs. *)
+
+let draw_arc_ellipse x y r1 r2 =
+  set_color green;
+  draw_arc x y r1 r2 60 120;
+  set_color black;
+  draw_arc x y r1 r2 120 420;;
+
+set_line_width 3;;
+
+let draw_arc_ellipses x y r1 r2 =
+  let step = 5 in
+  for i = 0 to (r1 - step) / (2 * step) do
+   for j = 0 to (r2 - step) / (2 * step) do
+    draw_arc_ellipse x y (3 * i * step) (3 * j * step)
+   done
+  done;;
+
+draw_arc_ellipses 20 128 15 50;;
+
+let fill_arc_ellipse x y r1 r2 c1 c2 =
+  set_color c1;
+  fill_arc x y r1 r2 60 120;
+  set_color c2;
+  fill_arc x y r1 r2 120 420;;
+
+let fill_arc_ellipses x y r1 r2 =
+  let step = 3 in
+  let c1 = ref black
+  and c2 = ref yellow in
+  let exchange r1 r2 = let tmp = !r1 in r1 := !r2; r2 := tmp in
+  for i = r1 / (2 * step) downto 10 do
+   for j = r2 / (2 * step) downto 30 do
+    exchange c1 c2;
+    fill_arc_ellipse x y (3 * i) (3 * j) !c1 !c2
+   done
+  done;;
+
+fill_arc_ellipses 400 240 150 200;;
+
+
+synchronize ();;
+
+(* transparent color drawing *)
+set_color transp;;
+draw_circle 400 240 50;;
+draw_circle 400 240 40;;
+draw_circle 400 240 30;;
+(* try to go back a normal color *)
+set_color red;;
+draw_circle 400 240 20;;
+
+synchronize ();;
+
+input_line stdin;;
diff --git a/test/Moretest/includestruct.ml b/test/Moretest/includestruct.ml
new file mode 100644 (file)
index 0000000..182272c
--- /dev/null
@@ -0,0 +1,92 @@
+(* Test for "include <module-expr>" inside structures *)
+
+module A =
+  struct
+    type t = int
+    let x = (1 : t)
+    let y = (2 : t)
+    let f (z : t) = (x + z : t)
+  end
+
+module B =
+  struct
+    include A
+    type u = t * t
+    let p = ((x, y) : u)
+    let g ((x, y) : u) = ((f x, f y) : u)
+  end
+
+let _ =
+  let print_pair (x,y) =
+    print_int x; print_string ", "; print_int y; print_newline() in
+  print_pair B.p;
+  print_pair (B.g B.p);
+  print_pair (B.g (123, 456))
+
+module H =
+  struct
+    include A
+    let f (z : t) = (x - 1 : t)
+  end
+
+let _ =
+  print_int (H.f H.x); print_newline()
+
+module C =
+  struct
+    include (A : sig type t val f : t -> int val x : t end)
+    let z = f x
+  end
+
+let _ =
+  print_int C.z; print_newline();
+  print_int (C.f C.x); print_newline()
+
+(* Toplevel inclusion *)
+
+include A
+
+let _ =
+  print_int x; print_newline();
+  print_int (f y); print_newline()
+
+(* With a functor *)
+
+module F(X: sig end) =
+  struct
+    let _ = print_string "F is called"; print_newline()
+    type t = A | B of int
+    let print_t = function A -> print_string "A"
+                         | B x -> print_int x
+  end
+
+module D =
+  struct
+    include F(struct end)
+    let test() = print_t A; print_newline(); print_t (B 42); print_newline()
+  end
+    
+let _ =
+  D.test();
+  D.print_t D.A; print_newline(); D.print_t (D.B 42); print_newline()
+
+(* Exceptions and classes *)
+
+module E =
+  struct
+    exception Exn of string
+    class c = object method m = 1 end
+  end
+
+module G =
+  struct
+    include E
+    let _ =
+      begin try raise (Exn "foo") with Exn s -> print_string s end;
+      print_int ((new c)#m); print_newline()
+  end
+
+let _ =
+  begin try raise (G.Exn "foo") with G.Exn s -> print_string s end;
+  print_int ((new G.c)#m); print_newline()
+
diff --git a/test/Moretest/intext.ml b/test/Moretest/intext.ml
new file mode 100644 (file)
index 0000000..7c73518
--- /dev/null
@@ -0,0 +1,454 @@
+(* Test for output_value / input_value *)
+
+type t = A | B of int | C of float | D of string | E of char
+       | F of t | G of t * t | H of int * t | I of t * float | J
+
+let longstring =
+"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+let verylongstring =
+"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
+ 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+
+let bigint = Int64.to_int 0x123456789ABCDEF0L
+
+let rec fib n =
+  if n < 2 then 1 else fib(n-1) + fib(n-2)
+
+let test_out filename =
+  let oc = open_out_bin filename in
+  output_value oc 1;
+  output_value oc (-1);
+  output_value oc 258;
+  output_value oc 20000;
+  output_value oc 0x12345678;
+  output_value oc bigint;
+  output_value oc "foobargeebuz";
+  output_value oc longstring;
+  output_value oc verylongstring;
+  output_value oc 3.141592654;
+  output_value oc ();
+  output_value oc A;
+  output_value oc (B 1);
+  output_value oc (C 2.718);
+  output_value oc (D "hello, world!");
+  output_value oc (E 'l');
+  output_value oc (F(B 1));
+  output_value oc (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e')))));
+  output_value oc (H(1, A));
+  output_value oc (I(B 2, 1e-6));
+  let x = D "sharing" in
+  let y = G(x, x) in
+  let z = G(y, G(x, y)) in
+  output_value oc z;
+  output_value oc [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|];
+  let rec big n = if n <= 0 then A else H(n, big(n-1)) in
+  output_value oc (big 1000);
+  Marshal.to_channel oc y [Marshal.No_sharing];
+  Marshal.to_channel oc fib [Marshal.Closures];
+  output_value oc (Int32.of_string "0");
+  output_value oc (Int32.of_string "123456");
+  output_value oc (Int32.of_string "-123456");
+  output_value oc (Int64.of_string "0");
+  output_value oc (Int64.of_string "123456789123456");
+  output_value oc (Int64.of_string "-123456789123456");
+  output_value oc (Nativeint.of_string "0");
+  output_value oc (Nativeint.of_string "123456");
+  output_value oc (Nativeint.of_string "-123456");
+  output_value oc (Nativeint.shift_left (Nativeint.of_string "123456789") 32);
+  output_value oc (Nativeint.shift_left (Nativeint.of_string "-123456789") 32);
+  let i = Int64.of_string "123456789123456" in output_value oc (i,i);
+  close_out oc
+
+
+let test n b =
+  prerr_string "Test "; prerr_int n;
+  if b then prerr_string " passed.\n" else prerr_string " FAILED.\n";
+  flush stderr
+
+let test_in filename =
+  let ic = open_in_bin filename in
+  test 1 (input_value ic = 1);
+  test 2 (input_value ic = (-1));
+  test 3 (input_value ic = 258);
+  test 4 (input_value ic = 20000);
+  test 5 (input_value ic = 0x12345678);
+  test 6 (input_value ic = bigint);
+  test 7 (input_value ic = "foobargeebuz");
+  test 8 (input_value ic = longstring);
+  test 9 (input_value ic = verylongstring);
+  test 10 (input_value ic = 3.141592654);
+  test 11 (input_value ic = ());
+  test 12 (match input_value ic with
+    A -> true
+  | _ -> false);
+  test 13 (match input_value ic with
+    (B 1) -> true
+  | _ -> false);
+  test 14 (match input_value ic with
+    (C f) -> f = 2.718
+  | _ -> false);
+  test 15 (match input_value ic with
+    (D "hello, world!") -> true
+  | _ -> false);
+  test 16 (match input_value ic with
+    (E 'l') -> true
+  | _ -> false);
+  test 17 (match input_value ic with
+    (F(B 1)) -> true
+  | _ -> false);
+  test 18 (match input_value ic with
+    (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) -> true
+  | _ -> false);
+  test 19 (match input_value ic with
+    (H(1, A)) -> true
+  | _ -> false);
+  test 20 (match input_value ic with
+    (I(B 2, 1e-6)) -> true
+  | _ -> false);
+  test 21 (match input_value ic with
+    G((G((D "sharing" as t1), t2) as t3), G(t4, t5)) ->
+      t1 == t2 && t3 == t5 && t4 == t1
+  | _ -> false);
+  test 22 (input_value ic = [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|]);
+  let rec check_big n t =
+    if n <= 0 then
+      test 23 (match t with A -> true | _ -> false)
+    else
+      match t with H(m, s) -> if m = n then check_big (n-1) s
+                                       else test 23 false
+                 | _ -> test 23 false
+  in
+    check_big 1000 (input_value ic);
+  test 24 (match input_value ic with
+    G((D "sharing" as t1), (D "sharing" as t2)) -> t1 != t2
+  | _ -> false);
+  test 25 (let fib = input_value ic in fib 5 = 8 && fib 10 = 89);
+  test 26 (input_value ic = Int32.of_string "0");
+  test 27 (input_value ic = Int32.of_string "123456");
+  test 28 (input_value ic = Int32.of_string "-123456");
+  test 29 (input_value ic = Int64.of_string "0");
+  test 30 (input_value ic = Int64.of_string "123456789123456");
+  test 31 (input_value ic = Int64.of_string "-123456789123456");
+  test 32 (input_value ic = Nativeint.of_string "0");
+  test 33 (input_value ic = Nativeint.of_string "123456");
+  test 34 (input_value ic = Nativeint.of_string "-123456");
+  test 35 (input_value ic =
+             Nativeint.shift_left (Nativeint.of_string "123456789") 32);
+  test 36 (input_value ic =
+             Nativeint.shift_left (Nativeint.of_string "-123456789") 32);
+  let ((i, j) : int64 * int64) = input_value ic in
+  test 37 (i = Int64.of_string "123456789123456");
+  test 38 (j = Int64.of_string "123456789123456");
+  test 39 (i == j);
+  close_in ic
+
+let test_string () =
+  let s = Marshal.to_string 1 [] in
+  test 101 (Marshal.from_string s 0 = 1);
+  let s = Marshal.to_string (-1) [] in
+  test 102 (Marshal.from_string s 0 = (-1));
+  let s = Marshal.to_string 258 [] in
+  test 103 (Marshal.from_string s 0 = 258);
+  let s = Marshal.to_string 20000 [] in
+  test 104 (Marshal.from_string s 0 = 20000);
+  let s = Marshal.to_string 0x12345678 [] in
+  test 105 (Marshal.from_string s 0 = 0x12345678);
+  let s = Marshal.to_string bigint [] in
+  test 106 (Marshal.from_string s 0 = bigint);
+  let s = Marshal.to_string "foobargeebuz" [] in
+  test 107 (Marshal.from_string s 0 = "foobargeebuz");
+  let s = Marshal.to_string longstring [] in
+  test 108 (Marshal.from_string s 0 = longstring);
+  let s = Marshal.to_string verylongstring [] in
+  test 109 (Marshal.from_string s 0 = verylongstring);
+  let s = Marshal.to_string 3.141592654 [] in
+  test 110 (Marshal.from_string s 0 = 3.141592654);
+  let s = Marshal.to_string () [] in
+  test 111 (Marshal.from_string s 0 = ());
+  let s = Marshal.to_string A [] in
+  test 112 (match Marshal.from_string s 0 with
+    A -> true
+  | _ -> false);
+  let s = Marshal.to_string (B 1) [] in
+  test 113 (match Marshal.from_string s 0 with
+    (B 1) -> true
+  | _ -> false);
+  let s = Marshal.to_string (C 2.718) [] in
+  test 114 (match Marshal.from_string s 0 with
+    (C f) -> f = 2.718
+  | _ -> false);
+  let s = Marshal.to_string (D "hello, world!") [] in
+  test 115 (match Marshal.from_string s 0 with
+    (D "hello, world!") -> true
+  | _ -> false);
+  let s = Marshal.to_string (E 'l') [] in
+  test 116 (match Marshal.from_string s 0 with
+    (E 'l') -> true
+  | _ -> false);
+  let s = Marshal.to_string (F(B 1)) [] in
+  test 117 (match Marshal.from_string s 0 with
+    (F(B 1)) -> true
+  | _ -> false);
+  let s = Marshal.to_string (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) [] in
+  test 118 (match Marshal.from_string s 0 with
+    (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) -> true
+  | _ -> false);
+  let s = Marshal.to_string (H(1, A)) [] in
+  test 119 (match Marshal.from_string s 0 with
+    (H(1, A)) -> true
+  | _ -> false);
+  let s = Marshal.to_string (I(B 2, 1e-6)) [] in
+  test 120 (match Marshal.from_string s 0 with
+    (I(B 2, 1e-6)) -> true
+  | _ -> false);
+  let x = D "sharing" in
+  let y = G(x, x) in
+  let z = G(y, G(x, y)) in
+  let s = Marshal.to_string z [] in
+  test 121 (match Marshal.from_string s 0 with
+    G((G((D "sharing" as t1), t2) as t3), G(t4, t5)) ->
+      t1 == t2 && t3 == t5 && t4 == t1
+  | _ -> false);
+  let s = Marshal.to_string [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|] [] in
+  test 122 (Marshal.from_string s 0 = [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|]);
+  let rec big n = if n <= 0 then A else H(n, big(n-1)) in
+  let s = Marshal.to_string (big 1000) [] in
+  let rec check_big n t =
+    if n <= 0 then
+      test 123 (match t with A -> true | _ -> false)
+    else
+      match t with H(m, s) -> if m = n then check_big (n-1) s
+                                       else test 123 false
+                 | _ -> test 123 false
+  in
+    check_big 1000 (Marshal.from_string s 0)
+
+let test_buffer () =
+  let s = String.create 512 in
+  Marshal.to_buffer s 0 512 1 [];
+  test 201 (Marshal.from_string s 0 = 1);
+  Marshal.to_buffer s 0 512 (-1) [];
+  test 202 (Marshal.from_string s 0 = (-1));
+  Marshal.to_buffer s 0 512 258 [];
+  test 203 (Marshal.from_string s 0 = 258);
+  Marshal.to_buffer s 0 512 20000 [];
+  test 204 (Marshal.from_string s 0 = 20000);
+  Marshal.to_buffer s 0 512 0x12345678 [];
+  test 205 (Marshal.from_string s 0 = 0x12345678);
+  Marshal.to_buffer s 0 512 bigint [];
+  test 206 (Marshal.from_string s 0 = bigint);
+  Marshal.to_buffer s 0 512 "foobargeebuz" [];
+  test 207 (Marshal.from_string s 0 = "foobargeebuz");
+  Marshal.to_buffer s 0 512 longstring [];
+  test 208 (Marshal.from_string s 0 = longstring);
+  test 209
+    (try Marshal.to_buffer s 0 512 verylongstring []; false
+     with Failure "Marshal.to_buffer: buffer overflow" -> true);
+  Marshal.to_buffer s 0 512 3.141592654 [];
+  test 210 (Marshal.from_string s 0 = 3.141592654);
+  Marshal.to_buffer s 0 512 () [];
+  test 211 (Marshal.from_string s 0 = ());
+  Marshal.to_buffer s 0 512 A [];
+  test 212 (match Marshal.from_string s 0 with
+    A -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (B 1) [];
+  test 213 (match Marshal.from_string s 0 with
+    (B 1) -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (C 2.718) [];
+  test 214 (match Marshal.from_string s 0 with
+    (C f) -> f = 2.718
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (D "hello, world!") [];
+  test 215 (match Marshal.from_string s 0 with
+    (D "hello, world!") -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (E 'l') [];
+  test 216 (match Marshal.from_string s 0 with
+    (E 'l') -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (F(B 1)) [];
+  test 217 (match Marshal.from_string s 0 with
+    (F(B 1)) -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) [];
+  test 218 (match Marshal.from_string s 0 with
+    (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (H(1, A)) [];
+  test 219 (match Marshal.from_string s 0 with
+    (H(1, A)) -> true
+  | _ -> false);
+  Marshal.to_buffer s 0 512 (I(B 2, 1e-6)) [];
+  test 220 (match Marshal.from_string s 0 with
+    (I(B 2, 1e-6)) -> true
+  | _ -> false);
+  let x = D "sharing" in
+  let y = G(x, x) in
+  let z = G(y, G(x, y)) in
+  Marshal.to_buffer s 0 512 z [];
+  test 221 (match Marshal.from_string s 0 with
+    G((G((D "sharing" as t1), t2) as t3), G(t4, t5)) ->
+      t1 == t2 && t3 == t5 && t4 == t1
+  | _ -> false);
+  Marshal.to_buffer s 0 512 [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|] [];
+  test 222 (Marshal.from_string s 0 = [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|]);
+  let rec big n = if n <= 0 then A else H(n, big(n-1)) in
+  test 223
+    (try Marshal.to_buffer s 0 512 (big 1000) []; false
+     with Failure "Marshal.to_buffer: buffer overflow" -> true)
+
+let test_size() =
+  let s = Marshal.to_string (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) [] in
+  test 300 (Marshal.header_size + Marshal.data_size s 0 = String.length s)
+
+external marshal_to_block
+   : string -> int -> 'a -> Marshal.extern_flags list -> unit
+   = "marshal_to_block"
+external marshal_from_block : string -> int -> 'a = "marshal_from_block"
+external static_alloc : int -> string = "caml_static_alloc"
+
+let test_block () =
+  let s = static_alloc 512 in
+  marshal_to_block s 512 1 [];
+  test 401 (marshal_from_block s 512 = 1);
+  marshal_to_block s 512 (-1) [];
+  test 402 (marshal_from_block s 512 = (-1));
+  marshal_to_block s 512 258 [];
+  test 403 (marshal_from_block s 512 = 258);
+  marshal_to_block s 512 20000 [];
+  test 404 (marshal_from_block s 512 = 20000);
+  marshal_to_block s 512 0x12345678 [];
+  test 405 (marshal_from_block s 512 = 0x12345678);
+  marshal_to_block s 512 bigint [];
+  test 406 (marshal_from_block s 512 = bigint);
+  marshal_to_block s 512 "foobargeebuz" [];
+  test 407 (marshal_from_block s 512 = "foobargeebuz");
+  marshal_to_block s 512 longstring [];
+  test 408 (marshal_from_block s 512 = longstring);
+  test 409
+    (try marshal_to_block s 512 verylongstring []; false
+     with Failure "Marshal.to_buffer: buffer overflow" -> true);
+  marshal_to_block s 512 3.141592654 [];
+  test 410 (marshal_from_block s 512 = 3.141592654);
+  marshal_to_block s 512 () [];
+  test 411 (marshal_from_block s 512 = ());
+  marshal_to_block s 512 A [];
+  test 412 (match marshal_from_block s 512 with
+    A -> true
+  | _ -> false);
+  marshal_to_block s 512 (B 1) [];
+  test 413 (match marshal_from_block s 512 with
+    (B 1) -> true
+  | _ -> false);
+  marshal_to_block s 512 (C 2.718) [];
+  test 414 (match marshal_from_block s 512 with
+    (C f) -> f = 2.718
+  | _ -> false);
+  marshal_to_block s 512 (D "hello, world!") [];
+  test 415 (match marshal_from_block s 512 with
+    (D "hello, world!") -> true
+  | _ -> false);
+  marshal_to_block s 512 (E 'l') [];
+  test 416 (match marshal_from_block s 512 with
+    (E 'l') -> true
+  | _ -> false);
+  marshal_to_block s 512 (F(B 1)) [];
+  test 417 (match marshal_from_block s 512 with
+    (F(B 1)) -> true
+  | _ -> false);
+  marshal_to_block s 512 (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) [];
+  test 418 (match marshal_from_block s 512 with
+    (G(A, G(B 2, G(C 3.14, G(D "glop", E 'e'))))) -> true
+  | _ -> false);
+  marshal_to_block s 512 (H(1, A)) [];
+  test 419 (match marshal_from_block s 512 with
+    (H(1, A)) -> true
+  | _ -> false);
+  marshal_to_block s 512 (I(B 2, 1e-6)) [];
+  test 420 (match marshal_from_block s 512 with
+    (I(B 2, 1e-6)) -> true
+  | _ -> false);
+  let x = D "sharing" in
+  let y = G(x, x) in
+  let z = G(y, G(x, y)) in
+  marshal_to_block s 512 z [];
+  test 421 (match marshal_from_block s 512 with
+    G((G((D "sharing" as t1), t2) as t3), G(t4, t5)) ->
+      t1 == t2 && t3 == t5 && t4 == t1
+  | _ -> false);
+  marshal_to_block s 512 [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|] [];
+  test 422 (marshal_from_block s 512 = [|1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16|]);
+  let rec big n = if n <= 0 then A else H(n, big(n-1)) in
+  test 423
+    (try marshal_to_block s 512 (big 1000) []; false
+     with Failure _ -> true);
+  test 424
+    (try marshal_to_block s 512 "Hello, world!" [];
+         marshal_from_block s 8;
+         false
+     with Failure _ -> true)
+
+(* Test for really big objects *)
+
+let counter = ref 0
+
+let rec make_big n =
+  if n <= 0 then begin
+    incr counter; B !counter
+  end else begin
+    let l = make_big (n-1) in
+    let r = make_big (n-1) in
+    G(l, r)
+  end
+
+let rec check_big n x =
+  if n <= 0 then begin
+    match x with
+      B k -> incr counter; k = !counter
+    | _   -> false
+  end else begin
+    match x with
+      G(l, r) -> check_big (n-1) l && check_big (n-1) r
+    | _       -> false
+  end
+
+let main() =
+  if Array.length Sys.argv <= 2 then begin
+    test_out "intext.data"; test_in "intext.data";
+    test_out "intext.data"; test_in "intext.data";
+    Sys.remove "intext.data";
+    test_string();
+    test_buffer();
+    test_size();
+    test_block()
+  end else
+  if Sys.argv.(1) = "make" then begin
+    let n = int_of_string Sys.argv.(2) in
+    let oc = open_out_bin "intext.data" in
+    counter := 0;
+    output_value oc (make_big n);
+    close_out oc
+  end else
+  if Sys.argv.(1) = "test" then begin
+    let n = int_of_string Sys.argv.(2) in
+    let ic = open_in_bin "intext.data" in
+    let b = (input_value ic : t) in
+    Gc.full_major();
+    close_in ic;
+    counter := 0;
+    if check_big n b then
+      Printf.printf "Test big %d passed" n
+    else
+      Printf.printf "Test big %d FAILED" n;
+    print_newline()
+  end
+
+let _ = Printexc.catch main (); exit 0
diff --git a/test/Moretest/intextaux.c b/test/Moretest/intextaux.c
new file mode 100644 (file)
index 0000000..9225b90
--- /dev/null
@@ -0,0 +1,13 @@
+#include <mlvalues.h>
+#include <intext.h>
+
+value marshal_to_block(value vbuf, value vlen, value v, value vflags)
+{
+  return Val_long(output_value_to_block(v, vflags, 
+                                        (char *) vbuf, Long_val(vlen)));
+}
+
+value marshal_from_block(value vbuf, value vlen)
+{
+  return input_value_from_block((char *) vbuf, Long_val(vlen));
+}
diff --git a/test/Moretest/io.ml b/test/Moretest/io.ml
new file mode 100644 (file)
index 0000000..f843e70
--- /dev/null
@@ -0,0 +1,103 @@
+(* Test a file copy function *)
+
+let test msg funct f1 f2 =
+  print_string msg; print_newline();
+  funct f1 f2;
+  if Sys.command ("cmp " ^ f1 ^ " " ^ f2) = 0
+  then print_string "passed"
+  else print_string "FAILED";
+  print_newline()
+
+(* File copy with constant-sized chunks *)
+
+let copy_file sz infile ofile =
+  let ic = open_in infile in
+  let oc = open_out ofile in
+  let buffer = String.create sz in
+  let rec copy () =
+    let n = input ic buffer 0 sz in
+    if n = 0 then () else begin
+      output oc buffer 0 n;
+      copy ()
+    end in
+  copy();
+  close_in ic;
+  close_out oc
+
+(* File copy with random-sized chunks *)
+
+let copy_random sz infile ofile =
+  let ic = open_in infile in
+  let oc = open_out ofile in
+  let buffer = String.create sz in
+  let rec copy () =
+    let s = 1 + Random.int sz in
+    let n = input ic buffer 0 s in
+    if n = 0 then () else begin
+      output oc buffer 0 n;
+      copy ()
+    end in
+  copy();
+  close_in ic;
+  close_out oc
+
+(* File copy line per line *)
+
+let copy_line infile ofile =
+  let ic = open_in infile in
+  let oc = open_out ofile in
+  try
+    while true do
+      output_string oc (input_line ic); output_char oc '\n'
+    done
+  with End_of_file ->
+    close_in ic;
+    close_out oc
+
+(* Backward copy, with lots of seeks *)
+
+let copy_seek chunksize infile ofile =
+  let ic = open_in_bin infile in
+  let oc = open_out_bin ofile in
+  let size = in_channel_length ic in
+  let buffer = String.create chunksize in
+  for i = (size - 1) / chunksize downto 0 do
+    seek_in ic (i * chunksize);
+    seek_out oc (i * chunksize);
+    let n = input ic buffer 0 chunksize in
+    output oc buffer 0 n
+  done;
+  close_in ic;
+  close_out oc
+
+(* Create long lines of text *)
+
+let make_lines ofile =
+  let oc = open_out ofile in
+  for i = 1 to 256 do
+    output_string oc (String.make (i*64) '.'); output_char oc '\n'
+  done;
+  close_out oc
+
+(* The test *)
+
+let _ =
+  let src = Sys.argv.(1) in
+  let testio = Filename.temp_file "testio" "" in
+  let lines = Filename.temp_file "lines" "" in
+  test "16-byte chunks" (copy_file 16) src testio;
+  test "256-byte chunks" (copy_file 256) src testio;
+  test "4096-byte chunks" (copy_file 4096) src testio;
+  test "65536-byte chunks" (copy_file 65536) src testio;
+  test "19-byte chunks" (copy_file 19) src testio;
+  test "263-byte chunks" (copy_file 263) src testio;
+  test "4011-byte chunks" (copy_file 4011) src testio;
+  test "0...8192 byte chunks" (copy_random 8192) src testio;
+  test "line per line, short lines" copy_line "/etc/hosts" testio;
+  make_lines lines;
+  test "line per line, short and long lines" copy_line lines testio;
+  test "backwards, 4096-byte chunks" (copy_seek 4096) src testio;
+  test "backwards, 64-byte chunks" (copy_seek 64) src testio;
+  Sys.remove lines;
+  Sys.remove testio;
+  exit 0
diff --git a/test/Moretest/manyargs.ml b/test/Moretest/manyargs.ml
new file mode 100644 (file)
index 0000000..70c8662
--- /dev/null
@@ -0,0 +1,42 @@
+let manyargs a b c d e f g h i j k l m n o =
+  print_string "a = "; print_int a; print_newline();
+  print_string "b = "; print_int b; print_newline();
+  print_string "c = "; print_int c; print_newline();
+  print_string "d = "; print_int d; print_newline();
+  print_string "e = "; print_int e; print_newline();
+  print_string "f = "; print_int f; print_newline();
+  print_string "g = "; print_int g; print_newline();
+  print_string "h = "; print_int h; print_newline();
+  print_string "i = "; print_int i; print_newline();
+  print_string "j = "; print_int j; print_newline();
+  print_string "k = "; print_int k; print_newline();
+  print_string "l = "; print_int l; print_newline();
+  print_string "m = "; print_int m; print_newline();
+  print_string "n = "; print_int n; print_newline();
+  print_string "o = "; print_int o; print_newline();
+  print_string "---"; print_newline()
+
+let manyargs_tail1 a b c d e f g h i j k l m n o =
+  print_string "tail1:\n";
+  manyargs a b c d e f g h i j k l m n o
+
+let manyargs_tail2 a b =
+  print_string "tail2:\n";
+  manyargs a b a b a b a b a b a b a b a
+
+let manyargs_tail3 a b c d e f g h i j k l m n o =
+  print_string "tail3:\n";
+  print_string "o = "; print_int o; print_newline();
+  print_string "---"; print_newline()
+
+let _ =
+  manyargs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15;
+  manyargs_tail1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15;
+  manyargs_tail2 0 1;
+  manyargs_tail3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+
+external manyargs_ext: int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> int = "manyargs_argv" "manyargs"
+
+let _ =
+  print_string "external:\n"; flush stdout;
+  manyargs_ext 1 2 3 4 5 6 7 8 9 10 11
diff --git a/test/Moretest/manyargsprim.c b/test/Moretest/manyargsprim.c
new file mode 100644 (file)
index 0000000..c80e534
--- /dev/null
@@ -0,0 +1,24 @@
+#include "mlvalues.h"
+
+value manyargs(value a, value b, value c, value d, value e, value f,
+               value g, value h, value i, value j, value k)
+{
+  printf("a = %d\n", Int_val(a));
+  printf("b = %d\n", Int_val(b));
+  printf("c = %d\n", Int_val(c));
+  printf("d = %d\n", Int_val(d));
+  printf("e = %d\n", Int_val(e));
+  printf("f = %d\n", Int_val(f));
+  printf("g = %d\n", Int_val(g));
+  printf("h = %d\n", Int_val(h));
+  printf("i = %d\n", Int_val(i));
+  printf("j = %d\n", Int_val(j));
+  printf("k = %d\n", Int_val(k));
+  return Val_unit;
+}
+
+value manyargs_argv(value *argv, int argc)
+{
+  return manyargs(argv[0], argv[1], argv[2], argv[3], argv[4],
+                  argv[5], argv[6], argv[7], argv[8], argv[9], argv[10]);
+}
diff --git a/test/Moretest/md5.ml b/test/Moretest/md5.ml
new file mode 100644 (file)
index 0000000..46d8a10
--- /dev/null
@@ -0,0 +1,219 @@
+(* Test int32 arithmetic and optimizations using the MD5 algorithm *)
+
+open Printf
+
+type context =
+  { buf: string;
+    mutable pos: int;
+    mutable a: int32;
+    mutable b: int32;
+    mutable c: int32;
+    mutable d: int32;
+    mutable bits: int64 }
+
+let step1 w x y z data s =
+  let w =
+    Int32.add (Int32.add w data)
+              (Int32.logxor z (Int32.logand x (Int32.logxor y z))) in
+  Int32.add x
+    (Int32.logor (Int32.shift_left w s) (Int32.shift_right_logical w (32-s)))
+
+let step2 w x y z data s =
+  let w =
+    Int32.add (Int32.add w data)
+              (Int32.logxor y (Int32.logand z (Int32.logxor x y))) in
+  Int32.add x
+    (Int32.logor (Int32.shift_left w s) (Int32.shift_right_logical w (32-s)))
+
+let step3 w x y z data s =
+  let w =
+    Int32.add (Int32.add w data)
+              (Int32.logxor x (Int32.logxor y z)) in
+  Int32.add x
+    (Int32.logor (Int32.shift_left w s) (Int32.shift_right_logical w (32-s)))
+
+let step4 w x y z data s =
+  let w =
+    Int32.add (Int32.add w data)
+              (Int32.logxor y (Int32.logor x (Int32.logxor z (-1l)))) in
+  Int32.add x
+    (Int32.logor (Int32.shift_left w s) (Int32.shift_right_logical w (32-s)))
+
+let transform ctx data =
+    let a = ctx.a and b = ctx.b and c = ctx.c and d = ctx.d in
+
+    let a = step1 a b c d (Int32.add data.(0) 0xd76aa478l) 7 in
+    let d = step1 d a b c (Int32.add data.(1) 0xe8c7b756l) 12 in
+    let c = step1 c d a b (Int32.add data.(2) 0x242070dbl) 17 in
+    let b = step1 b c d a (Int32.add data.(3) 0xc1bdceeel) 22 in
+    let a = step1 a b c d (Int32.add data.(4) 0xf57c0fafl) 7 in
+    let d = step1 d a b c (Int32.add data.(5) 0x4787c62al) 12 in
+    let c = step1 c d a b (Int32.add data.(6) 0xa8304613l) 17 in
+    let b = step1 b c d a (Int32.add data.(7) 0xfd469501l) 22 in
+    let a = step1 a b c d (Int32.add data.(8) 0x698098d8l) 7 in
+    let d = step1 d a b c (Int32.add data.(9) 0x8b44f7afl) 12 in
+    let c = step1 c d a b (Int32.add data.(10) 0xffff5bb1l) 17 in
+    let b = step1 b c d a (Int32.add data.(11) 0x895cd7bel) 22 in
+    let a = step1 a b c d (Int32.add data.(12) 0x6b901122l) 7 in
+    let d = step1 d a b c (Int32.add data.(13) 0xfd987193l) 12 in
+    let c = step1 c d a b (Int32.add data.(14) 0xa679438el) 17 in
+    let b = step1 b c d a (Int32.add data.(15) 0x49b40821l) 22 in
+
+    let a = step2 a b c d (Int32.add data.(1) 0xf61e2562l) 5 in
+    let d = step2 d a b c (Int32.add data.(6) 0xc040b340l) 9 in
+    let c = step2 c d a b (Int32.add data.(11) 0x265e5a51l) 14 in
+    let b = step2 b c d a (Int32.add data.(0) 0xe9b6c7aal) 20 in
+    let a = step2 a b c d (Int32.add data.(5) 0xd62f105dl) 5 in
+    let d = step2 d a b c (Int32.add data.(10) 0x02441453l) 9 in
+    let c = step2 c d a b (Int32.add data.(15) 0xd8a1e681l) 14 in
+    let b = step2 b c d a (Int32.add data.(4) 0xe7d3fbc8l) 20 in
+    let a = step2 a b c d (Int32.add data.(9) 0x21e1cde6l) 5 in
+    let d = step2 d a b c (Int32.add data.(14) 0xc33707d6l) 9 in
+    let c = step2 c d a b (Int32.add data.(3) 0xf4d50d87l) 14 in
+    let b = step2 b c d a (Int32.add data.(8) 0x455a14edl) 20 in
+    let a = step2 a b c d (Int32.add data.(13) 0xa9e3e905l) 5 in
+    let d = step2 d a b c (Int32.add data.(2) 0xfcefa3f8l) 9 in
+    let c = step2 c d a b (Int32.add data.(7) 0x676f02d9l) 14 in
+    let b = step2 b c d a (Int32.add data.(12) 0x8d2a4c8al) 20 in
+
+    let a = step3 a b c d (Int32.add data.(5) 0xfffa3942l) 4 in
+    let d = step3 d a b c (Int32.add data.(8) 0x8771f681l) 11 in
+    let c = step3 c d a b (Int32.add data.(11) 0x6d9d6122l) 16 in
+    let b = step3 b c d a (Int32.add data.(14) 0xfde5380cl) 23 in
+    let a = step3 a b c d (Int32.add data.(1) 0xa4beea44l) 4 in
+    let d = step3 d a b c (Int32.add data.(4) 0x4bdecfa9l) 11 in
+    let c = step3 c d a b (Int32.add data.(7) 0xf6bb4b60l) 16 in
+    let b = step3 b c d a (Int32.add data.(10) 0xbebfbc70l) 23 in
+    let a = step3 a b c d (Int32.add data.(13) 0x289b7ec6l) 4 in
+    let d = step3 d a b c (Int32.add data.(0) 0xeaa127fal) 11 in
+    let c = step3 c d a b (Int32.add data.(3) 0xd4ef3085l) 16 in
+    let b = step3 b c d a (Int32.add data.(6) 0x04881d05l) 23 in
+    let a = step3 a b c d (Int32.add data.(9) 0xd9d4d039l) 4 in
+    let d = step3 d a b c (Int32.add data.(12) 0xe6db99e5l) 11 in
+    let c = step3 c d a b (Int32.add data.(15) 0x1fa27cf8l) 16 in
+    let b = step3 b c d a (Int32.add data.(2) 0xc4ac5665l) 23 in
+
+    let a = step4 a b c d (Int32.add data.(0) 0xf4292244l) 6 in
+    let d = step4 d a b c (Int32.add data.(7) 0x432aff97l) 10 in
+    let c = step4 c d a b (Int32.add data.(14) 0xab9423a7l) 15 in
+    let b = step4 b c d a (Int32.add data.(5) 0xfc93a039l) 21 in
+    let a = step4 a b c d (Int32.add data.(12) 0x655b59c3l) 6 in
+    let d = step4 d a b c (Int32.add data.(3) 0x8f0ccc92l) 10 in
+    let c = step4 c d a b (Int32.add data.(10) 0xffeff47dl) 15 in
+    let b = step4 b c d a (Int32.add data.(1) 0x85845dd1l) 21 in
+    let a = step4 a b c d (Int32.add data.(8) 0x6fa87e4fl) 6 in
+    let d = step4 d a b c (Int32.add data.(15) 0xfe2ce6e0l) 10 in
+    let c = step4 c d a b (Int32.add data.(6) 0xa3014314l) 15 in
+    let b = step4 b c d a (Int32.add data.(13) 0x4e0811a1l) 21 in
+    let a = step4 a b c d (Int32.add data.(4) 0xf7537e82l) 6 in
+    let d = step4 d a b c (Int32.add data.(11) 0xbd3af235l) 10 in
+    let c = step4 c d a b (Int32.add data.(2) 0x2ad7d2bbl) 15 in
+    let b = step4 b c d a (Int32.add data.(9) 0xeb86d391l) 21 in
+
+    ctx.a <- Int32.add ctx.a a;
+    ctx.b <- Int32.add ctx.b b;
+    ctx.c <- Int32.add ctx.c c;
+    ctx.d <- Int32.add ctx.d d
+
+let string_to_data s =
+  let data = Array.make 16 0l in
+  for i = 0 to 15 do
+    let j = i lsl 2 in
+    data.(i) <-
+      Int32.logor (Int32.shift_left (Int32.of_int (Char.code s.[j+3])) 24)
+        (Int32.logor (Int32.shift_left (Int32.of_int (Char.code s.[j+2])) 16)
+          (Int32.logor (Int32.shift_left (Int32.of_int (Char.code s.[j+1])) 8)
+                       (Int32.of_int (Char.code s.[j]))))
+  done;
+  data
+
+let int32_to_string n s i =
+  s.[i+3] <- Char.chr (Int32.to_int (Int32.shift_right n 24) land 0xFF);
+  s.[i+2] <- Char.chr (Int32.to_int (Int32.shift_right n 16) land 0xFF);
+  s.[i+1] <- Char.chr (Int32.to_int (Int32.shift_right n 8) land 0xFF);
+  s.[i] <- Char.chr (Int32.to_int n land 0xFF)
+
+let init () =
+  { buf = String.create 64;
+    pos = 0;
+    a = 0x67452301l;
+    b = 0xefcdab89l;
+    c = 0x98badcfel;
+    d = 0x10325476l;
+    bits = 0L }
+
+let update ctx input ofs len =
+  let rec upd ofs len =
+    if len <= 0 then () else
+    if ctx.pos + len < 64 then begin
+      (* Just buffer the data *)
+      String.blit input ofs ctx.buf ctx.pos len;
+      ctx.pos <- ctx.pos + len
+    end else begin
+      (* Fill the buffer *)
+      let len' = 64 - ctx.pos in
+      if len' > 0 then String.blit input ofs ctx.buf ctx.pos len';
+      (* Transform 64 bytes *)
+      transform ctx (string_to_data ctx.buf);
+      ctx.pos <- 0;
+      upd (ofs + len') (len - len')
+    end in
+  upd ofs len;
+  ctx.bits <- Int64.add ctx.bits (Int64.of_int (len lsl 3))
+
+
+let finish ctx =
+  let padding = String.make 64 '\000' in
+  padding.[0] <- '\x80';
+  let numbits = ctx.bits in
+  if ctx.pos < 56 then begin
+    update ctx padding 0 (56 - ctx.pos)
+  end else begin
+    update ctx padding 0 (64 + 56 - ctx.pos)
+  end;
+  assert (ctx.pos = 56);
+  let data = string_to_data ctx.buf in
+  data.(14) <- (Int64.to_int32 numbits);
+  data.(15) <- (Int64.to_int32 (Int64.shift_right_logical numbits 32));
+  transform ctx data;
+  let res = String.create 16 in
+  int32_to_string ctx.a res 0;
+  int32_to_string ctx.b res 4;
+  int32_to_string ctx.c res 8;
+  int32_to_string ctx.d res 12;
+  res
+
+let test s =
+  let ctx = init() in
+  update ctx s 0 (String.length s);
+  let res = finish ctx in
+  let exp = Digest.string s in
+  let ok = (res = exp) in
+  if not ok then Printf.printf "Failure for '%s'\n" s;
+  ok
+
+let time msg iter fn =
+  let start = Sys.time() in
+  for i = 1 to iter do fn () done;
+  let stop = Sys.time() in
+  printf "%s: %.2f s\n" msg (stop -. start)
+
+let _ =
+  (* Test *)
+  if test ""
+  && test "a"
+  && test "abc"
+  && test "message digest"
+  && test "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
+  then printf "Test vectors passed.\n";
+  flush stdout;
+  (* Benchmark *)
+  let s = String.make 50000 'a' in
+  let num_iter = 1000 in
+  time "Caml implementation" num_iter
+    (fun () ->
+      let ctx = init() in
+      update ctx s 0 (String.length s);
+      ignore (finish ctx));
+  time "C implementation" num_iter
+    (fun () -> ignore (Digest.string s))
diff --git a/test/Moretest/morematch.ml b/test/Moretest/morematch.ml
new file mode 100644 (file)
index 0000000..e6a0a1c
--- /dev/null
@@ -0,0 +1,1137 @@
+(**************************************************************)
+(*  This suite tests the pattern-matching compiler            *)
+(*  it should just compile and run.                           *)
+(*  While compiling the following messages are normal:        *)
+(**************************************************************)
+
+(*
+File "morematch.ml", line 38, characters 10-93:
+Warning: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+0
+File "morematch.ml", line 376, characters 2-15:
+Warning: this match case is unused.
+File "morematch.ml", line 443, characters 2-7:
+Warning: this match case is unused.
+*)
+
+let test msg f arg r =
+  if f arg <> r then begin
+    prerr_endline msg ;
+    failwith "Malaise"
+  end
+;;
+
+type t = A | B | C | D | E | F
+  ;;
+
+let f x = match x with
+| A | B | C -> 1
+| D | E -> 2
+| F -> 3;;
+
+test "un" f C 1 ;
+test "un" f D 2 ;
+test "un" f F 3 ; ()
+;;
+
+let g x = match x with
+  1 -> 1
+| 2 -> 2
+| 3 -> 3
+| 4 | 5 -> 4
+| 6 -> 5
+| 7 | 8 -> 6
+| 9 -> 7
+;;
+
+test "deux" g 5 4 ;
+test "deux" g 6 5 ;
+test "deux" g 9 7 ; ()
+;;
+
+  
+let g x = match x with
+  1 -> 1
+| 2 -> 2
+| 3 -> 3
+| 4 | 5 -> 4
+| 6 -> 5   
+| 7 | 8 -> 6
+| 9 -> 7
+| _ -> 8;;
+
+test "trois" g 10 8
+;;
+
+let g x= match  x with
+  1 -> 1
+| 2 -> 2
+| 3 -> 3
+| 4 | 5 -> 4
+| 6 -> 5   
+| 4|5|7 -> 100
+| 7 | 8 -> 6
+| 9 -> 7
+| _ -> 8;;
+test "quatre" g 4 4 ;
+test "quatre" g 7 100 ; ()
+;;
+
+
+let h x =
+ match x with
+   (1,1) -> 1
+| (2|3), 1 -> 2
+| 2,(2|3) -> 3
+| (4,4) -> 5
+| _ -> 100
+;;
+
+test "cinq" h (2,2) 3 ;
+test "cinq" h (2,1) 2 ;
+test "cinq" h (2,4) 100 ; ()
+;;
+
+(* idem hh (2,5) *)
+
+let hh x = match x with
+| 1,1 -> 1
+| 2,1 -> 2
+| (2|3),(1|2|3|4) -> 3
+| 2,5 -> 4
+| (4,4) -> 5
+| _ -> 100
+;;
+
+let hhh x = match x with
+| 1,1 -> 1
+| (2|3),1 -> 2
+| 2,2 -> 3
+| _ -> 100
+;;
+
+let h x =
+ match x with
+   (1,1) -> 1
+| 3,1 -> 2
+| 2,(2|3) -> 3
+| (4,4) -> 5
+| _ -> 100
+;;
+
+let h x = match x with
+  1 -> 1
+| 2|3 -> 2
+| 4 -> 4
+| 5 -> 5
+| 6|7 -> 6
+| 8 -> 8
+| _ -> 100
+;;
+let f x = match x with
+| ((1|2),(3|4))|((3|4),(1|2)) -> 1
+| (3,(5|6)) -> 2
+| _ -> 3
+;;
+
+test "six" f (1,3) 1 ;
+test "six" f (3,2) 1 ;
+test "six" f (3,5) 2 ;
+test "six" f (3,7) 3 ; ()
+;;
+
+type tt = {a : bool list ; b : bool}
+
+let f = function
+  | {a=([]|[true])} -> 1
+  | {a=false::_}|{b=(true|false)}    -> 2
+;;
+
+test "sept" f {a=[] ; b = true} 1 ;
+test "sept" f {a=[true] ; b = false} 1 ;
+test "sept" f {a=[false ; true] ; b = true} 2 ;
+test "sept" f {a=[false] ; b = false} 2 ; ()
+;;
+
+let f = function
+  | (([]|[true]),_) -> 1
+  | (false::_,_)|(_,(true|false)) -> 2
+;;
+
+test "huit" f ([],true) 1 ;
+test "huit" f ([true],false) 1 ;
+test "huit" f ([false ; true], true) 2 ;
+test "huit" f ([false], false) 2 ; ()
+;;
+
+
+let split_cases = function
+   | `Nil | `Cons _ as x -> `A x
+   | `Snoc _ as x -> `B x
+;;
+
+test "oubli" split_cases `Nil (`A `Nil);
+test "oubli" split_cases (`Cons 1) (`A (`Cons 1));
+test "oubli" split_cases (`Snoc 1) (`B (`Snoc 1)) ; ()
+;;
+
+type t1 = A of int | B of int
+let f1 = function
+  | (A x | B x) -> x
+;;
+
+test "neuf" f1 (A 1) 1 ;
+test "neuf" f1 (B 1) 1 ;
+;;
+
+type coucou = A of int | B of int * int | C
+;;
+
+
+let g = function
+  | (A x | B (_,x)) -> x
+  | C -> 0
+;;
+
+
+test "dix" g (A 1) 1 ;
+test "dix" g (B (1,2)) 2 ;
+;;
+
+
+
+let h = function
+  | ([x]|[1 ; x ]|[1 ; 2 ; x]) -> x
+  | _ -> 0
+;;
+
+test "encore" h [1] 1 ;
+test "encore" h [1;2] 2 ;
+test "encore" h [1;2;3] 3 ;
+test "encore" h [0 ; 0] 0 ; ()
+;;
+
+let f = function
+| (x,(0 as y)) | (y,x) -> y-x
+;;
+
+test "foo1" f (1,0) (-1);
+test "foo1" f (1,2) (-1)
+;;
+
+
+let f = function (([]|[_]) as x)|(_::([] as x))|(_::_::x)  -> x
+;;
+
+test "zob" f [] [] ;
+test "zob" f [1] [1] ;
+test "zob" f [1;2;3] [3]
+;;
+
+
+type zob = A | B | C | D of zob * int | E of zob * zob
+
+let rec f = function
+  | (A | B | C) -> A
+  | D (x,i) -> D (f x,i)
+  | E (x,_) -> D (f x,0)
+;;
+
+
+test "fin" f B A ;
+test "fin" f (D (C,1)) (D (A,1)) ;
+test "fin" f (E (C,A)) (D (A,0)) ; ()
+;;
+
+type length = 
+    Char of int | Pixel of int | Percent of int | No of string | Default
+
+let length = function
+  | Char n -> n | Pixel n -> n
+  | _       -> 0
+;;
+
+test "length" length (Char 10) 10 ;
+test "length" length (Pixel 20) 20 ;
+test "length" length Default 0 ;
+test "length" length (Percent 100) 0 ; ()
+;;
+
+let length2 = function
+  | Char n -> n | Percent n -> n
+  | _       -> 0
+;;
+
+test "length2" length2 (Char 10) 10 ;
+test "length2" length2 (Pixel 20) 0 ;
+test "length2" length2 Default 0 ;
+test "length2" length2(Percent 100) 100 ; ()
+;;
+
+let length3 = function
+  | Char _ | No _ -> true
+  | _ -> false
+;;
+
+test "length3" length3 (Char 10) true ;
+test "length3" length3 (No "") true ;
+test "length3" length3 (Pixel 20) false ;
+test "length3" length3 Default false ;
+test "length3" length3(Percent 100) false ; ()
+;;
+
+type hevea = A | B | C
+
+let h x = match x with
+| A -> 1
+| B|C -> 2
+;;
+
+test "hevea" h A 1 ;
+test "hevea" h B 2 ;
+test "hevea" h B 2 ; ()
+;;
+type lambda =
+    Lvar of int
+  | Lconst of int
+  | Lapply of lambda * lambda list
+  | Lfunction of bool  * int list * lambda
+  | Llet of  bool * int * lambda * lambda
+  | Lletrec of (int * lambda) list * lambda
+  | Lprim of string * lambda list
+  | Lswitch of lambda * lambda_switch
+  | Lstaticfail
+  | Lcatch of lambda * lambda
+  | Lstaticraise of int * lambda list
+  | Lstaticcatch of lambda * (int * int list) * lambda
+  | Ltrywith of lambda * int * lambda
+  | Lifthenelse of lambda * lambda * lambda
+  | Lsequence of lambda * lambda
+  | Lwhile of lambda * lambda
+  | Lfor of int * lambda * lambda * bool * lambda
+  | Lassign of int * lambda
+  | Lsend of lambda * lambda * lambda list
+  | Levent of lambda * lambda_event
+  | Lifused of int * lambda
+and lambda_switch =
+  { sw_numconsts: int;                  (* Number of integer cases *)
+    sw_consts: (int * lambda) list;     (* Integer cases *)
+    sw_numblocks: int;                  (* Number of tag block cases *)
+    sw_blocks: (int * lambda) list;     (* Tag block cases *)
+    sw_checked: bool ;                  (* True if bound checks needed *)
+    sw_nofail: bool}                    (* True if should not fail *)
+and lambda_event =
+  { lev_loc: int;
+    lev_kind: bool ;
+    lev_repr: int ref option;
+    lev_env: int list }
+
+let rec approx_present v l = true
+
+let rec lower_bind v arg lam = match lam with
+| Lifthenelse (cond, ifso, ifnot) -> 1
+| Lswitch (ls,({sw_consts=[i,act] ; sw_blocks = []} as sw))
+    when not (approx_present v ls) -> 2
+| Lswitch (ls,({sw_consts=[] ; sw_blocks = [i,act]} as sw))
+    when not (approx_present v ls) -> 3
+| Llet (true , vv, lv, l) -> 4
+| _ -> 5
+;;
+
+test "lower_bind" (lower_bind 0 0) (Llet (true,0, Lvar 1, Lvar 2)) 4 ;
+test "lower_bind" (lower_bind 0 0) (Lvar 0) 5 ;
+test "lower_bind" (lower_bind 0 0) (Lifthenelse (Lvar 0, Lvar 1, Lvar 2)) 1
+;;
+
+
+type field_kind =
+    Fvar of field_kind option ref
+  | Fpresent
+  | Fabsent
+
+let unify_kind (k1, k2) =  match k1, k2 with
+    (Fvar r, (Fvar _ | Fpresent))             -> 1
+  | (Fpresent, Fvar r)                        -> 2
+  | (Fpresent, Fpresent)                      -> 3
+  | _                                         -> 4
+
+
+let r = ref (Some Fpresent)
+;;
+
+test "unify"  unify_kind (Fvar r, Fpresent) 1 ;
+test "unify"  unify_kind (Fvar r, Fvar r) 1 ;
+test "unify"  unify_kind (Fvar r, Fabsent) 4 ;
+test "unify"  unify_kind (Fpresent, Fvar r) 2 ;
+test "unify"  unify_kind (Fpresent, Fpresent) 3 ;
+test "unify"  unify_kind (Fabsent, Fpresent) 4 ; ()
+;;
+
+
+type youyou = A | B | C | D of youyou
+
+let foo (k1, k2) = match k1,k2 with
+| D _, (A|D _) -> 1
+| (A|B),D _ -> 2
+| C,_       -> 3
+| _, (A|B|C) -> 4
+;;
+
+test "foo2" foo (D A,A) 1 ;
+test "foo2" foo (D A,B) 4 ;
+test "foo2" foo (A,A) 4 ; ()
+;;
+
+type yaya = A | B
+;;
+
+let yaya = function
+| A,_,_ -> 1
+| _,A,_ -> 2
+| B,B,_ -> 3
+| A,_,(100|103) -> 5
+;;
+
+test "yaya" yaya (A,A,0) 1 ;
+test "yaya" yaya (B,A,0) 2 ;
+test "yaya" yaya (B,B,100) 3 ; ()
+;;
+
+(*
+let yoyo =  function
+| [],_,_ -> 1
+| _,[],_ -> 2
+| _::_,_::_,_ -> 3
+| [],_,(100|103|104) -> 5
+| [],_,(100|103) -> 6
+| [],_,(1000|1001|1002|20000) -> 7
+;;
+
+test "yoyo" yoyo ([],[],0) 1 ;
+test "yoyo" yoyo ([1],[],0) 2 ;
+test "yoyo" yoyo ([1],[1],100) 3 ; ()
+;;
+
+let youyou = function
+  | (100|103|104) -> 1
+  | (100|103|101) -> 2
+  | (1000|1001|1002|20000) -> 3
+  | _ -> -1
+;;
+
+test "youyou" youyou 100 1 ;
+test "youyou" youyou 101 2 ;
+test "youyou" youyou 1000 3
+;;
+*)
+type autre =
+  |  C | D | E of autre | F of autre * autre | H of autre | I | J | K of string
+
+let rec autre = function
+| C,_,_ -> 1
+| _,C,_ -> 2
+| D,D,_ -> 3
+| (D|F (_,_)|H _|K _),_,_ -> 4
+| (_, (D|I|E _|F (_, _)|H _|K _), _) -> 8
+| (J,J,((C|D) as x |E x|F (_,x))) | (J,_,((C|J) as x)) -> autre (x,x,x)
+| (J, J, (I|H _|K _)) -> 9
+| I,_,_ -> 6
+| E _,_,_ -> 7
+;;
+
+test "autre" autre (J,J,F (D,D)) 3 ;
+test "autre" autre (J,J,D) 3 ;
+test "autre" autre (J,J,I) 9 ;
+test "autre" autre (H I,I,I) 4 ;
+test "autre" autre (J,J,H I) 9 ; ()
+;;
+
+
+type youpi = YA | YB | YC
+and hola = X | Y | Z | T of hola | U of hola | V of hola
+
+let xyz = function
+| YA,_,_ -> 1
+| _,YA,_ -> 2
+| YB,YB,_ -> 3
+| ((YB|YC), (YB|YC), (X|Y|Z|V _|T _)) -> 6
+| _,_,(X|U _) -> 8
+| _,_,Y -> 5
+;;
+
+test "xyz" xyz (YC,YC,X) 6 ;
+test "xyz" xyz (YC,YB,U X) 8 ;
+test "xyz" xyz (YB,YC,X) 6 ; ()
+;;
+
+
+(* Ce test est pour le compilo lui-meme *)
+let eq (x,y) = x=y
+;;
+
+test "eq" eq ("coucou", "coucou") true ; ()
+;;
+
+(* Test des gardes, non trivial *)
+
+let is_none = function
+  | None -> true
+  | _ -> false
+
+let garde x = match x with
+| (Some _, _) when is_none (snd x) -> 1
+| (Some (pc, _), Some pc') when pc = pc' -> 2
+| _ -> 3
+;;
+
+test "garde" garde (Some (1,1),None) 1 ;
+test "garde" garde (Some (1,1),Some 1) 2 ;
+test "garde" garde (Some (2,1),Some 1) 3 ; ()
+;;
+
+let orstring = function
+  | ("A"|"B"|"C") -> 2
+  | "D" -> 3
+  | _ -> 4
+;;
+
+test "orstring" orstring "A" 2 ;
+test "orstring" orstring "B" 2 ;
+test "orstring" orstring "C" 2 ;
+test "orstring" orstring "D" 3 ;
+test "orstring" orstring "E" 4 ; ()
+;;
+
+type var_t = [`Variant of [ `Some of string | `None | `Foo] ]
+
+let crash (pat:var_t) =
+      match pat with
+      | `Variant (`Some tag) -> tag
+      | `Variant (`None) -> "none"
+      | _ -> "foo"
+
+;;
+
+test "crash" crash (`Variant `None) "none" ;
+test "crash" crash (`Variant (`Some "coucou")) "coucou" ;
+test "crash" crash (`Variant (`Foo)) "foo" ; ()
+;;
+
+let flatgarde c =
+let x,y = c in
+match x,y with
+| (1,2)|(2,3) when y=2 -> 1
+| (1,_)|(_,3) -> 2
+| _ -> 3
+;;
+
+test "flatgarde" flatgarde (1,2) 1 ;
+test "flatgarde" flatgarde (1,3) 2 ;
+test "flatgarde" flatgarde (2,3) 2 ;
+test "flatgarde" flatgarde (2,4) 3 ; ()
+;;
+
+
+(* Les bugs de jerome *)
+type f =
+  | ABSENT 
+  | FILE
+  | SYMLINK
+  | DIRECTORY
+
+type r =
+  | Unchanged
+  | Deleted
+  | Modified
+  | PropsChanged
+  | Created
+
+let replicaContent2shortString rc =
+    let (typ, status) = rc in
+    match typ, status with
+      _, Unchanged             -> "        "
+    | ABSENT, Deleted         -> "deleted "
+    | FILE, Created           -> "new file"
+    | FILE, Modified          -> "changed "
+    | FILE, PropsChanged      -> "props   "
+    | SYMLINK, Created        -> "new link"
+    | SYMLINK, Modified       -> "chgd lnk"
+    | DIRECTORY, Created      -> "new dir "
+    | DIRECTORY, Modified     -> "chgd dir"
+    | DIRECTORY, PropsChanged -> "props   "
+    (* Cases that can't happen... *)
+
+    | ABSENT, (Created | Modified | PropsChanged)
+    | SYMLINK, PropsChanged
+    | (FILE|SYMLINK|DIRECTORY), Deleted
+                                -> "assert false"
+;;
+
+
+test "jerome_constr" 
+   replicaContent2shortString (ABSENT, Unchanged) "        " ;
+test "jerome_constr" 
+   replicaContent2shortString (ABSENT, Deleted) "deleted " ;
+test "jerome_constr" 
+   replicaContent2shortString (FILE, Modified) "changed " ;
+test "jerome_constr" 
+   replicaContent2shortString (DIRECTORY, PropsChanged) "props   " ;
+test "jerome_constr" 
+   replicaContent2shortString (FILE, Deleted) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (SYMLINK, Deleted) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (SYMLINK, PropsChanged) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (DIRECTORY, Deleted) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (ABSENT, Created) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (ABSENT, Modified) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (ABSENT, PropsChanged) "assert false" ;
+;;
+
+
+let replicaContent2shortString rc =
+    let (typ, status) = rc in
+    match typ, status with
+      _, `Unchanged             -> "        "
+    | `ABSENT, `Deleted         -> "deleted "
+    | `FILE, `Created           -> "new file"
+    | `FILE, `Modified          -> "changed "
+    | `FILE, `PropsChanged      -> "props   "
+    | `SYMLINK, `Created        -> "new link"
+    | `SYMLINK, `Modified       -> "chgd lnk"
+    | `DIRECTORY, `Created      -> "new dir "
+    | `DIRECTORY, `Modified     -> "chgd dir"
+    | `DIRECTORY, `PropsChanged -> "props   "
+    (* Cases that can't happen... *)
+
+    | `ABSENT, (`Created | `Modified | `PropsChanged)
+    | `SYMLINK, `PropsChanged
+    | (`FILE|`SYMLINK|`DIRECTORY), `Deleted
+                                -> "assert false"
+;;
+
+
+test "jerome_constr" 
+   replicaContent2shortString (`ABSENT, `Unchanged) "        " ;
+test "jerome_constr" 
+   replicaContent2shortString (`ABSENT, `Deleted) "deleted " ;
+test "jerome_constr" 
+   replicaContent2shortString (`FILE, `Modified) "changed " ;
+test "jerome_constr" 
+   replicaContent2shortString (`DIRECTORY, `PropsChanged) "props   " ;
+test "jerome_constr" 
+   replicaContent2shortString (`FILE, `Deleted) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (`SYMLINK, `Deleted) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (`SYMLINK, `PropsChanged) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (`DIRECTORY, `Deleted) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (`ABSENT, `Created) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (`ABSENT, `Modified) "assert false" ;
+test "jerome_constr" 
+   replicaContent2shortString (`ABSENT, `PropsChanged) "assert false" ;
+;;
+
+(* bug 319 *)
+
+type ab = A of int | B of int
+type cd = C | D
+
+let ohl = function
+  | (A (p) | B (p)), C -> p
+  | (A (p) | B (p)), D -> p
+;;
+
+test "ohl" ohl (A 0,C) 0 ;
+test "ohl" ohl (B 0,D) 0 ; ()
+;;
+
+(* bug 324 *)
+type pottier =
+  | A
+  | B
+;;
+
+let pottier x =
+  match x with
+  | (( (A, 1) | (B, 2)),A) -> false
+  | _ -> true
+;;
+
+test "pottier" pottier ((B,2),A) false ;
+test "pottier" pottier ((B,2),B) true ;
+test "pottier" pottier ((A,2),A) true ; ()
+;;
+
+(* bug 325 in bytecode compiler *)
+let coquery q =  match q with
+| y,0,([modu;defs]| [defs;modu;_]) -> y+defs-modu
+| _ -> 0
+;;
+
+test "coquery" coquery (1,0,[1 ; 2 ; 3]) 0 ;
+test "coquery" coquery (1,0,[1 ; 2]) 2 ; ()
+;;
+
+(*
+  Two other variable in or-pat tests
+*)
+type vars = A of int | B of (int * int) | C
+;;
+
+
+let vars1 = function
+  | (A x | B (_,x)) -> x
+  | C -> 0
+;;
+
+test "vars1" vars1 (A 1) 1 ;
+test "vars1" vars1 (B (1,2)) 2 ; ()
+;;
+
+let vars2 = function
+  | ([x]|[1 ; x ]|[1 ; 2 ; x]) -> x
+  | _ -> 0
+;;
+
+test"vars2" vars2 [1] 1 ;
+test"vars2" vars2 [1;2] 2 ;
+test"vars2" vars2 [1;2;3] 3 ;
+test"vars2" vars2 [0 ; 0] 0 ; ()
+;;
+
+(* Bug 342 *)
+type eber = {x:int; y: int; z:bool}
+
+let eber = function
+  | {x=a; z=true}
+  | {y=a; z=false} -> a
+;;
+
+test "eber" eber {x=0 ; y=1 ; z=true} 0 ;
+test "eber" eber {x=1 ; y=0 ; z=false} 0 ; ()
+;;
+
+
+(* Enchainement des test d'intervalle *)
+
+let escaped = function
+  | '"' | '\\' | '\n' | '\t' -> 2
+  | c -> 1
+;;
+
+test "escaped" escaped '"' 2 ;
+test "escaped" escaped '\\' 2 ;
+test "escaped" escaped '\n' 2 ;
+test "escaped" escaped '\t' 2 ;
+test "escaped" escaped '\000' 1 ;
+test "escaped" escaped ' ' 1 ;
+test "escaped" escaped '\000' 1 ;
+test "escaped" escaped '[' 1 ;
+test "escaped" escaped ']' 1 ;
+test "escaped" escaped '!' 1 ;
+test "escaped" escaped '#' 1 ;
+()
+;;
+
+(* For compilation speed (due to J. Garigue) *)
+exception Unknown_Reply of int
+
+type command_reply =
+   RPL_TRYAGAIN
+ | RPL_TRACEEND
+ | RPL_TRACELOG
+ | RPL_ADMINEMAIL
+ | RPL_ADMINLOC2
+ | RPL_ADMINLOC1
+ | RPL_ADMINME
+ | RPL_LUSERME
+ | RPL_LUSERCHANNELS
+ | RPL_LUSERUNKNOWN
+ | RPL_LUSEROP
+ | RPL_LUSERCLIENT
+ | RPL_STATSDLINE
+ | RPL_STATSDEBUG
+ | RPL_STATSDEFINE
+ | RPL_STATSBLINE
+ | RPL_STATSPING
+ | RPL_STATSSLINE
+ | RPL_STATSHLINE
+ | RPL_STATSOLINE
+ | RPL_STATSUPTIME
+ | RPL_STATSLLINE
+ | RPL_STATSVLINE
+ | RPL_SERVLISTEND
+ | RPL_SERVLIST
+ | RPL_SERVICE
+ | RPL_ENDOFSERVICES
+ | RPL_SERVICEINFO
+ | RPL_UMODEIS
+ | RPL_ENDOFSTATS
+ | RPL_STATSYLINE
+ | RPL_STATSQLINE
+ | RPL_STATSKLINE
+ | RPL_STATSILINE
+ | RPL_STATSNLINE
+ | RPL_STATSCLINE
+ | RPL_STATSCOMMANDS
+ | RPL_STATSLINKINFO
+ | RPL_TRACERECONNECT
+ | RPL_TRACECLASS
+ | RPL_TRACENEWTYPE
+ | RPL_TRACESERVICE
+ | RPL_TRACESERVER
+ | RPL_TRACEUSER
+ | RPL_TRACEOPERATOR
+ | RPL_TRACEUNKNOWN
+ | RPL_TRACEHANDSHAKE
+ | RPL_TRACECONNECTING
+ | RPL_TRACELINK
+ | RPL_NOUSERS
+ | RPL_ENDOFUSERS
+ | RPL_USERS
+ | RPL_USERSSTART
+ | RPL_TIME
+ | RPL_NOTOPERANYMORE
+ | RPL_MYPORTIS
+ | RPL_YOURESERVICE
+ | RPL_REHASHING
+ | RPL_YOUREOPER
+ | RPL_ENDOFMOTD
+ | RPL_MOTDSTART
+ | RPL_ENDOFINFO
+ | RPL_INFOSTART
+ | RPL_MOTD
+ | RPL_INFO
+ | RPL_ENDOFBANLIST
+ | RPL_BANLIST
+ | RPL_ENDOFLINKS
+ | RPL_LINKS
+ | RPL_CLOSEEND
+ | RPL_CLOSING
+ | RPL_KILLDONE
+ | RPL_ENDOFNAMES
+ | RPL_NAMREPLY
+ | RPL_ENDOFWHO
+ | RPL_WHOREPLY
+ | RPL_VERSION
+ | RPL_SUMMONING
+ | RPL_INVITING
+ | RPL_TOPIC
+ | RPL_NOTOPIC
+ | RPL_CHANNELMODEIS
+ | RPL_LISTEND
+ | RPL_LIST
+ | RPL_LISTSTART
+ | RPL_WHOISCHANNELS
+ | RPL_ENDOFWHOIS
+ | RPL_WHOISIDLE
+ | RPL_WHOISCHANOP
+ | RPL_ENDOFWHOWAS
+ | RPL_WHOWASUSER
+ | RPL_WHOISOPERATOR
+ | RPL_WHOISSERVER
+ | RPL_WHOISUSER
+ | RPL_NOWAWAY
+ | RPL_UNAWAY
+ | RPL_TEXT
+ | RPL_ISON
+ | RPL_USERHOST
+ | RPL_AWAY
+ | RPL_NONE
+
+let get_command_reply n =
+match n with
+   263    ->     RPL_TRYAGAIN
+ | 319    ->     RPL_WHOISCHANNELS
+ | 318    ->     RPL_ENDOFWHOIS
+ | 317    ->     RPL_WHOISIDLE
+ | 316    ->     RPL_WHOISCHANOP
+ | 369    ->     RPL_ENDOFWHOWAS
+ | 314    ->     RPL_WHOWASUSER
+ | 313    ->     RPL_WHOISOPERATOR
+ | 312    ->     RPL_WHOISSERVER
+ | 311    ->     RPL_WHOISUSER
+ | 262    ->     RPL_TRACEEND
+ | 261    ->     RPL_TRACELOG
+ | 259    ->     RPL_ADMINEMAIL
+ | 258    ->     RPL_ADMINLOC2
+ | 257    ->     RPL_ADMINLOC1
+ | 256    ->     RPL_ADMINME
+ | 255    ->     RPL_LUSERME
+ | 254    ->     RPL_LUSERCHANNELS
+ | 253    ->     RPL_LUSERUNKNOWN
+ | 252    ->     RPL_LUSEROP
+ | 251    ->     RPL_LUSERCLIENT
+ | 250    ->     RPL_STATSDLINE
+ | 249    ->     RPL_STATSDEBUG
+ | 248    ->     RPL_STATSDEFINE
+ | 247    ->     RPL_STATSBLINE
+ | 246    ->     RPL_STATSPING
+ | 245    ->     RPL_STATSSLINE
+ | 244    ->     RPL_STATSHLINE
+ | 243    ->     RPL_STATSOLINE
+ | 242    ->     RPL_STATSUPTIME
+ | 241    ->     RPL_STATSLLINE
+ | 240    ->     RPL_STATSVLINE
+ | 235    ->     RPL_SERVLISTEND
+ | 234    ->     RPL_SERVLIST
+ | 233    ->     RPL_SERVICE
+ | 232    ->     RPL_ENDOFSERVICES
+ | 231    ->     RPL_SERVICEINFO
+ | 221    ->     RPL_UMODEIS
+ | 219    ->     RPL_ENDOFSTATS
+ | 218    ->     RPL_STATSYLINE
+ | 217    ->     RPL_STATSQLINE
+ | 216    ->     RPL_STATSKLINE
+ | 215    ->     RPL_STATSILINE
+ | 214    ->     RPL_STATSNLINE
+ | 213    ->     RPL_STATSCLINE
+ | 212    ->     RPL_STATSCOMMANDS
+ | 211    ->     RPL_STATSLINKINFO
+ | 210    ->     RPL_TRACERECONNECT
+ | 209    ->     RPL_TRACECLASS
+ | 208    ->     RPL_TRACENEWTYPE
+ | 207    ->     RPL_TRACESERVICE
+ | 206    ->     RPL_TRACESERVER
+ | 205    ->     RPL_TRACEUSER
+ | 204    ->     RPL_TRACEOPERATOR
+ | 203    ->     RPL_TRACEUNKNOWN
+ | 202    ->     RPL_TRACEHANDSHAKE
+ | 201    ->     RPL_TRACECONNECTING
+ | 200    ->     RPL_TRACELINK
+ | 395    ->     RPL_NOUSERS
+ | 394    ->     RPL_ENDOFUSERS
+ | 393    ->     RPL_USERS
+ | 392    ->     RPL_USERSSTART
+ | 391    ->     RPL_TIME
+ | 385    ->     RPL_NOTOPERANYMORE
+ | 384    ->     RPL_MYPORTIS
+ | 383    ->     RPL_YOURESERVICE
+ | 382    ->     RPL_REHASHING
+ | 381    ->     RPL_YOUREOPER
+ | 376    ->     RPL_ENDOFMOTD
+ | 375    ->     RPL_MOTDSTART
+ | 374    ->     RPL_ENDOFINFO
+ | 373    ->     RPL_INFOSTART
+ | 372    ->     RPL_MOTD
+ | 371    ->     RPL_INFO
+ | 368    ->     RPL_ENDOFBANLIST
+ | 367    ->     RPL_BANLIST
+ | 365    ->     RPL_ENDOFLINKS
+ | 364    ->     RPL_LINKS
+ | 363    ->     RPL_CLOSEEND
+ | 362    ->     RPL_CLOSING
+ | 361    ->     RPL_KILLDONE
+ | 366    ->     RPL_ENDOFNAMES
+ | 353    ->     RPL_NAMREPLY
+ | 315    ->     RPL_ENDOFWHO
+ | 352    ->     RPL_WHOREPLY
+ | 351    ->     RPL_VERSION
+ | 342    ->     RPL_SUMMONING
+ | 341    ->     RPL_INVITING
+ | 332    ->     RPL_TOPIC
+ | 331    ->     RPL_NOTOPIC
+ | 324    ->     RPL_CHANNELMODEIS
+ | 323    ->     RPL_LISTEND
+ | 322    ->     RPL_LIST
+ | 321    ->     RPL_LISTSTART
+ | 306    ->     RPL_NOWAWAY
+ | 305    ->     RPL_UNAWAY
+ | 304    ->     RPL_TEXT
+ | 303    ->     RPL_ISON
+ | 302    ->     RPL_USERHOST
+ | 301    ->     RPL_AWAY
+ | 300    ->     RPL_NONE
+ | _ -> raise (Unknown_Reply n)
+
+(* Bug 454 *)
+type  habert_a=
+  | A of habert_c
+  | B of habert_c
+  
+and habert_c= {lvar:int; lassoc: habert_c;lnb:int} 
+  
+  
+let habert=function
+  | (A {lnb=i}|B {lnb=i}) when i=0 -> 1
+  | A {lassoc=({lnb=j});lnb=i} -> 2
+  | _ -> 3
+;;
+
+let rec ex0 = {lvar=0 ; lnb=0 ; lassoc=ex1}
+and ex1 = {lvar=1 ; lnb=1 ; lassoc=ex0} in
+
+test "habert" habert (A ex0) 1 ;
+test "habert" habert (B ex0) 1 ;
+test "habert" habert (A ex1) 2 ;
+test "habert" habert (B ex1) 3 ;
+
+(* Problems with interval test in arithmetic mod 2^31, bug #359 *)
+(* From manuel Fahndrich *)
+
+type type_expr = [
+  | `TTuple of type_expr list
+  | `TConstr of type_expr list
+  | `TVar of string
+  | `TVariant of string list
+  | `TBlock of int
+  | `TCopy of type_expr
+  ] 
+
+and recurs_type_expr = [
+  | `TTuple of type_expr list
+  | `TConstr of type_expr list
+  | `TVariant of string list
+  ] 
+
+
+let rec maf te =
+    match te with
+    | `TCopy te -> 1
+    | `TVar _ -> 2
+    | `TBlock _ -> 2
+    | #recurs_type_expr as desc ->
+
+        let te =
+          (match desc with
+            `TTuple tl ->
+              4
+          | `TConstr tl ->
+              5
+          | `TVariant (row) ->
+              6
+                )
+        in
+
+        te
+;;
+
+let base = `TBlock 0
+;;
+
+test "maf" maf (`TCopy base) 1 ;
+test "maf" maf (`TVar "test") 2 ;
+test "maf" maf (`TBlock 0) 2 ;
+test "maf" maf (`TTuple []) 4 ;
+test "maf" maf (`TConstr []) 5 ;
+test "maf" maf (`TVariant []) 6
+;;
+
+(* PR#1310
+  Using ``get_args'' in place or an ad-hoc ``matcher'' function for tuples.
+  Has made the compiler [3.05] to fail.
+*)
+type t_seb = Uin | Uout
+;;
+
+let rec seb = function
+  | ((i, Uin) | (i, Uout)), Uout -> 1
+  | ((j, Uin) | (j, Uout)), Uin ->  2
+;;
+
+test "seb" seb ((0,Uin),Uout) 1 ;
+test "seb" seb ((0,Uout),Uin) 2 ;
+()
+;;
+
+(* Talk with Jacques
+     - type 'b is still open ??
+     - better case generation, accept intervals of size 1 when ok_inter is
+       false (in Switch)
+*)
+
+(*
+File "morematch.ml", line 1060, characters 8-65:
+Warning: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+A `D
+*)
+type ('a, 'b) t_j = A of 'a | B of 'b * 'a | C
+
+let f = function
+  | A (`A|`C) -> 0
+  | B (`B,`D) -> 1
+  | C -> 2
+
+let g x = try f x with Match_failure _ -> 3
+
+let _ =
+  test "jacques" g (A `A) 0 ;
+  test "jacques" g (A `C) 0 ;
+  test "jacques" g (B (`B,`D)) 1 ;
+  test "jacaues" g C 2 ;
+(*  test "jacques" g (B (`A,`D)) 3 ; (* type incorrect expected behavior ? *)*)
+  ()
+
+(*
+  Compilation bug, segfault, because of incorrect compilation
+  of unused match case .. -> "11"
+*)
+
+type t_l = A | B
+
+let f = function
+  |  _, _, _, _, _, _, _, _, _, _, _, _, _, B, _, _ -> "0"
+  |  _, _, _, B, A, _, _, _, _, _, _, _, _, _, _, _ -> "1"
+  |  _, _, _, B, _, A, _, _, A, _, _, _, _, _, _, _ -> "2"
+  |  _, _, _, _, _, _, _, _, _, _, B, A, _, A, _, _ -> "3"
+  |  _, _, _, _, _, _, _, B, _, _, _, _, B, _, A, A -> "4"
+  |  A, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ -> "5"
+  |  _, _, _, _, _, _, _, B, _, B, _, _, _, _, _, _ -> "6"
+  |  _, B, _, _, _, _, _, _, _, _, _, _, _, _, _, _ -> "7"
+  |  _, A, A, _, A, _, B, _, _, _, _, _, _, _, _, B -> "8"
+  |  _, _, _, _, B, _, _, _, _, _, _, _, _, _, B, _ -> "9"
+  |  _, _, _, _, _, _, _, _, _, _, _, B, _, _, _, _ -> "10"
+  |  _, _, _, _, _, A, _, _, _, _, B, _, _, _, _, _ -> "11"
+  |  B, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ -> "12"
+  |  _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ -> "13"
+
+(*
+File "morematch.ml", line 1094, characters 5-51:
+Warning: this match case is unused.
+File "morematch.ml", line 1096, characters 5-51:
+Warning: this match case is unused.
+*)
+let _  =
+  test "luc"  f (B, A, A, A, A, A, A, A, A, A, A, B, A, A, A, A) "10" ;
+  test "luc"  f (B, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A) "12" ;
+ ()
+
+(*
+  By Gilles Peskine, compilation raised some assert false i make_failactionneg
+*)
+
+type bg = [
+  | `False
+  | `True
+  ]
+  
+type vg = [
+  | `A
+  | `B
+  | `U of int
+  | `V of int
+  ]
+
+type tg = {
+    v : vg;
+    x : bg;
+  }
+
+let predg x = true 
+
+let rec gilles o = match o with
+  | {v = (`U data | `V data); x = `False} when predg o -> 1
+  | {v = (`A|`B) ; x = `False}
+  | {v = (`U _ | `V _); x = `False}
+  | {v = _ ; x = `True}
+    -> 2
diff --git a/test/Moretest/multdef.ml b/test/Moretest/multdef.ml
new file mode 100644 (file)
index 0000000..ac5f488
--- /dev/null
@@ -0,0 +1,2 @@
+let f x = x + 1
+external g : string -> int = "int_of_string"
diff --git a/test/Moretest/multdef.mli b/test/Moretest/multdef.mli
new file mode 100644 (file)
index 0000000..8d67a54
--- /dev/null
@@ -0,0 +1,3 @@
+val f : int -> int
+val f : int -> int
+val g : string -> int
diff --git a/test/Moretest/patmatch.ml b/test/Moretest/patmatch.ml
new file mode 100644 (file)
index 0000000..0077e77
--- /dev/null
@@ -0,0 +1,78 @@
+(* Tests for matchings on integers and characters *)
+
+(* Dense integer switch *)
+
+let f = function 1 -> 1 | 2 -> 2 | 3 -> 3 | 4 -> 4 | 5 -> 5 | 6 -> 6 | _ -> 0
+
+(* Sparse integer switch *)
+
+let g = function 303 -> 1 | 401 -> 2 | _ -> 0
+
+(* Very sparse integer switch *)
+
+let iszero = function 0 -> true | _ -> false
+
+(* Simple matching on characters *)
+
+let h = function
+    'a' -> "a"
+  | 'e' -> "e"
+  | 'i' -> "i"
+  | 'o' -> "o"
+  | 'u' -> "u"
+  | _ -> "?"
+
+(* Matching with orpats *)
+
+let k = function
+    ' ' | '\t' | '\n' | '\r' -> "blk"
+  | 'A'..'Z' | 'a'..'z' | '\192'..'\255' -> "letr"
+  | '0'..'9' -> "dig"
+  | '!'|'%'|'&'|'$'|'#'|'+'|'/'|':'|'<'|'='|'>'|'?'|'@'|'\\'|
+             '~'|'^'|'|'|'*' -> "oper"
+  | _ -> "othr"
+
+(* Matching on arrays *)
+
+let p = function [| x |] -> x | _ -> assert false
+
+let q = function [| x |] -> x | _ -> 0
+
+let r = function [| x |] -> x | _ -> 0.0
+
+let l = function
+    [||] -> 0
+  | [|x|] -> x + 1
+  | [|x;y|] -> x + y
+  | [|x;y;z|] -> x + y + z
+
+(* The test *)
+
+open Printf
+
+let _ =
+  for i = -5 to 10 do printf "f(%d) = %d\n" i (f i) done;
+  List.iter (fun i -> printf "g(%d) = %d\n" i (g i))
+            [0;300;303;305;400;401;402;999];
+  for i = -2 to 2 do printf "iszero(%d) = %B\n" i (iszero i) done;
+  for i = 97 to 126 do
+    let c = Char.chr i in
+    printf "h(%c) = %s\n" c (h c)
+  done;
+  for i = 0 to 255 do
+    let c = Char.chr i in
+    printf "k(%s) = %s\t" (Char.escaped c) (k c)
+  done;
+  printf "\n";
+  printf "p([|\"hello\"|]) = %s\n" (p [|"hello"|]);
+  printf "p([|1.0|]) = %f\n" (p [|1.0|]);
+  printf "q([|2|]) = %d\n" (q [|2|]);
+  printf "r([|3.0|]) = %f\n" (r [|3.0|]);
+  printf "l([||]) = %d\n" (l [||]);
+  printf "l([|1|]) = %d\n" (l [|1|]);
+  printf "l([|2;3|]) = %d\n" (l [|2;3|]);
+  printf "l([|4;5;6|]) = %d\n" (l [|4;5;6|]);
+  exit 0
+
+
+
diff --git a/test/Moretest/recmod.ml b/test/Moretest/recmod.ml
new file mode 100644 (file)
index 0000000..1573ef0
--- /dev/null
@@ -0,0 +1,534 @@
+(* Tests for recursive modules *)
+
+let test number result expected =
+  if result = expected
+  then Printf.printf "Test %d passed.\n" number
+  else Printf.printf "Test %d FAILED.\n" number;
+  flush stdout
+
+(* Tree of sets *)
+
+module rec A
+ : sig
+     type t = Leaf of int | Node of ASet.t
+     val compare: t -> t -> int
+   end
+ = struct
+     type t = Leaf of int | Node of ASet.t
+     let compare x y =
+       match (x,y) with
+         (Leaf i, Leaf j) -> Pervasives.compare i j
+       | (Leaf i, Node t) -> -1
+       | (Node s, Leaf j) -> 1
+       | (Node s, Node t) -> ASet.compare s t
+   end
+
+and ASet : Set.S with type elt = A.t = Set.Make(A)
+;;
+
+let _ =
+  let x = A.Node (ASet.add (A.Leaf 3) (ASet.singleton (A.Leaf 2))) in
+  let y = A.Node (ASet.add (A.Leaf 1) (ASet.singleton x)) in
+  test 10 (A.compare x x) 0;
+  test 11 (A.compare x (A.Leaf 3)) 1;
+  test 12 (A.compare (A.Leaf 0) x) (-1);
+  test 13 (A.compare y y) 0;
+  test 14 (A.compare x y) 1
+;;
+
+(* Simple value recursion *)
+
+module rec Fib
+  : sig val f : int -> int end
+  = struct let f x = if x < 2 then 1 else Fib.f(x-1) + Fib.f(x-2) end
+;;
+
+let _ =
+  test 20 (Fib.f 10) 89
+;;
+
+(* Update function by infix *)
+
+module rec Fib2
+  : sig val f : int -> int end
+  = struct let rec g x = Fib2.f(x-1) + Fib2.f(x-2)
+               and f x = if x < 2 then 1 else g x
+    end
+;;
+
+let _ =
+  test 21 (Fib2.f 10) 89
+;;
+
+(* Early application *)
+
+(*
+module rec Bad
+  : sig val f : int -> int end
+  = struct let f = let y = Bad.f 5 in fun x -> x+y end
+;;
+*)
+
+let _ =
+  let res =
+    try
+      let module A =
+        struct
+          module rec Bad
+            : sig val f : int -> int end
+            = struct let f = let y = Bad.f 5 in fun x -> x+y end
+          end in
+      false
+    with Undefined_recursive_module _ ->
+      true in
+  test 30 res true
+;;
+
+(*
+module rec Cyclic
+  : sig val x : int end
+  = struct let x = Cyclic.x + 1 end
+;;
+*)
+
+(* Reordering of evaluation based on dependencies *)
+
+module rec After
+  : sig val x : int end
+  = struct let x = Before.x + 1 end
+and Before
+  : sig val x : int end
+  = struct let x = 3 end
+;;
+
+let _ =
+  test 40 After.x 4
+;;
+
+(* Type identity between A.t and t within A's definition *)
+
+module rec Strengthen
+  : sig type t val f : t -> t end
+  = struct
+      type t = A | B
+      let _ = (A : Strengthen.t)
+      let f x = if true then A else Strengthen.f B
+    end
+;;
+
+module rec Strengthen2
+  : sig type t 
+        val f : t -> t
+        module M : sig type u end
+        module R : sig type v end
+    end
+  = struct
+      type t = A | B
+      let _ = (A : Strengthen2.t)
+      let f x = if true then A else Strengthen2.f B
+      module M =
+        struct
+          type u = C
+          let _ = (C: Strengthen2.M.u)
+        end
+      module rec R : sig type v  = Strengthen2.R.v end =
+        struct
+          type v = D
+          let _ = (D : R.v)
+          let _ = (D : Strengthen2.R.v)
+        end
+    end
+;;
+
+(* Polymorphic recursion *)
+
+module rec PolyRec
+  : sig
+      type 'a t = Leaf of 'a | Node of 'a list t * 'a list t
+      val depth: 'a t -> int
+    end
+  = struct
+      type 'a t = Leaf of 'a | Node of 'a list t * 'a list t
+      let x = (PolyRec.Leaf 1 : int t)
+      let depth = function
+        Leaf x -> 0
+      | Node(l,r) -> 1 + max (PolyRec.depth l) (PolyRec.depth r)
+    end
+;;
+  
+(* Expressions and bindings *)
+
+module StringSet = Set.Make(String);;
+
+module rec Expr
+  : sig
+      type t =
+        Var of string
+      | Const of int
+      | Add of t * t
+      | Binding of Binding.t * t
+      val make_let: string -> t -> t -> t
+      val fv: t -> StringSet.t
+      val simpl: t -> t
+    end
+  = struct
+      type t =
+        Var of string
+      | Const of int
+      | Add of t * t
+      | Binding of Binding.t * t
+      let make_let id e1 e2 = Binding([id, e1], e2)
+      let rec fv = function
+        Var s -> StringSet.singleton s
+      | Const n -> StringSet.empty
+      | Add(t1,t2) -> StringSet.union (fv t1) (fv t2)
+      | Binding(b,t) ->
+          StringSet.union (Binding.fv b)
+            (StringSet.diff (fv t) (Binding.bv b))
+      let rec simpl = function
+        Var s -> Var s
+      | Const n -> Const n
+      | Add(Const i, Const j) -> Const (i+j)
+      | Add(Const 0, t) -> simpl t
+      | Add(t, Const 0) -> simpl t
+      | Add(t1,t2) -> Add(simpl t1, simpl t2)
+      | Binding(b, t) -> Binding(Binding.simpl b, simpl t)
+    end
+
+and Binding
+  : sig
+      type t = (string * Expr.t) list
+      val fv: t -> StringSet.t
+      val bv: t -> StringSet.t    
+      val simpl: t -> t
+    end
+  = struct
+      type t = (string * Expr.t) list
+      let fv b =
+        List.fold_left (fun v (id,e) -> StringSet.union v (Expr.fv e))
+                       StringSet.empty b
+      let bv b =
+        List.fold_left (fun v (id,e) -> StringSet.add id v)
+                       StringSet.empty b
+      let simpl b =
+        List.map (fun (id,e) -> (id, Expr.simpl e)) b
+    end
+;;
+
+let _ =
+  let e = Expr.make_let "x" (Expr.Add (Expr.Var "y", Expr.Const 0))
+                            (Expr.Var "x") in
+  let e' = Expr.make_let "x" (Expr.Var "y") (Expr.Var "x") in
+  test 50 (StringSet.elements (Expr.fv e)) ["y"];
+  test 51 (Expr.simpl e) e'
+;;
+
+(* Okasaki's bootstrapping *)
+
+module type ORDERED =
+  sig
+    type t
+    val eq: t -> t -> bool
+    val lt: t -> t -> bool
+    val leq: t -> t -> bool
+  end
+
+module type HEAP =
+  sig
+    module Elem: ORDERED
+    type heap
+    val empty: heap
+    val isEmpty: heap -> bool
+    val insert: Elem.t -> heap -> heap
+    val merge: heap -> heap -> heap
+    val findMin: heap -> Elem.t
+    val deleteMin: heap -> heap
+  end
+
+module Bootstrap (MakeH: functor (Element:ORDERED) -> 
+                                    HEAP with module Elem = Element)
+                 (Element: ORDERED) : HEAP with module Elem = Element =
+  struct
+    module Elem = Element
+    module rec BE
+    : sig type t = E | H of Elem.t * PrimH.heap
+          val eq: t -> t -> bool
+          val lt: t -> t -> bool
+          val leq: t -> t -> bool
+      end                  
+    = struct
+        type t = E | H of Elem.t * PrimH.heap
+        let leq (H(x, _)) (H(y, _)) = Elem.leq x y
+        let eq (H(x, _)) (H(y, _)) = Elem.eq x y
+        let lt (H(x, _)) (H(y, _)) = Elem.lt x y
+      end
+    and PrimH
+    : HEAP with type Elem.t = BE.t
+    = MakeH(BE)
+    type heap = BE.t
+    let empty = BE.E
+    let isEmpty = function BE.E -> true | _ -> false
+    let rec merge x y =
+      match (x,y) with
+        (BE.E, _) -> y
+      | (_, BE.E) -> x
+      | (BE.H(e1,p1) as h1), (BE.H(e2,p2) as h2) ->
+          if Elem.leq e1 e2
+          then BE.H(e1, PrimH.insert h2 p1)
+          else BE.H(e2, PrimH.insert h1 p2)
+    let insert x h =
+      merge (BE.H(x, PrimH.empty)) h
+    let findMin = function
+        BE.E -> raise Not_found
+      | BE.H(x, _) -> x
+    let deleteMin = function
+        BE.E -> raise Not_found
+      | BE.H(x, p) ->
+          if PrimH.isEmpty p then BE.E else begin
+            let (BE.H(y, p1)) = PrimH.findMin p in
+            let p2 = PrimH.deleteMin p in
+            BE.H(y, PrimH.merge p1 p2)
+          end
+  end
+;;
+
+module LeftistHeap(Element: ORDERED): HEAP with module Elem = Element =
+  struct
+    module Elem = Element
+    type heap = E | T of int * Elem.t * heap * heap
+    let rank = function E -> 0 | T(r,_,_,_) -> r
+    let make x a b =
+      if rank a >= rank b
+      then T(rank b + 1, x, a, b)
+      else T(rank a + 1, x, b, a)
+    let empty = E
+    let isEmpty = function E -> true | _ -> false
+    let rec merge h1 h2 =
+      match (h1, h2) with
+        (_, E) -> h1
+      | (E, _) -> h2
+      | (T(_, x1, a1, b1), T(_, x2, a2, b2)) ->
+          if Elem.leq x1 x2
+          then make x1 a1 (merge b1 h2)
+          else make x2 a2 (merge h1 b2)
+    let insert x h = merge (T(1, x, E, E)) h
+    let findMin = function
+      E -> raise Not_found
+    | T(_, x, _, _) -> x
+    let deleteMin = function
+      E -> raise Not_found
+    | T(_, x, a, b) -> merge a b
+  end
+;;
+
+module Ints =
+  struct
+    type t = int
+    let eq = (=)
+    let lt = (<)
+    let leq = (<=)
+  end
+;;
+
+module C = Bootstrap(LeftistHeap)(Ints);;
+
+let _ =
+  let h = List.fold_right C.insert [6;4;8;7;3;1] C.empty in
+  test 60 (C.findMin h) 1;
+  test 61 (C.findMin (C.deleteMin h)) 3;
+  test 62 (C.findMin (C.deleteMin (C.deleteMin h))) 4
+;;
+
+(* Classes *)
+
+module rec Class1
+  : sig
+      class c : object method m : int -> int end
+    end
+  = struct
+      class c =
+        object
+          method m x = if x <= 0 then x else (new Class2.d)#m x
+        end
+    end
+and Class2
+  : sig
+      class d : object method m : int -> int end
+    end
+  = struct
+      class d =
+        object(self)
+          inherit Class1.c as super
+          method m (x:int) = super#m 0
+        end
+    end
+;;
+
+let _ =
+  test 70 ((new Class1.c)#m 7) 0
+;;
+
+let _ =
+  try
+    let module A = struct
+       module rec BadClass1
+         : sig
+             class c : object method m : int end
+           end
+         = struct
+             class c = object method m = 123 end
+           end
+       and BadClass2
+         : sig
+             val x: int
+           end
+         = struct
+             let x = (new BadClass1.c)#m
+           end
+    end in
+      test 71 true false
+  with Undefined_recursive_module _ ->
+    test 71 true true
+;;
+
+(* Coercions *)
+
+module rec Coerce1
+  : sig
+      val g: int -> int
+      val f: int -> int
+    end
+  = struct
+      module A = (Coerce1: sig val f: int -> int end)
+      let g x = x
+      let f x = if x <= 0 then 1 else A.f (x-1) * x
+    end 
+;;
+
+let _ =
+  test 80 (Coerce1.f 10) 3628800
+;;
+
+module CoerceF(S: sig end) = struct
+  let f1 () = 1
+  let f2 () = 2
+  let f3 () = 3
+  let f4 () = 4
+  let f5 () = 5
+end
+
+module rec Coerce2: sig val f1: unit -> int end = CoerceF(Coerce3)
+       and Coerce3: sig end = struct end
+;;
+
+let _ =
+  test 81 (Coerce2.f1 ()) 1
+;;
+
+module Coerce4(A : sig val f : int -> int end) = struct
+  let x = 0
+  let at a = A.f a
+end
+
+module rec Coerce5
+  : sig val blabla: int -> int val f: int -> int end 
+  = struct let blabla x = 0 let f x = 5 end
+and Coerce6
+  : sig val at: int -> int end
+  = Coerce4(Coerce5)
+
+let _ =
+  test 82 (Coerce6.at 100) 5
+;;
+
+(* Miscellaneous bug reports *)
+
+module rec F 
+  : sig type t = X of int | Y of int
+        val f: t -> bool
+    end
+  = struct
+      type t = X of int | Y of int  
+      let f = function
+        | X _ -> false
+        | _ -> true
+    end;; 
+
+let _ =
+  test 100 (F.f (F.X 1)) false;
+  test 101 (F.f (F.Y 2)) true
+
+(** Ill-formed type abbreviations.  *)
+
+(**
+
+(* Bad (t = t) *)
+module rec A : sig type t = A.t end = struct type t = A.t end;;
+
+(* Bad (t = t) *)
+module rec A : sig type t = B.t end = struct type t = B.t end
+       and B : sig type t = A.t end = struct type t = A.t end;;
+
+(* OK (t = int) *)
+module rec A : sig type t = B.t end = struct type t = B.t end
+       and B : sig type t = int end = struct type t = int end;;
+
+(* Bad (t = int * t) *)
+module rec A : sig type t = int * A.t end = struct type t = int * A.t end;;
+
+(* Bad (t = t -> int) *)
+module rec A : sig type t = B.t -> int end = struct type t = B.t -> int end
+       and B : sig type t = A.t end = struct type t = A.t end;;
+
+(* OK (t = <m:t>) *)
+module rec A : sig type t = <m:B.t> end = struct type t = <m:B.t> end
+       and B : sig type t = A.t end = struct type t = A.t end;;
+
+(* Bad (not regular) *)
+module rec A : sig type 'a t = <m: 'a list A.t> end
+             = struct type 'a t = <m: 'a list A.t> end;;
+
+(* Bad (not regular) *)
+module rec A : sig type 'a t = <m: 'a list B.t; n: 'a array B.t> end
+             = struct type 'a t = <m: 'a list B.t; n: 'a array B.t> end
+       and B : sig type 'a t = 'a A.t end = struct type 'a t = 'a A.t end;;
+
+(* Bad (not regular) *)
+module rec A : sig type 'a t = 'a B.t end
+             = struct type 'a t = 'a B.t end
+       and B : sig type 'a t = <m: 'a list A.t; n: 'a array A.t> end
+             = struct type 'a t = <m: 'a list A.t; n: 'a array A.t> end;;
+
+(* OK *)
+module rec A : sig type 'a t = 'a array B.t * 'a list B.t end
+             = struct type 'a t = 'a array B.t * 'a list B.t end
+       and B : sig type 'a t = <m: 'a B.t> end
+             = struct type 'a t = <m: 'a B.t> end;;
+
+(* Bad (not regular) *)
+module rec A : sig type 'a t = 'a list B.t end
+             = struct type 'a t = 'a list B.t end
+       and B : sig type 'a t = <m: 'a array B.t> end
+             = struct type 'a t = <m: 'a array B.t> end;;
+
+(* Bad (not regular) *)
+module rec M :
+    sig
+      class ['a] c : 'a -> object
+        method map : ('a -> 'b) -> 'b M.c
+      end
+    end
+  = struct
+      class ['a] c (x : 'a) = object
+        method map : 'b. ('a -> 'b) -> 'b M.c
+          = fun f -> new M.c (f x)
+      end
+    end;;
+
+(* OK *)
+class type [ 'node ] extension = object method node : 'node end
+class type [ 'ext ] node = object constraint 'ext = 'ext node #extension end 
+class x = object method node : x node = assert false end
+type t = x node;;
+
+**)
diff --git a/test/Moretest/recmod.mli b/test/Moretest/recmod.mli
new file mode 100644 (file)
index 0000000..6c1fad3
--- /dev/null
@@ -0,0 +1,134 @@
+module rec A :
+  sig type t = Leaf of int | Node of ASet.t val compare : t -> t -> int end
+and ASet : Set.S with type elt = A.t
+module Fib : sig val f : int -> int end
+module After : sig val x : int end
+module Before : sig val x : int end
+module Strengthen : sig type t val f : t -> t end
+module Strengthen2 :
+  sig
+    type t
+    val f : t -> t
+    module M : sig type u end
+    module R : sig type v end
+  end
+module PolyRec :
+  sig
+    type 'a t = Leaf of 'a | Node of 'a list t * 'a list t
+    val depth : 'a t -> int
+  end
+module StringSet : Set.S with type elt = string
+module rec Expr :
+  sig
+    type t =
+        Var of string
+      | Const of int
+      | Add of t * t
+      | Binding of Binding.t * t
+    val make_let : string -> t -> t -> t
+    val fv : t -> StringSet.t
+    val simpl : t -> t
+  end
+and Binding :
+  sig
+    type t = (string * Expr.t) list
+    val fv : t -> StringSet.t
+    val bv : t -> StringSet.t
+    val simpl : t -> t
+  end
+module type ORDERED =
+  sig
+    type t
+    val eq : t -> t -> bool
+    val lt : t -> t -> bool
+    val leq : t -> t -> bool
+  end
+module type HEAP =
+  sig
+    module Elem : ORDERED
+    type heap
+    val empty : heap
+    val isEmpty : heap -> bool
+    val insert : Elem.t -> heap -> heap
+    val merge : heap -> heap -> heap
+    val findMin : heap -> Elem.t
+    val deleteMin : heap -> heap
+  end
+module Bootstrap :
+  functor
+    (MakeH : functor (Element : ORDERED) ->
+               sig
+                 module Elem :
+                   sig
+                     type t = Element.t
+                     val eq : t -> t -> bool
+                     val lt : t -> t -> bool
+                     val leq : t -> t -> bool
+                   end
+                 type heap
+                 val empty : heap
+                 val isEmpty : heap -> bool
+                 val insert : Elem.t -> heap -> heap
+                 val merge : heap -> heap -> heap
+                 val findMin : heap -> Elem.t
+                 val deleteMin : heap -> heap
+               end) ->
+    functor (Element : ORDERED) ->
+      sig
+        module Elem :
+          sig
+            type t = Element.t
+            val eq : t -> t -> bool
+            val lt : t -> t -> bool
+            val leq : t -> t -> bool
+          end
+        type heap
+        val empty : heap
+        val isEmpty : heap -> bool
+        val insert : Elem.t -> heap -> heap
+        val merge : heap -> heap -> heap
+        val findMin : heap -> Elem.t
+        val deleteMin : heap -> heap
+      end
+module LeftistHeap :
+  functor (Element : ORDERED) ->
+    sig
+      module Elem :
+        sig
+          type t = Element.t
+          val eq : t -> t -> bool
+          val lt : t -> t -> bool
+          val leq : t -> t -> bool
+        end
+      type heap
+      val empty : heap
+      val isEmpty : heap -> bool
+      val insert : Elem.t -> heap -> heap
+      val merge : heap -> heap -> heap
+      val findMin : heap -> Elem.t
+      val deleteMin : heap -> heap
+    end
+module Ints :
+  sig
+    type t = int
+    val eq : 'a -> 'a -> bool
+    val lt : 'a -> 'a -> bool
+    val leq : 'a -> 'a -> bool
+  end
+module C :
+  sig
+    module Elem :
+      sig
+        type t = Ints.t
+        val eq : t -> t -> bool
+        val lt : t -> t -> bool
+        val leq : t -> t -> bool
+      end
+    type heap = Bootstrap(LeftistHeap)(Ints).heap
+    val empty : heap
+    val isEmpty : heap -> bool
+    val insert : Elem.t -> heap -> heap
+    val merge : heap -> heap -> heap
+    val findMin : heap -> Elem.t
+    val deleteMin : heap -> heap
+  end
diff --git a/test/Moretest/recvalues.ml b/test/Moretest/recvalues.ml
new file mode 100644 (file)
index 0000000..c00ced8
--- /dev/null
@@ -0,0 +1,38 @@
+(* Recursive value definitions *)
+
+let _ =
+  let rec x = 1 :: x in
+  if match x with
+       1 :: x' -> x == x'
+     | _ -> false
+  then print_string "Test 1: passed\n"
+  else print_string "Test 1: FAILED\n";
+  let one = 1 in
+  let rec y = (one, one+1) :: y in  
+  if match y with
+       (1,2) :: y' -> y == y'
+     | _ -> false
+  then print_string "Test 2: passed\n"
+  else print_string "Test 2: FAILED\n";
+  let rec z = (Gc.minor(); (one, one+1)) :: z in
+  (* Trash the minor generation *)
+  for i = 0 to 50000 do ignore (ref 0) done;
+  if match z with
+       (1,2) :: z' -> z == z'
+     | _ -> false
+  then print_string "Test 3: passed\n"
+  else print_string "Test 3: FAILED\n";
+;;
+
+let rec s = "bar"
+and idx = 1
+and x1 = let f x = Printf.printf "%s\n" x in f "foo"; s, x4
+and x2 = [| x1; x1 |]
+and x3 = (fun () -> fst (x2.(idx))) :: x3
+and x4 = {contents = x3}
+;;
+
+Gc.minor ();;
+if (List.hd (!(snd (x2.(0))))) () == s
+then print_string "Test 4: passed\n"
+else print_string "Test 4: FAILED\n"
diff --git a/test/Moretest/regexp.ml b/test/Moretest/regexp.ml
new file mode 100644 (file)
index 0000000..a932b74
--- /dev/null
@@ -0,0 +1,975 @@
+open Printf
+
+let build_result ngroups input =
+  let res = Array.make (ngroups + 1) "~" in
+  for i = 0 to ngroups do
+    try
+      res.(i) <- Str.matched_group i input
+    with Not_found -> ()
+  done;
+  res
+
+let search_forward re ng input start =
+  try
+    ignore(Str.search_forward re input start);
+    build_result ng input
+  with Not_found ->
+    [||]
+
+let search_backward re ng input start =
+  try
+    ignore(Str.search_backward re input start);
+    build_result ng input
+  with Not_found ->
+    [||]
+
+let partial_match re ng input start =
+  if Str.string_partial_match re input start
+  then build_result ng input
+  else [||]
+
+let start_test msg =
+  print_newline(); printf "%s\n  " msg
+
+let num_failures = ref 0
+
+let test res1 res2 =
+  if res1 = res2 
+  then print_char '.'
+  else begin print_string " FAIL "; incr num_failures end
+
+let test_search_forward r ng s exp =
+  test (search_forward r ng s 0) exp
+
+let test_search_backward r ng s exp =
+  test (search_backward r ng s (String.length s)) exp
+
+let test_partial_match r ng s exp =
+  test (partial_match r ng s 0) exp
+
+let end_test () =
+  print_newline();
+  if !num_failures = 0 then
+    printf "All tests passed\n"
+  else begin
+    printf "TEST FAILED: %d failure(s)\n" !num_failures;
+    exit 2
+  end
+
+let automated_test() =
+
+  (** Forward searches *)
+  start_test "Search for /the quick brown fox/";
+  let r = Str.regexp "the quick brown fox" in
+  let n = 0 in
+  test_search_forward r n "the quick brown fox"
+    [|"the quick brown fox"|];
+  test_search_forward r n "What do you know about the quick brown fox?"
+    [|"the quick brown fox"|];
+  test_search_forward r n "The quick brown FOX"
+    [||];
+  test_search_forward r n "What do you know about THE QUICK BROWN FOX?"
+    [||];
+
+  start_test "Search for /the quick brown fox/";
+  let r = Str.regexp_case_fold "the quick brown fox" in
+  let n = 0 in
+  test_search_forward r n "the quick brown fox"
+    [|"the quick brown fox"|];
+  test_search_forward r n "What do you know about the quick brown fox?"
+    [|"the quick brown fox"|];
+  test_search_forward r n "The quick brown FOX"
+    [|"The quick brown FOX"|];
+  test_search_forward r n "What do you know about THE QUICK BROWN FOX?"
+    [|"THE QUICK BROWN FOX"|];
+  test_search_forward r n "The slow white snail"
+    [||];
+
+  start_test "Search for /a*abc?xyz+pqrrrabbb*xyyyyy?pq?q?q?q?q?q?AB*zz/";
+  let r = Str.regexp "a*abc?xyz+pqrrrabbb*xyyyyy?pq?q?q?q?q?q?AB*zz" in
+  let n = 0 in
+  test_search_forward r n "abxyzpqrrrabbxyyyypqAzz"
+    [|"abxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "abxyzpqrrrabbxyyyypqAzz"
+    [|"abxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aabxyzpqrrrabbxyyyypqAzz"
+    [|"aabxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaabxyzpqrrrabbxyyyypqAzz"
+    [|"aaabxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaaabxyzpqrrrabbxyyyypqAzz"
+    [|"aaaabxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "abcxyzpqrrrabbxyyyypqAzz"
+    [|"abcxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aabcxyzpqrrrabbxyyyypqAzz"
+    [|"aabcxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypAzz"
+    [|"aaabcxyzpqrrrabbxyyyypAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqAzz"
+    [|"aaabcxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqqAzz"
+    [|"aaabcxyzpqrrrabbxyyyypqqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqqqAzz"
+    [|"aaabcxyzpqrrrabbxyyyypqqqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqqqqAzz"
+    [|"aaabcxyzpqrrrabbxyyyypqqqqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqqqqqAzz"
+    [|"aaabcxyzpqrrrabbxyyyypqqqqqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqqqqqqAzz"
+    [|"aaabcxyzpqrrrabbxyyyypqqqqqqAzz"|];
+  test_search_forward r n "aaaabcxyzpqrrrabbxyyyypqAzz"
+    [|"aaaabcxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "abxyzzpqrrrabbxyyyypqAzz"
+    [|"abxyzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aabxyzzzpqrrrabbxyyyypqAzz"
+    [|"aabxyzzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaabxyzzzzpqrrrabbxyyyypqAzz"
+    [|"aaabxyzzzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaaabxyzzzzpqrrrabbxyyyypqAzz"
+    [|"aaaabxyzzzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "abcxyzzpqrrrabbxyyyypqAzz"
+    [|"abcxyzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aabcxyzzzpqrrrabbxyyyypqAzz"
+    [|"aabcxyzzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaabcxyzzzzpqrrrabbxyyyypqAzz"
+    [|"aaabcxyzzzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaaabcxyzzzzpqrrrabbxyyyypqAzz"
+    [|"aaaabcxyzzzzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "aaaabcxyzzzzpqrrrabbbxyyyypqAzz"
+    [|"aaaabcxyzzzzpqrrrabbbxyyyypqAzz"|];
+  test_search_forward r n "aaaabcxyzzzzpqrrrabbbxyyyyypqAzz"
+    [|"aaaabcxyzzzzpqrrrabbbxyyyyypqAzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypABzz"
+    [|"aaabcxyzpqrrrabbxyyyypABzz"|];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypABBzz"
+    [|"aaabcxyzpqrrrabbxyyyypABBzz"|];
+  test_search_forward r n ">>>aaabxyzpqrrrabbxyyyypqAzz"
+    [|"aaabxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n ">aaaabxyzpqrrrabbxyyyypqAzz"
+    [|"aaaabxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n ">>>>abcxyzpqrrrabbxyyyypqAzz"
+    [|"abcxyzpqrrrabbxyyyypqAzz"|];
+  test_search_forward r n "abxyzpqrrabbxyyyypqAzz"
+    [||];
+  test_search_forward r n "abxyzpqrrrrabbxyyyypqAzz"
+    [||];
+  test_search_forward r n "abxyzpqrrrabxyyyypqAzz"
+    [||];
+  test_search_forward r n "aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz"
+    [||];
+  test_search_forward r n "aaaabcxyzzzzpqrrrabbbxyyypqAzz"
+    [||];
+  test_search_forward r n "aaabcxyzpqrrrabbxyyyypqqqqqqqAzz"
+    [||];
+
+  start_test "Search for /^abc\\(abc\\)?zz/";
+  let r = Str.regexp "^abc\\(abc\\)?zz" in
+  let n = 1 in
+  test_search_forward r n "abczz"
+    [|"abczz"; "~"|];
+  test_search_forward r n "abcabczz"
+    [|"abcabczz"; "abc"|];
+  test_search_forward r n "zz"
+    [||];
+  test_search_forward r n "abcabcabczz"
+    [||];
+  test_search_forward r n ">>abczz"
+    [||];
+
+  start_test "Search for /^\\(b+\\|a\\)\\(b+\\|a\\)?c/";
+  let r = Str.regexp "^\\(b+\\|a\\)\\(b+\\|a\\)?c" in
+  let n = 2 in
+  test_search_forward r n "bc"
+    [|"bc"; "b"; "~"|];
+  test_search_forward r n "bbc"
+    [|"bbc"; "bb"; "~"|];
+  test_search_forward r n "bbbc"
+    [|"bbbc"; "bbb"; "~"|];
+  test_search_forward r n "bac"
+    [|"bac"; "b"; "a"|];
+  test_search_forward r n "bbac"
+    [|"bbac"; "bb"; "a"|];
+  test_search_forward r n "aac"
+    [|"aac"; "a"; "a"|];
+  test_search_forward r n "abbbbbbbbbbbc"
+    [|"abbbbbbbbbbbc"; "a"; "bbbbbbbbbbb"|];
+  test_search_forward r n "bbbbbbbbbbbac"
+    [|"bbbbbbbbbbbac"; "bbbbbbbbbbb"; "a"|];
+  test_search_forward r n "aaac"
+    [||];
+  test_search_forward r n "abbbbbbbbbbbac"
+    [||];
+
+  start_test "Search for /r\\(\\(g*\\|k\\)y?\\)*A/";
+  let r = Str.regexp "r\\(\\(g*\\|k\\)y?\\)*A" in
+  let n = 2 in
+  test_search_forward r n "ArA"
+    [|"rA"; "~"; "~"|];
+  test_search_forward r n "ArkA"
+    [|"rkA"; "k"; "k"|];
+  test_search_forward r n "AryA"
+    [|"ryA"; "y"; ""|];
+  test_search_forward r n "ArgggkyggkA"
+    [|"rgggkyggkA"; "k"; "k"|];
+
+  start_test "Search for /A\\(\\(t\\|v\\)\\(q?\\|n\\)\\)*A/";
+  let r = Str.regexp "A\\(\\(t\\|v\\)\\(q?\\|n\\)\\)*A" in
+  let n = 3 in
+  test_search_forward r n "AvA"
+    [|"AvA"; "v"; "v"; ""|];
+
+  start_test "Search for /A\\(\\(b\\(\\(d\\|l*\\)?\\|w\\)\\)*a\\)A/";
+  let r = Str.regexp "A\\(\\(b\\(\\(d\\|l*\\)?\\|w\\)\\)*a\\)A" in
+  let n = 4 in
+  test_search_forward r n "AbbaA"
+    [|"AbbaA"; "bba"; "b"; ""; ""|];
+
+  start_test "Search for /\\(\\|f\\)*x/";
+  let r = Str.regexp "\\(\\|f\\)*x" in
+  let n = 1 in
+  test_search_forward r n "abcd"
+    [||];
+  test_search_forward r n "fffff"
+    [||];
+  test_search_forward r n "fffxab"
+    [|"fffx"; "f"|];
+  test_search_forward r n "zzzxab"
+    [|"x"; "~"|];
+
+  start_test "Search for /\\(\\|f\\)+x/";
+  let r = Str.regexp "\\(\\|f\\)+x" in
+  let n = 1 in
+  test_search_forward r n "abcd"
+    [||];
+  test_search_forward r n "fffff"
+    [||];
+  test_search_forward r n "fffxab"
+    [|"fffx"; "f"|];
+  test_search_forward r n "zzzxab"
+    [|"x"; ""|];
+
+  start_test "Search for /A\\(.?\\)*A/";
+  let r = Str.regexp "A\\(.?\\)*A" in
+  let n = 1 in
+  test_search_forward r n "AA"
+    [|"AA"; "~"|];
+  test_search_forward r n "AAA"
+    [|"AAA"; "A"|];
+  test_search_forward r n "AbA"
+    [|"AbA"; "b"|];
+  test_search_forward r n "A"
+    [||];
+
+  start_test "Search for /\\([ab]*\\)\\1+c/";
+  let r = Str.regexp "\\([ab]*\\)\\1+c" in
+  let n = 1 in
+  test_search_forward r n "abababc"
+    [| "abababc"; "ab" |];
+  test_search_forward r n "abbc"
+    [| "bbc"; "b" |];
+  test_search_forward r n "abc"
+    [| "c"; "" |];
+
+  start_test "Search for /^\\(\\(b+\\|a\\)\\(b+\\|a\\)?\\)?bc/";
+  let r = Str.regexp "^\\(\\(b+\\|a\\)\\(b+\\|a\\)?\\)?bc" in
+  let n = 3 in
+  test_search_forward r n "bbc"
+    [|"bbc"; "b"; "b"; "~"|];
+
+  start_test "Search for /^\\(\\(b*\\|ba\\)\\(b*\\|ba\\)?\\)?bc/";
+  let r = Str.regexp "^\\(\\(b*\\|ba\\)\\(b*\\|ba\\)?\\)?bc" in
+  let n = 3 in
+  test_search_forward r n "babc"
+    [|"babc"; "ba"; ""; "ba"|];
+  test_search_forward r n "bbabc"
+    [|"bbabc"; "bba"; "b"; "ba"|];
+  test_search_forward r n "bababc"
+    [|"bababc"; "baba"; "ba"; "ba"|];
+  test_search_forward r n "bababbc"
+    [||];
+  test_search_forward r n "babababc"
+    [||];
+
+  start_test "Search for /^[]abcde]/";
+  let r = Str.regexp "^[]abcde]" in
+  let n = 0 in
+  test_search_forward r n "athing"
+    [|"a"|];
+  test_search_forward r n "bthing"
+    [|"b"|];
+  test_search_forward r n "]thing"
+    [|"]"|];
+  test_search_forward r n "cthing"
+    [|"c"|];
+  test_search_forward r n "dthing"
+    [|"d"|];
+  test_search_forward r n "ething"
+    [|"e"|];
+  test_search_forward r n "fthing"
+    [||];
+  test_search_forward r n "[thing"
+    [||];
+  test_search_forward r n "\\\\thing"
+    [||];
+
+  start_test "Search for /^[]cde]/";
+  let r = Str.regexp "^[]cde]" in
+  let n = 0 in
+  test_search_forward r n "]thing"
+    [|"]"|];
+  test_search_forward r n "cthing"
+    [|"c"|];
+  test_search_forward r n "dthing"
+    [|"d"|];
+  test_search_forward r n "ething"
+    [|"e"|];
+  test_search_forward r n "athing"
+    [||];
+  test_search_forward r n "fthing"
+    [||];
+
+  start_test "Search for /^[^]abcde]/";
+  let r = Str.regexp "^[^]abcde]" in
+  let n = 0 in
+  test_search_forward r n "fthing"
+    [|"f"|];
+  test_search_forward r n "[thing"
+    [|"["|];
+  test_search_forward r n "\\\\thing"
+    [|"\\"|];
+  test_search_forward r n "athing"
+    [||];
+  test_search_forward r n "bthing"
+    [||];
+  test_search_forward r n "]thing"
+    [||];
+  test_search_forward r n "cthing"
+    [||];
+  test_search_forward r n "dthing"
+    [||];
+  test_search_forward r n "ething"
+    [||];
+
+  start_test "Search for /^[^]cde]/";
+  let r = Str.regexp "^[^]cde]" in
+  let n = 0 in
+  test_search_forward r n "athing"
+    [|"a"|];
+  test_search_forward r n "fthing"
+    [|"f"|];
+  test_search_forward r n "]thing"
+    [||];
+  test_search_forward r n "cthing"
+    [||];
+  test_search_forward r n "dthing"
+    [||];
+  test_search_forward r n "ething"
+    [||];
+
+  start_test "Search for /^ÿ/";
+  let r = Str.regexp "^ÿ" in
+  let n = 0 in
+  test_search_forward r n "ÿ"
+    [|"ÿ"|];
+
+  start_test "Search for /^[0-9]+$/";
+  let r = Str.regexp "^[0-9]+$" in
+  let n = 0 in
+  test_search_forward r n "0"
+    [|"0"|];
+  test_search_forward r n "1"
+    [|"1"|];
+  test_search_forward r n "2"
+    [|"2"|];
+  test_search_forward r n "3"
+    [|"3"|];
+  test_search_forward r n "4"
+    [|"4"|];
+  test_search_forward r n "5"
+    [|"5"|];
+  test_search_forward r n "6"
+    [|"6"|];
+  test_search_forward r n "7"
+    [|"7"|];
+  test_search_forward r n "8"
+    [|"8"|];
+  test_search_forward r n "9"
+    [|"9"|];
+  test_search_forward r n "10"
+    [|"10"|];
+  test_search_forward r n "100"
+    [|"100"|];
+  test_search_forward r n "abc"
+    [||];
+
+  start_test "Search for /^.*nter/";
+  let r = Str.regexp "^.*nter" in
+  let n = 0 in
+  test_search_forward r n "enter"
+    [|"enter"|];
+  test_search_forward r n "inter"
+    [|"inter"|];
+  test_search_forward r n "uponter"
+    [|"uponter"|];
+
+  start_test "Search for /^xxx[0-9]+$/";
+  let r = Str.regexp "^xxx[0-9]+$" in
+  let n = 0 in
+  test_search_forward r n "xxx0"
+    [|"xxx0"|];
+  test_search_forward r n "xxx1234"
+    [|"xxx1234"|];
+  test_search_forward r n "xxx"
+    [||];
+
+  start_test "Search for /^.+[0-9][0-9][0-9]$/";
+  let r = Str.regexp "^.+[0-9][0-9][0-9]$" in
+  let n = 0 in
+  test_search_forward r n "x123"
+    [|"x123"|];
+  test_search_forward r n "xx123"
+    [|"xx123"|];
+  test_search_forward r n "123456"
+    [|"123456"|];
+  test_search_forward r n "123"
+    [||];
+  test_search_forward r n "x123x"
+    [||];
+
+  start_test "Search for /^\\([^!]+\\)!\\(.+\\)=apquxz\\.ixr\\.zzz\\.ac\\.uk$/";
+  let r = Str.regexp "^\\([^!]+\\)!\\(.+\\)=apquxz\\.ixr\\.zzz\\.ac\\.uk$" in
+  let n = 2 in
+  test_search_forward r n "abc!pqr=apquxz.ixr.zzz.ac.uk"
+    [|"abc!pqr=apquxz.ixr.zzz.ac.uk"; "abc"; "pqr"|];
+  test_search_forward r n "!pqr=apquxz.ixr.zzz.ac.uk"
+    [||];
+  test_search_forward r n "abc!=apquxz.ixr.zzz.ac.uk"
+    [||];
+  test_search_forward r n "abc!pqr=apquxz:ixr.zzz.ac.uk"
+    [||];
+  test_search_forward r n "abc!pqr=apquxz.ixr.zzz.ac.ukk"
+    [||];
+
+  start_test "Search for /\\([0-9a-f:]+\\)$/";
+  let r = Str.regexp_case_fold "\\([0-9a-f:]+\\)$" in
+  let n = 1 in
+  test_search_forward r n "0abc"
+    [|"0abc"; "0abc"|];
+  test_search_forward r n "abc"
+    [|"abc"; "abc"|];
+  test_search_forward r n "fed"
+    [|"fed"; "fed"|];
+  test_search_forward r n "E"
+    [|"E"; "E"|];
+  test_search_forward r n "::"
+    [|"::"; "::"|];
+  test_search_forward r n "5f03:12C0::932e"
+    [|"5f03:12C0::932e"; "5f03:12C0::932e"|];
+  test_search_forward r n "fed def"
+    [|"def"; "def"|];
+  test_search_forward r n "Any old stuff"
+    [|"ff"; "ff"|];
+  test_search_forward r n "0zzz"
+    [||];
+  test_search_forward r n "gzzz"
+    [||];
+  test_search_forward r n "fed "
+    [||];
+  test_search_forward r n "Any old rubbish"
+    [||];
+
+  start_test "Search for /^[a-z0-9][a-z0-9-]*\\(\\.[a-z0-9][A-Z0-9-]*\\)*\\.$/";
+  let r = Str.regexp_case_fold "^[a-z0-9][a-z0-9-]*\\(\\.[a-z0-9][A-Z0-9-]*\\)*\\.$" in
+  let n = 1 in
+  test_search_forward r n "a."
+    [|"a."; "~"|];
+  test_search_forward r n "Z."
+    [|"Z."; "~"|];
+  test_search_forward r n "2."
+    [|"2."; "~"|];
+  test_search_forward r n "ab-c."
+    [|"ab-c."; "~"|];
+  test_search_forward r n "ab-c.pq-r."
+    [|"ab-c.pq-r."; ".pq-r"|];
+  test_search_forward r n "sxk.zzz.ac.uk."
+    [|"sxk.zzz.ac.uk."; ".uk"|];
+  test_search_forward r n "sxk.ZZZ.ac.UK."
+    [|"sxk.ZZZ.ac.UK."; ".UK"|];
+  test_search_forward r n "x-.y-."
+    [|"x-.y-."; ".y-"|];
+  test_search_forward r n "-abc.peq."
+    [||];
+
+  start_test "Search for /^\\*\\.[a-z]\\([a-z0-9-]*[a-z0-9]+\\)?\\(\\.[a-z]\\([a-z0-9-]*[a-z0-9]+\\)?\\)*$/";
+  let r = Str.regexp "^\\*\\.[a-z]\\([a-z0-9-]*[a-z0-9]+\\)?\\(\\.[a-z]\\([a-z0-9-]*[a-z0-9]+\\)?\\)*$" in
+  let n = 3 in
+  test_search_forward r n "*.a"
+    [|"*.a"; "~"; "~"; "~"|];
+  test_search_forward r n "*.b0-a"
+    [|"*.b0-a"; "0-a"; "~"; "~"|];
+  test_search_forward r n "*.c3-b.c"
+    [|"*.c3-b.c"; "3-b"; ".c"; "~"|];
+  test_search_forward r n "*.c-a.b-c"
+    [|"*.c-a.b-c"; "-a"; ".b-c"; "-c"|];
+  test_search_forward r n "*.0"
+    [||];
+  test_search_forward r n "*.a-"
+    [||];
+  test_search_forward r n "*.a-b.c-"
+    [||];
+  test_search_forward r n "*.c-a.0-c"
+    [||];
+
+  start_test "Search for /^[0-9a-fA-F]\\(\\.[0-9a-fA-F]\\)*$/";
+  let r = Str.regexp "^[0-9a-fA-F]\\(\\.[0-9a-fA-F]\\)*$" in
+  let n = 1 in
+  test_search_forward r n "a.b.c.d"
+    [|"a.b.c.d"; ".d"|];
+  test_search_forward r n "A.B.C.D"
+    [|"A.B.C.D"; ".D"|];
+  test_search_forward r n "a.b.c.1.2.3.C"
+    [|"a.b.c.1.2.3.C"; ".C"|];
+  test_search_forward r n "a.b.c.dz"
+    [||];
+  test_search_forward r n "za"
+    [||];
+
+  start_test "Search for /^\\\".*\\\" *\\(;.*\\)?$/";
+  let r = Str.regexp "^\\\".*\\\" *\\(;.*\\)?$" in
+  let n = 1 in
+  test_search_forward r n "\"1234\""
+    [|"\"1234\""; "~"|];
+  test_search_forward r n "\"abcd\" ;"
+    [|"\"abcd\" ;"; ";"|];
+  test_search_forward r n "\"\" ; rhubarb"
+    [|"\"\" ; rhubarb"; "; rhubarb"|];
+  test_search_forward r n "\"1234\" : things"
+    [||];
+
+  start_test "Search for /^\\(a\\(b\\(c\\)\\)\\)\\(d\\(e\\(f\\)\\)\\)\\(h\\(i\\(j\\)\\)\\)$/";
+  let r = Str.regexp "^\\(a\\(b\\(c\\)\\)\\)\\(d\\(e\\(f\\)\\)\\)\\(h\\(i\\(j\\)\\)\\)$" in
+  let n = 9 in
+  test_search_forward r n "abcdefhij"
+    [|"abcdefhij"; "abc"; "bc"; "c"; "def"; "ef"; "f"; "hij"; "ij"; "j"|];
+
+  start_test "Search for /^[.^$|()*+?{,}]+/";
+  let r = Str.regexp "^[.^$|()*+?{,}]+" in
+  let n = 0 in
+  test_search_forward r n ".^$*(+)|{?,?}"
+    [|".^$*(+)|{?,?}"|];
+
+  start_test "Search for /\\(cat\\(a\\(ract\\|tonic\\)\\|erpillar\\)\\) \\1\\(\\)2\\(3\\)/";
+  let r = Str.regexp "\\(cat\\(a\\(ract\\|tonic\\)\\|erpillar\\)\\) \\1\\(\\)2\\(3\\)" in
+  let n = 5 in
+  test_search_forward r n "cataract cataract23"
+    [|"cataract cataract23"; "cataract"; "aract"; "ract"; ""; "3"|];
+  test_search_forward r n "catatonic catatonic23"
+    [|"catatonic catatonic23"; "catatonic"; "atonic"; "tonic"; ""; "3"|];
+  test_search_forward r n "caterpillar caterpillar23"
+    [|"caterpillar caterpillar23"; "caterpillar"; "erpillar"; "~"; ""; "3"|];
+
+  start_test "Search for /^From +\\([^ ]+\\) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/";
+  let r = Str.regexp "^From +\\([^ ]+\\) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]" in
+  let n = 1 in
+  test_search_forward r n "From abcd  Mon Sep 01 12:33:02 1997"
+    [|"From abcd  Mon Sep 01 12:33"; "abcd"|];
+
+  start_test "Search for /\\ba/";
+  let r = Str.regexp "\\ba" in
+  let n = 0 in
+  test_search_forward r n "abcd"
+    [|"a"|];
+  test_search_forward r n "the a"
+    [|"a"|];
+  test_search_forward r n ".ab"
+    [|"a"|];
+  test_search_forward r n "bad"
+    [||];
+  test_search_forward r n "the ba"
+    [||];
+  test_search_forward r n "ba."
+    [||];
+
+  start_test "Search for /a\\b/";
+  let r = Str.regexp "a\\b" in
+  let n = 0 in
+  test_search_forward r n "a"
+    [|"a"|];
+  test_search_forward r n "bcda"
+    [|"a"|];
+  test_search_forward r n "a foo"
+    [|"a"|];
+  test_search_forward r n "a."
+    [|"a"|];
+  test_search_forward r n "bad"
+    [||];
+  test_search_forward r n "ab"
+    [||];
+
+  start_test "Search for /\\([a-z]*\\)b/";
+  let r = Str.regexp "\\([a-z]*\\)b" in
+  let n = 1 in
+  test_search_forward r n "abbb"
+    [|"abbb"; "abb"|];
+
+  start_test "Search for /\\([a-z]+\\)b/";
+  let r = Str.regexp "\\([a-z]+\\)b" in
+  let n = 1 in
+  test_search_forward r n "abbb"
+    [|"abbb"; "abb"|];
+
+  start_test "Search for /\\([a-z]?\\)b/";
+  let r = Str.regexp "\\([a-z]?\\)b" in
+  let n = 1 in
+  test_search_forward r n "bbbb"
+    [|"bb"; "b"|];
+
+  start_test "Search for /^a/";
+  let r = Str.regexp "^a" in
+  let n = 0 in
+  test_search_forward r n "abcdef"
+    [|"a"|];
+  test_search_forward r n "zzzz\nabcdef"
+    [|"a"|];
+
+  start_test "Search for /a$/";
+  let r = Str.regexp "a$" in
+  let n = 0 in
+  test_search_forward r n "xyza"
+    [|"a"|];
+  test_search_forward r n "xyza\nbcdef"
+    [|"a"|];
+
+  start_test "Null characters in regexps";
+  let r = Str.regexp "ab\000cd" in
+  let n = 0 in
+  test_search_forward r n "qerpoiuab\000cdwerltkh"
+    [| "ab\000cd" |];
+  let r = Str.regexp "\000cd" in
+  let n = 0 in
+  test_search_forward r n "qerpoiuab\000cdwerltkh"
+    [| "\000cd" |];
+
+  (** Backward searches *)
+  start_test "Backward search for /the quick/";
+  let r = Str.regexp "the quick" in
+  let n = 0 in
+  test_search_backward r n "the quick brown fox"
+    [|"the quick"|];
+  test_search_backward r n "What do you know about the quick brown fox?"
+    [|"the quick"|];
+  test_search_backward r n "The quick brown FOX"
+    [||];
+  test_search_backward r n "What do you know about THE QUICK BROWN FOX?"
+    [||];
+
+  start_test "Backward search for /a\\([0-9]+\\)/";
+  let r = Str.regexp "a\\([0-9]+\\)" in
+  let n = 1 in
+  test_search_backward r n "a123 a456zzzz"
+    [|"a456"; "456"|];
+  test_search_backward r n "ab123"
+    [||];
+
+  (** Partial match searches *)
+
+  start_test "Partial match for /partial match/";
+  let r = Str.regexp "partial match" in
+  let n = 0 in
+  test_partial_match r n ""
+    [|""|];
+  test_partial_match r n "partial matching"
+    [|"partial match"|];
+  test_partial_match r n "partial m"
+    [|"partial m"|];
+
+  start_test "Partial match for /\\(partial\\)\\|\\(match\\)/";
+  let r = Str.regexp "\\(partial\\)\\|\\(match\\)" in
+  let n = 2 in
+  test_partial_match r n ""
+    [|""; "~"; "~"|];
+  test_partial_match r n "part"
+    [|"part"; "~"; "~"|];
+  test_partial_match r n "partial"
+    [|"partial"; "partial"; "~"|];
+  test_partial_match r n "matching"
+    [|"match"; "~"; "match"|];
+  test_partial_match r n "mat"
+    [|"mat"; "~"; "~"|];
+  test_partial_match r n "zorglub"
+    [||];
+
+  (** Replacement *)
+  start_test "Global replacement";
+  test (Str.global_replace (Str.regexp "[aeiou]") ".."
+          "abcdefghijklmnopqrstuvwxyz")
+       "..bcd..fgh..jklmn..pqrst..vwxyz";
+  test (Str.global_replace (Str.regexp "[0-9]\\([0-9]*\\)") "-\\0-\\1-"
+          "abc012def3ghi45")
+       "abc-012-12-def-3--ghi-45-5-";
+  test (Str.global_replace (Str.regexp "[0-9]?") "."
+          "abc012def3ghi45")
+       ".a.b.c....d.e.f..g.h.i...";
+
+  start_test "First replacement";
+  test (Str.replace_first (Str.regexp "[eiou]") ".."
+          "abcdefghijklmnopqrstuvwxyz")
+       "abcd..fghijklmnopqrstuvwxyz";
+  test (Str.replace_first (Str.regexp "[0-9]\\([0-9]*\\)") "-\\0-\\1-"
+          "abc012def3ghi45")
+       "abc-012-12-def3ghi45";
+
+  (** XML tokenization *)
+  (* See "REX: XML Shallow Parsing with Regular Expressions",
+     Robert D. Cameron, Simon Fraser University, CMPT TR 1998-17. *)
+  start_test "XML tokenization";
+  begin 
+    let _TextSE = "[^<]+" in
+    let _UntilHyphen = "[^-]*-" in
+    let _Until2Hyphens = _UntilHyphen ^ "\\([^-]" ^ _UntilHyphen ^ "\\)*-" in
+    let _CommentCE = _Until2Hyphens ^ ">?" in
+    let _UntilRSBs = "[^]]*]\\([^]]+]\\)*]+" in
+    let _CDATA_CE = _UntilRSBs ^ "\\([^]>]" ^ _UntilRSBs ^ "\\)*>" in
+    let _S = "[ \n\t\r]+" in
+    let _NameStrt = "[A-Za-z_:]\\|[^\x00-\x7F]" in
+    let _NameChar = "[A-Za-z0-9_:.-]\\|[^\x00-\x7F]" in
+    let _Name = "\\(" ^ _NameStrt ^ "\\)\\(" ^ _NameChar ^ "\\)*" in
+    let _QuoteSE = "\"[^\"]*\"\\|'[^']*'" in
+    let _DT_IdentSE = _S ^ _Name ^ "\\(" ^ _S ^ "\\(" ^ _Name ^ "\\|" ^ _QuoteSE ^ "\\)\\)*" in
+    let _MarkupDeclCE = "\\([^]\"'><]\\|" ^ _QuoteSE ^ "\\)*>" in
+    let _S1 = "[\n\r\t ]" in
+    let _UntilQMs = "[^?]*\\?+" in
+    let _PI_Tail = "\\?>\\|" ^ _S1 ^ _UntilQMs ^ "\\([^>?]" ^ _UntilQMs ^ "\\)*>" in
+    let _DT_ItemSE = "<\\(!\\(--" ^ _Until2Hyphens ^ ">\\|[^-]" ^ _MarkupDeclCE ^ "\\)\\|\\?" ^ _Name ^ "\\(" ^ _PI_Tail ^ "\\)\\)\\|%" ^ _Name ^ ";\\|" ^ _S1 in
+    let _DocTypeCE = _DT_IdentSE ^ "\\(" ^ _S ^ "\\)?\\(\\[\\(" ^ _DT_ItemSE ^ "\\)*]\\(" ^ _S ^ "\\)?\\)?>?" in
+    let _DeclCE = "--\\(" ^ _CommentCE ^ "\\)?\\|\\[_CDATA\\[\\(" ^ _CDATA_CE ^ "\\)?\\|_DOCTYPE\\(" ^ _DocTypeCE ^ "\\)?" in
+    let _PI_CE = _Name ^ "\\(" ^ _PI_Tail ^ "\\)?" in
+    let _EndTagCE = _Name ^ "\\(" ^ _S ^ "\\)?>?" in
+    let _AttValSE = "\"[^<\"]*\"\\|'[^<']*'" in
+    let _ElemTagCE = _Name ^ "\\(" ^ _S ^ _Name ^ "\\(" ^ _S ^ "\\)?=\\(" ^ _S ^ "\\)?\\(" ^ _AttValSE ^ "\\)\\)*\\(" ^ _S ^ "\\)?/?>?" in
+    let _MarkupSPE = "<\\(!\\(" ^ _DeclCE ^ "\\)?\\|\\?\\(" ^ _PI_CE ^ "\\)?\\|/\\(" ^ _EndTagCE ^ "\\)?\\|\\(" ^ _ElemTagCE ^ "\\)?\\)" in
+    let _XML_SPE = _TextSE ^ "\\|" ^ _MarkupSPE in
+    let input = "\
+<?xml version=\"1.0\"?>
+<?xml-stylesheet type=\"text/css\" href=\"nutrition.css\"?>
+<!DOCTYPE root [
+   <!ELEMENT root (stem)>
+   <!ELEMENT stem EMPTY>
+]>
+<!ELEMENT name (#PCDATA)>
+<![CDATA[my
+escaped text]]> 
+<nutrition>
+<daily-values>
+       <total-fat units=\"g\">65</total-fat>
+       <saturated-fat units=\"g\">20</saturated-fat>
+       <cholesterol units=\"mg\">300</cholesterol>
+       <sodium units=\"mg\">2400</sodium>
+       <carb units=\"g\">300</carb>
+       <fiber units=\"g\">25</fiber>
+       <protein units=\"g\">50</protein>
+</daily-values>
+<food>
+       <name>Avocado Dip</name>
+       <mfr>Sunnydale</mfr>
+       <serving units=\"g\">29</serving>
+       <calories total=\"110\" fat=\"100\"/>
+       <total-fat>11</total-fat>
+       <saturated-fat>3</saturated-fat>
+       <cholesterol>5</cholesterol>
+       <sodium>210</sodium>
+       <carb>2</carb>
+       <fiber>0</fiber>
+       <protein>1</protein>
+       <vitamins>
+               <a>0</a>
+               <c>0</c>
+       </vitamins>
+       <minerals>
+               <ca>0</ca>
+               <fe>0</fe>
+       </minerals>
+</food>
+<!--
+<food>
+       <name></name>
+       <mfr></mfr>
+       <serving units=\"g\"></serving>
+       <calories total=\"\" fat=\"\"/>
+       <total-fat></total-fat>
+       <saturated-fat></saturated-fat>
+       <cholesterol></cholesterol>
+       <sodium></sodium>
+       <carb></carb>
+       <fiber></fiber>
+       <protein></protein>
+       <vitamins>
+               <a></a>
+               <c></c>
+       </vitamins>
+       <minerals>
+               <ca></ca>
+               <fe></fe>
+       </minerals>
+</food>
+-->
+" in
+    let result = [
+  "<?xml version=\"1.0\"?>";
+  "\n";
+  "<?xml-stylesheet type=\"text/css\" href=\"nutrition.css\"?>";
+  "\n";
+  "<!";
+  "DOCTYPE root [\n   ";
+  "<!";
+  "ELEMENT root (stem)>\n   ";
+  "<!";
+  "ELEMENT stem EMPTY>\n]>\n";
+  "<!";
+  "ELEMENT name (#PCDATA)>\n";
+  "<!";
+  "[CDATA[my\nescaped text]]> \n";
+  "<nutrition>";
+  "\n";
+  "<daily-values>";
+  "\n\t";
+  "<total-fat units=\"g\">";
+  "65";
+  "</total-fat>";
+  "\n\t";
+  "<saturated-fat units=\"g\">";
+  "20";
+  "</saturated-fat>";
+  "\n\t";
+  "<cholesterol units=\"mg\">";
+  "300";
+  "</cholesterol>";
+  "\n\t";
+  "<sodium units=\"mg\">";
+  "2400";
+  "</sodium>";
+  "\n\t";
+  "<carb units=\"g\">";
+  "300";
+  "</carb>";
+  "\n\t";
+  "<fiber units=\"g\">";
+  "25";
+  "</fiber>";
+  "\n\t";
+  "<protein units=\"g\">";
+  "50";
+  "</protein>";
+  "\n";
+  "</daily-values>";
+  "\n";
+  "<food>";
+  "\n\t";
+  "<name>";
+  "Avocado Dip";
+  "</name>";
+  "\n\t";
+  "<mfr>";
+  "Sunnydale";
+  "</mfr>";
+  "\n\t";
+  "<serving units=\"g\">";
+  "29";
+  "</serving>";
+  "\n\t";
+  "<calories total=\"110\" fat=\"100\"/>";
+  "\n\t";
+  "<total-fat>";
+  "11";
+  "</total-fat>";
+  "\n\t";
+  "<saturated-fat>";
+  "3";
+  "</saturated-fat>";
+  "\n\t";
+  "<cholesterol>";
+  "5";
+  "</cholesterol>";
+  "\n\t";
+  "<sodium>";
+  "210";
+  "</sodium>";
+  "\n\t";
+  "<carb>";
+  "2";
+  "</carb>";
+  "\n\t";
+  "<fiber>";
+  "0";
+  "</fiber>";
+  "\n\t";
+  "<protein>";
+  "1";
+  "</protein>";
+  "\n\t";
+  "<vitamins>";
+  "\n\t\t";
+  "<a>";
+  "0";
+  "</a>";
+  "\n\t\t";
+  "<c>";
+  "0";
+  "</c>";
+  "\n\t";
+  "</vitamins>";
+  "\n\t";
+  "<minerals>";
+  "\n\t\t";
+  "<ca>";
+  "0";
+  "</ca>";
+  "\n\t\t";
+  "<fe>";
+  "0";
+  "</fe>";
+  "\n\t";
+  "</minerals>";
+  "\n";
+  "</food>";
+  "\n";
+  "<!--\n<food>\n\t<name></name>\n\t<mfr></mfr>\n\t<serving units=\"g\"></serving>\n\t<calories total=\"\" fat=\"\"/>\n\t<total-fat></total-fat>\n\t<saturated-fat></saturated-fat>\n\t<cholesterol></cholesterol>\n\t<sodium></sodium>\n\t<carb></carb>\n\t<fiber></fiber>\n\t<protein></protein>\n\t<vitamins>\n\t\t<a></a>\n\t\t<c></c>\n\t</vitamins>\n\t<minerals>\n\t\t<ca></ca>\n\t\t<fe></fe>\n\t</minerals>\n</food>\n-->";
+  "\n"] in
+    let re = Str.regexp _XML_SPE in
+    let rec process i l =
+      let j = try Str.search_forward re input i with Not_found -> (-1) in
+      if j < 0 then begin
+        test l []
+      end else begin
+        match l with
+          [] -> test 0 1 (* failure *)
+        | hd :: tl ->
+            test (Str.matched_string input) hd; process (Str.match_end()) tl
+      end in
+    process 0 result
+  end;
+
+  end_test()
+
+let manual_test regexp text =
+  try
+    ignore (Str.search_forward (Str.regexp regexp) text 0);
+    printf "Matched,";
+    begin try
+      for i = 0 to 31 do
+        try
+          let s = Str.matched_group i text in
+          printf " \\%d=%s" i s
+        with Not_found ->
+          ()
+      done
+    with Invalid_argument "Str.matched_group" -> (*yuck*)
+      ()
+    end;
+    print_newline()
+  with Not_found ->
+    printf "Not matched\n"
+
+let _ =
+  if Array.length Sys.argv >= 3
+  then manual_test Sys.argv.(1) Sys.argv.(2)
+  else automated_test()
diff --git a/test/Moretest/sets.ml b/test/Moretest/sets.ml
new file mode 100644 (file)
index 0000000..7ec77c4
--- /dev/null
@@ -0,0 +1,39 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: sets.ml,v 1.4 2002/10/16 09:06:39 weis Exp $ *)
+
+module IntSet = Set.Make(struct type t = int let compare x y = x-y end)
+
+let even = List.fold_right IntSet.add [0; -2; 2; 4; 6; -10] IntSet.empty
+
+let odd = List.fold_right IntSet.add [9; -7; 5; 1; -3] IntSet.empty
+
+let _ =
+  for i = -10 to 10 do
+    Printf.printf "%d  %B  %B\n" i (IntSet.mem i even) (IntSet.mem i odd)
+  done
+
+module PowerSet(BaseSet: Set.S)
+               (SetOrd: functor(S: Set.S) -> Set.OrderedType) =
+  Set.Make(SetOrd(BaseSet))
+
+module IntSetSet = PowerSet(IntSet)(functor (S: Set.S) -> S)
+
+let setofset = List.fold_right IntSetSet.add [even; odd] IntSetSet.empty
+
+let _ =
+  List.iter
+    (fun s -> Printf.printf "%B\n" (IntSetSet.mem s setofset))
+    [IntSet.empty; even; odd; IntSet.union even odd]
+
+let _ = exit 0
diff --git a/test/Moretest/signals.ml b/test/Moretest/signals.ml
new file mode 100644 (file)
index 0000000..ce93a27
--- /dev/null
@@ -0,0 +1,32 @@
+let rec tak (x, y, z as tuple) =
+  if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y))
+           else z
+
+let break_handler _ =
+  print_string "Thank you for pressing ctrl-C."; print_newline();
+  print_string "Allocating a bit..."; flush stdout;
+  tak(18,12,6); print_string "done."; print_newline()
+
+let stop_handler _ =
+  print_string "Thank you for pressing ctrl-Z."; print_newline();
+  print_string "Now raising an exception..."; print_newline();
+  raise Exit
+
+let _ =
+  Sys.signal Sys.sigint (Sys.Signal_handle break_handler);
+  Sys.signal Sys.sigtstp (Sys.Signal_handle stop_handler);
+  begin try
+    print_string "Computing like crazy..."; print_newline();
+    for i = 1 to 1000 do tak(18,12,6) done;
+    print_string "Reading on input..."; print_newline();
+    for i = 1 to 5 do
+      try
+        let s = read_line () in
+        print_string ">> "; print_string s; print_newline()
+      with Exit ->
+        print_string "Got Exit, continuing."; print_newline()
+    done
+  with Exit ->
+    print_string "Got Exit, exiting."; print_newline()
+  end;
+  exit 0
diff --git a/test/Moretest/stackoverflow.ml b/test/Moretest/stackoverflow.ml
new file mode 100644 (file)
index 0000000..4d211bc
--- /dev/null
@@ -0,0 +1,15 @@
+let rec f x =
+  if x land 0xFFFF <> 0
+  then 1 + f (x + 1)
+  else
+    try
+      1 + f (x + 1)
+    with Stack_overflow ->
+      print_string "x = "; print_int x; print_newline();
+      raise Stack_overflow
+
+let _ =
+  try
+    ignore(f 0)
+  with Stack_overflow ->
+    print_string "Stack overflow caught"; print_newline()
diff --git a/test/Moretest/syserror.ml b/test/Moretest/syserror.ml
new file mode 100644 (file)
index 0000000..46f62ea
--- /dev/null
@@ -0,0 +1 @@
+let channel = open_out "titi:/toto"
diff --git a/test/Moretest/tailcalls.ml b/test/Moretest/tailcalls.ml
new file mode 100644 (file)
index 0000000..23b7353
--- /dev/null
@@ -0,0 +1,28 @@
+let rec tailcall4 a b c d =
+  if a < 0
+  then b
+  else tailcall4 (a-1) (b+1) (c+2) (d+3)
+
+let rec tailcall8 a b c d e f g h =
+  if a < 0
+  then b
+  else tailcall8 (a-1) (b+1) (c+2) (d+3) (e+4) (f+5) (g+6) (h+7)
+
+let rec tailcall16 a b c d e f g h i j k l m n o p =
+  if a < 0
+  then b
+  else tailcall16 (a-1) (b+1) (c+2) (d+3) (e+4) (f+5) (g+6) (h+7)
+                  (i+8) (j+9) (k+10) (l+11) (m+12) (n+13) (o+14) (p+15)
+
+let indtailcall8 fn a b c d e f g h =
+  fn a b c d e f g h
+
+let indtailcall16 fn a b c d e f g h i j k l m n o p =
+  fn a b c d e f g h i j k l m n o p 
+
+let _ =
+  print_int (tailcall4 10000000 0 0 0); print_newline();
+  print_int (tailcall8 10000000 0 0 0 0 0 0 0); print_newline();
+  print_int (tailcall16 10000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0); print_newline();
+  print_int (indtailcall8 tailcall8 10 0 0 0 0 0 0 0); print_newline();
+  print_int (indtailcall16 tailcall16 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0); print_newline()
diff --git a/test/Moretest/testrandom.ml b/test/Moretest/testrandom.ml
new file mode 100644 (file)
index 0000000..150d408
--- /dev/null
@@ -0,0 +1,13 @@
+open Random
+
+let _ = 
+  for i = 0 to 20 do
+    print_float (float 1000.); print_char ' '
+  done;
+  print_newline ();  print_newline ();
+  for i = 0 to 20 do
+    print_int (int 1000); print_char ' '
+  done
+
+let _ = exit 0
+
diff --git a/test/Moretest/tscanf.ml b/test/Moretest/tscanf.ml
new file mode 100644 (file)
index 0000000..cd66076
--- /dev/null
@@ -0,0 +1,1024 @@
+open Scanf;;
+
+(* Auxilliaries. *)
+let all_tests_ok = ref true;;
+
+let finish () =
+  match !all_tests_ok with
+  | true ->
+      prerr_endline "\nAll tests succeeded."
+  | _ ->
+      prerr_endline "\n\n********* Test suit failed. ***********\n";;
+
+at_exit finish;;
+
+let test_num = ref (-1);;
+
+let print_test_number () =
+  print_int !test_num; print_string " "; flush stdout;;
+
+let next_test () =
+  incr test_num;
+  print_test_number ();;
+
+let print_test_fail () =
+  all_tests_ok := false;
+  print_string
+   (Printf.sprintf "\n********* Test number %i failed ***********\n"
+    !test_num);;
+
+let print_failure_test_fail () =
+  all_tests_ok := false;
+  print_string
+   (Printf.sprintf
+      "\n********* Failure Test number %i incorrectly failed ***********\n"
+    !test_num);;
+
+let print_failure_test_succeed () =
+  all_tests_ok := false;
+  print_string
+   (Printf.sprintf
+      "\n********* Failure Test number %i failed to fail ***********\n"
+    !test_num);;
+
+let test b =
+  next_test ();
+  if not b then print_test_fail ();;
+
+(* Applies f to x and checks that the evaluation indeed
+   raises an exception that verifies the predicate [pred]. *)
+let test_raises_exc_p pred f x =
+  next_test ();
+  try
+    ignore (f x);
+    print_failure_test_succeed ();
+    false
+  with
+  | x ->
+    pred x || (print_failure_test_fail (); false);;
+
+(* Applies f to x and checks that the evaluation indeed
+   raises some exception. *)
+let test_raises_some_exc f = test_raises_exc_p (fun _ -> true) f;;
+let test_raises_this_exc exc = test_raises_exc_p (fun x -> x = exc);;
+
+(* Applies f to x and checks that the evaluation indeed
+   raises exception Failure s. *)
+
+let test_raises_this_failure s f x =
+  test_raises_exc_p (fun x -> x = Failure s) f x;;
+
+(* Applies f to x and checks that the evaluation indeed
+   raises the exception Failure. *)
+let test_raises_some_failure f x =
+  test_raises_exc_p (function Failure _ -> true | _ -> false) f x;;
+
+let failure_test f x s = test_raises_this_failure s f x;;
+let any_failure_test = test_raises_some_failure;;
+
+let scan_failure_test f x =
+  test_raises_exc_p (function Scan_failure _ -> true | _ -> false) f x;;
+
+(* The ``continuation'' that returns the scanned value. *)
+let id x = x;;
+
+(* Testing space scanning. *)
+let test0 () =
+  (sscanf "" "" id) 1 +
+  (sscanf "" " " id) 2 +
+  (sscanf " " " " id) 3 +
+  (sscanf "\t" " " id) 4 +
+  (sscanf "\n" " " id) 5 +
+  (sscanf "\n\t 6" " %d" id);;
+
+test (test0 () = 21);;
+
+(* Testing integer scanning %i and %d. *)
+let test1 () =
+  sscanf "1" "%d" id +
+  sscanf " 2" " %d" id +
+  sscanf " -2" " %d" id +
+  sscanf " +2" " %d" id +
+  sscanf " 2a " " %da" id;;
+
+test (test1 () = 5);;
+
+let test2 () =
+  sscanf "123" "%2i" id +
+  sscanf "245" "%d" id +
+  sscanf " 2a " " %1da" id;;
+
+test (test2 () = 259);;
+
+let test3 () =
+  sscanf "0xff" "%3i" id +
+  sscanf "0XEF" "%3i" id +
+  sscanf "x=-245" " x = %d" id +
+  sscanf " 2a " " %1da" id;;
+
+test (test3 () = -214);;
+
+(* Testing float scanning. *)
+(* f style. *)
+let test4 () =
+  bscanf (Scanning.from_string "1")
+    "%f" (fun b0 -> b0 = 1.0) &&
+  bscanf (Scanning.from_string "-1")
+    "%f" (fun b0 -> b0 = -1.0) &&
+  bscanf (Scanning.from_string "+1")
+    "%f" (fun b0 -> b0 = 1.0) &&
+  bscanf (Scanning.from_string "1.")
+    "%f" (fun b0 -> b0 = 1.0) &&
+  bscanf (Scanning.from_string ".1")
+    "%f" (fun b0 -> b0 = 0.1) &&
+  bscanf (Scanning.from_string "-.1")
+    "%f" (fun b0 -> b0 = -0.1) &&
+  bscanf (Scanning.from_string "+.1")
+    "%f" (fun b0 -> b0 = 0.1) &&
+  bscanf (Scanning.from_string "+1.")
+    "%f" (fun b0 -> b0 = 1.0) &&
+  bscanf (Scanning.from_string "-1.")
+    "%f" (fun b0 -> b0 = -1.0) &&
+  bscanf (Scanning.from_string "0 1. 1.3")
+    "%f %f %f" (fun b0 b1 b2 -> b0 = 0.0 && b1 = 1.0 && b2 = 1.3) &&
+  bscanf (Scanning.from_string "0.113")
+    "%4f" (fun b0 -> b0 = 0.11) &&
+  bscanf (Scanning.from_string "0.113")
+    "%5f" (fun b0 -> b0 = 0.113) &&
+  bscanf (Scanning.from_string "000.113")
+    "%15f" (fun b0 -> b0 = 0.113) &&
+  bscanf (Scanning.from_string "+000.113")
+    "%15f" (fun b0 -> b0 = 0.113) &&
+  bscanf (Scanning.from_string "-000.113")
+    "%15f" (fun b0 -> b0 = -0.113);;
+test (test4 ());;
+
+(* e style. *)
+let test5 () =
+  bscanf (Scanning.from_string "1e1")
+    "%e" (fun b -> b = 10.0) &&
+  bscanf (Scanning.from_string "1e+1")
+    "%e" (fun b -> b = 10.0) &&
+  bscanf (Scanning.from_string "10e-1")
+    "%e" (fun b -> b = 1.0) &&
+  bscanf (Scanning.from_string "10.e-1")
+    "%e" (fun b -> b = 1.0) &&
+  bscanf (Scanning.from_string "1e1 1.e+1 1.3e-1")
+    "%e %e %e" (fun b1 b2 b3 -> b1 = 10.0 && b2 = b1 && b3 = 0.13) &&
+
+(* g style. *)
+  bscanf (Scanning.from_string "1 1.1 0e+1 1.3e-1")
+    "%g %g %g %g"
+    (fun b1 b2 b3 b4 ->
+     b1 = 1.0 && b2 = 1.1 && b3 = 0.0 && b4 = 0.13);;
+
+test (test5 ());;
+
+(* Testing boolean scanning. *)
+let test6 () =
+  bscanf (Scanning.from_string "truetrue") "%B%B"
+         (fun b1 b2 -> (b1, b2) = (true, true))  &&
+  bscanf (Scanning.from_string "truefalse") "%B%B"
+         (fun b1 b2 -> (b1, b2) = (true, false)) &&
+  bscanf (Scanning.from_string "falsetrue") "%B%B"
+         (fun b1 b2 -> (b1, b2) = (false, true)) &&
+  bscanf (Scanning.from_string "falsefalse") "%B%B"
+         (fun b1 b2 -> (b1, b2) = (false, false)) &&
+  bscanf (Scanning.from_string "true false") "%B %B"
+         (fun b1 b2 -> (b1, b2) = (true, false));;
+
+test (test6 ());;
+
+(* Testing char scanning. *)
+
+let test7 () =
+  bscanf (Scanning.from_string "'a' '\n' '\t' '\000' '\032'")
+         "%C %C %C %C %C"
+    (fun c1 c2 c3 c4 c5 ->
+       c1 = 'a' && c2 = '\n' && c3 = '\t' && c4 = '\000' && c5 = '\032') &&
+
+(* Here \n, \t, and \032 are skipped due to the space semantics of scanf. *)
+  bscanf (Scanning.from_string "a \n \t \000 \032b")
+         "%c %c %c "
+    (fun c1 c2 c3 ->
+       c1 = 'a' && c2 = '\000' && c3 = 'b');;
+
+test (test7 ());;
+
+let verify_read c =
+  let s = Printf.sprintf "%C" c in
+  let ib = Scanning.from_string s in
+  assert (bscanf ib "%C" id = c);;
+
+let verify_scan_Chars () =
+  for i = 0 to 255 do verify_read (char_of_int i) done;;
+
+let test8 () = verify_scan_Chars () = ();;
+
+test (test8 ());;
+
+(* Testing string scanning. *)
+
+(* %S and %s styles. *)
+let unit fmt s =
+  let ib = Scanning.from_string (Printf.sprintf "%S" s) in
+  Scanf.bscanf ib fmt id;;
+
+let test_fmt fmt s = unit fmt s = s;;
+
+let test_S = test_fmt "%S";;
+let test9 () =
+  test_S "poi" &&
+  test_S "a\"b" &&
+  test_S "a\nb" &&
+  test_S "a\010b" &&
+  test_S "a\\\n\
+          b \\\n\
+          c\010\\\n\
+          b" &&
+  test_S "a\\\n\
+          \\\n\
+          \\\n\
+          b \\\n\
+          c\010\\\n\
+          b";;
+
+test (test9 ());;
+
+let test10 () =
+  let res =
+    sscanf "Une chaîne: \"celle-ci\" et \"celle-là\"!"
+           "%s %s %S %s %S %s"
+           (fun s1 s2 s3 s4 s5 s6 -> s1 ^ s2 ^ s3 ^ s4 ^ s5 ^ s6) in
+  res = "Unechaîne:celle-cietcelle-là!";;
+
+test (test10 ());;
+
+(* %[] style *)
+let test11 () =
+  sscanf "Pierre       Weis    70" "%s %s %s"
+    (fun prenom nom poids ->
+     prenom = "Pierre" && nom = "Weis" && int_of_string poids = 70)
+  &&
+  sscanf "Jean-Luc     de Léage        68" "%[^        ] %[^   ] %d"
+    (fun prenom nom poids ->
+     prenom = "Jean-Luc" && nom = "de Léage" && poids = 68)
+  &&
+  sscanf "Daniel       de Rauglaudre   66" "%s@\t %s@\t %d"
+    (fun prenom nom poids ->
+     prenom = "Daniel" && nom = "de Rauglaudre" && poids = 66);;
+
+(* Empty string (end of input) testing. *)
+let test110 () =
+  sscanf "" " " (fun x -> x) "" = "" &&
+  sscanf "" "%s" (fun x -> x = "") &&
+  sscanf "" "%s%s" (fun x y -> x = "" && y = "") &&
+  sscanf "" "%s " (fun x -> x = "") &&
+  sscanf "" " %s" (fun x -> x = "") &&
+  sscanf "" " %s " (fun x -> x = "") &&
+  sscanf "" "%[^\n]" (fun x -> x = "") &&
+  sscanf "" "%[^\n] " (fun x -> x = "") &&
+  sscanf " " "%s" (fun x -> x = "") &&
+  sscanf " " "%s%s" (fun x y -> x = "" && y = "") &&
+  sscanf " " " %s " (fun x -> x = "") &&
+  sscanf " " " %s %s" (fun x y -> x = "" && x = y) &&
+  sscanf " " " %s@ %s" (fun x y -> x = "" && x = y) &&
+  sscanf " poi !" " %s@ %s@." (fun x y -> x = "poi" && y = "!") &&
+  sscanf " poi !" "%s@ %s@." (fun x y -> x = "" && y = "poi !");;
+
+let test111 () = sscanf "" "%[^\n]@\n" (fun x -> x = "");;
+
+test (test11 () && test110 () && test111 ());;
+
+(* Scanning lists. *)
+let ib () = Scanning.from_string "[1;2;3;4; ]";;
+
+(* Statically known lists can be scanned directly. *)
+let f ib =
+  bscanf ib " [" ();
+  bscanf ib " %i ;" (fun i ->
+  bscanf ib " %i ;" (fun j ->
+  bscanf ib " %i ;" (fun k ->
+  bscanf ib " %i ;" (fun l ->
+  bscanf ib " ]" ();
+  [i; j; k; l]))));;
+
+let test12 () = f (ib ()) = [1; 2; 3; 4];;
+
+test (test12 ());;
+
+(* A general list scanner that always fails to succeed. *)
+let rec scan_elems ib accu =
+  try bscanf ib " %i ;" (fun i -> scan_elems ib (i :: accu)) with
+  | _ -> accu;;
+
+let g ib = bscanf ib "[ " (); List.rev (scan_elems ib []);;
+
+let test13 () = g (ib ()) = [1; 2; 3; 4];;
+
+test (test13 ());;
+
+(* A general int list scanner. *)
+let rec scan_int_list ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib [] in
+  bscanf ib " ]" ();
+   List.rev accu;;
+
+let test14 () = scan_int_list (ib ()) = [1; 2; 3; 4];;
+
+test (test14 ());;
+
+(* A general list scanner that always succeeds. *)
+let rec scan_elems ib accu =
+  bscanf ib " %i %c"
+    (fun i -> function
+     | ';' -> scan_elems ib (i :: accu)
+     | ']' -> List.rev (i :: accu)
+     | c -> failwith "scan_elems");;
+
+let rec scan_int_list ib =
+  bscanf ib "[ " ();
+  scan_elems ib [];;
+
+let test15 () =
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1; 2; 3; 4];;
+
+test (test15 ());;
+
+let rec scan_elems ib accu =
+  try
+  bscanf ib "%c %i"
+    (fun c i ->
+     match c with
+     | ';' -> scan_elems ib (i :: accu)
+     | ']' -> List.rev (i :: accu)
+     | '[' when accu = [] -> scan_elems ib (i :: accu)
+     | c -> prerr_endline (String.make 1 c); failwith "scan_elems")
+  with
+  | Scan_failure _ -> bscanf ib "]" (); accu
+  | End_of_file -> accu;;
+
+let scan_int_list ib = scan_elems ib [];;
+
+let test16 () =
+  scan_int_list (Scanning.from_string "[]") = List.rev [] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = List.rev [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4; ]") = List.rev [1;2;3;4] &&
+  (* Should fail but succeeds! *)
+  scan_int_list (Scanning.from_string "[1;2;3;4") = List.rev [1;2;3;4];;
+
+test (test16 ());;
+
+let rec scan_elems ib accu =
+  bscanf ib " %i%[]; \t\n\r]"
+    (fun i s ->
+     match s with
+     | ";" -> scan_elems ib (i :: accu)
+     | "]" -> List.rev (i :: accu)
+     | s -> List.rev (i :: accu));;
+
+let scan_int_list ib =
+  bscanf ib " [" ();
+  scan_elems ib [];;
+
+let test17 () =
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4; ]") = [1;2;3;4] &&
+  (* Should fail but succeeds! *)
+  scan_int_list (Scanning.from_string "[1;2;3;4 5]") = [1;2;3;4];;
+
+test (test17 ());;
+
+let rec scan_elems ib accu =
+  bscanf ib " %c " (fun c ->
+    match c with
+    | '[' when accu = [] ->
+        (* begginning of list: could find either
+           - an int, if the list is not empty,
+           - the char ], if the list is empty. *)
+        bscanf ib "%[]]"
+          (function
+           | "]" -> accu
+           | _ ->
+             bscanf ib " %i " (fun i ->
+               scan_rest ib (i :: accu)))
+    | _ -> failwith "scan_elems")
+
+and scan_rest ib accu =
+  bscanf ib " %c " (fun c ->
+    match c with
+    | ';' ->
+        bscanf ib "%[]]"
+          (function
+           | "]" -> accu
+           | _ ->
+             bscanf ib " %i " (fun i ->
+             scan_rest ib (i :: accu)))
+    | ']' -> accu
+    | _ -> failwith "scan_rest");;
+
+let scan_int_list ib = List.rev (scan_elems ib []);;
+
+let test18 () =
+  scan_int_list (Scanning.from_string "[]") = [] &&
+  scan_int_list (Scanning.from_string "[ ]") = [] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4; ]") = [1;2;3;4];;
+
+test (test18 ());;
+
+(* Those properly fail *)
+
+let test19 () =
+  failure_test
+    scan_int_list (Scanning.from_string "[1;2;3;4 5]")
+    "scan_rest";;
+
+(test19 ());;
+
+let test20 () =
+  scan_failure_test 
+    scan_int_list (Scanning.from_string "[1;2;3;4; ; 5]");;
+
+(test20 ());;
+
+let test21 () =
+  scan_failure_test
+    scan_int_list (Scanning.from_string "[1;2;3;4;;");;
+
+(test21 ());;
+
+let rec scan_elems ib accu =
+  bscanf ib "%1[];]" (function
+  | "]" -> accu
+  | ";" -> scan_rest ib accu
+  | _ ->
+    failwith
+      (Printf.sprintf "scan_int_list" (*
+        "scan_int_list: char %i waiting for ']' or ';' but found %c"
+        (Scanning.char_count ib) (Scanning.peek_char ib)*)))
+
+and scan_rest ib accu =
+  bscanf ib "%[]]" (function
+  | "]" -> accu
+  | _ -> scan_elem ib accu)
+
+and scan_elem ib accu =
+  bscanf ib " %i " (fun i -> scan_elems ib (i :: accu));;
+
+let scan_int_list ib =
+  bscanf ib " [ " ();
+  List.rev (scan_rest ib []);;
+
+let test22 () =
+  scan_int_list (Scanning.from_string "[]") = [] &&
+  scan_int_list (Scanning.from_string "[ ]") = [] &&
+  scan_int_list (Scanning.from_string "[1]") = [1] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4;]") = [1;2;3;4];;
+
+test (test22 ());;
+
+(* Should work and does not with this version of scan_int_list!
+scan_int_list (Scanning.from_string "[1;2;3;4; ]");;
+(* Should lead to a bad input error. *)
+scan_int_list (Scanning.from_string "[1;2;3;4 5]");;
+scan_int_list (Scanning.from_string "[1;2;3;4;;");;
+scan_int_list (Scanning.from_string "[1;2;3;4; ; 5]");;
+scan_int_list (Scanning.from_string "[1;2;3;4;; 23]");;
+*)
+
+let rec scan_elems ib accu =
+  try bscanf ib " %i %1[;]" (fun i s ->
+   if s = "" then i :: accu else scan_elems ib (i :: accu)) with
+  | Scan_failure _ -> accu;;
+
+(* The general int list scanner. *)
+let rec scan_int_list ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib [] in
+  bscanf ib " ]" ();
+  List.rev accu;;
+
+(* The general HO list scanner. *)
+let rec scan_elems ib scan_elem accu =
+  try scan_elem ib (fun i s ->
+    let accu = i :: accu in
+    if s = "" then accu else scan_elems ib scan_elem accu) with
+  | Scan_failure _ -> accu;;
+
+let scan_list scan_elem ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib scan_elem [] in
+  bscanf ib " ]" ();
+  List.rev accu;;
+
+(* Deriving particular list scanners from the HO list scanner. *)
+let scan_int_elem ib = bscanf ib " %i %1[;]";;
+let scan_int_list = scan_list scan_int_elem;;
+
+let test23 () =
+  scan_int_list (Scanning.from_string "[]") = [] &&
+  scan_int_list (Scanning.from_string "[ ]") = [] &&
+  scan_int_list (Scanning.from_string "[1]") = [1] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4;]") = [1;2;3;4];;
+
+test (test23 ());;
+
+let test24 () =
+  scan_failure_test scan_int_list (Scanning.from_string "[1;2;3;4 5]")
+and test25 () =
+  scan_failure_test scan_int_list (Scanning.from_string "[1;2;3;4;;")
+and test26 () =
+  scan_failure_test scan_int_list (Scanning.from_string "[1;2;3;4; ; 5]")
+and test27 () =
+  scan_failure_test scan_int_list (Scanning.from_string "[1;2;3;4;; 23]");;
+
+ (test24 ()) &&
+ (test25 ()) &&
+ (test26 ()) &&
+ (test27 ());;
+
+(* To scan a Caml string:
+   the format is "\"%s@\"".
+   A better way would be to add a %S (String.escaped), a %C (Char.escaped).
+   This is now available. *)
+let scan_string_elem ib = bscanf ib " \"%s@\" %1[;]";;
+let scan_string_list = scan_list scan_string_elem;;
+
+let scan_String_elem ib = bscanf ib " %S %1[;]";;
+let scan_String_list = scan_list scan_String_elem;;
+
+let test28 () =
+  scan_string_list (Scanning.from_string "[]") = [] &&
+  scan_string_list (Scanning.from_string "[\"Le\"]") = ["Le"] &&
+  scan_string_list
+    (Scanning.from_string "[\"Le\";\"langage\";\"Objective\";\"Caml\"]") =
+    ["Le"; "langage"; "Objective"; "Caml"] &&
+  scan_string_list
+    (Scanning.from_string "[\"Le\";\"langage\";\"Objective\";\"Caml\"; ]") =
+    ["Le"; "langage"; "Objective"; "Caml"] &&
+
+  scan_String_list (Scanning.from_string "[]") = [] &&
+  scan_String_list (Scanning.from_string "[\"Le\"]") = ["Le"] &&
+  scan_String_list
+    (Scanning.from_string "[\"Le\";\"langage\";\"Objective\";\"Caml\"]") =
+    ["Le"; "langage"; "Objective"; "Caml"] &&
+  scan_String_list
+    (Scanning.from_string "[\"Le\";\"langage\";\"Objective\";\"Caml\"; ]") =
+    ["Le"; "langage"; "Objective"; "Caml"];;
+
+test (test28 ());;
+
+(* The general HO list scanner with continuations. *)
+let rec scan_elems ib scan_elem accu =
+  scan_elem ib
+    (fun i s ->
+     let accu = i :: accu in
+     if s = "" then accu else scan_elems ib scan_elem accu)
+    (fun ib exc -> accu);;
+
+let scan_list scan_elem ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib scan_elem [] in
+  bscanf ib " ]" ();
+  List.rev accu;;
+
+(* Deriving particular list scanners from the HO list scanner. *)
+let scan_int_elem ib f ek = kscanf ib ek " %i %1[;]" f;;
+let scan_int_list = scan_list scan_int_elem;;
+
+let test29 () =
+  scan_int_list (Scanning.from_string "[]") = [] &&
+  scan_int_list (Scanning.from_string "[ ]") = [] &&
+  scan_int_list (Scanning.from_string "[1]") = [1] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4;]") = [1;2;3;4];;
+
+test (test29 ());;
+
+let scan_string_elem ib f ek = kscanf ib ek " %S %1[;]" f;;
+let scan_string_list = scan_list scan_string_elem;;
+
+let test30 () =
+  scan_string_list (Scanning.from_string "[]") = [] &&
+  scan_string_list (Scanning.from_string "[ ]") = [] &&
+  scan_string_list (Scanning.from_string "[ \"1\" ]") = ["1"] &&
+  scan_string_list
+    (Scanning.from_string "[\"1\"; \"2\"; \"3\"; \"4\"]") =
+    ["1"; "2"; "3"; "4"] &&
+  scan_string_list
+    (Scanning.from_string "[\"1\"; \"2\"; \"3\"; \"4\";]") =
+    ["1"; "2"; "3"; "4"];;
+
+test (test30 ());;
+
+(* A generic scan_elem, *)
+let scan_elem fmt ib f ek = kscanf ib ek fmt f;;
+
+(* Derivation of list scanners from the generic polymorphic scanners. *)
+let scan_int_list = scan_list (scan_elem " %i %1[;]");;
+let scan_string_list = scan_list (scan_elem " %S %1[;]");;
+let scan_bool_list = scan_list (scan_elem " %B %1[;]");;
+let scan_char_list = scan_list (scan_elem " %C %1[;]");;
+let scan_float_list = scan_list (scan_elem " %f %1[;]");;
+
+let rec scan_elems ib scan_elem accu =
+  scan_elem ib
+    (fun i ->
+     let accu = i :: accu in
+     kscanf ib
+      (fun ib exc -> accu)
+      " %1[;]"
+      (fun s -> if s = "" then accu else scan_elems ib scan_elem accu))
+  (fun ib exc -> accu);;
+
+let scan_list scan_elem ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib scan_elem [] in
+  bscanf ib " ]" ();
+  List.rev accu;;
+
+let scan_int_list = scan_list (scan_elem " %i");;
+let scan_string_list = scan_list (scan_elem " %S");;
+let scan_bool_list = scan_list (scan_elem " %B");;
+let scan_char_list = scan_list (scan_elem " %C");;
+let scan_float_list = scan_list (scan_elem " %f");;
+
+let test31 () =
+  scan_int_list (Scanning.from_string "[]") = [] &&
+  scan_int_list (Scanning.from_string "[ ]") = [] &&
+  scan_int_list (Scanning.from_string "[1]") = [1] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4]") = [1;2;3;4] &&
+  scan_int_list (Scanning.from_string "[1;2;3;4;]") = [1;2;3;4];;
+
+test (test31 ());;
+
+let test32 () =
+  scan_string_list (Scanning.from_string "[]") = [] &&
+  scan_string_list (Scanning.from_string "[ ]") = [] &&
+  scan_string_list (Scanning.from_string "[ \"1\" ]") = ["1"] &&
+  scan_string_list
+    (Scanning.from_string "[\"1\"; \"2\"; \"3\"; \"4\"]") =
+    ["1"; "2"; "3"; "4"] &&
+  scan_string_list
+    (Scanning.from_string "[\"1\"; \"2\"; \"3\"; \"4\";]") =
+    ["1"; "2"; "3"; "4"];;
+
+test (test32 ());;
+
+(* Using kscanf only.
+   Using formats as ``functional'' specifications to scan elements of
+   lists. *)
+let rec scan_elems ib scan_elem_fmt accu =
+  kscanf ib (fun ib exc -> accu)
+    scan_elem_fmt
+    (fun i ->
+     let accu = i :: accu in
+     kscanf ib (fun ib exc -> accu)
+       " %1[;] "
+       (function
+        | "" -> accu
+        | _ -> scan_elems ib scan_elem_fmt accu)
+    );;
+
+let scan_list scan_elem_fmt ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib scan_elem_fmt [] in
+  bscanf ib " ]" ();
+  List.rev accu;;
+
+let scan_int_list = scan_list "%i";;
+let scan_string_list = scan_list "%S";;
+let scan_bool_list = scan_list "%B";;
+let scan_char_list = scan_list "%C";;
+let scan_float_list = scan_list "%f";;
+
+let test33 () =
+  scan_int_list (Scanning.from_string "[]") = [] &&
+  scan_int_list (Scanning.from_string "[ ]") = [] &&
+  scan_int_list (Scanning.from_string "[ 1 ]") = [1] &&
+  scan_int_list (Scanning.from_string "[ 1 ; 2 ; 3 ; 4 ]") = [1; 2; 3; 4] &&
+  scan_int_list (Scanning.from_string "[1 ;2 ;3 ;4;]") = [1; 2; 3; 4];;
+
+test (test33 ());;
+
+let test34 () =
+  scan_string_list (Scanning.from_string "[]") = [] &&
+  scan_string_list (Scanning.from_string "[ ]") = [] &&
+  scan_string_list (Scanning.from_string "[ \"1\" ]") = ["1"] &&
+  scan_string_list
+    (Scanning.from_string "[\"1\"; \"2\"; \"3\"; \"4\"]") =
+    ["1"; "2"; "3"; "4"] &&
+  scan_string_list
+    (Scanning.from_string "[\"1\"; \"2\"; \"3\"; \"4\";]") =
+    ["1"; "2"; "3"; "4"];;
+
+(* Using kscanf only.
+   Using functions to scan elements of lists. *)
+let rec scan_elems ib scan_elem accu =
+  scan_elem ib
+    (fun elem ->
+     let accu = elem :: accu in
+     kscanf ib (fun ib exc -> accu)
+       " %1[;] "
+       (function
+        | "" -> accu
+        | _ -> scan_elems ib scan_elem accu));;
+
+let scan_list scan_elem ib =
+  bscanf ib "[ " ();
+  let accu = scan_elems ib scan_elem [] in
+  bscanf ib " ]" ();
+  List.rev accu;;
+
+let scan_float ib = Scanf.bscanf ib "%f";;
+
+let scan_int_list = scan_list (fun ib -> Scanf.bscanf ib "%i");;
+let scan_string_list = scan_list (fun ib -> Scanf.bscanf ib "%S");;
+let scan_bool_list = scan_list (fun ib -> Scanf.bscanf ib "%B");;
+let scan_char_list = scan_list (fun ib -> Scanf.bscanf ib "%C");;
+let scan_float_list = scan_list scan_float;;
+
+(* Scanning list of lists of floats. *)
+let scan_float_list_list =
+  scan_list
+    (fun ib k -> k (scan_list (fun ib -> Scanf.bscanf ib "%f") ib));;
+
+let scan_float_list_list =
+  scan_list
+    (fun ib k -> k (scan_list scan_float ib));;
+
+let scan_float_list_list =
+  scan_list
+    (fun ib k -> k (scan_float_list ib));;
+
+(* A general scan_list_list functional. *)
+let scan_list_list scan_elems ib =
+  scan_list
+    (fun ib k -> k (scan_elems ib)) ib;;
+
+let scan_float_list_list = scan_list_list scan_float_list;;
+
+(* Programming with continuations :) *)
+let scan_float_item ib k = k (scan_float ib (fun x -> x));;
+let scan_float_list ib k = k (scan_list scan_float_item ib);;
+let scan_float_list_list ib k = k (scan_list scan_float_list ib);;
+
+test (test34 ());;
+
+(* Testing the %N format. *)
+let test35 () =
+  sscanf "" "%N" (fun x -> x) = 0 &&
+  sscanf "456" "%N" (fun x -> x) = 0 &&
+  sscanf "456" "%d%N" (fun x y -> x, y) = (456, 1) &&
+  sscanf " " "%N%s%N" (fun x s y -> x, s, y) = (0, "", 1);;
+
+test (test35 ());;
+
+(* Testing the %n format. *)
+let test36 () =
+  sscanf "" "%n" (fun x -> x) = 0 &&
+  sscanf "456" "%n" (fun x -> x) = 0 &&
+  sscanf "456" "%d%n" (fun x y -> x, y) = (456, 3) &&
+  sscanf " " "%n%s%n" (fun x s y -> x, s, y) = (0, "", 1);;
+
+test (test36 ());;
+
+(* Weird tests to empty strings or formats. *)
+let test37 () =
+  sscanf "" "" true &&
+  sscanf "" "" (fun x -> x) 1 = 1 &&
+  sscanf "123" "" (fun x -> x) 1 = 1;;
+
+test (test37 ());;
+
+(* Testing end of input condition. *)
+let test38 () =
+  sscanf "a" "a%!" true &&
+  sscanf "a" "a%!%!" true &&
+  sscanf " a" " a%!" true &&
+  sscanf "a " "a %!" true &&
+  sscanf "" "%!" true &&
+  sscanf " " " %!" true &&
+  sscanf "" " %!" true &&
+  sscanf "" " %!%!" true;;
+
+test (test38 ());;
+
+(* Weird tests on empty buffers. *)
+let test39 () =
+  let is_empty_buff ib =
+    Scanning.beginning_of_input ib &&
+    Scanning.end_of_input ib in
+
+  let ib = Scanning.from_string "" in
+  is_empty_buff ib &&
+  (* Do it twice since testing empty buff could incorrectly
+     thraw an exception or wrongly change the beginning_of_input condition. *)
+  is_empty_buff ib;;
+
+test (test39 ());;
+
+(* Testing ranges. *)
+let test40 () =
+ let s = "cba" in
+ let ib = Scanning.from_string s in
+ bscanf ib "%[^ab]%s%!" (fun s1 s2 -> s1 = "c" && s2 = "ba");;
+
+test (test40 ());;
+
+let test41 () =
+ let s = "cba" in
+ let ib = Scanning.from_string s in
+ bscanf ib "%[^abc]%[cba]%!" (fun s1 s2 -> s1 = "" && s2 = "cba");;
+
+test (test41 ());;
+
+let test42 () =
+ let s = "defcbaaghi" in
+ let ib = Scanning.from_string s in
+ bscanf ib "%[^abc]%[abc]%s%!" (fun s1 s2 s3 ->
+   s1 = "def" && s2 = "cbaa" && s3 = "ghi") &&
+ let ib = Scanning.from_string s in
+ bscanf ib "%s@\t" (fun s -> s = "defcbaaghi");;
+
+test (test42 ());;
+
+(* Testing end of file condition (bug found). *)
+let test43, test44 =
+ let s = "" in
+ let ib = Scanning.from_string s in
+ (fun () -> bscanf ib "%i%!" (fun i -> i)),
+ (fun () -> bscanf ib "%!%i" (fun i -> i));;
+
+test_raises_this_exc End_of_file test43 () &&
+test_raises_this_exc End_of_file test44 ();;
+
+(* Testing small range scanning (bug found). *)
+let test45 () =
+ let s = "12.2" in
+ let ib = Scanning.from_string s in
+ bscanf ib "%[0-9].%[0-9]%s%!" (fun s1 s2 s3 ->
+   s1 = "12" && s2 = "2" && s3 = "");;
+
+test (test45 ());;
+
+(* Testing meta formats. *)
+
+let test46, test47 =
+  (fun () ->
+     Printf.sprintf
+       (format_of_string "%i %(%s%).")
+       1 "spells one, %s" "in english"),
+  (fun () ->
+     Printf.sprintf
+       (format_of_string "%i ,%{%s%}, %s.")
+       1 "spells one %s" "in english");;
+
+test (test46 () = "1 spells one, in english.");;
+test (test47 () = "1 ,%s, in english.");;
+
+let test48 () =
+  sscanf "12 \"%i\"89 " "%i %{%d%}%s %!"
+    (fun i f s -> i=12 && f="%i" && s="89");;
+
+test (test48 ());;
+
+(* Testing stoppers after ranges. *)
+let test49 () =
+  sscanf "as" "%[\\]" (fun s -> s = "") &&
+  sscanf "as" "%[\\]%s" (fun s t -> s = "" && t = "as") &&
+  sscanf "as" "%[\\]%s%!" (fun s t -> s = "" && t = "as") &&
+  sscanf "as" "%[a..z]" (fun s -> s = "a") &&
+  sscanf "as" "%[a-z]" (fun s -> s = "as") &&
+  sscanf "as" "%[a..z]%s" (fun s t -> s = "a" && t = "s") &&
+  sscanf "as" "%[a-z]%s" (fun s t -> s = "as" && t = "") &&
+  sscanf "-as" "%[-a-z]" (fun s -> s = "-as") &&
+  sscanf "-as" "%[-a-z]@s" (fun s -> s = "-a") &&
+  sscanf "-as" "-%[a]@s" (fun s -> s = "a") &&   
+  sscanf "-asb" "-%[a]@sb%!" (fun s -> s = "a") &&
+  sscanf "-asb" "-%[a]@s%s" (fun s t -> s = "a" && t = "b");; 
+
+test (test49 ());;
+
+(* Testing buffers defined via functions +
+   co-routines that read and write from the same buffers
+   + range chars and proper handling of \n (and of the end of file
+   condition). *)
+let next_char ob () =
+  let s = Buffer.contents ob in
+  let len = String.length s in
+  if len = 0 then raise End_of_file else
+  let c = s.[0] in
+  Buffer.clear ob;
+  Buffer.add_string ob (String.sub s 1 (len - 1));
+  (*prerr_endline (Printf.sprintf "giving %C" c);*)
+  c;;
+
+let send_string ob s =
+  (*prerr_endline (Printf.sprintf "adding %s\n" s);*)
+  Buffer.add_string ob s; Buffer.add_char ob '\n';;
+let send_int ob i = send_string ob (string_of_int i);;
+
+let rec reader =
+  let count = ref 0 in
+  (fun ib ob ->
+    if Scanf.Scanning.beginning_of_input ib then begin
+      count := 0; send_string ob "start"; writer ib ob end else
+    Scanf.bscanf ib "%[^\n]\n" (function
+    | "stop" -> send_string ob "stop"; writer ib ob
+    | s ->
+      let l = String.length s in
+      count := l + !count;
+      if !count >= 100 then begin
+        send_string ob "stop";
+        send_int ob !count
+        end else
+      send_int ob l;
+      writer ib ob))
+
+and writer ib ob =
+  Scanf.bscanf ib "%s\n" (function
+    | "start" -> send_string ob "Hello World!"; reader ib ob
+    | "stop" -> Scanf.bscanf ib "%i" (function i -> i)
+    | s -> send_int ob (int_of_string s); reader ib ob);;
+
+let go () =
+  let ob = Buffer.create 17 in
+  let ib = Scanf.Scanning.from_function (next_char ob) in
+  reader ib ob;;
+
+let test50 () = go () = 100;;
+
+test (test50 ());;
+
+(* Simple tests may also fail! *)
+let test51 () =
+ sscanf "Hello" "%s" id = "Hello" &&
+ sscanf "Hello\n" "%s\n" id = "Hello" &&
+ sscanf "Hello\n" "%s%s\n" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "") &&
+ sscanf "Hello\nWorld" "%s\n%s%!" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "World") &&
+ sscanf "Hello\nWorld!" "%s\n%s" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "World!") &&
+ sscanf "Hello\n" "%s@\n%s" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "") &&
+ sscanf "Hello \n" "%s@\n%s" (fun s1 s2 ->
+   s1 = "Hello " && s2 = "");;
+
+test (test51 ());;
+
+(* Tests that indeed %s@c works properly.
+   Also tests the difference between \n and @\n.
+   In particular, tests that if no c character can be found in the
+   input, then the token obtained for %s@c spreads to the end of
+   input. *)
+let test52 () =
+ sscanf "Hello\n" "%s@\n" id = "Hello" &&
+ sscanf "Hello" "%s@\n" id = "Hello" &&
+ sscanf "Hello" "%s%s@\n" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "") &&
+ sscanf "Hello\nWorld" "%s@\n%s%!" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "World") &&
+ sscanf "Hello\nWorld!" "%s@\n%s@\n" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "World!") &&
+ sscanf "Hello\n" "%s@\n%s" (fun s1 s2 ->
+   s1 = "Hello" && s2 = "") &&
+ sscanf "Hello \n" "%s%s@\n" (fun s1 s2 ->
+   s1 = "Hello" && s2 = " ");;
+
+test (test52 ());;
+
+(*******
+
+To be continued.
+
+let digest () =
+  let scan_line f = Scanf.scanf "%[^\n\r]@\n" f in
+  let digest s = String.uppercase (Digest.to_hex (Digest.string s)) in
+  let digest_line s = print_endline (s ^ "#" ^ digest s) in
+  try
+   while true do scan_line digest_line done
+  with End_of_file -> ();;
+
+(* Trying to scan records. *)
+let rec scan_fields ib scan_field accu =
+  kscanf ib (fun ib exc -> accu)
+   scan_field
+   (fun i ->
+      let accu = i :: accu in
+      kscanf ib (fun ib exc -> accu)
+       " %1[;] "
+       (fun s ->
+          if s = "" then accu else scan_fields ib scan_field accu));;
+
+let scan_record scan_field ib =
+  bscanf ib "{ " ();
+  let accu = scan_fields ib scan_field [] in
+  bscanf ib " }" ();
+  List.rev accu;;
+***********)
diff --git a/test/Moretest/tscanf2_io.ml b/test/Moretest/tscanf2_io.ml
new file mode 100644 (file)
index 0000000..11c503d
--- /dev/null
@@ -0,0 +1,18 @@
+(* A very simple communication module using buffers. It should help detecting
+   advanced character reading by Scanf when using stdin. *)
+
+let send_flush send ob oc t =
+  send ob t;
+  Buffer.output_buffer oc ob;
+  Buffer.clear ob;
+  flush oc;;
+
+(* The correct sending format for the test should be "%S\n",
+   but to avoid problems when Scanf ask too early for the next character,
+   "%S\n\n" is fine. *)
+let send_string = send_flush (fun ob -> Printf.bprintf ob "%S\n");;
+
+(* The correct reading format for the test should be "%S\n",
+   but to avoid problems when Scanf ask too early for the next character,
+   " %S\n" is fine. *)
+let receive_string ib = Scanf.bscanf ib "%S\n" (fun s -> s);;
diff --git a/test/Moretest/tscanf2_master.ml b/test/Moretest/tscanf2_master.ml
new file mode 100644 (file)
index 0000000..8ff5ef8
--- /dev/null
@@ -0,0 +1,40 @@
+(* A very simple master:
+   - first launch a slave process,
+   - then repeat a random number of times:
+     + print the string " Ping" on stderr,
+     + send it to the slave,
+     + and wait for its answer "-pong",
+   - finally send the string "stop" to the slave
+     and wait for its answer "OK, bye!"
+     and die.
+   
+   Use the communication module Test_scanf_io.
+   
+   Usage: test_master <slave_name> *)
+
+open Tscanf2_io;;
+
+let slave = Sys.argv.(1);;
+let ic, oc = Unix.open_process slave;;
+let ib = Scanf.Scanning.from_channel ic;;
+let ob = Buffer.create 1024;;
+
+let send_string_ping ob = send_string ob oc " Ping";;
+let send_string_stop ob = send_string ob oc "stop";;
+
+let interact i =
+  Printf.eprintf " Ping"; flush stderr;
+  send_string_ping ob;
+  let s = receive_string ib in
+  if s <> "-pong" then failwith ("Master: unbound string " ^ s);;
+  
+Random.self_init ();
+let n = max (Random.int 8) 1 in
+let rec loop i =
+  if i > 0 then (interact i; loop (i - 1)) in
+loop n;;
+
+send_string_stop ob;
+let ack = receive_string ib in
+if ack = "OK, bye!" then (prerr_endline "Test OK."; exit 0) else
+(prerr_endline "Test Failed!"; exit 2);;
diff --git a/test/Moretest/tscanf2_slave.ml b/test/Moretest/tscanf2_slave.ml
new file mode 100644 (file)
index 0000000..5d6b413
--- /dev/null
@@ -0,0 +1,27 @@
+(* A very simple slave:
+   - read the string " Ping" on stdin,
+   - then print the string "-pong" on stderr,
+   - and send it back on stdout
+   - until reading the string "stop" on stdin,
+   - then print the string "!\n" on stderr,
+   - send back the string "OK, bye!" on stdout,
+   - and die.
+
+   Use the communication module Test_scanf_io. *)
+
+open Tscanf2_io;;
+
+let ib = Scanf.Scanning.from_channel stdin;;
+let ob = Buffer.create 1024
+and oc = stdout;;
+
+let send_string_pong ob = send_string ob oc "-pong";;
+let send_string_okbye ob = send_string ob oc "OK, bye!";;
+
+while true do
+  let s = receive_string ib in
+  match s with
+  | " Ping" -> Printf.eprintf "-pong"; flush stderr; send_string_pong ob
+  | "stop" -> Printf.eprintf "!\n"; flush stderr; send_string_okbye ob; exit 0
+  | s -> failwith ("Slave: unbound string " ^ s)
+done;;
diff --git a/test/Moretest/usemultdef.ml b/test/Moretest/usemultdef.ml
new file mode 100644 (file)
index 0000000..2bccabb
--- /dev/null
@@ -0,0 +1 @@
+let _ = print_int(Multdef.f 1); print_newline(); exit 0
diff --git a/test/Moretest/warnings.ml b/test/Moretest/warnings.ml
new file mode 100644 (file)
index 0000000..08e2f29
--- /dev/null
@@ -0,0 +1,44 @@
+
+(* C *)
+
+let foo = ( *);;
+
+
+(* F *)
+
+let f x y = x;;
+f 1; f 1;;
+
+
+(* M *)
+
+(* duh *)
+
+
+(* P *)
+
+let 1 = 1;;
+
+
+(* S *)
+
+1; 1;;
+
+
+(* U *)
+
+match 1 with
+| 1 -> ()
+| 1 -> ()
+| _ -> ()
+;;
+
+
+(* V *)
+
+(* re-duh *)
+
+
+(* X *)
+
+(* re-re *)
diff --git a/test/Moretest/wc.ml b/test/Moretest/wc.ml
new file mode 100644 (file)
index 0000000..dbe46d9
--- /dev/null
@@ -0,0 +1,54 @@
+(* Counts characters, lines and words in one or several files. *)
+
+let chars = ref 0
+and words = ref 0
+and lines = ref 0
+
+type state = Inside_word | Outside_word
+
+let count_channel in_channel =
+  let rec count status =
+    let c = input_char in_channel in
+    incr chars;
+    match c with
+      '\n' ->
+        incr lines; count Outside_word
+    | ' ' | '\t' ->
+        count Outside_word
+    | _ ->
+        if status = Outside_word then begin incr words; () end;
+        count Inside_word
+  in
+    try
+      count Outside_word
+    with End_of_file ->
+      ()
+
+let count_file name =
+  let ic = open_in name in
+  count_channel ic;
+  close_in ic
+
+let print_result () =
+  print_int !chars; print_string " characters, ";
+  print_int !words; print_string " words, ";
+  print_int !lines; print_string " lines";
+  print_newline()
+
+let count name =
+  count_file name;
+  print_result ()
+
+let _ =
+try
+  if Array.length Sys.argv <= 1 then
+    count_channel stdin                (* No command-line arguments *)
+  else
+    for i = 1 to Array.length Sys.argv - 1 do
+      count_file  Sys.argv.(i)
+    done;
+  print_result ()
+with Sys_error s ->
+  print_string "I/O error: ";
+  print_string s;
+  print_newline()
diff --git a/test/Results/almabench.fast.out b/test/Results/almabench.fast.out
new file mode 100644 (file)
index 0000000..5c1d8b8
--- /dev/null
@@ -0,0 +1,8 @@
+0 17.00 -26.06
+1 12.34 1.29
+2 6.83 22.95
+3 0.04 -1.26
+4 2.30 12.54
+5 2.93 14.35
+6 21.27 -16.57
+7 20.41 -19.04
diff --git a/test/Results/almabench.out b/test/Results/almabench.out
new file mode 100644 (file)
index 0000000..5c1d8b8
--- /dev/null
@@ -0,0 +1,8 @@
+0 17.00 -26.06
+1 12.34 1.29
+2 6.83 22.95
+3 0.04 -1.26
+4 2.30 12.54
+5 2.93 14.35
+6 21.27 -16.57
+7 20.41 -19.04
diff --git a/test/Results/bdd.out b/test/Results/bdd.out
new file mode 100644 (file)
index 0000000..d86bac9
--- /dev/null
@@ -0,0 +1 @@
+OK
diff --git a/test/Results/boyer.out b/test/Results/boyer.out
new file mode 100644 (file)
index 0000000..f38e326
--- /dev/null
@@ -0,0 +1 @@
+Proved!
diff --git a/test/Results/fft.fast.out b/test/Results/fft.fast.out
new file mode 100644 (file)
index 0000000..b0f1238
--- /dev/null
@@ -0,0 +1,16 @@
+16... ok
+32... ok
+64... ok
+128... ok
+256... ok
+512... ok
+1024... ok
+2048... ok
+4096... ok
+8192... ok
+16384... ok
+32768... ok
+65536... ok
+131072... ok
+262144... ok
+524288... ok
diff --git a/test/Results/fft.out b/test/Results/fft.out
new file mode 100644 (file)
index 0000000..b0f1238
--- /dev/null
@@ -0,0 +1,16 @@
+16... ok
+32... ok
+64... ok
+128... ok
+256... ok
+512... ok
+1024... ok
+2048... ok
+4096... ok
+8192... ok
+16384... ok
+32768... ok
+65536... ok
+131072... ok
+262144... ok
+524288... ok
diff --git a/test/Results/fib.out b/test/Results/fib.out
new file mode 100644 (file)
index 0000000..1d7ca9c
--- /dev/null
@@ -0,0 +1 @@
+165580141
diff --git a/test/Results/hamming.out b/test/Results/hamming.out
new file mode 100644 (file)
index 0000000..af1339e
--- /dev/null
@@ -0,0 +1,100 @@
+6726050156250000000000000000000000000
+6729216728661136606575523242669244416
+6730293634611118019721084375000000000
+6731430439413948088320000000000000000
+6733644878411293029785156250000000000
+6736815026358904613608094481682268160
+6739031236724077363200000000000000000
+6743282904874568941599068856042651648
+6744421903677486140423997176256921600
+6746640616477458432000000000000000000
+6750000000000000000000000000000000000
+6750897085400702945836103937453588480
+6752037370304563380023474956271616000
+6754258588364960445000000000000000000
+6755399441055744000000000000000000000
+6757621765136718750000000000000000000
+6758519863481752323552044362431792300
+6759661435938757375539248533340160000
+6761885162088395001166534423828125000
+6763027302973440000000000000000000000
+6765252136392518877983093261718750000
+6767294110289640371843415775641600000
+6768437164792816653010961694720000000
+6770663777894400000000000000000000000
+6774935403077748181101173538816000000
+6776079748261363229431903027200000000
+6778308875544000000000000000000000000
+6782585324034592562287109312160000000
+6783730961356018699387011072000000000
+6785962605658597412109375000000000000
+6789341568946838378906250000000000000
+6791390813820928754681118720000000000
+6794772480000000000000000000000000000
+6799059315411241693033267200000000000
+6800207735332289107722240000000000000
+6802444800000000000000000000000000000
+6806736475893120841673472000000000000
+6807886192552970708582400000000000000
+6810125783203125000000000000000000000
+6814422305043756994967597929687500000
+6815573319906622439424000000000000000
+6817815439391434192657470703125000000
+6821025214188390921278195662703296512
+6821210263296961784362792968750000000
+6823269127183128330240000000000000000
+6828727177473454717179297140960133120
+6830973624183426662400000000000000000
+6834375000000000000000000000000000000
+6835283298968211732659055236671758336
+6836437837433370422273768393225011200
+6838686820719522450562500000000000000
+6839841934068940800000000000000000000
+6842092037200927734375000000000000000
+6844157203887991842733489140006912000
+6845313241232438768082197309030400000
+6847565144260608000000000000000000000
+6849817788097425363957881927490234375
+6851885286668260876491458472837120000
+6853042629352726861173598715904000000
+6855297075118080000000000000000000000
+6859622095616220033364938208051200000
+6860780745114630269799801815040000000
+6863037736488300000000000000000000000
+6866455078125000000000000000000000000
+6867367640585024969315698178562000000
+6868527598372968933129348710400000000
+6870787138229329879760742187500000000
+6871947673600000000000000000000000000
+6874208338558673858642578125000000000
+6876283198993690364114632704000000000
+6879707136000000000000000000000000000
+6884047556853882214196183040000000000
+6885210332023942721568768000000000000
+6887475360000000000000000000000000000
+6891820681841784852194390400000000000
+6892984769959882842439680000000000000
+6895252355493164062500000000000000000
+6899602583856803957404692903808593750
+6900767986405455219916800000000000000
+6903038132383827120065689086914062500
+6906475391588173806667327880859375000
+6908559991272917434368000000000000000
+6912000000000000000000000000000000000
+6914086267191872901144038355222134784
+6916360794485719495680000000000000000
+6917529027641081856000000000000000000
+6919804687500000000000000000000000000
+6921893310401287552552190498140323840
+6924170405978516481194531250000000000
+6925339958244802560000000000000000000
+6927618187665939331054687500000000000
+6929709168936591740767657754256998400
+6930879656747844252683224775393280000
+6933159708563865600000000000000000000
+6937533852751614137447601703747584000
+6938705662219635946938268699852800000
+6940988288557056000000000000000000000
+6945367371811422783781999935651840000
+6946540504428563148172299337728000000
+6948825708194403750000000000000000000
diff --git a/test/Results/kb.out b/test/Results/kb.out
new file mode 100644 (file)
index 0000000..2789a66
--- /dev/null
@@ -0,0 +1,5460 @@
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*I(C))
+7 : C*(B*I(C)) = B
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+11 : C*(A*(I(C)*A)) = U
+12 : C*(B*(I(C)*v1)) = B*v1
+13 : I(U)*v1 = v1
+14 : I(I(v1))*U = v1
+15 : I(v3*v2)*(v3*(v2*v1)) = v1
+16 : C*(A*(I(C)*(B*A))) = B
+17 : I(C)*U = C
+18 : C*(A*(I(C)*(A*v1))) = v1
+19 : I(C)*B = B*I(C)
+20 : I(I(v2))*v1 = v2*v1
+Rule 14 deleted
+21 : v1*U = v1
+Rule 17 deleted
+22 : I(C) = C
+Rule 19 deleted
+Rule 18 deleted
+Rule 16 deleted
+Rule 12 deleted
+Rule 11 deleted
+Rule 7 deleted
+23 : C*B = B*C
+24 : C*(A*(C*(A*v1))) = v1
+25 : C*(A*(C*(B*A))) = B
+26 : C*(B*(C*v1)) = B*v1
+27 : C*(A*(C*A)) = U
+28 : C*(B*C) = B
+29 : C*(A*(C*(B*(A*v1)))) = B*v1
+30 : I(I(v2*v1)*v2) = v1
+31 : I(v2*I(v1))*v2 = v1
+32 : I(v4*(v3*v2))*(v4*(v3*(v2*v1))) = v1
+33 : I(v1*A)*(v1*(B*A)) = B
+34 : I(v1*C)*v1 = C
+35 : I(v3*I(v2))*(v3*v1) = v2*v1
+36 : I(v2*A)*(v2*(B*(A*v1))) = B*v1
+37 : I(v2*C)*(v2*v1) = C*v1
+38 : v1*I(v1) = U
+39 : I(C*(A*C))*v1 = A*v1
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+Rule 13 deleted
+42 : I(I(v1)) = v1
+Rule 20 deleted
+43 : C*(B*v1) = B*(C*v1)
+Rule 29 deleted
+Rule 28 deleted
+Rule 26 deleted
+Rule 25 deleted
+44 : A*(C*(A*v1)) = C*v1
+Rule 24 deleted
+45 : A*(C*A) = C
+Rule 27 deleted
+46 : v2*(I(v1*v2)*v1) = U
+47 : I(I(v3*(v2*v1))*(v3*v2)) = v1
+48 : I(I(B*A)*A) = B
+49 : v3*(I(v2*v3)*(v2*v1)) = v1
+50 : I(I(v1)*I(v2)) = v2*v1
+51 : I(I(B*(A*v1))*A) = B*v1
+52 : I(I(v1)*C) = C*v1
+53 : I(v2*I(v1*v2)) = v1
+54 : I(v3*(v2*I(v1)))*(v3*v2) = v1
+55 : I(v1*(C*(A*C)))*v1 = A
+56 : v2*I(I(v1)*v2) = v1
+57 : I(v2*(I(v3*v1)*v3))*v2 = v1
+58 : I(v5*(v4*(v3*v2)))*(v5*(v4*(v3*(v2*v1)))) = v1
+59 : I(v2*(v1*A))*(v2*(v1*(B*A))) = B
+60 : I(v2*(v1*C))*(v2*v1) = C
+61 : I(v4*(v3*I(v2)))*(v4*(v3*v1)) = v2*v1
+62 : I(v3*(v2*A))*(v3*(v2*(B*(A*v1)))) = B*v1
+63 : I(v3*(v2*C))*(v3*(v2*v1)) = C*v1
+64 : I(v3*(I(v4*v2)*v4))*(v3*v1) = v2*v1
+65 : v4*(I(v3*(v2*v4))*(v3*(v2*v1))) = v1
+66 : I(I(B)*A)*A = B
+67 : I(A*A)*(B*(A*A)) = B
+68 : v1*(I(A*v1)*(B*A)) = B
+69 : I(I(v1*A)*(v1*B))*B = A
+70 : v1*I(C*v1) = C
+71 : I(A*I(v1))*(B*A) = v1*B
+72 : I(C*I(v1)) = v1*C
+73 : I(v2*(C*(A*C)))*(v2*v1) = A*v1
+74 : I(A*I(v2))*(B*(A*v1)) = v2*(B*v1)
+75 : v3*(I(I(v2)*v3)*v1) = v2*v1
+76 : I(I(B*I(v1))*A)*(v1*A) = B
+77 : I(v1*A)*(v1*(B*(B*A))) = B*B
+78 : I(I(B)*A)*(A*v1) = B*v1
+79 : I(A*A)*(B*(A*(A*v1))) = B*v1
+80 : I(v2*A)*(v2*(B*(B*(A*v1)))) = B*(B*v1)
+81 : v2*(I(A*v2)*(B*(A*v1))) = B*v1
+82 : I(I(v2*A)*(v2*B))*(B*v1) = A*v1
+83 : I(I(B*I(v2))*A)*(v2*(A*v1)) = B*v1
+84 : I(A*C)*(B*A) = B*C
+85 : I(A*C)*(B*(A*v1)) = B*(C*v1)
+86 : v2*(I(C*v2)*v1) = C*v1
+87 : I(I(B*C)*A)*(C*A) = B
+88 : I(I(B*C)*A)*(C*(A*v1)) = B*v1
+89 : v2*(v1*I(v2*v1)) = U
+90 : B*(A*I(B)) = A
+91 : I(v2*v1)*v2 = I(v1)
+Rule 64 deleted
+Rule 57 deleted
+Rule 55 deleted
+Rule 46 deleted
+Rule 34 deleted
+Rule 31 deleted
+Rule 30 deleted
+92 : I(C*(A*C)) = A
+Rule 39 deleted
+93 : I(v3*(v2*v1))*(v3*v2) = I(v1)
+Rule 60 deleted
+Rule 54 deleted
+Rule 47 deleted
+94 : I(v1*I(v2)) = v2*I(v1)
+Rule 83 deleted
+Rule 76 deleted
+Rule 74 deleted
+Rule 72 deleted
+Rule 71 deleted
+Rule 53 deleted
+Rule 50 deleted
+Rule 35 deleted
+95 : I(v2*(I(B)*A))*(v2*(A*v1)) = B*v1
+96 : I(v1*(I(B)*A))*(v1*A) = B
+97 : I(v1*A)*(v1*B) = B*(C*(A*C))
+Rule 82 deleted
+Rule 69 deleted
+98 : I(v1*C) = C*I(v1)
+Rule 88 deleted
+Rule 87 deleted
+Rule 85 deleted
+Rule 84 deleted
+Rule 52 deleted
+Rule 37 deleted
+99 : v3*(v2*(I(v3*v2)*v1)) = v1
+100 : B*(A*(I(B)*v1)) = A*v1
+101 : I(v3*v2)*(v3*v1) = I(v2)*v1
+Rule 97 deleted
+Rule 96 deleted
+Rule 95 deleted
+Rule 93 deleted
+Rule 80 deleted
+Rule 77 deleted
+Rule 73 deleted
+Rule 65 deleted
+Rule 63 deleted
+Rule 62 deleted
+Rule 61 deleted
+Rule 59 deleted
+Rule 58 deleted
+Rule 49 deleted
+Rule 36 deleted
+Rule 33 deleted
+Rule 32 deleted
+Rule 15 deleted
+102 : B*(C*I(B)) = C
+103 : B*(C*(I(B)*v1)) = C*v1
+104 : B*(I(B*A)*A) = U
+105 : B*(I(B*A)*(A*v1)) = v1
+106 : I(B*A)*A = I(B)
+Rule 104 deleted
+Rule 48 deleted
+107 : B*(v1*(I(B*(A*v1))*A)) = U
+108 : I(I(B*(B*A))*A) = B*B
+109 : B*(v2*(I(B*(A*v2))*(A*v1))) = v1
+110 : I(I(B*(B*(A*v1)))*A) = B*(B*v1)
+111 : I(I(B)*A) = B*(C*(A*C))
+Rule 78 deleted
+Rule 66 deleted
+112 : I(I(B*v1)*A) = B*(C*(A*(C*v1)))
+Rule 110 deleted
+Rule 108 deleted
+Rule 51 deleted
+113 : v3*(v2*I(I(v1)*(v3*v2))) = v1
+114 : v1*I(C*(A*(C*v1))) = A
+115 : I(I(v1)*v2) = I(v2)*v1
+Rule 113 deleted
+Rule 112 deleted
+Rule 111 deleted
+Rule 75 deleted
+Rule 56 deleted
+116 : v2*(v1*(I(A*(v2*v1))*(B*A))) = B
+117 : I(A*v1)*(B*A) = I(v1)*B
+Rule 116 deleted
+Rule 68 deleted
+118 : v2*(v1*I(C*(v2*v1))) = C
+119 : I(C*v1) = I(v1)*C
+Rule 118 deleted
+Rule 114 deleted
+Rule 92 deleted
+Rule 86 deleted
+Rule 70 deleted
+120 : v1*(I(A*(C*v1))*C) = A
+121 : I(A*A)*(B*(B*(A*A))) = B*B
+122 : I(A*A)*(B*(B*(A*(A*v1)))) = B*(B*v1)
+123 : I(A*A)*(B*(A*v1)) = B*(C*(A*(C*v1)))
+Rule 79 deleted
+Rule 67 deleted
+124 : v3*(v2*(I(A*(v3*v2))*(B*(A*v1)))) = B*v1
+125 : v1*(I(A*v1)*(B*(B*A))) = B*B
+126 : I(A*v2)*(B*(A*v1)) = I(v2)*(B*v1)
+Rule 124 deleted
+Rule 123 deleted
+Rule 81 deleted
+127 : v3*(v2*(v1*I(v3*(v2*v1)))) = U
+128 : v2*I(v1*v2) = I(v1)
+Rule 89 deleted
+129 : A*I(B) = I(B)*A
+Rule 90 deleted
+130 : I(v1*v2) = I(v2)*I(v1)
+Rule 128 deleted
+Rule 127 deleted
+Rule 126 deleted
+Rule 125 deleted
+Rule 122 deleted
+Rule 121 deleted
+Rule 120 deleted
+Rule 119 deleted
+Rule 117 deleted
+Rule 115 deleted
+Rule 109 deleted
+Rule 107 deleted
+Rule 106 deleted
+Rule 105 deleted
+Rule 101 deleted
+Rule 99 deleted
+Rule 98 deleted
+Rule 94 deleted
+Rule 91 deleted
+131 : B*(C*(A*(C*(I(B)*(A*v1))))) = v1
+132 : B*(C*(A*(C*(I(B)*A)))) = U
+133 : C*(A*(C*(I(B)*A))) = I(B)
+Rule 132 deleted
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+Rule 100 deleted
+135 : C*I(B) = I(B)*C
+Rule 102 deleted
+136 : C*(I(B)*v1) = I(B)*(C*v1)
+Rule 133 deleted
+Rule 131 deleted
+Rule 103 deleted
+Canonical set found :
+1 : U*v1 = v1
+2 : I(v1)*v1 = U
+3 : (v3*v2)*v1 = v3*(v2*v1)
+4 : A*B = B*A
+5 : C*C = U
+6 : I(A) = C*(A*C)
+8 : I(v2)*(v2*v1) = v1
+9 : A*(B*v1) = B*(A*v1)
+10 : C*(C*v1) = v1
+21 : v1*U = v1
+22 : I(C) = C
+23 : C*B = B*C
+38 : v1*I(v1) = U
+40 : v2*(I(v2)*v1) = v1
+41 : I(U) = U
+42 : I(I(v1)) = v1
+43 : C*(B*v1) = B*(C*v1)
+44 : A*(C*(A*v1)) = C*v1
+45 : A*(C*A) = C
+129 : A*I(B) = I(B)*A
+130 : I(v1*v2) = I(v2)*I(v1)
+134 : A*(I(B)*v1) = I(B)*(A*v1)
+135 : C*I(B) = I(B)*C
+136 : C*(I(B)*v1) = I(B)*(C*v1)
diff --git a/test/Results/nucleic.out b/test/Results/nucleic.out
new file mode 100644 (file)
index 0000000..14689cd
--- /dev/null
@@ -0,0 +1 @@
+33.7976
diff --git a/test/Results/quicksort.fast.out b/test/Results/quicksort.fast.out
new file mode 100644 (file)
index 0000000..2c94e48
--- /dev/null
@@ -0,0 +1,2 @@
+OK
+OK
diff --git a/test/Results/quicksort.out b/test/Results/quicksort.out
new file mode 100644 (file)
index 0000000..2c94e48
--- /dev/null
@@ -0,0 +1,2 @@
+OK
+OK
diff --git a/test/Results/sieve.out b/test/Results/sieve.out
new file mode 100644 (file)
index 0000000..eb96be0
--- /dev/null
@@ -0,0 +1 @@
+2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003 5009 5011 5021 5023 5039 5051 5059 5077 5081 5087 5099 5101 5107 5113 5119 5147 5153 5167 5171 5179 5189 5197 5209 5227 5231 5233 5237 5261 5273 5279 5281 5297 5303 5309 5323 5333 5347 5351 5381 5387 5393 5399 5407 5413 5417 5419 5431 5437 5441 5443 5449 5471 5477 5479 5483 5501 5503 5507 5519 5521 5527 5531 5557 5563 5569 5573 5581 5591 5623 5639 5641 5647 5651 5653 5657 5659 5669 5683 5689 5693 5701 5711 5717 5737 5741 5743 5749 5779 5783 5791 5801 5807 5813 5821 5827 5839 5843 5849 5851 5857 5861 5867 5869 5879 5881 5897 5903 5923 5927 5939 5953 5981 5987 6007 6011 6029 6037 6043 6047 6053 6067 6073 6079 6089 6091 6101 6113 6121 6131 6133 6143 6151 6163 6173 6197 6199 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 6781 6791 6793 6803 6823 6827 6829 6833 6841 6857 6863 6869 6871 6883 6899 6907 6911 6917 6947 6949 6959 6961 6967 6971 6977 6983 6991 6997 7001 7013 7019 7027 7039 7043 7057 7069 7079 7103 7109 7121 7127 7129 7151 7159 7177 7187 7193 7207 7211 7213 7219 7229 7237 7243 7247 7253 7283 7297 7307 7309 7321 7331 7333 7349 7351 7369 7393 7411 7417 7433 7451 7457 7459 7477 7481 7487 7489 7499 7507 7517 7523 7529 7537 7541 7547 7549 7559 7561 7573 7577 7583 7589 7591 7603 7607 7621 7639 7643 7649 7669 7673 7681 7687 7691 7699 7703 7717 7723 7727 7741 7753 7757 7759 7789 7793 7817 7823 7829 7841 7853 7867 7873 7877 7879 7883 7901 7907 7919 7927 7933 7937 7949 7951 7963 7993 8009 8011 8017 8039 8053 8059 8069 8081 8087 8089 8093 8101 8111 8117 8123 8147 8161 8167 8171 8179 8191 8209 8219 8221 8231 8233 8237 8243 8263 8269 8273 8287 8291 8293 8297 8311 8317 8329 8353 8363 8369 8377 8387 8389 8419 8423 8429 8431 8443 8447 8461 8467 8501 8513 8521 8527 8537 8539 8543 8563 8573 8581 8597 8599 8609 8623 8627 8629 8641 8647 8663 8669 8677 8681 8689 8693 8699 8707 8713 8719 8731 8737 8741 8747 8753 8761 8779 8783 8803 8807 8819 8821 8831 8837 8839 8849 8861 8863 8867 8887 8893 8923 8929 8933 8941 8951 8963 8969 8971 8999 9001 9007 9011 9013 9029 9041 9043 9049 9059 9067 9091 9103 9109 9127 9133 9137 9151 9157 9161 9173 9181 9187 9199 9203 9209 9221 9227 9239 9241 9257 9277 9281 9283 9293 9311 9319 9323 9337 9341 9343 9349 9371 9377 9391 9397 9403 9413 9419 9421 9431 9433 9437 9439 9461 9463 9467 9473 9479 9491 9497 9511 9521 9533 9539 9547 9551 9587 9601 9613 9619 9623 9629 9631 9643 9649 9661 9677 9679 9689 9697 9719 9721 9733 9739 9743 9749 9767 9769 9781 9787 9791 9803 9811 9817 9829 9833 9839 9851 9857 9859 9871 9883 9887 9901 9907 9923 9929 9931 9941 9949 9967 9973 10007 10009 10037 10039 10061 10067 10069 10079 10091 10093 10099 10103 10111 10133 10139 10141 10151 10159 10163 10169 10177 10181 10193 10211 10223 10243 10247 10253 10259 10267 10271 10273 10289 10301 10303 10313 10321 10331 10333 10337 10343 10357 10369 10391 10399 10427 10429 10433 10453 10457 10459 10463 10477 10487 10499 10501 10513 10529 10531 10559 10567 10589 10597 10601 10607 10613 10627 10631 10639 10651 10657 10663 10667 10687 10691 10709 10711 10723 10729 10733 10739 10753 10771 10781 10789 10799 10831 10837 10847 10853 10859 10861 10867 10883 10889 10891 10903 10909 10937 10939 10949 10957 10973 10979 10987 10993 11003 11027 11047 11057 11059 11069 11071 11083 11087 11093 11113 11117 11119 11131 11149 11159 11161 11171 11173 11177 11197 11213 11239 11243 11251 11257 11261 11273 11279 11287 11299 11311 11317 11321 11329 11351 11353 11369 11383 11393 11399 11411 11423 11437 11443 11447 11467 11471 11483 11489 11491 11497 11503 11519 11527 11549 11551 11579 11587 11593 11597 11617 11621 11633 11657 11677 11681 11689 11699 11701 11717 11719 11731 11743 11777 11779 11783 11789 11801 11807 11813 11821 11827 11831 11833 11839 11863 11867 11887 11897 11903 11909 11923 11927 11933 11939 11941 11953 11959 11969 11971 11981 11987 12007 12011 12037 12041 12043 12049 12071 12073 12097 12101 12107 12109 12113 12119 12143 12149 12157 12161 12163 12197 12203 12211 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 12329 12343 12347 12373 12377 12379 12391 12401 12409 12413 12421 12433 12437 12451 12457 12473 12479 12487 12491 12497 12503 12511 12517 12527 12539 12541 12547 12553 12569 12577 12583 12589 12601 12611 12613 12619 12637 12641 12647 12653 12659 12671 12689 12697 12703 12713 12721 12739 12743 12757 12763 12781 12791 12799 12809 12821 12823 12829 12841 12853 12889 12893 12899 12907 12911 12917 12919 12923 12941 12953 12959 12967 12973 12979 12983 13001 13003 13007 13009 13033 13037 13043 13049 13063 13093 13099 13103 13109 13121 13127 13147 13151 13159 13163 13171 13177 13183 13187 13217 13219 13229 13241 13249 13259 13267 13291 13297 13309 13313 13327 13331 13337 13339 13367 13381 13397 13399 13411 13417 13421 13441 13451 13457 13463 13469 13477 13487 13499 13513 13523 13537 13553 13567 13577 13591 13597 13613 13619 13627 13633 13649 13669 13679 13681 13687 13691 13693 13697 13709 13711 13721 13723 13729 13751 13757 13759 13763 13781 13789 13799 13807 13829 13831 13841 13859 13873 13877 13879 13883 13901 13903 13907 13913 13921 13931 13933 13963 13967 13997 13999 14009 14011 14029 14033 14051 14057 14071 14081 14083 14087 14107 14143 14149 14153 14159 14173 14177 14197 14207 14221 14243 14249 14251 14281 14293 14303 14321 14323 14327 14341 14347 14369 14387 14389 14401 14407 14411 14419 14423 14431 14437 14447 14449 14461 14479 14489 14503 14519 14533 14537 14543 14549 14551 14557 14561 14563 14591 14593 14621 14627 14629 14633 14639 14653 14657 14669 14683 14699 14713 14717 14723 14731 14737 14741 14747 14753 14759 14767 14771 14779 14783 14797 14813 14821 14827 14831 14843 14851 14867 14869 14879 14887 14891 14897 14923 14929 14939 14947 14951 14957 14969 14983 15013 15017 15031 15053 15061 15073 15077 15083 15091 15101 15107 15121 15131 15137 15139 15149 15161 15173 15187 15193 15199 15217 15227 15233 15241 15259 15263 15269 15271 15277 15287 15289 15299 15307 15313 15319 15329 15331 15349 15359 15361 15373 15377 15383 15391 15401 15413 15427 15439 15443 15451 15461 15467 15473 15493 15497 15511 15527 15541 15551 15559 15569 15581 15583 15601 15607 15619 15629 15641 15643 15647 15649 15661 15667 15671 15679 15683 15727 15731 15733 15737 15739 15749 15761 15767 15773 15787 15791 15797 15803 15809 15817 15823 15859 15877 15881 15887 15889 15901 15907 15913 15919 15923 15937 15959 15971 15973 15991 16001 16007 16033 16057 16061 16063 16067 16069 16073 16087 16091 16097 16103 16111 16127 16139 16141 16183 16187 16189 16193 16217 16223 16229 16231 16249 16253 16267 16273 16301 16319 16333 16339 16349 16361 16363 16369 16381 16411 16417 16421 16427 16433 16447 16451 16453 16477 16481 16487 16493 16519 16529 16547 16553 16561 16567 16573 16603 16607 16619 16631 16633 16649 16651 16657 16661 16673 16691 16693 16699 16703 16729 16741 16747 16759 16763 16787 16811 16823 16829 16831 16843 16871 16879 16883 16889 16901 16903 16921 16927 16931 16937 16943 16963 16979 16981 16987 16993 17011 17021 17027 17029 17033 17041 17047 17053 17077 17093 17099 17107 17117 17123 17137 17159 17167 17183 17189 17191 17203 17207 17209 17231 17239 17257 17291 17293 17299 17317 17321 17327 17333 17341 17351 17359 17377 17383 17387 17389 17393 17401 17417 17419 17431 17443 17449 17467 17471 17477 17483 17489 17491 17497 17509 17519 17539 17551 17569 17573 17579 17581 17597 17599 17609 17623 17627 17657 17659 17669 17681 17683 17707 17713 17729 17737 17747 17749 17761 17783 17789 17791 17807 17827 17837 17839 17851 17863 17881 17891 17903 17909 17911 17921 17923 17929 17939 17957 17959 17971 17977 17981 17987 17989 18013 18041 18043 18047 18049 18059 18061 18077 18089 18097 18119 18121 18127 18131 18133 18143 18149 18169 18181 18191 18199 18211 18217 18223 18229 18233 18251 18253 18257 18269 18287 18289 18301 18307 18311 18313 18329 18341 18353 18367 18371 18379 18397 18401 18413 18427 18433 18439 18443 18451 18457 18461 18481 18493 18503 18517 18521 18523 18539 18541 18553 18583 18587 18593 18617 18637 18661 18671 18679 18691 18701 18713 18719 18731 18743 18749 18757 18773 18787 18793 18797 18803 18839 18859 18869 18899 18911 18913 18917 18919 18947 18959 18973 18979 19001 19009 19013 19031 19037 19051 19069 19073 19079 19081 19087 19121 19139 19141 19157 19163 19181 19183 19207 19211 19213 19219 19231 19237 19249 19259 19267 19273 19289 19301 19309 19319 19333 19373 19379 19381 19387 19391 19403 19417 19421 19423 19427 19429 19433 19441 19447 19457 19463 19469 19471 19477 19483 19489 19501 19507 19531 19541 19543 19553 19559 19571 19577 19583 19597 19603 19609 19661 19681 19687 19697 19699 19709 19717 19727 19739 19751 19753 19759 19763 19777 19793 19801 19813 19819 19841 19843 19853 19861 19867 19889 19891 19913 19919 19927 19937 19949 19961 19963 19973 19979 19991 19993 19997 20011 20021 20023 20029 20047 20051 20063 20071 20089 20101 20107 20113 20117 20123 20129 20143 20147 20149 20161 20173 20177 20183 20201 20219 20231 20233 20249 20261 20269 20287 20297 20323 20327 20333 20341 20347 20353 20357 20359 20369 20389 20393 20399 20407 20411 20431 20441 20443 20477 20479 20483 20507 20509 20521 20533 20543 20549 20551 20563 20593 20599 20611 20627 20639 20641 20663 20681 20693 20707 20717 20719 20731 20743 20747 20749 20753 20759 20771 20773 20789 20807 20809 20849 20857 20873 20879 20887 20897 20899 20903 20921 20929 20939 20947 20959 20963 20981 20983 21001 21011 21013 21017 21019 21023 21031 21059 21061 21067 21089 21101 21107 21121 21139 21143 21149 21157 21163 21169 21179 21187 21191 21193 21211 21221 21227 21247 21269 21277 21283 21313 21317 21319 21323 21341 21347 21377 21379 21383 21391 21397 21401 21407 21419 21433 21467 21481 21487 21491 21493 21499 21503 21517 21521 21523 21529 21557 21559 21563 21569 21577 21587 21589 21599 21601 21611 21613 21617 21647 21649 21661 21673 21683 21701 21713 21727 21737 21739 21751 21757 21767 21773 21787 21799 21803 21817 21821 21839 21841 21851 21859 21863 21871 21881 21893 21911 21929 21937 21943 21961 21977 21991 21997 22003 22013 22027 22031 22037 22039 22051 22063 22067 22073 22079 22091 22093 22109 22111 22123 22129 22133 22147 22153 22157 22159 22171 22189 22193 22229 22247 22259 22271 22273 22277 22279 22283 22291 22303 22307 22343 22349 22367 22369 22381 22391 22397 22409 22433 22441 22447 22453 22469 22481 22483 22501 22511 22531 22541 22543 22549 22567 22571 22573 22613 22619 22621 22637 22639 22643 22651 22669 22679 22691 22697 22699 22709 22717 22721 22727 22739 22741 22751 22769 22777 22783 22787 22807 22811 22817 22853 22859 22861 22871 22877 22901 22907 22921 22937 22943 22961 22963 22973 22993 23003 23011 23017 23021 23027 23029 23039 23041 23053 23057 23059 23063 23071 23081 23087 23099 23117 23131 23143 23159 23167 23173 23189 23197 23201 23203 23209 23227 23251 23269 23279 23291 23293 23297 23311 23321 23327 23333 23339 23357 23369 23371 23399 23417 23431 23447 23459 23473 23497 23509 23531 23537 23539 23549 23557 23561 23563 23567 23581 23593 23599 23603 23609 23623 23627 23629 23633 23663 23669 23671 23677 23687 23689 23719 23741 23743 23747 23753 23761 23767 23773 23789 23801 23813 23819 23827 23831 23833 23857 23869 23873 23879 23887 23893 23899 23909 23911 23917 23929 23957 23971 23977 23981 23993 24001 24007 24019 24023 24029 24043 24049 24061 24071 24077 24083 24091 24097 24103 24107 24109 24113 24121 24133 24137 24151 24169 24179 24181 24197 24203 24223 24229 24239 24247 24251 24281 24317 24329 24337 24359 24371 24373 24379 24391 24407 24413 24419 24421 24439 24443 24469 24473 24481 24499 24509 24517 24527 24533 24547 24551 24571 24593 24611 24623 24631 24659 24671 24677 24683 24691 24697 24709 24733 24749 24763 24767 24781 24793 24799 24809 24821 24841 24847 24851 24859 24877 24889 24907 24917 24919 24923 24943 24953 24967 24971 24977 24979 24989 25013 25031 25033 25037 25057 25073 25087 25097 25111 25117 25121 25127 25147 25153 25163 25169 25171 25183 25189 25219 25229 25237 25243 25247 25253 25261 25301 25303 25307 25309 25321 25339 25343 25349 25357 25367 25373 25391 25409 25411 25423 25439 25447 25453 25457 25463 25469 25471 25523 25537 25541 25561 25577 25579 25583 25589 25601 25603 25609 25621 25633 25639 25643 25657 25667 25673 25679 25693 25703 25717 25733 25741 25747 25759 25763 25771 25793 25799 25801 25819 25841 25847 25849 25867 25873 25889 25903 25913 25919 25931 25933 25939 25943 25951 25969 25981 25997 25999 26003 26017 26021 26029 26041 26053 26083 26099 26107 26111 26113 26119 26141 26153 26161 26171 26177 26183 26189 26203 26209 26227 26237 26249 26251 26261 26263 26267 26293 26297 26309 26317 26321 26339 26347 26357 26371 26387 26393 26399 26407 26417 26423 26431 26437 26449 26459 26479 26489 26497 26501 26513 26539 26557 26561 26573 26591 26597 26627 26633 26641 26647 26669 26681 26683 26687 26693 26699 26701 26711 26713 26717 26723 26729 26731 26737 26759 26777 26783 26801 26813 26821 26833 26839 26849 26861 26863 26879 26881 26891 26893 26903 26921 26927 26947 26951 26953 26959 26981 26987 26993 27011 27017 27031 27043 27059 27061 27067 27073 27077 27091 27103 27107 27109 27127 27143 27179 27191 27197 27211 27239 27241 27253 27259 27271 27277 27281 27283 27299 27329 27337 27361 27367 27397 27407 27409 27427 27431 27437 27449 27457 27479 27481 27487 27509 27527 27529 27539 27541 27551 27581 27583 27611 27617 27631 27647 27653 27673 27689 27691 27697 27701 27733 27737 27739 27743 27749 27751 27763 27767 27773 27779 27791 27793 27799 27803 27809 27817 27823 27827 27847 27851 27883 27893 27901 27917 27919 27941 27943 27947 27953 27961 27967 27983 27997 28001 28019 28027 28031 28051 28057 28069 28081 28087 28097 28099 28109 28111 28123 28151 28163 28181 28183 28201 28211 28219 28229 28277 28279 28283 28289 28297 28307 28309 28319 28349 28351 28387 28393 28403 28409 28411 28429 28433 28439 28447 28463 28477 28493 28499 28513 28517 28537 28541 28547 28549 28559 28571 28573 28579 28591 28597 28603 28607 28619 28621 28627 28631 28643 28649 28657 28661 28663 28669 28687 28697 28703 28711 28723 28729 28751 28753 28759 28771 28789 28793 28807 28813 28817 28837 28843 28859 28867 28871 28879 28901 28909 28921 28927 28933 28949 28961 28979 29009 29017 29021 29023 29027 29033 29059 29063 29077 29101 29123 29129 29131 29137 29147 29153 29167 29173 29179 29191 29201 29207 29209 29221 29231 29243 29251 29269 29287 29297 29303 29311 29327 29333 29339 29347 29363 29383 29387 29389 29399 29401 29411 29423 29429 29437 29443 29453 29473 29483 29501 29527 29531 29537 29567 29569 29573 29581 29587 29599 29611 29629 29633 29641 29663 29669 29671 29683 29717 29723 29741 29753 29759 29761 29789 29803 29819 29833 29837 29851 29863 29867 29873 29879 29881 29917 29921 29927 29947 29959 29983 29989 30011 30013 30029 30047 30059 30071 30089 30091 30097 30103 30109 30113 30119 30133 30137 30139 30161 30169 30181 30187 30197 30203 30211 30223 30241 30253 30259 30269 30271 30293 30307 30313 30319 30323 30341 30347 30367 30389 30391 30403 30427 30431 30449 30467 30469 30491 30493 30497 30509 30517 30529 30539 30553 30557 30559 30577 30593 30631 30637 30643 30649 30661 30671 30677 30689 30697 30703 30707 30713 30727 30757 30763 30773 30781 30803 30809 30817 30829 30839 30841 30851 30853 30859 30869 30871 30881 30893 30911 30931 30937 30941 30949 30971 30977 30983 31013 31019 31033 31039 31051 31063 31069 31079 31081 31091 31121 31123 31139 31147 31151 31153 31159 31177 31181 31183 31189 31193 31219 31223 31231 31237 31247 31249 31253 31259 31267 31271 31277 31307 31319 31321 31327 31333 31337 31357 31379 31387 31391 31393 31397 31469 31477 31481 31489 31511 31513 31517 31531 31541 31543 31547 31567 31573 31583 31601 31607 31627 31643 31649 31657 31663 31667 31687 31699 31721 31723 31727 31729 31741 31751 31769 31771 31793 31799 31817 31847 31849 31859 31873 31883 31891 31907 31957 31963 31973 31981 31991 32003 32009 32027 32029 32051 32057 32059 32063 32069 32077 32083 32089 32099 32117 32119 32141 32143 32159 32173 32183 32189 32191 32203 32213 32233 32237 32251 32257 32261 32297 32299 32303 32309 32321 32323 32327 32341 32353 32359 32363 32369 32371 32377 32381 32401 32411 32413 32423 32429 32441 32443 32467 32479 32491 32497 32503 32507 32531 32533 32537 32561 32563 32569 32573 32579 32587 32603 32609 32611 32621 32633 32647 32653 32687 32693 32707 32713 32717 32719 32749 32771 32779 32783 32789 32797 32801 32803 32831 32833 32839 32843 32869 32887 32909 32911 32917 32933 32939 32941 32957 32969 32971 32983 32987 32993 32999 33013 33023 33029 33037 33049 33053 33071 33073 33083 33091 33107 33113 33119 33149 33151 33161 33179 33181 33191 33199 33203 33211 33223 33247 33287 33289 33301 33311 33317 33329 33331 33343 33347 33349 33353 33359 33377 33391 33403 33409 33413 33427 33457 33461 33469 33479 33487 33493 33503 33521 33529 33533 33547 33563 33569 33577 33581 33587 33589 33599 33601 33613 33617 33619 33623 33629 33637 33641 33647 33679 33703 33713 33721 33739 33749 33751 33757 33767 33769 33773 33791 33797 33809 33811 33827 33829 33851 33857 33863 33871 33889 33893 33911 33923 33931 33937 33941 33961 33967 33997 34019 34031 34033 34039 34057 34061 34123 34127 34129 34141 34147 34157 34159 34171 34183 34211 34213 34217 34231 34253 34259 34261 34267 34273 34283 34297 34301 34303 34313 34319 34327 34337 34351 34361 34367 34369 34381 34403 34421 34429 34439 34457 34469 34471 34483 34487 34499 34501 34511 34513 34519 34537 34543 34549 34583 34589 34591 34603 34607 34613 34631 34649 34651 34667 34673 34679 34687 34693 34703 34721 34729 34739 34747 34757 34759 34763 34781 34807 34819 34841 34843 34847 34849 34871 34877 34883 34897 34913 34919 34939 34949 34961 34963 34981 35023 35027 35051 35053 35059 35069 35081 35083 35089 35099 35107 35111 35117 35129 35141 35149 35153 35159 35171 35201 35221 35227 35251 35257 35267 35279 35281 35291 35311 35317 35323 35327 35339 35353 35363 35381 35393 35401 35407 35419 35423 35437 35447 35449 35461 35491 35507 35509 35521 35527 35531 35533 35537 35543 35569 35573 35591 35593 35597 35603 35617 35671 35677 35729 35731 35747 35753 35759 35771 35797 35801 35803 35809 35831 35837 35839 35851 35863 35869 35879 35897 35899 35911 35923 35933 35951 35963 35969 35977 35983 35993 35999 36007 36011 36013 36017 36037 36061 36067 36073 36083 36097 36107 36109 36131 36137 36151 36161 36187 36191 36209 36217 36229 36241 36251 36263 36269 36277 36293 36299 36307 36313 36319 36341 36343 36353 36373 36383 36389 36433 36451 36457 36467 36469 36473 36479 36493 36497 36523 36527 36529 36541 36551 36559 36563 36571 36583 36587 36599 36607 36629 36637 36643 36653 36671 36677 36683 36691 36697 36709 36713 36721 36739 36749 36761 36767 36779 36781 36787 36791 36793 36809 36821 36833 36847 36857 36871 36877 36887 36899 36901 36913 36919 36923 36929 36931 36943 36947 36973 36979 36997 37003 37013 37019 37021 37039 37049 37057 37061 37087 37097 37117 37123 37139 37159 37171 37181 37189 37199 37201 37217 37223 37243 37253 37273 37277 37307 37309 37313 37321 37337 37339 37357 37361 37363 37369 37379 37397 37409 37423 37441 37447 37463 37483 37489 37493 37501 37507 37511 37517 37529 37537 37547 37549 37561 37567 37571 37573 37579 37589 37591 37607 37619 37633 37643 37649 37657 37663 37691 37693 37699 37717 37747 37781 37783 37799 37811 37813 37831 37847 37853 37861 37871 37879 37889 37897 37907 37951 37957 37963 37967 37987 37991 37993 37997 38011 38039 38047 38053 38069 38083 38113 38119 38149 38153 38167 38177 38183 38189 38197 38201 38219 38231 38237 38239 38261 38273 38281 38287 38299 38303 38317 38321 38327 38329 38333 38351 38371 38377 38393 38431 38447 38449 38453 38459 38461 38501 38543 38557 38561 38567 38569 38593 38603 38609 38611 38629 38639 38651 38653 38669 38671 38677 38693 38699 38707 38711 38713 38723 38729 38737 38747 38749 38767 38783 38791 38803 38821 38833 38839 38851 38861 38867 38873 38891 38903 38917 38921 38923 38933 38953 38959 38971 38977 38993 39019 39023 39041 39043 39047 39079 39089 39097 39103 39107 39113 39119 39133 39139 39157 39161 39163 39181 39191 39199 39209 39217 39227 39229 39233 39239 39241 39251 39293 39301 39313 39317 39323 39341 39343 39359 39367 39371 39373 39383 39397 39409 39419 39439 39443 39451 39461 39499 39503 39509 39511 39521 39541 39551 39563 39569 39581 39607 39619 39623 39631 39659 39667 39671 39679 39703 39709 39719 39727 39733 39749 39761 39769 39779 39791 39799 39821 39827 39829 39839 39841 39847 39857 39863 39869 39877 39883 39887 39901 39929 39937 39953 39971 39979 39983 39989 40009 40013 40031 40037 40039 40063 40087 40093 40099 40111 40123 40127 40129 40151 40153 40163 40169 40177 40189 40193 40213 40231 40237 40241 40253 40277 40283 40289 40343 40351 40357 40361 40387 40423 40427 40429 40433 40459 40471 40483 40487 40493 40499 40507 40519 40529 40531 40543 40559 40577 40583 40591 40597 40609 40627 40637 40639 40693 40697 40699 40709 40739 40751 40759 40763 40771 40787 40801 40813 40819 40823 40829 40841 40847 40849 40853 40867 40879 40883 40897 40903 40927 40933 40939 40949 40961 40973 40993 41011 41017 41023 41039 41047 41051 41057 41077 41081 41113 41117 41131 41141 41143 41149 41161 41177 41179 41183 41189 41201 41203 41213 41221 41227 41231 41233 41243 41257 41263 41269 41281 41299 41333 41341 41351 41357 41381 41387 41389 41399 41411 41413 41443 41453 41467 41479 41491 41507 41513 41519 41521 41539 41543 41549 41579 41593 41597 41603 41609 41611 41617 41621 41627 41641 41647 41651 41659 41669 41681 41687 41719 41729 41737 41759 41761 41771 41777 41801 41809 41813 41843 41849 41851 41863 41879 41887 41893 41897 41903 41911 41927 41941 41947 41953 41957 41959 41969 41981 41983 41999 42013 42017 42019 42023 42043 42061 42071 42073 42083 42089 42101 42131 42139 42157 42169 42179 42181 42187 42193 42197 42209 42221 42223 42227 42239 42257 42281 42283 42293 42299 42307 42323 42331 42337 42349 42359 42373 42379 42391 42397 42403 42407 42409 42433 42437 42443 42451 42457 42461 42463 42467 42473 42487 42491 42499 42509 42533 42557 42569 42571 42577 42589 42611 42641 42643 42649 42667 42677 42683 42689 42697 42701 42703 42709 42719 42727 42737 42743 42751 42767 42773 42787 42793 42797 42821 42829 42839 42841 42853 42859 42863 42899 42901 42923 42929 42937 42943 42953 42961 42967 42979 42989 43003 43013 43019 43037 43049 43051 43063 43067 43093 43103 43117 43133 43151 43159 43177 43189 43201 43207 43223 43237 43261 43271 43283 43291 43313 43319 43321 43331 43391 43397 43399 43403 43411 43427 43441 43451 43457 43481 43487 43499 43517 43541 43543 43573 43577 43579 43591 43597 43607 43609 43613 43627 43633 43649 43651 43661 43669 43691 43711 43717 43721 43753 43759 43777 43781 43783 43787 43789 43793 43801 43853 43867 43889 43891 43913 43933 43943 43951 43961 43963 43969 43973 43987 43991 43997 44017 44021 44027 44029 44041 44053 44059 44071 44087 44089 44101 44111 44119 44123 44129 44131 44159 44171 44179 44189 44201 44203 44207 44221 44249 44257 44263 44267 44269 44273 44279 44281 44293 44351 44357 44371 44381 44383 44389 44417 44449 44453 44483 44491 44497 44501 44507 44519 44531 44533 44537 44543 44549 44563 44579 44587 44617 44621 44623 44633 44641 44647 44651 44657 44683 44687 44699 44701 44711 44729 44741 44753 44771 44773 44777 44789 44797 44809 44819 44839 44843 44851 44867 44879 44887 44893 44909 44917 44927 44939 44953 44959 44963 44971 44983 44987 45007 45013 45053 45061 45077 45083 45119 45121 45127 45131 45137 45139 45161 45179 45181 45191 45197 45233 45247 45259 45263 45281 45289 45293 45307 45317 45319 45329 45337 45341 45343 45361 45377 45389 45403 45413 45427 45433 45439 45481 45491 45497 45503 45523 45533 45541 45553 45557 45569 45587 45589 45599 45613 45631 45641 45659 45667 45673 45677 45691 45697 45707 45737 45751 45757 45763 45767 45779 45817 45821 45823 45827 45833 45841 45853 45863 45869 45887 45893 45943 45949 45953 45959 45971 45979 45989 46021 46027 46049 46051 46061 46073 46091 46093 46099 46103 46133 46141 46147 46153 46171 46181 46183 46187 46199 46219 46229 46237 46261 46271 46273 46279 46301 46307 46309 46327 46337 46349 46351 46381 46399 46411 46439 46441 46447 46451 46457 46471 46477 46489 46499 46507 46511 46523 46549 46559 46567 46573 46589 46591 46601 46619 46633 46639 46643 46649 46663 46679 46681 46687 46691 46703 46723 46727 46747 46751 46757 46769 46771 46807 46811 46817 46819 46829 46831 46853 46861 46867 46877 46889 46901 46919 46933 46957 46993 46997 47017 47041 47051 47057 47059 47087 47093 47111 47119 47123 47129 47137 47143 47147 47149 47161 47189 47207 47221 47237 47251 47269 47279 47287 47293 47297 47303 47309 47317 47339 47351 47353 47363 47381 47387 47389 47407 47417 47419 47431 47441 47459 47491 47497 47501 47507 47513 47521 47527 47533 47543 47563 47569 47581 47591 47599 47609 47623 47629 47639 47653 47657 47659 47681 47699 47701 47711 47713 47717 47737 47741 47743 47777 47779 47791 47797 47807 47809 47819 47837 47843 47857 47869 47881 47903 47911 47917 47933 47939 47947 47951 47963 47969 47977 47981 48017 48023 48029 48049 48073 48079 48091 48109 48119 48121 48131 48157 48163 48179 48187 48193 48197 48221 48239 48247 48259 48271 48281 48299 48311 48313 48337 48341 48353 48371 48383 48397 48407 48409 48413 48437 48449 48463 48473 48479 48481 48487 48491 48497 48523 48527 48533 48539 48541 48563 48571 48589 48593 48611 48619 48623 48647 48649 48661 48673 48677 48679 48731 48733 48751 48757 48761 48767 48779 48781 48787 48799 48809 48817 48821 48823 48847 48857 48859 48869 48871 48883 48889 48907 48947 48953 48973 48989 48991 49003 49009 49019 49031 49033 49037 49043 49057 49069 49081 49103 49109 49117 49121 49123 49139 49157 49169 49171 49177 49193 49199 49201 49207 49211 49223 49253 49261 49277 49279 49297 49307 49331 49333 49339 49363 49367 49369 49391 49393 49409 49411 49417 49429 49433 49451 49459 49463 49477 49481 49499 49523 49529 49531 49537 49547 49549 49559 49597 49603 49613 49627 49633 49639 49663 49667 49669 49681 49697 49711 49727 49739 49741 49747 49757 49783 49787 49789 49801 49807 49811 49823 49831 49843 49853 49871 49877 49891 49919 49921 49927 49937 49939 49943 49957 49991 49993 49999 
diff --git a/test/Results/soli.fast.out b/test/Results/soli.fast.out
new file mode 100644 (file)
index 0000000..b94045c
--- /dev/null
@@ -0,0 +1,50 @@
+500
+1000
+1500
+2000
+2500
+3000
+3500
+4000
+4500
+5000
+5500
+6000
+6500
+7000
+7500
+8000
+8500
+9000
+9500
+10000
+10500
+11000
+11500
+12000
+12500
+13000
+13500
+14000
+14500
+15000
+15500
+16000
+16500
+17000
+17500
+18000
+18500
+19000
+19500
+20000
+
+.........
+...   ...
+...   ...
+.       .
+.   $   .
+.       .
+...   ...
+...   ...
+.........
diff --git a/test/Results/soli.out b/test/Results/soli.out
new file mode 100644 (file)
index 0000000..b94045c
--- /dev/null
@@ -0,0 +1,50 @@
+500
+1000
+1500
+2000
+2500
+3000
+3500
+4000
+4500
+5000
+5500
+6000
+6500
+7000
+7500
+8000
+8500
+9000
+9500
+10000
+10500
+11000
+11500
+12000
+12500
+13000
+13500
+14000
+14500
+15000
+15500
+16000
+16500
+17000
+17500
+18000
+18500
+19000
+19500
+20000
+
+.........
+...   ...
+...   ...
+.       .
+.   $   .
+.       .
+...   ...
+...   ...
+.........
diff --git a/test/Results/sorts.out b/test/Results/sorts.out
new file mode 100644 (file)
index 0000000..fa0cc04
--- /dev/null
@@ -0,0 +1,198 @@
+Command line arguments are:
+Testing List.sort...
+  List.sort with constant ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with reverse-sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with random ints (many dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with random ints (few dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with records (str)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with records (int[1])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with records (int[10])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with records (int[100])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.sort with records (int[1000])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+Testing List.stable_sort...
+  List.stable_sort with constant ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with reverse-sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with random ints (many dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with random ints (few dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (str)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[1])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[10])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[100])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[1000])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[1]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[10]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[100]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  List.stable_sort with records (int[1000]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+Testing Array.sort...
+  Array.sort with constant ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with reverse-sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with random ints (many dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with random ints (few dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with records (str)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with records (int[1])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with records (int[10])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with records (int[100])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.sort with records (int[1000])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+Testing Array.stable_sort...
+  Array.stable_sort with constant ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with reverse-sorted ints
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with random ints (many dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with random ints (few dups)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (str)
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[1])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[10])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[100])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[1000])
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[1]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[10]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[100]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+  Array.stable_sort with records (int[1000]) [stable]
+        0.    1.    2.    3.    4.    5.    6.    7.    8.    9.   10.   11.
+       12.   13.   28.  100.  127.  128.  129.  191.  192.  193.  506. 1000.
+     1023. 1024. 1025. 1535. 1536. 1537. 2323. 4000. 4094. 4096. 4098. 5123.
+Number of tests failed: 0
diff --git a/test/Results/takc.out b/test/Results/takc.out
new file mode 100644 (file)
index 0000000..bfed819
--- /dev/null
@@ -0,0 +1 @@
+14000
diff --git a/test/Results/taku.out b/test/Results/taku.out
new file mode 100644 (file)
index 0000000..bfed819
--- /dev/null
@@ -0,0 +1 @@
+14000
diff --git a/test/alloc.ml b/test/alloc.ml
new file mode 100644 (file)
index 0000000..51de6c5
--- /dev/null
@@ -0,0 +1,51 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*             Damien Doligez, projet Para, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: alloc.ml,v 1.2 1999/11/17 18:58:33 xleroy Exp $ *)
+
+(* Random allocation test *)
+
+(*
+  Allocate arrays of strings, of random sizes in [0..1000[, and put them
+  into an array of 32768.  Replace a randomly-selected array with a new
+  random-length array.  Reiterate ad infinitum.
+*)
+
+let l = 32768;;
+let m = 1000;;
+
+let ar = Array.create l "";;
+
+Random.init 1234;;
+
+let compact_flag = ref false;;
+
+let main () =
+  while true do
+    for i = 1 to 100000 do
+      ar.(Random.int l) <- String.create (Random.int m);
+    done;
+    if !compact_flag then Gc.compact () else Gc.full_major ();
+    print_newline ();
+    Gc.print_stat stdout;
+    flush stdout;
+  done
+;;
+
+let argspecs = [
+  "-c", Arg.Set compact_flag, "do heap compactions";
+];;
+
+Arg.parse argspecs (fun _ -> ()) "Usage: alloc [-c]";;
+
+main ();;
+
diff --git a/test/almabench.ml b/test/almabench.ml
new file mode 100644 (file)
index 0000000..f1dd10c
--- /dev/null
@@ -0,0 +1,324 @@
+(*
+ * ALMABENCH 1.0.1
+ * Objective Caml version
+ *
+ *     A number-crunching benchmark designed for cross-language and vendor
+ *     comparisons.
+ *
+ *     Written by Shawn Wagner, from Scott Robert Ladd's versions for
+ *      C++ and java.
+ *
+ *     No rights reserved. This is public domain software, for use by anyone.
+ *
+ *     This program calculates the daily ephemeris (at noon) for the years
+ *     2000-2099 using an algorithm developed by J.L. Simon, P. Bretagnon, J.
+ *     Chapront, M. Chapront-Touze, G. Francou and J. Laskar of the Bureau des
+ *     Longitudes, Paris, France), as detailed in Astronomy & Astrophysics
+ *     282, 663 (1994)
+ *
+ *    Note that the code herein is design for the purpose of testing 
+ *     computational performance; error handling and other such "niceties"
+ *    is virtually non-existent.
+ *
+ *    Actual (and oft-updated) benchmark results can be found at:
+ *            http://www.coyotegulch.com
+ *
+ *    Please do not use this information or algorithm in any way that might
+ *    upset the balance of the universe or otherwise cause planets to impact
+ *    upon one another.
+ *)
+
+let pic = 3.14159265358979323846
+and j2000     = 2451545.0
+and jcentury  = 36525.0
+and jmillenia = 365250.0
+
+let twopi     = 2.0 *. pic
+and a2r       = pic /. 648000.0
+and r2h       = 12.0 /. pic
+and r2d       = 180.0 /. pic
+and gaussk    = 0.01720209895
+
+(* number of days to include in test *)
+let test_loops  = 5  (* was: 20 *)
+and test_length = 36525
+
+(* sin and cos of j2000 mean obliquity (iau 1976) *)
+and sineps = 0.3977771559319137
+and coseps = 0.9174820620691818
+
+and amas = [|  6023600.0; 408523.5; 328900.5; 3098710.0; 1047.355; 3498.5; 22869.0; 19314.0 |]
+
+(*
+ * tables giving the mean keplerian elements, limited to t**2 terms:
+ *        a       semi-major axis (au)
+ *        dlm     mean longitude (degree and arcsecond)
+ *        e       eccentricity
+ *        pi      longitude of the perihelion (degree and arcsecond)
+ *        dinc    inclination (degree and arcsecond)
+ *        omega   longitude of the ascending node (degree and arcsecond)
+ *)
+and a = [|
+  [|   0.3870983098;             0.0;        0.0 |];
+  [|   0.7233298200;             0.0;        0.0 |];
+  [|   1.0000010178;             0.0;        0.0 |];
+  [|   1.5236793419;         3e-10;        0.0 |];
+  [|   5.2026032092;     19132e-10;  -39e-10 |];
+  [|   9.5549091915; -0.0000213896;  444e-10 |];
+  [|  19.2184460618;     -3716e-10;  979e-10 |];
+  [|  30.1103868694;    -16635e-10;  686e-10 |] |]
+
+and dlm =        
+  [| [| 252.25090552; 5381016286.88982;  -1.92789 |];
+     [| 181.97980085; 2106641364.33548;   0.59381 |];
+     [| 100.46645683; 1295977422.83429;  -2.04411 |];
+     [| 355.43299958;  689050774.93988;   0.94264 |];
+     [|  34.35151874;  109256603.77991; -30.60378 |];
+     [|  50.07744430;   43996098.55732;  75.61614 |];
+     [| 314.05500511;   15424811.93933;  -1.75083 |];
+     [| 304.34866548;    7865503.20744;   0.21103 |] |]
+
+and e =
+  [| [|   0.2056317526;  0.0002040653;    -28349e-10 |];
+     [|   0.0067719164; -0.0004776521;     98127e-10 |];
+     [|   0.0167086342; -0.0004203654; -0.0000126734 |];
+     [|   0.0934006477;  0.0009048438;    -80641e-10 |];
+     [|   0.0484979255;  0.0016322542; -0.0000471366 |];
+     [|   0.0555481426; -0.0034664062; -0.0000643639 |];
+     [|   0.0463812221; -0.0002729293;  0.0000078913 |];
+     [|   0.0094557470;  0.0000603263;           0.0 |] |]
+
+and pi =
+  [| [|  77.45611904;  5719.11590;   -4.83016 |];
+     [| 131.56370300;   175.48640; -498.48184 |];
+     [| 102.93734808; 11612.35290;   53.27577 |];
+     [| 336.06023395; 15980.45908;  -62.32800 |];
+     [|  14.33120687;  7758.75163;  259.95938 |];
+     [|  93.05723748; 20395.49439;  190.25952 |];
+     [| 173.00529106;  3215.56238;  -34.09288 |];
+     [|  48.12027554;  1050.71912;   27.39717 |] |]
+and dinc =
+  [| [|   7.00498625; -214.25629;   0.28977 |];
+     [|   3.39466189;  -30.84437; -11.67836 |];
+     [|          0.0;  469.97289;  -3.35053 |];
+     [|   1.84972648; -293.31722;  -8.11830 |];
+     [|   1.30326698;  -71.55890;  11.95297 |];
+     [|   2.48887878;   91.85195; -17.66225 |];
+     [|   0.77319689;  -60.72723;   1.25759 |];
+     [|   1.76995259;    8.12333;   0.08135 |] |]
+
+and omega =
+  [| [|  48.33089304;  -4515.21727;  -31.79892 |];
+     [|  76.67992019; -10008.48154;  -51.32614 |];
+     [| 174.87317577;  -8679.27034;   15.34191 |];
+     [|  49.55809321; -10620.90088; -230.57416 |];
+     [| 100.46440702;   6362.03561;  326.52178 |];
+     [| 113.66550252;  -9240.19942;  -66.23743 |];
+     [|  74.00595701;   2669.15033;  145.93964 |];
+     [| 131.78405702;   -221.94322;   -0.78728 |] |]
+
+(* tables for trigonometric terms to be added to the mean elements
+   of the semi-major axes. *)
+and kp =
+  [| [| 69613.0;  75645.0; 88306.0; 59899.0; 15746.0; 71087.0; 142173.0;  3086.0;    0.0 |];
+     [| 21863.0;  32794.0; 26934.0; 10931.0; 26250.0; 43725.0;  53867.0; 28939.0;    0.0 |];
+     [| 16002.0;  21863.0; 32004.0; 10931.0; 14529.0; 16368.0;  15318.0; 32794.0;    0.0 |];
+     [|  6345.0;   7818.0; 15636.0;  7077.0;  8184.0; 14163.0;   1107.0;  4872.0;    0.0 |];
+     [|  1760.0;   1454.0;  1167.0;   880.0;   287.0;  2640.0;     19.0;  2047.0; 1454.0 |];
+     [|   574.0;      0.0;   880.0;   287.0;    19.0;  1760.0;   1167.0;   306.0;  574.0 |];
+     [|   204.0;      0.0;   177.0;  1265.0;     4.0;   385.0;    200.0;   208.0;  204.0 |];
+     [|     0.0;    102.0;   106.0;     4.0;    98.0;  1367.0;    487.0;   204.0;    0.0 |] |]
+
+and ca =
+  [| [|       4.0;    -13.0;    11.0;    -9.0;    -9.0;    -3.0;    -1.0;     4.0;    0.0 |];
+     [|    -156.0;     59.0;   -42.0;     6.0;    19.0;   -20.0;   -10.0;   -12.0;    0.0 |];
+     [|      64.0;   -152.0;    62.0;    -8.0;    32.0;   -41.0;    19.0;   -11.0;    0.0 |];
+     [|     124.0;    621.0;  -145.0;   208.0;    54.0;   -57.0;    30.0;    15.0;    0.0 |];
+     [|  -23437.0;  -2634.0;  6601.0;  6259.0; -1507.0; -1821.0;  2620.0; -2115.0;-1489.0 |];
+     [|   62911.0;-119919.0; 79336.0; 17814.0;-24241.0; 12068.0;  8306.0; -4893.0; 8902.0 |];
+     [|  389061.0;-262125.0;-44088.0;  8387.0;-22976.0; -2093.0;  -615.0; -9720.0; 6633.0 |];
+     [| -412235.0;-157046.0;-31430.0; 37817.0; -9740.0;   -13.0; -7449.0;  9644.0;    0.0 |] |]
+
+and sa =
+  [| [|     -29.0;    -1.0;     9.0;     6.0;    -6.0;     5.0;     4.0;     0.0;    0.0 |];
+     [|     -48.0;  -125.0;   -26.0;   -37.0;    18.0;   -13.0;   -20.0;    -2.0;    0.0 |];
+     [|    -150.0;   -46.0;    68.0;    54.0;    14.0;    24.0;   -28.0;    22.0;    0.0 |];
+     [|    -621.0;   532.0;  -694.0;   -20.0;   192.0;   -94.0;    71.0;   -73.0;    0.0 |];
+     [|  -14614.0;-19828.0; -5869.0;  1881.0; -4372.0; -2255.0;   782.0;   930.0;  913.0 |];
+     [|  139737.0;     0.0; 24667.0; 51123.0; -5102.0;  7429.0; -4095.0; -1976.0;-9566.0 |];
+     [| -138081.0;     0.0; 37205.0;-49039.0;-41901.0;-33872.0;-27037.0;-12474.0;18797.0 |];
+     [|       0.0; 28492.0;133236.0; 69654.0; 52322.0;-49577.0;-26430.0; -3593.0;    0.0 |] |]
+
+(* tables giving the trigonometric terms to be added to the mean elements of
+   the mean longitudes . *)
+and kq = 
+  [| [|  3086.0; 15746.0; 69613.0; 59899.0; 75645.0; 88306.0; 12661.0; 2658.0;  0.0;   0.0 |];
+     [| 21863.0; 32794.0; 10931.0;    73.0;  4387.0; 26934.0;  1473.0; 2157.0;  0.0;   0.0 |];
+     [|    10.0; 16002.0; 21863.0; 10931.0;  1473.0; 32004.0;  4387.0;   73.0;  0.0;   0.0 |];
+     [|    10.0;  6345.0;  7818.0;  1107.0; 15636.0;  7077.0;  8184.0;  532.0; 10.0;   0.0 |];
+     [|    19.0;  1760.0;  1454.0;   287.0;  1167.0;   880.0;   574.0; 2640.0; 19.0;1454.0 |];
+     [|    19.0;   574.0;   287.0;   306.0;  1760.0;    12.0;    31.0;   38.0; 19.0; 574.0 |];
+     [|     4.0;   204.0;   177.0;     8.0;    31.0;   200.0;  1265.0;  102.0;  4.0; 204.0 |];
+     [|     4.0;   102.0;   106.0;     8.0;    98.0;  1367.0;   487.0;  204.0;  4.0; 102.0 |] |]
+
+and cl =
+  [| [|      21.0;   -95.0; -157.0;   41.0;   -5.0;   42.0;   23.0;   30.0;     0.0;    0.0 |];
+     [|    -160.0;  -313.0; -235.0;   60.0;  -74.0;  -76.0;  -27.0;   34.0;     0.0;    0.0 |];
+     [|    -325.0;  -322.0;  -79.0;  232.0;  -52.0;   97.0;   55.0;  -41.0;     0.0;    0.0 |];
+     [|    2268.0;  -979.0;  802.0;  602.0; -668.0;  -33.0;  345.0;  201.0;   -55.0;    0.0 |];
+     [|    7610.0; -4997.0;-7689.0;-5841.0;-2617.0; 1115.0; -748.0; -607.0;  6074.0;  354.0 |];
+     [|  -18549.0; 30125.0;20012.0; -730.0;  824.0;   23.0; 1289.0; -352.0;-14767.0;-2062.0 |];
+     [| -135245.0;-14594.0; 4197.0;-4030.0;-5630.0;-2898.0; 2540.0; -306.0;  2939.0; 1986.0 |];
+     [|   89948.0;  2103.0; 8963.0; 2695.0; 3682.0; 1648.0;  866.0; -154.0; -1963.0; -283.0 |] |]
+
+and sl =
+  [| [|   -342.0;   136.0;  -23.0;   62.0;   66.0;  -52.0;  -33.0;   17.0;     0.0;    0.0 |];
+     [|    524.0;  -149.0;  -35.0;  117.0;  151.0;  122.0;  -71.0;  -62.0;     0.0;    0.0 |];
+     [|   -105.0;  -137.0;  258.0;   35.0; -116.0;  -88.0; -112.0;  -80.0;     0.0;    0.0 |];
+     [|    854.0;  -205.0; -936.0; -240.0;  140.0; -341.0;  -97.0; -232.0;   536.0;    0.0 |];
+     [| -56980.0;  8016.0; 1012.0; 1448.0;-3024.0;-3710.0;  318.0;  503.0;  3767.0;  577.0 |];
+     [| 138606.0;-13478.0;-4964.0; 1441.0;-1319.0;-1482.0;  427.0; 1236.0; -9167.0;-1918.0 |];
+     [|  71234.0;-41116.0; 5334.0;-4935.0;-1848.0;   66.0;  434.0;-1748.0;  3780.0; -701.0 |];
+     [| -47645.0; 11647.0; 2166.0; 3194.0;  679.0;    0.0; -244.0; -419.0; -2531.0;   48.0 |] |]
+
+  
+(* Normalize angle into the range -pi <= A < +pi. *)
+let anpm a =
+  let w = mod_float a twopi in
+    if abs_float w >= pic then begin
+      if a < 0.0 then
+       w +. twopi
+      else
+       w -. twopi
+    end else
+      w
+
+(* The reference frame is equatorial and is with respect to the
+ *    mean equator and equinox of epoch j2000. *)
+let planetpv epoch np pv =
+  (* time: julian millennia since j2000. *)
+  let t = ((epoch.(0) -. j2000) +. epoch.(1)) /. jmillenia in
+    (*  compute the mean elements. *)
+  let da  = ref (a.(np).(0) +. (a.(np).(1) +. a.(np).(2) *. t ) *. t)
+  and dl  = ref ((3600.0 *. dlm.(np).(0) +. (dlm.(np).(1) +. dlm.(np).(2) *. t ) *. t) *. a2r)
+  and de  = e.(np).(0) +. (e.(np).(1) +. e.(np).(2) *. t ) *. t
+  and dp  = anpm ((3600.0 *. pi.(np).(0) +. (pi.(np).(1) +. pi.(np).(2) *. t ) *. t ) *. a2r )
+  and  di  = (3600.0 *. dinc.(np).(0) +. (dinc.(np).(1) +. dinc.(np).(2) *. t ) *. t ) *. a2r
+  and doh = anpm ((3600.0 *. omega.(np).(0) +. (omega.(np).(1) +. omega.(np).(2) *. t ) *. t ) *. a2r )     
+             (* apply the trigonometric terms. *)
+  and dmu = 0.35953620 *. t in
+    
+  (* loop invariant *)
+  let kp = kp.(np) and kq = kq.(np) and ca = ca.(np) and sa = sa.(np)
+  and cl = cl.(np) and sl = sl.(np) in
+    for k = 0 to 7 do
+      let arga = kp.(k) *. dmu
+      and  argl = kq.(k) *. dmu in
+        da := !da +. (ca.(k) *. cos arga +. sa.(k) *. sin arga) *. 0.0000001;
+        dl := !dl +. (cl.(k) *. cos argl +. sl.(k) *. sin argl) *. 0.0000001
+    done;
+    begin let arga = kp.(8) *. dmu in
+      da := !da +. t *. (ca.(8) *. cos arga  +. sa.(8) *. sin arga ) *. 0.0000001;
+      for k = 8 to 9 do
+        let argl = kq.(k) *. dmu in
+          dl := !dl +. t *. ( cl.(k) *. cos argl +. sl.(k) *. sin argl ) *. 0.0000001
+      done;
+    end;
+
+
+    dl := mod_float !dl twopi;
+
+    (* iterative solution of kepler's equation to get eccentric anomaly. *)
+    let am = !dl -. dp in
+    let ae = ref (am +. de *. sin am)
+    and k = ref 0 in 
+    let dae = ref ((am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae)) in
+      ae := !ae +. !dae;
+      incr k;
+      while !k < 10 or abs_float !dae >= 1e-12 do
+       dae := (am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae);
+       ae := !ae +. !dae;
+       incr k
+      done;
+      
+      (* true anomaly. *)
+      let ae2 = !ae /. 2.0 in
+      let at  = 2.0 *. atan2 (sqrt ((1.0 +. de) /. (1.0 -. de)) *. sin ae2)  (cos ae2) 
+                 (* distance (au) and speed (radians per day). *)
+      and r = !da *. (1.0 -. de *. cos !ae)
+      and v = gaussk *. sqrt ((1.0 +. 1.0 /. amas.(np) ) /. (!da *. !da *. !da))
+      and si2   = sin (di /. 2.0) in
+      let xq = si2 *. cos doh
+      and xp = si2 *. sin doh
+      and tl = at +. dp in
+      let xsw = sin tl
+      and xcw = cos tl in
+      let xm2  = 2.0 *. (xp *. xcw -. xq *. xsw ) 
+      and xf = !da /. sqrt (1.0 -. de *. de)
+      and ci2 = cos (di /. 2.0) in
+      let xms = (de *. sin dp +. xsw) *. xf
+      and xmc = (de *. cos dp  +. xcw) *. xf
+      and xpxq2 = 2.0 *. xp *. xq in
+
+      (* position (j2000 ecliptic x,y,z in au). *)
+      let x = r *. (xcw -. xm2 *. xp)
+      and y = r *. (xsw +. xm2 *. xq)
+      and z = r *. (-.xm2 *. ci2) in
+
+       (* rotate to equatorial. *)
+       pv.(0).(0) <- x;
+       pv.(0).(1) <- y *. coseps -. z *. sineps;
+       pv.(0).(2) <- y *. sineps +. z *. coseps;
+
+       (* velocity (j2000 ecliptic xdot,ydot,zdot in au/d). *)
+       let x = v *. ((-1.0 +. 2.0 *. xp *. xp) *. xms +. xpxq2 *. xmc)
+       and y = v *. (( 1.0 -. 2.0 *. xq *. xq ) *. xmc -. xpxq2 *. xms)
+       and z = v *. (2.0 *. ci2 *. (xp *. xms +. xq *. xmc)) in
+
+         (* rotate to equatorial *)
+         pv.(1).(0) <- x;
+         pv.(1).(1) <- y *. coseps -. z *. sineps;
+         pv.(1).(2) <- y *. sineps +. z *. coseps
+
+
+(* Computes RA, Declination, and distance from a state vector returned by 
+ * planetpv. *)
+let radecdist state rdd =
+  (* Distance *)
+  rdd.(2) <- sqrt (state.(0).(0) *. state.(0).(0)
+                +. state.(0).(1) *. state.(0).(1)
+                +. state.(0).(2) *. state.(0).(2));
+  (* RA *)
+  rdd.(0) <- atan2 state.(0).(1) state.(0).(0) *. r2h;
+  if rdd.(0) < 0.0 then rdd.(0) <- rdd.(0) +. 24.0;
+  
+  (* Declination *)
+  rdd.(1) <- asin (state.(0).(2) /. rdd.(2)) *. r2d
+  
+
+
+(* Entry point. Calculate RA and Dec for noon on every day in 1900-2100 *)
+let _ =
+  let jd = [| 0.0; 0.0 |]
+  and pv = [| [| 0.0; 0.0; 0.0 |]; [| 0.0; 0.0; 0.0 |] |] 
+  and position = [| 0.0; 0.0; 0.0 |] in
+  (* Test *)
+  jd.(0) <- j2000;
+  jd.(1) <- 1.0;
+  for p = 0 to 7 do
+    planetpv jd p pv;
+    radecdist pv position;
+    Printf.printf "%d %.2f %.2f\n" p position.(0) position.(1)
+  done;
+  (* Benchmark *)
+  for i = 0 to test_loops - 1 do
+    jd.(0) <- j2000;
+    jd.(1) <- 0.0;
+    for n = 0 to test_length - 1 do
+      jd.(0) <- jd.(0) +. 1.0;
+      for p = 0 to 7 do
+       planetpv jd p pv;
+       radecdist pv position;
+      done
+    done
+  done
diff --git a/test/bdd.ml b/test/bdd.ml
new file mode 100644 (file)
index 0000000..06413d1
--- /dev/null
@@ -0,0 +1,231 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: bdd.ml,v 1.9 2005/08/12 09:22:04 xleroy Exp $ *)
+
+(* Translated to Caml by Xavier Leroy *)
+(* Original code written in SML by ... *)
+
+type bdd = One | Zero | Node of bdd * int * int * bdd
+
+let rec eval bdd vars =
+  match bdd with
+    Zero -> false
+  | One -> true
+  | Node(l, v, _, h) ->
+      if vars.(v) then eval h vars else eval l vars
+
+let getId bdd = 
+  match bdd with 
+    Node(_,_,id,_) -> id
+  | Zero           -> 0
+  | One            -> 1
+
+let initSize_1 = 8*1024 - 1
+let nodeC      = ref 1
+let sz_1       = ref initSize_1
+let htab       = ref(Array.create (!sz_1+1) [])
+let n_items    = ref 0
+let hashVal x y v = x lsl 1 + y + v lsl 2
+
+let resize newSize =
+      let arr     = !htab in
+      let newSz_1 = newSize-1 in
+      let newArr  = Array.create newSize [] in
+      let rec copyBucket bucket =
+                match bucket with 
+                  []     -> ()
+                | n :: ns ->  
+                    match n with 
+                    | Node(l,v,_,h) ->
+                       let ind = hashVal (getId l) (getId h) v land newSz_1
+                       in
+                       newArr.(ind) <- (n :: newArr.(ind));
+                       copyBucket ns
+                    | _ -> assert false
+                    in
+      for n = 0 to !sz_1 do
+        copyBucket(arr.(n))
+      done;
+      htab := newArr;
+      sz_1 := newSz_1
+
+
+let rec insert idl idh v ind bucket newNode =
+        if !n_items <= !sz_1
+        then ( (!htab).(ind) <- (newNode :: bucket);
+               incr n_items )
+        else ( resize(!sz_1 + !sz_1 + 2);
+               let ind = hashVal idl idh v land (!sz_1)
+               in
+                  (!htab).(ind) <- newNode :: (!htab).(ind)
+             )
+
+
+let resetUnique () = (
+      sz_1    := initSize_1;
+      htab    := Array.create (!sz_1+1) [];
+      n_items := 0;
+      nodeC   := 1
+      )
+
+let mkNode low v high =
+   let idl = getId low in
+   let idh = getId high 
+   in
+     if idl = idh
+     then low
+     else let ind      = hashVal idl idh v land  (!sz_1) in
+          let bucket   = (!htab).(ind) in
+          let rec lookup b = 
+                    match b with 
+                      [] -> let n = Node(low, v, (incr nodeC; !nodeC), high)
+                            in
+                             insert (getId low) (getId high) v ind bucket n; n
+                    | n :: ns -> 
+                        match n with
+                        | Node(l,v',id,h) ->
+                           if v = v' && idl = getId l && idh = getId h
+                           then n else lookup ns
+                        | _ -> assert false
+           in
+             lookup bucket
+
+
+type ordering = LESS | EQUAL | GREATER
+
+let cmpVar (x : int) (y : int) =
+  if x<y then LESS else if x>y then GREATER else EQUAL 
+
+let zero = Zero
+let one  = One
+
+let mkVar x   = mkNode zero x one
+
+
+let cacheSize = 1999
+let andslot1  = Array.create cacheSize 0
+let andslot2  = Array.create cacheSize 0
+let andslot3  = Array.create cacheSize zero
+let xorslot1  = Array.create cacheSize 0
+let xorslot2  = Array.create cacheSize 0
+let xorslot3  = Array.create cacheSize zero
+let notslot1  = Array.create cacheSize 0
+let notslot2  = Array.create cacheSize one
+let hash x y  = ((x lsl 1)+y) mod cacheSize
+
+let rec not n = 
+match n with
+  Zero -> One
+| One  -> Zero
+| Node(l, v, id, r) -> let h = id mod cacheSize
+                       in
+                          if id=notslot1.(h) then notslot2.(h)
+                          else let f = mkNode (not l) v (not r)
+                               in
+                                 notslot1.(h) <- id; notslot2.(h) <- f; f
+
+let rec and2 n1 n2 = 
+match n1 with
+  Node(l1, v1, i1, r1) 
+  -> (match n2 with
+        Node(l2, v2, i2, r2)
+        -> let h = hash i1 i2
+           in
+             if i1=andslot1.(h) && i2=andslot2.(h) then andslot3.(h)
+             else let f = match cmpVar v1 v2 with
+                            EQUAL   -> mkNode (and2 l1 l2) v1 (and2 r1 r2)
+                          | LESS    -> mkNode (and2 l1 n2) v1 (and2 r1 n2)
+                          | GREATER -> mkNode (and2 n1 l2) v2 (and2 n1 r2)
+                  in
+                   andslot1.(h) <- i1; 
+                   andslot2.(h) <- i2; 
+                   andslot3.(h) <- f;
+                   f
+     | Zero -> Zero
+     | One  -> n1)
+|  Zero -> Zero
+|  One  -> n2
+
+
+let rec xor n1 n2 = 
+match n1 with
+  Node(l1, v1, i1, r1) 
+  -> (match n2 with
+        Node(l2, v2, i2, r2)
+        -> let h = hash i1 i2
+           in
+             if i1=andslot1.(h) && i2=andslot2.(h) then andslot3.(h)
+             else let f = match cmpVar v1 v2 with
+                            EQUAL   -> mkNode (xor l1 l2) v1 (xor r1 r2)
+                          | LESS    -> mkNode (xor l1 n2) v1 (xor r1 n2)
+                          | GREATER -> mkNode (xor n1 l2) v2 (xor n1 r2)
+                  in
+                   andslot1.(h) <- i1;
+                   andslot2.(h) <- i2;
+                   andslot3.(h) <- f;
+                   f
+     | Zero -> n1 
+     | One  -> not n1)
+|  Zero -> n2
+|  One  -> not n2
+
+let hwb n = 
+  let rec h i j = if i=j
+                  then mkVar i
+                  else  xor (and2 (not(mkVar j)) (h i (j-1)))
+                            (and2 (mkVar j)      (g i (j-1)))
+      and g i j = if i=j
+                  then mkVar i
+                  else xor (and2 (not(mkVar i)) (h (i+1) j)) 
+                           (and2 (mkVar i)      (g (i+1) j))
+  in
+     h 0 (n-1)
+
+(* Testing *)
+let seed = ref 0
+
+let random() =
+  seed := !seed * 25173 + 17431; !seed land 1 > 0
+
+let random_vars n =
+  let vars = Array.create n false in
+  for i = 0 to n - 1 do vars.(i) <- random() done;
+  vars
+
+let test_hwb bdd vars =
+  (* We should have
+        eval bdd vars = vars.(n-1) if n > 0
+        eval bdd vars = false if n = 0
+     where n is the number of "true" elements in vars. *)
+  let ntrue = ref 0 in
+  for i = 0 to Array.length vars - 1 do
+    if vars.(i) then incr ntrue
+  done;
+  eval bdd vars = (if !ntrue > 0 then vars.(!ntrue-1) else false)
+
+let main () =
+  let n =
+    if Array.length Sys.argv >= 2 then int_of_string Sys.argv.(1) else 22 in
+  let ntests =
+    if Array.length Sys.argv >= 3 then int_of_string Sys.argv.(2) else 100 in
+  let bdd = hwb n in
+  let succeeded = ref true in
+  for i = 1 to ntests do
+    succeeded := !succeeded && test_hwb bdd (random_vars n)
+  done;
+  if !succeeded
+  then print_string "OK\n"
+  else print_string "FAILED\n";
+  exit 0
+
+let _ = main()
diff --git a/test/boyer.ml b/test/boyer.ml
new file mode 100644 (file)
index 0000000..ccb9df9
--- /dev/null
@@ -0,0 +1,911 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: boyer.ml,v 1.9 2005/08/12 09:22:04 xleroy Exp $ *)
+
+(* Manipulations over terms *)
+
+type term =
+    Var of int
+  | Prop of head * term list
+and head =
+    { name: string;
+      mutable props: (term * term) list }
+
+let rec print_term = function
+    Var v ->
+      print_string "v"; print_int v
+  | Prop (head,argl) ->
+      print_string "(";
+      print_string head.name;
+      List.iter (fun t -> print_string " "; print_term t) argl;
+      print_string ")"
+let lemmas = ref ([] : head list)
+
+(* Replacement for property lists *)
+
+let get name =
+  let rec get_rec = function
+    hd1::hdl ->
+      if hd1.name = name then hd1 else get_rec hdl
+  | [] ->
+      let entry = {name = name; props = []} in
+        lemmas := entry :: !lemmas;
+        entry
+  in get_rec !lemmas
+
+let add_lemma = function
+ | Prop(_, [(Prop(headl,_) as left); right]) ->
+     headl.props <- (left, right) :: headl.props
+ | _ -> assert false
+
+(* Substitutions *)
+
+type subst = Bind of int * term
+
+let get_binding v list =
+  let rec get_rec = function
+    [] -> failwith "unbound"
+  | Bind(w,t)::rest -> if v = w  then t else get_rec rest
+  in get_rec list
+
+let apply_subst alist term =
+  let rec as_rec = function
+     Var v -> begin try get_binding v alist with Failure _ -> term end
+   | Prop (head,argl) -> Prop (head, List.map as_rec argl)
+  in as_rec term
+
+exception Unify
+
+let rec unify term1 term2 =
+  unify1 term1 term2 []
+
+and unify1 term1 term2 unify_subst =
+ match term2 with
+    Var v ->
+      begin try
+        if get_binding v unify_subst = term1
+        then unify_subst
+        else raise Unify
+      with Failure _ ->
+        Bind(v,term1) :: unify_subst
+      end
+  | Prop (head2, argl2) ->
+      match term1 with
+         Var _ -> raise Unify
+       | Prop (head1,argl1) ->
+           if head1 == head2
+           then unify1_lst argl1 argl2 unify_subst
+           else raise Unify
+
+and unify1_lst l1 l2 unify_subst =
+  match (l1, l2) with
+    ([], []) -> unify_subst
+  | (h1::r1, h2::r2) -> unify1_lst r1 r2 (unify1 h1 h2 unify_subst)
+  | _ -> raise Unify
+
+
+let rec rewrite = function
+    Var _ as term -> term
+  | Prop (head, argl) ->
+      rewrite_with_lemmas (Prop (head, List.map rewrite argl)) head.props
+and rewrite_with_lemmas term lemmas =
+  match lemmas with
+    [] ->
+      term
+  | (t1,t2)::rest ->
+      try
+        rewrite (apply_subst (unify term t1) t2)
+      with Unify ->
+        rewrite_with_lemmas term rest
+
+type cterm = CVar of int | CProp of string * cterm list
+
+let rec cterm_to_term = function
+    CVar v -> Var v
+  | CProp(p, l) -> Prop(get p, List.map cterm_to_term l)
+
+let add t = add_lemma (cterm_to_term t)
+
+let _ =
+add (CProp
+("equal",
+ [CProp ("compile",[CVar 5]); 
+  CProp
+  ("reverse",
+   [CProp ("codegen",[CProp ("optimize",[CVar 5]); CProp ("nil",[])])])]));
+add (CProp
+("equal",
+ [CProp ("eqp",[CVar 23; CVar 24]); 
+  CProp ("equal",[CProp ("fix",[CVar 23]); CProp ("fix",[CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("gt",[CVar 23; CVar 24]); CProp ("lt",[CVar 24; CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("le",[CVar 23; CVar 24]); CProp ("ge",[CVar 24; CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("ge",[CVar 23; CVar 24]); CProp ("le",[CVar 24; CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("boolean",[CVar 23]); 
+  CProp
+  ("or",
+   [CProp ("equal",[CVar 23; CProp ("true",[])]); 
+    CProp ("equal",[CVar 23; CProp ("false",[])])])]));
+add (CProp
+("equal",
+ [CProp ("iff",[CVar 23; CVar 24]); 
+  CProp
+  ("and",
+   [CProp ("implies",[CVar 23; CVar 24]); 
+    CProp ("implies",[CVar 24; CVar 23])])]));
+add (CProp
+("equal",
+ [CProp ("even1",[CVar 23]); 
+  CProp
+  ("if",
+   [CProp ("zerop",[CVar 23]); CProp ("true",[]); 
+    CProp ("odd",[CProp ("sub1",[CVar 23])])])]));
+add (CProp
+("equal",
+ [CProp ("countps_",[CVar 11; CVar 15]); 
+  CProp ("countps_loop",[CVar 11; CVar 15; CProp ("zero",[])])]));
+add (CProp
+("equal",
+ [CProp ("fact_",[CVar 8]); 
+  CProp ("fact_loop",[CVar 8; CProp ("one",[])])]));
+add (CProp
+("equal",
+ [CProp ("reverse_",[CVar 23]); 
+  CProp ("reverse_loop",[CVar 23; CProp ("nil",[])])]));
+add (CProp
+("equal",
+ [CProp ("divides",[CVar 23; CVar 24]); 
+  CProp ("zerop",[CProp ("remainder",[CVar 24; CVar 23])])]));
+add (CProp
+("equal",
+ [CProp ("assume_true",[CVar 21; CVar 0]); 
+  CProp ("cons",[CProp ("cons",[CVar 21; CProp ("true",[])]); CVar 0])]));
+add (CProp
+("equal",
+ [CProp ("assume_false",[CVar 21; CVar 0]); 
+  CProp ("cons",[CProp ("cons",[CVar 21; CProp ("false",[])]); CVar 0])]));
+add (CProp
+("equal",
+ [CProp ("tautology_checker",[CVar 23]); 
+  CProp ("tautologyp",[CProp ("normalize",[CVar 23]); CProp ("nil",[])])]));
+add (CProp
+("equal",
+ [CProp ("falsify",[CVar 23]); 
+  CProp ("falsify1",[CProp ("normalize",[CVar 23]); CProp ("nil",[])])]));
+add (CProp
+("equal",
+ [CProp ("prime",[CVar 23]); 
+  CProp
+  ("and",
+   [CProp ("not",[CProp ("zerop",[CVar 23])]); 
+    CProp
+    ("not",
+     [CProp ("equal",[CVar 23; CProp ("add1",[CProp ("zero",[])])])]); 
+    CProp ("prime1",[CVar 23; CProp ("sub1",[CVar 23])])])]));
+add (CProp
+("equal",
+ [CProp ("and",[CVar 15; CVar 16]); 
+  CProp
+  ("if",
+   [CVar 15; 
+    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]); 
+    CProp ("false",[])])]));
+add (CProp
+("equal",
+ [CProp ("or",[CVar 15; CVar 16]); 
+  CProp
+  ("if",
+   [CVar 15; CProp ("true",[]); 
+    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]); 
+    CProp ("false",[])])]));
+add (CProp
+("equal",
+ [CProp ("not",[CVar 15]); 
+  CProp ("if",[CVar 15; CProp ("false",[]); CProp ("true",[])])]));
+add (CProp
+("equal",
+ [CProp ("implies",[CVar 15; CVar 16]); 
+  CProp
+  ("if",
+   [CVar 15; 
+    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]); 
+    CProp ("true",[])])]));
+add (CProp
+("equal",
+ [CProp ("fix",[CVar 23]); 
+  CProp ("if",[CProp ("numberp",[CVar 23]); CVar 23; CProp ("zero",[])])]));
+add (CProp
+("equal",
+ [CProp ("if",[CProp ("if",[CVar 0; CVar 1; CVar 2]); CVar 3; CVar 4]); 
+  CProp
+  ("if",
+   [CVar 0; CProp ("if",[CVar 1; CVar 3; CVar 4]); 
+    CProp ("if",[CVar 2; CVar 3; CVar 4])])]));
+add (CProp
+("equal",
+ [CProp ("zerop",[CVar 23]); 
+  CProp
+  ("or",
+   [CProp ("equal",[CVar 23; CProp ("zero",[])]); 
+    CProp ("not",[CProp ("numberp",[CVar 23])])])]));
+add (CProp
+("equal",
+ [CProp ("plus",[CProp ("plus",[CVar 23; CVar 24]); CVar 25]); 
+  CProp ("plus",[CVar 23; CProp ("plus",[CVar 24; CVar 25])])]));
+add (CProp
+("equal",
+ [CProp ("equal",[CProp ("plus",[CVar 0; CVar 1]); CProp ("zero",[])]); 
+  CProp ("and",[CProp ("zerop",[CVar 0]); CProp ("zerop",[CVar 1])])]));
+add (CProp
+("equal",[CProp ("difference",[CVar 23; CVar 23]); CProp ("zero",[])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",
+   [CProp ("plus",[CVar 0; CVar 1]); CProp ("plus",[CVar 0; CVar 2])]); 
+  CProp ("equal",[CProp ("fix",[CVar 1]); CProp ("fix",[CVar 2])])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",[CProp ("zero",[]); CProp ("difference",[CVar 23; CVar 24])]); 
+  CProp ("not",[CProp ("gt",[CVar 24; CVar 23])])]));
+add (CProp
+("equal",
+ [CProp ("equal",[CVar 23; CProp ("difference",[CVar 23; CVar 24])]); 
+  CProp
+  ("and",
+   [CProp ("numberp",[CVar 23]); 
+    CProp
+    ("or",
+     [CProp ("equal",[CVar 23; CProp ("zero",[])]); 
+      CProp ("zerop",[CVar 24])])])]));
+add (CProp
+("equal",
+ [CProp
+  ("meaning",
+   [CProp ("plus_tree",[CProp ("append",[CVar 23; CVar 24])]); CVar 0]); 
+  CProp
+  ("plus",
+   [CProp ("meaning",[CProp ("plus_tree",[CVar 23]); CVar 0]); 
+    CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0])])]));
+add (CProp
+("equal",
+ [CProp
+  ("meaning",
+   [CProp ("plus_tree",[CProp ("plus_fringe",[CVar 23])]); CVar 0]); 
+  CProp ("fix",[CProp ("meaning",[CVar 23; CVar 0])])]));
+add (CProp
+("equal",
+ [CProp ("append",[CProp ("append",[CVar 23; CVar 24]); CVar 25]); 
+  CProp ("append",[CVar 23; CProp ("append",[CVar 24; CVar 25])])]));
+add (CProp
+("equal",
+ [CProp ("reverse",[CProp ("append",[CVar 0; CVar 1])]); 
+  CProp
+  ("append",[CProp ("reverse",[CVar 1]); CProp ("reverse",[CVar 0])])]));
+add (CProp
+("equal",
+ [CProp ("times",[CVar 23; CProp ("plus",[CVar 24; CVar 25])]); 
+  CProp
+  ("plus",
+   [CProp ("times",[CVar 23; CVar 24]); 
+    CProp ("times",[CVar 23; CVar 25])])]));
+add (CProp
+("equal",
+ [CProp ("times",[CProp ("times",[CVar 23; CVar 24]); CVar 25]); 
+  CProp ("times",[CVar 23; CProp ("times",[CVar 24; CVar 25])])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",[CProp ("times",[CVar 23; CVar 24]); CProp ("zero",[])]); 
+  CProp ("or",[CProp ("zerop",[CVar 23]); CProp ("zerop",[CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("exec",[CProp ("append",[CVar 23; CVar 24]); CVar 15; CVar 4]); 
+  CProp
+  ("exec",[CVar 24; CProp ("exec",[CVar 23; CVar 15; CVar 4]); CVar 4])]));
+add (CProp
+("equal",
+ [CProp ("mc_flatten",[CVar 23; CVar 24]); 
+  CProp ("append",[CProp ("flatten",[CVar 23]); CVar 24])]));
+add (CProp
+("equal",
+ [CProp ("member",[CVar 23; CProp ("append",[CVar 0; CVar 1])]); 
+  CProp
+  ("or",
+   [CProp ("member",[CVar 23; CVar 0]); 
+    CProp ("member",[CVar 23; CVar 1])])]));
+add (CProp
+("equal",
+ [CProp ("member",[CVar 23; CProp ("reverse",[CVar 24])]); 
+  CProp ("member",[CVar 23; CVar 24])]));
+add (CProp
+("equal",
+ [CProp ("length",[CProp ("reverse",[CVar 23])]); 
+  CProp ("length",[CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("member",[CVar 0; CProp ("intersect",[CVar 1; CVar 2])]); 
+  CProp
+  ("and",
+   [CProp ("member",[CVar 0; CVar 1]); CProp ("member",[CVar 0; CVar 2])])]));
+add (CProp
+("equal",[CProp ("nth",[CProp ("zero",[]); CVar 8]); CProp ("zero",[])]));
+add (CProp
+("equal",
+ [CProp ("exp",[CVar 8; CProp ("plus",[CVar 9; CVar 10])]); 
+  CProp
+  ("times",
+   [CProp ("exp",[CVar 8; CVar 9]); CProp ("exp",[CVar 8; CVar 10])])]));
+add (CProp
+("equal",
+ [CProp ("exp",[CVar 8; CProp ("times",[CVar 9; CVar 10])]); 
+  CProp ("exp",[CProp ("exp",[CVar 8; CVar 9]); CVar 10])]));
+add (CProp
+("equal",
+ [CProp ("reverse_loop",[CVar 23; CVar 24]); 
+  CProp ("append",[CProp ("reverse",[CVar 23]); CVar 24])]));
+add (CProp
+("equal",
+ [CProp ("reverse_loop",[CVar 23; CProp ("nil",[])]); 
+  CProp ("reverse",[CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("count_list",[CVar 25; CProp ("sort_lp",[CVar 23; CVar 24])]); 
+  CProp
+  ("plus",
+   [CProp ("count_list",[CVar 25; CVar 23]); 
+    CProp ("count_list",[CVar 25; CVar 24])])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",
+   [CProp ("append",[CVar 0; CVar 1]); CProp ("append",[CVar 0; CVar 2])]); 
+  CProp ("equal",[CVar 1; CVar 2])]));
+add (CProp
+("equal",
+ [CProp
+  ("plus",
+   [CProp ("remainder",[CVar 23; CVar 24]); 
+    CProp ("times",[CVar 24; CProp ("quotient",[CVar 23; CVar 24])])]); 
+  CProp ("fix",[CVar 23])]));
+add (CProp
+("equal",
+ [CProp
+  ("power_eval",[CProp ("big_plus",[CVar 11; CVar 8; CVar 1]); CVar 1]); 
+  CProp ("plus",[CProp ("power_eval",[CVar 11; CVar 1]); CVar 8])]));
+add (CProp
+("equal",
+ [CProp
+  ("power_eval",
+   [CProp ("big_plus",[CVar 23; CVar 24; CVar 8; CVar 1]); CVar 1]); 
+  CProp
+  ("plus",
+   [CVar 8; 
+    CProp
+    ("plus",
+     [CProp ("power_eval",[CVar 23; CVar 1]); 
+      CProp ("power_eval",[CVar 24; CVar 1])])])]));
+add (CProp
+("equal",
+ [CProp ("remainder",[CVar 24; CProp ("one",[])]); CProp ("zero",[])]));
+add (CProp
+("equal",
+ [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 24]); 
+  CProp ("not",[CProp ("zerop",[CVar 24])])]));
+add (CProp
+("equal",[CProp ("remainder",[CVar 23; CVar 23]); CProp ("zero",[])]));
+add (CProp
+("equal",
+ [CProp ("lt",[CProp ("quotient",[CVar 8; CVar 9]); CVar 8]); 
+  CProp
+  ("and",
+   [CProp ("not",[CProp ("zerop",[CVar 8])]); 
+    CProp
+    ("or",
+     [CProp ("zerop",[CVar 9]); 
+      CProp ("not",[CProp ("equal",[CVar 9; CProp ("one",[])])])])])]));
+add (CProp
+("equal",
+ [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 23]); 
+  CProp
+  ("and",
+   [CProp ("not",[CProp ("zerop",[CVar 24])]); 
+    CProp ("not",[CProp ("zerop",[CVar 23])]); 
+    CProp ("not",[CProp ("lt",[CVar 23; CVar 24])])])]));
+add (CProp
+("equal",
+ [CProp ("power_eval",[CProp ("power_rep",[CVar 8; CVar 1]); CVar 1]); 
+  CProp ("fix",[CVar 8])]));
+add (CProp
+("equal",
+ [CProp
+  ("power_eval",
+   [CProp
+    ("big_plus",
+     [CProp ("power_rep",[CVar 8; CVar 1]); 
+      CProp ("power_rep",[CVar 9; CVar 1]); CProp ("zero",[]); 
+      CVar 1]); 
+    CVar 1]); 
+  CProp ("plus",[CVar 8; CVar 9])]));
+add (CProp
+("equal",
+ [CProp ("gcd",[CVar 23; CVar 24]); CProp ("gcd",[CVar 24; CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("nth",[CProp ("append",[CVar 0; CVar 1]); CVar 8]); 
+  CProp
+  ("append",
+   [CProp ("nth",[CVar 0; CVar 8]); 
+    CProp
+    ("nth",
+     [CVar 1; CProp ("difference",[CVar 8; CProp ("length",[CVar 0])])])])]));
+add (CProp
+("equal",
+ [CProp ("difference",[CProp ("plus",[CVar 23; CVar 24]); CVar 23]); 
+  CProp ("fix",[CVar 24])]));
+add (CProp
+("equal",
+ [CProp ("difference",[CProp ("plus",[CVar 24; CVar 23]); CVar 23]); 
+  CProp ("fix",[CVar 24])]));
+add (CProp
+("equal",
+ [CProp
+  ("difference",
+   [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]); 
+  CProp ("difference",[CVar 24; CVar 25])]));
+add (CProp
+("equal",
+ [CProp ("times",[CVar 23; CProp ("difference",[CVar 2; CVar 22])]); 
+  CProp
+  ("difference",
+   [CProp ("times",[CVar 2; CVar 23]); 
+    CProp ("times",[CVar 22; CVar 23])])]));
+add (CProp
+("equal",
+ [CProp ("remainder",[CProp ("times",[CVar 23; CVar 25]); CVar 25]); 
+  CProp ("zero",[])]));
+add (CProp
+("equal",
+ [CProp
+  ("difference",
+   [CProp ("plus",[CVar 1; CProp ("plus",[CVar 0; CVar 2])]); CVar 0]); 
+  CProp ("plus",[CVar 1; CVar 2])]));
+add (CProp
+("equal",
+ [CProp
+  ("difference",
+   [CProp ("add1",[CProp ("plus",[CVar 24; CVar 25])]); CVar 25]); 
+  CProp ("add1",[CVar 24])]));
+add (CProp
+("equal",
+ [CProp
+  ("lt",
+   [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]); 
+  CProp ("lt",[CVar 24; CVar 25])]));
+add (CProp
+("equal",
+ [CProp
+  ("lt",
+   [CProp ("times",[CVar 23; CVar 25]); 
+    CProp ("times",[CVar 24; CVar 25])]); 
+  CProp
+  ("and",
+   [CProp ("not",[CProp ("zerop",[CVar 25])]); 
+    CProp ("lt",[CVar 23; CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("lt",[CVar 24; CProp ("plus",[CVar 23; CVar 24])]); 
+  CProp ("not",[CProp ("zerop",[CVar 23])])]));
+add (CProp
+("equal",
+ [CProp
+  ("gcd",
+   [CProp ("times",[CVar 23; CVar 25]); 
+    CProp ("times",[CVar 24; CVar 25])]); 
+  CProp ("times",[CVar 25; CProp ("gcd",[CVar 23; CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("value",[CProp ("normalize",[CVar 23]); CVar 0]); 
+  CProp ("value",[CVar 23; CVar 0])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",
+   [CProp ("flatten",[CVar 23]); 
+    CProp ("cons",[CVar 24; CProp ("nil",[])])]); 
+  CProp
+  ("and",
+   [CProp ("nlistp",[CVar 23]); CProp ("equal",[CVar 23; CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("listp",[CProp ("gother",[CVar 23])]); 
+  CProp ("listp",[CVar 23])]));
+add (CProp
+("equal",
+ [CProp ("samefringe",[CVar 23; CVar 24]); 
+  CProp
+  ("equal",[CProp ("flatten",[CVar 23]); CProp ("flatten",[CVar 24])])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",
+   [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("zero",[])]); 
+  CProp
+  ("and",
+   [CProp
+    ("or",
+     [CProp ("zerop",[CVar 24]); 
+      CProp ("equal",[CVar 24; CProp ("one",[])])]); 
+    CProp ("equal",[CVar 23; CProp ("zero",[])])])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",
+   [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("one",[])]); 
+  CProp ("equal",[CVar 23; CProp ("one",[])])]));
+add (CProp
+("equal",
+ [CProp ("numberp",[CProp ("greatest_factor",[CVar 23; CVar 24])]); 
+  CProp
+  ("not",
+   [CProp
+    ("and",
+     [CProp
+      ("or",
+       [CProp ("zerop",[CVar 24]); 
+        CProp ("equal",[CVar 24; CProp ("one",[])])]); 
+      CProp ("not",[CProp ("numberp",[CVar 23])])])])]));
+add (CProp
+("equal",
+ [CProp ("times_list",[CProp ("append",[CVar 23; CVar 24])]); 
+  CProp
+  ("times",
+   [CProp ("times_list",[CVar 23]); CProp ("times_list",[CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("prime_list",[CProp ("append",[CVar 23; CVar 24])]); 
+  CProp
+  ("and",
+   [CProp ("prime_list",[CVar 23]); CProp ("prime_list",[CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("equal",[CVar 25; CProp ("times",[CVar 22; CVar 25])]); 
+  CProp
+  ("and",
+   [CProp ("numberp",[CVar 25]); 
+    CProp
+    ("or",
+     [CProp ("equal",[CVar 25; CProp ("zero",[])]); 
+      CProp ("equal",[CVar 22; CProp ("one",[])])])])]));
+add (CProp
+("equal",
+ [CProp ("ge",[CVar 23; CVar 24]); 
+  CProp ("not",[CProp ("lt",[CVar 23; CVar 24])])]));
+add (CProp
+("equal",
+ [CProp ("equal",[CVar 23; CProp ("times",[CVar 23; CVar 24])]); 
+  CProp
+  ("or",
+   [CProp ("equal",[CVar 23; CProp ("zero",[])]); 
+    CProp
+    ("and",
+     [CProp ("numberp",[CVar 23]); 
+      CProp ("equal",[CVar 24; CProp ("one",[])])])])]));
+add (CProp
+("equal",
+ [CProp ("remainder",[CProp ("times",[CVar 24; CVar 23]); CVar 24]); 
+  CProp ("zero",[])]));
+add (CProp
+("equal",
+ [CProp ("equal",[CProp ("times",[CVar 0; CVar 1]); CProp ("one",[])]); 
+  CProp
+  ("and",
+   [CProp ("not",[CProp ("equal",[CVar 0; CProp ("zero",[])])]); 
+    CProp ("not",[CProp ("equal",[CVar 1; CProp ("zero",[])])]); 
+    CProp ("numberp",[CVar 0]); CProp ("numberp",[CVar 1]); 
+    CProp ("equal",[CProp ("sub1",[CVar 0]); CProp ("zero",[])]); 
+    CProp ("equal",[CProp ("sub1",[CVar 1]); CProp ("zero",[])])])]));
+add (CProp
+("equal",
+ [CProp
+  ("lt",
+   [CProp ("length",[CProp ("delete",[CVar 23; CVar 11])]); 
+    CProp ("length",[CVar 11])]); 
+  CProp ("member",[CVar 23; CVar 11])]));
+add (CProp
+("equal",
+ [CProp ("sort2",[CProp ("delete",[CVar 23; CVar 11])]); 
+  CProp ("delete",[CVar 23; CProp ("sort2",[CVar 11])])]));
+add (CProp ("equal",[CProp ("dsort",[CVar 23]); CProp ("sort2",[CVar 23])]));
+add (CProp
+("equal",
+ [CProp
+  ("length",
+   [CProp
+    ("cons",
+     [CVar 0; 
+      CProp
+      ("cons",
+       [CVar 1; 
+        CProp
+        ("cons",
+         [CVar 2; 
+          CProp
+          ("cons",
+           [CVar 3; 
+            CProp ("cons",[CVar 4; CProp ("cons",[CVar 5; CVar 6])])])])])])])
+  ; CProp ("plus",[CProp ("six",[]); CProp ("length",[CVar 6])])]));
+add (CProp
+("equal",
+ [CProp
+  ("difference",
+   [CProp ("add1",[CProp ("add1",[CVar 23])]); CProp ("two",[])]); 
+  CProp ("fix",[CVar 23])]));
+add (CProp
+("equal",
+ [CProp
+  ("quotient",
+   [CProp ("plus",[CVar 23; CProp ("plus",[CVar 23; CVar 24])]); 
+    CProp ("two",[])]); 
+  CProp
+  ("plus",[CVar 23; CProp ("quotient",[CVar 24; CProp ("two",[])])])]));
+add (CProp
+("equal",
+ [CProp ("sigma",[CProp ("zero",[]); CVar 8]); 
+  CProp
+  ("quotient",
+   [CProp ("times",[CVar 8; CProp ("add1",[CVar 8])]); CProp ("two",[])])]));
+add (CProp
+("equal",
+ [CProp ("plus",[CVar 23; CProp ("add1",[CVar 24])]); 
+  CProp
+  ("if",
+   [CProp ("numberp",[CVar 24]); 
+    CProp ("add1",[CProp ("plus",[CVar 23; CVar 24])]); 
+    CProp ("add1",[CVar 23])])]));
+add (CProp
+("equal",
+ [CProp
+  ("equal",
+   [CProp ("difference",[CVar 23; CVar 24]); 
+    CProp ("difference",[CVar 25; CVar 24])]); 
+  CProp
+  ("if",
+   [CProp ("lt",[CVar 23; CVar 24]); 
+    CProp ("not",[CProp ("lt",[CVar 24; CVar 25])]); 
+    CProp
+    ("if",
+     [CProp ("lt",[CVar 25; CVar 24]); 
+      CProp ("not",[CProp ("lt",[CVar 24; CVar 23])]); 
+      CProp ("equal",[CProp ("fix",[CVar 23]); CProp ("fix",[CVar 25])])])])])
+);
+add (CProp
+("equal",
+ [CProp
+  ("meaning",
+   [CProp ("plus_tree",[CProp ("delete",[CVar 23; CVar 24])]); CVar 0]); 
+  CProp
+  ("if",
+   [CProp ("member",[CVar 23; CVar 24]); 
+    CProp
+    ("difference",
+     [CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0]); 
+      CProp ("meaning",[CVar 23; CVar 0])]); 
+    CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0])])]));
+add (CProp
+("equal",
+ [CProp ("times",[CVar 23; CProp ("add1",[CVar 24])]); 
+  CProp
+  ("if",
+   [CProp ("numberp",[CVar 24]); 
+    CProp
+    ("plus",
+     [CVar 23; CProp ("times",[CVar 23; CVar 24]); 
+      CProp ("fix",[CVar 23])])])]));
+add (CProp
+("equal",
+ [CProp ("nth",[CProp ("nil",[]); CVar 8]); 
+  CProp
+  ("if",[CProp ("zerop",[CVar 8]); CProp ("nil",[]); CProp ("zero",[])])]));
+add (CProp
+("equal",
+ [CProp ("last",[CProp ("append",[CVar 0; CVar 1])]); 
+  CProp
+  ("if",
+   [CProp ("listp",[CVar 1]); CProp ("last",[CVar 1]); 
+    CProp
+    ("if",
+     [CProp ("listp",[CVar 0]); 
+      CProp ("cons",[CProp ("car",[CProp ("last",[CVar 0])]); CVar 1]); 
+      CVar 1])])]));
+add (CProp
+("equal",
+ [CProp ("equal",[CProp ("lt",[CVar 23; CVar 24]); CVar 25]); 
+  CProp
+  ("if",
+   [CProp ("lt",[CVar 23; CVar 24]); 
+    CProp ("equal",[CProp ("true",[]); CVar 25]); 
+    CProp ("equal",[CProp ("false",[]); CVar 25])])]));
+add (CProp
+("equal",
+ [CProp ("assignment",[CVar 23; CProp ("append",[CVar 0; CVar 1])]); 
+  CProp
+  ("if",
+   [CProp ("assignedp",[CVar 23; CVar 0]); 
+    CProp ("assignment",[CVar 23; CVar 0]); 
+    CProp ("assignment",[CVar 23; CVar 1])])]));
+add (CProp
+("equal",
+ [CProp ("car",[CProp ("gother",[CVar 23])]); 
+  CProp
+  ("if",
+   [CProp ("listp",[CVar 23]); 
+    CProp ("car",[CProp ("flatten",[CVar 23])]); CProp ("zero",[])])]));
+add (CProp
+("equal",
+ [CProp ("flatten",[CProp ("cdr",[CProp ("gother",[CVar 23])])]); 
+  CProp
+  ("if",
+   [CProp ("listp",[CVar 23]); 
+    CProp ("cdr",[CProp ("flatten",[CVar 23])]); 
+    CProp ("cons",[CProp ("zero",[]); CProp ("nil",[])])])]));
+add (CProp
+("equal",
+ [CProp ("quotient",[CProp ("times",[CVar 24; CVar 23]); CVar 24]); 
+  CProp
+  ("if",
+   [CProp ("zerop",[CVar 24]); CProp ("zero",[]); 
+    CProp ("fix",[CVar 23])])]));
+add (CProp
+("equal",
+ [CProp ("get",[CVar 9; CProp ("set",[CVar 8; CVar 21; CVar 12])]); 
+  CProp
+  ("if",
+   [CProp ("eqp",[CVar 9; CVar 8]); CVar 21; 
+    CProp ("get",[CVar 9; CVar 12])])]))
+
+(* Tautology checker *)
+
+let truep x lst =
+  match x with
+    Prop(head, _) ->
+      head.name = "true" || List.mem x lst
+  | _ ->
+      List.mem x lst
+
+and falsep x lst =
+  match x with
+    Prop(head, _) ->
+      head.name = "false" || List.mem x lst
+  | _ ->
+      List.mem x lst
+
+
+let rec tautologyp x true_lst false_lst =
+ if truep x true_lst then true else
+ if falsep x false_lst then false else begin
+(*
+ print_term x; print_newline();
+*)
+ match x with
+     Var _ -> false
+   | Prop (head,[test; yes; no]) as p ->
+        if head.name = "if" then
+          if truep test true_lst then
+            tautologyp yes true_lst false_lst
+          else if falsep test false_lst then
+            tautologyp no true_lst false_lst
+          else tautologyp yes (test::true_lst) false_lst &&
+               tautologyp no true_lst (test::false_lst)
+        else
+          false
+   | _ -> assert false
+  end
+
+
+let tautp x = 
+(*  print_term x; print_string"\n"; *)
+  let y = rewrite x in
+(*    print_term y; print_string "\n"; *)
+    tautologyp y [] []
+
+(* the benchmark *)
+
+let subst =
+[Bind(23, cterm_to_term(
+             CProp
+              ("f",
+               [CProp
+                ("plus",
+                 [CProp ("plus",[CVar 0; CVar 1]);
+                  CProp ("plus",[CVar 2; CProp ("zero",[])])])])));
+ Bind(24, cterm_to_term(
+             CProp
+              ("f",
+               [CProp
+                ("times",
+                 [CProp ("times",[CVar 0; CVar 1]);
+                  CProp ("plus",[CVar 2; CVar 3])])])));
+ Bind(25, cterm_to_term(
+             CProp
+              ("f",
+               [CProp
+                ("reverse",
+                 [CProp
+                  ("append",
+                   [CProp ("append",[CVar 0; CVar 1]);
+                    CProp ("nil",[])])])])));
+ Bind(20, cterm_to_term(
+             CProp
+              ("equal",
+               [CProp ("plus",[CVar 0; CVar 1]);
+                CProp ("difference",[CVar 23; CVar 24])])));
+ Bind(22, cterm_to_term(
+             CProp
+              ("lt",
+               [CProp ("remainder",[CVar 0; CVar 1]);
+                CProp ("member",[CVar 0; CProp ("length",[CVar 1])])])))]
+
+let term = cterm_to_term(
+           CProp
+            ("implies",
+             [CProp
+              ("and",
+               [CProp ("implies",[CVar 23; CVar 24]);
+                CProp
+                ("and",
+                 [CProp ("implies",[CVar 24; CVar 25]);
+                  CProp
+                  ("and",
+                   [CProp ("implies",[CVar 25; CVar 20]);
+                    CProp ("implies",[CVar 20; CVar 22])])])]);
+              CProp ("implies",[CVar 23; CVar 22])]))
+
+let _ =
+  let ok = ref true in
+  for i = 1 to 50 do
+    if not (tautp (apply_subst subst term)) then ok := false
+  done;
+  if !ok then
+    print_string "Proved!\n"
+  else
+    print_string "Cannot prove!\n";
+  exit 0
+
+(*********
+with
+    failure s ->
+      print_string "Exception failure("; print_string s; print_string ")\n"
+  | Unify ->
+      print_string "Exception Unify\n"
+  | match_failure(file,start,stop) ->
+      print_string "Exception match_failure(";
+      print_string file;
+      print_string ",";
+      print_int start;
+      print_string ",";
+      print_int stop;
+      print_string ")\n"
+  | _ ->
+      print_string "Exception ?\n"
+
+**********)
diff --git a/test/fft.ml b/test/fft.ml
new file mode 100644 (file)
index 0000000..1c458f4
--- /dev/null
@@ -0,0 +1,189 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: fft.ml,v 1.9 2005/08/12 09:22:04 xleroy Exp $ *)
+
+let pi = 3.14159265358979323846
+
+let tpi = 2.0 *. pi
+
+let fft px py np =
+  let i = ref 2 in
+  let m = ref 1 in
+  
+  while (!i < np) do
+    i := !i + !i; 
+    m := !m + 1
+  done;
+
+  let n = !i in  
+  
+  if n <> np then begin
+    for i = np+1 to n do
+      px.(i) <- 0.0; 
+      py.(i) <- 0.0
+    done;
+    print_string "Use "; print_int n;
+    print_string " point fft"; print_newline()
+  end;
+
+  let n2 = ref(n+n) in
+  for k = 1 to !m-1 do
+    n2 := !n2 / 2; 
+    let n4 = !n2 / 4 in
+    let e  = tpi /. float !n2 in
+
+    for j = 1 to n4 do
+      let a = e *. float(j - 1) in
+      let a3 = 3.0 *. a in
+      let cc1 = cos(a) in
+      let ss1 = sin(a) in
+      let cc3 = cos(a3) in
+      let ss3 = sin(a3) in
+      let is = ref j in
+      let id = ref(2 * !n2) in
+  
+        while !is < n do
+          let i0r = ref !is in
+          while !i0r < n do
+             let i0 = !i0r in
+             let i1 = i0 + n4 in
+             let i2 = i1 + n4 in
+             let i3 = i2 + n4 in
+             let r1 = px.(i0) -. px.(i2) in
+             px.(i0) <- px.(i0) +. px.(i2);
+             let r2 = px.(i1) -. px.(i3) in
+             px.(i1) <- px.(i1) +. px.(i3);
+             let s1 = py.(i0) -. py.(i2) in
+             py.(i0) <- py.(i0) +. py.(i2);
+             let s2 = py.(i1) -. py.(i3) in
+             py.(i1) <- py.(i1) +. py.(i3);
+             let s3 = r1 -. s2 in
+             let r1 = r1 +. s2 in
+             let s2 = r2 -. s1 in
+             let r2 = r2 +. s1 in
+             px.(i2) <- r1*.cc1 -. s2*.ss1; 
+             py.(i2) <- -.s2*.cc1 -. r1*.ss1;
+             px.(i3) <- s3*.cc3 +. r2*.ss3;
+             py.(i3) <- r2*.cc3 -. s3*.ss3;
+             i0r := i0 + !id
+          done;
+          is := 2 * !id - !n2 + j; 
+          id := 4 * !id
+        done
+    done
+  done;
+
+(************************************)
+(*  Last stage, length=2 butterfly  *)
+(************************************)
+
+  let is = ref 1 in
+  let id = ref 4 in
+  
+  while !is < n do
+    let i0r = ref !is in
+    while !i0r <= n do
+      let i0 = !i0r in
+      let i1 = i0 + 1 in
+      let r1 = px.(i0) in
+      px.(i0) <- r1 +. px.(i1);
+      px.(i1) <- r1 -. px.(i1);
+      let r1 = py.(i0) in
+      py.(i0) <- r1 +. py.(i1);
+      py.(i1) <- r1 -. py.(i1);
+      i0r := i0 + !id
+    done;
+    is := 2 * !id - 1; 
+    id := 4 * !id
+  done;
+
+(*************************)
+(*  Bit reverse counter  *)
+(*************************)
+
+  let j = ref 1 in
+  
+  for i = 1 to n - 1 do
+    if i < !j then begin
+      let xt = px.(!j) in
+      px.(!j) <- px.(i); 
+      px.(i) <- xt;
+      let xt = py.(!j) in
+      py.(!j) <- py.(i);
+      py.(i) <- xt
+    end;
+    let k = ref(n / 2) in
+    while !k < !j do
+      j := !j - !k; 
+      k := !k / 2
+    done;
+    j := !j + !k
+  done;
+
+  n
+
+
+let test np =
+  print_int np; print_string "... "; flush stdout;
+  let enp = float np in
+  let npm = np / 2 - 1 in
+  let pxr = Array.create (np+2) 0.0
+  and pxi = Array.create (np+2) 0.0 in
+  let t = pi /. enp in
+  pxr.(1) <- (enp -. 1.0) *. 0.5;
+  pxi.(1) <- 0.0;
+  let n2 = np / 2 in
+  pxr.(n2+1) <- -0.5;
+  pxi.(n2+1) <-  0.0;
+
+  for i = 1 to npm do
+      let j = np - i in
+      pxr.(i+1) <- -0.5;
+      pxr.(j+1) <- -0.5;
+      let z = t *. float i in
+      let y = -0.5*.(cos(z)/.sin(z)) in
+      pxi.(i+1) <- y;
+      pxi.(j+1) <- -.y
+  done;
+(**
+  print_newline();
+  for i=0 to 15 do Printf.printf "%d  %f  %f\n" i pxr.(i+1) pxi.(i+1) done;
+**)
+  let _ = fft pxr pxi np in
+(**
+  for i=0 to 15 do Printf.printf "%d  %f  %f\n" i pxr.(i+1) pxi.(i+1) done;
+**)
+  let zr = ref 0.0 in
+  let zi = ref 0.0 in
+  let kr = ref 0 in
+  let ki = ref 0 in
+  for i = 0 to np-1 do
+      let a = abs_float(pxr.(i+1) -. float i) in
+      if !zr < a then begin
+         zr := a; 
+         kr := i
+      end;
+      let a = abs_float(pxi.(i+1)) in
+      if !zi < a then begin
+         zi := a; 
+         ki := i
+      end
+  done;
+  if abs_float !zr <= 1e-9 && abs_float !zi <= 1e-9
+  then print_string "ok"
+  else print_string "ERROR";
+  print_newline()
+
+let _ =
+  let np = ref 16 in for i = 1 to 16 do test !np; np := !np*2 done
+
diff --git a/test/fib.ml b/test/fib.ml
new file mode 100644 (file)
index 0000000..afba6a7
--- /dev/null
@@ -0,0 +1,24 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: fib.ml,v 1.5 2005/08/12 09:22:04 xleroy Exp $ *)
+
+let rec fib n =
+  if n < 2 then 1 else fib(n-1) + fib(n-2)
+
+let _ =
+  let n =
+    if Array.length Sys.argv >= 2 
+    then int_of_string Sys.argv.(1)
+    else 40 in
+  print_int(fib n); print_newline(); exit 0
+
diff --git a/test/hamming.ml b/test/hamming.ml
new file mode 100644 (file)
index 0000000..6075b79
--- /dev/null
@@ -0,0 +1,105 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*          Damien Doligez, projet Moscova, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 2002 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: hamming.ml,v 1.1 2002/01/23 17:50:19 doligez Exp $ *)
+
+(* We cannot use bignums because we don't do custom runtimes, but
+   int64 is a bit short, so we roll our own 37-digit numbers...
+*)
+
+let n0 = Int64.of_int 0;;
+let n1 = Int64.of_int 1;;
+let n2 = Int64.of_int 2;;
+let n3 = Int64.of_int 3;;
+let n5 = Int64.of_int 5;;
+
+let ( % ) = Int64.rem;;
+let ( * ) = Int64.mul;;
+let ( / ) = Int64.div;;
+let ( + ) = Int64.add;;
+let digit = Int64.of_string "1000000000000000000";;
+
+let mul n (pl, ph) = ((n * pl) % digit, n * ph + (n * pl) / digit);;
+let cmp (nl, nh) (pl, ph) =
+  if nh < ph then -1
+  else if nh > ph then 1
+  else if nl < pl then -1
+  else if nl > pl then 1
+  else 0
+;;
+
+let x2 = fun p -> mul n2 p;;
+let x3 = fun p -> mul n3 p;;
+let x5 = fun p -> mul n5 p;;
+
+let nn1 = (n1, n0);;
+
+let pr (nl, nh) =
+  if compare nh n0 = 0
+  then Printf.printf "%Ld\n" nl
+  else Printf.printf "%Ld%018Ld\n" nh nl
+;;
+
+(*
+  (* bignum version *)
+open Num;;
+let nn1 = num_of_int 1;;
+let x2 = fun p -> (num_of_int 2) */ p;;
+let x3 = fun p -> (num_of_int 3) */ p;;
+let x5 = fun p -> (num_of_int 5) */ p;;
+let cmp n p = sign_num (n -/ p);;
+let pr n = Printf.printf "%s\n" (string_of_num n);;
+*)
+
+
+(* This is where the interesting stuff begins. *)
+
+open Lazy;;
+
+type 'a lcons = Cons of 'a * 'a lcons Lazy.t;;
+type 'a llist = 'a lcons Lazy.t;;
+
+let rec map f l =
+  lazy (
+    match force l with
+    | Cons (x, ll) -> Cons (f x, map f ll)
+  )
+;;
+
+let rec merge cmp l1 l2 =
+  lazy (
+    match force l1, force l2 with
+    | Cons (x1, ll1), Cons (x2, ll2)
+       -> let c = cmp x1 x2 in
+          if c = 0
+          then Cons (x1, merge cmp ll1 ll2)
+          else if c < 0
+          then Cons (x1, merge cmp ll1 l2)
+          else Cons (x2, merge cmp l1 ll2)
+  )
+;;
+
+let rec iter_interval f l (start, stop) =
+  if stop = 0 then ()
+  else match force l with
+       | Cons (x, ll)
+          -> if start <= 0 then f x;
+             iter_interval f ll (start-1, stop-1)
+;;
+
+let rec hamming = lazy (Cons (nn1, merge cmp ham2 (merge cmp ham3 ham5)))
+    and ham2 = lazy (force (map x2 hamming))
+    and ham3 = lazy (force (map x3 hamming))
+    and ham5 = lazy (force (map x5 hamming))
+;;
+
+iter_interval pr hamming (88000, 88100);;
diff --git a/test/nucleic.ml b/test/nucleic.ml
new file mode 100644 (file)
index 0000000..eeb17e2
--- /dev/null
@@ -0,0 +1,3238 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: nucleic.ml,v 1.11 2005/08/12 09:22:04 xleroy Exp $ *)
+
+(* Use floating-point arithmetic *)
+
+external (+) : float -> float -> float = "%addfloat"
+external (-) : float -> float -> float = "%subfloat"
+external ( * ) : float -> float -> float = "%mulfloat"
+external (/) : float -> float -> float = "%divfloat"
+
+(* -- MATH UTILITIES --------------------------------------------------------*)
+
+let constant_pi        =  3.14159265358979323846
+let constant_minus_pi  = -3.14159265358979323846
+let constant_pi2       =  1.57079632679489661923
+let constant_minus_pi2 = -1.57079632679489661923
+
+(* -- POINTS ----------------------------------------------------------------*)
+
+type pt = { x : float; y : float; z : float }
+
+let
+pt_sub p1 p2
+  = { x = p1.x - p2.x; y = p1.y - p2.y; z = p1.z - p2.z }
+
+let
+pt_dist p1 p2
+  = let dx = p1.x - p2.x
+    and dy = p1.y - p2.y
+    and dz = p1.z - p2.z
+    in
+      sqrt ((dx * dx) + (dy * dy) + (dz * dz))
+
+let
+pt_phi p
+  = let b = atan2 p.x p.z
+    in
+      atan2 ((cos b) * p.z + (sin b) * p.x) p.y
+
+let
+pt_theta p
+  =  atan2 p.x p.z
+
+(* -- COORDINATE TRANSFORMATIONS --------------------------------------------*)
+
+(*
+   The notation for the transformations follows "Paul, R.P. (1981) Robot
+   Manipulators.  MIT Press." with the exception that our transformation
+   matrices don't have the perspective terms and are the transpose of
+   Paul's one.  See also "M\"antyl\"a, M. (1985) An Introduction to
+   Solid Modeling, Computer Science Press" Appendix A.
+  
+   The components of a transformation matrix are named like this:
+  
+    a  b  c
+    d  e  f
+    g  h  i
+   tx ty tz
+  
+   The components tx, ty, and tz are the translation vector.
+*)
+
+type tfo =
+  {a: float;   b: float;   c: float;
+   d: float;   e: float;   f: float;
+   g: float;   h: float;   i: float;
+   tx: float;  ty: float;  tz: float}
+
+let tfo_id =
+  {a=1.0; b=0.0; c=0.0;
+   d=0.0; e=1.0; f=0.0;
+   g=0.0; h=0.0; i=1.0;
+   tx=0.0; ty=0.0; tz=0.0}
+
+(*
+   The function "tfo-apply" multiplies a transformation matrix, tfo, by a
+   point vector, p.  The result is a new point.
+*)
+
+let
+tfo_apply t p
+  = { x = ((p.x * t.a) + (p.y * t.d) + (p.z * t.g) + t.tx);
+      y = ((p.x * t.b) + (p.y * t.e) + (p.z * t.h) + t.ty);
+      z = ((p.x * t.c) + (p.y * t.f) + (p.z * t.i) + t.tz) }
+
+(*
+   The function "tfo-combine" multiplies two transformation matrices A and B.
+   The result is a new matrix which cumulates the transformations described
+   by A and B.
+*)
+
+let
+tfo_combine a b =
+(* <HAND_CSE> *)
+  (* Hand elimination of common subexpressions.
+     Assumes lots of float registers (32 is perfect, 16 still OK).
+     Loses on the I386, of course. *)
+  let a_a = a.a  and a_b = a.b  and a_c = a.c  and a_d = a.d
+  and a_e = a.e  and a_f = a.f  and a_g = a.g  and a_h = a.h
+  and a_i = a.i  and a_tx = a.tx  and a_ty = a.ty  and a_tz = a.tz
+  and b_a = b.a  and b_b = b.b  and b_c = b.c  and b_d = b.d
+  and b_e = b.e  and b_f = b.f  and b_g = b.g  and b_h = b.h
+  and b_i = b.i  and b_tx = b.tx  and b_ty = b.ty  and b_tz = b.tz in
+    { a = ((a_a * b_a) + (a_b * b_d) + (a_c * b_g));
+      b = ((a_a * b_b) + (a_b * b_e) + (a_c * b_h));
+      c = ((a_a * b_c) + (a_b * b_f) + (a_c * b_i));
+      d = ((a_d * b_a) + (a_e * b_d) + (a_f * b_g));
+      e = ((a_d * b_b) + (a_e * b_e) + (a_f * b_h));
+      f = ((a_d * b_c) + (a_e * b_f) + (a_f * b_i));
+      g = ((a_g * b_a) + (a_h * b_d) + (a_i * b_g));
+      h = ((a_g * b_b) + (a_h * b_e) + (a_i * b_h));
+      i = ((a_g * b_c) + (a_h * b_f) + (a_i * b_i));
+      tx = ((a_tx * b_a) + (a_ty * b_d) + (a_tz * b_g) + b_tx);
+      ty = ((a_tx * b_b) + (a_ty * b_e) + (a_tz * b_h) + b_ty);
+      tz = ((a_tx * b_c) + (a_ty * b_f) + (a_tz * b_i) + b_tz)
+    }
+(* </HAND_CSE> *)
+ (* Original without CSE *)
+(* <NO_CSE> *) (***
+    { a = ((a.a * b.a) + (a.b * b.d) + (a.c * b.g));
+      b = ((a.a * b.b) + (a.b * b.e) + (a.c * b.h));
+      c = ((a.a * b.c) + (a.b * b.f) + (a.c * b.i));
+      d = ((a.d * b.a) + (a.e * b.d) + (a.f * b.g));
+      e = ((a.d * b.b) + (a.e * b.e) + (a.f * b.h));
+      f = ((a.d * b.c) + (a.e * b.f) + (a.f * b.i));
+      g = ((a.g * b.a) + (a.h * b.d) + (a.i * b.g));
+      h = ((a.g * b.b) + (a.h * b.e) + (a.i * b.h));
+      i = ((a.g * b.c) + (a.h * b.f) + (a.i * b.i));
+      tx = ((a.tx * b.a) + (a.ty * b.d) + (a.tz * b.g) + b.tx);
+      ty = ((a.tx * b.b) + (a.ty * b.e) + (a.tz * b.h) + b.ty);
+      tz = ((a.tx * b.c) + (a.ty * b.f) + (a.tz * b.i) + b.tz)
+    }
+  ***) (* </NO_CSE> *)
+
+(*
+   The function "tfo-inv-ortho" computes the inverse of a homogeneous
+   transformation matrix.
+*)
+
+let
+tfo_inv_ortho t =
+  { a = t.a; b = t.d; c = t.g;
+    d = t.b; e = t.e; f = t.h;
+    g = t.c; h = t.f; i = t.i;
+    tx = (-.((t.a * t.tx) + (t.b * t.ty) + (t.c * t.tz)));
+    ty = (-.((t.d * t.tx) + (t.e * t.ty) + (t.f * t.tz)));
+    tz = (-.((t.g * t.tx) + (t.h * t.ty) + (t.i * t.tz)))
+  }
+
+(*
+   Given three points p1, p2, and p3, the function "tfo-align" computes
+   a transformation matrix such that point p1 gets mapped to (0,0,0), p2 gets
+   mapped to the Y axis and p3 gets mapped to the YZ plane.
+*)
+
+let
+tfo_align p1 p2 p3
+  = let x31 = p3.x - p1.x in
+    let y31 = p3.y - p1.y in
+    let z31 = p3.z - p1.z in
+    let rotpy = pt_sub p2 p1 in
+    let phi = pt_phi rotpy in
+    let theta = pt_theta rotpy in
+    let sinp = sin phi in
+    let sint = sin theta in
+    let cosp = cos phi in
+    let cost = cos theta in
+    let sinpsint = sinp * sint in
+    let sinpcost = sinp * cost in
+    let cospsint = cosp * sint in
+    let cospcost = cosp * cost in
+    let rotpz =
+      { x = ((cost * x31) - (sint * z31));
+        y = ((sinpsint * x31) + (cosp * y31) + (sinpcost * z31));
+        z = ((cospsint * x31) + (-.(sinp * y31)) + (cospcost * z31)) } in
+    let rho = pt_theta rotpz in
+    let cosr = cos rho in
+    let sinr = sin rho in
+    let x = (-.(p1.x * cost)) + (p1.z * sint) in
+    let y = ((-.(p1.x * sinpsint)) - (p1.y * cosp)) - (p1.z * sinpcost) in
+    let z = ((-.(p1.x * cospsint) + (p1.y * sinp))) - (p1.z * cospcost) in
+      { a = ((cost * cosr) - (cospsint * sinr));
+        b = sinpsint;
+        c = ((cost * sinr) + (cospsint * cosr));
+        d = (sinp * sinr);
+        e = cosp;
+        f = (-.(sinp * cosr));
+        g = ((-.(sint * cosr)) - (cospcost * sinr));
+        h = sinpcost;
+        i = ((-.(sint * sinr) + (cospcost * cosr)));
+        tx = ((x * cosr) - (z * sinr));
+        ty = y;
+        tz = ((x * sinr + (z * cosr)))
+      }
+
+(* -- NUCLEIC ACID CONFORMATIONS DATA BASE ----------------------------------*)
+
+(*
+   Numbering of atoms follows the paper:
+  
+   IUPAC-IUB Joint Commission on Biochemical Nomenclature (JCBN)
+   (1983) Abbreviations and Symbols for the Description of
+   Conformations of Polynucleotide Chains.  Eur. J. Biochem 131,
+   9-15.
+*)
+
+(* Define remaining atoms for each nucleotide type. *)
+
+type nuc_specific =
+  A of pt*pt*pt*pt*pt*pt*pt*pt
+| C of pt*pt*pt*pt*pt*pt
+| G of pt*pt*pt*pt*pt*pt*pt*pt*pt
+| U of pt*pt*pt*pt*pt
+
+(*
+   A n6 n7 n9 c8 h2 h61 h62 h8
+   C n4 o2 h41 h42 h5 h6
+   G n2 n7 n9 c8 o6 h1 h21 h22 h8
+   U o2 o4 h3 h5 h6
+*)
+
+(* Define part common to all 4 nucleotide types. *)
+
+type nuc =
+  N of tfo*tfo*tfo*tfo*
+       pt*pt*pt*pt*pt*pt*pt*pt*pt*pt*pt*pt*
+       pt*pt*pt*pt*pt*pt*pt*pt*pt*pt*pt*pt*
+       pt*nuc_specific
+
+(*
+    dgf_base_tfo  ; defines the standard position for wc and wc_dumas
+    p_o3'_275_tfo ; defines the standard position for the connect function
+    p_o3'_180_tfo
+    p_o3'_60_tfo
+    p o1p o2p o5' c5' h5' h5'' c4' h4' o4' c1' h1' c2' h2'' o2' h2' c3'
+    h3' o3' n1 n3 c2 c4 c5 c6
+*)
+
+let is_A = function
+     N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+      p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+      c3',h3',o3',n1,n3,c2,c4,c5,c6,A(_,_,_,_,_,_,_,_)) -> true
+   | _ -> false
+
+let is_C = function
+     N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+      p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+      c3',h3',o3',n1,n3,c2,c4,c5,c6,C(_,_,_,_,_,_)) -> true
+  | _ -> false
+
+let is_G = function
+     N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+      p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+      c3',h3',o3',n1,n3,c2,c4,c5,c6,G(_,_,_,_,_,_,_,_,_)) -> true
+  | _ -> false
+
+let
+nuc_C1'
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = c1'
+
+let
+nuc_C2 
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = c2
+
+let
+nuc_C3'
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = c3'
+
+let
+nuc_C4 
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = c4
+
+let
+nuc_C4'
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = c4'
+
+let
+nuc_N1 
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = n1
+
+let
+nuc_O3'
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = o3'
+
+let
+nuc_P
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = p
+
+let
+nuc_dgf_base_tfo
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = dgf_base_tfo
+
+let
+nuc_p_o3'_180_tfo
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = p_o3'_180_tfo
+
+let
+nuc_p_o3'_275_tfo
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = p_o3'_275_tfo
+
+let
+nuc_p_o3'_60_tfo
+(N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
+  = p_o3'_60_tfo
+
+let
+rA_N9 = function
+| (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+     p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+     c3',h3',o3',n1,n3,c2,c4,c5,c6,A (n6,n7,n9,c8,h2,h61,h62,h8))) -> n9
+| _ -> assert false
+
+
+let
+rG_N9   = function
+| (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+     p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+     c3',h3',o3',n1,n3,c2,c4,c5,c6,G (n2,n7,n9,c8,o6,h1,h21,h22,h8))) -> n9
+| _ -> assert false
+
+(* Database of nucleotide conformations: *)
+
+let rA
+  = N(
+      {    a= -0.0018; b= -0.8207; c=0.5714; (* dgf_base_tfo *)
+           d=0.2679; e= -0.5509; f= -0.7904;
+           g=0.9634; h=0.1517; i=0.2209;
+           tx=0.0073; ty=8.4030; tz=0.6232 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 5.4550; y = 8.2120; z = -2.8810 }, (* C5'  *)
+      { x = 5.4546; y = 8.8508; z = -1.9978 }, (* H5'  *)
+      { x = 5.7588; y = 8.6625; z = -3.8259 }, (* H5'' *)
+      { x = 6.4970; y = 7.1480; z = -2.5980 }, (* C4'  *)
+      { x = 7.4896; y = 7.5919; z = -2.5214 }, (* H4'  *)
+      { x = 6.1630; y = 6.4860; z = -1.3440 }, (* O4'  *)
+      { x = 6.5400; y = 5.1200; z = -1.4190 }, (* C1'  *)
+      { x = 7.2763; y = 4.9681; z = -0.6297 }, (* H1'  *)
+      { x = 7.1940; y = 4.8830; z = -2.7770 }, (* C2'  *)
+      { x = 6.8667; y = 3.9183; z = -3.1647 }, (* H2'' *)
+      { x = 8.5860; y = 5.0910; z = -2.6140 }, (* O2'  *)
+      { x = 8.9510; y = 4.7626; z = -1.7890 }, (* H2'  *)
+      { x = 6.5720; y = 6.0040; z = -3.6090 }, (* C3'  *)
+      { x = 5.5636; y = 5.7066; z = -3.8966 }, (* H3'  *)
+      { x = 7.3801; y = 6.3562; z = -4.7350 }, (* O3'  *)
+      { x = 4.7150; y = 0.4910; z = -0.1360 }, (* N1   *)
+      { x = 6.3490; y = 2.1730; z = -0.6020 }, (* N3   *)
+      { x = 5.9530; y = 0.9650; z = -0.2670 }, (* C2   *)
+      { x = 5.2900; y = 2.9790; z = -0.8260 }, (* C4   *)
+      { x = 3.9720; y = 2.6390; z = -0.7330 }, (* C5   *)
+      { x = 3.6770; y = 1.3160; z = -0.3660 }, (* C6 *)
+      (A (
+      { x = 2.4280; y = 0.8450; z = -0.2360 }, (* N6   *)
+      { x = 3.1660; y = 3.7290; z = -1.0360 }, (* N7   *)
+      { x = 5.3170; y = 4.2990; z = -1.1930 }, (* N9   *)
+      { x = 4.0100; y = 4.6780; z = -1.2990 }, (* C8   *)
+      { x = 6.6890; y = 0.1903; z = -0.0518 }, (* H2   *)
+      { x = 1.6470; y = 1.4460; z = -0.4040 }, (* H61  *)
+      { x = 2.2780; y = -0.1080; z = -0.0280 }, (* H62  *)
+      { x = 3.4421; y = 5.5744; z = -1.5482 }) (* H8   *)
+      )
+    )
+
+let rA01
+  = N(
+      {    a= -0.0043; b= -0.8175; c=0.5759; (* dgf_base_tfo *)
+           d=0.2617; e= -0.5567; f= -0.7884;
+           g=0.9651; h=0.1473; i=0.2164;
+           tx=0.0359; ty=8.3929; tz=0.5532 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 5.4352; y = 8.2183; z = -2.7757 }, (* C5'  *)
+      { x = 5.3830; y = 8.7883; z = -1.8481 }, (* H5'  *)
+      { x = 5.7729; y = 8.7436; z = -3.6691 }, (* H5'' *)
+      { x = 6.4830; y = 7.1518; z = -2.5252 }, (* C4'  *)
+      { x = 7.4749; y = 7.5972; z = -2.4482 }, (* H4'  *)
+      { x = 6.1626; y = 6.4620; z = -1.2827 }, (* O4'  *)
+      { x = 6.5431; y = 5.0992; z = -1.3905 }, (* C1'  *)
+      { x = 7.2871; y = 4.9328; z = -0.6114 }, (* H1'  *)
+      { x = 7.1852; y = 4.8935; z = -2.7592 }, (* C2'  *)
+      { x = 6.8573; y = 3.9363; z = -3.1645 }, (* H2'' *)
+      { x = 8.5780; y = 5.1025; z = -2.6046 }, (* O2'  *)
+      { x = 8.9516; y = 4.7577; z = -1.7902 }, (* H2'  *)
+      { x = 6.5522; y = 6.0300; z = -3.5612 }, (* C3'  *)
+      { x = 5.5420; y = 5.7356; z = -3.8459 }, (* H3'  *)
+      { x = 7.3487; y = 6.4089; z = -4.6867 }, (* O3'  *)
+      { x = 4.7442; y = 0.4514; z = -0.1390 }, (* N1   *)
+      { x = 6.3687; y = 2.1459; z = -0.5926 }, (* N3   *)
+      { x = 5.9795; y = 0.9335; z = -0.2657 }, (* C2   *)
+      { x = 5.3052; y = 2.9471; z = -0.8125 }, (* C4   *)
+      { x = 3.9891; y = 2.5987; z = -0.7230 }, (* C5   *)
+      { x = 3.7016; y = 1.2717; z = -0.3647 }, (* C6 *)
+      (A (
+      { x = 2.4553; y = 0.7925; z = -0.2390 }, (* N6   *)
+      { x = 3.1770; y = 3.6859; z = -1.0198 }, (* N7   *)
+      { x = 5.3247; y = 4.2695; z = -1.1710 }, (* N9   *)
+      { x = 4.0156; y = 4.6415; z = -1.2759 }, (* C8   *)
+      { x = 6.7198; y = 0.1618; z = -0.0547 }, (* H2   *)
+      { x = 1.6709; y = 1.3900; z = -0.4039 }, (* H61  *)
+      { x = 2.3107; y = -0.1627; z = -0.0373 }, (* H62  *)
+      { x = 3.4426; y = 5.5361; z = -1.5199 }) (* H8   *)
+      )
+    )
+
+let rA02
+  = N(
+      {    a=0.5566; b=0.0449; c=0.8296; (* dgf_base_tfo *)
+           d=0.5125; e=0.7673; f= -0.3854;
+           g= -0.6538; h=0.6397; i=0.4041;
+           tx= -9.1161; ty= -3.7679; tz= -2.9968 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.5778; y = 6.6594; z = -4.0364 }, (* C5'  *)
+      { x = 4.9220; y = 7.1963; z = -4.9204 }, (* H5'  *)
+      { x = 3.7996; y = 5.9091; z = -4.1764 }, (* H5'' *)
+      { x = 5.7873; y = 5.8869; z = -3.5482 }, (* C4'  *)
+      { x = 6.0405; y = 5.0875; z = -4.2446 }, (* H4'  *)
+      { x = 6.9135; y = 6.8036; z = -3.4310 }, (* O4'  *)
+      { x = 7.7293; y = 6.4084; z = -2.3392 }, (* C1'  *)
+      { x = 8.7078; y = 6.1815; z = -2.7624 }, (* H1'  *)
+      { x = 7.1305; y = 5.1418; z = -1.7347 }, (* C2'  *)
+      { x = 7.2040; y = 5.1982; z = -0.6486 }, (* H2'' *)
+      { x = 7.7417; y = 4.0392; z = -2.3813 }, (* O2'  *)
+      { x = 8.6785; y = 4.1443; z = -2.5630 }, (* H2'  *)
+      { x = 5.6666; y = 5.2728; z = -2.1536 }, (* C3'  *)
+      { x = 5.1747; y = 5.9805; z = -1.4863 }, (* H3'  *)
+      { x = 4.9997; y = 4.0086; z = -2.1973 }, (* O3'  *)
+      { x = 10.3245; y = 8.5459; z = 1.5467 }, (* N1   *)
+      { x = 9.8051; y = 6.9432; z = -0.1497 }, (* N3   *)
+      { x = 10.5175; y = 7.4328; z = 0.8408 }, (* C2   *)
+      { x = 8.7523; y = 7.7422; z = -0.4228 }, (* C4   *)
+      { x = 8.4257; y = 8.9060; z = 0.2099 }, (* C5   *)
+      { x = 9.2665; y = 9.3242; z = 1.2540 }, (* C6 *)
+      (A (
+      { x = 9.0664; y = 10.4462; z = 1.9610 }, (* N6   *)
+      { x = 7.2750; y = 9.4537; z = -0.3428 }, (* N7   *)
+      { x = 7.7962; y = 7.5519; z = -1.3859 }, (* N9   *)
+      { x = 6.9479; y = 8.6157; z = -1.2771 }, (* C8   *)
+      { x = 11.4063; y = 6.9047; z = 1.1859 }, (* H2   *)
+      { x = 8.2845; y = 11.0341; z = 1.7552 }, (* H61  *)
+      { x = 9.6584; y = 10.6647; z = 2.7198 }, (* H62  *)
+      { x = 6.0430; y = 8.9853; z = -1.7594 }) (* H8   *)
+      )
+    )
+let rA03
+  = N(
+      {    a= -0.5021; b=0.0731; c=0.8617; (* dgf_base_tfo *)
+           d= -0.8112; e=0.3054; f= -0.4986;
+           g= -0.2996; h= -0.9494; i= -0.0940;
+           tx=6.4273; ty= -5.1944; tz= -3.7807 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.1214; y = 6.7116; z = -1.9049 }, (* C5'  *)
+      { x = 3.3465; y = 5.9610; z = -2.0607 }, (* H5'  *)
+      { x = 4.0789; y = 7.2928; z = -0.9837 }, (* H5'' *)
+      { x = 5.4170; y = 5.9293; z = -1.8186 }, (* C4'  *)
+      { x = 5.4506; y = 5.3400; z = -0.9023 }, (* H4'  *)
+      { x = 5.5067; y = 5.0417; z = -2.9703 }, (* O4'  *)
+      { x = 6.8650; y = 4.9152; z = -3.3612 }, (* C1'  *)
+      { x = 7.1090; y = 3.8577; z = -3.2603 }, (* H1'  *)
+      { x = 7.7152; y = 5.7282; z = -2.3894 }, (* C2'  *)
+      { x = 8.5029; y = 6.2356; z = -2.9463 }, (* H2'' *)
+      { x = 8.1036; y = 4.8568; z = -1.3419 }, (* O2'  *)
+      { x = 8.3270; y = 3.9651; z = -1.6184 }, (* H2'  *)
+      { x = 6.7003; y = 6.7565; z = -1.8911 }, (* C3'  *)
+      { x = 6.5898; y = 7.5329; z = -2.6482 }, (* H3'  *)
+      { x = 7.0505; y = 7.2878; z = -0.6105 }, (* O3'  *)
+      { x = 9.6740; y = 4.7656; z = -7.6614 }, (* N1   *)
+      { x = 9.0739; y = 4.3013; z = -5.3941 }, (* N3   *)
+      { x = 9.8416; y = 4.2192; z = -6.4581 }, (* C2   *)
+      { x = 7.9885; y = 5.0632; z = -5.6446 }, (* C4   *)
+      { x = 7.6822; y = 5.6856; z = -6.8194 }, (* C5   *)
+      { x = 8.5831; y = 5.5215; z = -7.8840 }, (* C6 *)
+      (A (
+      { x = 8.4084; y = 6.0747; z = -9.0933 }, (* N6   *)
+      { x = 6.4857; y = 6.3816; z = -6.7035 }, (* N7   *)
+      { x = 6.9740; y = 5.3703; z = -4.7760 }, (* N9   *)
+      { x = 6.1133; y = 6.1613; z = -5.4808 }, (* C8   *)
+      { x = 10.7627; y = 3.6375; z = -6.4220 }, (* H2   *)
+      { x = 7.6031; y = 6.6390; z = -9.2733 }, (* H61  *)
+      { x = 9.1004; y = 5.9708; z = -9.7893 }, (* H62  *)
+      { x = 5.1705; y = 6.6830; z = -5.3167 }) (* H8   *)
+      )
+    )
+
+let rA04
+  = N(
+      {    a= -0.5426; b= -0.8175; c=0.1929; (* dgf_base_tfo *)
+           d=0.8304; e= -0.5567; f= -0.0237;
+           g=0.1267; h=0.1473; i=0.9809;
+           tx= -0.5075; ty=8.3929; tz=0.2229 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 5.4352; y = 8.2183; z = -2.7757 }, (* C5'  *)
+      { x = 5.3830; y = 8.7883; z = -1.8481 }, (* H5'  *)
+      { x = 5.7729; y = 8.7436; z = -3.6691 }, (* H5'' *)
+      { x = 6.4830; y = 7.1518; z = -2.5252 }, (* C4'  *)
+      { x = 7.4749; y = 7.5972; z = -2.4482 }, (* H4'  *)
+      { x = 6.1626; y = 6.4620; z = -1.2827 }, (* O4'  *)
+      { x = 6.5431; y = 5.0992; z = -1.3905 }, (* C1'  *)
+      { x = 7.2871; y = 4.9328; z = -0.6114 }, (* H1'  *)
+      { x = 7.1852; y = 4.8935; z = -2.7592 }, (* C2'  *)
+      { x = 6.8573; y = 3.9363; z = -3.1645 }, (* H2'' *)
+      { x = 8.5780; y = 5.1025; z = -2.6046 }, (* O2'  *)
+      { x = 8.9516; y = 4.7577; z = -1.7902 }, (* H2'  *)
+      { x = 6.5522; y = 6.0300; z = -3.5612 }, (* C3'  *)
+      { x = 5.5420; y = 5.7356; z = -3.8459 }, (* H3'  *)
+      { x = 7.3487; y = 6.4089; z = -4.6867 }, (* O3'  *)
+      { x = 3.6343; y = 2.6680; z = 2.0783 }, (* N1   *)
+      { x = 5.4505; y = 3.9805; z = 1.2446 }, (* N3   *)
+      { x = 4.7540; y = 3.3816; z = 2.1851 }, (* C2   *)
+      { x = 4.8805; y = 3.7951; z = 0.0354 }, (* C4   *)
+      { x = 3.7416; y = 3.0925; z = -0.2305 }, (* C5   *)
+      { x = 3.0873; y = 2.4980; z = 0.8606 }, (* C6 *)
+      (A (
+      { x = 1.9600; y = 1.7805; z = 0.7462 }, (* N6   *)
+      { x = 3.4605; y = 3.1184; z = -1.5906 }, (* N7   *)
+      { x = 5.3247; y = 4.2695; z = -1.1710 }, (* N9   *)
+      { x = 4.4244; y = 3.8244; z = -2.0953 }, (* C8   *)
+      { x = 5.0814; y = 3.4352; z = 3.2234 }, (* H2   *)
+      { x = 1.5423; y = 1.6454; z = -0.1520 }, (* H61  *)
+      { x = 1.5716; y = 1.3398; z = 1.5392 }, (* H62  *)
+      { x = 4.2675; y = 3.8876; z = -3.1721 }) (* H8   *)
+      )
+    )
+
+let rA05
+  = N(
+      {    a= -0.5891; b=0.0449; c=0.8068; (* dgf_base_tfo *)
+           d=0.5375; e=0.7673; f=0.3498;
+           g= -0.6034; h=0.6397; i= -0.4762;
+           tx= -0.3019; ty= -3.7679; tz= -9.5913 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.5778; y = 6.6594; z = -4.0364 }, (* C5'  *)
+      { x = 4.9220; y = 7.1963; z = -4.9204 }, (* H5'  *)
+      { x = 3.7996; y = 5.9091; z = -4.1764 }, (* H5'' *)
+      { x = 5.7873; y = 5.8869; z = -3.5482 }, (* C4'  *)
+      { x = 6.0405; y = 5.0875; z = -4.2446 }, (* H4'  *)
+      { x = 6.9135; y = 6.8036; z = -3.4310 }, (* O4'  *)
+      { x = 7.7293; y = 6.4084; z = -2.3392 }, (* C1'  *)
+      { x = 8.7078; y = 6.1815; z = -2.7624 }, (* H1'  *)
+      { x = 7.1305; y = 5.1418; z = -1.7347 }, (* C2'  *)
+      { x = 7.2040; y = 5.1982; z = -0.6486 }, (* H2'' *)
+      { x = 7.7417; y = 4.0392; z = -2.3813 }, (* O2'  *)
+      { x = 8.6785; y = 4.1443; z = -2.5630 }, (* H2'  *)
+      { x = 5.6666; y = 5.2728; z = -2.1536 }, (* C3'  *)
+      { x = 5.1747; y = 5.9805; z = -1.4863 }, (* H3'  *)
+      { x = 4.9997; y = 4.0086; z = -2.1973 }, (* O3'  *)
+      { x = 10.2594; y = 10.6774; z = -1.0056 }, (* N1   *)
+      { x = 9.7528; y = 8.7080; z = -2.2631 }, (* N3   *)
+      { x = 10.4471; y = 9.7876; z = -1.9791 }, (* C2   *)
+      { x = 8.7271; y = 8.5575; z = -1.3991 }, (* C4   *)
+      { x = 8.4100; y = 9.3803; z = -0.3580 }, (* C5   *)
+      { x = 9.2294; y = 10.5030; z = -0.1574 }, (* C6 *)
+      (A (
+      { x = 9.0349; y = 11.3951; z = 0.8250 }, (* N6   *)
+      { x = 7.2891; y = 8.9068; z = 0.3121 }, (* N7   *)
+      { x = 7.7962; y = 7.5519; z = -1.3859 }, (* N9   *)
+      { x = 6.9702; y = 7.8292; z = -0.3353 }, (* C8   *)
+      { x = 11.3132; y = 10.0537; z = -2.5851 }, (* H2   *)
+      { x = 8.2741; y = 11.2784; z = 1.4629 }, (* H61  *)
+      { x = 9.6733; y = 12.1368; z = 0.9529 }, (* H62  *)
+      { x = 6.0888; y = 7.3990; z = 0.1403 }) (* H8   *)
+      )
+    )
+
+let rA06
+  = N(
+      {    a= -0.9815; b=0.0731; c= -0.1772; (* dgf_base_tfo *)
+           d=0.1912; e=0.3054; f= -0.9328;
+           g= -0.0141; h= -0.9494; i= -0.3137;
+           tx=5.7506; ty= -5.1944; tz=4.7470 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.1214; y = 6.7116; z = -1.9049 }, (* C5'  *)
+      { x = 3.3465; y = 5.9610; z = -2.0607 }, (* H5'  *)
+      { x = 4.0789; y = 7.2928; z = -0.9837 }, (* H5'' *)
+      { x = 5.4170; y = 5.9293; z = -1.8186 }, (* C4'  *)
+      { x = 5.4506; y = 5.3400; z = -0.9023 }, (* H4'  *)
+      { x = 5.5067; y = 5.0417; z = -2.9703 }, (* O4'  *)
+      { x = 6.8650; y = 4.9152; z = -3.3612 }, (* C1'  *)
+      { x = 7.1090; y = 3.8577; z = -3.2603 }, (* H1'  *)
+      { x = 7.7152; y = 5.7282; z = -2.3894 }, (* C2'  *)
+      { x = 8.5029; y = 6.2356; z = -2.9463 }, (* H2'' *)
+      { x = 8.1036; y = 4.8568; z = -1.3419 }, (* O2'  *)
+      { x = 8.3270; y = 3.9651; z = -1.6184 }, (* H2'  *)
+      { x = 6.7003; y = 6.7565; z = -1.8911 }, (* C3'  *)
+      { x = 6.5898; y = 7.5329; z = -2.6482 }, (* H3'  *)
+      { x = 7.0505; y = 7.2878; z = -0.6105 }, (* O3'  *)
+      { x = 6.6624; y = 3.5061; z = -8.2986 }, (* N1   *)
+      { x = 6.5810; y = 3.2570; z = -5.9221 }, (* N3   *)
+      { x = 6.5151; y = 2.8263; z = -7.1625 }, (* C2   *)
+      { x = 6.8364; y = 4.5817; z = -5.8882 }, (* C4   *)
+      { x = 7.0116; y = 5.4064; z = -6.9609 }, (* C5   *)
+      { x = 6.9173; y = 4.8260; z = -8.2361 }, (* C6 *)
+      (A (
+      { x = 7.0668; y = 5.5163; z = -9.3763 }, (* N6   *)
+      { x = 7.2573; y = 6.7070; z = -6.5394 }, (* N7   *)
+      { x = 6.9740; y = 5.3703; z = -4.7760 }, (* N9   *)
+      { x = 7.2238; y = 6.6275; z = -5.2453 }, (* C8   *)
+      { x = 6.3146; y = 1.7741; z = -7.3641 }, (* H2   *)
+      { x = 7.2568; y = 6.4972; z = -9.3456 }, (* H61  *)
+      { x = 7.0437; y = 5.0478; z = -10.2446 }, (* H62  *)
+      { x = 7.4108; y = 7.6227; z = -4.8418 }) (* H8   *)
+      )
+    )
+
+let rA07
+  = N(
+      {    a=0.2379; b=0.1310; c= -0.9624; (* dgf_base_tfo *)
+           d= -0.5876; e= -0.7696; f= -0.2499;
+           g= -0.7734; h=0.6249; i= -0.1061;
+           tx=30.9870; ty= -26.9344; tz=42.6416 },
+      {    a=0.7529; b=0.1548; c=0.6397; (* P_O3'_275_tfo *)
+           d=0.2952; e= -0.9481; f= -0.1180;
+           g=0.5882; h=0.2777; i= -0.7595;
+           tx= -58.8919; ty= -11.3095; tz=6.0866 },
+      {    a= -0.0239; b=0.9667; c= -0.2546; (* P_O3'_180_tfo *)
+           d=0.9731; e= -0.0359; f= -0.2275;
+           g= -0.2290; h= -0.2532; i= -0.9399;
+           tx=3.5401; ty= -29.7913; tz=52.2796 },
+      {    a= -0.8912; b= -0.4531; c=0.0242; (* P_O3'_60_tfo *)
+           d= -0.1183; e=0.1805; f= -0.9764;
+           g=0.4380; h= -0.8730; i= -0.2145;
+           tx=19.9023; ty=54.8054; tz=15.2799 },
+      { x = 41.8210; y = 8.3880; z = 43.5890 }, (* P    *)
+      { x = 42.5400; y = 8.0450; z = 44.8330 }, (* O1P  *)
+      { x = 42.2470; y = 9.6920; z = 42.9910 }, (* O2P  *)
+      { x = 40.2550; y = 8.2030; z = 43.7340 }, (* O5'  *)
+      { x = 39.3505; y = 8.4697; z = 42.6565 }, (* C5'  *)
+      { x = 39.1377; y = 7.5433; z = 42.1230 }, (* H5'  *)
+      { x = 39.7203; y = 9.3119; z = 42.0717 }, (* H5'' *)
+      { x = 38.0405; y = 8.9195; z = 43.2869 }, (* C4'  *)
+      { x = 37.3687; y = 9.3036; z = 42.5193 }, (* H4'  *)
+      { x = 37.4319; y = 7.8146; z = 43.9387 }, (* O4'  *)
+      { x = 37.1959; y = 8.1354; z = 45.3237 }, (* C1'  *)
+      { x = 36.1788; y = 8.5202; z = 45.3970 }, (* H1'  *)
+      { x = 38.1721; y = 9.2328; z = 45.6504 }, (* C2'  *)
+      { x = 39.1555; y = 8.7939; z = 45.8188 }, (* H2'' *)
+      { x = 37.7862; y = 10.0617; z = 46.7013 }, (* O2'  *)
+      { x = 37.3087; y = 9.6229; z = 47.4092 }, (* H2'  *)
+      { x = 38.1844; y = 10.0268; z = 44.3367 }, (* C3'  *)
+      { x = 39.1578; y = 10.5054; z = 44.2289 }, (* H3'  *)
+      { x = 37.0547; y = 10.9127; z = 44.3441 }, (* O3'  *)
+      { x = 34.8811; y = 4.2072; z = 47.5784 }, (* N1   *)
+      { x = 35.1084; y = 6.1336; z = 46.1818 }, (* N3   *)
+      { x = 34.4108; y = 5.1360; z = 46.7207 }, (* C2   *)
+      { x = 36.3908; y = 6.1224; z = 46.6053 }, (* C4   *)
+      { x = 36.9819; y = 5.2334; z = 47.4697 }, (* C5   *)
+      { x = 36.1786; y = 4.1985; z = 48.0035 }, (* C6 *)
+      (A (
+      { x = 36.6103; y = 3.2749; z = 48.8452 }, (* N6   *)
+      { x = 38.3236; y = 5.5522; z = 47.6595 }, (* N7   *)
+      { x = 37.3887; y = 7.0024; z = 46.2437 }, (* N9   *)
+      { x = 38.5055; y = 6.6096; z = 46.9057 }, (* C8   *)
+      { x = 33.3553; y = 5.0152; z = 46.4771 }, (* H2   *)
+      { x = 37.5730; y = 3.2804; z = 49.1507 }, (* H61  *)
+      { x = 35.9775; y = 2.5638; z = 49.1828 }, (* H62  *)
+      { x = 39.5461; y = 6.9184; z = 47.0041 }) (* H8   *)
+      )
+    )
+
+let rA08
+  = N(
+      {    a=0.1084; b= -0.0895; c= -0.9901; (* dgf_base_tfo *)
+           d=0.9789; e= -0.1638; f=0.1220;
+           g= -0.1731; h= -0.9824; i=0.0698;
+           tx= -2.9039; ty=47.2655; tz=33.0094 },
+      {    a=0.7529; b=0.1548; c=0.6397; (* P_O3'_275_tfo *)
+           d=0.2952; e= -0.9481; f= -0.1180;
+           g=0.5882; h=0.2777; i= -0.7595;
+           tx= -58.8919; ty= -11.3095; tz=6.0866 },
+      {    a= -0.0239; b=0.9667; c= -0.2546; (* P_O3'_180_tfo *)
+           d=0.9731; e= -0.0359; f= -0.2275;
+           g= -0.2290; h= -0.2532; i= -0.9399;
+           tx=3.5401; ty= -29.7913; tz=52.2796 },
+      {    a= -0.8912; b= -0.4531; c=0.0242; (* P_O3'_60_tfo *)
+           d= -0.1183; e=0.1805; f= -0.9764;
+           g=0.4380; h= -0.8730; i= -0.2145;
+           tx=19.9023; ty=54.8054; tz=15.2799 },
+      { x = 41.8210; y = 8.3880; z = 43.5890 }, (* P    *)
+      { x = 42.5400; y = 8.0450; z = 44.8330 }, (* O1P  *)
+      { x = 42.2470; y = 9.6920; z = 42.9910 }, (* O2P  *)
+      { x = 40.2550; y = 8.2030; z = 43.7340 }, (* O5'  *)
+      { x = 39.4850; y = 8.9301; z = 44.6977 }, (* C5'  *)
+      { x = 39.0638; y = 9.8199; z = 44.2296 }, (* H5'  *)
+      { x = 40.0757; y = 9.0713; z = 45.6029 }, (* H5'' *)
+      { x = 38.3102; y = 8.0414; z = 45.0789 }, (* C4'  *)
+      { x = 37.7842; y = 8.4637; z = 45.9351 }, (* H4'  *)
+      { x = 37.4200; y = 7.9453; z = 43.9769 }, (* O4'  *)
+      { x = 37.2249; y = 6.5609; z = 43.6273 }, (* C1'  *)
+      { x = 36.3360; y = 6.2168; z = 44.1561 }, (* H1'  *)
+      { x = 38.4347; y = 5.8414; z = 44.1590 }, (* C2'  *)
+      { x = 39.2688; y = 5.9974; z = 43.4749 }, (* H2'' *)
+      { x = 38.2344; y = 4.4907; z = 44.4348 }, (* O2'  *)
+      { x = 37.6374; y = 4.0386; z = 43.8341 }, (* H2'  *)
+      { x = 38.6926; y = 6.6079; z = 45.4637 }, (* C3'  *)
+      { x = 39.7585; y = 6.5640; z = 45.6877 }, (* H3'  *)
+      { x = 37.8238; y = 6.0705; z = 46.4723 }, (* O3'  *)
+      { x = 33.9162; y = 6.2598; z = 39.7758 }, (* N1   *)
+      { x = 34.6709; y = 6.5759; z = 42.0215 }, (* N3   *)
+      { x = 33.7257; y = 6.5186; z = 41.0858 }, (* C2   *)
+      { x = 35.8935; y = 6.3324; z = 41.5018 }, (* C4   *)
+      { x = 36.2105; y = 6.0601; z = 40.1932 }, (* C5   *)
+      { x = 35.1538; y = 6.0151; z = 39.2537 }, (* C6 *)
+      (A (
+      { x = 35.3088; y = 5.7642; z = 37.9649 }, (* N6   *)
+      { x = 37.5818; y = 5.8677; z = 40.0507 }, (* N7   *)
+      { x = 37.0932; y = 6.3197; z = 42.1810 }, (* N9   *)
+      { x = 38.0509; y = 6.0354; z = 41.2635 }, (* C8   *)
+      { x = 32.6830; y = 6.6898; z = 41.3532 }, (* H2   *)
+      { x = 36.2305; y = 5.5855; z = 37.5925 }, (* H61  *)
+      { x = 34.5056; y = 5.7512; z = 37.3528 }, (* H62  *)
+      { x = 39.1318; y = 5.8993; z = 41.2285 }) (* H8   *)
+      )
+    )
+
+let rA09
+  = N(
+      {    a=0.8467; b=0.4166; c= -0.3311; (* dgf_base_tfo *)
+           d= -0.3962; e=0.9089; f=0.1303;
+           g=0.3552; h=0.0209; i=0.9346;
+           tx= -42.7319; ty= -26.6223; tz= -29.8163 },
+      {    a=0.7529; b=0.1548; c=0.6397; (* P_O3'_275_tfo *)
+           d=0.2952; e= -0.9481; f= -0.1180;
+           g=0.5882; h=0.2777; i= -0.7595;
+           tx= -58.8919; ty= -11.3095; tz=6.0866 },
+      {    a= -0.0239; b=0.9667; c= -0.2546; (* P_O3'_180_tfo *)
+           d=0.9731; e= -0.0359; f= -0.2275;
+           g= -0.2290; h= -0.2532; i= -0.9399;
+           tx=3.5401; ty= -29.7913; tz=52.2796 },
+      {    a= -0.8912; b= -0.4531; c=0.0242; (* P_O3'_60_tfo *)
+           d= -0.1183; e=0.1805; f= -0.9764;
+           g=0.4380; h= -0.8730; i= -0.2145;
+           tx=19.9023; ty=54.8054; tz=15.2799 },
+      { x = 41.8210; y = 8.3880; z = 43.5890 }, (* P    *)
+      { x = 42.5400; y = 8.0450; z = 44.8330 }, (* O1P  *)
+      { x = 42.2470; y = 9.6920; z = 42.9910 }, (* O2P  *)
+      { x = 40.2550; y = 8.2030; z = 43.7340 }, (* O5'  *)
+      { x = 39.3505; y = 8.4697; z = 42.6565 }, (* C5'  *)
+      { x = 39.1377; y = 7.5433; z = 42.1230 }, (* H5'  *)
+      { x = 39.7203; y = 9.3119; z = 42.0717 }, (* H5'' *)
+      { x = 38.0405; y = 8.9195; z = 43.2869 }, (* C4'  *)
+      { x = 37.6479; y = 8.1347; z = 43.9335 }, (* H4'  *)
+      { x = 38.2691; y = 10.0933; z = 44.0524 }, (* O4'  *)
+      { x = 37.3999; y = 11.1488; z = 43.5973 }, (* C1'  *)
+      { x = 36.5061; y = 11.1221; z = 44.2206 }, (* H1'  *)
+      { x = 37.0364; y = 10.7838; z = 42.1836 }, (* C2'  *)
+      { x = 37.8636; y = 11.0489; z = 41.5252 }, (* H2'' *)
+      { x = 35.8275; y = 11.3133; z = 41.7379 }, (* O2'  *)
+      { x = 35.6214; y = 12.1896; z = 42.0714 }, (* H2'  *)
+      { x = 36.9316; y = 9.2556; z = 42.2837 }, (* C3'  *)
+      { x = 37.1778; y = 8.8260; z = 41.3127 }, (* H3'  *)
+      { x = 35.6285; y = 8.9334; z = 42.7926 }, (* O3'  *)
+      { x = 38.1482; y = 15.2833; z = 46.4641 }, (* N1   *)
+      { x = 37.3641; y = 13.0968; z = 45.9007 }, (* N3   *)
+      { x = 37.5032; y = 14.1288; z = 46.7300 }, (* C2   *)
+      { x = 37.9570; y = 13.3377; z = 44.7113 }, (* C4   *)
+      { x = 38.6397; y = 14.4660; z = 44.3267 }, (* C5   *)
+      { x = 38.7473; y = 15.5229; z = 45.2609 }, (* C6 *)
+      (A (
+      { x = 39.3720; y = 16.6649; z = 45.0297 }, (* N6   *)
+      { x = 39.1079; y = 14.3351; z = 43.0223 }, (* N7   *)
+      { x = 38.0132; y = 12.4868; z = 43.6280 }, (* N9   *)
+      { x = 38.7058; y = 13.1402; z = 42.6620 }, (* C8   *)
+      { x = 37.0731; y = 14.0857; z = 47.7306 }, (* H2   *)
+      { x = 39.8113; y = 16.8281; z = 44.1350 }, (* H61  *)
+      { x = 39.4100; y = 17.3741; z = 45.7478 }, (* H62  *)
+      { x = 39.0412; y = 12.9660; z = 41.6397 }) (* H8   *)
+      )
+    )
+
+let rA10
+  = N(
+      {    a=0.7063; b=0.6317; c= -0.3196; (* dgf_base_tfo *)
+           d= -0.0403; e= -0.4149; f= -0.9090;
+           g= -0.7068; h=0.6549; i= -0.2676;
+           tx=6.4402; ty= -52.1496; tz=30.8246 },
+      {    a=0.7529; b=0.1548; c=0.6397; (* P_O3'_275_tfo *)
+           d=0.2952; e= -0.9481; f= -0.1180;
+           g=0.5882; h=0.2777; i= -0.7595;
+           tx= -58.8919; ty= -11.3095; tz=6.0866 },
+      {    a= -0.0239; b=0.9667; c= -0.2546; (* P_O3'_180_tfo *)
+           d=0.9731; e= -0.0359; f= -0.2275;
+           g= -0.2290; h= -0.2532; i= -0.9399;
+           tx=3.5401; ty= -29.7913; tz=52.2796 },
+      {    a= -0.8912; b= -0.4531; c=0.0242; (* P_O3'_60_tfo *)
+           d= -0.1183; e=0.1805; f= -0.9764;
+           g=0.4380; h= -0.8730; i= -0.2145;
+           tx=19.9023; ty=54.8054; tz=15.2799 },
+      { x = 41.8210; y = 8.3880; z = 43.5890 }, (* P    *)
+      { x = 42.5400; y = 8.0450; z = 44.8330 }, (* O1P  *)
+      { x = 42.2470; y = 9.6920; z = 42.9910 }, (* O2P  *)
+      { x = 40.2550; y = 8.2030; z = 43.7340 }, (* O5'  *)
+      { x = 39.4850; y = 8.9301; z = 44.6977 }, (* C5'  *)
+      { x = 39.0638; y = 9.8199; z = 44.2296 }, (* H5'  *)
+      { x = 40.0757; y = 9.0713; z = 45.6029 }, (* H5'' *)
+      { x = 38.3102; y = 8.0414; z = 45.0789 }, (* C4'  *)
+      { x = 37.7099; y = 7.8166; z = 44.1973 }, (* H4'  *)
+      { x = 38.8012; y = 6.8321; z = 45.6380 }, (* O4'  *)
+      { x = 38.2431; y = 6.6413; z = 46.9529 }, (* C1'  *)
+      { x = 37.3505; y = 6.0262; z = 46.8385 }, (* H1'  *)
+      { x = 37.8484; y = 8.0156; z = 47.4214 }, (* C2'  *)
+      { x = 38.7381; y = 8.5406; z = 47.7690 }, (* H2'' *)
+      { x = 36.8286; y = 8.0368; z = 48.3701 }, (* O2'  *)
+      { x = 36.8392; y = 7.3063; z = 48.9929 }, (* H2'  *)
+      { x = 37.3576; y = 8.6512; z = 46.1132 }, (* C3'  *)
+      { x = 37.5207; y = 9.7275; z = 46.1671 }, (* H3'  *)
+      { x = 35.9985; y = 8.2392; z = 45.9032 }, (* O3'  *)
+      { x = 39.9117; y = 2.2278; z = 48.8527 }, (* N1   *)
+      { x = 38.6207; y = 3.6941; z = 47.4757 }, (* N3   *)
+      { x = 38.9872; y = 2.4888; z = 47.9057 }, (* C2   *)
+      { x = 39.2961; y = 4.6720; z = 48.1174 }, (* C4   *)
+      { x = 40.2546; y = 4.5307; z = 49.0912 }, (* C5   *)
+      { x = 40.5932; y = 3.2189; z = 49.4985 }, (* C6 *)
+      (A (
+      { x = 41.4938; y = 2.9317; z = 50.4229 }, (* N6   *)
+      { x = 40.7195; y = 5.7755; z = 49.5060 }, (* N7   *)
+      { x = 39.1730; y = 6.0305; z = 47.9170 }, (* N9   *)
+      { x = 40.0413; y = 6.6250; z = 48.7728 }, (* C8   *)
+      { x = 38.5257; y = 1.5960; z = 47.4838 }, (* H2   *)
+      { x = 41.9907; y = 3.6753; z = 50.8921 }, (* H61  *)
+      { x = 41.6848; y = 1.9687; z = 50.6599 }, (* H62  *)
+      { x = 40.3571; y = 7.6321; z = 49.0452 }) (* H8   *)
+      )
+    )
+
+let rAs = [rA01;rA02;rA03;rA04;rA05;rA06;rA07;rA08;rA09;rA10]
+
+let rC
+  = N(
+      {    a= -0.0359; b= -0.8071; c=0.5894; (* dgf_base_tfo *)
+           d= -0.2669; e=0.5761; f=0.7726;
+           g= -0.9631; h= -0.1296; i= -0.2361;
+           tx=0.1584; ty=8.3434; tz=0.5434 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2430; y = -8.2420; z = 2.8260 }, (* C5'  *)
+      { x = 5.1974; y = -8.8497; z = 1.9223 }, (* H5'  *)
+      { x = 5.5548; y = -8.7348; z = 3.7469 }, (* H5'' *)
+      { x = 6.3140; y = -7.2060; z = 2.5510 }, (* C4'  *)
+      { x = 7.2954; y = -7.6762; z = 2.4898 }, (* H4'  *)
+      { x = 6.0140; y = -6.5420; z = 1.2890 }, (* O4'  *)
+      { x = 6.4190; y = -5.1840; z = 1.3620 }, (* C1'  *)
+      { x = 7.1608; y = -5.0495; z = 0.5747 }, (* H1'  *)
+      { x = 7.0760; y = -4.9560; z = 2.7270 }, (* C2'  *)
+      { x = 6.7770; y = -3.9803; z = 3.1099 }, (* H2'' *)
+      { x = 8.4500; y = -5.1930; z = 2.5810 }, (* O2'  *)
+      { x = 8.8309; y = -4.8755; z = 1.7590 }, (* H2'  *)
+      { x = 6.4060; y = -6.0590; z = 3.5580 }, (* C3'  *)
+      { x = 5.4021; y = -5.7313; z = 3.8281 }, (* H3'  *)
+      { x = 7.1570; y = -6.4240; z = 4.7070 }, (* O3'  *)
+      { x = 5.2170; y = -4.3260; z = 1.1690 }, (* N1   *)
+      { x = 4.2960; y = -2.2560; z = 0.6290 }, (* N3   *)
+      { x = 5.4330; y = -3.0200; z = 0.7990 }, (* C2   *)
+      { x = 2.9930; y = -2.6780; z = 0.7940 }, (* C4   *)
+      { x = 2.8670; y = -4.0630; z = 1.1830 }, (* C5   *)
+      { x = 3.9570; y = -4.8300; z = 1.3550 }, (* C6 *)
+      (C (
+      { x = 2.0187; y = -1.8047; z = 0.5874 }, (* N4   *)
+      { x = 6.5470; y = -2.5560; z = 0.6290 }, (* O2   *)
+      { x = 1.0684; y = -2.1236; z = 0.7109 }, (* H41  *)
+      { x = 2.2344; y = -0.8560; z = 0.3162 }, (* H42  *)
+      { x = 1.8797; y = -4.4972; z = 1.3404 }, (* H5   *)
+      { x = 3.8479; y = -5.8742; z = 1.6480 }) (* H6   *)
+      )
+    )
+
+let rC01
+  = N(
+      {    a= -0.0137; b= -0.8012; c=0.5983; (* dgf_base_tfo *)
+           d= -0.2523; e=0.5817; f=0.7733;
+           g= -0.9675; h= -0.1404; i= -0.2101;
+           tx=0.2031; ty=8.3874; tz=0.4228 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2416; y = -8.2422; z = 2.8181 }, (* C5'  *)
+      { x = 5.2050; y = -8.8128; z = 1.8901 }, (* H5'  *)
+      { x = 5.5368; y = -8.7738; z = 3.7227 }, (* H5'' *)
+      { x = 6.3232; y = -7.2037; z = 2.6002 }, (* C4'  *)
+      { x = 7.3048; y = -7.6757; z = 2.5577 }, (* H4'  *)
+      { x = 6.0635; y = -6.5092; z = 1.3456 }, (* O4'  *)
+      { x = 6.4697; y = -5.1547; z = 1.4629 }, (* C1'  *)
+      { x = 7.2354; y = -5.0043; z = 0.7018 }, (* H1'  *)
+      { x = 7.0856; y = -4.9610; z = 2.8521 }, (* C2'  *)
+      { x = 6.7777; y = -3.9935; z = 3.2487 }, (* H2'' *)
+      { x = 8.4627; y = -5.1992; z = 2.7423 }, (* O2'  *)
+      { x = 8.8693; y = -4.8638; z = 1.9399 }, (* H2'  *)
+      { x = 6.3877; y = -6.0809; z = 3.6362 }, (* C3'  *)
+      { x = 5.3770; y = -5.7562; z = 3.8834 }, (* H3'  *)
+      { x = 7.1024; y = -6.4754; z = 4.7985 }, (* O3'  *)
+      { x = 5.2764; y = -4.2883; z = 1.2538 }, (* N1   *)
+      { x = 4.3777; y = -2.2062; z = 0.7229 }, (* N3   *)
+      { x = 5.5069; y = -2.9779; z = 0.9088 }, (* C2   *)
+      { x = 3.0693; y = -2.6246; z = 0.8500 }, (* C4   *)
+      { x = 2.9279; y = -4.0146; z = 1.2149 }, (* C5   *)
+      { x = 4.0101; y = -4.7892; z = 1.4017 }, (* C6 *)
+      (C (
+      { x = 2.1040; y = -1.7437; z = 0.6331 }, (* N4   *)
+      { x = 6.6267; y = -2.5166; z = 0.7728 }, (* O2   *)
+      { x = 1.1496; y = -2.0600; z = 0.7287 }, (* H41  *)
+      { x = 2.3303; y = -0.7921; z = 0.3815 }, (* H42  *)
+      { x = 1.9353; y = -4.4465; z = 1.3419 }, (* H5   *)
+      { x = 3.8895; y = -5.8371; z = 1.6762 }) (* H6   *)
+      )
+    )
+
+let rC02
+  = N(
+      {    a=0.5141; b=0.0246; c=0.8574; (* dgf_base_tfo *)
+           d= -0.5547; e= -0.7529; f=0.3542;
+           g=0.6542; h= -0.6577; i= -0.3734;
+           tx= -9.1111; ty= -3.4598; tz= -3.2939 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 4.3825; y = -6.6585; z = 4.0489 }, (* C5'  *)
+      { x = 4.6841; y = -7.2019; z = 4.9443 }, (* H5'  *)
+      { x = 3.6189; y = -5.8889; z = 4.1625 }, (* H5'' *)
+      { x = 5.6255; y = -5.9175; z = 3.5998 }, (* C4'  *)
+      { x = 5.8732; y = -5.1228; z = 4.3034 }, (* H4'  *)
+      { x = 6.7337; y = -6.8605; z = 3.5222 }, (* O4'  *)
+      { x = 7.5932; y = -6.4923; z = 2.4548 }, (* C1'  *)
+      { x = 8.5661; y = -6.2983; z = 2.9064 }, (* H1'  *)
+      { x = 7.0527; y = -5.2012; z = 1.8322 }, (* C2'  *)
+      { x = 7.1627; y = -5.2525; z = 0.7490 }, (* H2'' *)
+      { x = 7.6666; y = -4.1249; z = 2.4880 }, (* O2'  *)
+      { x = 8.5944; y = -4.2543; z = 2.6981 }, (* H2'  *)
+      { x = 5.5661; y = -5.3029; z = 2.2009 }, (* C3'  *)
+      { x = 5.0841; y = -6.0018; z = 1.5172 }, (* H3'  *)
+      { x = 4.9062; y = -4.0452; z = 2.2042 }, (* O3'  *)
+      { x = 7.6298; y = -7.6136; z = 1.4752 }, (* N1   *)
+      { x = 8.6945; y = -8.7046; z = -0.2857 }, (* N3   *)
+      { x = 8.6943; y = -7.6514; z = 0.6066 }, (* C2   *)
+      { x = 7.7426; y = -9.6987; z = -0.3801 }, (* C4   *)
+      { x = 6.6642; y = -9.5742; z = 0.5722 }, (* C5   *)
+      { x = 6.6391; y = -8.5592; z = 1.4526 }, (* C6 *)
+      (C (
+      { x = 7.9033; y = -10.6371; z = -1.3010 }, (* N4   *)
+      { x = 9.5840; y = -6.8186; z = 0.6136 }, (* O2   *)
+      { x = 7.2009; y = -11.3604; z = -1.3619 }, (* H41  *)
+      { x = 8.7058; y = -10.6168; z = -1.9140 }, (* H42  *)
+      { x = 5.8585; y = -10.3083; z = 0.5822 }, (* H5   *)
+      { x = 5.8197; y = -8.4773; z = 2.1667 }) (* H6   *)
+      )
+    )
+
+let rC03
+  = N(
+      {    a= -0.4993; b=0.0476; c=0.8651; (* dgf_base_tfo *)
+           d=0.8078; e= -0.3353; f=0.4847;
+           g=0.3132; h=0.9409; i=0.1290;
+           tx=6.2989; ty= -5.2303; tz= -3.8577 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 3.9938; y = -6.7042; z = 1.9023 }, (* C5'  *)
+      { x = 3.2332; y = -5.9343; z = 2.0319 }, (* H5'  *)
+      { x = 3.9666; y = -7.2863; z = 0.9812 }, (* H5'' *)
+      { x = 5.3098; y = -5.9546; z = 1.8564 }, (* C4'  *)
+      { x = 5.3863; y = -5.3702; z = 0.9395 }, (* H4'  *)
+      { x = 5.3851; y = -5.0642; z = 3.0076 }, (* O4'  *)
+      { x = 6.7315; y = -4.9724; z = 3.4462 }, (* C1'  *)
+      { x = 7.0033; y = -3.9202; z = 3.3619 }, (* H1'  *)
+      { x = 7.5997; y = -5.8018; z = 2.4948 }, (* C2'  *)
+      { x = 8.3627; y = -6.3254; z = 3.0707 }, (* H2'' *)
+      { x = 8.0410; y = -4.9501; z = 1.4724 }, (* O2'  *)
+      { x = 8.2781; y = -4.0644; z = 1.7570 }, (* H2'  *)
+      { x = 6.5701; y = -6.8129; z = 1.9714 }, (* C3'  *)
+      { x = 6.4186; y = -7.5809; z = 2.7299 }, (* H3'  *)
+      { x = 6.9357; y = -7.3841; z = 0.7235 }, (* O3'  *)
+      { x = 6.8024; y = -5.4718; z = 4.8475 }, (* N1   *)
+      { x = 7.9218; y = -5.5700; z = 6.8877 }, (* N3   *)
+      { x = 7.8908; y = -5.0886; z = 5.5944 }, (* C2   *)
+      { x = 6.9789; y = -6.3827; z = 7.4823 }, (* C4   *)
+      { x = 5.8742; y = -6.7319; z = 6.6202 }, (* C5   *)
+      { x = 5.8182; y = -6.2769; z = 5.3570 }, (* C6 *)
+      (C (
+      { x = 7.1702; y = -6.7511; z = 8.7402 }, (* N4   *)
+      { x = 8.7747; y = -4.3728; z = 5.1568 }, (* O2   *)
+      { x = 6.4741; y = -7.3461; z = 9.1662 }, (* H41  *)
+      { x = 7.9889; y = -6.4396; z = 9.2429 }, (* H42  *)
+      { x = 5.0736; y = -7.3713; z = 6.9922 }, (* H5   *)
+      { x = 4.9784; y = -6.5473; z = 4.7170 }) (* H6   *)
+      )
+    )
+
+let rC04
+  = N(
+      {    a= -0.5669; b= -0.8012; c=0.1918; (* dgf_base_tfo *)
+           d= -0.8129; e=0.5817; f=0.0273;
+           g= -0.1334; h= -0.1404; i= -0.9811;
+           tx= -0.3279; ty=8.3874; tz=0.3355 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2416; y = -8.2422; z = 2.8181 }, (* C5'  *)
+      { x = 5.2050; y = -8.8128; z = 1.8901 }, (* H5'  *)
+      { x = 5.5368; y = -8.7738; z = 3.7227 }, (* H5'' *)
+      { x = 6.3232; y = -7.2037; z = 2.6002 }, (* C4'  *)
+      { x = 7.3048; y = -7.6757; z = 2.5577 }, (* H4'  *)
+      { x = 6.0635; y = -6.5092; z = 1.3456 }, (* O4'  *)
+      { x = 6.4697; y = -5.1547; z = 1.4629 }, (* C1'  *)
+      { x = 7.2354; y = -5.0043; z = 0.7018 }, (* H1'  *)
+      { x = 7.0856; y = -4.9610; z = 2.8521 }, (* C2'  *)
+      { x = 6.7777; y = -3.9935; z = 3.2487 }, (* H2'' *)
+      { x = 8.4627; y = -5.1992; z = 2.7423 }, (* O2'  *)
+      { x = 8.8693; y = -4.8638; z = 1.9399 }, (* H2'  *)
+      { x = 6.3877; y = -6.0809; z = 3.6362 }, (* C3'  *)
+      { x = 5.3770; y = -5.7562; z = 3.8834 }, (* H3'  *)
+      { x = 7.1024; y = -6.4754; z = 4.7985 }, (* O3'  *)
+      { x = 5.2764; y = -4.2883; z = 1.2538 }, (* N1   *)
+      { x = 3.8961; y = -3.0896; z = -0.1893 }, (* N3   *)
+      { x = 5.0095; y = -3.8907; z = -0.0346 }, (* C2   *)
+      { x = 3.0480; y = -2.6632; z = 0.8116 }, (* C4   *)
+      { x = 3.4093; y = -3.1310; z = 2.1292 }, (* C5   *)
+      { x = 4.4878; y = -3.9124; z = 2.3088 }, (* C6 *)
+      (C (
+      { x = 2.0216; y = -1.8941; z = 0.4804 }, (* N4   *)
+      { x = 5.7005; y = -4.2164; z = -0.9842 }, (* O2   *)
+      { x = 1.4067; y = -1.5873; z = 1.2205 }, (* H41  *)
+      { x = 1.8721; y = -1.6319; z = -0.4835 }, (* H42  *)
+      { x = 2.8048; y = -2.8507; z = 2.9918 }, (* H5   *)
+      { x = 4.7491; y = -4.2593; z = 3.3085 }) (* H6   *)
+      )
+    )
+
+let rC05
+  = N(
+      {    a= -0.6298; b=0.0246; c=0.7763; (* dgf_base_tfo *)
+           d= -0.5226; e= -0.7529; f= -0.4001;
+           g=0.5746; h= -0.6577; i=0.4870;
+           tx= -0.0208; ty= -3.4598; tz= -9.6882 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 4.3825; y = -6.6585; z = 4.0489 }, (* C5'  *)
+      { x = 4.6841; y = -7.2019; z = 4.9443 }, (* H5'  *)
+      { x = 3.6189; y = -5.8889; z = 4.1625 }, (* H5'' *)
+      { x = 5.6255; y = -5.9175; z = 3.5998 }, (* C4'  *)
+      { x = 5.8732; y = -5.1228; z = 4.3034 }, (* H4'  *)
+      { x = 6.7337; y = -6.8605; z = 3.5222 }, (* O4'  *)
+      { x = 7.5932; y = -6.4923; z = 2.4548 }, (* C1'  *)
+      { x = 8.5661; y = -6.2983; z = 2.9064 }, (* H1'  *)
+      { x = 7.0527; y = -5.2012; z = 1.8322 }, (* C2'  *)
+      { x = 7.1627; y = -5.2525; z = 0.7490 }, (* H2'' *)
+      { x = 7.6666; y = -4.1249; z = 2.4880 }, (* O2'  *)
+      { x = 8.5944; y = -4.2543; z = 2.6981 }, (* H2'  *)
+      { x = 5.5661; y = -5.3029; z = 2.2009 }, (* C3'  *)
+      { x = 5.0841; y = -6.0018; z = 1.5172 }, (* H3'  *)
+      { x = 4.9062; y = -4.0452; z = 2.2042 }, (* O3'  *)
+      { x = 7.6298; y = -7.6136; z = 1.4752 }, (* N1   *)
+      { x = 8.5977; y = -9.5977; z = 0.7329 }, (* N3   *)
+      { x = 8.5951; y = -8.5745; z = 1.6594 }, (* C2   *)
+      { x = 7.7372; y = -9.7371; z = -0.3364 }, (* C4   *)
+      { x = 6.7596; y = -8.6801; z = -0.4476 }, (* C5   *)
+      { x = 6.7338; y = -7.6721; z = 0.4408 }, (* C6 *)
+      (C (
+      { x = 7.8849; y = -10.7881; z = -1.1289 }, (* N4   *)
+      { x = 9.3993; y = -8.5377; z = 2.5743 }, (* O2   *)
+      { x = 7.2499; y = -10.8809; z = -1.9088 }, (* H41  *)
+      { x = 8.6122; y = -11.4649; z = -0.9468 }, (* H42  *)
+      { x = 6.0317; y = -8.6941; z = -1.2588 }, (* H5   *)
+      { x = 5.9901; y = -6.8809; z = 0.3459 }) (* H6   *)
+      )
+    )
+
+let rC06
+  = N(
+      {    a= -0.9837; b=0.0476; c= -0.1733; (* dgf_base_tfo *)
+           d= -0.1792; e= -0.3353; f=0.9249;
+           g= -0.0141; h=0.9409; i=0.3384;
+           tx=5.7793; ty= -5.2303; tz=4.5997 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 3.9938; y = -6.7042; z = 1.9023 }, (* C5'  *)
+      { x = 3.2332; y = -5.9343; z = 2.0319 }, (* H5'  *)
+      { x = 3.9666; y = -7.2863; z = 0.9812 }, (* H5'' *)
+      { x = 5.3098; y = -5.9546; z = 1.8564 }, (* C4'  *)
+      { x = 5.3863; y = -5.3702; z = 0.9395 }, (* H4'  *)
+      { x = 5.3851; y = -5.0642; z = 3.0076 }, (* O4'  *)
+      { x = 6.7315; y = -4.9724; z = 3.4462 }, (* C1'  *)
+      { x = 7.0033; y = -3.9202; z = 3.3619 }, (* H1'  *)
+      { x = 7.5997; y = -5.8018; z = 2.4948 }, (* C2'  *)
+      { x = 8.3627; y = -6.3254; z = 3.0707 }, (* H2'' *)
+      { x = 8.0410; y = -4.9501; z = 1.4724 }, (* O2'  *)
+      { x = 8.2781; y = -4.0644; z = 1.7570 }, (* H2'  *)
+      { x = 6.5701; y = -6.8129; z = 1.9714 }, (* C3'  *)
+      { x = 6.4186; y = -7.5809; z = 2.7299 }, (* H3'  *)
+      { x = 6.9357; y = -7.3841; z = 0.7235 }, (* O3'  *)
+      { x = 6.8024; y = -5.4718; z = 4.8475 }, (* N1   *)
+      { x = 6.6920; y = -5.0495; z = 7.1354 }, (* N3   *)
+      { x = 6.6201; y = -4.5500; z = 5.8506 }, (* C2   *)
+      { x = 6.9254; y = -6.3614; z = 7.4926 }, (* C4   *)
+      { x = 7.1046; y = -7.2543; z = 6.3718 }, (* C5   *)
+      { x = 7.0391; y = -6.7951; z = 5.1106 }, (* C6 *)
+      (C (
+      { x = 6.9614; y = -6.6648; z = 8.7815 }, (* N4   *)
+      { x = 6.4083; y = -3.3696; z = 5.6340 }, (* O2   *)
+      { x = 7.1329; y = -7.6280; z = 9.0324 }, (* H41  *)
+      { x = 6.8204; y = -5.9469; z = 9.4777 }, (* H42  *)
+      { x = 7.2954; y = -8.3135; z = 6.5440 }, (* H5   *)
+      { x = 7.1753; y = -7.4798; z = 4.2735 }) (* H6   *)
+      )
+    )
+
+let rC07
+  = N(
+      {    a=0.0033; b=0.2720; c= -0.9623; (* dgf_base_tfo *)
+           d=0.3013; e= -0.9179; f= -0.2584;
+           g= -0.9535; h= -0.2891; i= -0.0850;
+           tx=43.0403; ty=13.7233; tz=34.5710 },
+      {    a=0.9187; b=0.2887; c=0.2694; (* P_O3'_275_tfo *)
+           d=0.0302; e= -0.7316; f=0.6811;
+           g=0.3938; h= -0.6176; i= -0.6808;
+           tx= -48.4330; ty=26.3254; tz=13.6383 },
+      {    a= -0.1504; b=0.7744; c= -0.6145; (* P_O3'_180_tfo *)
+           d=0.7581; e=0.4893; f=0.4311;
+           g=0.6345; h= -0.4010; i= -0.6607;
+           tx= -31.9784; ty= -13.4285; tz=44.9650 },
+      {    a= -0.6236; b= -0.7810; c= -0.0337; (* P_O3'_60_tfo *)
+           d= -0.6890; e=0.5694; f= -0.4484;
+           g=0.3694; h= -0.2564; i= -0.8932;
+           tx=12.1105; ty=30.8774; tz=46.0946 },
+      { x = 33.3400; y = 11.0980; z = 46.1750 }, (* P    *)
+      { x = 34.5130; y = 10.2320; z = 46.4660 }, (* O1P  *)
+      { x = 33.4130; y = 12.3960; z = 46.9340 }, (* O2P  *)
+      { x = 31.9810; y = 10.3390; z = 46.4820 }, (* O5'  *)
+      { x = 30.8152; y = 11.1619; z = 46.2003 }, (* C5'  *)
+      { x = 30.4519; y = 10.9454; z = 45.1957 }, (* H5'  *)
+      { x = 31.0379; y = 12.2016; z = 46.4400 }, (* H5'' *)
+      { x = 29.7081; y = 10.7448; z = 47.1428 }, (* C4'  *)
+      { x = 28.8710; y = 11.4416; z = 47.0982 }, (* H4'  *)
+      { x = 29.2550; y = 9.4394; z = 46.8162 }, (* O4'  *)
+      { x = 29.3907; y = 8.5625; z = 47.9460 }, (* C1'  *)
+      { x = 28.4416; y = 8.5669; z = 48.4819 }, (* H1'  *)
+      { x = 30.4468; y = 9.2031; z = 48.7952 }, (* C2'  *)
+      { x = 31.4222; y = 8.9651; z = 48.3709 }, (* H2'' *)
+      { x = 30.3701; y = 8.9157; z = 50.1624 }, (* O2'  *)
+      { x = 30.0652; y = 8.0304; z = 50.3740 }, (* H2'  *)
+      { x = 30.1622; y = 10.6879; z = 48.6120 }, (* C3'  *)
+      { x = 31.0952; y = 11.2399; z = 48.7254 }, (* H3'  *)
+      { x = 29.1076; y = 11.1535; z = 49.4702 }, (* O3'  *)
+      { x = 29.7883; y = 7.2209; z = 47.5235 }, (* N1   *)
+      { x = 29.1825; y = 5.0438; z = 46.8275 }, (* N3   *)
+      { x = 28.8008; y = 6.2912; z = 47.2263 }, (* C2   *)
+      { x = 30.4888; y = 4.6890; z = 46.7186 }, (* C4   *)
+      { x = 31.5034; y = 5.6405; z = 47.0249 }, (* C5   *)
+      { x = 31.1091; y = 6.8691; z = 47.4156 }, (* C6 *)
+      (C (
+      { x = 30.8109; y = 3.4584; z = 46.3336 }, (* N4   *)
+      { x = 27.6171; y = 6.5989; z = 47.3189 }, (* O2   *)
+      { x = 31.7923; y = 3.2301; z = 46.2638 }, (* H41  *)
+      { x = 30.0880; y = 2.7857; z = 46.1215 }, (* H42  *)
+      { x = 32.5542; y = 5.3634; z = 46.9395 }, (* H5   *)
+      { x = 31.8523; y = 7.6279; z = 47.6603 }) (* H6   *)
+      )
+    )
+
+let rC08
+  = N(
+      {    a=0.0797; b= -0.6026; c= -0.7941; (* dgf_base_tfo *)
+           d=0.7939; e=0.5201; f= -0.3150;
+           g=0.6028; h= -0.6054; i=0.5198;
+           tx= -36.8341; ty=41.5293; tz=1.6628 },
+      {    a=0.9187; b=0.2887; c=0.2694; (* P_O3'_275_tfo *)
+           d=0.0302; e= -0.7316; f=0.6811;
+           g=0.3938; h= -0.6176; i= -0.6808;
+           tx= -48.4330; ty=26.3254; tz=13.6383 },
+      {    a= -0.1504; b=0.7744; c= -0.6145; (* P_O3'_180_tfo *)
+           d=0.7581; e=0.4893; f=0.4311;
+           g=0.6345; h= -0.4010; i= -0.6607;
+           tx= -31.9784; ty= -13.4285; tz=44.9650 },
+      {    a= -0.6236; b= -0.7810; c= -0.0337; (* P_O3'_60_tfo *)
+           d= -0.6890; e=0.5694; f= -0.4484;
+           g=0.3694; h= -0.2564; i= -0.8932;
+           tx=12.1105; ty=30.8774; tz=46.0946 },
+      { x = 33.3400; y = 11.0980; z = 46.1750 }, (* P    *)
+      { x = 34.5130; y = 10.2320; z = 46.4660 }, (* O1P  *)
+      { x = 33.4130; y = 12.3960; z = 46.9340 }, (* O2P  *)
+      { x = 31.9810; y = 10.3390; z = 46.4820 }, (* O5'  *)
+      { x = 31.8779; y = 9.9369; z = 47.8760 }, (* C5'  *)
+      { x = 31.3239; y = 10.6931; z = 48.4322 }, (* H5'  *)
+      { x = 32.8647; y = 9.6624; z = 48.2489 }, (* H5'' *)
+      { x = 31.0429; y = 8.6773; z = 47.9401 }, (* C4'  *)
+      { x = 31.0779; y = 8.2331; z = 48.9349 }, (* H4'  *)
+      { x = 29.6956; y = 8.9669; z = 47.5983 }, (* O4'  *)
+      { x = 29.2784; y = 8.1700; z = 46.4782 }, (* C1'  *)
+      { x = 28.8006; y = 7.2731; z = 46.8722 }, (* H1'  *)
+      { x = 30.5544; y = 7.7940; z = 45.7875 }, (* C2'  *)
+      { x = 30.8837; y = 8.6410; z = 45.1856 }, (* H2'' *)
+      { x = 30.5100; y = 6.6007; z = 45.0582 }, (* O2'  *)
+      { x = 29.6694; y = 6.4168; z = 44.6326 }, (* H2'  *)
+      { x = 31.5146; y = 7.5954; z = 46.9527 }, (* C3'  *)
+      { x = 32.5255; y = 7.8261; z = 46.6166 }, (* H3'  *)
+      { x = 31.3876; y = 6.2951; z = 47.5516 }, (* O3'  *)
+      { x = 28.3976; y = 8.9302; z = 45.5933 }, (* N1   *)
+      { x = 26.2155; y = 9.6135; z = 44.9910 }, (* N3   *)
+      { x = 27.0281; y = 8.8961; z = 45.8192 }, (* C2   *)
+      { x = 26.7044; y = 10.3489; z = 43.9595 }, (* C4   *)
+      { x = 28.1088; y = 10.3837; z = 43.7247 }, (* C5   *)
+      { x = 28.8978; y = 9.6708; z = 44.5535 }, (* C6 *)
+      (C (
+      { x = 25.8715; y = 11.0249; z = 43.1749 }, (* N4   *)
+      { x = 26.5733; y = 8.2371; z = 46.7484 }, (* O2   *)
+      { x = 26.2707; y = 11.5609; z = 42.4177 }, (* H41  *)
+      { x = 24.8760; y = 10.9939; z = 43.3427 }, (* H42  *)
+      { x = 28.5089; y = 10.9722; z = 42.8990 }, (* H5   *)
+      { x = 29.9782; y = 9.6687; z = 44.4097 }) (* H6   *)
+      )
+    )
+
+let rC09
+  = N(
+      {    a=0.8727; b=0.4760; c= -0.1091; (* dgf_base_tfo *)
+           d= -0.4188; e=0.6148; f= -0.6682;
+           g= -0.2510; h=0.6289; i=0.7359;
+           tx= -8.1687; ty= -52.0761; tz= -25.0726 },
+      {    a=0.9187; b=0.2887; c=0.2694; (* P_O3'_275_tfo *)
+           d=0.0302; e= -0.7316; f=0.6811;
+           g=0.3938; h= -0.6176; i= -0.6808;
+           tx= -48.4330; ty=26.3254; tz=13.6383 },
+      {    a= -0.1504; b=0.7744; c= -0.6145; (* P_O3'_180_tfo *)
+           d=0.7581; e=0.4893; f=0.4311;
+           g=0.6345; h= -0.4010; i= -0.6607;
+           tx= -31.9784; ty= -13.4285; tz=44.9650 },
+      {    a= -0.6236; b= -0.7810; c= -0.0337; (* P_O3'_60_tfo *)
+           d= -0.6890; e=0.5694; f= -0.4484;
+           g=0.3694; h= -0.2564; i= -0.8932;
+           tx=12.1105; ty=30.8774; tz=46.0946 },
+      { x = 33.3400; y = 11.0980; z = 46.1750 }, (* P    *)
+      { x = 34.5130; y = 10.2320; z = 46.4660 }, (* O1P  *)
+      { x = 33.4130; y = 12.3960; z = 46.9340 }, (* O2P  *)
+      { x = 31.9810; y = 10.3390; z = 46.4820 }, (* O5'  *)
+      { x = 30.8152; y = 11.1619; z = 46.2003 }, (* C5'  *)
+      { x = 30.4519; y = 10.9454; z = 45.1957 }, (* H5'  *)
+      { x = 31.0379; y = 12.2016; z = 46.4400 }, (* H5'' *)
+      { x = 29.7081; y = 10.7448; z = 47.1428 }, (* C4'  *)
+      { x = 29.4506; y = 9.6945; z = 47.0059 }, (* H4'  *)
+      { x = 30.1045; y = 10.9634; z = 48.4885 }, (* O4'  *)
+      { x = 29.1794; y = 11.8418; z = 49.1490 }, (* C1'  *)
+      { x = 28.4388; y = 11.2210; z = 49.6533 }, (* H1'  *)
+      { x = 28.5211; y = 12.6008; z = 48.0367 }, (* C2'  *)
+      { x = 29.1947; y = 13.3949; z = 47.7147 }, (* H2'' *)
+      { x = 27.2316; y = 13.0683; z = 48.3134 }, (* O2'  *)
+      { x = 27.0851; y = 13.3391; z = 49.2227 }, (* H2'  *)
+      { x = 28.4131; y = 11.5507; z = 46.9391 }, (* C3'  *)
+      { x = 28.4451; y = 12.0512; z = 45.9713 }, (* H3'  *)
+      { x = 27.2707; y = 10.6955; z = 47.1097 }, (* O3'  *)
+      { x = 29.8751; y = 12.7405; z = 50.0682 }, (* N1   *)
+      { x = 30.7172; y = 13.1841; z = 52.2328 }, (* N3   *)
+      { x = 30.0617; y = 12.3404; z = 51.3847 }, (* C2   *)
+      { x = 31.1834; y = 14.3941; z = 51.8297 }, (* C4   *)
+      { x = 30.9913; y = 14.8074; z = 50.4803 }, (* C5   *)
+      { x = 30.3434; y = 13.9610; z = 49.6548 }, (* C6 *)
+      (C (
+      { x = 31.8090; y = 15.1847; z = 52.6957 }, (* N4   *)
+      { x = 29.6470; y = 11.2494; z = 51.7616 }, (* O2   *)
+      { x = 32.1422; y = 16.0774; z = 52.3606 }, (* H41  *)
+      { x = 31.9392; y = 14.8893; z = 53.6527 }, (* H42  *)
+      { x = 31.3632; y = 15.7771; z = 50.1491 }, (* H5   *)
+      { x = 30.1742; y = 14.2374; z = 48.6141 }) (* H6   *)
+      )
+    )
+
+let rC10
+  = N(
+      {    a=0.1549; b=0.8710; c= -0.4663; (* dgf_base_tfo *)
+           d=0.6768; e= -0.4374; f= -0.5921;
+           g= -0.7197; h= -0.2239; i= -0.6572;
+           tx=25.2447; ty= -14.1920; tz=50.3201 },
+      {    a=0.9187; b=0.2887; c=0.2694; (* P_O3'_275_tfo *)
+           d=0.0302; e= -0.7316; f=0.6811;
+           g=0.3938; h= -0.6176; i= -0.6808;
+           tx= -48.4330; ty=26.3254; tz=13.6383 },
+      {    a= -0.1504; b=0.7744; c= -0.6145; (* P_O3'_180_tfo *)
+           d=0.7581; e=0.4893; f=0.4311;
+           g=0.6345; h= -0.4010; i= -0.6607;
+           tx= -31.9784; ty= -13.4285; tz=44.9650 },
+      {    a= -0.6236; b= -0.7810; c= -0.0337; (* P_O3'_60_tfo *)
+           d= -0.6890; e=0.5694; f= -0.4484;
+           g=0.3694; h= -0.2564; i= -0.8932;
+           tx=12.1105; ty=30.8774; tz=46.0946 },
+      { x = 33.3400; y = 11.0980; z = 46.1750 }, (* P    *)
+      { x = 34.5130; y = 10.2320; z = 46.4660 }, (* O1P  *)
+      { x = 33.4130; y = 12.3960; z = 46.9340 }, (* O2P  *)
+      { x = 31.9810; y = 10.3390; z = 46.4820 }, (* O5'  *)
+      { x = 31.8779; y = 9.9369; z = 47.8760 }, (* C5'  *)
+      { x = 31.3239; y = 10.6931; z = 48.4322 }, (* H5'  *)
+      { x = 32.8647; y = 9.6624; z = 48.2489 }, (* H5'' *)
+      { x = 31.0429; y = 8.6773; z = 47.9401 }, (* C4'  *)
+      { x = 30.0440; y = 8.8473; z = 47.5383 }, (* H4'  *)
+      { x = 31.6749; y = 7.6351; z = 47.2119 }, (* O4'  *)
+      { x = 31.9159; y = 6.5022; z = 48.0616 }, (* C1'  *)
+      { x = 31.0691; y = 5.8243; z = 47.9544 }, (* H1'  *)
+      { x = 31.9300; y = 7.0685; z = 49.4493 }, (* C2'  *)
+      { x = 32.9024; y = 7.5288; z = 49.6245 }, (* H2'' *)
+      { x = 31.5672; y = 6.1750; z = 50.4632 }, (* O2'  *)
+      { x = 31.8416; y = 5.2663; z = 50.3200 }, (* H2'  *)
+      { x = 30.8618; y = 8.1514; z = 49.3749 }, (* C3'  *)
+      { x = 31.1122; y = 8.9396; z = 50.0850 }, (* H3'  *)
+      { x = 29.5351; y = 7.6245; z = 49.5409 }, (* O3'  *)
+      { x = 33.1890; y = 5.8629; z = 47.7343 }, (* N1   *)
+      { x = 34.4004; y = 4.2636; z = 46.4828 }, (* N3   *)
+      { x = 33.2062; y = 4.8497; z = 46.7851 }, (* C2   *)
+      { x = 35.5600; y = 4.6374; z = 47.0822 }, (* C4   *)
+      { x = 35.5444; y = 5.6751; z = 48.0577 }, (* C5   *)
+      { x = 34.3565; y = 6.2450; z = 48.3432 }, (* C6 *)
+      (C (
+      { x = 36.6977; y = 4.0305; z = 46.7598 }, (* N4   *)
+      { x = 32.1661; y = 4.5034; z = 46.2348 }, (* O2   *)
+      { x = 37.5405; y = 4.3347; z = 47.2259 }, (* H41  *)
+      { x = 36.7033; y = 3.2923; z = 46.0706 }, (* H42  *)
+      { x = 36.4713; y = 5.9811; z = 48.5428 }, (* H5   *)
+      { x = 34.2986; y = 7.0426; z = 49.0839 }) (* H6   *)
+      )
+    )
+
+let rCs = [rC01;rC02;rC03;rC04;rC05;rC06;rC07;rC08;rC09;rC10]
+
+let rG
+  = N(
+      {    a= -0.0018; b= -0.8207; c=0.5714; (* dgf_base_tfo *)
+           d=0.2679; e= -0.5509; f= -0.7904;
+           g=0.9634; h=0.1517; i=0.2209;
+           tx=0.0073; ty=8.4030; tz=0.6232 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 5.4550; y = 8.2120; z = -2.8810 }, (* C5'  *)
+      { x = 5.4546; y = 8.8508; z = -1.9978 }, (* H5'  *)
+      { x = 5.7588; y = 8.6625; z = -3.8259 }, (* H5'' *)
+      { x = 6.4970; y = 7.1480; z = -2.5980 }, (* C4'  *)
+      { x = 7.4896; y = 7.5919; z = -2.5214 }, (* H4'  *)
+      { x = 6.1630; y = 6.4860; z = -1.3440 }, (* O4'  *)
+      { x = 6.5400; y = 5.1200; z = -1.4190 }, (* C1'  *)
+      { x = 7.2763; y = 4.9681; z = -0.6297 }, (* H1'  *)
+      { x = 7.1940; y = 4.8830; z = -2.7770 }, (* C2'  *)
+      { x = 6.8667; y = 3.9183; z = -3.1647 }, (* H2'' *)
+      { x = 8.5860; y = 5.0910; z = -2.6140 }, (* O2'  *)
+      { x = 8.9510; y = 4.7626; z = -1.7890 }, (* H2'  *)
+      { x = 6.5720; y = 6.0040; z = -3.6090 }, (* C3'  *)
+      { x = 5.5636; y = 5.7066; z = -3.8966 }, (* H3'  *)
+      { x = 7.3801; y = 6.3562; z = -4.7350 }, (* O3'  *)
+      { x = 4.7150; y = 0.4910; z = -0.1360 }, (* N1   *)
+      { x = 6.3490; y = 2.1730; z = -0.6020 }, (* N3   *)
+      { x = 5.9530; y = 0.9650; z = -0.2670 }, (* C2   *)
+      { x = 5.2900; y = 2.9790; z = -0.8260 }, (* C4   *)
+      { x = 3.9720; y = 2.6390; z = -0.7330 }, (* C5   *)
+      { x = 3.6770; y = 1.3160; z = -0.3660 }, (* C6 *)
+      (G (
+      { x = 6.8426; y = 0.0056; z = -0.0019 }, (* N2   *)
+      { x = 3.1660; y = 3.7290; z = -1.0360 }, (* N7   *)
+      { x = 5.3170; y = 4.2990; z = -1.1930 }, (* N9   *)
+      { x = 4.0100; y = 4.6780; z = -1.2990 }, (* C8   *)
+      { x = 2.4280; y = 0.8450; z = -0.2360 }, (* O6   *)
+      { x = 4.6151; y = -0.4677; z = 0.1305 }, (* H1   *)
+      { x = 6.6463; y = -0.9463; z = 0.2729 }, (* H21  *)
+      { x = 7.8170; y = 0.2642; z = -0.0640 }, (* H22  *)
+      { x = 3.4421; y = 5.5744; z = -1.5482 }) (* H8   *)
+      )
+    )
+
+let rG01
+  = N(
+      {    a= -0.0043; b= -0.8175; c=0.5759; (* dgf_base_tfo *)
+           d=0.2617; e= -0.5567; f= -0.7884;
+           g=0.9651; h=0.1473; i=0.2164;
+           tx=0.0359; ty=8.3929; tz=0.5532 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 5.4352; y = 8.2183; z = -2.7757 }, (* C5'  *)
+      { x = 5.3830; y = 8.7883; z = -1.8481 }, (* H5'  *)
+      { x = 5.7729; y = 8.7436; z = -3.6691 }, (* H5'' *)
+      { x = 6.4830; y = 7.1518; z = -2.5252 }, (* C4'  *)
+      { x = 7.4749; y = 7.5972; z = -2.4482 }, (* H4'  *)
+      { x = 6.1626; y = 6.4620; z = -1.2827 }, (* O4'  *)
+      { x = 6.5431; y = 5.0992; z = -1.3905 }, (* C1'  *)
+      { x = 7.2871; y = 4.9328; z = -0.6114 }, (* H1'  *)
+      { x = 7.1852; y = 4.8935; z = -2.7592 }, (* C2'  *)
+      { x = 6.8573; y = 3.9363; z = -3.1645 }, (* H2'' *)
+      { x = 8.5780; y = 5.1025; z = -2.6046 }, (* O2'  *)
+      { x = 8.9516; y = 4.7577; z = -1.7902 }, (* H2'  *)
+      { x = 6.5522; y = 6.0300; z = -3.5612 }, (* C3'  *)
+      { x = 5.5420; y = 5.7356; z = -3.8459 }, (* H3'  *)
+      { x = 7.3487; y = 6.4089; z = -4.6867 }, (* O3'  *)
+      { x = 4.7442; y = 0.4514; z = -0.1390 }, (* N1   *)
+      { x = 6.3687; y = 2.1459; z = -0.5926 }, (* N3   *)
+      { x = 5.9795; y = 0.9335; z = -0.2657 }, (* C2   *)
+      { x = 5.3052; y = 2.9471; z = -0.8125 }, (* C4   *)
+      { x = 3.9891; y = 2.5987; z = -0.7230 }, (* C5   *)
+      { x = 3.7016; y = 1.2717; z = -0.3647 }, (* C6 *)
+      (G (
+      { x = 6.8745; y = -0.0224; z = -0.0058 }, (* N2   *)
+      { x = 3.1770; y = 3.6859; z = -1.0198 }, (* N7   *)
+      { x = 5.3247; y = 4.2695; z = -1.1710 }, (* N9   *)
+      { x = 4.0156; y = 4.6415; z = -1.2759 }, (* C8   *)
+      { x = 2.4553; y = 0.7925; z = -0.2390 }, (* O6   *)
+      { x = 4.6497; y = -0.5095; z = 0.1212 }, (* H1   *)
+      { x = 6.6836; y = -0.9771; z = 0.2627 }, (* H21  *)
+      { x = 7.8474; y = 0.2424; z = -0.0653 }, (* H22  *)
+      { x = 3.4426; y = 5.5361; z = -1.5199 }) (* H8   *)
+      )
+    )
+
+let rG02
+  = N(
+      {    a=0.5566; b=0.0449; c=0.8296; (* dgf_base_tfo *)
+           d=0.5125; e=0.7673; f= -0.3854;
+           g= -0.6538; h=0.6397; i=0.4041;
+           tx= -9.1161; ty= -3.7679; tz= -2.9968 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.5778; y = 6.6594; z = -4.0364 }, (* C5'  *)
+      { x = 4.9220; y = 7.1963; z = -4.9204 }, (* H5'  *)
+      { x = 3.7996; y = 5.9091; z = -4.1764 }, (* H5'' *)
+      { x = 5.7873; y = 5.8869; z = -3.5482 }, (* C4'  *)
+      { x = 6.0405; y = 5.0875; z = -4.2446 }, (* H4'  *)
+      { x = 6.9135; y = 6.8036; z = -3.4310 }, (* O4'  *)
+      { x = 7.7293; y = 6.4084; z = -2.3392 }, (* C1'  *)
+      { x = 8.7078; y = 6.1815; z = -2.7624 }, (* H1'  *)
+      { x = 7.1305; y = 5.1418; z = -1.7347 }, (* C2'  *)
+      { x = 7.2040; y = 5.1982; z = -0.6486 }, (* H2'' *)
+      { x = 7.7417; y = 4.0392; z = -2.3813 }, (* O2'  *)
+      { x = 8.6785; y = 4.1443; z = -2.5630 }, (* H2'  *)
+      { x = 5.6666; y = 5.2728; z = -2.1536 }, (* C3'  *)
+      { x = 5.1747; y = 5.9805; z = -1.4863 }, (* H3'  *)
+      { x = 4.9997; y = 4.0086; z = -2.1973 }, (* O3'  *)
+      { x = 10.3245; y = 8.5459; z = 1.5467 }, (* N1   *)
+      { x = 9.8051; y = 6.9432; z = -0.1497 }, (* N3   *)
+      { x = 10.5175; y = 7.4328; z = 0.8408 }, (* C2   *)
+      { x = 8.7523; y = 7.7422; z = -0.4228 }, (* C4   *)
+      { x = 8.4257; y = 8.9060; z = 0.2099 }, (* C5   *)
+      { x = 9.2665; y = 9.3242; z = 1.2540 }, (* C6 *)
+      (G (
+      { x = 11.6077; y = 6.7966; z = 1.2752 }, (* N2   *)
+      { x = 7.2750; y = 9.4537; z = -0.3428 }, (* N7   *)
+      { x = 7.7962; y = 7.5519; z = -1.3859 }, (* N9   *)
+      { x = 6.9479; y = 8.6157; z = -1.2771 }, (* C8   *)
+      { x = 9.0664; y = 10.4462; z = 1.9610 }, (* O6   *)
+      { x = 10.9838; y = 8.7524; z = 2.2697 }, (* H1   *)
+      { x = 12.2274; y = 7.0896; z = 2.0170 }, (* H21  *)
+      { x = 11.8502; y = 5.9398; z = 0.7984 }, (* H22  *)
+      { x = 6.0430; y = 8.9853; z = -1.7594 }) (* H8   *)
+      )
+    )
+
+let rG03
+  = N(
+      {    a= -0.5021; b=0.0731; c=0.8617; (* dgf_base_tfo *)
+           d= -0.8112; e=0.3054; f= -0.4986;
+           g= -0.2996; h= -0.9494; i= -0.0940;
+           tx=6.4273; ty= -5.1944; tz= -3.7807 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.1214; y = 6.7116; z = -1.9049 }, (* C5'  *)
+      { x = 3.3465; y = 5.9610; z = -2.0607 }, (* H5'  *)
+      { x = 4.0789; y = 7.2928; z = -0.9837 }, (* H5'' *)
+      { x = 5.4170; y = 5.9293; z = -1.8186 }, (* C4'  *)
+      { x = 5.4506; y = 5.3400; z = -0.9023 }, (* H4'  *)
+      { x = 5.5067; y = 5.0417; z = -2.9703 }, (* O4'  *)
+      { x = 6.8650; y = 4.9152; z = -3.3612 }, (* C1'  *)
+      { x = 7.1090; y = 3.8577; z = -3.2603 }, (* H1'  *)
+      { x = 7.7152; y = 5.7282; z = -2.3894 }, (* C2'  *)
+      { x = 8.5029; y = 6.2356; z = -2.9463 }, (* H2'' *)
+      { x = 8.1036; y = 4.8568; z = -1.3419 }, (* O2'  *)
+      { x = 8.3270; y = 3.9651; z = -1.6184 }, (* H2'  *)
+      { x = 6.7003; y = 6.7565; z = -1.8911 }, (* C3'  *)
+      { x = 6.5898; y = 7.5329; z = -2.6482 }, (* H3'  *)
+      { x = 7.0505; y = 7.2878; z = -0.6105 }, (* O3'  *)
+      { x = 9.6740; y = 4.7656; z = -7.6614 }, (* N1   *)
+      { x = 9.0739; y = 4.3013; z = -5.3941 }, (* N3   *)
+      { x = 9.8416; y = 4.2192; z = -6.4581 }, (* C2   *)
+      { x = 7.9885; y = 5.0632; z = -5.6446 }, (* C4   *)
+      { x = 7.6822; y = 5.6856; z = -6.8194 }, (* C5   *)
+      { x = 8.5831; y = 5.5215; z = -7.8840 }, (* C6 *)
+      (G (
+      { x = 10.9733; y = 3.5117; z = -6.4286 }, (* N2   *)
+      { x = 6.4857; y = 6.3816; z = -6.7035 }, (* N7   *)
+      { x = 6.9740; y = 5.3703; z = -4.7760 }, (* N9   *)
+      { x = 6.1133; y = 6.1613; z = -5.4808 }, (* C8   *)
+      { x = 8.4084; y = 6.0747; z = -9.0933 }, (* O6   *)
+      { x = 10.3759; y = 4.5855; z = -8.3504 }, (* H1   *)
+      { x = 11.6254; y = 3.3761; z = -7.1879 }, (* H21  *)
+      { x = 11.1917; y = 3.0460; z = -5.5593 }, (* H22  *)
+      { x = 5.1705; y = 6.6830; z = -5.3167 }) (* H8   *)
+      )
+    )
+
+let rG04
+  = N(
+      {    a= -0.5426; b= -0.8175; c=0.1929; (* dgf_base_tfo *)
+           d=0.8304; e= -0.5567; f= -0.0237;
+           g=0.1267; h=0.1473; i=0.9809;
+           tx= -0.5075; ty=8.3929; tz=0.2229 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 5.4352; y = 8.2183; z = -2.7757 }, (* C5'  *)
+      { x = 5.3830; y = 8.7883; z = -1.8481 }, (* H5'  *)
+      { x = 5.7729; y = 8.7436; z = -3.6691 }, (* H5'' *)
+      { x = 6.4830; y = 7.1518; z = -2.5252 }, (* C4'  *)
+      { x = 7.4749; y = 7.5972; z = -2.4482 }, (* H4'  *)
+      { x = 6.1626; y = 6.4620; z = -1.2827 }, (* O4'  *)
+      { x = 6.5431; y = 5.0992; z = -1.3905 }, (* C1'  *)
+      { x = 7.2871; y = 4.9328; z = -0.6114 }, (* H1'  *)
+      { x = 7.1852; y = 4.8935; z = -2.7592 }, (* C2'  *)
+      { x = 6.8573; y = 3.9363; z = -3.1645 }, (* H2'' *)
+      { x = 8.5780; y = 5.1025; z = -2.6046 }, (* O2'  *)
+      { x = 8.9516; y = 4.7577; z = -1.7902 }, (* H2'  *)
+      { x = 6.5522; y = 6.0300; z = -3.5612 }, (* C3'  *)
+      { x = 5.5420; y = 5.7356; z = -3.8459 }, (* H3'  *)
+      { x = 7.3487; y = 6.4089; z = -4.6867 }, (* O3'  *)
+      { x = 3.6343; y = 2.6680; z = 2.0783 }, (* N1   *)
+      { x = 5.4505; y = 3.9805; z = 1.2446 }, (* N3   *)
+      { x = 4.7540; y = 3.3816; z = 2.1851 }, (* C2   *)
+      { x = 4.8805; y = 3.7951; z = 0.0354 }, (* C4   *)
+      { x = 3.7416; y = 3.0925; z = -0.2305 }, (* C5   *)
+      { x = 3.0873; y = 2.4980; z = 0.8606 }, (* C6 *)
+      (G (
+      { x = 5.1433; y = 3.4373; z = 3.4609 }, (* N2   *)
+      { x = 3.4605; y = 3.1184; z = -1.5906 }, (* N7   *)
+      { x = 5.3247; y = 4.2695; z = -1.1710 }, (* N9   *)
+      { x = 4.4244; y = 3.8244; z = -2.0953 }, (* C8   *)
+      { x = 1.9600; y = 1.7805; z = 0.7462 }, (* O6   *)
+      { x = 3.2489; y = 2.2879; z = 2.9191 }, (* H1   *)
+      { x = 4.6785; y = 3.0243; z = 4.2568 }, (* H21  *)
+      { x = 5.9823; y = 3.9654; z = 3.6539 }, (* H22  *)
+      { x = 4.2675; y = 3.8876; z = -3.1721 }) (* H8   *)
+      )
+    )
+
+let rG05
+  = N(
+      {    a= -0.5891; b=0.0449; c=0.8068; (* dgf_base_tfo *)
+           d=0.5375; e=0.7673; f=0.3498;
+           g= -0.6034; h=0.6397; i= -0.4762;
+           tx= -0.3019; ty= -3.7679; tz= -9.5913 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.5778; y = 6.6594; z = -4.0364 }, (* C5'  *)
+      { x = 4.9220; y = 7.1963; z = -4.9204 }, (* H5'  *)
+      { x = 3.7996; y = 5.9091; z = -4.1764 }, (* H5'' *)
+      { x = 5.7873; y = 5.8869; z = -3.5482 }, (* C4'  *)
+      { x = 6.0405; y = 5.0875; z = -4.2446 }, (* H4'  *)
+      { x = 6.9135; y = 6.8036; z = -3.4310 }, (* O4'  *)
+      { x = 7.7293; y = 6.4084; z = -2.3392 }, (* C1'  *)
+      { x = 8.7078; y = 6.1815; z = -2.7624 }, (* H1'  *)
+      { x = 7.1305; y = 5.1418; z = -1.7347 }, (* C2'  *)
+      { x = 7.2040; y = 5.1982; z = -0.6486 }, (* H2'' *)
+      { x = 7.7417; y = 4.0392; z = -2.3813 }, (* O2'  *)
+      { x = 8.6785; y = 4.1443; z = -2.5630 }, (* H2'  *)
+      { x = 5.6666; y = 5.2728; z = -2.1536 }, (* C3'  *)
+      { x = 5.1747; y = 5.9805; z = -1.4863 }, (* H3'  *)
+      { x = 4.9997; y = 4.0086; z = -2.1973 }, (* O3'  *)
+      { x = 10.2594; y = 10.6774; z = -1.0056 }, (* N1   *)
+      { x = 9.7528; y = 8.7080; z = -2.2631 }, (* N3   *)
+      { x = 10.4471; y = 9.7876; z = -1.9791 }, (* C2   *)
+      { x = 8.7271; y = 8.5575; z = -1.3991 }, (* C4   *)
+      { x = 8.4100; y = 9.3803; z = -0.3580 }, (* C5   *)
+      { x = 9.2294; y = 10.5030; z = -0.1574 }, (* C6 *)
+      (G (
+      { x = 11.5110; y = 10.1256; z = -2.7114 }, (* N2   *)
+      { x = 7.2891; y = 8.9068; z = 0.3121 }, (* N7   *)
+      { x = 7.7962; y = 7.5519; z = -1.3859 }, (* N9   *)
+      { x = 6.9702; y = 7.8292; z = -0.3353 }, (* C8   *)
+      { x = 9.0349; y = 11.3951; z = 0.8250 }, (* O6   *)
+      { x = 10.9013; y = 11.4422; z = -0.9512 }, (* H1   *)
+      { x = 12.1031; y = 10.9341; z = -2.5861 }, (* H21  *)
+      { x = 11.7369; y = 9.5180; z = -3.4859 }, (* H22  *)
+      { x = 6.0888; y = 7.3990; z = 0.1403 }) (* H8   *)
+      )
+    )
+
+let rG06
+  = N(
+      {    a= -0.9815; b=0.0731; c= -0.1772; (* dgf_base_tfo *)
+           d=0.1912; e=0.3054; f= -0.9328;
+           g= -0.0141; h= -0.9494; i= -0.3137;
+           tx=5.7506; ty= -5.1944; tz=4.7470 },
+      {    a= -0.8143; b= -0.5091; c= -0.2788; (* P_O3'_275_tfo *)
+           d= -0.0433; e= -0.4257; f=0.9038;
+           g= -0.5788; h=0.7480; i=0.3246;
+           tx=1.5227; ty=6.9114; tz= -7.0765 },
+      {    a=0.3822; b= -0.7477; c=0.5430; (* P_O3'_180_tfo *)
+           d=0.4552; e=0.6637; f=0.5935;
+           g= -0.8042; h=0.0203; i=0.5941;
+           tx= -6.9472; ty= -4.1186; tz= -5.9108 },
+      {    a=0.5640; b=0.8007; c= -0.2022; (* P_O3'_60_tfo *)
+           d= -0.8247; e=0.5587; f= -0.0878;
+           g=0.0426; h=0.2162; i=0.9754;
+           tx=6.2694; ty= -7.0540; tz=3.3316 },
+      { x = 2.8930; y = 8.5380; z = -3.3280 }, (* P    *)
+      { x = 1.6980; y = 7.6960; z = -3.5570 }, (* O1P  *)
+      { x = 3.2260; y = 9.5010; z = -4.4020 }, (* O2P  *)
+      { x = 4.1590; y = 7.6040; z = -3.0340 }, (* O5'  *)
+      { x = 4.1214; y = 6.7116; z = -1.9049 }, (* C5'  *)
+      { x = 3.3465; y = 5.9610; z = -2.0607 }, (* H5'  *)
+      { x = 4.0789; y = 7.2928; z = -0.9837 }, (* H5'' *)
+      { x = 5.4170; y = 5.9293; z = -1.8186 }, (* C4'  *)
+      { x = 5.4506; y = 5.3400; z = -0.9023 }, (* H4'  *)
+      { x = 5.5067; y = 5.0417; z = -2.9703 }, (* O4'  *)
+      { x = 6.8650; y = 4.9152; z = -3.3612 }, (* C1'  *)
+      { x = 7.1090; y = 3.8577; z = -3.2603 }, (* H1'  *)
+      { x = 7.7152; y = 5.7282; z = -2.3894 }, (* C2'  *)
+      { x = 8.5029; y = 6.2356; z = -2.9463 }, (* H2'' *)
+      { x = 8.1036; y = 4.8568; z = -1.3419 }, (* O2'  *)
+      { x = 8.3270; y = 3.9651; z = -1.6184 }, (* H2'  *)
+      { x = 6.7003; y = 6.7565; z = -1.8911 }, (* C3'  *)
+      { x = 6.5898; y = 7.5329; z = -2.6482 }, (* H3'  *)
+      { x = 7.0505; y = 7.2878; z = -0.6105 }, (* O3'  *)
+      { x = 6.6624; y = 3.5061; z = -8.2986 }, (* N1   *)
+      { x = 6.5810; y = 3.2570; z = -5.9221 }, (* N3   *)
+      { x = 6.5151; y = 2.8263; z = -7.1625 }, (* C2   *)
+      { x = 6.8364; y = 4.5817; z = -5.8882 }, (* C4   *)
+      { x = 7.0116; y = 5.4064; z = -6.9609 }, (* C5   *)
+      { x = 6.9173; y = 4.8260; z = -8.2361 }, (* C6 *)
+      (G (
+      { x = 6.2717; y = 1.5402; z = -7.4250 }, (* N2   *)
+      { x = 7.2573; y = 6.7070; z = -6.5394 }, (* N7   *)
+      { x = 6.9740; y = 5.3703; z = -4.7760 }, (* N9   *)
+      { x = 7.2238; y = 6.6275; z = -5.2453 }, (* C8   *)
+      { x = 7.0668; y = 5.5163; z = -9.3763 }, (* O6   *)
+      { x = 6.5754; y = 2.9964; z = -9.1545 }, (* H1   *)
+      { x = 6.1908; y = 1.1105; z = -8.3354 }, (* H21  *)
+      { x = 6.1346; y = 0.9352; z = -6.6280 }, (* H22  *)
+      { x = 7.4108; y = 7.6227; z = -4.8418 }) (* H8   *)
+      )
+    )
+
+let rG07
+  = N(
+      {    a=0.0894; b= -0.6059; c=0.7905; (* dgf_base_tfo *)
+           d= -0.6810; e=0.5420; f=0.4924;
+           g= -0.7268; h= -0.5824; i= -0.3642;
+           tx=34.1424; ty=45.9610; tz= -11.8600 },
+      {    a= -0.8644; b= -0.4956; c= -0.0851; (* P_O3'_275_tfo *)
+           d= -0.0427; e=0.2409; f= -0.9696;
+           g=0.5010; h= -0.8345; i= -0.2294;
+           tx=4.0167; ty=54.5377; tz=12.4779 },
+      {    a=0.3706; b= -0.6167; c=0.6945; (* P_O3'_180_tfo *)
+           d= -0.2867; e= -0.7872; f= -0.5460;
+           g=0.8834; h=0.0032; i= -0.4686;
+           tx= -52.9020; ty=18.6313; tz= -0.6709 },
+      {    a=0.4155; b=0.9025; c= -0.1137; (* P_O3'_60_tfo *)
+           d=0.9040; e= -0.4236; f= -0.0582;
+           g= -0.1007; h= -0.0786; i= -0.9918;
+           tx= -7.6624; ty= -25.2080; tz=49.5181 },
+      { x = 31.3810; y = 0.1400; z = 47.5810 }, (* P    *)
+      { x = 29.9860; y = 0.6630; z = 47.6290 }, (* O1P  *)
+      { x = 31.7210; y = -0.6460; z = 48.8090 }, (* O2P  *)
+      { x = 32.4940; y = 1.2540; z = 47.2740 }, (* O5'  *)
+      { x = 33.8709; y = 0.7918; z = 47.2113 }, (* C5'  *)
+      { x = 34.1386; y = 0.5870; z = 46.1747 }, (* H5'  *)
+      { x = 34.0186; y = -0.0095; z = 47.9353 }, (* H5'' *)
+      { x = 34.7297; y = 1.9687; z = 47.6685 }, (* C4'  *)
+      { x = 35.7723; y = 1.6845; z = 47.8113 }, (* H4'  *)
+      { x = 34.6455; y = 2.9768; z = 46.6660 }, (* O4'  *)
+      { x = 34.1690; y = 4.1829; z = 47.2627 }, (* C1'  *)
+      { x = 35.0437; y = 4.7633; z = 47.5560 }, (* H1'  *)
+      { x = 33.4145; y = 3.7532; z = 48.4954 }, (* C2'  *)
+      { x = 32.4340; y = 3.3797; z = 48.2001 }, (* H2'' *)
+      { x = 33.3209; y = 4.6953; z = 49.5217 }, (* O2'  *)
+      { x = 33.2374; y = 5.6059; z = 49.2295 }, (* H2'  *)
+      { x = 34.2724; y = 2.5970; z = 48.9773 }, (* C3'  *)
+      { x = 33.6373; y = 1.8935; z = 49.5157 }, (* H3'  *)
+      { x = 35.3453; y = 3.1884; z = 49.7285 }, (* O3'  *)
+      { x = 34.0511; y = 7.8930; z = 43.7791 }, (* N1   *)
+      { x = 34.9937; y = 6.3369; z = 45.3199 }, (* N3   *)
+      { x = 35.0882; y = 7.3126; z = 44.4200 }, (* C2   *)
+      { x = 33.7190; y = 5.9650; z = 45.5374 }, (* C4   *)
+      { x = 32.5845; y = 6.4770; z = 44.9458 }, (* C5   *)
+      { x = 32.7430; y = 7.5179; z = 43.9914 }, (* C6 *)
+      (G (
+      { x = 36.3030; y = 7.7827; z = 44.1036 }, (* N2   *)
+      { x = 31.4499; y = 5.8335; z = 45.4368 }, (* N7   *)
+      { x = 33.2760; y = 4.9817; z = 46.4043 }, (* N9   *)
+      { x = 31.9235; y = 4.9639; z = 46.2934 }, (* C8   *)
+      { x = 31.8602; y = 8.1000; z = 43.3695 }, (* O6   *)
+      { x = 34.2623; y = 8.6223; z = 43.1283 }, (* H1   *)
+      { x = 36.5188; y = 8.5081; z = 43.4347 }, (* H21  *)
+      { x = 37.0888; y = 7.3524; z = 44.5699 }, (* H22  *)
+      { x = 31.0815; y = 4.4201; z = 46.7218 }) (* H8   *)
+      )
+    )
+
+let rG08
+  = N(
+      {    a=0.2224; b=0.6335; c=0.7411; (* dgf_base_tfo *)
+           d= -0.3644; e= -0.6510; f=0.6659;
+           g=0.9043; h= -0.4181; i=0.0861;
+           tx= -47.6824; ty= -0.5823; tz= -31.7554 },
+      {    a= -0.8644; b= -0.4956; c= -0.0851; (* P_O3'_275_tfo *)
+           d= -0.0427; e=0.2409; f= -0.9696;
+           g=0.5010; h= -0.8345; i= -0.2294;
+           tx=4.0167; ty=54.5377; tz=12.4779 },
+      {    a=0.3706; b= -0.6167; c=0.6945; (* P_O3'_180_tfo *)
+           d= -0.2867; e= -0.7872; f= -0.5460;
+           g=0.8834; h=0.0032; i= -0.4686;
+           tx= -52.9020; ty=18.6313; tz= -0.6709 },
+      {    a=0.4155; b=0.9025; c= -0.1137; (* P_O3'_60_tfo *)
+           d=0.9040; e= -0.4236; f= -0.0582;
+           g= -0.1007; h= -0.0786; i= -0.9918;
+           tx= -7.6624; ty= -25.2080; tz=49.5181 },
+      { x = 31.3810; y = 0.1400; z = 47.5810 }, (* P    *)
+      { x = 29.9860; y = 0.6630; z = 47.6290 }, (* O1P  *)
+      { x = 31.7210; y = -0.6460; z = 48.8090 }, (* O2P  *)
+      { x = 32.4940; y = 1.2540; z = 47.2740 }, (* O5'  *)
+      { x = 32.5924; y = 2.3488; z = 48.2255 }, (* C5'  *)
+      { x = 33.3674; y = 2.1246; z = 48.9584 }, (* H5'  *)
+      { x = 31.5994; y = 2.5917; z = 48.6037 }, (* H5'' *)
+      { x = 33.0722; y = 3.5577; z = 47.4258 }, (* C4'  *)
+      { x = 33.0310; y = 4.4778; z = 48.0089 }, (* H4'  *)
+      { x = 34.4173; y = 3.3055; z = 47.0316 }, (* O4'  *)
+      { x = 34.5056; y = 3.3910; z = 45.6094 }, (* C1'  *)
+      { x = 34.7881; y = 4.4152; z = 45.3663 }, (* H1'  *)
+      { x = 33.1122; y = 3.1198; z = 45.1010 }, (* C2'  *)
+      { x = 32.9230; y = 2.0469; z = 45.1369 }, (* H2'' *)
+      { x = 32.7946; y = 3.6590; z = 43.8529 }, (* O2'  *)
+      { x = 33.5170; y = 3.6707; z = 43.2207 }, (* H2'  *)
+      { x = 32.2730; y = 3.8173; z = 46.1566 }, (* C3'  *)
+      { x = 31.3094; y = 3.3123; z = 46.2244 }, (* H3'  *)
+      { x = 32.2391; y = 5.2039; z = 45.7807 }, (* O3'  *)
+      { x = 39.3337; y = 2.7157; z = 44.1441 }, (* N1   *)
+      { x = 37.4430; y = 3.8242; z = 45.0824 }, (* N3   *)
+      { x = 38.7276; y = 3.7646; z = 44.7403 }, (* C2   *)
+      { x = 36.7791; y = 2.6963; z = 44.7704 }, (* C4   *)
+      { x = 37.2860; y = 1.5653; z = 44.1678 }, (* C5   *)
+      { x = 38.6647; y = 1.5552; z = 43.8235 }, (* C6 *)
+      (G (
+      { x = 39.5123; y = 4.8216; z = 44.9936 }, (* N2   *)
+      { x = 36.2829; y = 0.6110; z = 44.0078 }, (* N7   *)
+      { x = 35.4394; y = 2.4314; z = 44.9931 }, (* N9   *)
+      { x = 35.2180; y = 1.1815; z = 44.5128 }, (* C8   *)
+      { x = 39.2907; y = 0.6514; z = 43.2796 }, (* O6   *)
+      { x = 40.3076; y = 2.8048; z = 43.9352 }, (* H1   *)
+      { x = 40.4994; y = 4.9066; z = 44.7977 }, (* H21  *)
+      { x = 39.0738; y = 5.6108; z = 45.4464 }, (* H22  *)
+      { x = 34.3856; y = 0.4842; z = 44.4185 }) (* H8   *)
+      )
+    )
+
+let rG09
+  = N(
+      {    a= -0.9699; b= -0.1688; c= -0.1753; (* dgf_base_tfo *)
+           d= -0.1050; e= -0.3598; f=0.9271;
+           g= -0.2196; h=0.9176; i=0.3312;
+           tx=45.6217; ty= -38.9484; tz= -12.3208 },
+      {    a= -0.8644; b= -0.4956; c= -0.0851; (* P_O3'_275_tfo *)
+           d= -0.0427; e=0.2409; f= -0.9696;
+           g=0.5010; h= -0.8345; i= -0.2294;
+           tx=4.0167; ty=54.5377; tz=12.4779 },
+      {    a=0.3706; b= -0.6167; c=0.6945; (* P_O3'_180_tfo *)
+           d= -0.2867; e= -0.7872; f= -0.5460;
+           g=0.8834; h=0.0032; i= -0.4686;
+           tx= -52.9020; ty=18.6313; tz= -0.6709 },
+      {    a=0.4155; b=0.9025; c= -0.1137; (* P_O3'_60_tfo *)
+           d=0.9040; e= -0.4236; f= -0.0582;
+           g= -0.1007; h= -0.0786; i= -0.9918;
+           tx= -7.6624; ty= -25.2080; tz=49.5181 },
+      { x = 31.3810; y = 0.1400; z = 47.5810 }, (* P    *)
+      { x = 29.9860; y = 0.6630; z = 47.6290 }, (* O1P  *)
+      { x = 31.7210; y = -0.6460; z = 48.8090 }, (* O2P  *)
+      { x = 32.4940; y = 1.2540; z = 47.2740 }, (* O5'  *)
+      { x = 33.8709; y = 0.7918; z = 47.2113 }, (* C5'  *)
+      { x = 34.1386; y = 0.5870; z = 46.1747 }, (* H5'  *)
+      { x = 34.0186; y = -0.0095; z = 47.9353 }, (* H5'' *)
+      { x = 34.7297; y = 1.9687; z = 47.6685 }, (* C4'  *)
+      { x = 34.5880; y = 2.8482; z = 47.0404 }, (* H4'  *)
+      { x = 34.3575; y = 2.2770; z = 49.0081 }, (* O4'  *)
+      { x = 35.5157; y = 2.1993; z = 49.8389 }, (* C1'  *)
+      { x = 35.9424; y = 3.2010; z = 49.8893 }, (* H1'  *)
+      { x = 36.4701; y = 1.2820; z = 49.1169 }, (* C2'  *)
+      { x = 36.1545; y = 0.2498; z = 49.2683 }, (* H2'' *)
+      { x = 37.8262; y = 1.4547; z = 49.4008 }, (* O2'  *)
+      { x = 38.0227; y = 1.6945; z = 50.3094 }, (* H2'  *)
+      { x = 36.2242; y = 1.6797; z = 47.6725 }, (* C3'  *)
+      { x = 36.4297; y = 0.8197; z = 47.0351 }, (* H3'  *)
+      { x = 37.0289; y = 2.8480; z = 47.4426 }, (* O3'  *)
+      { x = 34.3005; y = 3.5042; z = 54.6070 }, (* N1   *)
+      { x = 34.7693; y = 3.7936; z = 52.2874 }, (* N3   *)
+      { x = 34.4484; y = 4.2541; z = 53.4939 }, (* C2   *)
+      { x = 34.9354; y = 2.4584; z = 52.2785 }, (* C4   *)
+      { x = 34.8092; y = 1.5915; z = 53.3422 }, (* C5   *)
+      { x = 34.4646; y = 2.1367; z = 54.6085 }, (* C6 *)
+      (G (
+      { x = 34.2514; y = 5.5708; z = 53.6503 }, (* N2   *)
+      { x = 35.0641; y = 0.2835; z = 52.9337 }, (* N7   *)
+      { x = 35.2669; y = 1.6690; z = 51.1915 }, (* N9   *)
+      { x = 35.3288; y = 0.3954; z = 51.6563 }, (* C8   *)
+      { x = 34.3151; y = 1.5317; z = 55.6650 }, (* O6   *)
+      { x = 34.0623; y = 3.9797; z = 55.4539 }, (* H1   *)
+      { x = 33.9950; y = 6.0502; z = 54.5016 }, (* H21  *)
+      { x = 34.3512; y = 6.1432; z = 52.8242 }, (* H22  *)
+      { x = 35.5414; y = -0.6006; z = 51.2679 }) (* H8   *)
+      )
+    )
+
+let rG10
+  = N(
+      {    a= -0.0980; b= -0.9723; c=0.2122; (* dgf_base_tfo *)
+           d= -0.9731; e=0.1383; f=0.1841;
+           g= -0.2083; h= -0.1885; i= -0.9597;
+           tx=17.8469; ty=38.8265; tz=37.0475 },
+      {    a= -0.8644; b= -0.4956; c= -0.0851; (* P_O3'_275_tfo *)
+           d= -0.0427; e=0.2409; f= -0.9696;
+           g=0.5010; h= -0.8345; i= -0.2294;
+           tx=4.0167; ty=54.5377; tz=12.4779 },
+      {    a=0.3706; b= -0.6167; c=0.6945; (* P_O3'_180_tfo *)
+           d= -0.2867; e= -0.7872; f= -0.5460;
+           g=0.8834; h=0.0032; i= -0.4686;
+           tx= -52.9020; ty=18.6313; tz= -0.6709 },
+      {    a=0.4155; b=0.9025; c= -0.1137; (* P_O3'_60_tfo *)
+           d=0.9040; e= -0.4236; f= -0.0582;
+           g= -0.1007; h= -0.0786; i= -0.9918;
+           tx= -7.6624; ty= -25.2080; tz=49.5181 },
+      { x = 31.3810; y = 0.1400; z = 47.5810 }, (* P    *)
+      { x = 29.9860; y = 0.6630; z = 47.6290 }, (* O1P  *)
+      { x = 31.7210; y = -0.6460; z = 48.8090 }, (* O2P  *)
+      { x = 32.4940; y = 1.2540; z = 47.2740 }, (* O5'  *)
+      { x = 32.5924; y = 2.3488; z = 48.2255 }, (* C5'  *)
+      { x = 33.3674; y = 2.1246; z = 48.9584 }, (* H5'  *)
+      { x = 31.5994; y = 2.5917; z = 48.6037 }, (* H5'' *)
+      { x = 33.0722; y = 3.5577; z = 47.4258 }, (* C4'  *)
+      { x = 34.0333; y = 3.3761; z = 46.9447 }, (* H4'  *)
+      { x = 32.0890; y = 3.8338; z = 46.4332 }, (* O4'  *)
+      { x = 31.6377; y = 5.1787; z = 46.5914 }, (* C1'  *)
+      { x = 32.2499; y = 5.8016; z = 45.9392 }, (* H1'  *)
+      { x = 31.9167; y = 5.5319; z = 48.0305 }, (* C2'  *)
+      { x = 31.1507; y = 5.0820; z = 48.6621 }, (* H2'' *)
+      { x = 32.0865; y = 6.8890; z = 48.3114 }, (* O2'  *)
+      { x = 31.5363; y = 7.4819; z = 47.7942 }, (* H2'  *)
+      { x = 33.2398; y = 4.8224; z = 48.2563 }, (* C3'  *)
+      { x = 33.3166; y = 4.5570; z = 49.3108 }, (* H3'  *)
+      { x = 34.2528; y = 5.7056; z = 47.7476 }, (* O3'  *)
+      { x = 28.2782; y = 6.3049; z = 42.9364 }, (* N1   *)
+      { x = 30.4001; y = 5.8547; z = 43.9258 }, (* N3   *)
+      { x = 29.6195; y = 6.1568; z = 42.8913 }, (* C2   *)
+      { x = 29.7005; y = 5.7006; z = 45.0649 }, (* C4   *)
+      { x = 28.3383; y = 5.8221; z = 45.2343 }, (* C5   *)
+      { x = 27.5519; y = 6.1461; z = 44.0958 }, (* C6 *)
+      (G (
+      { x = 30.1838; y = 6.3385; z = 41.6890 }, (* N2   *)
+      { x = 27.9936; y = 5.5926; z = 46.5651 }, (* N7   *)
+      { x = 30.2046; y = 5.3825; z = 46.3136 }, (* N9   *)
+      { x = 29.1371; y = 5.3398; z = 47.1506 }, (* C8   *)
+      { x = 26.3361; y = 6.3024; z = 44.0495 }, (* O6   *)
+      { x = 27.8122; y = 6.5394; z = 42.0833 }, (* H1   *)
+      { x = 29.7125; y = 6.5595; z = 40.8235 }, (* H21  *)
+      { x = 31.1859; y = 6.2231; z = 41.6389 }, (* H22  *)
+      { x = 28.9406; y = 5.1504; z = 48.2059 }) (* H8   *)
+      )
+    )
+
+let rGs = [rG01;rG02;rG03;rG04;rG05;rG06;rG07;rG08;rG09;rG10]
+
+let rU
+  = N(
+      {    a= -0.0359; b= -0.8071; c=0.5894; (* dgf_base_tfo *)
+           d= -0.2669; e=0.5761; f=0.7726;
+           g= -0.9631; h= -0.1296; i= -0.2361;
+           tx=0.1584; ty=8.3434; tz=0.5434 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2430; y = -8.2420; z = 2.8260 }, (* C5'  *)
+      { x = 5.1974; y = -8.8497; z = 1.9223 }, (* H5'  *)
+      { x = 5.5548; y = -8.7348; z = 3.7469 }, (* H5'' *)
+      { x = 6.3140; y = -7.2060; z = 2.5510 }, (* C4'  *)
+      { x = 7.2954; y = -7.6762; z = 2.4898 }, (* H4'  *)
+      { x = 6.0140; y = -6.5420; z = 1.2890 }, (* O4'  *)
+      { x = 6.4190; y = -5.1840; z = 1.3620 }, (* C1'  *)
+      { x = 7.1608; y = -5.0495; z = 0.5747 }, (* H1'  *)
+      { x = 7.0760; y = -4.9560; z = 2.7270 }, (* C2'  *)
+      { x = 6.7770; y = -3.9803; z = 3.1099 }, (* H2'' *)
+      { x = 8.4500; y = -5.1930; z = 2.5810 }, (* O2'  *)
+      { x = 8.8309; y = -4.8755; z = 1.7590 }, (* H2'  *)
+      { x = 6.4060; y = -6.0590; z = 3.5580 }, (* C3'  *)
+      { x = 5.4021; y = -5.7313; z = 3.8281 }, (* H3'  *)
+      { x = 7.1570; y = -6.4240; z = 4.7070 }, (* O3'  *)
+      { x = 5.2170; y = -4.3260; z = 1.1690 }, (* N1   *)
+      { x = 4.2960; y = -2.2560; z = 0.6290 }, (* N3   *)
+      { x = 5.4330; y = -3.0200; z = 0.7990 }, (* C2   *)
+      { x = 2.9930; y = -2.6780; z = 0.7940 }, (* C4   *)
+      { x = 2.8670; y = -4.0630; z = 1.1830 }, (* C5   *)
+      { x = 3.9570; y = -4.8300; z = 1.3550 }, (* C6 *)
+      (U (
+      { x = 6.5470; y = -2.5560; z = 0.6290 }, (* O2   *)
+      { x = 2.0540; y = -1.9000; z = 0.6130 }, (* O4   *)
+      { x = 4.4300; y = -1.3020; z = 0.3600 }, (* H3   *)
+      { x = 1.9590; y = -4.4570; z = 1.3250 }, (* H5   *)
+      { x = 3.8460; y = -5.7860; z = 1.6240 }) (* H6   *)
+      )
+    )
+
+let rU01
+  = N(
+      {    a= -0.0137; b= -0.8012; c=0.5983; (* dgf_base_tfo *)
+           d= -0.2523; e=0.5817; f=0.7733;
+           g= -0.9675; h= -0.1404; i= -0.2101;
+           tx=0.2031; ty=8.3874; tz=0.4228 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2416; y = -8.2422; z = 2.8181 }, (* C5'  *)
+      { x = 5.2050; y = -8.8128; z = 1.8901 }, (* H5'  *)
+      { x = 5.5368; y = -8.7738; z = 3.7227 }, (* H5'' *)
+      { x = 6.3232; y = -7.2037; z = 2.6002 }, (* C4'  *)
+      { x = 7.3048; y = -7.6757; z = 2.5577 }, (* H4'  *)
+      { x = 6.0635; y = -6.5092; z = 1.3456 }, (* O4'  *)
+      { x = 6.4697; y = -5.1547; z = 1.4629 }, (* C1'  *)
+      { x = 7.2354; y = -5.0043; z = 0.7018 }, (* H1'  *)
+      { x = 7.0856; y = -4.9610; z = 2.8521 }, (* C2'  *)
+      { x = 6.7777; y = -3.9935; z = 3.2487 }, (* H2'' *)
+      { x = 8.4627; y = -5.1992; z = 2.7423 }, (* O2'  *)
+      { x = 8.8693; y = -4.8638; z = 1.9399 }, (* H2'  *)
+      { x = 6.3877; y = -6.0809; z = 3.6362 }, (* C3'  *)
+      { x = 5.3770; y = -5.7562; z = 3.8834 }, (* H3'  *)
+      { x = 7.1024; y = -6.4754; z = 4.7985 }, (* O3'  *)
+      { x = 5.2764; y = -4.2883; z = 1.2538 }, (* N1   *)
+      { x = 4.3777; y = -2.2062; z = 0.7229 }, (* N3   *)
+      { x = 5.5069; y = -2.9779; z = 0.9088 }, (* C2   *)
+      { x = 3.0693; y = -2.6246; z = 0.8500 }, (* C4   *)
+      { x = 2.9279; y = -4.0146; z = 1.2149 }, (* C5   *)
+      { x = 4.0101; y = -4.7892; z = 1.4017 }, (* C6 *)
+      (U (
+      { x = 6.6267; y = -2.5166; z = 0.7728 }, (* O2   *)
+      { x = 2.1383; y = -1.8396; z = 0.6581 }, (* O4   *)
+      { x = 4.5223; y = -1.2489; z = 0.4716 }, (* H3   *)
+      { x = 2.0151; y = -4.4065; z = 1.3290 }, (* H5   *)
+      { x = 3.8886; y = -5.7486; z = 1.6535 }) (* H6   *)
+      )
+    )
+
+let rU02
+  = N(
+      {    a=0.5141; b=0.0246; c=0.8574; (* dgf_base_tfo *)
+           d= -0.5547; e= -0.7529; f=0.3542;
+           g=0.6542; h= -0.6577; i= -0.3734;
+           tx= -9.1111; ty= -3.4598; tz= -3.2939 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 4.3825; y = -6.6585; z = 4.0489 }, (* C5'  *)
+      { x = 4.6841; y = -7.2019; z = 4.9443 }, (* H5'  *)
+      { x = 3.6189; y = -5.8889; z = 4.1625 }, (* H5'' *)
+      { x = 5.6255; y = -5.9175; z = 3.5998 }, (* C4'  *)
+      { x = 5.8732; y = -5.1228; z = 4.3034 }, (* H4'  *)
+      { x = 6.7337; y = -6.8605; z = 3.5222 }, (* O4'  *)
+      { x = 7.5932; y = -6.4923; z = 2.4548 }, (* C1'  *)
+      { x = 8.5661; y = -6.2983; z = 2.9064 }, (* H1'  *)
+      { x = 7.0527; y = -5.2012; z = 1.8322 }, (* C2'  *)
+      { x = 7.1627; y = -5.2525; z = 0.7490 }, (* H2'' *)
+      { x = 7.6666; y = -4.1249; z = 2.4880 }, (* O2'  *)
+      { x = 8.5944; y = -4.2543; z = 2.6981 }, (* H2'  *)
+      { x = 5.5661; y = -5.3029; z = 2.2009 }, (* C3'  *)
+      { x = 5.0841; y = -6.0018; z = 1.5172 }, (* H3'  *)
+      { x = 4.9062; y = -4.0452; z = 2.2042 }, (* O3'  *)
+      { x = 7.6298; y = -7.6136; z = 1.4752 }, (* N1   *)
+      { x = 8.6945; y = -8.7046; z = -0.2857 }, (* N3   *)
+      { x = 8.6943; y = -7.6514; z = 0.6066 }, (* C2   *)
+      { x = 7.7426; y = -9.6987; z = -0.3801 }, (* C4   *)
+      { x = 6.6642; y = -9.5742; z = 0.5722 }, (* C5   *)
+      { x = 6.6391; y = -8.5592; z = 1.4526 }, (* C6 *)
+      (U (
+      { x = 9.5840; y = -6.8186; z = 0.6136 }, (* O2   *)
+      { x = 7.8505; y = -10.5925; z = -1.2223 }, (* O4   *)
+      { x = 9.4601; y = -8.7514; z = -0.9277 }, (* H3   *)
+      { x = 5.9281; y = -10.2509; z = 0.5782 }, (* H5   *)
+      { x = 5.8831; y = -8.4931; z = 2.1028 }) (* H6   *)
+      )
+    )
+
+let rU03
+  = N(
+      {    a= -0.4993; b=0.0476; c=0.8651; (* dgf_base_tfo *)
+           d=0.8078; e= -0.3353; f=0.4847;
+           g=0.3132; h=0.9409; i=0.1290;
+           tx=6.2989; ty= -5.2303; tz= -3.8577 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 3.9938; y = -6.7042; z = 1.9023 }, (* C5'  *)
+      { x = 3.2332; y = -5.9343; z = 2.0319 }, (* H5'  *)
+      { x = 3.9666; y = -7.2863; z = 0.9812 }, (* H5'' *)
+      { x = 5.3098; y = -5.9546; z = 1.8564 }, (* C4'  *)
+      { x = 5.3863; y = -5.3702; z = 0.9395 }, (* H4'  *)
+      { x = 5.3851; y = -5.0642; z = 3.0076 }, (* O4'  *)
+      { x = 6.7315; y = -4.9724; z = 3.4462 }, (* C1'  *)
+      { x = 7.0033; y = -3.9202; z = 3.3619 }, (* H1'  *)
+      { x = 7.5997; y = -5.8018; z = 2.4948 }, (* C2'  *)
+      { x = 8.3627; y = -6.3254; z = 3.0707 }, (* H2'' *)
+      { x = 8.0410; y = -4.9501; z = 1.4724 }, (* O2'  *)
+      { x = 8.2781; y = -4.0644; z = 1.7570 }, (* H2'  *)
+      { x = 6.5701; y = -6.8129; z = 1.9714 }, (* C3'  *)
+      { x = 6.4186; y = -7.5809; z = 2.7299 }, (* H3'  *)
+      { x = 6.9357; y = -7.3841; z = 0.7235 }, (* O3'  *)
+      { x = 6.8024; y = -5.4718; z = 4.8475 }, (* N1   *)
+      { x = 7.9218; y = -5.5700; z = 6.8877 }, (* N3   *)
+      { x = 7.8908; y = -5.0886; z = 5.5944 }, (* C2   *)
+      { x = 6.9789; y = -6.3827; z = 7.4823 }, (* C4   *)
+      { x = 5.8742; y = -6.7319; z = 6.6202 }, (* C5   *)
+      { x = 5.8182; y = -6.2769; z = 5.3570 }, (* C6 *)
+      (U (
+      { x = 8.7747; y = -4.3728; z = 5.1568 }, (* O2   *)
+      { x = 7.1154; y = -6.7509; z = 8.6509 }, (* O4   *)
+      { x = 8.7055; y = -5.3037; z = 7.4491 }, (* H3   *)
+      { x = 5.1416; y = -7.3178; z = 6.9665 }, (* H5   *)
+      { x = 5.0441; y = -6.5310; z = 4.7784 }) (* H6   *)
+      )
+    )
+
+let rU04
+  = N(
+      {    a= -0.5669; b= -0.8012; c=0.1918; (* dgf_base_tfo *)
+           d= -0.8129; e=0.5817; f=0.0273;
+           g= -0.1334; h= -0.1404; i= -0.9811;
+           tx= -0.3279; ty=8.3874; tz=0.3355 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2416; y = -8.2422; z = 2.8181 }, (* C5'  *)
+      { x = 5.2050; y = -8.8128; z = 1.8901 }, (* H5'  *)
+      { x = 5.5368; y = -8.7738; z = 3.7227 }, (* H5'' *)
+      { x = 6.3232; y = -7.2037; z = 2.6002 }, (* C4'  *)
+      { x = 7.3048; y = -7.6757; z = 2.5577 }, (* H4'  *)
+      { x = 6.0635; y = -6.5092; z = 1.3456 }, (* O4'  *)
+      { x = 6.4697; y = -5.1547; z = 1.4629 }, (* C1'  *)
+      { x = 7.2354; y = -5.0043; z = 0.7018 }, (* H1'  *)
+      { x = 7.0856; y = -4.9610; z = 2.8521 }, (* C2'  *)
+      { x = 6.7777; y = -3.9935; z = 3.2487 }, (* H2'' *)
+      { x = 8.4627; y = -5.1992; z = 2.7423 }, (* O2'  *)
+      { x = 8.8693; y = -4.8638; z = 1.9399 }, (* H2'  *)
+      { x = 6.3877; y = -6.0809; z = 3.6362 }, (* C3'  *)
+      { x = 5.3770; y = -5.7562; z = 3.8834 }, (* H3'  *)
+      { x = 7.1024; y = -6.4754; z = 4.7985 }, (* O3'  *)
+      { x = 5.2764; y = -4.2883; z = 1.2538 }, (* N1   *)
+      { x = 3.8961; y = -3.0896; z = -0.1893 }, (* N3   *)
+      { x = 5.0095; y = -3.8907; z = -0.0346 }, (* C2   *)
+      { x = 3.0480; y = -2.6632; z = 0.8116 }, (* C4   *)
+      { x = 3.4093; y = -3.1310; z = 2.1292 }, (* C5   *)
+      { x = 4.4878; y = -3.9124; z = 2.3088 }, (* C6 *)
+      (U (
+      { x = 5.7005; y = -4.2164; z = -0.9842 }, (* O2   *)
+      { x = 2.0800; y = -1.9458; z = 0.5503 }, (* O4   *)
+      { x = 3.6834; y = -2.7882; z = -1.1190 }, (* H3   *)
+      { x = 2.8508; y = -2.8721; z = 2.9172 }, (* H5   *)
+      { x = 4.7188; y = -4.2247; z = 3.2295 }) (* H6   *)
+      )
+    )
+
+let rU05
+  = N(
+      {    a= -0.6298; b=0.0246; c=0.7763; (* dgf_base_tfo *)
+           d= -0.5226; e= -0.7529; f= -0.4001;
+           g=0.5746; h= -0.6577; i=0.4870;
+           tx= -0.0208; ty= -3.4598; tz= -9.6882 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 4.3825; y = -6.6585; z = 4.0489 }, (* C5'  *)
+      { x = 4.6841; y = -7.2019; z = 4.9443 }, (* H5'  *)
+      { x = 3.6189; y = -5.8889; z = 4.1625 }, (* H5'' *)
+      { x = 5.6255; y = -5.9175; z = 3.5998 }, (* C4'  *)
+      { x = 5.8732; y = -5.1228; z = 4.3034 }, (* H4'  *)
+      { x = 6.7337; y = -6.8605; z = 3.5222 }, (* O4'  *)
+      { x = 7.5932; y = -6.4923; z = 2.4548 }, (* C1'  *)
+      { x = 8.5661; y = -6.2983; z = 2.9064 }, (* H1'  *)
+      { x = 7.0527; y = -5.2012; z = 1.8322 }, (* C2'  *)
+      { x = 7.1627; y = -5.2525; z = 0.7490 }, (* H2'' *)
+      { x = 7.6666; y = -4.1249; z = 2.4880 }, (* O2'  *)
+      { x = 8.5944; y = -4.2543; z = 2.6981 }, (* H2'  *)
+      { x = 5.5661; y = -5.3029; z = 2.2009 }, (* C3'  *)
+      { x = 5.0841; y = -6.0018; z = 1.5172 }, (* H3'  *)
+      { x = 4.9062; y = -4.0452; z = 2.2042 }, (* O3'  *)
+      { x = 7.6298; y = -7.6136; z = 1.4752 }, (* N1   *)
+      { x = 8.5977; y = -9.5977; z = 0.7329 }, (* N3   *)
+      { x = 8.5951; y = -8.5745; z = 1.6594 }, (* C2   *)
+      { x = 7.7372; y = -9.7371; z = -0.3364 }, (* C4   *)
+      { x = 6.7596; y = -8.6801; z = -0.4476 }, (* C5   *)
+      { x = 6.7338; y = -7.6721; z = 0.4408 }, (* C6 *)
+      (U (
+      { x = 9.3993; y = -8.5377; z = 2.5743 }, (* O2   *)
+      { x = 7.8374; y = -10.6990; z = -1.1008 }, (* O4   *)
+      { x = 9.2924; y = -10.3081; z = 0.8477 }, (* H3   *)
+      { x = 6.0932; y = -8.6982; z = -1.1929 }, (* H5   *)
+      { x = 6.0481; y = -6.9515; z = 0.3446 }) (* H6   *)
+      )
+    )
+
+let rU06
+  = N(
+      {    a= -0.9837; b=0.0476; c= -0.1733; (* dgf_base_tfo *)
+           d= -0.1792; e= -0.3353; f=0.9249;
+           g= -0.0141; h=0.9409; i=0.3384;
+           tx=5.7793; ty= -5.2303; tz=4.5997 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 3.9938; y = -6.7042; z = 1.9023 }, (* C5'  *)
+      { x = 3.2332; y = -5.9343; z = 2.0319 }, (* H5'  *)
+      { x = 3.9666; y = -7.2863; z = 0.9812 }, (* H5'' *)
+      { x = 5.3098; y = -5.9546; z = 1.8564 }, (* C4'  *)
+      { x = 5.3863; y = -5.3702; z = 0.9395 }, (* H4'  *)
+      { x = 5.3851; y = -5.0642; z = 3.0076 }, (* O4'  *)
+      { x = 6.7315; y = -4.9724; z = 3.4462 }, (* C1'  *)
+      { x = 7.0033; y = -3.9202; z = 3.3619 }, (* H1'  *)
+      { x = 7.5997; y = -5.8018; z = 2.4948 }, (* C2'  *)
+      { x = 8.3627; y = -6.3254; z = 3.0707 }, (* H2'' *)
+      { x = 8.0410; y = -4.9501; z = 1.4724 }, (* O2'  *)
+      { x = 8.2781; y = -4.0644; z = 1.7570 }, (* H2'  *)
+      { x = 6.5701; y = -6.8129; z = 1.9714 }, (* C3'  *)
+      { x = 6.4186; y = -7.5809; z = 2.7299 }, (* H3'  *)
+      { x = 6.9357; y = -7.3841; z = 0.7235 }, (* O3'  *)
+      { x = 6.8024; y = -5.4718; z = 4.8475 }, (* N1   *)
+      { x = 6.6920; y = -5.0495; z = 7.1354 }, (* N3   *)
+      { x = 6.6201; y = -4.5500; z = 5.8506 }, (* C2   *)
+      { x = 6.9254; y = -6.3614; z = 7.4926 }, (* C4   *)
+      { x = 7.1046; y = -7.2543; z = 6.3718 }, (* C5   *)
+      { x = 7.0391; y = -6.7951; z = 5.1106 }, (* C6 *)
+      (U (
+      { x = 6.4083; y = -3.3696; z = 5.6340 }, (* O2   *)
+      { x = 6.9679; y = -6.6901; z = 8.6800 }, (* O4   *)
+      { x = 6.5626; y = -4.3957; z = 7.8812 }, (* H3   *)
+      { x = 7.2781; y = -8.2254; z = 6.5350 }, (* H5   *)
+      { x = 7.1657; y = -7.4312; z = 4.3503 }) (* H6   *)
+      )
+    )
+
+let rU07
+  = N(
+      {    a= -0.9434; b=0.3172; c=0.0971; (* dgf_base_tfo *)
+           d=0.2294; e=0.4125; f=0.8816;
+           g=0.2396; h=0.8539; i= -0.4619;
+           tx=8.3625; ty= -52.7147; tz=1.3745 },
+      {    a=0.2765; b= -0.1121; c= -0.9545; (* P_O3'_275_tfo *)
+           d= -0.8297; e=0.4733; f= -0.2959;
+           g=0.4850; h=0.8737; i=0.0379;
+           tx= -14.7774; ty= -45.2464; tz=21.9088 },
+      {    a=0.1063; b= -0.6334; c= -0.7665; (* P_O3'_180_tfo *)
+           d= -0.5932; e= -0.6591; f=0.4624;
+           g= -0.7980; h=0.4055; i= -0.4458;
+           tx=43.7634; ty=4.3296; tz=28.4890 },
+      {    a=0.7136; b= -0.5032; c= -0.4873; (* P_O3'_60_tfo *)
+           d=0.6803; e=0.3317; f=0.6536;
+           g= -0.1673; h= -0.7979; i=0.5791;
+           tx= -17.1858; ty=41.4390; tz= -27.0751 },
+      { x = 21.3880; y = 15.0780; z = 45.5770 }, (* P    *)
+      { x = 21.9980; y = 14.5500; z = 46.8210 }, (* O1P  *)
+      { x = 21.1450; y = 14.0270; z = 44.5420 }, (* O2P  *)
+      { x = 22.1250; y = 16.3600; z = 44.9460 }, (* O5'  *)
+      { x = 21.5037; y = 16.8594; z = 43.7323 }, (* C5'  *)
+      { x = 20.8147; y = 17.6663; z = 43.9823 }, (* H5'  *)
+      { x = 21.1086; y = 16.0230; z = 43.1557 }, (* H5'' *)
+      { x = 22.5654; y = 17.4874; z = 42.8616 }, (* C4'  *)
+      { x = 22.1584; y = 17.7243; z = 41.8785 }, (* H4'  *)
+      { x = 23.0557; y = 18.6826; z = 43.4751 }, (* O4'  *)
+      { x = 24.4788; y = 18.6151; z = 43.6455 }, (* C1'  *)
+      { x = 24.9355; y = 19.0840; z = 42.7739 }, (* H1'  *)
+      { x = 24.7958; y = 17.1427; z = 43.6474 }, (* C2'  *)
+      { x = 24.5652; y = 16.7400; z = 44.6336 }, (* H2'' *)
+      { x = 26.1041; y = 16.8773; z = 43.2455 }, (* O2'  *)
+      { x = 26.7516; y = 17.5328; z = 43.5149 }, (* H2'  *)
+      { x = 23.8109; y = 16.5979; z = 42.6377 }, (* C3'  *)
+      { x = 23.5756; y = 15.5686; z = 42.9084 }, (* H3'  *)
+      { x = 24.2890; y = 16.7447; z = 41.2729 }, (* O3'  *)
+      { x = 24.9420; y = 19.2174; z = 44.8923 }, (* N1   *)
+      { x = 25.2655; y = 20.5636; z = 44.8883 }, (* N3   *)
+      { x = 25.1663; y = 21.2219; z = 43.8561 }, (* C2   *)
+      { x = 25.6911; y = 21.1219; z = 46.0494 }, (* C4   *)
+      { x = 25.8051; y = 20.4068; z = 47.2048 }, (* C5   *)
+      { x = 26.2093; y = 20.9962; z = 48.2534 }, (* C6 *)
+      (U (
+      { x = 25.4692; y = 19.0221; z = 47.2053 }, (* O2   *)
+      { x = 25.0502; y = 18.4827; z = 46.0370 }, (* O4   *)
+      { x = 25.9599; y = 22.1772; z = 46.0966 }, (* H3   *)
+      { x = 25.5545; y = 18.4409; z = 48.1234 }, (* H5   *)
+      { x = 24.7854; y = 17.4265; z = 45.9883 }) (* H6   *)
+      )
+    )
+
+let rU08
+  = N(
+      {    a= -0.0080; b= -0.7928; c=0.6094; (* dgf_base_tfo *)
+           d= -0.7512; e=0.4071; f=0.5197;
+           g= -0.6601; h= -0.4536; i= -0.5988;
+           tx=44.1482; ty=30.7036; tz=2.1088 },
+      {    a=0.2765; b= -0.1121; c= -0.9545; (* P_O3'_275_tfo *)
+           d= -0.8297; e=0.4733; f= -0.2959;
+           g=0.4850; h=0.8737; i=0.0379;
+           tx= -14.7774; ty= -45.2464; tz=21.9088 },
+      {    a=0.1063; b= -0.6334; c= -0.7665; (* P_O3'_180_tfo *)
+           d= -0.5932; e= -0.6591; f=0.4624;
+           g= -0.7980; h=0.4055; i= -0.4458;
+           tx=43.7634; ty=4.3296; tz=28.4890 },
+      {    a=0.7136; b= -0.5032; c= -0.4873; (* P_O3'_60_tfo *)
+           d=0.6803; e=0.3317; f=0.6536;
+           g= -0.1673; h= -0.7979; i=0.5791;
+           tx= -17.1858; ty=41.4390; tz= -27.0751 },
+      { x = 21.3880; y = 15.0780; z = 45.5770 }, (* P    *)
+      { x = 21.9980; y = 14.5500; z = 46.8210 }, (* O1P  *)
+      { x = 21.1450; y = 14.0270; z = 44.5420 }, (* O2P  *)
+      { x = 22.1250; y = 16.3600; z = 44.9460 }, (* O5'  *)
+      { x = 23.5096; y = 16.1227; z = 44.5783 }, (* C5'  *)
+      { x = 23.5649; y = 15.8588; z = 43.5222 }, (* H5'  *)
+      { x = 23.9621; y = 15.4341; z = 45.2919 }, (* H5'' *)
+      { x = 24.2805; y = 17.4138; z = 44.7151 }, (* C4'  *)
+      { x = 25.3492; y = 17.2309; z = 44.6030 }, (* H4'  *)
+      { x = 23.8497; y = 18.3471; z = 43.7208 }, (* O4'  *)
+      { x = 23.4090; y = 19.5681; z = 44.3321 }, (* C1'  *)
+      { x = 24.2595; y = 20.2496; z = 44.3524 }, (* H1'  *)
+      { x = 23.0418; y = 19.1813; z = 45.7407 }, (* C2'  *)
+      { x = 22.0532; y = 18.7224; z = 45.7273 }, (* H2'' *)
+      { x = 23.1307; y = 20.2521; z = 46.6291 }, (* O2'  *)
+      { x = 22.8888; y = 21.1051; z = 46.2611 }, (* H2'  *)
+      { x = 24.0799; y = 18.1326; z = 46.0700 }, (* C3'  *)
+      { x = 23.6490; y = 17.4370; z = 46.7900 }, (* H3'  *)
+      { x = 25.3329; y = 18.7227; z = 46.5109 }, (* O3'  *)
+      { x = 22.2515; y = 20.1624; z = 43.6698 }, (* N1   *)
+      { x = 22.4760; y = 21.0609; z = 42.6406 }, (* N3   *)
+      { x = 23.6229; y = 21.3462; z = 42.3061 }, (* C2   *)
+      { x = 21.3986; y = 21.6081; z = 42.0236 }, (* C4   *)
+      { x = 20.1189; y = 21.3012; z = 42.3804 }, (* C5   *)
+      { x = 19.1599; y = 21.8516; z = 41.7578 }, (* C6 *)
+      (U (
+      { x = 19.8919; y = 20.3745; z = 43.4387 }, (* O2   *)
+      { x = 20.9790; y = 19.8423; z = 44.0440 }, (* O4   *)
+      { x = 21.5235; y = 22.3222; z = 41.2097 }, (* H3   *)
+      { x = 18.8732; y = 20.1200; z = 43.7312 }, (* H5   *)
+      { x = 20.8545; y = 19.1313; z = 44.8608 }) (* H6   *)
+      )
+    )
+
+let rU09
+  = N(
+      {    a= -0.0317; b=0.1374; c=0.9900; (* dgf_base_tfo *)
+           d= -0.3422; e= -0.9321; f=0.1184;
+           g=0.9391; h= -0.3351; i=0.0765;
+           tx= -32.1929; ty=25.8198; tz= -28.5088 },
+      {    a=0.2765; b= -0.1121; c= -0.9545; (* P_O3'_275_tfo *)
+           d= -0.8297; e=0.4733; f= -0.2959;
+           g=0.4850; h=0.8737; i=0.0379;
+           tx= -14.7774; ty= -45.2464; tz=21.9088 },
+      {    a=0.1063; b= -0.6334; c= -0.7665; (* P_O3'_180_tfo *)
+           d= -0.5932; e= -0.6591; f=0.4624;
+           g= -0.7980; h=0.4055; i= -0.4458;
+           tx=43.7634; ty=4.3296; tz=28.4890 },
+      {    a=0.7136; b= -0.5032; c= -0.4873; (* P_O3'_60_tfo *)
+           d=0.6803; e=0.3317; f=0.6536;
+           g= -0.1673; h= -0.7979; i=0.5791;
+           tx= -17.1858; ty=41.4390; tz= -27.0751 },
+      { x = 21.3880; y = 15.0780; z = 45.5770 }, (* P    *)
+      { x = 21.9980; y = 14.5500; z = 46.8210 }, (* O1P  *)
+      { x = 21.1450; y = 14.0270; z = 44.5420 }, (* O2P  *)
+      { x = 22.1250; y = 16.3600; z = 44.9460 }, (* O5'  *)
+      { x = 21.5037; y = 16.8594; z = 43.7323 }, (* C5'  *)
+      { x = 20.8147; y = 17.6663; z = 43.9823 }, (* H5'  *)
+      { x = 21.1086; y = 16.0230; z = 43.1557 }, (* H5'' *)
+      { x = 22.5654; y = 17.4874; z = 42.8616 }, (* C4'  *)
+      { x = 23.0565; y = 18.3036; z = 43.3915 }, (* H4'  *)
+      { x = 23.5375; y = 16.5054; z = 42.4925 }, (* O4'  *)
+      { x = 23.6574; y = 16.4257; z = 41.0649 }, (* C1'  *)
+      { x = 24.4701; y = 17.0882; z = 40.7671 }, (* H1'  *)
+      { x = 22.3525; y = 16.9643; z = 40.5396 }, (* C2'  *)
+      { x = 21.5993; y = 16.1799; z = 40.6133 }, (* H2'' *)
+      { x = 22.4693; y = 17.4849; z = 39.2515 }, (* O2'  *)
+      { x = 23.0899; y = 17.0235; z = 38.6827 }, (* H2'  *)
+      { x = 22.0341; y = 18.0633; z = 41.5279 }, (* C3'  *)
+      { x = 20.9509; y = 18.1709; z = 41.5846 }, (* H3'  *)
+      { x = 22.7249; y = 19.3020; z = 41.2100 }, (* O3'  *)
+      { x = 23.8580; y = 15.0648; z = 40.5757 }, (* N1   *)
+      { x = 25.1556; y = 14.5982; z = 40.4523 }, (* N3   *)
+      { x = 26.1047; y = 15.3210; z = 40.7448 }, (* C2   *)
+      { x = 25.3391; y = 13.3315; z = 40.0020 }, (* C4   *)
+      { x = 24.2974; y = 12.5148; z = 39.6749 }, (* C5   *)
+      { x = 24.5450; y = 11.3410; z = 39.2610 }, (* C6 *)
+      (U (
+      { x = 22.9633; y = 12.9979; z = 39.8053 }, (* O2   *)
+      { x = 22.8009; y = 14.2648; z = 40.2524 }, (* O4   *)
+      { x = 26.3414; y = 12.9194; z = 39.8855 }, (* H3   *)
+      { x = 22.1227; y = 12.3533; z = 39.5486 }, (* H5   *)
+      { x = 21.7989; y = 14.6788; z = 40.3650 }) (* H6   *)
+      )
+    )
+
+let rU10
+  = N(
+      {    a= -0.9674; b=0.1021; c= -0.2318; (* dgf_base_tfo *)
+           d= -0.2514; e= -0.2766; f=0.9275;
+           g=0.0306; h=0.9555; i=0.2933;
+           tx=27.8571; ty= -42.1305; tz= -24.4563 },
+      {    a=0.2765; b= -0.1121; c= -0.9545; (* P_O3'_275_tfo *)
+           d= -0.8297; e=0.4733; f= -0.2959;
+           g=0.4850; h=0.8737; i=0.0379;
+           tx= -14.7774; ty= -45.2464; tz=21.9088 },
+      {    a=0.1063; b= -0.6334; c= -0.7665; (* P_O3'_180_tfo *)
+           d= -0.5932; e= -0.6591; f=0.4624;
+           g= -0.7980; h=0.4055; i= -0.4458;
+           tx=43.7634; ty=4.3296; tz=28.4890 },
+      {    a=0.7136; b= -0.5032; c= -0.4873; (* P_O3'_60_tfo *)
+           d=0.6803; e=0.3317; f=0.6536;
+           g= -0.1673; h= -0.7979; i=0.5791;
+           tx= -17.1858; ty=41.4390; tz= -27.0751 },
+      { x = 21.3880; y = 15.0780; z = 45.5770 }, (* P    *)
+      { x = 21.9980; y = 14.5500; z = 46.8210 }, (* O1P  *)
+      { x = 21.1450; y = 14.0270; z = 44.5420 }, (* O2P  *)
+      { x = 22.1250; y = 16.3600; z = 44.9460 }, (* O5'  *)
+      { x = 23.5096; y = 16.1227; z = 44.5783 }, (* C5'  *)
+      { x = 23.5649; y = 15.8588; z = 43.5222 }, (* H5'  *)
+      { x = 23.9621; y = 15.4341; z = 45.2919 }, (* H5'' *)
+      { x = 24.2805; y = 17.4138; z = 44.7151 }, (* C4'  *)
+      { x = 23.8509; y = 18.1819; z = 44.0720 }, (* H4'  *)
+      { x = 24.2506; y = 17.8583; z = 46.0741 }, (* O4'  *)
+      { x = 25.5830; y = 18.0320; z = 46.5775 }, (* C1'  *)
+      { x = 25.8569; y = 19.0761; z = 46.4256 }, (* H1'  *)
+      { x = 26.4410; y = 17.1555; z = 45.7033 }, (* C2'  *)
+      { x = 26.3459; y = 16.1253; z = 46.0462 }, (* H2'' *)
+      { x = 27.7649; y = 17.5888; z = 45.6478 }, (* O2'  *)
+      { x = 28.1004; y = 17.9719; z = 46.4616 }, (* H2'  *)
+      { x = 25.7796; y = 17.2997; z = 44.3513 }, (* C3'  *)
+      { x = 25.9478; y = 16.3824; z = 43.7871 }, (* H3'  *)
+      { x = 26.2154; y = 18.4984; z = 43.6541 }, (* O3'  *)
+      { x = 25.7321; y = 17.6281; z = 47.9726 }, (* N1   *)
+      { x = 25.5136; y = 18.5779; z = 48.9560 }, (* N3   *)
+      { x = 25.2079; y = 19.7276; z = 48.6503 }, (* C2   *)
+      { x = 25.6482; y = 18.1987; z = 50.2518 }, (* C4   *)
+      { x = 25.9847; y = 16.9266; z = 50.6092 }, (* C5   *)
+      { x = 26.0918; y = 16.6439; z = 51.8416 }, (* C6 *)
+      (U (
+      { x = 26.2067; y = 15.9515; z = 49.5943 }, (* O2   *)
+      { x = 26.0713; y = 16.3497; z = 48.3080 }, (* O4   *)
+      { x = 25.4890; y = 18.9105; z = 51.0618 }, (* H3   *)
+      { x = 26.4742; y = 14.9310; z = 49.8682 }, (* H5   *)
+      { x = 26.2346; y = 15.6394; z = 47.4975 }) (* H6   *)
+      )
+    )
+
+let rUs = [rU01;rU02;rU03;rU04;rU05;rU06;rU07;rU08;rU09;rU10]
+
+let rG'
+  = N(
+      {    a= -0.2067; b= -0.0264; c=0.9780; (* dgf_base_tfo *)
+           d=0.9770; e= -0.0586; f=0.2049;
+           g=0.0519; h=0.9979; i=0.0379;
+           tx=1.0331; ty= -46.8078; tz= -36.4742 },
+      {    a= -0.8644; b= -0.4956; c= -0.0851; (* P_O3'_275_tfo *)
+           d= -0.0427; e=0.2409; f= -0.9696;
+           g=0.5010; h= -0.8345; i= -0.2294;
+           tx=4.0167; ty=54.5377; tz=12.4779 },
+      {    a=0.3706; b= -0.6167; c=0.6945; (* P_O3'_180_tfo *)
+           d= -0.2867; e= -0.7872; f= -0.5460;
+           g=0.8834; h=0.0032; i= -0.4686;
+           tx= -52.9020; ty=18.6313; tz= -0.6709 },
+      {    a=0.4155; b=0.9025; c= -0.1137; (* P_O3'_60_tfo *)
+           d=0.9040; e= -0.4236; f= -0.0582;
+           g= -0.1007; h= -0.0786; i= -0.9918;
+           tx= -7.6624; ty= -25.2080; tz=49.5181 },
+      { x = 31.3810; y = 0.1400; z = 47.5810 }, (* P    *)
+      { x = 29.9860; y = 0.6630; z = 47.6290 }, (* O1P  *)
+      { x = 31.7210; y = -0.6460; z = 48.8090 }, (* O2P  *)
+      { x = 32.4940; y = 1.2540; z = 47.2740 }, (* O5'  *)
+      { x = 32.1610; y = 2.2370; z = 46.2560 }, (* C5'  *)
+      { x = 31.2986; y = 2.8190; z = 46.5812 }, (* H5'  *)
+      { x = 32.0980; y = 1.7468; z = 45.2845 }, (* H5'' *)
+      { x = 33.3476; y = 3.1959; z = 46.1947 }, (* C4'  *)
+      { x = 33.2668; y = 3.8958; z = 45.3630 }, (* H4'  *)
+      { x = 33.3799; y = 3.9183; z = 47.4216 }, (* O4'  *)
+      { x = 34.6515; y = 3.7222; z = 48.0398 }, (* C1'  *)
+      { x = 35.2947; y = 4.5412; z = 47.7180 }, (* H1'  *)
+      { x = 35.1756; y = 2.4228; z = 47.4827 }, (* C2'  *)
+      { x = 34.6778; y = 1.5937; z = 47.9856 }, (* H2'' *)
+      { x = 36.5631; y = 2.2672; z = 47.4798 }, (* O2'  *)
+      { x = 37.0163; y = 2.6579; z = 48.2305 }, (* H2'  *)
+      { x = 34.6953; y = 2.5043; z = 46.0448 }, (* C3'  *)
+      { x = 34.5444; y = 1.4917; z = 45.6706 }, (* H3'  *)
+      { x = 35.6679; y = 3.3009; z = 45.3487 }, (* O3'  *)
+      { x = 37.4804; y = 4.0914; z = 52.2559 }, (* N1   *)
+      { x = 36.9670; y = 4.1312; z = 49.9281 }, (* N3   *)
+      { x = 37.8045; y = 4.2519; z = 50.9550 }, (* C2   *)
+      { x = 35.7171; y = 3.8264; z = 50.3222 }, (* C4   *)
+      { x = 35.2668; y = 3.6420; z = 51.6115 }, (* C5   *)
+      { x = 36.2037; y = 3.7829; z = 52.6706 }, (* C6 *)
+      (G (
+      { x = 39.0869; y = 4.5552; z = 50.7092 }, (* N2   *)
+      { x = 33.9075; y = 3.3338; z = 51.6102 }, (* N7   *)
+      { x = 34.6126; y = 3.6358; z = 49.5108 }, (* N9   *)
+      { x = 33.5805; y = 3.3442; z = 50.3425 }, (* C8   *)
+      { x = 35.9958; y = 3.6512; z = 53.8724 }, (* O6   *)
+      { x = 38.2106; y = 4.2053; z = 52.9295 }, (* H1   *)
+      { x = 39.8218; y = 4.6863; z = 51.3896 }, (* H21  *)
+      { x = 39.3420; y = 4.6857; z = 49.7407 }, (* H22  *)
+      { x = 32.5194; y = 3.1070; z = 50.2664 }) (* H8   *)
+      )
+    )
+
+let rU'
+  = N(
+      {    a= -0.0109; b=0.5907; c=0.8068; (* dgf_base_tfo *)
+           d=0.2217; e= -0.7853; f=0.5780;
+           g=0.9751; h=0.1852; i= -0.1224;
+           tx= -1.4225; ty= -11.0956; tz= -2.5217 },
+      {    a= -0.8313; b= -0.4738; c= -0.2906; (* P_O3'_275_tfo *)
+           d=0.0649; e=0.4366; f= -0.8973;
+           g=0.5521; h= -0.7648; i= -0.3322;
+           tx=1.6833; ty=6.8060; tz= -7.0011 },
+      {    a=0.3445; b= -0.7630; c=0.5470; (* P_O3'_180_tfo *)
+           d= -0.4628; e= -0.6450; f= -0.6082;
+           g=0.8168; h= -0.0436; i= -0.5753;
+           tx= -6.8179; ty= -3.9778; tz= -5.9887 },
+      {    a=0.5855; b=0.7931; c= -0.1682; (* P_O3'_60_tfo *)
+           d=0.8103; e= -0.5790; f=0.0906;
+           g= -0.0255; h= -0.1894; i= -0.9816;
+           tx=6.1203; ty= -7.1051; tz=3.1984 },
+      { x = 2.6760; y = -8.4960; z = 3.2880 }, (* P    *)
+      { x = 1.4950; y = -7.6230; z = 3.4770 }, (* O1P  *)
+      { x = 2.9490; y = -9.4640; z = 4.3740 }, (* O2P  *)
+      { x = 3.9730; y = -7.5950; z = 3.0340 }, (* O5'  *)
+      { x = 5.2430; y = -8.2420; z = 2.8260 }, (* C5'  *)
+      { x = 5.1974; y = -8.8497; z = 1.9223 }, (* H5'  *)
+      { x = 5.5548; y = -8.7348; z = 3.7469 }, (* H5'' *)
+      { x = 6.3140; y = -7.2060; z = 2.5510 }, (* C4'  *)
+      { x = 5.8744; y = -6.2116; z = 2.4731 }, (* H4'  *)
+      { x = 7.2798; y = -7.2260; z = 3.6420 }, (* O4'  *)
+      { x = 8.5733; y = -6.9410; z = 3.1329 }, (* C1'  *)
+      { x = 8.9047; y = -6.0374; z = 3.6446 }, (* H1'  *)
+      { x = 8.4429; y = -6.6596; z = 1.6327 }, (* C2'  *)
+      { x = 9.2880; y = -7.1071; z = 1.1096 }, (* H2'' *)
+      { x = 8.2502; y = -5.2799; z = 1.4754 }, (* O2'  *)
+      { x = 8.7676; y = -4.7284; z = 2.0667 }, (* H2'  *)
+      { x = 7.1642; y = -7.4416; z = 1.3021 }, (* C3'  *)
+      { x = 7.4125; y = -8.5002; z = 1.2260 }, (* H3'  *)
+      { x = 6.5160; y = -6.9772; z = 0.1267 }, (* O3'  *)
+      { x = 9.4531; y = -8.1107; z = 3.4087 }, (* N1   *)
+      { x = 11.5931; y = -9.0015; z = 3.6357 }, (* N3   *)
+      { x = 10.8101; y = -7.8950; z = 3.3748 }, (* C2   *)
+      { x = 11.1439; y = -10.2744; z = 3.9206 }, (* C4   *)
+      { x = 9.7056; y = -10.4026; z = 3.9332 }, (* C5   *)
+      { x = 8.9192; y = -9.3419; z = 3.6833 }, (* C6 *)
+      (U (
+      { x = 11.3013; y = -6.8063; z = 3.1326 }, (* O2   *)
+      { x = 11.9431; y = -11.1876; z = 4.1375 }, (* O4   *)
+      { x = 12.5840; y = -8.8673; z = 3.6158 }, (* H3   *)
+      { x = 9.2891; y = -11.2898; z = 4.1313 }, (* H5   *)
+      { x = 7.9263; y = -9.4537; z = 3.6977 }) (* H6   *)
+      )
+    )
+
+(* -- PARTIAL INSTANTIATIONS ------------------------------------------------*)
+
+type variable =
+  { id : int;
+    t : tfo;
+    n : nuc }
+
+let mk_var i t n = { id = i; t = t; n = n }
+
+let absolute_pos v p = tfo_apply v.t p
+
+let atom_pos atom v = absolute_pos v (atom v.n)
+
+let rec get_var id = function
+ | (v::lst) -> if id = v.id then v else get_var id lst
+ | _ -> assert false
+
+(* -- SEARCH ----------------------------------------------------------------*)
+
+(* Sequential backtracking algorithm *)
+
+let rec search (partial_inst : variable list) l constr =
+  match l with
+    [] -> [partial_inst]
+  | (h::t) ->
+      let rec try_assignments = function
+        [] -> []
+      | v::vs ->
+          if constr v partial_inst then
+            (search (v::partial_inst) t constr) @ (try_assignments vs)
+          else
+            try_assignments vs
+      in
+        try_assignments (h partial_inst)
+
+
+(* -- DOMAINS ---------------------------------------------------------------*)
+
+(* Primary structure:   strand A CUGCCACGUCUG, strand B CAGACGUGGCAG
+  
+   Secondary structure: strand A CUGCCACGUCUG
+                                 ||||||||||||
+                                 GACGGUGCAGAC strand B
+  
+   Tertiary structure:
+  
+      5' end of strand A C1----G12 3' end of strand B
+                       U2-------A11
+                      G3-------C10
+                      C4-----G9
+                       C5---G8
+                          A6
+                        G6-C7
+                       C5----G8
+                      A4-------U9
+                      G3--------C10
+                       A2-------U11
+     5' end of strand B C1----G12 3' end of strand A
+  
+   "helix", "stacked" and "connected" describe the spatial relationship
+   between two consecutive nucleotides. E.g. the nucleotides C1 and U2
+   from the strand A.
+  
+   "wc" (stands for Watson-Crick and is a type of base-pairing),
+   and "wc-dumas" describe the spatial relationship between 
+   nucleotides from two chains that are growing in opposite directions.
+   E.g. the nucleotides C1 from strand A and G12 from strand B.
+*)
+
+(* Dynamic Domains *)
+
+(* Given,
+     "refnuc" a nucleotide which is already positioned,
+     "nucl" the nucleotide to be placed,
+     and "tfo" a transformation matrix which expresses the desired
+     relationship between "refnuc" and "nucl",
+   the function "dgf-base" computes the transformation matrix that
+   places the nucleotide "nucl" in the given relationship to "refnuc".
+*)
+
+let
+dgf_base tfo v nucl
+  = let x = if is_A v.n then
+                tfo_align (atom_pos nuc_C1' v)
+                          (atom_pos rA_N9   v)
+                          (atom_pos nuc_C4  v)
+              else if is_C v.n then
+                tfo_align (atom_pos nuc_C1' v)
+                          (atom_pos nuc_N1  v)
+                          (atom_pos nuc_C2  v)
+              else if is_G v.n then
+                tfo_align (atom_pos nuc_C1' v)
+                          (atom_pos rG_N9   v)
+                          (atom_pos nuc_C4  v)
+              else
+                tfo_align (atom_pos nuc_C1' v)
+                          (atom_pos nuc_N1  v)
+                          (atom_pos nuc_C2  v)
+    in
+      tfo_combine (nuc_dgf_base_tfo nucl)
+                  (tfo_combine tfo (tfo_inv_ortho x))
+
+(* Placement of first nucleotide. *)
+
+let
+reference n i partial_inst = [ mk_var i tfo_id n ]
+
+(* The transformation matrix for wc is from:
+  
+   Chandrasekaran R. et al (1989) A Re-Examination of the Crystal
+   Structure of A-DNA Using Fiber Diffraction Data. J. Biomol.
+   Struct. & Dynamics 6(6):1189-1202.
+*)
+
+let wc_tfo
+  = (
+      {    a= -1.0000; b=0.0028; c= -0.0019;
+           d=0.0028; e=0.3468; f= -0.9379;
+           g= -0.0019; h= -0.9379; i= -0.3468;
+           tx= -0.0080; ty=6.0730; tz=8.7208 }
+    )
+
+let
+wc nucl i j partial_inst
+  = [ mk_var i (dgf_base wc_tfo (get_var j partial_inst) nucl) nucl ]
+
+let wc_dumas_tfo
+  = (
+      {    a= -0.9737; b= -0.1834; c=0.1352;
+           d= -0.1779; e=0.2417; f= -0.9539;
+           g=0.1422; h= -0.9529; i= -0.2679;
+           tx=0.4837; ty=6.2649; tz=8.0285 }
+    )
+
+let
+wc_dumas nucl i j partial_inst
+  = [ mk_var i (dgf_base wc_dumas_tfo (get_var j partial_inst) nucl) nucl ]
+
+let helix5'_tfo
+  = (
+      {    a=0.9886; b= -0.0961; c=0.1156;
+           d=0.1424; e=0.8452; f= -0.5152;
+           g= -0.0482; h=0.5258; i=0.8492;
+           tx= -3.8737; ty=0.5480; tz=3.8024 }
+    )
+
+let
+helix5' nucl i j partial_inst
+  = [ mk_var i (dgf_base helix5'_tfo (get_var j partial_inst) nucl) nucl ]
+
+let helix3'_tfo
+  = (
+      {    a=0.9886; b=0.1424; c= -0.0482;
+           d= -0.0961; e=0.8452; f=0.5258;
+           g=0.1156; h= -0.5152; i=0.8492;
+           tx=3.4426; ty=2.0474; tz= -3.7042 }
+    )
+
+let
+helix3' nucl i j partial_inst
+  = [ mk_var i (dgf_base helix3'_tfo (get_var j partial_inst) nucl) nucl ]
+
+let g37_a38_tfo
+  = (
+      {    a=0.9991; b=0.0164; c= -0.0387;
+           d= -0.0375; e=0.7616; f= -0.6470;
+           g=0.0189; h=0.6478; i=0.7615;
+           tx= -3.3018; ty=0.9975; tz=2.5585 }
+    )
+
+let
+g37_a38 nucl i j partial_inst
+  = mk_var i (dgf_base g37_a38_tfo (get_var j partial_inst) nucl) nucl
+
+let
+stacked5' nucl i j partial_inst
+  = (g37_a38 nucl i j partial_inst) :: (helix5' nucl i j partial_inst)
+
+let a38_g37_tfo
+  = (
+      {    a=0.9991; b= -0.0375; c=0.0189;
+           d=0.0164; e=0.7616; f=0.6478;
+           g= -0.0387; h= -0.6470; i=0.7615;
+           tx=3.3819; ty=0.7718; tz= -2.5321 }
+    )
+
+let
+a38_g37 nucl i j partial_inst
+  = mk_var i (dgf_base a38_g37_tfo (get_var j partial_inst) nucl) nucl
+
+let   
+stacked3' nucl i j partial_inst
+  = (a38_g37 nucl i j partial_inst) :: (helix3' nucl i j partial_inst)
+
+let
+p_o3' nucls i j partial_inst
+  = let refnuc = get_var j partial_inst in
+    let align = tfo_inv_ortho
+                    (tfo_align (atom_pos nuc_O3' refnuc)
+                               (atom_pos nuc_C3' refnuc)
+                               (atom_pos nuc_C4' refnuc)) in
+    let rec generate domains = function
+      [] -> domains
+    | n::ns ->
+         generate
+           ((mk_var i (tfo_combine (nuc_p_o3'_60_tfo n) align) n)::
+            (mk_var i (tfo_combine (nuc_p_o3'_180_tfo n) align) n)::
+            (mk_var i (tfo_combine (nuc_p_o3'_275_tfo n) align) n)::domains)
+           ns
+    in
+      generate [] nucls
+
+(* -- PROBLEM STATEMENT -----------------------------------------------------*)
+
+(* Define anticodon problem -- Science 253:1255 Figure 3a, 3b and 3c *)
+
+let
+anticodon_domains
+  = [
+     reference rC  27;
+     helix5'   rC  28 27;
+     helix5'   rA  29 28;
+     helix5'   rG  30 29;
+     helix5'   rA  31 30;
+     wc        rU  39 31;
+     helix5'   rC  40 39;
+     helix5'   rU  41 40;
+     helix5'   rG  42 41;
+     helix5'   rG  43 42;
+     stacked3' rA  38 39;
+     stacked3' rG  37 38;
+     stacked3' rA  36 37;
+     stacked3' rA  35 36;
+     stacked3' rG  34 35; (* <-. Distance      *)
+     p_o3'     rCs 32 31; (*   | Constraint    *)
+     p_o3'     rUs 33 32  (* <-' 3.0 Angstroms *)
+    ]
+
+(* Anticodon constraint *)
+
+let
+anticodon_constraint v partial_inst =
+  let rec dist j = let p = atom_pos nuc_P (get_var j partial_inst) in
+                   let o3' = atom_pos nuc_O3' v in
+                     pt_dist p o3'
+  in
+      if v.id = 33 then
+        (dist 34) <= 3.0
+      else
+        true
+
+let
+anticodon () = search [] anticodon_domains anticodon_constraint
+
+(* Define pseudoknot problem -- Science 253:1255 Figure 4a and 4b *)
+
+let
+pseudoknot_domains
+  = [
+     reference rA  23;
+     wc_dumas  rU   8 23;
+     helix3'   rG  22 23;
+     wc_dumas  rC   9 22;
+     helix3'   rG  21 22;
+     wc_dumas  rC  10 21;
+     helix3'   rC  20 21;
+     wc_dumas  rG  11 20;
+     helix3'   rU' 19 20; (* <-.               *)
+     wc_dumas  rA  12 19; (*   | Distance      *)
+(*                             | Constraint    *)
+(*  Helix 1                    | 4.0 Angstroms *)
+     helix3'   rC   3 19; (*   |               *)
+     wc_dumas  rG  13  3; (*   |               *)
+     helix3'   rC   2  3; (*   |               *)
+     wc_dumas  rG  14  2; (*   |               *)
+     helix3'   rC   1  2; (*   |               *)
+     wc_dumas  rG' 15  1; (*   |               *)
+(*                             |               *)
+(*  L2 LOOP                    |               *)
+     p_o3'     rUs 16 15; (*   |               *)
+     p_o3'     rCs 17 16; (*   |               *)
+     p_o3'     rAs 18 17; (* <-'               *)
+(*                                             *)
+(*  L1 LOOP                                    *)
+     helix3'   rU   7  8; (* <-.               *)
+     p_o3'     rCs  4  3; (*   | Constraint    *)
+     stacked5' rU   5  4; (*   | 4.5 Angstroms *)
+     stacked5' rC   6  5  (* <-'               *)
+    ]
+  
+(* Pseudoknot constraint *)
+
+let
+pseudoknot_constraint v partial_inst =
+    let rec dist j =
+        let p = atom_pos nuc_P (get_var j partial_inst) in
+        let o3' = atom_pos nuc_O3' v in
+        pt_dist p o3'
+    in
+      if v.id = 18 then
+        (dist 19) <= 4.0
+      else if v.id = 6 then
+        (dist 7) <= 4.5
+      else
+        true
+
+let
+pseudoknot () = search [] pseudoknot_domains pseudoknot_constraint
+
+(* -- TESTING ---------------------------------------------------------------*)
+
+let list_of_atoms = function
+  (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,
+   A (n6,n7,n9,c8,h2,h61,h62,h8)))
+  -> [|p;o1p;o2p;o5';c5';h5';h5'';c4';h4';o4';c1';h1';c2';h2'';o2';h2';c3';
+     h3';o3';n1;n3;c2;c4;c5;c6;n6;n7;n9;c8;h2;h61;h62;h8|]
+
+| (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,
+   C (n4,o2,h41,h42,h5,h6)))
+  -> [|p;o1p;o2p;o5';c5';h5';h5'';c4';h4';o4';c1';h1';c2';h2'';o2';h2';c3';
+     h3';o3';n1;n3;c2;c4;c5;c6;n4;o2;h41;h42;h5;h6|]
+
+| (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,
+   G (n2,n7,n9,c8,o6,h1,h21,h22,h8)))
+  -> [|p;o1p;o2p;o5';c5';h5';h5'';c4';h4';o4';c1';h1';c2';h2'';o2';h2';c3';
+     h3';o3';n1;n3;c2;c4;c5;c6;n2;n7;n9;c8;o6;h1;h21;h22;h8|]
+
+| (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
+   p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
+   c3',h3',o3',n1,n3,c2,c4,c5,c6,
+   U (o2,o4,h3,h5,h6)))
+  -> [|p;o1p;o2p;o5';c5';h5';h5'';c4';h4';o4';c1';h1';c2';h2'';o2';h2';c3';
+     h3';o3';n1;n3;c2;c4;c5;c6;o2;o4;h3;h5;h6|]
+
+let maximum = function
+  | x::xs ->
+     let rec iter m = function
+       [] -> m
+     | (a::b) -> iter (if a > m then a else m) b
+     in
+       iter x xs
+  | _ -> assert false
+
+let
+var_most_distant_atom v =
+  let atoms = list_of_atoms v.n in
+  let max_dist = ref 0.0 in
+  for i = 0 to pred (Array.length atoms) do
+    let p = atoms.(i) in
+    let distance = 
+      let pos = absolute_pos v p
+      in sqrt ((pos.x * pos.x) + (pos.y * pos.y) + (pos.z * pos.z)) in
+    if distance > !max_dist then max_dist := distance
+  done;
+  !max_dist
+
+let
+sol_most_distant_atom s = maximum (List.map var_most_distant_atom s)
+
+let
+most_distant_atom sols = maximum (List.map sol_most_distant_atom sols)
+
+let
+check () = List.length (pseudoknot ())
+
+let
+run () = most_distant_atom (pseudoknot ())
+
+let main () =
+  for i = 1 to 50 do ignore(run()) done;
+  Printf.printf "%.4f" (run ()); print_newline()
+
+let _ = main ()
diff --git a/test/ocamldoc/Makefile b/test/ocamldoc/Makefile
new file mode 100644 (file)
index 0000000..0beaefc
--- /dev/null
@@ -0,0 +1,40 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#         Maxence Guesdon, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 2004 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the Q Public License version 1.0.                #
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.1 2004/02/20 16:02:03 guesdon Exp $ 
+
+ROOT=../..
+include $(ROOT)/config/Makefile
+
+CAMLC=$(ROOT)/boot/ocamlrun $(ROOT)/ocamlc
+CAMLOPT=$(ROOT)/boot/ocamlrun $(ROOT)/ocamlopt
+COMPFLAGS=-nostdlib -I $(ROOT)/stdlib -I KB -I Lex
+OPTFLAGS=-S
+CAMLYACC=$(ROOT)/yacc/ocamlyacc
+YACCFLAGS=-v
+CAMLLEX=$(ROOT)/boot/ocamlrun $(ROOT)/lex/ocamllex
+CAMLDEP=$(ROOT)/boot/ocamlrun $(ROOT)/tools/ocamldep
+CAMLRUN=$(ROOT)/byterun/ocamlrun
+OCAMLDOC=$(ROOT)/boot/ocamlrun $(ROOT)/ocamldoc/ocamldoc
+OCAMLDOC_TEST=$(OCAMLDOC) -g $(ROOT)/ocamldoc/odoc_test.cmo -warn-error
+
+
+all:
+       for i in *.ml; do $(MAKE) TARGET=`basename $$i .ml` test_one; done
+
+test_one: results/$(TARGET).txt
+
+results/$(TARGET).txt : $(TARGET).ml
+       $(OCAMLDOC_TEST) -o $@ $< 2> results/$(TARGET).stderr
+
+clean:
+       rm -f results/*.txt results/*.stderr
\ No newline at end of file
diff --git a/test/ocamldoc/t1.ml b/test/ocamldoc/t1.ml
new file mode 100644 (file)
index 0000000..6caf3d7
--- /dev/null
@@ -0,0 +1,19 @@
+(** Testing display of types.
+
+   @test_types_display
+ *)
+
+let x = 1
+
+
+module M = struct
+  let y = 2 
+
+end
+
+module type MT = sig
+  type t = string -> int -> string -> (string * string * string) ->
+    (string * string * string) ->
+      (string * string * string) -> unit
+  val y : int
+end
diff --git a/test/quicksort.ml b/test/quicksort.ml
new file mode 100644 (file)
index 0000000..778c622
--- /dev/null
@@ -0,0 +1,92 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: quicksort.ml,v 1.7 2005/08/12 09:22:04 xleroy Exp $ *)
+
+(* Good test for loops. Best compiled with -unsafe. *)
+
+let rec qsort lo hi (a : int array) =
+  if lo < hi then begin
+    let i = ref lo in
+    let j = ref hi in
+    let pivot = a.(hi) in
+    while !i < !j do
+      while !i < hi && a.(!i) <= pivot do incr i done;
+      while !j > lo && a.(!j) >= pivot do decr j done;
+      if !i < !j then begin
+        let temp = a.(!i) in a.(!i) <- a.(!j); a.(!j) <- temp
+      end
+    done;
+    let temp = a.(!i) in a.(!i) <- a.(hi); a.(hi) <- temp;
+    qsort lo (!i-1) a;
+    qsort (!i+1) hi a
+  end
+
+
+(* Same but abstract over the comparison to force spilling *)
+
+let cmp i j = i - j
+
+let rec qsort2 lo hi (a : int array) =
+  if lo < hi then begin
+    let i = ref lo in
+    let j = ref hi in
+    let pivot = a.(hi) in
+    while !i < !j do
+      while !i < hi && cmp a.(!i) pivot <= 0 do incr i done;
+      while !j > lo && cmp a.(!j) pivot >= 0 do decr j done;
+      if !i < !j then begin
+        let temp = a.(!i) in a.(!i) <- a.(!j); a.(!j) <- temp
+      end
+    done;
+    let temp = a.(!i) in a.(!i) <- a.(hi); a.(hi) <- temp;
+    qsort2 lo (!i-1) a;
+    qsort2 (!i+1) hi a
+  end
+
+
+(* Test *)
+
+let seed = ref 0
+
+let random() =
+  seed := !seed * 25173 + 17431; !seed land 0xFFF
+
+
+exception Failed
+
+let test_sort sort_fun size =
+  let a = Array.create size 0 in
+  let check = Array.create 4096 0 in
+  for i = 0 to size-1 do
+    let n = random() in a.(i) <- n; check.(n) <- check.(n)+1
+  done;
+  sort_fun 0 (size-1) a;
+  try
+    check.(a.(0)) <- check.(a.(0)) - 1;
+    for i = 1 to size-1 do
+      if a.(i-1) > a.(i) then raise Failed;
+      check.(a.(i)) <- check.(a.(i)) - 1
+    done;
+    for i = 0 to 4095 do
+      if check.(i) <> 0 then raise Failed
+    done;
+    print_string "OK";  print_newline()
+  with Failed ->
+    print_string "failed"; print_newline()
+
+
+let main () =
+  test_sort qsort 500000;
+  test_sort qsort2 500000
+
+let _ = main(); exit 0
diff --git a/test/sieve.ml b/test/sieve.ml
new file mode 100644 (file)
index 0000000..b58dd60
--- /dev/null
@@ -0,0 +1,56 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: sieve.ml,v 1.5 2005/08/12 09:22:04 xleroy Exp $ *)
+
+(* Eratosthene's sieve *)
+
+(* interval min max = [min; min+1; ...; max-1; max] *)
+
+let rec interval min max =
+  if min > max then [] else min :: interval (min + 1) max
+
+
+(* filter p L returns the list of the elements in list L
+   that satisfy predicate p *)
+
+let rec filter p = function
+     []  -> []
+  | a::r -> if p a then a :: filter p r else filter p r
+
+
+(* Application: removing all numbers multiple of n from a list of integers *)
+
+let remove_multiples_of n =
+  filter (fun m -> m mod n <> 0)
+
+
+(* The sieve itself *)
+
+let sieve max =
+  let rec filter_again = function
+     [] -> []
+  | n::r as l ->
+      if n*n > max then l else n :: filter_again (remove_multiples_of n r)
+  in
+    filter_again (interval 2 max)
+
+
+let rec do_list f = function
+    [] -> ()
+  | a::l -> f a; do_list f l
+
+
+let _ =
+  do_list (fun n -> print_int n; print_string " ") (sieve 50000);
+  print_newline();
+  exit 0
diff --git a/test/soli.ml b/test/soli.ml
new file mode 100644 (file)
index 0000000..684d646
--- /dev/null
@@ -0,0 +1,111 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: soli.ml,v 1.4 1999/11/17 18:58:34 xleroy Exp $ *)
+
+
+type peg = Out | Empty | Peg
+
+let board = [|
+ [| Out; Out; Out; Out; Out; Out; Out; Out; Out|];
+ [| Out; Out; Out; Peg; Peg; Peg; Out; Out; Out|];
+ [| Out; Out; Out; Peg; Peg; Peg; Out; Out; Out|];
+ [| Out; Peg; Peg; Peg; Peg; Peg; Peg; Peg; Out|];
+ [| Out; Peg; Peg; Peg; Empty; Peg; Peg; Peg; Out|];
+ [| Out; Peg; Peg; Peg; Peg; Peg; Peg; Peg; Out|];
+ [| Out; Out; Out; Peg; Peg; Peg; Out; Out; Out|];
+ [| Out; Out; Out; Peg; Peg; Peg; Out; Out; Out|];
+ [| Out; Out; Out; Out; Out; Out; Out; Out; Out|]
+|]
+
+
+let print_peg = function
+    Out -> print_string "."
+  | Empty -> print_string " "
+  | Peg -> print_string "$"
+
+
+let print_board board =
+ for i=0 to 8 do
+   for j=0 to 8 do
+    print_peg board.(i).(j)
+   done;
+   print_newline()
+ done
+
+
+type direction = { dx: int; dy: int }
+
+let dir = [| {dx = 0; dy = 1}; {dx = 1; dy = 0};
+             {dx = 0; dy = -1}; {dx = -1; dy = 0} |]
+
+type move = { x1: int; y1: int; x2: int; y2: int }
+
+let moves = Array.create 31 {x1=0;y1=0;x2=0;y2=0}
+
+let counter = ref 0
+
+exception Found
+
+let rec solve m =
+  counter := !counter + 1;
+  if m = 31 then
+    begin match board.(4).(4) with Peg -> true | _ -> false end
+  else
+    try
+      if !counter mod 500 = 0 then begin
+        print_int !counter; print_newline()
+      end;
+      for i=1 to 7 do
+      for j=1 to 7 do
+        match board.(i).(j) with
+          Peg ->
+            for k=0 to 3 do
+              let d1 = dir.(k).dx in
+              let d2 = dir.(k).dy in
+              let i1 = i+d1 in
+              let i2 = i1+d1 in
+              let j1 = j+d2 in
+              let j2 = j1+d2 in
+              match board.(i1).(j1) with
+                Peg ->
+                  begin match board.(i2).(j2) with
+                    Empty ->
+(*
+                      print_int i; print_string ", ";
+                      print_int j; print_string ") dir ";
+                      print_int k; print_string "\n";
+*)
+                      board.(i).(j) <- Empty;
+                      board.(i1).(j1) <- Empty;
+                      board.(i2).(j2) <- Peg;
+                      if solve(m+1) then begin
+                        moves.(m) <- { x1=i; y1=j; x2=i2; y2=j2 };
+                        raise Found
+                      end;
+                      board.(i).(j) <- Peg;
+                      board.(i1).(j1) <- Peg;
+                      board.(i2).(j2) <- Empty
+                    | _ -> ()
+                  end
+              | _ -> ()
+            done
+        | _ ->
+            ()
+      done
+      done;
+      false
+    with Found ->
+      true
+
+
+let _ = if solve 0 then (print_string "\n"; print_board board)
diff --git a/test/sorts.ml b/test/sorts.ml
new file mode 100644 (file)
index 0000000..859ff0e
--- /dev/null
@@ -0,0 +1,4477 @@
+(* Test bench for sorting algorithms. *)
+
+
+(*
+  ocamlopt -noassert sorts.ml -cclib -lunix
+*)
+
+open Printf;;
+
+(*
+  Criteres:
+  0. overhead en pile: doit etre logn au maximum.
+  1. stable ou non.
+  2. overhead en espace.
+  3. vitesse.
+*)
+
+(************************************************************************)
+(* auxiliary functions *)
+
+let rec exp2 n = if n <= 0 then 1 else 2 * exp2 (n-1);;
+let id x = x;;
+let postl x y = Array.of_list y;;
+let posta x y = x;;
+
+let mkconst n = Array.make n 0;;
+let chkconst _ n a = (a = mkconst n);;
+
+let mksorted n =
+  let a = Array.make n 0 in
+  for i = 0 to n - 1 do
+    a.(i) <- i;
+  done;
+  a
+;;
+let chksorted _ n a = (a = mksorted n);;
+
+let mkrev n =
+  let a = Array.make n 0 in
+  for i = 0 to n - 1 do
+    a.(i) <- n - 1 - i;
+  done;
+  a
+;;
+let chkrev _ n a = (a = mksorted n);;
+
+let seed = ref 0;;
+let random_reinit () = Random.init !seed;;
+
+let random_get_state () =
+  let a = Array.make 55 0 in
+  for i = 0 to 54 do a.(i) <- Random.bits (); done;
+  Random.full_init a;
+  a
+;;
+let random_set_state a = Random.full_init a;;
+
+let chkgen mke cmp rstate n a =
+  let marks = Array.make n (-1) in
+  let skipmarks l =
+    if marks.(l) = -1 then l else begin
+      let m = ref marks.(l) in
+      while marks.(!m) <> -1 do incr m; done;
+      marks.(l) <- !m;
+      !m
+    end
+  in
+  let linear e l =
+    let l = skipmarks l in
+    let rec loop l =
+      if cmp a.(l) e > 0 then raise Exit
+      else if e = a.(l) then marks.(l) <- l+1
+      else loop (l+1)
+    in loop l
+  in
+  let rec dicho e l r =
+    if l = r then linear e l
+    else begin
+      assert (l < r);
+      let m = (l + r) / 2 in
+      if cmp a.(m) e >= 0 then dicho e l m else dicho e (m + 1) r
+    end
+  in
+  try
+    for i = 0 to n-2 do if cmp a.(i) a.(i+1) > 0 then raise Exit; done;
+    random_set_state rstate;
+    for i = 0 to n-1 do dicho (mke i) 0 (Array.length a - 1); done;
+    true
+  with Exit | Invalid_argument _ -> false;
+;;
+
+let mkrand_dup n =
+  let a = Array.make n 0 in
+  for i = 0 to (n-1) do a.(i) <- Random.int n; done;
+  a
+;;
+
+let chkrand_dup rstate n a =
+  chkgen (fun i -> Random.int n) compare rstate n a
+;;
+
+let mkrand_nodup n =
+  let a = Array.make n 0 in
+  for i = 0 to (n-1) do a.(i) <- Random.bits (); done;
+  a
+;;
+
+let chkrand_nodup rstate n a =
+  chkgen (fun i -> Random.bits ()) compare rstate n a
+;;
+
+let mkfloats n =
+  let a = Array.make n 0.0 in
+  for i = 0 to (n-1) do a.(i) <- Random.float 1.0; done;
+  a
+;;
+
+let chkfloats rstate n a =
+  chkgen (fun i -> Random.float 1.0) compare rstate n a
+;;
+
+type record = {
+  s1 : string;
+  s2 : string;
+  i1 : int;
+  i2 : int;
+};;
+
+let rand_string () =
+  let len = Random.int 10 in
+  let s = String.create len in
+  for i = 0 to len-1 do
+    s.[i] <- Char.chr (Random.int 256);
+  done;
+  s
+;;
+
+let mkrec1 b i = {
+  s1 = rand_string ();
+  s2 = rand_string ();
+  i1 = Random.int b;
+  i2 = i;
+};;
+
+let mkrecs b n = Array.init n (mkrec1 b);;
+
+let mkrec1_rev b i = {
+  s1 = rand_string ();
+  s2 = rand_string ();
+  i1 = - i;
+  i2 = i;
+};;
+
+let mkrecs_rev n = Array.init n (mkrec1_rev 0);;
+
+let cmpstr r1 r2 =
+  let c1 = compare r1.s1 r2.s1 in
+  if c1 = 0 then compare r1.s2 r2.s2 else c1
+;;
+let lestr r1 r2 =
+  let c1 = compare r1.s1 r2.s1 in
+  if c1 = 0 then r1.s2 <= r2.s2 else (c1 < 0)
+;;
+let chkstr b rstate n a = chkgen (mkrec1 b) cmpstr rstate n a;;
+
+let cmpint r1 r2 = compare r1.i1 r2.i1;;
+let leint r1 r2 = r1.i1 <= r2.i1;;
+let chkint b rstate n a = chkgen (mkrec1 b) cmpint rstate n a;;
+
+let cmplex r1 r2 =
+  let c1 = compare r1.i1 r2.i1 in
+  if c1 = 0 then compare r1.i2 r2.i2 else c1
+;;
+let lelex r1 r2 =
+  let c1 = compare r1.i1 r2.i1 in
+  if c1 = 0 then r1.i2 <= r2.i2 else (c1 < 0)
+;;
+let chklex b rstate n a = chkgen (mkrec1 b) cmplex rstate n a;;
+
+(************************************************************************)
+
+let lens = [
+  0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 28;
+  100; 127; 128; 129; 191; 192; 193; 506;
+  1000; 1023; 1024; 1025; 1535; 1536; 1537; 2323;
+  4000; 4094; 4096; 4098; 5123;
+];;
+
+type ('a, 'b, 'c, 'd) aux = {
+  prepf : ('a -> 'a -> int) -> ('a -> 'a -> bool) -> 'b;
+  prepd : 'a array -> 'c;
+  postd : 'a array -> 'd -> 'a array;
+};;
+
+let ll = { prepf = (fun x y -> y); prepd = Array.to_list; postd = postl };;
+let lc = { prepf = (fun x y -> x); prepd = Array.to_list; postd = postl };;
+let al = { prepf = (fun x y -> y); prepd = id; postd = posta };;
+let ac = { prepf = (fun x y -> x); prepd = id; postd = posta };;
+
+type 'a outcome = Value of 'a | Exception of exn;;
+
+let numfailed = ref 0;;
+
+let test1 name f prepdata postdata cmp desc mk chk =
+  random_reinit ();
+  printf "  %s with %s" name desc;
+  let i = ref 0 in
+  List.iter (fun n ->
+      if !i = 0 then printf "\n    "; incr i; if !i > 11 then i := 0;
+      printf "%5d" n; flush stdout;
+      let rstate = random_get_state () in
+      let a = mk n in
+      let input = prepdata a in
+      let output = try Value (f cmp input) with e -> Exception e in
+      printf "."; flush stdout;
+      begin match output with
+      | Value v ->
+         if not (chk rstate n (postdata a v))
+         then (incr numfailed; printf "\n*** FAIL\n")
+      | Exception e ->
+         incr numfailed; printf "\n*** %s\n" (Printexc.to_string e)
+      end;
+      flush stdout;
+    ) lens;
+  printf "\n";
+;;
+
+let test name stable f1 f2 aux1 aux2 =
+  printf "Testing %s...\n" name;
+  let t a b c d = test1 name f1 aux1.prepd aux1.postd a b c d in
+  let cmp = aux1.prepf compare (<=) in
+  t cmp "constant ints" mkconst chkconst;
+  t cmp "sorted ints" mksorted chksorted;
+  t cmp "reverse-sorted ints" mkrev chkrev;
+  t cmp "random ints (many dups)" mkrand_dup chkrand_dup;
+  t cmp "random ints (few dups)" mkrand_nodup chkrand_nodup;
+(*
+  let t a b c d = test1 name f3 aux3.prepd aux3.postd a b c d in
+  t cmp "random floats" mkfloats chkfloats;
+*)
+  let t a b c d = test1 name f2 aux2.prepd aux2.postd a b c d in
+  let cmp = aux2.prepf cmpstr lestr in
+  t cmp "records (str)" (mkrecs 1) (chkstr 1);
+  let cmp = aux2.prepf cmpint leint in
+  List.iter (fun m -> t cmp (sprintf "records (int[%d])" m) (mkrecs m)
+                        (chkint m)
+            ) [1; 10; 100; 1000];
+  if stable then
+    List.iter (fun m -> t cmp (sprintf "records (int[%d]) [stable]" m)
+                          (mkrecs m) (chklex m)
+              ) [1; 10; 100; 1000];
+;;
+
+(************************************************************************)
+
+(* Warning: rpt_timer cannot be used for the array sorts because
+   the sorting functions have effects.
+*)
+
+let rpt_timer1 repeat f x =
+  Gc.compact ();
+  ignore (f x);
+  let st = Sys.time () in
+  for i = 1 to repeat do ignore (f x); done;
+  let en = Sys.time () in
+  en -. st
+;;
+
+let rpt_timer f x =
+  let repeat = ref 1 in
+  let t = ref (rpt_timer1 !repeat f x) in
+  while !t < 0.2 do
+    repeat := 10 * !repeat;
+    t := rpt_timer1 !repeat f x;
+  done;
+  if !t < 2.0 then begin
+    repeat := (int_of_float (10. *. (float !repeat) /. !t) + 1);
+    t := rpt_timer1 !repeat f x;
+  end;
+  !t /. (float !repeat)
+;;
+
+let timer f x =
+  let st = Sys.time () in
+  ignore (f x);
+  let en = Sys.time () in
+  (en -. st)
+;;
+
+let table1 limit f mkarg =
+  printf "  %10s  %9s  %9s  %9s  %9s  %9s\n" "n" "t1" "t2" "t3" "t4" "t5";
+  let sz = ref 49151 in
+  while !sz < int_of_float (2. ** float limit) do
+    begin try
+      printf "  %10d  " !sz; flush stdout;
+      for i = 0 to 4 do
+        let arg = mkarg !sz in
+        let t = timer f arg in
+        printf " %.2e   " t; flush stdout;
+      done;
+      printf "\n";
+    with e -> printf "*** %s\n" (Printexc.to_string e);
+    end;
+    flush stdout;
+    sz := 2 * !sz + 1;
+  done;
+;;
+
+let table2 limit f mkarg =
+  printf "  %10s  %9s  %9s  %9s  %9s  %9s\n"
+         " n" "t" "t/n" "t/nlogn" "t/nlog^2n" "t/n^2";
+  let sz = ref 49151 in
+  while float !sz < 2. ** float limit do
+    begin try
+      printf "  %10d   " !sz; flush stdout;
+      Gc.compact ();
+      let arg = mkarg !sz in
+      let t = timer f arg in
+      let n = float !sz in
+      let logn = log (float !sz) /. log 2. in
+      printf "%.2e   %.2e   %.2e   %.2e   %.2e\n"
+             t (t/.n) (t/.n/.logn) (t/.n/.logn/.logn) (t/.n/.n);
+    with e -> printf "*** %s\n" (Printexc.to_string e);
+    end;
+    flush stdout;
+    sz := 2 * !sz + 1;
+  done;
+;;
+
+let table3 limit f mkarg =
+  printf "  %10s  %9s  %9s  %9s  %9s  %9s\n" "n" "t1" "t2" "t3" "t4" "t5";
+  let sz = ref 2 in
+  while float !sz < 2. ** float limit do
+    begin try
+      printf "  %10d  " !sz; flush stdout;
+      for i = 0 to 4 do
+        let arg = mkarg !sz in
+        let t = rpt_timer f arg in
+        printf " %.2e   " t; flush stdout;
+      done;
+      printf "\n";
+    with e -> printf "*** %s\n" (Printexc.to_string e);
+    end;
+    flush stdout;
+    sz := 2 * !sz + 1;
+  done;
+;;
+
+(************************************************************************)
+
+(* benchmarks:
+   1a. random records, sorted with two keys
+   1b. random integers
+   1c. random floats
+
+   2a. integers, constant
+   2b. integers, already sorted
+   2c. integers, reverse sorted
+
+   only for short lists:
+   3a. random records, sorted with two keys
+   3b. random integers
+   3c. random floats
+*)
+let bench1a limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  random_reinit ();
+
+  printf "\n%s with random records [10]:\n" name;
+  let cmp = aux.prepf cmplex lelex in
+  table1 limit (f cmp) (fun n -> aux.prepd (mkrecs 10 n));
+;;
+
+let bench1b limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  random_reinit ();
+
+  printf "\n%s with random integers:\n" name;
+  let cmp = aux.prepf (-) (<=) in
+  table1 limit (f cmp) (fun n -> aux.prepd (mkrand_nodup n));
+;;
+
+let bench1c limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  random_reinit ();
+
+  printf "\n%s with random floats:\n" name;
+  let cmp = aux.prepf compare (<=) in
+  table1 limit (f cmp) (fun n -> aux.prepd (mkfloats n));
+;;
+
+let bench2 limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  printf "\n%s with constant integers:\n" name;
+  let cmp = aux.prepf compare (<=) in
+  table2 limit (f cmp) (fun n -> aux.prepd (mkconst n));
+
+  printf "\n%s with sorted integers:\n" name;
+  let cmp = aux.prepf compare (<=) in
+  table2 limit (f cmp) (fun n -> aux.prepd (mksorted n));
+
+  printf "\n%s with reverse-sorted integers:\n" name;
+  let cmp = aux.prepf compare (<=) in
+  table2 limit (f cmp) (fun n -> aux.prepd (mkrev n));
+;;
+
+let bench3a limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  random_reinit ();
+
+  printf "\n%s with random records [10]:\n" name;
+  let cmp = aux.prepf cmplex lelex in
+  table3 limit (f cmp) (fun n -> aux.prepd (mkrecs 10 n));
+;;
+
+let bench3b limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  random_reinit ();
+
+  printf "\n%s with random integers:\n" name;
+  let cmp = aux.prepf (-) (<=) in
+  table3 limit (f cmp) (fun n -> aux.prepd (mkrand_nodup n));
+;;
+
+let bench3c limit name f aux =
+
+  (* Don't do benchmarks with assertions enabled. *)
+  assert (not true);
+
+  random_reinit ();
+
+  printf "\n%s with random floats:\n" name;
+  let cmp = aux.prepf compare (<=) in
+  table3 limit (f cmp) (fun n -> aux.prepd (mkfloats n));
+;;
+\f
+(************************************************************************)
+(* merge sort on lists *)
+
+(* FIXME to do: cutoff
+         to do: cascader les pattern-matchings (enlever les paires)
+         to do: fermeture intermediaire pour merge
+*)
+let (@@) = List.rev_append;;
+
+let lmerge_1a cmp l =
+  let rec init accu = function
+    | [] -> accu
+    | e::rest -> init ([e] :: accu) rest
+  in
+  let rec merge rest accu2 accu l1 l2 = (* l1,l2,rest are forward;
+                                           accu,accu2 are rev *)
+    match l1, l2 with
+    | []    , _      -> mergepairs ((l2 @@ accu)::accu2) rest
+    | _     , []     -> mergepairs ((l1 @@ accu)::accu2) rest
+    | h1::t1, h2::t2 -> if cmp h1 h2 <= 0
+                        then merge rest accu2 (h1::accu) t1 l2
+                        else merge rest accu2 (h2::accu) l1 t2
+  and merge_rev rest accu2 accu l1 l2 = (* accu, accu2 are forward;
+                                           l1,l2,rest are rev *)
+    match l1, l2 with
+    | []    , _      -> mergepairs_rev ((l2 @@ accu)::accu2) rest
+    | _     , []     -> mergepairs_rev ((l1 @@ accu)::accu2) rest
+    | h1::t1, h2::t2 -> if cmp h2 h1 <= 0
+                        then merge_rev rest accu2 (h1::accu) t1 l2
+                        else merge_rev rest accu2 (h2::accu) l1 t2
+  and mergepairs accu = function       (* accu is rev, arg is forward *)
+    | [] -> mergeall_rev accu
+    | [l] -> mergeall_rev ((List.rev l)::accu)
+    | l1::l2::rest -> merge rest accu [] l1 l2
+  and mergepairs_rev accu = function   (* accu is forward, arg is rev *)
+    | [] -> mergeall accu
+    | [l] -> mergeall ((List.rev l)::accu)
+    | l1::l2::rest -> merge_rev rest accu [] l1 l2
+  and mergeall = function              (* arg is forward *)
+    | [] -> []
+    | [l] -> l
+    | llist -> mergepairs [] llist
+  and mergeall_rev = function          (* arg is rev *)
+    | [] -> []
+    | [l] -> List.rev l
+    | llist -> mergepairs_rev [] llist
+  in
+  mergeall_rev (init [] l)
+;;
+\f
+let lmerge_1b cmp l =
+  let rec init accu = function
+    | [] -> accu
+    | [e] -> [e] :: accu
+    | e1::e2::rest ->
+        init ((if cmp e1 e2 <= 0 then [e2;e1] else [e1;e2])::accu) rest
+  in
+  let rec merge rest accu2 accu l1 l2 = (* l1,l2,rest are forward;
+                                           accu,accu2 are rev *)
+    match l1, l2 with
+    | []    , _      -> mergepairs ((l2 @@ accu)::accu2) rest
+    | _     , []     -> mergepairs ((l1 @@ accu)::accu2) rest
+    | h1::t1, h2::t2 -> if cmp h1 h2 <= 0
+                        then merge rest accu2 (h1::accu) t1 l2
+                        else merge rest accu2 (h2::accu) l1 t2
+  and merge_rev rest accu2 accu l1 l2 = (* accu, accu2 are forward;
+                                           l1,l2,rest are rev *)
+    match l1, l2 with
+    | []    , _      -> mergepairs_rev ((l2 @@ accu)::accu2) rest
+    | _     , []     -> mergepairs_rev ((l1 @@ accu)::accu2) rest
+    | h1::t1, h2::t2 -> if cmp h2 h1 <= 0
+                        then merge_rev rest accu2 (h1::accu) t1 l2
+                        else merge_rev rest accu2 (h2::accu) l1 t2
+  and mergepairs accu = function       (* accu is rev, arg is forward *)
+    | [] -> mergeall_rev accu
+    | [l] -> mergeall_rev ((List.rev l)::accu)
+    | l1::l2::rest -> merge rest accu [] l1 l2
+  and mergepairs_rev accu = function   (* accu is forward, arg is rev *)
+    | [] -> mergeall accu
+    | [l] -> mergeall ((List.rev l)::accu)
+    | l1::l2::rest -> merge_rev rest accu [] l1 l2
+  and mergeall = function              (* arg is forward *)
+    | [] -> []
+    | [l] -> l
+    | llist -> mergepairs [] llist
+  and mergeall_rev = function          (* arg is rev *)
+    | [] -> []
+    | [l] -> List.rev l
+    | llist -> mergepairs_rev [] llist
+  in
+  mergeall_rev (init [] l)
+;;
+\f
+let lmerge_1c cmp l =
+  let rec init accu = function
+    | [] -> accu
+    | [e] -> [e] :: accu
+    | e1::e2::rest ->
+        init ((if cmp e1 e2 <= 0 then [e2;e1] else [e1;e2])::accu) rest
+  in
+  let rec merge rest accu2 accu l1 l2 = (* l1,l2,rest are forward;
+                                           accu,accu2 are rev *)
+    match l1 with
+    | [] -> mergepairs ((l2 @@ accu)::accu2) rest
+    | h1::t1 ->
+       match l2 with
+       | []     -> mergepairs ((l1 @@ accu)::accu2) rest
+       | h2::t2 -> if cmp h1 h2 <= 0
+                   then merge rest accu2 (h1::accu) t1 l2
+                   else merge rest accu2 (h2::accu) l1 t2
+  and merge_rev rest accu2 accu l1 l2 = (* accu, accu2 are forward;
+                                           l1,l2,rest are rev *)
+    match l1 with
+    | [] -> mergepairs_rev ((l2 @@ accu)::accu2) rest
+    | h1::t1 ->
+       match l2 with
+       | []     -> mergepairs_rev ((l1 @@ accu)::accu2) rest
+       | h2::t2 -> if cmp h2 h1 <= 0
+                   then merge_rev rest accu2 (h1::accu) t1 l2
+                   else merge_rev rest accu2 (h2::accu) l1 t2
+  and mergepairs accu = function       (* accu is rev, arg is forward *)
+    | [] -> mergeall_rev accu
+    | [l] -> mergeall_rev ((List.rev l)::accu)
+    | l1::l2::rest -> merge rest accu [] l1 l2
+  and mergepairs_rev accu = function   (* accu is forward, arg is rev *)
+    | [] -> mergeall accu
+    | [l] -> mergeall ((List.rev l)::accu)
+    | l1::l2::rest -> merge_rev rest accu [] l1 l2
+  and mergeall = function              (* arg is forward *)
+    | [] -> []
+    | [l] -> l
+    | llist -> mergepairs [] llist
+  and mergeall_rev = function          (* arg is rev *)
+    | [] -> []
+    | [l] -> List.rev l
+    | llist -> mergepairs_rev [] llist
+  in
+  mergeall_rev (init [] l)
+;;
+\f
+let lmerge_1d cmp l =
+  let rec init accu = function
+    | [] -> accu
+    | [e] -> [e] :: accu
+    | e1::e2::rest ->
+        init ((if cmp e1 e2 <= 0 then [e2;e1] else [e1;e2])::accu) rest
+  in
+  let rec merge rest accu2 accu l1 l2 = (* l1,l2,rest are forward;
+                                           accu,accu2 are rev *)
+    let merge_rest_accu2 accu l1 l2 =
+      match l1 with
+      | [] -> mergepairs ((l2 @@ accu)::accu2) rest
+      | h1::t1 ->
+         match l2 with
+         | []     -> mergepairs ((l1 @@ accu)::accu2) rest
+         | h2::t2 -> if cmp h1 h2 <= 0
+                     then merge rest accu2 (h1::accu) t1 l2
+                     else merge rest accu2 (h2::accu) l1 t2
+    in merge_rest_accu2 accu l1 l2
+  and merge_rev rest accu2 accu l1 l2 = (* accu, accu2 are forward;
+                                           l1,l2,rest are rev *)
+    let merge_rev_rest_accu2 accu l1 l2 =
+      match l1 with
+      | [] -> mergepairs_rev ((l2 @@ accu)::accu2) rest
+      | h1::t1 ->
+         match l2 with
+         | []     -> mergepairs_rev ((l1 @@ accu)::accu2) rest
+         | h2::t2 -> if cmp h2 h1 <= 0
+                     then merge_rev rest accu2 (h1::accu) t1 l2
+                     else merge_rev rest accu2 (h2::accu) l1 t2
+    in merge_rev_rest_accu2 accu l1 l2
+  and mergepairs accu = function       (* accu is rev, arg is forward *)
+    | [] -> mergeall_rev accu
+    | [l] -> mergeall_rev ((List.rev l)::accu)
+    | l1::l2::rest -> merge rest accu [] l1 l2
+  and mergepairs_rev accu = function   (* accu is forward, arg is rev *)
+    | [] -> mergeall accu
+    | [l] -> mergeall ((List.rev l)::accu)
+    | l1::l2::rest -> merge_rev rest accu [] l1 l2
+  and mergeall = function              (* arg is forward *)
+    | [] -> []
+    | [l] -> l
+    | llist -> mergepairs [] llist
+  and mergeall_rev = function          (* arg is rev *)
+    | [] -> []
+    | [l] -> List.rev l
+    | llist -> mergepairs_rev [] llist
+  in
+  mergeall_rev (init [] l)
+;;
+\f
+(************************************************************************)
+(* merge sort on lists, user-contributed (NOT STABLE) *)
+
+(* BEGIN code contributed by Yann Coscoy *)
+
+  let rec rev_merge_append order l1 l2 acc =
+    match l1 with
+      [] ->  List.rev_append l2 acc
+    | h1 :: t1 ->
+        match l2 with
+          [] -> List.rev_append l1 acc
+        | h2 :: t2 ->
+            if order h1 h2
+            then  rev_merge_append order t1 l2 (h1::acc)
+            else  rev_merge_append order l1 t2 (h2::acc)
+
+  let rev_merge order l1 l2 = rev_merge_append order l1 l2 []
+
+  let rec rev_merge_append' order l1 l2 acc =
+    match l1 with
+    | [] ->  List.rev_append l2 acc
+    | h1 :: t1 ->
+        match l2 with
+          | [] -> List.rev_append l1 acc
+          | h2 :: t2 ->
+              if order h2 h1
+              then  rev_merge_append' order t1 l2 (h1::acc)
+              else  rev_merge_append' order l1 t2 (h2::acc)
+
+  let rev_merge' order l1 l2 = rev_merge_append' order l1 l2 []
+
+  let lmerge_3 order l =
+    let rec initlist l acc = match l with
+      | e1::e2::rest ->
+          initlist rest
+           ((if order e1 e2 then [e1;e2] else [e2;e1])::acc)
+      | [e] -> [e]::acc
+      | [] -> acc
+    in
+    let rec merge2 ll acc  = match ll with
+      | [] -> acc
+      | [l] -> [List.rev l]@acc
+      | l1::l2::rest ->
+          merge2 rest (rev_merge order l1 l2::acc)
+    in
+    let rec merge2' ll acc  = match ll with
+      | [] -> acc
+      | [l] -> [List.rev l]@acc
+      | l1::l2::rest ->
+          merge2' rest (rev_merge' order l1 l2::acc)
+    in
+    let rec mergeall rev = function
+      | [] -> []
+      | [l] -> if rev then List.rev l else l
+      | llist ->
+          mergeall
+          (not rev) ((if rev then merge2' else merge2) llist [])
+    in
+    mergeall false (initlist l [])
+
+(* END code contributed by Yann Coscoy *)
+\f
+(************************************************************************)
+(* merge sort on short lists, Francois Pottier *)
+
+(* BEGIN code contributed by Francois Pottier *)
+
+  (* [chop k l] returns the list [l] deprived of its [k] first
+     elements. The length of the list [l] must be [k] at least. *)
+
+  let rec chop k l =
+    match k, l with
+    | 0, _ -> l
+    | _, x :: l -> chop (k-1) l
+    | _, _ -> assert false
+  ;;
+
+  let rec merge order l1 l2 =
+    match l1 with
+      [] -> l2
+    | h1 :: t1 ->
+        match l2 with
+          [] -> l1
+        | h2 :: t2 ->
+            if order h1 h2
+            then h1 :: merge order t1 l2
+            else h2 :: merge order l1 t2
+  ;;
+
+  let rec lmerge_4a order l =
+    match l with
+    | []
+    | [ _ ] -> l
+    | _ ->
+        let rec sort k l = (* k > 1 *)
+          match k, l with
+          | 2, x1 :: x2 :: _ ->
+              if order x1 x2 then [ x1; x2 ] else [ x2; x1 ]
+          | 3, x1 :: x2 :: x3 :: _ ->
+              if order x1 x2 then
+                if order x2 x3 then
+                  [ x1 ; x2 ; x3 ]
+                else
+                  if order x1 x3 then [ x1 ; x3 ; x2 ] else [ x3; x1; x2 ]
+              else
+                if order x1 x3 then
+                  [ x2; x1; x3 ]
+                else
+                  if order x2 x3 then [ x2; x3; x1 ] else [ x3; x2; x1 ]
+          | _, _ ->
+              let k1 = k / 2 in
+              let k2 = k - k1 in
+              merge order (sort k1 l) (sort k2 (chop k1 l))
+        in
+        sort (List.length l) l
+  ;;
+(* END code contributed by Francois Pottier *)
+\f
+(************************************************************************)
+(* merge sort on short lists, Francois Pottier,
+   adapted to new-style interface *)
+
+(* BEGIN code contributed by Francois Pottier *)
+
+  (* [chop k l] returns the list [l] deprived of its [k] first
+     elements. The length of the list [l] must be [k] at least. *)
+
+  let rec chop k l =
+    match k, l with
+    | 0, _ -> l
+    | _, x :: l -> chop (k-1) l
+    | _, _ -> assert false
+  ;;
+
+  let rec merge order l1 l2 =
+    match l1 with
+      [] -> l2
+    | h1 :: t1 ->
+        match l2 with
+          [] -> l1
+        | h2 :: t2 ->
+            if order h1 h2 <= 0
+            then h1 :: merge order t1 l2
+            else h2 :: merge order l1 t2
+  ;;
+
+  let rec lmerge_4b order l =
+    match l with
+    | []
+    | [ _ ] -> l
+    | _ ->
+        let rec sort k l = (* k > 1 *)
+          match k, l with
+          | 2, x1 :: x2 :: _ ->
+              if order x1 x2 <= 0 then [ x1; x2 ] else [ x2; x1 ]
+          | 3, x1 :: x2 :: x3 :: _ ->
+              if order x1 x2 <= 0 then
+                if order x2 x3 <= 0 then
+                  [ x1 ; x2 ; x3 ]
+                else
+                  if order x1 x3 <= 0 then [ x1 ; x3 ; x2 ] else [ x3; x1; x2 ]
+              else
+                if order x1 x3 <= 0 then
+                  [ x2; x1; x3 ]
+                else
+                  if order x2 x3 <= 0 then [ x2; x3; x1 ] else [ x3; x2; x1 ]
+          | _, _ ->
+              let k1 = k / 2 in
+              let k2 = k - k1 in
+              merge order (sort k1 l) (sort k2 (chop k1 l))
+        in
+        sort (List.length l) l
+  ;;
+(* END code contributed by Francois Pottier *)
+\f
+(************************************************************************)
+(* merge sort on short lists a la Pottier, modified merge *)
+
+let rec chop k l =
+  if k = 0 then l else begin
+    match l with
+    | x::t -> chop (k-1) t
+    | _ -> assert false
+  end
+;;
+
+let lmerge_4c cmp l =
+  let rec merge1 h1 t1 l2 =
+    match l2 with
+    | [] -> h1 :: t1
+    | h2 :: t2 ->
+        if cmp h1 h2 <= 0
+        then h1 :: (merge2 t1 h2 t2)
+        else h2 :: (merge1 h1 t1 t2)
+  and merge2 l1 h2 t2 =
+    match l1 with
+    | [] -> h2 :: t2
+    | h1 :: t1 ->
+        if cmp h1 h2 <= 0
+        then h1 :: (merge2 t1 h2 t2)
+        else h2 :: (merge1 h1 t1 t2)
+  in
+  let merge l1 = function
+    | [] -> l1
+    | h2 :: t2 -> merge2 l1 h2 t2
+  in
+  let rec sort n l =
+    match n, l with
+    | 2, x1 :: x2 :: _ ->
+       if cmp x1 x2 <= 0 then [x1; x2] else [x2; x1]
+    | 3, x1 :: x2 :: x3 :: _ ->
+       if cmp x1 x2 <= 0 then begin
+         if cmp x2 x3 <= 0 then [x1; x2; x3]
+         else if cmp x1 x3 <= 0 then [x1; x3; x2]
+         else [x3; x1; x2]
+       end else begin
+         if cmp x1 x3 <= 0 then [x2; x1; x3]
+         else if cmp x2 x3 <= 0 then [x2; x3; x1]
+         else [x3; x2; x1]
+       end
+    | n, l ->
+       let n1 = n asr 1 in
+       let n2 = n - n1 in
+       merge (sort n1 l) (sort n2 (chop n1 l))
+  in
+  let len = List.length l in
+  if len < 2 then l else sort len l
+;;
+\f
+(************************************************************************)
+(* merge sort on short lists a la Pottier, logarithmic stack space *)
+
+let rec chop k l =
+  if k = 0 then l else begin
+    match l with
+    | x::t -> chop (k-1) t
+    | _ -> assert false
+  end
+;;
+
+let lmerge_4d cmp l =
+  let rec rev_merge l1 l2 accu =
+    match l1, l2 with
+    | [], l2 -> l2 @@ accu
+    | l1, [] -> l1 @@ accu
+    | h1::t1, h2::t2 ->
+        if cmp h1 h2 <= 0
+        then rev_merge t1 l2 (h1::accu)
+        else rev_merge l1 t2 (h2::accu)
+  in
+  let rec rev_merge_rev l1 l2 accu =
+    match l1, l2 with
+    | [], l2 -> l2 @@ accu
+    | l1, [] -> l1 @@ accu
+    | h1::t1, h2::t2 ->
+        if cmp h1 h2 > 0
+        then rev_merge_rev t1 l2 (h1::accu)
+        else rev_merge_rev l1 t2 (h2::accu)
+  in
+  let rec sort n l =
+    match n, l with
+    | 2, x1 :: x2 :: _ ->
+       if cmp x1 x2 <= 0 then [x1; x2] else [x2; x1]
+    | 3, x1 :: x2 :: x3 :: _ ->
+       if cmp x1 x2 <= 0 then begin
+         if cmp x2 x3 <= 0 then [x1; x2; x3]
+         else if cmp x1 x3 <= 0 then [x1; x3; x2]
+         else [x3; x1; x2]
+       end else begin
+         if cmp x1 x3 <= 0 then [x2; x1; x3]
+         else if cmp x2 x3 <= 0 then [x2; x3; x1]
+         else [x3; x2; x1]
+       end
+    | n, l ->
+       let n1 = n asr 1 in
+       let n2 = n - n1 in
+       rev_merge_rev (rev_sort n1 l) (rev_sort n2 (chop n1 l)) []
+  and rev_sort n l =
+    match n, l with
+    | 2, x1 :: x2 :: _ ->
+       if cmp x1 x2 > 0 then [x1; x2] else [x2; x1]
+    | 3, x1 :: x2 :: x3 :: _ ->
+       if cmp x1 x2 > 0 then begin
+         if cmp x2 x3 > 0 then [x1; x2; x3]
+         else if cmp x1 x3 > 0 then [x1; x3; x2]
+         else [x3; x1; x2]
+       end else begin
+         if cmp x1 x3 > 0 then [x2; x1; x3]
+         else if cmp x2 x3 > 0 then [x2; x3; x1]
+         else [x3; x2; x1]
+       end
+    | n, l ->
+       let n1 = n asr 1 in
+       let n2 = n - n1 in
+       rev_merge (sort n1 l) (sort n2 (chop n1 l)) []
+  in
+  let len = List.length l in
+  if len < 2 then l else sort len l
+;;
+
+\f
+(************************************************************************)
+(* merge sort on short lists a la Pottier, logarithmic stack space,
+   in place: input list is freed as the output is being computed. *)
+
+let rec chop k l =
+  if k = 0 then l else begin
+    match l with
+    | x::t -> chop (k-1) t
+    | _ -> assert false
+  end
+;;
+
+let lmerge_4e cmp l =
+  let rec rev_merge l1 l2 accu =
+    match l1, l2 with
+    | [], l2 -> l2 @@ accu
+    | l1, [] -> l1 @@ accu
+    | h1::t1, h2::t2 ->
+        if cmp h1 h2 <= 0
+        then rev_merge t1 l2 (h1::accu)
+        else rev_merge l1 t2 (h2::accu)
+  in
+  let rec rev_merge_rev l1 l2 accu =
+    match l1, l2 with
+    | [], l2 -> l2 @@ accu
+    | l1, [] -> l1 @@ accu
+    | h1::t1, h2::t2 ->
+        if cmp h1 h2 > 0
+        then rev_merge_rev t1 l2 (h1::accu)
+        else rev_merge_rev l1 t2 (h2::accu)
+  in
+  let rec sort n l =
+    match n, l with
+    | 2, x1 :: x2 :: _ ->
+       if cmp x1 x2 <= 0 then [x1; x2] else [x2; x1]
+    | 3, x1 :: x2 :: x3 :: _ ->
+       if cmp x1 x2 <= 0 then begin
+         if cmp x2 x3 <= 0 then [x1; x2; x3]
+         else if cmp x1 x3 <= 0 then [x1; x3; x2]
+         else [x3; x1; x2]
+       end else begin
+         if cmp x1 x3 <= 0 then [x2; x1; x3]
+         else if cmp x2 x3 <= 0 then [x2; x3; x1]
+         else [x3; x2; x1]
+       end
+    | n, l ->
+       let n1 = n asr 1 in
+       let n2 = n - n1 in
+       let l2 = chop n1 l in
+       let s1 = rev_sort n1 l in
+       let s2 = rev_sort n2 l2 in
+       rev_merge_rev s1 s2 []
+  and rev_sort n l =
+    match n, l with
+    | 2, x1 :: x2 :: _ ->
+       if cmp x1 x2 > 0 then [x1; x2] else [x2; x1]
+    | 3, x1 :: x2 :: x3 :: _ ->
+       if cmp x1 x2 > 0 then begin
+         if cmp x2 x3 > 0 then [x1; x2; x3]
+         else if cmp x1 x3 > 0 then [x1; x3; x2]
+         else [x3; x1; x2]
+       end else begin
+         if cmp x1 x3 > 0 then [x2; x1; x3]
+         else if cmp x2 x3 > 0 then [x2; x3; x1]
+         else [x3; x2; x1]
+       end
+    | n, l ->
+       let n1 = n asr 1 in
+       let n2 = n - n1 in
+       let l2 = chop n1 l in
+       let s1 = sort n1 l in
+       let s2 = sort n2 l2 in
+       rev_merge s1 s2 []
+  in
+  let len = List.length l in
+  if len < 2 then l else sort len l
+;;
+\f
+(************************************************************************)
+(* chop-free version of Pottier's code, binary version *)
+
+let rec merge cmp l1 l2 =
+  match l1, l2 with
+  | [], l2 -> l2
+  | l1, [] -> l1
+  | h1 :: t1, h2 :: t2 ->
+      if cmp h1 h2 <= 0
+      then h1 :: merge cmp t1 l2
+      else h2 :: merge cmp l1 t2
+;;
+
+let lmerge_5a cmp l =
+  let rem = ref l in
+  let rec sort_prefix n =
+    if n <= 1 then begin
+      match !rem with
+      | [] -> []
+      | [x] as l -> rem := []; l
+      | x::y::t -> rem := t; if cmp x y <= 0 then [x;y] else [y;x]
+    end else if !rem = [] then []
+    else begin
+      let l1 = sort_prefix (n-1) in
+      let l2 = sort_prefix (n-1) in
+      merge cmp l1 l2
+    end
+  in
+  let len = ref (List.length l) in
+  let i = ref 0 in
+  while !len > 0 do incr i; len := !len lsr 1; done;
+  sort_prefix !i
+;;
+\f
+(************************************************************************)
+(* chop-free version of Pottier's code, dichotomic version,
+   ground cases 1 & 2 *)
+
+let rec merge cmp l1 l2 =
+  match l1, l2 with
+  | [], l2 -> l2
+  | l1, [] -> l1
+  | h1 :: t1, h2 :: t2 ->
+      if cmp h1 h2 <= 0
+      then h1 :: merge cmp t1 l2
+      else h2 :: merge cmp l1 t2
+;;
+
+let lmerge_5b cmp l =
+  let rem = ref l in
+  let rec sort_prefix n =
+    match n, !rem with
+    | 1, x::t -> rem := t; [x]
+    | 2, x::y::t -> rem := t; if cmp x y <= 0 then [x;y] else [y;x]
+    | n, _ ->
+       let n1 = n/2 in
+       let n2 = n - n1 in
+       let l1 = sort_prefix n1 in
+       let l2 = sort_prefix n2 in
+       merge cmp l1 l2
+  in
+  let len = List.length l in
+  if len <= 1 then l else sort_prefix len
+;;
+\f
+(************************************************************************)
+(* chop-free version of Pottier's code, dichotomic version,
+   ground cases 2 & 3 *)
+
+let rec merge cmp l1 l2 =
+  match l1, l2 with
+  | [], l2 -> l2
+  | l1, [] -> l1
+  | h1 :: t1, h2 :: t2 ->
+      if cmp h1 h2 <= 0
+      then h1 :: merge cmp t1 l2
+      else h2 :: merge cmp l1 t2
+;;
+
+let lmerge_5c cmp l =
+  let rem = ref l in
+  let rec sort_prefix n =
+    match n, !rem with
+    | 2, x::y::t -> rem := t; if cmp x y <= 0 then [x;y] else [y;x]
+    | 3, x::y::z::t ->
+       rem := t;
+       if cmp x y <= 0 then
+         if cmp y z <= 0 then [x; y; z]
+         else if cmp x z <= 0 then [x; z; y]
+         else [z; x; y]
+       else
+         if cmp x z <= 0 then [y; x; z]
+         else if cmp y z <= 0 then [y; z; x]
+         else [z; y; x]
+    | n, _ ->
+       let n1 = n/2 in
+       let n2 = n - n1 in
+       let l1 = sort_prefix n1 in
+       let l2 = sort_prefix n2 in
+       merge cmp l1 l2
+  in
+  let len = List.length l in
+  if len <= 1 then l else sort_prefix len
+;;
+\f
+(************************************************************************)
+(* chop-free, ref-free version of Pottier's code, dichotomic version,
+   ground cases 2 & 3, modified merge *)
+
+let lmerge_5d cmp l =
+  let rec merge1 h1 t1 l2 =
+    match l2 with
+    | [] -> h1::t1
+    | h2 :: t2 ->
+        if cmp h1 h2 <= 0
+        then h1 :: merge2 t1 h2 t2
+        else h2 :: merge1 h1 t1 t2
+  and merge2 l1 h2 t2 =
+    match l1 with
+    | [] -> h2::t2
+    | h1 :: t1 ->
+        if cmp h1 h2 <= 0
+        then h1 :: merge2 t1 h2 t2
+        else h2 :: merge1 h1 t1 t2
+  in
+  let rec sort_prefix n l =
+    match n, l with
+    | 2, x::y::t -> ((if cmp x y <= 0 then [x;y] else [y;x]), t)
+    | 3, x::y::z::t ->
+       ((if cmp x y <= 0 then
+           if cmp y z <= 0 then [x; y; z]
+           else if cmp x z <= 0 then [x; z; y]
+           else [z; x; y]
+         else
+           if cmp x z <= 0 then [y; x; z]
+           else if cmp y z <= 0 then [y; z; x]
+           else [z; y; x]),
+        t)
+    | n, _ ->
+       let n1 = n/2 in
+       let n2 = n - n1 in
+       let (l1, rest1) = sort_prefix n1 l in
+       match sort_prefix n2 rest1 with
+       | (h2::t2, rest2) -> ((merge2 l1 h2 t2), rest2)
+       | _ -> assert false
+  in
+  let len = List.length l in
+  if len <= 1 then l else fst (sort_prefix len l)
+;;
+\f
+(************************************************************************)
+(* merge sort on arrays, merge with tail-rec function *)
+
+let amerge_1a cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let rec sortto srcofs dst dstofs len =
+    assert (len > 0);
+    if len = 1 then dst.(dstofs) <- a.(srcofs)
+    else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= 1 then ()
+  else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let amerge_1b cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let rec sortto srcofs dst dstofs len =
+    assert (len > 0);
+    if len = 1 then dst.(dstofs) <- a.(srcofs)
+    else if len = 2 then begin
+      if cmp a.(srcofs) a.(srcofs+1) <= 0 then begin
+        dst.(dstofs) <- a.(srcofs);
+        dst.(dstofs+1) <- a.(srcofs+1);
+      end else begin
+        dst.(dstofs) <- a.(srcofs+1);
+        dst.(dstofs+1) <- a.(srcofs);
+      end;
+    end else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= 1 then ()
+  else if l = 2 then begin
+    if cmp a.(0) a.(1) > 0 then begin
+      let e = a.(0) in
+      a.(0) <- a.(1);
+      a.(1) <- e;
+    end;
+  end else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 3;;
+let amerge_1c cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 4;;
+let amerge_1d cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 5;;
+let amerge_1e cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 6;;
+let amerge_1f cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 7;;
+let amerge_1g cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 8;;
+let amerge_1h cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 9;;
+let amerge_1i cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 10;;
+let amerge_1j cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
+    let rec loop i1 s1 i2 s2 d =
+      if cmp s1 s2 <= 0 then begin
+        dst.(d) <- s1;
+        let i1 = i1 + 1 in
+        if i1 < src1r then
+          loop i1 a.(i1) i2 s2 (d + 1)
+        else
+          Array.blit src2 i2 dst (d + 1) (src2r - i2)
+      end else begin
+        dst.(d) <- s2;
+        let i2 = i2 + 1 in
+        if i2 < src2r then
+          loop i1 s1 i2 src2.(i2) (d + 1)
+        else
+          Array.blit a i1 dst (d + 1) (src1r - i1)
+      end
+    in loop src1ofs a.(src1ofs) src2ofs src2.(src2ofs) dstofs;
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len - 1 do
+      let e = a.(srcofs + i) in
+      let j = ref (dstofs + i - 1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs + l1) dst (dstofs + l1) l2;
+      sortto srcofs a (srcofs + l2) l1;
+      merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;
+    end;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+(* FIXME a essayer: *)
+(* list->array->list direct et array->list->array direct *)
+(* overhead = 1/3, 1/4, etc. *)
+(* overhead = sqrt (n) *)
+(* overhead = n/3 jusqu'a 30k, 30k jusqu'a 900M, sqrt (n) au-dela *)
+\f
+(************************************************************************)
+(* merge sort on arrays, merge with loop *)
+
+(* cutoff = 1 *)
+let amerge_3a cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let rec sortto srcofs dst dstofs len =
+    assert (len > 0);
+    if len = 1 then dst.(dstofs) <- a.(srcofs) else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= 1 then () else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let amerge_3b cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let rec sortto srcofs dst dstofs len =
+    assert (len > 0);
+    if len = 1 then dst.(dstofs) <- a.(srcofs)
+    else if len = 2 then begin
+      if cmp a.(srcofs) a.(srcofs+1) <= 0 then begin
+        dst.(dstofs) <- a.(srcofs);
+        dst.(dstofs+1) <- a.(srcofs+1);
+      end else begin
+        dst.(dstofs) <- a.(srcofs+1);
+        dst.(dstofs+1) <- a.(srcofs);
+      end
+    end else begin
+      let l1 = len / 2 in
+      let l2 = len - l1 in
+      sortto (srcofs+l1) dst (dstofs+l1) l2;
+      sortto srcofs a (srcofs+l2) l1;
+      merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+    end
+  in
+  let l = Array.length a in
+  if l <= 1 then ()
+  else if l = 2 then begin
+    if cmp a.(0) a.(1) > 0 then begin
+      let e = a.(0) in
+      a.(0) <- a.(1);
+      a.(1) <- e;
+    end;
+  end else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 3;;
+let amerge_3c cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 4;;
+let amerge_3d cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 5;;
+let amerge_3e cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 6;;
+let amerge_3f cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 7;;
+let amerge_3g cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 8;;
+let amerge_3h cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 9;;
+let amerge_3i cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+\f
+let cutoff = 10;;
+let amerge_3j cmp a =
+  let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
+    let i1 = ref src1ofs
+    and i2 = ref src2ofs
+    and d = ref dstofs
+    and src1r = src1ofs + src1len
+    and src2r = src2ofs + src2len
+    in
+    while !i1 < src1r && !i2 < src2r do
+      let s1 = a.(!i1) and s2 = src2.(!i2) in
+      if cmp s1 s2 <= 0 then begin
+        dst.(!d) <- s1;
+        incr i1;
+      end else begin
+        dst.(!d) <- s2;
+        incr i2;
+      end;
+      incr d;
+    done;
+    if !i1 < src1r then
+      Array.blit a !i1 dst !d (src1r - !i1)
+    else
+      Array.blit src2 !i2 dst !d (src2r - !i2)
+  in
+  let isortto srcofs dst dstofs len =
+    for i = 0 to len-1 do
+      let e = a.(srcofs+i) in
+      let j = ref (dstofs+i-1) in
+      while (!j >= dstofs && cmp dst.(!j) e > 0) do
+        dst.(!j + 1) <- dst.(!j);
+        decr j;
+      done;
+      dst.(!j + 1) <- e;
+    done;
+  in
+  let rec sortto srcofs dst dstofs len =
+    if len <= cutoff then isortto srcofs dst dstofs len else
+    let l1 = len / 2 in
+    let l2 = len - l1 in
+    sortto (srcofs+l1) dst (dstofs+l1) l2;
+    sortto srcofs a (srcofs+l2) l1;
+    merge (srcofs+l2) l1 dst (dstofs+l1) l2 dst dstofs;
+  in
+  let l = Array.length a in
+  if l <= cutoff then isortto 0 a 0 l else begin
+    let l1 = l / 2 in
+    let l2 = l - l1 in
+    let t = Array.make l2 a.(0) in
+    sortto l1 t 0 l2;
+    sortto 0 a l2 l1;
+    merge l2 l1 t 0 l2 a 0;
+  end;
+;;
+
+(* FIXME essayer bottom-up merge on arrays ? *)
+\f
+(************************************************************************)
+(* Shell sort on arrays *)
+
+let ashell_1 cmp a =
+  let l = Array.length a in
+  let step = ref 1 in
+  while !step < l do step := !step * 3 + 1; done;
+  step := !step / 3;
+  while !step > 0 do
+    for j = !step to l-1 do
+      let e = a.(j) in
+      let k = ref (j - !step) in
+      let k1 = ref j in
+      while !k >= 0 && cmp a.(!k) e > 0 do
+        a.(!k1) <- a.(!k);
+        k1 := !k;
+        k := !k - !step;
+      done;
+      a.(!k1) <- e;
+    done;
+    step := !step / 3;
+  done;
+;;
+\f
+let ashell_2 cmp a =
+  let l = Array.length a in
+  let step = ref 1 in
+  while !step < l do step := !step * 3 + 1; done;
+  step := !step / 3;
+  while !step > 0 do
+    for j = !step to l-1 do
+      let e = a.(j) in
+      let k = ref (j - !step) in
+      while !k >= 0 && cmp a.(!k) e > 0 do
+        a.(!k + !step) <- a.(!k);
+        k := !k - !step;
+      done;
+      a.(!k + !step) <- e;
+    done;
+    step := !step / 3;
+  done;
+;;
+\f
+let ashell_3 cmp a =
+  let l = Array.length a in
+  let step = ref 1 in
+  while !step < l do step := !step * 3 + 1; done;
+  step := !step / 3;
+  while !step > 0 do
+    for i = 0 to !step - 1 do
+      let j = ref (i + !step) in
+      while !j < l do
+        let e = ref a.(!j) in
+        let k = ref (!j - !step) in
+        if cmp !e a.(i) < 0 then begin
+          let x = !e in e := a.(i); a.(i) <- x;
+        end;
+        while cmp a.(!k) !e > 0 do
+          a.(!k + !step) <- a.(!k);
+          k := !k - !step;
+        done;
+        a.(!k + !step) <- !e;
+        j := !j + !step;
+      done;
+    done;
+    step := !step / 3;
+  done;
+;;
+\f
+let force = Lazy.force;;
+
+type iilist = Cons of int * iilist Lazy.t;;
+
+let rec mult n (Cons (x,l)) = Cons (n*x, lazy (mult n (force l)))
+
+let rec merge (Cons (x1, t1) as l1) (Cons (x2, t2) as l2) =
+  if x1 = x2 then Cons (x1, lazy (merge (force t1) (force t2)))
+  else if x1 < x2 then Cons (x1, lazy (merge (force t1) l2))
+  else Cons (x2, lazy (merge l1 (force t2)))
+;;
+
+let rec scale = Cons (1, lazy (merge (mult 2 scale) (mult 3 scale)));;
+
+let ashell_4 cmp a =
+  let l = Array.length a in
+  let rec loop1 accu (Cons (x, t)) =
+    if x > l then accu else loop1 (x::accu) (force t)
+  in
+  let sc = loop1 [] scale in
+  let rec loop2 = function
+    | [] -> ()
+    | step::t ->
+      for i = 0 to step - 1 do
+        let j = ref (i + step) in
+        while !j < l do
+          let e = a.(!j) in
+          let k = ref (!j - step) in
+          while !k >= 0 && cmp a.(!k) e > 0 do
+            a.(!k + step) <- a.(!k);
+            k := !k - step;
+          done;
+          a.(!k + step) <- e;
+          j := !j + step;
+        done;
+      done;
+      loop2 t;
+  in
+  loop2 sc;
+;;
+\f
+(************************************************************************)
+(* Quicksort on arrays *)
+let cutoff = 1;;
+let aquick_1a cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 2;;
+let aquick_1b cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 3;;
+let aquick_1c cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 4;;
+let aquick_1d cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 5;;
+let aquick_1e cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 6;;
+let aquick_1f cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 7;;
+let aquick_1g cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref (r - 1) in
+    while !p2 <= !p3 do
+      let e = a.(!p3) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+      end else if c < 0 then begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        a.(!p3) <- a.(!p2);
+        a.(!p2) <- e;
+        incr p2;
+      end;
+    done;
+    incr p3;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 1 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 1;;
+let aquick_2a cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 2;;
+let aquick_2b cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 3;;
+let aquick_2c cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 4;;
+let aquick_2d cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 5;;
+let aquick_2e cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 6;;
+let aquick_2f cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 7;;
+let aquick_2g cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end else begin
+        incr p2;
+      end;
+    done;
+    let len1 = !p1 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p1; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p1)
+      end else qsort l !p1
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 1;;
+let aquick_3a cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 2;;
+let aquick_3b cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 3;;
+let aquick_3c cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 4;;
+let aquick_3d cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 5;;
+let aquick_3e cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 6;;
+let aquick_3f cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 7;;
+let aquick_3g cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 8;;
+let aquick_3h cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 9;;
+let aquick_3i cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+let cutoff = 10;;
+let aquick_3j cmp a =
+  let rec qsort l r =     (* ASSUMES r - l >= 2 *)
+    let m = (l + r) / 2 in
+    let al = a.(l) and am = a.(m) and ar = a.(r - 1) in
+    let pivot = if cmp al am <= 0 then
+                  if cmp am ar <= 0 then am
+                  else if cmp al ar <= 0 then ar
+                  else al
+                else
+                  if cmp al ar <= 0 then al
+                  else if cmp am ar <= 0 then ar
+                  else am
+    in
+    let p1 = ref l and p2 = ref l and p3 = ref r in
+    while !p2 < !p3 do
+      let e = a.(!p2) in
+      let c = cmp e pivot in
+      if c > 0 then begin
+        decr p3;
+        a.(!p2) <- a.(!p3);
+        a.(!p3) <- e;
+      end else if c < 0 then begin
+        incr p2;
+      end else begin
+        a.(!p2) <- a.(!p1);
+        a.(!p1) <- e;
+        incr p1;
+        incr p2;
+      end
+    done;
+    while !p1 > l do
+      decr p1;
+      decr p2;
+      let e = a.(!p1) in a.(!p1) <- a.(!p2); a.(!p2) <- e;
+    done;
+    let len1 = !p2 - l and len2 = r - !p3 in
+    if len1 > cutoff then
+      if len2 > cutoff then begin
+        if len1 < len2
+        then (qsort l !p2; qsort !p3 r)
+        else (qsort !p3 r; qsort l !p2)
+      end else qsort l !p2
+    else if len2 > cutoff then qsort !p3 r;
+  in
+  let l = Array.length a in
+  if l > 1 then begin
+    qsort 0 l;
+    let mini = ref 0 in
+    for i = 0 to (min l cutoff) - 1 do
+      if cmp a.(i) a.(!mini) < 0 then mini := i;
+    done;
+    let e = a.(0) in a.(0) <- a.(!mini); a.(!mini) <- e;
+    for i = 1 to l - 1 do
+      let e = a.(i) in
+      let j = ref (i - 1) in
+      while cmp a.(!j) e > 0 do
+        a.(!j + 1) <- a.(!j);
+        decr j;
+      done;
+      a.(!j + 1) <- e;
+    done;
+  end;
+;;
+\f
+(************************************************************************)
+(* Heap sort on arrays (top-down, ternary) *)
+
+let aheap_1 cmp a =
+  let l = ref (Array.length a) in
+  let l3 = ref ((!l + 1) / 3) in   (* l3 is the first element without sons *)
+  let maxson i =                   (* ASSUMES i < !l3 *)
+    let i31 = i+i+i+1 in
+    let x = ref i31 in
+    if i31+2 < !l then begin
+      if cmp a.(i31) a.(i31+1) < 0 then x := i31+1;
+      if cmp a.(!x) a.(i31+2) < 0 then x := i31+2;
+      !x
+    end else begin
+      if i31+1 < !l && cmp a.(i31) a.(i31+1) < 0
+      then i31+1
+      else i31
+    end
+  in
+  let rec trickledown i e =    (* ASSUMES i < !l3 *)
+    let j = maxson i in
+    if cmp a.(j) e > 0 then begin
+      a.(i) <- a.(j);
+      if j < !l3 then trickledown j e else a.(j) <- e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  for i = !l3 - 1 downto 0 do trickledown i a.(i); done;
+  let m = ref (!l + 1 - 3 * !l3) in
+  while !l > 2 do
+    decr l;
+    if !m = 0 then (m := 2; decr l3) else decr m;
+    let e = a.(!l) in
+    a.(!l) <- a.(0);
+    trickledown 0 e;
+  done;
+  if !l > 1 then begin let e = a.(1) in a.(1) <- a.(0); a.(0) <- e; end;
+;;
+\f
+(************************************************************************)
+(* Heap sort on arrays (top-down, binary) *)
+
+(* FIXME essayer application partielle de trickledown (merge avec down) *)
+(* FIXME essayer expanser maxson dans trickledown; supprimer l'exception. *)
+
+let aheap_2 cmp a =
+  let maxson l i e =
+    let i21 = i + i + 1 in
+    if i21 + 1 < l && cmp a.(i21) a.(i21+1) < 0
+    then i21 + 1
+    else if i21 < l then i21 else (a.(i) <- e; raise Exit)
+  in
+  let rec trickledown l i e =
+    let j = maxson l i e in
+    if cmp a.(j) e > 0 then begin
+      a.(i) <- a.(j);
+      trickledown l j e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let down l i e = try trickledown l i e with Exit -> () in
+  let l = Array.length a in
+  for i = l / 2 -1 downto 0 do down l i a.(i); done;
+  for i = l - 1 downto 1 do
+    let e = a.(i) in
+    a.(i) <- a.(0);
+    down i 0 e;
+  done;
+;;
+\f
+(************************************************************************)
+(* Heap sort on arrays (bottom-up, ternary) *)
+
+exception Bottom of int;;
+
+let aheap_3 cmp a =
+  let maxson l i =
+    let i31 = i+i+i+1 in
+    let x = ref i31 in
+    if i31+2 < l then begin
+      if cmp a.(i31) a.(i31+1) < 0 then x := i31+1;
+      if cmp a.(!x) a.(i31+2) < 0 then x := i31+2;
+      !x
+    end else
+      if i31+1 < l && cmp a.(i31) a.(i31+1) < 0
+      then i31+1
+      else if i31 < l then i31 else raise (Bottom i)
+  in
+  let rec trickledown l i e =
+    let j = maxson l i in
+    if cmp a.(j) e > 0 then begin
+      a.(i) <- a.(j);
+      trickledown l j e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let rec trickle l i e = try trickledown l i e with Bottom i -> a.(i) <- e in
+  let rec bubbledown l i =
+    let j = maxson l i in
+    a.(i) <- a.(j);
+    bubbledown l j;
+  in
+  let bubble l i = try bubbledown l i with Bottom i -> i in
+  let rec trickleup i e =
+    let father = (i - 1) / 3 in
+    assert (i <> father);
+    if cmp a.(father) e < 0 then begin
+      a.(i) <- a.(father);
+      if father > 0 then trickleup father e else a.(0) <- e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let l = Array.length a in
+  for i = (l + 1) / 3 - 1 downto 0 do trickle l i a.(i); done;
+  for i = l - 1 downto 2 do
+    let e = a.(i) in
+    a.(i) <- a.(0);
+    trickleup (bubble i 0) e;
+  done;
+  if l > 1 then (let e = a.(1) in a.(1) <- a.(0); a.(0) <- e);
+;;
+\f
+(************************************************************************)
+(* Heap sort on arrays (bottom-up, binary) *)
+
+let aheap_4 cmp a =
+  let maxson l i =
+    let i21 = i + i + 1 in
+    if i21 + 1 < l && cmp a.(i21) a.(i21 + 1) < 0
+    then i21 + 1
+    else if i21 < l then i21 else raise (Bottom i)
+  in
+  let rec trickledown l i e =
+    let j = maxson l i in
+    if cmp a.(j) e > 0 then begin
+      a.(i) <- a.(j);
+      trickledown l j e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let trickle l i e = try trickledown l i e with Bottom i -> a.(i) <- e in
+  let rec bubbledown l i =
+    let j = maxson l i in
+    a.(i) <- a.(j);
+    bubbledown l j;
+  in
+  let bubble l i = try bubbledown l i with Bottom i -> i in
+  let rec trickleup i e =
+    let father = (i - 1) / 2 in
+    assert (i <> father);
+    if cmp a.(father) e < 0 then begin
+      a.(i) <- a.(father);
+      if father > 0 then trickleup father e else a.(0) <- e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let l = Array.length a in
+  for i = l / 2 - 1 downto 0 do trickle l i a.(i); done;
+  for i = l - 1 downto 2 do
+    let e = a.(i) in
+    a.(i) <- a.(0);
+    trickleup (bubble i 0) e;
+  done;
+  if l > 1 then (let e = a.(1) in a.(1) <- a.(0); a.(0) <- e);
+;;
+\f
+(************************************************************************)
+(* heap sort, top-down, ternary, recursive final loop *)
+
+let aheap_5 cmp a =
+  let maxson l i =                 (* ASSUMES i < (l+1)/3 *)
+    let i31 = i+i+i+1 in
+    let x = ref i31 in
+    if i31+2 < l then begin
+      if cmp a.(i31) a.(i31+1) < 0 then x := i31+1;
+      if cmp a.(!x) a.(i31+2) < 0 then x := i31+2;
+      !x
+    end else begin
+      if i31+1 < l && cmp a.(i31) a.(i31+1) < 0
+      then i31+1
+      else i31
+    end
+  in
+  let rec trickledown l l3 i e =    (* ASSUMES i < l3 *)
+    let j = maxson l i in
+    if cmp a.(j) e > 0 then begin
+      a.(i) <- a.(j);
+      if j < l3 then trickledown l l3 j e else a.(j) <- e;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let l = Array.length a in
+  let l3 = (l + 1) / 3 in
+  for i = l3 - 1 downto 0 do trickledown l l3 i a.(i); done;
+  let rec loop0 l l3 =
+    let e = a.(l) in
+    a.(l) <- a.(0);
+    trickledown l l3 0 e;
+    loop2 (l-1) (l3-1);
+  and loop1 l l3 =
+    let e = a.(l) in
+    a.(l) <- a.(0);
+    trickledown l l3 0 e;
+    loop0 (l-1) l3;
+  and loop2 l l3 =
+    if l > 1 then begin
+      let e = a.(l) in
+      a.(l) <- a.(0);
+      trickledown l l3 0 e;
+      loop1 (l-1) l3;
+    end else begin
+      let e = a.(1) in a.(1) <- a.(0); a.(0) <- e;
+    end;
+  in
+  if l > 1 then
+    match l + 1 - 3 * l3 with
+    | 0 -> loop2 (l-1) (l3-1);
+    | 1 -> loop0 (l-1) l3;
+    | 2 -> loop1 (l-1) l3;
+    | _ -> assert false;
+;;
+\f
+(************************************************************************)
+(* heap sort, top-down, ternary, with exception *)
+
+let aheap_6 cmp a =
+  let maxson e l i =
+    let i31 = i + i + i + 1 in
+    let x = ref i31 in
+    if i31+2 < l then begin
+      if cmp a.(i31) a.(i31+1) < 0 then x := i31+1;
+      if cmp a.(!x) a.(i31+2) < 0 then x := i31+2;
+      !x
+    end else begin
+      if i31+1 < l && cmp a.(i31) a.(i31+1) < 0
+      then i31+1
+      else if i31 < l then i31 else (a.(i) <- e; raise Exit)
+    end
+  in
+  let rec trickledown e l i =
+    let j = maxson e l i in
+    if cmp a.(j) e > 0 then begin
+      a.(i) <- a.(j);
+      trickledown e l j;
+    end else begin
+      a.(i) <- e;
+    end;
+  in
+  let down e l i = try trickledown e l i with Exit -> (); in
+  let l = Array.length a in
+  for i = (l + 1) / 3 - 1 downto 0 do down a.(i) l i; done;
+  for i = l - 1 downto 2 do
+    let e = a.(i) in
+    a.(i) <- a.(0);
+    down e i 0;
+  done;
+  if l > 1 then (let e = a.(1) in a.(1) <- a.(0); a.(0) <- e);
+;;
+
+(* FIXME essayer cutoff pour heapsort *)
+
+(************************************************************************)
+(* Insertion sort with dichotomic search *)
+
+let ainsertion_1 cmp a =
+  let rec dicho l r e =
+    if l = r then l else begin
+      let m = (l + r) / 2 in
+      if cmp a.(m) e <= 0
+      then dicho (m+1) r e
+      else dicho l m e
+    end
+  in
+  for i = 1 to Array.length a - 1 do
+    let e = a.(i) in
+    let j = dicho 0 i e in
+    Array.blit a j a (j + 1) (i - j);
+    a.(j) <- e;
+  done;
+;;
+\f
+(************************************************************************)
+(* merge sort on lists via arrays *)
+
+let array_to_list_in_place a =
+  let l = Array.length a in
+  let rec loop accu n p =
+    if p <= 0 then accu else begin
+      if p = n then begin
+        Obj.truncate (Obj.repr a) p;
+        loop (a.(p-1) :: accu) (n-1000) (p-1)
+      end else begin
+        loop (a.(p-1) :: accu) n (p-1)
+      end
+    end
+  in
+  loop [] l l
+;;
+
+let array_of_list l len =
+  match l with
+  | [] -> [| |]
+  | h::t ->
+      let a = Array.make len h in
+      let rec loop i l =
+        match l with
+        | [] -> ()
+        | h::t -> a.(i) <- h; loop (i+1) t
+      in
+      loop 1 t;
+      a
+;;
+
+let lmerge_0a cmp l =
+  let a = Array.of_list l in
+  amerge_1e cmp a;
+  array_to_list_in_place a
+;;
+
+let lmerge_0b cmp l =
+  let len = List.length l in
+  if len > 256 then Gc.minor ();
+  let a = array_of_list l len in
+  amerge_1e cmp a;
+  array_to_list_in_place a
+;;
+
+let lshell_0 cmp l =
+  let a = Array.of_list l in
+  ashell_2 cmp a;
+  array_to_list_in_place a
+;;
+
+let lquick_0 cmp l =
+  let a = Array.of_list l in
+  aquick_3f cmp a;
+  array_to_list_in_place a
+;;
+
+(************************************************************************)
+(* merge sort on arrays via lists *)
+
+let amerge_0 cmp a =    (* cutoff is not yet used *)
+  let l = lmerge_4e cmp (Array.to_list a) in
+  let rec loop i = function
+  | [] -> ()
+  | h::t -> a.(i) <- h; loop (i + 1) t
+  in
+  loop 0 l
+;;
+\f
+(************************************************************************)
+
+let lold = [
+  "Sort.list", Sort.list, true;
+  "lmerge_3", lmerge_3, false;
+  "lmerge_4a", lmerge_4a, true;
+];;
+
+let lnew = [
+  "List.stable_sort", List.stable_sort, true;
+
+  "lmerge_0a", lmerge_0a, true;
+  "lmerge_0b", lmerge_0b, true;
+  "lshell_0", lshell_0, false;
+  "lquick_0", lquick_0, false;
+
+  "lmerge_1a", lmerge_1a, true;
+  "lmerge_1b", lmerge_1b, true;
+  "lmerge_1c", lmerge_1c, true;
+  "lmerge_1d", lmerge_1d, true;
+
+  "lmerge_4b", lmerge_4b, true;
+  "lmerge_4c", lmerge_4c, true;
+  "lmerge_4d", lmerge_4d, true;
+  "lmerge_4e", lmerge_4e, true;
+
+  "lmerge_5a", lmerge_5a, true;
+  "lmerge_5b", lmerge_5b, true;
+  "lmerge_5c", lmerge_5c, true;
+  "lmerge_5d", lmerge_5d, true;
+];;
+let anew = [
+  "Array.stable_sort", Array.stable_sort, true;
+  "Array.sort", Array.sort, false;
+
+  "amerge_0", amerge_0, true;
+
+  "amerge_1a", amerge_1a, true;
+  "amerge_1b", amerge_1b, true;
+  "amerge_1c", amerge_1c, true;
+  "amerge_1d", amerge_1d, true;
+  "amerge_1e", amerge_1e, true;
+  "amerge_1f", amerge_1f, true;
+  "amerge_1g", amerge_1g, true;
+  "amerge_1h", amerge_1h, true;
+  "amerge_1i", amerge_1i, true;
+  "amerge_1j", amerge_1j, true;
+
+  "amerge_3a", amerge_3a, true;
+  "amerge_3b", amerge_3b, true;
+  "amerge_3c", amerge_3c, true;
+  "amerge_3d", amerge_3d, true;
+  "amerge_3e", amerge_3e, true;
+  "amerge_3f", amerge_3f, true;
+  "amerge_3g", amerge_3g, true;
+  "amerge_3h", amerge_3h, true;
+  "amerge_3i", amerge_3i, true;
+  "amerge_3j", amerge_3j, true;
+
+  "ashell_1", ashell_1, false;
+  "ashell_2", ashell_2, false;
+  "ashell_3", ashell_3, false;
+  "ashell_4", ashell_4, false;
+
+  "aquick_1a", aquick_1a, false;
+  "aquick_1b", aquick_1b, false;
+  "aquick_1c", aquick_1c, false;
+  "aquick_1d", aquick_1d, false;
+  "aquick_1e", aquick_1e, false;
+  "aquick_1f", aquick_1f, false;
+  "aquick_1g", aquick_1g, false;
+
+  "aquick_2a", aquick_2a, false;
+  "aquick_2b", aquick_2b, false;
+  "aquick_2c", aquick_2c, false;
+  "aquick_2d", aquick_2d, false;
+  "aquick_2e", aquick_2e, false;
+  "aquick_2f", aquick_2f, false;
+  "aquick_2g", aquick_2g, false;
+
+  "aquick_3a", aquick_3a, false;
+  "aquick_3b", aquick_3b, false;
+  "aquick_3c", aquick_3c, false;
+  "aquick_3d", aquick_3d, false;
+  "aquick_3e", aquick_3e, false;
+  "aquick_3f", aquick_3f, false;
+  "aquick_3g", aquick_3g, false;
+  "aquick_3h", aquick_3h, false;
+  "aquick_3i", aquick_3i, false;
+  "aquick_3j", aquick_3j, false;
+
+  "aheap_1", aheap_1, false;
+  "aheap_2", aheap_2, false;
+  "aheap_3", aheap_3, false;
+  "aheap_4", aheap_4, false;
+  "aheap_5", aheap_5, false;
+  "aheap_6", aheap_6, false;
+
+  "ainsertion_1", ainsertion_1, true;
+];;
+
+(************************************************************************)
+(* main program *)
+
+type mode = Test_std | Test | Bench1 | Bench2 | Bench3;;
+
+let size = ref 22
+and mem = ref 0
+and mode = ref Test_std
+and only = ref []
+;;
+
+let usage = "Usage: sorts [-size <table size>] [-mem <memory size>]\n\
+          \032            [-seed <random seed>] [-test|-bench]"
+;;
+
+let options = [
+  "-size", Arg.Int ((:=) size), "   Maximum size for benchmarks (default 22)";
+  "-meg",Arg.Int ((:=) mem),"    How many megabytes to preallocate (default 0)";
+  "-seed", Arg.Int ((:=) seed), "   PRNG seed (default 0)";
+  "-teststd", Arg.Unit (fun () -> mode := Test_std), "   Test stdlib (default)";
+  "-test", Arg.Unit (fun () -> mode := Test), "   Select test mode";
+  "-bench1", Arg.Unit (fun () -> mode := Bench1), "  Select bench mode 1";
+  "-bench2", Arg.Unit (fun () -> mode := Bench2), "  Select bench mode 2";
+  "-bench3", Arg.Unit (fun () -> mode := Bench3), "  Select bench mode 3";
+  "-fn", Arg.String (fun x -> only := x :: !only),
+                         " <function>  Test/Bench this function (default all)";
+];;
+let anonymous x = raise (Arg.Bad ("unrecognised option "^x));;
+
+let main () =
+  Arg.parse options anonymous usage;
+
+  Printf.printf "Command line arguments are:";
+  for i = 1 to Array.length Sys.argv - 1 do
+    Printf.printf " %s" Sys.argv.(i);
+  done;
+  Printf.printf "\n";
+
+  ignore (String.create (1048576 * !mem));
+  Gc.full_major ();
+  let a2l = Array.to_list in
+  let l2ak x y = Array.of_list x in
+  let id = fun x -> x in
+  let fst x y = x in
+  let snd x y = y in
+  let benchonly f x y z t =
+    match !only with
+    | [] -> f x y z t
+    | l -> if List.mem y l then f x y z t
+  in
+  let testonly x1 x2 x3 x4 x5 x6 =
+    match !only with
+    | [] -> test x1 x2 x3 x4 x5 x6
+    | l -> if List.mem x1 l then test x1 x2 x3 x4 x5 x6
+  in
+
+  match !mode with
+  | Test_std -> begin
+      testonly "List.sort" false List.sort List.sort lc lc;
+      testonly "List.stable_sort" true List.stable_sort List.stable_sort lc lc;
+      testonly "Array.sort" false Array.sort Array.sort ac ac;
+      testonly "Array.stable_sort" true Array.stable_sort Array.stable_sort
+               ac ac;
+      printf "Number of tests failed: %d\n" !numfailed;
+    end;
+  | Test -> begin
+      for i = 0 to List.length lold - 1 do
+        let (name, f1, stable) = List.nth lold i in
+        let (_, f2, _) = List.nth lold i in
+        testonly name stable f1 f2 ll ll;
+      done;
+      testonly "Sort.array" false Sort.array Sort.array al al;
+      for i = 0 to List.length lnew - 1 do
+        let (name, f1, stable) = List.nth lnew i in
+        let (_, f2, _) = List.nth lnew i in
+        testonly name stable f1 f2 lc lc;
+      done;
+      for i = 0 to List.length anew - 1 do
+        let (name, f1, stable) = List.nth anew i in
+        let (_, f2, _) = List.nth anew i in
+        testonly name stable f1 f2 ac ac;
+      done;
+      printf "Number of tests failed: %d\n" !numfailed;
+    end;
+  | Bench1 -> begin
+      let ba = fun x y z -> benchonly bench1a !size x y z
+      and bb = fun x y z -> benchonly bench1b !size x y z
+      and bc = fun x y z -> benchonly bench1c !size x y z
+      in
+      for i = 0 to List.length lold - 1 do
+        let (name, f, stable) = List.nth lold i in ba name f ll;
+        let (name, f, stable) = List.nth lold i in bb name f ll;
+        let (name, f, stable) = List.nth lold i in bc name f ll;
+      done;
+      ba "Sort.array" Sort.array al;
+      bb "Sort.array" Sort.array al;
+      bc "Sort.array" Sort.array al;
+      for i = 0 to List.length lnew - 1 do
+        let (name, f, stable) = List.nth lnew i in ba name f lc;
+        let (name, f, stable) = List.nth lnew i in bb name f lc;
+        let (name, f, stable) = List.nth lnew i in bc name f lc;
+      done;
+      for i = 0 to List.length anew - 1 do
+        let (name, f, stable) = List.nth anew i in ba name f ac;
+        let (name, f, stable) = List.nth anew i in bb name f ac;
+        let (name, f, stable) = List.nth anew i in bc name f ac;
+      done;
+    end;
+  | Bench2 -> begin
+      let b = fun x y z -> benchonly bench2 !size x y z in
+      for i = 0 to List.length lold - 1 do
+        let (name, f, stable) = List.nth lold i in b name f ll;
+      done;
+      b "Sort.array" Sort.array al;
+      for i = 0 to List.length lnew - 1 do
+        let (name, f, stable) = List.nth lnew i in b name f lc;
+      done;
+      for i = 0 to List.length anew - 1 do
+        let (name, f, stable) = List.nth anew i in b name f ac;
+      done;
+    end;
+  | Bench3 -> begin
+      let ba = fun x y z -> benchonly bench3a !size x y z
+      and bb = fun x y z -> benchonly bench3b !size x y z
+      and bc = fun x y z -> benchonly bench3c !size x y z
+      in
+      for i = 0 to List.length lold - 1 do
+        let (name, f, stable) = List.nth lold i in ba name f ll;
+        let (name, f, stable) = List.nth lold i in bb name f ll;
+        let (name, f, stable) = List.nth lold i in bc name f ll;
+      done;
+      for i = 0 to List.length lnew - 1 do
+        let (name, f, stable) = List.nth lnew i in ba name f lc;
+        let (name, f, stable) = List.nth lnew i in bb name f lc;
+        let (name, f, stable) = List.nth lnew i in bc name f lc;
+      done;
+    end;
+;;
+
+if not !Sys.interactive then Printexc.catch main ();;
+
+(* $Id: sorts.ml,v 1.1 2002/06/26 14:55:36 doligez Exp $ *)
diff --git a/test/takc.ml b/test/takc.ml
new file mode 100644 (file)
index 0000000..576e5de
--- /dev/null
@@ -0,0 +1,23 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: takc.ml,v 1.5 2005/08/12 09:22:04 xleroy Exp $ *)
+
+let rec tak x y z =
+  if x > y then tak (tak (x-1) y z) (tak (y-1) z x) (tak (z-1) x y)
+           else z
+
+let rec repeat n =
+  if n <= 0 then 0 else tak 18 12 6 + repeat(n-1)
+
+let _ = print_int (repeat 2000); print_newline(); exit 0
+
diff --git a/test/taku.ml b/test/taku.ml
new file mode 100644 (file)
index 0000000..89bc64a
--- /dev/null
@@ -0,0 +1,22 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: taku.ml,v 1.5 2005/08/12 09:22:04 xleroy Exp $ *)
+
+let rec tak (x, y, z) =
+  if x > y then tak(tak (x-1, y, z), tak (y-1, z, x), tak (z-1, x, y))
+           else z
+
+let rec repeat n =
+  if n <= 0 then 0 else tak(18,12,6) + repeat(n-1)
+
+let _ = print_int (repeat 2000); print_newline(); exit 0
diff --git a/test/testinterp/.cvsignore b/test/testinterp/.cvsignore
new file mode 100644 (file)
index 0000000..fdffd0f
--- /dev/null
@@ -0,0 +1,3 @@
+a.out
+ocamlrun.68k
+ocamlrun.ppc
diff --git a/test/testinterp/coverage b/test/testinterp/coverage
new file mode 100644 (file)
index 0000000..30a3243
--- /dev/null
@@ -0,0 +1,133 @@
+ACC0:                 090
+ACC1:                 090
+ACC2:                 090
+ACC3:                 090
+ACC4:                 090
+ACC5:                 090
+ACC6:                 090
+ACC7:                 090
+ACC:                  091
+PUSH:                 150
+PUSHACC0:             092
+PUSHACC1:             092
+PUSHACC2:             092
+PUSHACC3:             092
+PUSHACC4:             092
+PUSHACC5:             092
+PUSHACC6:             092
+PUSHACC7:             092
+PUSHACC:              093
+POP:                  020
+ASSIGN:               220
+ENVACC1:              170
+ENVACC2:              170
+ENVACC3:              170
+ENVACC4:              170
+ENVACC:               171
+PUSHENVACC1:          172
+PUSHENVACC2:          172
+PUSHENVACC3:          172
+PUSHENVACC4:          172
+PUSHENVACC:           173
+PUSH_RETADDR:         270
+APPLY:                165
+APPLY1:               161
+APPLY2:               164
+APPLY3:               164
+APPTERM:              181
+APPTERM1:             180
+APPTERM2:             180
+APPTERM3:             180
+RETURN:               162
+RESTART:              163
+GRAB:                 163
+CLOSURE:              160
+CLOSUREREC:           250
+OFFSETCLOSUREM2:      253
+OFFSETCLOSURE0:       253
+OFFSETCLOSURE2:       253
+OFFSETCLOSURE:        254
+PUSHOFFSETCLOSUREM2:  251
+PUSHOFFSETCLOSURE0:   251
+PUSHOFFSETCLOSURE2:   251
+PUSHOFFSETCLOSURE:    252
+GETGLOBAL:            050
+PUSHGETGLOBAL:        050
+GETGLOBALFIELD:       051
+PUSHGETGLOBALFIELD:   051
+SETGLOBAL:            000
+ATOM0:                000
+ATOM:                 
+PUSHATOM0:            
+PUSHATOM:             
+MAKEBLOCK:            041
+MAKEBLOCK1:           040
+MAKEBLOCK2:           040
+MAKEBLOCK3:           040
+MAKEFLOATBLOCK:       190
+GETFIELD0:            200
+GETFIELD1:            200
+GETFIELD2:            200
+GETFIELD3:            200
+GETFIELD:             201
+GETFLOATFIELD:        192
+SETFIELD0:            210
+SETFIELD1:            210
+SETFIELD2:            210
+SETFIELD3:            210
+SETFIELD:             211
+SETFLOATFIELD:        193
+VECTLENGTH:           130,191
+GETVECTITEM:          130
+SETVECTITEM:          131
+GETSTRINGCHAR:        120
+SETSTRINGCHAR:        121
+BRANCH:               070
+BRANCHIF:             070
+BRANCHIFNOT:          070
+SWITCH:               140,141,142
+BOOLNOT:              071
+PUSHTRAP:             100
+POPTRAP:              101
+RAISE:                060
+CHECK_SIGNALS:        230
+C_CALL1:              240
+C_CALL2:              240
+C_CALL3:              240
+C_CALL4:              240
+C_CALL5:              240
+C_CALLN:              
+CONST0:               010
+CONST1:               010
+CONST2:               010
+CONST3:               010
+CONSTINT:             011
+PUSHCONST0:           020
+PUSHCONST1:           021
+PUSHCONST2:           021
+PUSHCONST3:           021
+PUSHCONSTINT:         022
+NEGINT:               110
+ADDINT:               110
+SUBINT:               110
+MULINT:               110
+DIVINT:               110
+MODINT:               110
+ANDINT:               110
+ORINT:                110
+XORINT:               110
+LSLINT:               110
+LSRINT:               110
+ASRINT:               110
+EQ:                   080
+NEQ:                  080
+LTINT:                080
+LEINT:                080
+GTINT:                080
+GEINT:                080
+OFFSETINT:            110
+OFFSETREF:            260
+GETMETHOD:            300
+STOP:                 000
+EVENT:                
+BREAK:                
diff --git a/test/testinterp/lib.ml b/test/testinterp/lib.ml
new file mode 100644 (file)
index 0000000..caf44fb
--- /dev/null
@@ -0,0 +1,46 @@
+(* file $Id: lib.ml,v 1.2 2004/04/06 09:11:45 starynke Exp $ *)
+
+external raise : exn -> 'a = "%raise"
+
+external not : bool -> bool = "%boolnot"
+
+external (=) : 'a -> 'a -> bool = "%equal"
+external (<>) : 'a -> 'a -> bool = "%notequal"
+external (<) : 'a -> 'a -> bool = "%lessthan"
+external (>) : 'a -> 'a -> bool = "%greaterthan"
+external (<=) : 'a -> 'a -> bool = "%lessequal"
+external (>=) : 'a -> 'a -> bool = "%greaterequal"
+
+external (~-) : int -> int = "%negint"
+external (+) : int -> int -> int = "%addint"
+external (-) : int -> int -> int = "%subint"
+external ( * ) : int -> int -> int = "%mulint"
+external (/) : int -> int -> int = "%divint"
+external (mod) : int -> int -> int = "%modint"
+
+external (land) : int -> int -> int = "%andint"
+external (lor) : int -> int -> int = "%orint"
+external (lxor) : int -> int -> int = "%xorint"
+external (lsl) : int -> int -> int = "%lslint"
+external (lsr) : int -> int -> int = "%lsrint"
+external (asr) : int -> int -> int = "%asrint"
+
+external ignore : 'a -> unit = "%ignore"
+
+type 'a ref = { mutable contents: 'a }
+external ref : 'a -> 'a ref = "%makemutable"
+external (!) : 'a ref -> 'a = "%field0"
+external (:=) : 'a ref -> 'a -> unit = "%setfield0"
+external incr : int ref -> unit = "%incr"
+external decr : int ref -> unit = "%decr"
+
+type 'a option = None | Some of 'a
+
+type 'a weak_t;;
+external weak_create: int -> 'a weak_t = "caml_weak_create";;
+external weak_set : 'a weak_t -> int -> 'a option -> unit = "caml_weak_set";;
+external weak_get: 'a weak_t -> int -> 'a option = "caml_weak_get";;
+
+let x = 42;;
+
+(* eof $Id: lib.ml,v 1.2 2004/04/06 09:11:45 starynke Exp $ *)
diff --git a/test/testinterp/no68k.rez b/test/testinterp/no68k.rez
new file mode 100644 (file)
index 0000000..a6353ea
--- /dev/null
@@ -0,0 +1 @@
+data 'CODE' (0) { };
diff --git a/test/testinterp/noppc.rez b/test/testinterp/noppc.rez
new file mode 100644 (file)
index 0000000..ecb9655
--- /dev/null
@@ -0,0 +1 @@
+data 'cfrg' (0) { };
diff --git a/test/testinterp/t000.ml b/test/testinterp/t000.ml
new file mode 100644 (file)
index 0000000..fafa1c8
--- /dev/null
@@ -0,0 +1,7 @@
+(* empty file *)
+
+(**
+       0 ATOM0 
+       1 SETGLOBAL T000
+       3 STOP 
+**)
diff --git a/test/testinterp/t010-const0.ml b/test/testinterp/t010-const0.ml
new file mode 100644 (file)
index 0000000..73ecbb1
--- /dev/null
@@ -0,0 +1,8 @@
+0;;
+
+(**
+       0 CONST0 
+       1 ATOM0 
+       2 SETGLOBAL T010-const0
+       4 STOP 
+**)
diff --git a/test/testinterp/t010-const1.ml b/test/testinterp/t010-const1.ml
new file mode 100644 (file)
index 0000000..75a00d5
--- /dev/null
@@ -0,0 +1,8 @@
+1;;
+
+(**
+       0 CONST1 
+       1 ATOM0 
+       2 SETGLOBAL T010-const1
+       4 STOP 
+**)
diff --git a/test/testinterp/t010-const2.ml b/test/testinterp/t010-const2.ml
new file mode 100644 (file)
index 0000000..f0ed8e7
--- /dev/null
@@ -0,0 +1,8 @@
+2;;
+
+(**
+       0 CONST2 
+       1 ATOM0 
+       2 SETGLOBAL T010-const2
+       4 STOP 
+**)
diff --git a/test/testinterp/t010-const3.ml b/test/testinterp/t010-const3.ml
new file mode 100644 (file)
index 0000000..4f034c4
--- /dev/null
@@ -0,0 +1,8 @@
+3;;
+
+(**
+       0 CONST3 
+       1 ATOM0 
+       2 SETGLOBAL T010-const3
+       4 STOP 
+**)
diff --git a/test/testinterp/t011-constint.ml b/test/testinterp/t011-constint.ml
new file mode 100644 (file)
index 0000000..9ece6c5
--- /dev/null
@@ -0,0 +1,8 @@
+4;;
+
+(**
+       0 CONSTINT 4
+       2 ATOM0 
+       3 SETGLOBAL T011-constint
+       5 STOP 
+**)
diff --git a/test/testinterp/t020.ml b/test/testinterp/t020.ml
new file mode 100644 (file)
index 0000000..5d6a3cf
--- /dev/null
@@ -0,0 +1,10 @@
+let _ = () in ();;
+
+(**
+       0 CONST0 
+       1 PUSHCONST0 
+       2 POP 1
+       4 ATOM0 
+       5 SETGLOBAL T020
+       7 STOP 
+**)
diff --git a/test/testinterp/t021-pushconst1.ml b/test/testinterp/t021-pushconst1.ml
new file mode 100644 (file)
index 0000000..075997a
--- /dev/null
@@ -0,0 +1,10 @@
+let _ = () in 1;;
+
+(**
+       0 CONST0 
+       1 PUSHCONST1 
+       2 POP 1
+       4 ATOM0 
+       5 SETGLOBAL T021-pushconst1
+       7 STOP 
+**)
diff --git a/test/testinterp/t021-pushconst2.ml b/test/testinterp/t021-pushconst2.ml
new file mode 100644 (file)
index 0000000..17adb50
--- /dev/null
@@ -0,0 +1,10 @@
+let _ = () in 2;;
+
+(**
+       0 CONST0 
+       1 PUSHCONST2 
+       2 POP 1
+       4 ATOM0 
+       5 SETGLOBAL T021-pushconst2
+       7 STOP 
+**)
diff --git a/test/testinterp/t021-pushconst3.ml b/test/testinterp/t021-pushconst3.ml
new file mode 100644 (file)
index 0000000..563c609
--- /dev/null
@@ -0,0 +1,10 @@
+let _ = () in 3;;
+
+(**
+       0 CONST0 
+       1 PUSHCONST3 
+       2 POP 1
+       4 ATOM0 
+       5 SETGLOBAL T021-pushconst3
+       7 STOP 
+**)
diff --git a/test/testinterp/t022-pushconstint.ml b/test/testinterp/t022-pushconstint.ml
new file mode 100644 (file)
index 0000000..1b766a5
--- /dev/null
@@ -0,0 +1,10 @@
+let _ = () in -1;;
+
+(**
+       0 CONST0 
+       1 PUSHCONSTINT -1
+       3 POP 1
+       5 ATOM0 
+       6 SETGLOBAL T022-pushconstint
+       8 STOP 
+**)
diff --git a/test/testinterp/t040-makeblock1.ml b/test/testinterp/t040-makeblock1.ml
new file mode 100644 (file)
index 0000000..7151660
--- /dev/null
@@ -0,0 +1,13 @@
+type t = {
+  mutable a : int;
+};;
+
+{ a = 0 };;
+
+(**
+       0 CONST0 
+       1 MAKEBLOCK1 0
+       3 ATOM0 
+       4 SETGLOBAL T040-makeblock1
+       6 STOP 
+**)
diff --git a/test/testinterp/t040-makeblock2.ml b/test/testinterp/t040-makeblock2.ml
new file mode 100644 (file)
index 0000000..e7c745b
--- /dev/null
@@ -0,0 +1,15 @@
+type t = {
+  mutable a : int;
+  mutable b : int;
+};;
+
+{ a = 0; b = 0 };;
+
+(**
+       0 CONST0 
+       1 PUSHCONST0 
+       2 MAKEBLOCK2 0
+       4 ATOM0 
+       5 SETGLOBAL T040-makeblock2
+       7 STOP 
+**)
diff --git a/test/testinterp/t040-makeblock3.ml b/test/testinterp/t040-makeblock3.ml
new file mode 100644 (file)
index 0000000..8fb5605
--- /dev/null
@@ -0,0 +1,17 @@
+type t = {
+  mutable a : int;
+  mutable b : int;
+  mutable c : int;
+};;
+
+{ a = 0; b = 0; c = 0 };;
+
+(**
+       0 CONST0 
+       1 PUSHCONST0 
+       2 PUSHCONST0 
+       3 MAKEBLOCK3 0
+       5 ATOM0 
+       6 SETGLOBAL T040-makeblock3
+       8 STOP 
+**)
diff --git a/test/testinterp/t041-makeblock.ml b/test/testinterp/t041-makeblock.ml
new file mode 100644 (file)
index 0000000..5ae255d
--- /dev/null
@@ -0,0 +1,19 @@
+type t = {
+  mutable a : int;
+  mutable b : int;
+  mutable c : int;
+  mutable d : int;
+};;
+
+{ a = 0; b = 0; c = 0; d = 0 };;
+
+(**
+       0 CONST0 
+       1 PUSHCONST0 
+       2 PUSHCONST0 
+       3 PUSHCONST0 
+       4 MAKEBLOCK 4, 0
+       7 ATOM0 
+       8 SETGLOBAL T041-makeblock
+      10 STOP 
+**)
diff --git a/test/testinterp/t050-getglobal.ml b/test/testinterp/t050-getglobal.ml
new file mode 100644 (file)
index 0000000..f10393c
--- /dev/null
@@ -0,0 +1,8 @@
+[1];;
+
+(**
+       0 GETGLOBAL <0>(1, 0)
+       2 ATOM0 
+       3 SETGLOBAL T050-getglobal
+       5 STOP 
+**)
diff --git a/test/testinterp/t050-pushgetglobal.ml b/test/testinterp/t050-pushgetglobal.ml
new file mode 100644 (file)
index 0000000..e1172cc
--- /dev/null
@@ -0,0 +1,10 @@
+let _ = () in 0.01;;
+
+(**
+       0 CONST0 
+       1 PUSHGETGLOBAL 0.01
+       3 POP 1
+       5 ATOM0 
+       6 SETGLOBAL T050-pushgetglobal
+       8 STOP 
+**)
diff --git a/test/testinterp/t051-getglobalfield.ml b/test/testinterp/t051-getglobalfield.ml
new file mode 100644 (file)
index 0000000..45d9cce
--- /dev/null
@@ -0,0 +1,13 @@
+Lib.x;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBALFIELD Lib, 0
+      12 ATOM0 
+      13 SETGLOBAL T051-getglobalfield
+      15 STOP 
+**)
diff --git a/test/testinterp/t051-pushgetglobalfield.ml b/test/testinterp/t051-pushgetglobalfield.ml
new file mode 100644 (file)
index 0000000..2012a25
--- /dev/null
@@ -0,0 +1,15 @@
+let _ = () in Lib.x;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHGETGLOBALFIELD Lib, 0
+      13 POP 1
+      15 ATOM0 
+      16 SETGLOBAL T051-pushgetglobalfield
+      18 STOP 
+**)
diff --git a/test/testinterp/t060-raise.ml b/test/testinterp/t060-raise.ml
new file mode 100644 (file)
index 0000000..1aa4846
--- /dev/null
@@ -0,0 +1,15 @@
+open Lib;;
+raise End_of_file;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL End_of_file
+      11 MAKEBLOCK1 0
+      13 RAISE 
+      14 SETGLOBAL T060-raise
+      16 STOP 
+**)
diff --git a/test/testinterp/t070-branch.ml b/test/testinterp/t070-branch.ml
new file mode 100644 (file)
index 0000000..4fc52d4
--- /dev/null
@@ -0,0 +1,20 @@
+open Lib;;
+if true then 0 else raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 BRANCHIFNOT 15
+      12 CONST0 
+      13 BRANCH 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 ATOM0 
+      21 SETGLOBAL T070-branch
+      23 STOP 
+**)
diff --git a/test/testinterp/t070-branchif.ml b/test/testinterp/t070-branchif.ml
new file mode 100644 (file)
index 0000000..c256248
--- /dev/null
@@ -0,0 +1,20 @@
+open Lib;;
+if not false then 0 else raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 BRANCHIF 15
+      12 CONST0 
+      13 BRANCH 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 ATOM0 
+      21 SETGLOBAL T070-branchif
+      23 STOP 
+**)
diff --git a/test/testinterp/t070-branchifnot.ml b/test/testinterp/t070-branchifnot.ml
new file mode 100644 (file)
index 0000000..9e6e4e8
--- /dev/null
@@ -0,0 +1,18 @@
+open Lib;;
+if false then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 BRANCHIFNOT 17
+      12 GETGLOBAL Not_found
+      14 MAKEBLOCK1 0
+      16 RAISE 
+      17 ATOM0 
+      18 SETGLOBAL T070-branchifnot
+      20 STOP 
+**)
diff --git a/test/testinterp/t071-boolnot.ml b/test/testinterp/t071-boolnot.ml
new file mode 100644 (file)
index 0000000..b4a8194
--- /dev/null
@@ -0,0 +1,19 @@
+open Lib;;
+if not true then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 BOOLNOT 
+      11 BRANCHIFNOT 18
+      13 GETGLOBAL Not_found
+      15 MAKEBLOCK1 0
+      17 RAISE 
+      18 ATOM0 
+      19 SETGLOBAL T071-boolnot
+      21 STOP 
+**)
diff --git a/test/testinterp/t080-eq.ml b/test/testinterp/t080-eq.ml
new file mode 100644 (file)
index 0000000..3ee735f
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+if not (0 = 0) then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 EQ 
+      12 BOOLNOT 
+      13 BRANCHIFNOT 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 ATOM0 
+      21 SETGLOBAL T080-eq
+      23 STOP 
+**)
diff --git a/test/testinterp/t080-geint.ml b/test/testinterp/t080-geint.ml
new file mode 100644 (file)
index 0000000..a220b7e
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+if not (0 >= 0) then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 GEINT 
+      12 BOOLNOT 
+      13 BRANCHIFNOT 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 ATOM0 
+      21 SETGLOBAL T080-geint
+      23 STOP 
+**)
diff --git a/test/testinterp/t080-gtint.ml b/test/testinterp/t080-gtint.ml
new file mode 100644 (file)
index 0000000..32d5732
--- /dev/null
@@ -0,0 +1,20 @@
+open Lib;;
+if 0 > 0 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 GTINT 
+      12 BRANCHIFNOT 19
+      14 GETGLOBAL Not_found
+      16 MAKEBLOCK1 0
+      18 RAISE 
+      19 ATOM0 
+      20 SETGLOBAL T080-gtint
+      22 STOP 
+**)
diff --git a/test/testinterp/t080-leint.ml b/test/testinterp/t080-leint.ml
new file mode 100644 (file)
index 0000000..cc983a0
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+if not (0 <= 0) then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 LEINT 
+      12 BOOLNOT 
+      13 BRANCHIFNOT 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 ATOM0 
+      21 SETGLOBAL T080-leint
+      23 STOP 
+**)
diff --git a/test/testinterp/t080-ltint.ml b/test/testinterp/t080-ltint.ml
new file mode 100644 (file)
index 0000000..ae7d240
--- /dev/null
@@ -0,0 +1,20 @@
+open Lib;;
+if 0 < 0 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 LTINT 
+      12 BRANCHIFNOT 19
+      14 GETGLOBAL Not_found
+      16 MAKEBLOCK1 0
+      18 RAISE 
+      19 ATOM0 
+      20 SETGLOBAL T080-ltint
+      22 STOP 
+**)
diff --git a/test/testinterp/t080-neq.ml b/test/testinterp/t080-neq.ml
new file mode 100644 (file)
index 0000000..5066e9c
--- /dev/null
@@ -0,0 +1,20 @@
+open Lib;;
+if 0 <> 0 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 NEQ 
+      12 BRANCHIFNOT 19
+      14 GETGLOBAL Not_found
+      16 MAKEBLOCK1 0
+      18 RAISE 
+      19 ATOM0 
+      20 SETGLOBAL T080-neq
+      22 STOP 
+**)
diff --git a/test/testinterp/t090-acc0.ml b/test/testinterp/t090-acc0.ml
new file mode 100644 (file)
index 0000000..74accec
--- /dev/null
@@ -0,0 +1,25 @@
+open Lib;;
+let x = true in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 ACC0 
+      12 BOOLNOT 
+      13 BRANCHIFNOT 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 POP 1
+      22 ATOM0 
+      23 SETGLOBAL T090-acc0
+      25 STOP 
+**)
diff --git a/test/testinterp/t090-acc1.ml b/test/testinterp/t090-acc1.ml
new file mode 100644 (file)
index 0000000..fc9b025
--- /dev/null
@@ -0,0 +1,27 @@
+open Lib;;
+let x = true in
+let y = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 ACC1 
+      13 BOOLNOT 
+      14 BRANCHIFNOT 21
+      16 GETGLOBAL Not_found
+      18 MAKEBLOCK1 0
+      20 RAISE 
+      21 POP 2
+      23 ATOM0 
+      24 SETGLOBAL T090-acc1
+      26 STOP 
+**)
diff --git a/test/testinterp/t090-acc2.ml b/test/testinterp/t090-acc2.ml
new file mode 100644 (file)
index 0000000..4865944
--- /dev/null
@@ -0,0 +1,29 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 ACC2 
+      14 BOOLNOT 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 POP 3
+      24 ATOM0 
+      25 SETGLOBAL T090-acc2
+      27 STOP 
+**)
diff --git a/test/testinterp/t090-acc3.ml b/test/testinterp/t090-acc3.ml
new file mode 100644 (file)
index 0000000..9622456
--- /dev/null
@@ -0,0 +1,31 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+let a = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 ACC3 
+      15 BOOLNOT 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 POP 4
+      25 ATOM0 
+      26 SETGLOBAL T090-acc3
+      28 STOP 
+**)
diff --git a/test/testinterp/t090-acc4.ml b/test/testinterp/t090-acc4.ml
new file mode 100644 (file)
index 0000000..992559b
--- /dev/null
@@ -0,0 +1,33 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+let a = false in
+let b = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHCONST0 
+      15 ACC4 
+      16 BOOLNOT 
+      17 BRANCHIFNOT 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 POP 5
+      26 ATOM0 
+      27 SETGLOBAL T090-acc4
+      29 STOP 
+**)
diff --git a/test/testinterp/t090-acc5.ml b/test/testinterp/t090-acc5.ml
new file mode 100644 (file)
index 0000000..57f7453
--- /dev/null
@@ -0,0 +1,35 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+let a = false in
+let b = false in
+let c = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHCONST0 
+      15 PUSHCONST0 
+      16 ACC5 
+      17 BOOLNOT 
+      18 BRANCHIFNOT 25
+      20 GETGLOBAL Not_found
+      22 MAKEBLOCK1 0
+      24 RAISE 
+      25 POP 6
+      27 ATOM0 
+      28 SETGLOBAL T090-acc5
+      30 STOP 
+**)
diff --git a/test/testinterp/t090-acc6.ml b/test/testinterp/t090-acc6.ml
new file mode 100644 (file)
index 0000000..f940028
--- /dev/null
@@ -0,0 +1,37 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+let a = false in
+let b = false in
+let c = false in
+let d = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHCONST0 
+      15 PUSHCONST0 
+      16 PUSHCONST0 
+      17 ACC6 
+      18 BOOLNOT 
+      19 BRANCHIFNOT 26
+      21 GETGLOBAL Not_found
+      23 MAKEBLOCK1 0
+      25 RAISE 
+      26 POP 7
+      28 ATOM0 
+      29 SETGLOBAL T090-acc6
+      31 STOP 
+**)
diff --git a/test/testinterp/t090-acc7.ml b/test/testinterp/t090-acc7.ml
new file mode 100644 (file)
index 0000000..366191b
--- /dev/null
@@ -0,0 +1,39 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+let a = false in
+let b = false in
+let c = false in
+let d = false in
+let e = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHCONST0 
+      15 PUSHCONST0 
+      16 PUSHCONST0 
+      17 PUSHCONST0 
+      18 ACC7 
+      19 BOOLNOT 
+      20 BRANCHIFNOT 27
+      22 GETGLOBAL Not_found
+      24 MAKEBLOCK1 0
+      26 RAISE 
+      27 POP 8
+      29 ATOM0 
+      30 SETGLOBAL T090-acc7
+      32 STOP 
+**)
diff --git a/test/testinterp/t091-acc.ml b/test/testinterp/t091-acc.ml
new file mode 100644 (file)
index 0000000..26b003f
--- /dev/null
@@ -0,0 +1,41 @@
+open Lib;;
+let x = true in
+let y = false in
+let z = false in
+let a = false in
+let b = false in
+let c = false in
+let d = false in
+let e = false in
+let f = false in
+();
+if not x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHCONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHCONST0 
+      15 PUSHCONST0 
+      16 PUSHCONST0 
+      17 PUSHCONST0 
+      18 PUSHCONST0 
+      19 ACC 8
+      21 BOOLNOT 
+      22 BRANCHIFNOT 29
+      24 GETGLOBAL Not_found
+      26 MAKEBLOCK1 0
+      28 RAISE 
+      29 POP 9
+      31 ATOM0 
+      32 SETGLOBAL T091-acc
+      34 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc.ml b/test/testinterp/t092-pushacc.ml
new file mode 100644 (file)
index 0000000..c21561e
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+let b = true in
+let c = true in
+let d = true in
+let e = true in
+let f = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHCONST1 
+      14 PUSHCONST1 
+      15 PUSHCONST1 
+      16 PUSHCONST1 
+      17 PUSHCONST1 
+      18 PUSHACC 8
+      20 BRANCHIFNOT 27
+      22 GETGLOBAL Not_found
+      24 MAKEBLOCK1 0
+      26 RAISE 
+      27 POP 9
+      29 ATOM0 
+      30 SETGLOBAL T092-pushacc
+      32 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc0.ml b/test/testinterp/t092-pushacc0.ml
new file mode 100644 (file)
index 0000000..ffdc3b0
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+let x = false in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHACC0 
+      11 BRANCHIFNOT 18
+      13 GETGLOBAL Not_found
+      15 MAKEBLOCK1 0
+      17 RAISE 
+      18 POP 1
+      20 ATOM0 
+      21 SETGLOBAL T092-pushacc0
+      23 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc1.ml b/test/testinterp/t092-pushacc1.ml
new file mode 100644 (file)
index 0000000..b923f4f
--- /dev/null
@@ -0,0 +1,24 @@
+open Lib;;
+let x = false in
+let y = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHACC1 
+      12 BRANCHIFNOT 19
+      14 GETGLOBAL Not_found
+      16 MAKEBLOCK1 0
+      18 RAISE 
+      19 POP 2
+      21 ATOM0 
+      22 SETGLOBAL T092-pushacc1
+      24 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc2.ml b/test/testinterp/t092-pushacc2.ml
new file mode 100644 (file)
index 0000000..f624978
--- /dev/null
@@ -0,0 +1,26 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHACC2 
+      13 BRANCHIFNOT 20
+      15 GETGLOBAL Not_found
+      17 MAKEBLOCK1 0
+      19 RAISE 
+      20 POP 3
+      22 ATOM0 
+      23 SETGLOBAL T092-pushacc2
+      25 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc3.ml b/test/testinterp/t092-pushacc3.ml
new file mode 100644 (file)
index 0000000..5984fec
--- /dev/null
@@ -0,0 +1,28 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHACC3 
+      14 BRANCHIFNOT 21
+      16 GETGLOBAL Not_found
+      18 MAKEBLOCK1 0
+      20 RAISE 
+      21 POP 4
+      23 ATOM0 
+      24 SETGLOBAL T092-pushacc3
+      26 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc4.ml b/test/testinterp/t092-pushacc4.ml
new file mode 100644 (file)
index 0000000..ce20e0b
--- /dev/null
@@ -0,0 +1,30 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+let b = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHCONST1 
+      14 PUSHACC4 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 POP 5
+      24 ATOM0 
+      25 SETGLOBAL T092-pushacc4
+      27 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc5.ml b/test/testinterp/t092-pushacc5.ml
new file mode 100644 (file)
index 0000000..030f3f0
--- /dev/null
@@ -0,0 +1,32 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+let b = true in
+let c = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHCONST1 
+      14 PUSHCONST1 
+      15 PUSHACC5 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 POP 6
+      25 ATOM0 
+      26 SETGLOBAL T092-pushacc5
+      28 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc6.ml b/test/testinterp/t092-pushacc6.ml
new file mode 100644 (file)
index 0000000..9c67b80
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+let b = true in
+let c = true in
+let d = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHCONST1 
+      14 PUSHCONST1 
+      15 PUSHCONST1 
+      16 PUSHACC6 
+      17 BRANCHIFNOT 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 POP 7
+      26 ATOM0 
+      27 SETGLOBAL T092-pushacc6
+      29 STOP 
+**)
diff --git a/test/testinterp/t092-pushacc7.ml b/test/testinterp/t092-pushacc7.ml
new file mode 100644 (file)
index 0000000..09fbbca
--- /dev/null
@@ -0,0 +1,36 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+let b = true in
+let c = true in
+let d = true in
+let e = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHCONST1 
+      14 PUSHCONST1 
+      15 PUSHCONST1 
+      16 PUSHCONST1 
+      17 PUSHACC7 
+      18 BRANCHIFNOT 25
+      20 GETGLOBAL Not_found
+      22 MAKEBLOCK1 0
+      24 RAISE 
+      25 POP 8
+      27 ATOM0 
+      28 SETGLOBAL T092-pushacc7
+      30 STOP 
+**)
diff --git a/test/testinterp/t093-pushacc.ml b/test/testinterp/t093-pushacc.ml
new file mode 100644 (file)
index 0000000..00a969a
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+let x = false in
+let y = true in
+let z = true in
+let a = true in
+let b = true in
+let c = true in
+let d = true in
+let e = true in
+let f = true in
+if x then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST1 
+      11 PUSHCONST1 
+      12 PUSHCONST1 
+      13 PUSHCONST1 
+      14 PUSHCONST1 
+      15 PUSHCONST1 
+      16 PUSHCONST1 
+      17 PUSHCONST1 
+      18 PUSHACC 8
+      20 BRANCHIFNOT 27
+      22 GETGLOBAL Not_found
+      24 MAKEBLOCK1 0
+      26 RAISE 
+      27 POP 9
+      29 ATOM0 
+      30 SETGLOBAL T093-pushacc
+      32 STOP 
+**)
diff --git a/test/testinterp/t100-pushtrap.ml b/test/testinterp/t100-pushtrap.ml
new file mode 100644 (file)
index 0000000..7b02a86
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+try raise Not_found
+with _ -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 PUSHTRAP 16
+      11 GETGLOBAL Not_found
+      13 MAKEBLOCK1 0
+      15 RAISE 
+      16 PUSHCONST0 
+      17 POP 1
+      19 ATOM0 
+      20 SETGLOBAL T100-pushtrap
+      22 STOP 
+**)
diff --git a/test/testinterp/t101-poptrap.ml b/test/testinterp/t101-poptrap.ml
new file mode 100644 (file)
index 0000000..3a754a0
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+try ()
+with _ -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 PUSHTRAP 15
+      11 CONST0 
+      12 POPTRAP 
+      13 BRANCH 18
+      15 PUSHCONST0 
+      16 POP 1
+      18 ATOM0 
+      19 SETGLOBAL T101-poptrap
+      21 STOP 
+**)
diff --git a/test/testinterp/t110-addint.ml b/test/testinterp/t110-addint.ml
new file mode 100644 (file)
index 0000000..5d683c5
--- /dev/null
@@ -0,0 +1,26 @@
+open Lib;;
+let x = 1 in
+if 1 + x <> 2 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST2 
+      11 PUSHACC1 
+      12 PUSHCONST1 
+      13 ADDINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 POP 1
+      24 ATOM0 
+      25 SETGLOBAL T110-addint
+      27 STOP 
+**)
diff --git a/test/testinterp/t110-andint.ml b/test/testinterp/t110-andint.ml
new file mode 100644 (file)
index 0000000..016dc3c
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (3 land 6) <> 2 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST2 
+      10 PUSHCONSTINT 6
+      12 PUSHCONST3 
+      13 ANDINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T110-andint
+      25 STOP 
+**)
diff --git a/test/testinterp/t110-asrint-1.ml b/test/testinterp/t110-asrint-1.ml
new file mode 100644 (file)
index 0000000..173bdca
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (-2 asr 1) <> -1 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT -1
+      11 PUSHCONST1 
+      12 PUSHCONSTINT -2
+      14 ASRINT 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T110-asrint-1
+      26 STOP 
+**)
diff --git a/test/testinterp/t110-asrint-2.ml b/test/testinterp/t110-asrint-2.ml
new file mode 100644 (file)
index 0000000..386fc64
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (3 asr 1) <> 1 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST1 
+      11 PUSHCONST3 
+      12 ASRINT 
+      13 NEQ 
+      14 BRANCHIFNOT 21
+      16 GETGLOBAL Not_found
+      18 MAKEBLOCK1 0
+      20 RAISE 
+      21 ATOM0 
+      22 SETGLOBAL T110-asrint-2
+      24 STOP 
+**)
diff --git a/test/testinterp/t110-divint-1.ml b/test/testinterp/t110-divint-1.ml
new file mode 100644 (file)
index 0000000..5cde135
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if 2 / 2 <> 1 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST2 
+      11 PUSHCONST2 
+      12 DIVINT 
+      13 NEQ 
+      14 BRANCHIFNOT 21
+      16 GETGLOBAL Not_found
+      18 MAKEBLOCK1 0
+      20 RAISE 
+      21 ATOM0 
+      22 SETGLOBAL T110-divint-1
+      24 STOP 
+**)
diff --git a/test/testinterp/t110-divint-2.ml b/test/testinterp/t110-divint-2.ml
new file mode 100644 (file)
index 0000000..34f5b00
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if 3 / 2 <> 1 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST2 
+      11 PUSHCONST3 
+      12 DIVINT 
+      13 NEQ 
+      14 BRANCHIFNOT 21
+      16 GETGLOBAL Not_found
+      18 MAKEBLOCK1 0
+      20 RAISE 
+      21 ATOM0 
+      22 SETGLOBAL T110-divint-2
+      24 STOP 
+**)
diff --git a/test/testinterp/t110-divint-3.ml b/test/testinterp/t110-divint-3.ml
new file mode 100644 (file)
index 0000000..cbb2bff
--- /dev/null
@@ -0,0 +1,33 @@
+open Lib;;
+try
+  ignore (3 / 0);
+  raise Not_found;
+with Division_by_zero -> ()
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 PUSHTRAP 19
+      11 CONST0 
+      12 PUSHCONST3 
+      13 DIVINT 
+      14 GETGLOBAL Not_found
+      16 MAKEBLOCK1 0
+      18 RAISE 
+      19 PUSHGETGLOBAL Division_by_zero
+      21 PUSHACC1 
+      22 GETFIELD0 
+      23 EQ 
+      24 BRANCHIFNOT 29
+      26 CONST0 
+      27 BRANCH 31
+      29 ACC0 
+      30 RAISE 
+      31 POP 1
+      33 ATOM0 
+      34 SETGLOBAL T110-divint-3
+      36 STOP 
+**)
diff --git a/test/testinterp/t110-lslint.ml b/test/testinterp/t110-lslint.ml
new file mode 100644 (file)
index 0000000..9dd197b
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (3 lsl 2) <> 12 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 12
+      11 PUSHCONST2 
+      12 PUSHCONST3 
+      13 LSLINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T110-lslint
+      25 STOP 
+**)
diff --git a/test/testinterp/t110-lsrint.ml b/test/testinterp/t110-lsrint.ml
new file mode 100644 (file)
index 0000000..9777815
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (14 lsr 2) <> 3 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST3 
+      10 PUSHCONST2 
+      11 PUSHCONSTINT 14
+      13 LSRINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T110-lsrint
+      25 STOP 
+**)
diff --git a/test/testinterp/t110-modint-1.ml b/test/testinterp/t110-modint-1.ml
new file mode 100644 (file)
index 0000000..2a690c0
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if 20 mod 3 <> 2 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST2 
+      10 PUSHCONST3 
+      11 PUSHCONSTINT 20
+      13 MODINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T110-modint-1
+      25 STOP 
+**)
diff --git a/test/testinterp/t110-modint-2.ml b/test/testinterp/t110-modint-2.ml
new file mode 100644 (file)
index 0000000..0bc3be0
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+try
+  ignore (2 mod 0);
+  raise Not_found;
+with Division_by_zero -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 PUSHTRAP 19
+      11 CONST0 
+      12 PUSHCONST2 
+      13 MODINT 
+      14 GETGLOBAL Not_found
+      16 MAKEBLOCK1 0
+      18 RAISE 
+      19 PUSHGETGLOBAL Division_by_zero
+      21 PUSHACC1 
+      22 GETFIELD0 
+      23 EQ 
+      24 BRANCHIFNOT 29
+      26 CONST0 
+      27 BRANCH 31
+      29 ACC0 
+      30 RAISE 
+      31 POP 1
+      33 ATOM0 
+      34 SETGLOBAL T110-modint-2
+      36 STOP 
+**)
diff --git a/test/testinterp/t110-mulint.ml b/test/testinterp/t110-mulint.ml
new file mode 100644 (file)
index 0000000..97c1cf1
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if 2 * 2 <> 4 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 4
+      11 PUSHCONST2 
+      12 PUSHCONST2 
+      13 MULINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T110-mulint
+      25 STOP 
+**)
diff --git a/test/testinterp/t110-negint.ml b/test/testinterp/t110-negint.ml
new file mode 100644 (file)
index 0000000..069a34b
--- /dev/null
@@ -0,0 +1,25 @@
+open Lib;;
+let x = 1 in
+if -x <> -1 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONSTINT -1
+      12 PUSHACC1 
+      13 NEGINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 POP 1
+      24 ATOM0 
+      25 SETGLOBAL T110-negint
+      27 STOP 
+**)
diff --git a/test/testinterp/t110-offsetint.ml b/test/testinterp/t110-offsetint.ml
new file mode 100644 (file)
index 0000000..925159e
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+if 2 + 2 <> 4 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 4
+      11 PUSHCONST2 
+      12 OFFSETINT 2
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T110-offsetint
+      25 STOP 
+**)
diff --git a/test/testinterp/t110-orint.ml b/test/testinterp/t110-orint.ml
new file mode 100644 (file)
index 0000000..56b63d8
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (3 lor 6) <> 7 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 7
+      11 PUSHCONSTINT 6
+      13 PUSHCONST3 
+      14 ORINT 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T110-orint
+      26 STOP 
+**)
diff --git a/test/testinterp/t110-subint.ml b/test/testinterp/t110-subint.ml
new file mode 100644 (file)
index 0000000..f626cd0
--- /dev/null
@@ -0,0 +1,26 @@
+open Lib;;
+let x = 1 in
+if 1 - x <> 0 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST0 
+      11 PUSHACC1 
+      12 PUSHCONST1 
+      13 SUBINT 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 POP 1
+      24 ATOM0 
+      25 SETGLOBAL T110-subint
+      27 STOP 
+**)
diff --git a/test/testinterp/t110-xorint.ml b/test/testinterp/t110-xorint.ml
new file mode 100644 (file)
index 0000000..dfb278b
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if (3 lxor 6) <> 5 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 5
+      11 PUSHCONSTINT 6
+      13 PUSHCONST3 
+      14 XORINT 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T110-xorint
+      26 STOP 
+**)
diff --git a/test/testinterp/t120-getstringchar.ml b/test/testinterp/t120-getstringchar.ml
new file mode 100644 (file)
index 0000000..aaff202
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if "foo".[2] <> 'o' then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 111
+      11 PUSHCONST2 
+      12 PUSHGETGLOBAL "foo"
+      14 GETSTRINGCHAR 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T120-getstringchar
+      26 STOP 
+**)
diff --git a/test/testinterp/t121-setstringchar.ml b/test/testinterp/t121-setstringchar.ml
new file mode 100644 (file)
index 0000000..882d6e0
--- /dev/null
@@ -0,0 +1,31 @@
+open Lib;;
+let x = "foo" in
+x.[2] <- 'x';
+if x.[2] <> 'x' then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL "foo"
+      11 PUSHCONSTINT 120
+      13 PUSHCONST2 
+      14 PUSHACC2 
+      15 SETSTRINGCHAR 
+      16 CONSTINT 120
+      18 PUSHCONST2 
+      19 PUSHACC2 
+      20 GETSTRINGCHAR 
+      21 NEQ 
+      22 BRANCHIFNOT 29
+      24 GETGLOBAL Not_found
+      26 MAKEBLOCK1 0
+      28 RAISE 
+      29 POP 1
+      31 ATOM0 
+      32 SETGLOBAL T121-setstringchar
+      34 STOP 
+**)
diff --git a/test/testinterp/t130-getvectitem.ml b/test/testinterp/t130-getvectitem.ml
new file mode 100644 (file)
index 0000000..d290379
--- /dev/null
@@ -0,0 +1,24 @@
+open Lib;;
+if [| 1; 2 |].(1) <> 2 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST2 
+      10 PUSHCONST1 
+      11 PUSHCONST2 
+      12 PUSHCONST1 
+      13 MAKEBLOCK2 0
+      15 GETVECTITEM 
+      16 NEQ 
+      17 BRANCHIFNOT 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 ATOM0 
+      25 SETGLOBAL T130-getvectitem
+      27 STOP 
+**)
diff --git a/test/testinterp/t130-vectlength.ml b/test/testinterp/t130-vectlength.ml
new file mode 100644 (file)
index 0000000..ce0da0e
--- /dev/null
@@ -0,0 +1,23 @@
+open Lib;;
+if Array.length [| 1; 2 |] <> 2 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST2 
+      10 PUSHCONST2 
+      11 PUSHCONST1 
+      12 MAKEBLOCK2 0
+      14 VECTLENGTH 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T130-vectlength
+      26 STOP 
+**)
diff --git a/test/testinterp/t131-setvectitem.ml b/test/testinterp/t131-setvectitem.ml
new file mode 100644 (file)
index 0000000..f544a3e
--- /dev/null
@@ -0,0 +1,33 @@
+open Lib;;
+let x = [| 1; 2 |] in
+x.(0) <- 3;
+if x.(0) <> 3 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST2 
+      10 PUSHCONST1 
+      11 MAKEBLOCK2 0
+      13 PUSHCONST3 
+      14 PUSHCONST0 
+      15 PUSHACC2 
+      16 SETVECTITEM 
+      17 CONST3 
+      18 PUSHCONST0 
+      19 PUSHACC2 
+      20 GETVECTITEM 
+      21 NEQ 
+      22 BRANCHIFNOT 29
+      24 GETGLOBAL Not_found
+      26 MAKEBLOCK1 0
+      28 RAISE 
+      29 POP 1
+      31 ATOM0 
+      32 SETGLOBAL T131-setvectitem
+      34 STOP 
+**)
diff --git a/test/testinterp/t140-switch-1.ml b/test/testinterp/t140-switch-1.ml
new file mode 100644 (file)
index 0000000..b2d7352
--- /dev/null
@@ -0,0 +1,32 @@
+open Lib;;
+match 0 with
+| 0 -> ()
+| 1 -> raise Not_found
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHACC0 
+      11 SWITCH 
+        int 0 -> 17
+        int 1 -> 20
+      15 BRANCH 25
+      17 CONST0 
+      18 BRANCH 30
+      20 GETGLOBAL Not_found
+      22 MAKEBLOCK1 0
+      24 RAISE 
+      25 GETGLOBAL Not_found
+      27 MAKEBLOCK1 0
+      29 RAISE 
+      30 POP 1
+      32 ATOM0 
+      33 SETGLOBAL T140-switch-1
+      35 STOP 
+**)
diff --git a/test/testinterp/t140-switch-2.ml b/test/testinterp/t140-switch-2.ml
new file mode 100644 (file)
index 0000000..9004fa6
--- /dev/null
@@ -0,0 +1,32 @@
+open Lib;;
+match 1 with
+| 0 -> raise Not_found
+| 1 -> ()
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHACC0 
+      11 SWITCH 
+        int 0 -> 17
+        int 1 -> 22
+      15 BRANCH 25
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 CONST0 
+      23 BRANCH 30
+      25 GETGLOBAL Not_found
+      27 MAKEBLOCK1 0
+      29 RAISE 
+      30 POP 1
+      32 ATOM0 
+      33 SETGLOBAL T140-switch-2
+      35 STOP 
+**)
diff --git a/test/testinterp/t140-switch-3.ml b/test/testinterp/t140-switch-3.ml
new file mode 100644 (file)
index 0000000..b0c4bc8
--- /dev/null
@@ -0,0 +1,31 @@
+open Lib;;
+match 2 with
+| 0 -> raise Not_found
+| 1 -> raise Not_found
+| _ -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST2 
+      10 PUSHACC0 
+      11 SWITCH 
+        int 0 -> 17
+        int 1 -> 22
+      15 BRANCH 27
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 GETGLOBAL Not_found
+      24 MAKEBLOCK1 0
+      26 RAISE 
+      27 CONST0 
+      28 POP 1
+      30 ATOM0 
+      31 SETGLOBAL T140-switch-3
+      33 STOP 
+**)
diff --git a/test/testinterp/t140-switch-4.ml b/test/testinterp/t140-switch-4.ml
new file mode 100644 (file)
index 0000000..1826b09
--- /dev/null
@@ -0,0 +1,31 @@
+open Lib;;
+match -1 with
+| 0 -> raise Not_found
+| 1 -> raise Not_found
+| _ -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT -1
+      11 PUSHACC0 
+      12 SWITCH 
+        int 0 -> 18
+        int 1 -> 23
+      16 BRANCH 28
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 GETGLOBAL Not_found
+      25 MAKEBLOCK1 0
+      27 RAISE 
+      28 CONST0 
+      29 POP 1
+      31 ATOM0 
+      32 SETGLOBAL T140-switch-4
+      34 STOP 
+**)
diff --git a/test/testinterp/t141-switch-5.ml b/test/testinterp/t141-switch-5.ml
new file mode 100644 (file)
index 0000000..ca44849
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+type t =
+ | A of int
+ | B of int
+ | C of int
+;;
+
+match A 0 with
+| A _ -> ()
+| B _ -> raise Not_found
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL <0>(0)
+      11 PUSHACC0 
+      12 SWITCH 
+        tag 0 -> 17
+        tag 1 -> 20
+        tag 2 -> 25
+      17 CONST0 
+      18 BRANCH 30
+      20 GETGLOBAL Not_found
+      22 MAKEBLOCK1 0
+      24 RAISE 
+      25 GETGLOBAL Not_found
+      27 MAKEBLOCK1 0
+      29 RAISE 
+      30 POP 1
+      32 ATOM0 
+      33 SETGLOBAL T141-switch-5
+      35 STOP 
+**)
diff --git a/test/testinterp/t141-switch-6.ml b/test/testinterp/t141-switch-6.ml
new file mode 100644 (file)
index 0000000..c48e80b
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+type t =
+ | A of int
+ | B of int
+ | C of int
+;;
+
+match B 0 with
+| A _ -> raise Not_found
+| B _ -> ()
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL <1>(0)
+      11 PUSHACC0 
+      12 SWITCH 
+        tag 0 -> 17
+        tag 1 -> 22
+        tag 2 -> 25
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 CONST0 
+      23 BRANCH 30
+      25 GETGLOBAL Not_found
+      27 MAKEBLOCK1 0
+      29 RAISE 
+      30 POP 1
+      32 ATOM0 
+      33 SETGLOBAL T141-switch-6
+      35 STOP 
+**)
diff --git a/test/testinterp/t141-switch-7.ml b/test/testinterp/t141-switch-7.ml
new file mode 100644 (file)
index 0000000..00f4873
--- /dev/null
@@ -0,0 +1,37 @@
+open Lib;;
+type t =
+ | A of int
+ | B of int
+ | C of int
+;;
+
+match C 0 with
+| A _ -> raise Not_found
+| B _ -> raise Not_found
+| _ -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL <2>(0)
+      11 PUSHACC0 
+      12 SWITCH 
+        tag 0 -> 17
+        tag 1 -> 22
+        tag 2 -> 27
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 GETGLOBAL Not_found
+      24 MAKEBLOCK1 0
+      26 RAISE 
+      27 CONST0 
+      28 POP 1
+      30 ATOM0 
+      31 SETGLOBAL T141-switch-7
+      33 STOP 
+**)
diff --git a/test/testinterp/t142-switch-8.ml b/test/testinterp/t142-switch-8.ml
new file mode 100644 (file)
index 0000000..5145913
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+type t =
+ | A
+ | B of int
+ | C of int
+;;
+
+match A with
+| A -> ()
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHACC0 
+      11 SWITCH 
+        int 0 -> 16
+        tag 0 -> 19
+        tag 1 -> 19
+      16 CONST0 
+      17 BRANCH 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 POP 1
+      26 ATOM0 
+      27 SETGLOBAL T142-switch-8
+      29 STOP 
+**)
diff --git a/test/testinterp/t142-switch-9.ml b/test/testinterp/t142-switch-9.ml
new file mode 100644 (file)
index 0000000..a0e43d3
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+type t =
+ | A
+ | B of int
+ | C of int
+;;
+
+match B 0 with
+| B _ -> ()
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL <0>(0)
+      11 PUSHACC0 
+      12 SWITCH 
+        int 0 -> 20
+        tag 0 -> 17
+        tag 1 -> 20
+      17 CONST0 
+      18 BRANCH 25
+      20 GETGLOBAL Not_found
+      22 MAKEBLOCK1 0
+      24 RAISE 
+      25 POP 1
+      27 ATOM0 
+      28 SETGLOBAL T142-switch-9
+      30 STOP 
+**)
diff --git a/test/testinterp/t142-switch-A.ml b/test/testinterp/t142-switch-A.ml
new file mode 100644 (file)
index 0000000..4f66aec
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+type t =
+ | A
+ | B of int
+ | C of int
+;;
+
+match C 0 with
+| C _ -> ()
+| _ -> raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL <1>(0)
+      11 PUSHACC0 
+      12 SWITCH 
+        int 0 -> 20
+        tag 0 -> 20
+        tag 1 -> 17
+      17 CONST0 
+      18 BRANCH 25
+      20 GETGLOBAL Not_found
+      22 MAKEBLOCK1 0
+      24 RAISE 
+      25 POP 1
+      27 ATOM0 
+      28 SETGLOBAL T142-switch-A
+      30 STOP 
+**)
diff --git a/test/testinterp/t150-push-1.ml b/test/testinterp/t150-push-1.ml
new file mode 100644 (file)
index 0000000..9264927
--- /dev/null
@@ -0,0 +1,24 @@
+open Lib;;
+let _ = 0 in
+try 0 with _ -> 0
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSH 
+      11 PUSHTRAP 17
+      13 CONST0 
+      14 POPTRAP 
+      15 BRANCH 20
+      17 PUSHCONST0 
+      18 POP 1
+      20 POP 1
+      22 ATOM0 
+      23 SETGLOBAL T150-push-1
+      25 STOP 
+**)
diff --git a/test/testinterp/t150-push-2.ml b/test/testinterp/t150-push-2.ml
new file mode 100644 (file)
index 0000000..d6f5107
--- /dev/null
@@ -0,0 +1,39 @@
+open Lib;;
+let x = 1 in
+try if x <> 1 then raise Not_found
+with End_of_file -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSH 
+      11 PUSHTRAP 26
+      13 CONST1 
+      14 PUSHACC5 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 POPTRAP 
+      24 BRANCH 40
+      26 PUSHGETGLOBAL End_of_file
+      28 PUSHACC1 
+      29 GETFIELD0 
+      30 EQ 
+      31 BRANCHIFNOT 36
+      33 CONST0 
+      34 BRANCH 38
+      36 ACC0 
+      37 RAISE 
+      38 POP 1
+      40 POP 1
+      42 ATOM0 
+      43 SETGLOBAL T150-push-2
+      45 STOP 
+**)
diff --git a/test/testinterp/t160-closure.ml b/test/testinterp/t160-closure.ml
new file mode 100644 (file)
index 0000000..5eb6128
--- /dev/null
@@ -0,0 +1,19 @@
+open Lib;;
+let f () = ();;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 14
+      11 CONST0 
+      12 RETURN 1
+      14 CLOSURE 0, 11
+      17 PUSHACC0 
+      18 MAKEBLOCK1 0
+      20 POP 1
+      22 SETGLOBAL T160-closure
+      24 STOP 
+**)
diff --git a/test/testinterp/t161-apply1.ml b/test/testinterp/t161-apply1.ml
new file mode 100644 (file)
index 0000000..5138c5f
--- /dev/null
@@ -0,0 +1,42 @@
+open Lib;;
+let f _ = raise End_of_file in
+try
+  f 0;
+  raise Not_found;
+with End_of_file -> 0
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 16
+      11 GETGLOBAL End_of_file
+      13 MAKEBLOCK1 0
+      15 RAISE 
+      16 CLOSURE 0, 11
+      19 PUSH 
+      20 PUSHTRAP 30
+      22 CONST0 
+      23 PUSHACC5 
+      24 APPLY1 
+      25 GETGLOBAL Not_found
+      27 MAKEBLOCK1 0
+      29 RAISE 
+      30 PUSHGETGLOBAL End_of_file
+      32 PUSHACC1 
+      33 GETFIELD0 
+      34 EQ 
+      35 BRANCHIFNOT 40
+      37 CONST0 
+      38 BRANCH 42
+      40 ACC0 
+      41 RAISE 
+      42 POP 1
+      44 POP 1
+      46 ATOM0 
+      47 SETGLOBAL T161-apply1
+      49 STOP 
+**)
diff --git a/test/testinterp/t162-return.ml b/test/testinterp/t162-return.ml
new file mode 100644 (file)
index 0000000..1059c9f
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+let f _ = 0 in f 0;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 14
+      11 CONST0 
+      12 RETURN 1
+      14 CLOSURE 0, 11
+      17 PUSHCONST0 
+      18 PUSHACC1 
+      19 APPLY1 
+      20 POP 1
+      22 ATOM0 
+      23 SETGLOBAL T162-return
+      25 STOP 
+**)
diff --git a/test/testinterp/t163.ml b/test/testinterp/t163.ml
new file mode 100644 (file)
index 0000000..9ec7790
--- /dev/null
@@ -0,0 +1,23 @@
+open Lib;;
+let f _ _ = 0 in f 0;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 17
+      11 RESTART 
+      12 GRAB 1
+      14 CONST0 
+      15 RETURN 2
+      17 CLOSURE 0, 12
+      20 PUSHCONST0 
+      21 PUSHACC1 
+      22 APPLY1 
+      23 POP 1
+      25 ATOM0 
+      26 SETGLOBAL T163
+      28 STOP 
+**)
diff --git a/test/testinterp/t164-apply2.ml b/test/testinterp/t164-apply2.ml
new file mode 100644 (file)
index 0000000..7fbe7d9
--- /dev/null
@@ -0,0 +1,24 @@
+open Lib;;
+let f _ _ = 0 in f 0 0;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 17
+      11 RESTART 
+      12 GRAB 1
+      14 CONST0 
+      15 RETURN 2
+      17 CLOSURE 0, 12
+      20 PUSHCONST0 
+      21 PUSHCONST0 
+      22 PUSHACC2 
+      23 APPLY2 
+      24 POP 1
+      26 ATOM0 
+      27 SETGLOBAL T164-apply2
+      29 STOP 
+**)
diff --git a/test/testinterp/t164-apply3.ml b/test/testinterp/t164-apply3.ml
new file mode 100644 (file)
index 0000000..e7ebc3a
--- /dev/null
@@ -0,0 +1,25 @@
+open Lib;;
+let f _ _ _ = 0 in f 0 0 0;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 17
+      11 RESTART 
+      12 GRAB 2
+      14 CONST0 
+      15 RETURN 3
+      17 CLOSURE 0, 12
+      20 PUSHCONST0 
+      21 PUSHCONST0 
+      22 PUSHCONST0 
+      23 PUSHACC3 
+      24 APPLY3 
+      25 POP 1
+      27 ATOM0 
+      28 SETGLOBAL T164-apply3
+      30 STOP 
+**)
diff --git a/test/testinterp/t165-apply.ml b/test/testinterp/t165-apply.ml
new file mode 100644 (file)
index 0000000..9d66855
--- /dev/null
@@ -0,0 +1,28 @@
+open Lib;;
+let f _ _ _ _ = 0 in f 0 0 0 0;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 17
+      11 RESTART 
+      12 GRAB 3
+      14 CONST0 
+      15 RETURN 4
+      17 CLOSURE 0, 12
+      20 PUSH 
+      21 PUSH_RETADDR 30
+      23 CONST0 
+      24 PUSHCONST0 
+      25 PUSHCONST0 
+      26 PUSHCONST0 
+      27 PUSHACC7 
+      28 APPLY 4
+      30 POP 1
+      32 ATOM0 
+      33 SETGLOBAL T165-apply
+      35 STOP 
+**)
diff --git a/test/testinterp/t170-envacc2.ml b/test/testinterp/t170-envacc2.ml
new file mode 100644 (file)
index 0000000..3a37366
--- /dev/null
@@ -0,0 +1,37 @@
+open Lib;;
+let x = 5 in
+let y = 2 in
+let f _ = ignore x; y in
+if f 0 <> 2 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 16
+      11 ENVACC1 
+      12 CONST0 
+      13 ENVACC2 
+      14 RETURN 1
+      16 CONSTINT 5
+      18 PUSHCONST2 
+      19 PUSHACC0 
+      20 PUSHACC2 
+      21 CLOSURE 2, 11
+      24 PUSHCONST2 
+      25 PUSHCONST0 
+      26 PUSHACC2 
+      27 APPLY1 
+      28 NEQ 
+      29 BRANCHIFNOT 36
+      31 GETGLOBAL Not_found
+      33 MAKEBLOCK1 0
+      35 RAISE 
+      36 POP 3
+      38 ATOM0 
+      39 SETGLOBAL T170-envacc2
+      41 STOP 
+**)
diff --git a/test/testinterp/t170-envacc3.ml b/test/testinterp/t170-envacc3.ml
new file mode 100644 (file)
index 0000000..9a2b8b5
--- /dev/null
@@ -0,0 +1,42 @@
+open Lib;;
+let x = 5 in
+let y = 2 in
+let z = 1 in
+let f _ = ignore x; ignore y; z in
+if f 0 <> 1 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 18
+      11 ENVACC1 
+      12 CONST0 
+      13 ENVACC2 
+      14 CONST0 
+      15 ENVACC3 
+      16 RETURN 1
+      18 CONSTINT 5
+      20 PUSHCONST2 
+      21 PUSHCONST1 
+      22 PUSHACC0 
+      23 PUSHACC2 
+      24 PUSHACC4 
+      25 CLOSURE 3, 11
+      28 PUSHCONST1 
+      29 PUSHCONST0 
+      30 PUSHACC2 
+      31 APPLY1 
+      32 NEQ 
+      33 BRANCHIFNOT 40
+      35 GETGLOBAL Not_found
+      37 MAKEBLOCK1 0
+      39 RAISE 
+      40 POP 4
+      42 ATOM0 
+      43 SETGLOBAL T170-envacc3
+      45 STOP 
+**)
diff --git a/test/testinterp/t170-envacc4.ml b/test/testinterp/t170-envacc4.ml
new file mode 100644 (file)
index 0000000..215e322
--- /dev/null
@@ -0,0 +1,47 @@
+open Lib;;
+let x = 5 in
+let y = 2 in
+let z = 1 in
+let a = 4 in
+let f _ = ignore x; ignore y; ignore z; a in
+if f 0 <> 4 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 20
+      11 ENVACC1 
+      12 CONST0 
+      13 ENVACC2 
+      14 CONST0 
+      15 ENVACC3 
+      16 CONST0 
+      17 ENVACC4 
+      18 RETURN 1
+      20 CONSTINT 5
+      22 PUSHCONST2 
+      23 PUSHCONST1 
+      24 PUSHCONSTINT 4
+      26 PUSHACC0 
+      27 PUSHACC2 
+      28 PUSHACC4 
+      29 PUSHACC6 
+      30 CLOSURE 4, 11
+      33 PUSHCONSTINT 4
+      35 PUSHCONST0 
+      36 PUSHACC2 
+      37 APPLY1 
+      38 NEQ 
+      39 BRANCHIFNOT 46
+      41 GETGLOBAL Not_found
+      43 MAKEBLOCK1 0
+      45 RAISE 
+      46 POP 5
+      48 ATOM0 
+      49 SETGLOBAL T170-envacc4
+      51 STOP 
+**)
diff --git a/test/testinterp/t171-envacc.ml b/test/testinterp/t171-envacc.ml
new file mode 100644 (file)
index 0000000..4c4a3df
--- /dev/null
@@ -0,0 +1,52 @@
+open Lib;;
+let x = 5 in
+let y = 2 in
+let z = 1 in
+let a = 4 in
+let b = 3 in
+let f _ = ignore x; ignore y; ignore z; ignore a; b in
+if f 0 <> 3 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 23
+      11 ENVACC1 
+      12 CONST0 
+      13 ENVACC2 
+      14 CONST0 
+      15 ENVACC3 
+      16 CONST0 
+      17 ENVACC4 
+      18 CONST0 
+      19 ENVACC 5
+      21 RETURN 1
+      23 CONSTINT 5
+      25 PUSHCONST2 
+      26 PUSHCONST1 
+      27 PUSHCONSTINT 4
+      29 PUSHCONST3 
+      30 PUSHACC0 
+      31 PUSHACC2 
+      32 PUSHACC4 
+      33 PUSHACC6 
+      34 PUSHACC 8
+      36 CLOSURE 5, 11
+      39 PUSHCONST3 
+      40 PUSHCONST0 
+      41 PUSHACC2 
+      42 APPLY1 
+      43 NEQ 
+      44 BRANCHIFNOT 51
+      46 GETGLOBAL Not_found
+      48 MAKEBLOCK1 0
+      50 RAISE 
+      51 POP 6
+      53 ATOM0 
+      54 SETGLOBAL T171-envacc
+      56 STOP 
+**)
diff --git a/test/testinterp/t172-pushenvacc1.ml b/test/testinterp/t172-pushenvacc1.ml
new file mode 100644 (file)
index 0000000..06c4011
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let x = 5 in
+let f _ = x + x in
+if f 0 <> 10 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 16
+      11 ENVACC1 
+      12 PUSHENVACC1 
+      13 ADDINT 
+      14 RETURN 1
+      16 CONSTINT 5
+      18 PUSHACC0 
+      19 CLOSURE 1, 11
+      22 PUSHCONSTINT 10
+      24 PUSHCONST0 
+      25 PUSHACC2 
+      26 APPLY1 
+      27 NEQ 
+      28 BRANCHIFNOT 35
+      30 GETGLOBAL Not_found
+      32 MAKEBLOCK1 0
+      34 RAISE 
+      35 POP 2
+      37 ATOM0 
+      38 SETGLOBAL T172-pushenvacc1
+      40 STOP 
+**)
diff --git a/test/testinterp/t172-pushenvacc2.ml b/test/testinterp/t172-pushenvacc2.ml
new file mode 100644 (file)
index 0000000..c25e40a
--- /dev/null
@@ -0,0 +1,37 @@
+open Lib;;
+let x = 5 in
+let y = 4 in
+let f _ = y + x in
+if f 0 <> 9 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 16
+      11 ENVACC1 
+      12 PUSHENVACC2 
+      13 ADDINT 
+      14 RETURN 1
+      16 CONSTINT 5
+      18 PUSHCONSTINT 4
+      20 PUSHACC0 
+      21 PUSHACC2 
+      22 CLOSURE 2, 11
+      25 PUSHCONSTINT 9
+      27 PUSHCONST0 
+      28 PUSHACC2 
+      29 APPLY1 
+      30 NEQ 
+      31 BRANCHIFNOT 38
+      33 GETGLOBAL Not_found
+      35 MAKEBLOCK1 0
+      37 RAISE 
+      38 POP 3
+      40 ATOM0 
+      41 SETGLOBAL T172-pushenvacc2
+      43 STOP 
+**)
diff --git a/test/testinterp/t172-pushenvacc3.ml b/test/testinterp/t172-pushenvacc3.ml
new file mode 100644 (file)
index 0000000..093f7f1
--- /dev/null
@@ -0,0 +1,42 @@
+open Lib;;
+let x = 5 in
+let y = 4 in
+let z = 3 in
+let f _ = z + y + x in
+if f 0 <> 12 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 18
+      11 ENVACC1 
+      12 PUSHENVACC2 
+      13 PUSHENVACC3 
+      14 ADDINT 
+      15 ADDINT 
+      16 RETURN 1
+      18 CONSTINT 5
+      20 PUSHCONSTINT 4
+      22 PUSHCONST3 
+      23 PUSHACC0 
+      24 PUSHACC2 
+      25 PUSHACC4 
+      26 CLOSURE 3, 11
+      29 PUSHCONSTINT 12
+      31 PUSHCONST0 
+      32 PUSHACC2 
+      33 APPLY1 
+      34 NEQ 
+      35 BRANCHIFNOT 42
+      37 GETGLOBAL Not_found
+      39 MAKEBLOCK1 0
+      41 RAISE 
+      42 POP 4
+      44 ATOM0 
+      45 SETGLOBAL T172-pushenvacc3
+      47 STOP 
+**)
diff --git a/test/testinterp/t172-pushenvacc4.ml b/test/testinterp/t172-pushenvacc4.ml
new file mode 100644 (file)
index 0000000..154c4a4
--- /dev/null
@@ -0,0 +1,47 @@
+open Lib;;
+let x = 5 in
+let y = 4 in
+let z = 3 in
+let a = 2 in
+let f _ = a + z + y + x in
+if f 0 <> 14 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 21
+      11 ENVACC1 
+      12 PUSHENVACC2 
+      13 PUSHENVACC3 
+      14 PUSHENVACC 4
+      16 ADDINT 
+      17 ADDINT 
+      18 ADDINT 
+      19 RETURN 1
+      21 CONSTINT 5
+      23 PUSHCONSTINT 4
+      25 PUSHCONST3 
+      26 PUSHCONST2 
+      27 PUSHACC0 
+      28 PUSHACC2 
+      29 PUSHACC4 
+      30 PUSHACC6 
+      31 CLOSURE 4, 11
+      34 PUSHCONSTINT 14
+      36 PUSHCONST0 
+      37 PUSHACC2 
+      38 APPLY1 
+      39 NEQ 
+      40 BRANCHIFNOT 47
+      42 GETGLOBAL Not_found
+      44 MAKEBLOCK1 0
+      46 RAISE 
+      47 POP 5
+      49 ATOM0 
+      50 SETGLOBAL T172-pushenvacc4
+      52 STOP 
+**)
diff --git a/test/testinterp/t173-pushenvacc.ml b/test/testinterp/t173-pushenvacc.ml
new file mode 100644 (file)
index 0000000..0d858b4
--- /dev/null
@@ -0,0 +1,52 @@
+open Lib;;
+let x = 5 in
+let y = 4 in
+let z = 3 in
+let a = 2 in
+let b = 1 in
+let f _ = b + a + z + y + x in
+if f 0 <> 15 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 24
+      11 ENVACC1 
+      12 PUSHENVACC2 
+      13 PUSHENVACC3 
+      14 PUSHENVACC 4
+      16 PUSHENVACC 5
+      18 ADDINT 
+      19 ADDINT 
+      20 ADDINT 
+      21 ADDINT 
+      22 RETURN 1
+      24 CONSTINT 5
+      26 PUSHCONSTINT 4
+      28 PUSHCONST3 
+      29 PUSHCONST2 
+      30 PUSHCONST1 
+      31 PUSHACC0 
+      32 PUSHACC2 
+      33 PUSHACC4 
+      34 PUSHACC6 
+      35 PUSHACC 8
+      37 CLOSURE 5, 11
+      40 PUSHCONSTINT 15
+      42 PUSHCONST0 
+      43 PUSHACC2 
+      44 APPLY1 
+      45 NEQ 
+      46 BRANCHIFNOT 53
+      48 GETGLOBAL Not_found
+      50 MAKEBLOCK1 0
+      52 RAISE 
+      53 POP 6
+      55 ATOM0 
+      56 SETGLOBAL T173-pushenvacc
+      58 STOP 
+**)
diff --git a/test/testinterp/t180-appterm1.ml b/test/testinterp/t180-appterm1.ml
new file mode 100644 (file)
index 0000000..6b82f51
--- /dev/null
@@ -0,0 +1,35 @@
+open Lib;;
+let f _ = 12 in
+let g _ = f 0 in
+if g 0 <> 12 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 19
+      11 CONST0 
+      12 PUSHENVACC1 
+      13 APPTERM1 2
+      15 CONSTINT 12
+      17 RETURN 1
+      19 CLOSURE 0, 15
+      22 PUSHACC0 
+      23 CLOSURE 1, 11
+      26 PUSHCONSTINT 12
+      28 PUSHCONST0 
+      29 PUSHACC2 
+      30 APPLY1 
+      31 NEQ 
+      32 BRANCHIFNOT 39
+      34 GETGLOBAL Not_found
+      36 MAKEBLOCK1 0
+      38 RAISE 
+      39 POP 2
+      41 ATOM0 
+      42 SETGLOBAL T180-appterm1
+      44 STOP 
+**)
diff --git a/test/testinterp/t180-appterm2.ml b/test/testinterp/t180-appterm2.ml
new file mode 100644 (file)
index 0000000..28f32a9
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+let f _ _ = 12 in
+let g _ = f 0 0 in
+if g 0 <> 12 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 23
+      11 CONST0 
+      12 PUSHCONST0 
+      13 PUSHENVACC1 
+      14 APPTERM2 3
+      16 RESTART 
+      17 GRAB 1
+      19 CONSTINT 12
+      21 RETURN 2
+      23 CLOSURE 0, 17
+      26 PUSHACC0 
+      27 CLOSURE 1, 11
+      30 PUSHCONSTINT 12
+      32 PUSHCONST0 
+      33 PUSHACC2 
+      34 APPLY1 
+      35 NEQ 
+      36 BRANCHIFNOT 43
+      38 GETGLOBAL Not_found
+      40 MAKEBLOCK1 0
+      42 RAISE 
+      43 POP 2
+      45 ATOM0 
+      46 SETGLOBAL T180-appterm2
+      48 STOP 
+**)
diff --git a/test/testinterp/t180-appterm3.ml b/test/testinterp/t180-appterm3.ml
new file mode 100644 (file)
index 0000000..fe8a0bd
--- /dev/null
@@ -0,0 +1,39 @@
+open Lib;;
+let f _ _ _ = 13 in
+let g _ = f 0 0 0 in
+if g 0 <> 13 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 24
+      11 CONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHENVACC1 
+      15 APPTERM3 4
+      17 RESTART 
+      18 GRAB 2
+      20 CONSTINT 13
+      22 RETURN 3
+      24 CLOSURE 0, 18
+      27 PUSHACC0 
+      28 CLOSURE 1, 11
+      31 PUSHCONSTINT 13
+      33 PUSHCONST0 
+      34 PUSHACC2 
+      35 APPLY1 
+      36 NEQ 
+      37 BRANCHIFNOT 44
+      39 GETGLOBAL Not_found
+      41 MAKEBLOCK1 0
+      43 RAISE 
+      44 POP 2
+      46 ATOM0 
+      47 SETGLOBAL T180-appterm3
+      49 STOP 
+**)
diff --git a/test/testinterp/t181-appterm.ml b/test/testinterp/t181-appterm.ml
new file mode 100644 (file)
index 0000000..03127bc
--- /dev/null
@@ -0,0 +1,40 @@
+open Lib;;
+let f _ _ _ _ = -10 in
+let g _ = f 0 0 0 0 in
+if g 0 <> -10 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 26
+      11 CONST0 
+      12 PUSHCONST0 
+      13 PUSHCONST0 
+      14 PUSHCONST0 
+      15 PUSHENVACC1 
+      16 APPTERM 4, 5
+      19 RESTART 
+      20 GRAB 3
+      22 CONSTINT -10
+      24 RETURN 4
+      26 CLOSURE 0, 20
+      29 PUSHACC0 
+      30 CLOSURE 1, 11
+      33 PUSHCONSTINT -10
+      35 PUSHCONST0 
+      36 PUSHACC2 
+      37 APPLY1 
+      38 NEQ 
+      39 BRANCHIFNOT 46
+      41 GETGLOBAL Not_found
+      43 MAKEBLOCK1 0
+      45 RAISE 
+      46 POP 2
+      48 ATOM0 
+      49 SETGLOBAL T181-appterm
+      51 STOP 
+**)
diff --git a/test/testinterp/t190-makefloatblock-1.ml b/test/testinterp/t190-makefloatblock-1.ml
new file mode 100644 (file)
index 0000000..f63c6cd
--- /dev/null
@@ -0,0 +1,17 @@
+open Lib;;
+let x = 0.0 in [| x |];;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0
+      11 PUSHACC0 
+      12 MAKEFLOATBLOCK 1
+      14 POP 1
+      16 ATOM0 
+      17 SETGLOBAL T190-makefloatblock-1
+      19 STOP 
+**)
diff --git a/test/testinterp/t190-makefloatblock-2.ml b/test/testinterp/t190-makefloatblock-2.ml
new file mode 100644 (file)
index 0000000..53b97f5
--- /dev/null
@@ -0,0 +1,18 @@
+open Lib;;
+let x = 0.0 in [| x; x |];;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0
+      11 PUSHACC0 
+      12 PUSHACC1 
+      13 MAKEFLOATBLOCK 2
+      15 POP 1
+      17 ATOM0 
+      18 SETGLOBAL T190-makefloatblock-2
+      20 STOP 
+**)
diff --git a/test/testinterp/t190-makefloatblock-3.ml b/test/testinterp/t190-makefloatblock-3.ml
new file mode 100644 (file)
index 0000000..cebccaa
--- /dev/null
@@ -0,0 +1,19 @@
+open Lib;;
+let x = 0.0 in [| x; x; x |];;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0
+      11 PUSHACC0 
+      12 PUSHACC1 
+      13 PUSHACC2 
+      14 MAKEFLOATBLOCK 3
+      16 POP 1
+      18 ATOM0 
+      19 SETGLOBAL T190-makefloatblock-3
+      21 STOP 
+**)
diff --git a/test/testinterp/t191-vectlength.ml b/test/testinterp/t191-vectlength.ml
new file mode 100644 (file)
index 0000000..16f7d78
--- /dev/null
@@ -0,0 +1,26 @@
+open Lib;;
+let x = 0.0 in
+if Array.length [| x |] <> 1 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0
+      11 PUSHCONST1 
+      12 PUSHACC1 
+      13 MAKEFLOATBLOCK 1
+      15 VECTLENGTH 
+      16 NEQ 
+      17 BRANCHIFNOT 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 POP 1
+      26 ATOM0 
+      27 SETGLOBAL T191-vectlength
+      29 STOP 
+**)
diff --git a/test/testinterp/t192-getfloatfield-1.ml b/test/testinterp/t192-getfloatfield-1.ml
new file mode 100644 (file)
index 0000000..ba002b2
--- /dev/null
@@ -0,0 +1,23 @@
+open Lib;;
+type t = { a : float; b : float };;
+
+if { a = 0.1; b = 0.2 }.a <> 0.1 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0.1
+      11 PUSHGETGLOBAL [|0.1, 0.2|]
+      13 GETFLOATFIELD 0
+      15 C_CALL2 neq_float
+      17 BRANCHIFNOT 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 ATOM0 
+      25 SETGLOBAL T192-getfloatfield-1
+      27 STOP 
+**)
diff --git a/test/testinterp/t192-getfloatfield-2.ml b/test/testinterp/t192-getfloatfield-2.ml
new file mode 100644 (file)
index 0000000..89230da
--- /dev/null
@@ -0,0 +1,23 @@
+open Lib;;
+type t = { a : float; b : float };;
+
+if { a = 0.1; b = 0.2 }.b <> 0.2 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0.2
+      11 PUSHGETGLOBAL [|0.1, 0.2|]
+      13 GETFLOATFIELD 1
+      15 C_CALL2 neq_float
+      17 BRANCHIFNOT 24
+      19 GETGLOBAL Not_found
+      21 MAKEBLOCK1 0
+      23 RAISE 
+      24 ATOM0 
+      25 SETGLOBAL T192-getfloatfield-2
+      27 STOP 
+**)
diff --git a/test/testinterp/t193-setfloatfield-1.ml b/test/testinterp/t193-setfloatfield-1.ml
new file mode 100644 (file)
index 0000000..b488e7d
--- /dev/null
@@ -0,0 +1,36 @@
+open Lib;;
+type t = {
+  mutable a : float;
+  mutable b : float;
+};;
+
+let x = { a = 0.1; b = 0.2 } in
+x.a <- 0.3;
+if x.a <> 0.3 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0.2
+      11 PUSHGETGLOBAL 0.1
+      13 MAKEFLOATBLOCK 2
+      15 PUSHGETGLOBAL 0.3
+      17 PUSHACC1 
+      18 SETFLOATFIELD 0
+      20 GETGLOBAL 0.3
+      22 PUSHACC1 
+      23 GETFLOATFIELD 0
+      25 C_CALL2 neq_float
+      27 BRANCHIFNOT 34
+      29 GETGLOBAL Not_found
+      31 MAKEBLOCK1 0
+      33 RAISE 
+      34 POP 1
+      36 ATOM0 
+      37 SETGLOBAL T193-setfloatfield-1
+      39 STOP 
+**)
diff --git a/test/testinterp/t193-setfloatfield-2.ml b/test/testinterp/t193-setfloatfield-2.ml
new file mode 100644 (file)
index 0000000..7dde0a2
--- /dev/null
@@ -0,0 +1,36 @@
+open Lib;;
+type t = {
+  mutable a : float;
+  mutable b : float;
+};;
+
+let x = { a = 0.1; b = 0.2 } in
+x.b <- 0.3;
+if x.b <> 0.3 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL 0.2
+      11 PUSHGETGLOBAL 0.1
+      13 MAKEFLOATBLOCK 2
+      15 PUSHGETGLOBAL 0.3
+      17 PUSHACC1 
+      18 SETFLOATFIELD 1
+      20 GETGLOBAL 0.3
+      22 PUSHACC1 
+      23 GETFLOATFIELD 1
+      25 C_CALL2 neq_float
+      27 BRANCHIFNOT 34
+      29 GETGLOBAL Not_found
+      31 MAKEBLOCK1 0
+      33 RAISE 
+      34 POP 1
+      36 ATOM0 
+      37 SETGLOBAL T193-setfloatfield-2
+      39 STOP 
+**)
diff --git a/test/testinterp/t200-getfield0.ml b/test/testinterp/t200-getfield0.ml
new file mode 100644 (file)
index 0000000..14ce1d5
--- /dev/null
@@ -0,0 +1,25 @@
+open Lib;;
+type t = {
+  a : int;
+};;
+
+if { a = 7 }.a <> 7 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 7
+      11 PUSHGETGLOBAL <0>(7)
+      13 GETFIELD0 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T200-getfield0
+      25 STOP 
+**)
diff --git a/test/testinterp/t200-getfield1.ml b/test/testinterp/t200-getfield1.ml
new file mode 100644 (file)
index 0000000..f4e2e01
--- /dev/null
@@ -0,0 +1,26 @@
+open Lib;;
+type t = {
+  a : int;
+  b : int;
+};;
+
+if { a = 7; b = 6 }.b <> 6 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 6
+      11 PUSHGETGLOBAL <0>(7, 6)
+      13 GETFIELD1 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T200-getfield1
+      25 STOP 
+**)
diff --git a/test/testinterp/t200-getfield2.ml b/test/testinterp/t200-getfield2.ml
new file mode 100644 (file)
index 0000000..df5c717
--- /dev/null
@@ -0,0 +1,27 @@
+open Lib;;
+type t = {
+  a : int;
+  b : int;
+  c : int;
+};;
+
+if { a = 7; b = 6; c = 5 }.c <> 5 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 5
+      11 PUSHGETGLOBAL <0>(7, 6, 5)
+      13 GETFIELD2 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T200-getfield2
+      25 STOP 
+**)
diff --git a/test/testinterp/t200-getfield3.ml b/test/testinterp/t200-getfield3.ml
new file mode 100644 (file)
index 0000000..a0376a1
--- /dev/null
@@ -0,0 +1,28 @@
+open Lib;;
+type t = {
+  a : int;
+  b : int;
+  c : int;
+  d : int;
+};;
+
+if { a = 7; b = 6; c = 5; d = 4 }.d <> 4 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 4
+      11 PUSHGETGLOBAL <0>(7, 6, 5, 4)
+      13 GETFIELD3 
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T200-getfield3
+      25 STOP 
+**)
diff --git a/test/testinterp/t201-getfield.ml b/test/testinterp/t201-getfield.ml
new file mode 100644 (file)
index 0000000..0fbbc63
--- /dev/null
@@ -0,0 +1,29 @@
+open Lib;;
+type t = {
+  a : int;
+  b : int;
+  c : int;
+  d : int;
+  e : int;
+};;
+
+if { a = 7; b = 6; c = 5; d = 4; e = 3 }.e <> 3 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST3 
+      10 PUSHGETGLOBAL <0>(7, 6, 5, 4, 3)
+      12 GETFIELD 4
+      14 NEQ 
+      15 BRANCHIFNOT 22
+      17 GETGLOBAL Not_found
+      19 MAKEBLOCK1 0
+      21 RAISE 
+      22 ATOM0 
+      23 SETGLOBAL T201-getfield
+      25 STOP 
+**)
diff --git a/test/testinterp/t210-setfield0.ml b/test/testinterp/t210-setfield0.ml
new file mode 100644 (file)
index 0000000..aa31d41
--- /dev/null
@@ -0,0 +1,36 @@
+open Lib;;
+type t = {
+  mutable a : int;
+};;
+
+let x = {a = 7} in
+x.a <- 11;
+if x.a <> 11 then raise Not_found;
+x
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 7
+      11 MAKEBLOCK1 0
+      13 PUSHCONSTINT 11
+      15 PUSHACC1 
+      16 SETFIELD0 
+      17 CONSTINT 11
+      19 PUSHACC1 
+      20 GETFIELD0 
+      21 NEQ 
+      22 BRANCHIFNOT 29
+      24 GETGLOBAL Not_found
+      26 MAKEBLOCK1 0
+      28 RAISE 
+      29 ACC0 
+      30 POP 1
+      32 ATOM0 
+      33 SETGLOBAL T210-setfield0
+      35 STOP 
+**)
diff --git a/test/testinterp/t210-setfield1.ml b/test/testinterp/t210-setfield1.ml
new file mode 100644 (file)
index 0000000..0d8e167
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+type t = {
+  mutable a : int;
+  mutable b : int;
+};;
+
+let x = {a = 7; b = 6} in
+x.b <- 11;
+if x.b <> 11 then raise Not_found;
+x
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 6
+      11 PUSHCONSTINT 7
+      13 MAKEBLOCK2 0
+      15 PUSHCONSTINT 11
+      17 PUSHACC1 
+      18 SETFIELD1 
+      19 CONSTINT 11
+      21 PUSHACC1 
+      22 GETFIELD1 
+      23 NEQ 
+      24 BRANCHIFNOT 31
+      26 GETGLOBAL Not_found
+      28 MAKEBLOCK1 0
+      30 RAISE 
+      31 ACC0 
+      32 POP 1
+      34 ATOM0 
+      35 SETGLOBAL T210-setfield1
+      37 STOP 
+**)
diff --git a/test/testinterp/t210-setfield2.ml b/test/testinterp/t210-setfield2.ml
new file mode 100644 (file)
index 0000000..727691d
--- /dev/null
@@ -0,0 +1,40 @@
+open Lib;;
+type t = {
+  mutable a : int;
+  mutable b : int;
+  mutable c : int;
+};;
+
+let x = {a = 7; b = 6; c = 5} in
+x.c <- 11;
+if x.c <> 11 then raise Not_found;
+x
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 5
+      11 PUSHCONSTINT 6
+      13 PUSHCONSTINT 7
+      15 MAKEBLOCK3 0
+      17 PUSHCONSTINT 11
+      19 PUSHACC1 
+      20 SETFIELD2 
+      21 CONSTINT 11
+      23 PUSHACC1 
+      24 GETFIELD2 
+      25 NEQ 
+      26 BRANCHIFNOT 33
+      28 GETGLOBAL Not_found
+      30 MAKEBLOCK1 0
+      32 RAISE 
+      33 ACC0 
+      34 POP 1
+      36 ATOM0 
+      37 SETGLOBAL T210-setfield2
+      39 STOP 
+**)
diff --git a/test/testinterp/t210-setfield3.ml b/test/testinterp/t210-setfield3.ml
new file mode 100644 (file)
index 0000000..d50d2c2
--- /dev/null
@@ -0,0 +1,42 @@
+open Lib;;
+type t = {
+  mutable a : int;
+  mutable b : int;
+  mutable c : int;
+  mutable d : int;
+};;
+
+let x = {a = 7; b = 6; c = 5; d = 4} in
+x.d <- 11;
+if x.d <> 11 then raise Not_found;
+x
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 4
+      11 PUSHCONSTINT 5
+      13 PUSHCONSTINT 6
+      15 PUSHCONSTINT 7
+      17 MAKEBLOCK 4, 0
+      20 PUSHCONSTINT 11
+      22 PUSHACC1 
+      23 SETFIELD3 
+      24 CONSTINT 11
+      26 PUSHACC1 
+      27 GETFIELD3 
+      28 NEQ 
+      29 BRANCHIFNOT 36
+      31 GETGLOBAL Not_found
+      33 MAKEBLOCK1 0
+      35 RAISE 
+      36 ACC0 
+      37 POP 1
+      39 ATOM0 
+      40 SETGLOBAL T210-setfield3
+      42 STOP 
+**)
diff --git a/test/testinterp/t211-setfield.ml b/test/testinterp/t211-setfield.ml
new file mode 100644 (file)
index 0000000..69c445e
--- /dev/null
@@ -0,0 +1,44 @@
+open Lib;;
+type t = {
+  mutable a : int;
+  mutable b : int;
+  mutable c : int;
+  mutable d : int;
+  mutable e : int;
+};;
+
+let x = {a = 7; b = 6; c = 5; d = 4; e = 5} in
+x.e <- 11;
+if x.e <> 11 then raise Not_found;
+x
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 5
+      11 PUSHCONSTINT 4
+      13 PUSHCONSTINT 5
+      15 PUSHCONSTINT 6
+      17 PUSHCONSTINT 7
+      19 MAKEBLOCK 5, 0
+      22 PUSHCONSTINT 11
+      24 PUSHACC1 
+      25 SETFIELD 4
+      27 CONSTINT 11
+      29 PUSHACC1 
+      30 GETFIELD 4
+      32 NEQ 
+      33 BRANCHIFNOT 40
+      35 GETGLOBAL Not_found
+      37 MAKEBLOCK1 0
+      39 RAISE 
+      40 ACC0 
+      41 POP 1
+      43 ATOM0 
+      44 SETGLOBAL T211-setfield
+      46 STOP 
+**)
diff --git a/test/testinterp/t220-assign.ml b/test/testinterp/t220-assign.ml
new file mode 100644 (file)
index 0000000..769f8fb
--- /dev/null
@@ -0,0 +1,27 @@
+open Lib;;
+let x = ref 1 in
+x := 3;
+if !x <> 3 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST1 
+      10 PUSHCONST3 
+      11 ASSIGN 0
+      13 CONST3 
+      14 PUSHACC1 
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 POP 1
+      25 ATOM0 
+      26 SETGLOBAL T220-assign
+      28 STOP 
+**)
diff --git a/test/testinterp/t230-check_signals.ml b/test/testinterp/t230-check_signals.ml
new file mode 100644 (file)
index 0000000..2c2b5d7
--- /dev/null
@@ -0,0 +1,28 @@
+open Lib;;
+for i = 0 to 0 do () done;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 PUSHCONST0 
+      11 PUSH 
+      12 BRANCH 21
+      14 CHECK_SIGNALS 
+      15 CONST0 
+      16 ACC1 
+      17 OFFSETINT 1
+      19 ASSIGN 1
+      21 ACC0 
+      22 PUSHACC2 
+      23 LEINT 
+      24 BRANCHIF 14
+      26 CONST0 
+      27 POP 2
+      29 ATOM0 
+      30 SETGLOBAL T230-check_signals
+      32 STOP 
+**)
diff --git a/test/testinterp/t240-c_call1.ml b/test/testinterp/t240-c_call1.ml
new file mode 100644 (file)
index 0000000..3c7508c
--- /dev/null
@@ -0,0 +1,21 @@
+open Lib;;
+if Pervasives.int_of_string "123" <> 123 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 123
+      11 PUSHGETGLOBAL "123"
+      13 C_CALL1 int_of_string
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T240-c_call1
+      26 STOP 
+**)
diff --git a/test/testinterp/t240-c_call2.ml b/test/testinterp/t240-c_call2.ml
new file mode 100644 (file)
index 0000000..23c9843
--- /dev/null
@@ -0,0 +1,22 @@
+open Lib;;
+if Pervasives.compare 1 2 <> -1 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT -1
+      11 PUSHCONST2 
+      12 PUSHCONST1 
+      13 C_CALL2 compare
+      15 NEQ 
+      16 BRANCHIFNOT 23
+      18 GETGLOBAL Not_found
+      20 MAKEBLOCK1 0
+      22 RAISE 
+      23 ATOM0 
+      24 SETGLOBAL T240-c_call2
+      26 STOP 
+**)
diff --git a/test/testinterp/t240-c_call3.ml b/test/testinterp/t240-c_call3.ml
new file mode 100644 (file)
index 0000000..707bc7e
--- /dev/null
@@ -0,0 +1,23 @@
+open Lib;;
+if Hashtbl.hash_param 5 6 [1;2;3] <> 196799 then raise Not_found;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 196799
+      11 PUSHGETGLOBAL <0>(1, <0>(2, <0>(3, 0)))
+      13 PUSHCONSTINT 6
+      15 PUSHCONSTINT 5
+      17 C_CALL3 hash_univ_param
+      19 NEQ 
+      20 BRANCHIFNOT 27
+      22 GETGLOBAL Not_found
+      24 MAKEBLOCK1 0
+      26 RAISE 
+      27 ATOM0 
+      28 SETGLOBAL T240-c_call3
+      30 STOP 
+**)
diff --git a/test/testinterp/t240-c_call4.ml b/test/testinterp/t240-c_call4.ml
new file mode 100644 (file)
index 0000000..2ab62d8
--- /dev/null
@@ -0,0 +1,32 @@
+open Lib;;
+let s = "abcdefgh" in
+String.unsafe_fill s 0 6 'x';
+if s.[5] <> 'x' then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL "abcdefgh"
+      11 PUSHCONSTINT 120
+      13 PUSHCONSTINT 6
+      15 PUSHCONST0 
+      16 PUSHACC3 
+      17 C_CALL4 fill_string
+      19 CONSTINT 120
+      21 PUSHCONSTINT 5
+      23 PUSHACC2 
+      24 GETSTRINGCHAR 
+      25 NEQ 
+      26 BRANCHIFNOT 33
+      28 GETGLOBAL Not_found
+      30 MAKEBLOCK1 0
+      32 RAISE 
+      33 POP 1
+      35 ATOM0 
+      36 SETGLOBAL T240-c_call4
+      38 STOP 
+**)
diff --git a/test/testinterp/t240-c_call5.ml b/test/testinterp/t240-c_call5.ml
new file mode 100644 (file)
index 0000000..e817d55
--- /dev/null
@@ -0,0 +1,33 @@
+open Lib;;
+let s = "abcdefgh" in
+String.unsafe_blit s 3 s 0 3;
+if s.[0] <> 'd' then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 GETGLOBAL "abcdefgh"
+      11 PUSHCONST3 
+      12 PUSHCONST0 
+      13 PUSHACC2 
+      14 PUSHCONST3 
+      15 PUSHACC4 
+      16 C_CALL5 blit_string
+      18 CONSTINT 100
+      20 PUSHCONST0 
+      21 PUSHACC2 
+      22 GETSTRINGCHAR 
+      23 NEQ 
+      24 BRANCHIFNOT 31
+      26 GETGLOBAL Not_found
+      28 MAKEBLOCK1 0
+      30 RAISE 
+      31 POP 1
+      33 ATOM0 
+      34 SETGLOBAL T240-c_call5
+      36 STOP 
+**)
diff --git a/test/testinterp/t250-closurerec-1.ml b/test/testinterp/t250-closurerec-1.ml
new file mode 100644 (file)
index 0000000..ded5036
--- /dev/null
@@ -0,0 +1,19 @@
+open Lib;;
+let rec f _ = 0;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 14
+      11 CONST0 
+      12 RETURN 1
+      14 CLOSUREREC 0, 11
+      18 ACC0 
+      19 MAKEBLOCK1 0
+      21 POP 1
+      23 SETGLOBAL T250-closurerec-1
+      25 STOP 
+**)
diff --git a/test/testinterp/t250-closurerec-2.ml b/test/testinterp/t250-closurerec-2.ml
new file mode 100644 (file)
index 0000000..97eac0c
--- /dev/null
@@ -0,0 +1,29 @@
+open Lib;;
+let rec f _ = 23 in
+if f 0 <> 23 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 15
+      11 CONSTINT 23
+      13 RETURN 1
+      15 CLOSUREREC 0, 11
+      19 CONSTINT 23
+      21 PUSHCONST0 
+      22 PUSHACC2 
+      23 APPLY1 
+      24 NEQ 
+      25 BRANCHIFNOT 32
+      27 GETGLOBAL Not_found
+      29 MAKEBLOCK1 0
+      31 RAISE 
+      32 POP 1
+      34 ATOM0 
+      35 SETGLOBAL T250-closurerec-2
+      37 STOP 
+**)
diff --git a/test/testinterp/t251-pushoffsetclosure0.ml b/test/testinterp/t251-pushoffsetclosure0.ml
new file mode 100644 (file)
index 0000000..b1c2555
--- /dev/null
@@ -0,0 +1,39 @@
+open Lib;;
+let rec f = function
+  | 0 -> 13
+  | n -> f 0
+in
+if f 5 <> 13 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 24
+      11 CONST0 
+      12 PUSHACC1 
+      13 EQ 
+      14 BRANCHIFNOT 20
+      16 CONSTINT 13
+      18 RETURN 1
+      20 CONST0 
+      21 PUSHOFFSETCLOSURE0 
+      22 APPTERM1 2
+      24 CLOSUREREC 0, 11
+      28 CONSTINT 13
+      30 PUSHCONSTINT 5
+      32 PUSHACC2 
+      33 APPLY1 
+      34 NEQ 
+      35 BRANCHIFNOT 42
+      37 GETGLOBAL Not_found
+      39 MAKEBLOCK1 0
+      41 RAISE 
+      42 POP 1
+      44 ATOM0 
+      45 SETGLOBAL T251-pushoffsetclosure0
+      47 STOP 
+**)
diff --git a/test/testinterp/t251-pushoffsetclosure2.ml b/test/testinterp/t251-pushoffsetclosure2.ml
new file mode 100644 (file)
index 0000000..0fbdd6e
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let rec f _ = g 0
+    and g _ = 4
+in
+if f 5 <> 4 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 19
+      11 CONST0 
+      12 PUSHOFFSETCLOSURE2 
+      13 APPTERM1 2
+      15 CONSTINT 4
+      17 RETURN 1
+      19 CLOSUREREC 0, 11, 15
+      24 CONSTINT 4
+      26 PUSHCONSTINT 5
+      28 PUSHACC3 
+      29 APPLY1 
+      30 NEQ 
+      31 BRANCHIFNOT 38
+      33 GETGLOBAL Not_found
+      35 MAKEBLOCK1 0
+      37 RAISE 
+      38 POP 2
+      40 ATOM0 
+      41 SETGLOBAL T251-pushoffsetclosure2
+      43 STOP 
+**)
diff --git a/test/testinterp/t251-pushoffsetclosurem2.ml b/test/testinterp/t251-pushoffsetclosurem2.ml
new file mode 100644 (file)
index 0000000..41ec196
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let rec f _ = 4
+    and g _ = f 2
+in
+if g 5 <> 4 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 19
+      11 CONSTINT 4
+      13 RETURN 1
+      15 CONST2 
+      16 PUSHOFFSETCLOSUREM2 
+      17 APPTERM1 2
+      19 CLOSUREREC 0, 11, 15
+      24 CONSTINT 4
+      26 PUSHCONSTINT 5
+      28 PUSHACC2 
+      29 APPLY1 
+      30 NEQ 
+      31 BRANCHIFNOT 38
+      33 GETGLOBAL Not_found
+      35 MAKEBLOCK1 0
+      37 RAISE 
+      38 POP 2
+      40 ATOM0 
+      41 SETGLOBAL T251-pushoffsetclosurem2
+      43 STOP 
+**)
diff --git a/test/testinterp/t252-pushoffsetclosure.ml b/test/testinterp/t252-pushoffsetclosure.ml
new file mode 100644 (file)
index 0000000..1887133
--- /dev/null
@@ -0,0 +1,38 @@
+open Lib;;
+let rec f x = x
+    and g _ = f 4
+    and h _ = f 6
+in
+if h 1 <> 6 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 25
+      11 ACC0 
+      12 RETURN 1
+      14 CONSTINT 4
+      16 PUSHOFFSETCLOSUREM2 
+      17 APPTERM1 2
+      19 CONSTINT 6
+      21 PUSHOFFSETCLOSURE -4
+      23 APPTERM1 2
+      25 CLOSUREREC 0, 11, 14, 19
+      31 CONSTINT 6
+      33 PUSHCONST1 
+      34 PUSHACC2 
+      35 APPLY1 
+      36 NEQ 
+      37 BRANCHIFNOT 44
+      39 GETGLOBAL Not_found
+      41 MAKEBLOCK1 0
+      43 RAISE 
+      44 POP 3
+      46 ATOM0 
+      47 SETGLOBAL T252-pushoffsetclosure
+      49 STOP 
+**)
diff --git a/test/testinterp/t253-offsetclosure0.ml b/test/testinterp/t253-offsetclosure0.ml
new file mode 100644 (file)
index 0000000..f6d12c6
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let rec f _ = g f
+    and g _ = 10
+in
+if f 3 <> 10 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 19
+      11 OFFSETCLOSURE0 
+      12 PUSHOFFSETCLOSURE2 
+      13 APPTERM1 2
+      15 CONSTINT 10
+      17 RETURN 1
+      19 CLOSUREREC 0, 11, 15
+      24 CONSTINT 10
+      26 PUSHCONST3 
+      27 PUSHACC3 
+      28 APPLY1 
+      29 NEQ 
+      30 BRANCHIFNOT 37
+      32 GETGLOBAL Not_found
+      34 MAKEBLOCK1 0
+      36 RAISE 
+      37 POP 2
+      39 ATOM0 
+      40 SETGLOBAL T253-offsetclosure0
+      42 STOP 
+**)
diff --git a/test/testinterp/t253-offsetclosure2.ml b/test/testinterp/t253-offsetclosure2.ml
new file mode 100644 (file)
index 0000000..be94061
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let rec f _ = g
+    and g _ = 10
+in
+if f 3 4 <> 10 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 18
+      11 OFFSETCLOSURE2 
+      12 RETURN 1
+      14 CONSTINT 10
+      16 RETURN 1
+      18 CLOSUREREC 0, 11, 14
+      23 CONSTINT 10
+      25 PUSHCONSTINT 4
+      27 PUSHCONST3 
+      28 PUSHACC4 
+      29 APPLY2 
+      30 NEQ 
+      31 BRANCHIFNOT 38
+      33 GETGLOBAL Not_found
+      35 MAKEBLOCK1 0
+      37 RAISE 
+      38 POP 2
+      40 ATOM0 
+      41 SETGLOBAL T253-offsetclosure2
+      43 STOP 
+**)
diff --git a/test/testinterp/t253-offsetclosurem2.ml b/test/testinterp/t253-offsetclosurem2.ml
new file mode 100644 (file)
index 0000000..cec3793
--- /dev/null
@@ -0,0 +1,34 @@
+open Lib;;
+let rec f _ = 11
+    and g _ = f
+in
+if g 3 4 <> 11 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 18
+      11 CONSTINT 11
+      13 RETURN 1
+      15 OFFSETCLOSUREM2 
+      16 RETURN 1
+      18 CLOSUREREC 0, 11, 15
+      23 CONSTINT 11
+      25 PUSHCONSTINT 4
+      27 PUSHCONST3 
+      28 PUSHACC3 
+      29 APPLY2 
+      30 NEQ 
+      31 BRANCHIFNOT 38
+      33 GETGLOBAL Not_found
+      35 MAKEBLOCK1 0
+      37 RAISE 
+      38 POP 2
+      40 ATOM0 
+      41 SETGLOBAL T253-offsetclosurem2
+      43 STOP 
+**)
diff --git a/test/testinterp/t254-offsetclosure.ml b/test/testinterp/t254-offsetclosure.ml
new file mode 100644 (file)
index 0000000..6da8c28
--- /dev/null
@@ -0,0 +1,37 @@
+open Lib;;
+let rec f _ = 11
+    and g _ = 0
+    and h _ = f
+in
+if h 3 4 <> 11 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 22
+      11 CONSTINT 11
+      13 RETURN 1
+      15 CONST0 
+      16 RETURN 1
+      18 OFFSETCLOSURE -4
+      20 RETURN 1
+      22 CLOSUREREC 0, 11, 15, 18
+      28 CONSTINT 11
+      30 PUSHCONSTINT 4
+      32 PUSHCONST3 
+      33 PUSHACC3 
+      34 APPLY2 
+      35 NEQ 
+      36 BRANCHIFNOT 43
+      38 GETGLOBAL Not_found
+      40 MAKEBLOCK1 0
+      42 RAISE 
+      43 POP 3
+      45 ATOM0 
+      46 SETGLOBAL T254-offsetclosure
+      48 STOP 
+**)
diff --git a/test/testinterp/t260-offsetref.ml b/test/testinterp/t260-offsetref.ml
new file mode 100644 (file)
index 0000000..968892e
--- /dev/null
@@ -0,0 +1,31 @@
+open Lib;;
+let x = ref 32 in
+incr x;
+if !x <> 33 then raise Not_found;
+x
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONSTINT 32
+      11 MAKEBLOCK1 0
+      13 PUSHACC0 
+      14 OFFSETREF 1
+      16 CONSTINT 33
+      18 PUSHACC1 
+      19 GETFIELD0 
+      20 NEQ 
+      21 BRANCHIFNOT 28
+      23 GETGLOBAL Not_found
+      25 MAKEBLOCK1 0
+      27 RAISE 
+      28 ACC0 
+      29 POP 1
+      31 ATOM0 
+      32 SETGLOBAL T260-offsetref
+      34 STOP 
+**)
diff --git a/test/testinterp/t270-push_retaddr.ml b/test/testinterp/t270-push_retaddr.ml
new file mode 100644 (file)
index 0000000..0c7fb36
--- /dev/null
@@ -0,0 +1,36 @@
+open Lib;;
+let f a b c d = 123 in
+if f 0 1 2 3 <> 123 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 18
+      11 RESTART 
+      12 GRAB 3
+      14 CONSTINT 123
+      16 RETURN 4
+      18 CLOSURE 0, 12
+      21 PUSHCONSTINT 123
+      23 PUSH 
+      24 PUSH_RETADDR 34
+      26 CONST3 
+      27 PUSHCONST2 
+      28 PUSHCONST1 
+      29 PUSHCONST0 
+      30 PUSHACC 8
+      32 APPLY 4
+      34 NEQ 
+      35 BRANCHIFNOT 42
+      37 GETGLOBAL Not_found
+      39 MAKEBLOCK1 0
+      41 RAISE 
+      42 POP 1
+      44 ATOM0 
+      45 SETGLOBAL T270-push_retaddr
+      47 STOP 
+**)
diff --git a/test/testinterp/t300-getmethod.ml b/test/testinterp/t300-getmethod.ml
new file mode 100644 (file)
index 0000000..e789473
--- /dev/null
@@ -0,0 +1,5885 @@
+open Lib;;
+
+class c = object
+  method m = 23
+end;;
+
+let o = new c in
+if o#m <> 23 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 3341
+    2406 RESTART 
+    2407 GRAB 2
+    2409 ACC2 
+    2410 PUSHACC2 
+    2411 VECTLENGTH 
+    2412 OFFSETINT -1
+    2414 PUSHCONST0 
+    2415 PUSH 
+    2416 BRANCH 2433
+    2418 CHECK_SIGNALS 
+    2419 ACC2 
+    2420 PUSHACC2 
+    2421 PUSHACC6 
+    2422 C_CALL2 array_unsafe_get
+    2424 PUSHACC5 
+    2425 APPLY2 
+    2426 ASSIGN 2
+    2428 ACC1 
+    2429 OFFSETINT -1
+    2431 ASSIGN 1
+    2433 ACC0 
+    2434 PUSHACC2 
+    2435 GEINT 
+    2436 BRANCHIF 2418
+    2438 CONST0 
+    2439 POP 2
+    2441 ACC0 
+    2442 RETURN 4
+    2444 RESTART 
+    2445 GRAB 2
+    2447 ACC1 
+    2448 PUSHCONST0 
+    2449 PUSHACC4 
+    2450 VECTLENGTH 
+    2451 OFFSETINT -1
+    2453 PUSH 
+    2454 BRANCH 2471
+    2456 CHECK_SIGNALS 
+    2457 ACC1 
+    2458 PUSHACC6 
+    2459 C_CALL2 array_unsafe_get
+    2461 PUSHACC3 
+    2462 PUSHACC5 
+    2463 APPLY2 
+    2464 ASSIGN 2
+    2466 ACC1 
+    2467 OFFSETINT 1
+    2469 ASSIGN 1
+    2471 ACC0 
+    2472 PUSHACC2 
+    2473 LEINT 
+    2474 BRANCHIF 2456
+    2476 CONST0 
+    2477 POP 2
+    2479 ACC0 
+    2480 RETURN 4
+    2482 RESTART 
+    2483 GRAB 1
+    2485 ACC1 
+    2486 BRANCHIFNOT 2502
+    2488 ACC1 
+    2489 GETFIELD0 
+    2490 PUSHACC1 
+    2491 PUSHENVACC1 
+    2492 C_CALL3 array_unsafe_set
+    2494 ACC1 
+    2495 GETFIELD1 
+    2496 PUSHACC1 
+    2497 OFFSETINT 1
+    2499 PUSHOFFSETCLOSURE0 
+    2500 APPTERM2 4
+    2502 ENVACC1 
+    2503 RETURN 2
+    2505 ACC0 
+    2506 BRANCHIFNOT 2531
+    2508 ACC0 
+    2509 GETFIELD1 
+    2510 PUSHACC1 
+    2511 GETFIELD0 
+    2512 PUSHACC1 
+    2513 PUSHGETGLOBALFIELD List, 0
+    2516 APPLY1 
+    2517 OFFSETINT 1
+    2519 C_CALL2 make_vect
+    2521 PUSHACC0 
+    2522 CLOSUREREC 1, 2483
+    2526 ACC2 
+    2527 PUSHCONST1 
+    2528 PUSHACC2 
+    2529 APPTERM2 6
+    2531 ATOM0 
+    2532 RETURN 1
+    2534 RESTART 
+    2535 GRAB 1
+    2537 CONST0 
+    2538 PUSHACC1 
+    2539 LTINT 
+    2540 BRANCHIFNOT 2545
+    2542 ACC1 
+    2543 RETURN 2
+    2545 ACC1 
+    2546 PUSHACC1 
+    2547 PUSHENVACC1 
+    2548 C_CALL2 array_unsafe_get
+    2550 MAKEBLOCK2 0
+    2552 PUSHACC1 
+    2553 OFFSETINT -1
+    2555 PUSHOFFSETCLOSURE0 
+    2556 APPTERM2 4
+    2558 ACC0 
+    2559 CLOSUREREC 1, 2535
+    2563 CONST0 
+    2564 PUSHACC2 
+    2565 VECTLENGTH 
+    2566 OFFSETINT -1
+    2568 PUSHACC2 
+    2569 APPTERM2 4
+    2571 RESTART 
+    2572 GRAB 1
+    2574 ACC1 
+    2575 VECTLENGTH 
+    2576 PUSHCONST0 
+    2577 PUSHACC1 
+    2578 EQ 
+    2579 BRANCHIFNOT 2584
+    2581 ATOM0 
+    2582 RETURN 3
+    2584 CONST0 
+    2585 PUSHACC3 
+    2586 C_CALL2 array_unsafe_get
+    2588 PUSHCONST0 
+    2589 PUSHACC3 
+    2590 APPLY2 
+    2591 PUSHACC1 
+    2592 C_CALL2 make_vect
+    2594 PUSHCONST1 
+    2595 PUSHACC2 
+    2596 OFFSETINT -1
+    2598 PUSH 
+    2599 BRANCH 2618
+    2601 CHECK_SIGNALS 
+    2602 ACC1 
+    2603 PUSHACC6 
+    2604 C_CALL2 array_unsafe_get
+    2606 PUSHACC2 
+    2607 PUSHACC6 
+    2608 APPLY2 
+    2609 PUSHACC2 
+    2610 PUSHACC4 
+    2611 C_CALL3 array_unsafe_set
+    2613 ACC1 
+    2614 OFFSETINT 1
+    2616 ASSIGN 1
+    2618 ACC0 
+    2619 PUSHACC2 
+    2620 LEINT 
+    2621 BRANCHIF 2601
+    2623 CONST0 
+    2624 POP 2
+    2626 ACC0 
+    2627 RETURN 4
+    2629 RESTART 
+    2630 GRAB 1
+    2632 CONST0 
+    2633 PUSHACC2 
+    2634 VECTLENGTH 
+    2635 OFFSETINT -1
+    2637 PUSH 
+    2638 BRANCH 2653
+    2640 CHECK_SIGNALS 
+    2641 ACC1 
+    2642 PUSHACC4 
+    2643 C_CALL2 array_unsafe_get
+    2645 PUSHACC2 
+    2646 PUSHACC4 
+    2647 APPLY2 
+    2648 ACC1 
+    2649 OFFSETINT 1
+    2651 ASSIGN 1
+    2653 ACC0 
+    2654 PUSHACC2 
+    2655 LEINT 
+    2656 BRANCHIF 2640
+    2658 CONST0 
+    2659 RETURN 4
+    2661 RESTART 
+    2662 GRAB 1
+    2664 ACC1 
+    2665 VECTLENGTH 
+    2666 PUSHCONST0 
+    2667 PUSHACC1 
+    2668 EQ 
+    2669 BRANCHIFNOT 2674
+    2671 ATOM0 
+    2672 RETURN 3
+    2674 CONST0 
+    2675 PUSHACC3 
+    2676 C_CALL2 array_unsafe_get
+    2678 PUSHACC2 
+    2679 APPLY1 
+    2680 PUSHACC1 
+    2681 C_CALL2 make_vect
+    2683 PUSHCONST1 
+    2684 PUSHACC2 
+    2685 OFFSETINT -1
+    2687 PUSH 
+    2688 BRANCH 2706
+    2690 CHECK_SIGNALS 
+    2691 ACC1 
+    2692 PUSHACC6 
+    2693 C_CALL2 array_unsafe_get
+    2695 PUSHACC5 
+    2696 APPLY1 
+    2697 PUSHACC2 
+    2698 PUSHACC4 
+    2699 C_CALL3 array_unsafe_set
+    2701 ACC1 
+    2702 OFFSETINT 1
+    2704 ASSIGN 1
+    2706 ACC0 
+    2707 PUSHACC2 
+    2708 LEINT 
+    2709 BRANCHIF 2690
+    2711 CONST0 
+    2712 POP 2
+    2714 ACC0 
+    2715 RETURN 4
+    2717 RESTART 
+    2718 GRAB 1
+    2720 CONST0 
+    2721 PUSHACC2 
+    2722 VECTLENGTH 
+    2723 OFFSETINT -1
+    2725 PUSH 
+    2726 BRANCH 2740
+    2728 CHECK_SIGNALS 
+    2729 ACC1 
+    2730 PUSHACC4 
+    2731 C_CALL2 array_unsafe_get
+    2733 PUSHACC3 
+    2734 APPLY1 
+    2735 ACC1 
+    2736 OFFSETINT 1
+    2738 ASSIGN 1
+    2740 ACC0 
+    2741 PUSHACC2 
+    2742 LEINT 
+    2743 BRANCHIF 2728
+    2745 CONST0 
+    2746 RETURN 4
+    2748 RESTART 
+    2749 GRAB 4
+    2751 CONST0 
+    2752 PUSHACC5 
+    2753 LTINT 
+    2754 BRANCHIF 2782
+    2756 CONST0 
+    2757 PUSHACC2 
+    2758 LTINT 
+    2759 BRANCHIF 2782
+    2761 ACC0 
+    2762 VECTLENGTH 
+    2763 PUSHACC5 
+    2764 PUSHACC3 
+    2765 ADDINT 
+    2766 GTINT 
+    2767 BRANCHIF 2782
+    2769 CONST0 
+    2770 PUSHACC4 
+    2771 LTINT 
+    2772 BRANCHIF 2782
+    2774 ACC2 
+    2775 VECTLENGTH 
+    2776 PUSHACC5 
+    2777 PUSHACC5 
+    2778 ADDINT 
+    2779 GTINT 
+    2780 BRANCHIFNOT 2789
+    2782 GETGLOBAL "Array.blit"
+    2784 PUSHGETGLOBALFIELD Pervasives, 2
+    2787 APPTERM1 6
+    2789 ACC3 
+    2790 PUSHACC2 
+    2791 LTINT 
+    2792 BRANCHIFNOT 2827
+    2794 ACC4 
+    2795 OFFSETINT -1
+    2797 PUSHCONST0 
+    2798 PUSH 
+    2799 BRANCH 2819
+    2801 CHECK_SIGNALS 
+    2802 ACC1 
+    2803 PUSHACC4 
+    2804 ADDINT 
+    2805 PUSHACC3 
+    2806 C_CALL2 array_unsafe_get
+    2808 PUSHACC2 
+    2809 PUSHACC7 
+    2810 ADDINT 
+    2811 PUSHACC6 
+    2812 C_CALL3 array_unsafe_set
+    2814 ACC1 
+    2815 OFFSETINT -1
+    2817 ASSIGN 1
+    2819 ACC0 
+    2820 PUSHACC2 
+    2821 GEINT 
+    2822 BRANCHIF 2801
+    2824 CONST0 
+    2825 RETURN 7
+    2827 CONST0 
+    2828 PUSHACC5 
+    2829 OFFSETINT -1
+    2831 PUSH 
+    2832 BRANCH 2852
+    2834 CHECK_SIGNALS 
+    2835 ACC1 
+    2836 PUSHACC4 
+    2837 ADDINT 
+    2838 PUSHACC3 
+    2839 C_CALL2 array_unsafe_get
+    2841 PUSHACC2 
+    2842 PUSHACC7 
+    2843 ADDINT 
+    2844 PUSHACC6 
+    2845 C_CALL3 array_unsafe_set
+    2847 ACC1 
+    2848 OFFSETINT 1
+    2850 ASSIGN 1
+    2852 ACC0 
+    2853 PUSHACC2 
+    2854 LEINT 
+    2855 BRANCHIF 2834
+    2857 CONST0 
+    2858 RETURN 7
+    2860 RESTART 
+    2861 GRAB 3
+    2863 CONST0 
+    2864 PUSHACC2 
+    2865 LTINT 
+    2866 BRANCHIF 2881
+    2868 CONST0 
+    2869 PUSHACC3 
+    2870 LTINT 
+    2871 BRANCHIF 2881
+    2873 ACC0 
+    2874 VECTLENGTH 
+    2875 PUSHACC3 
+    2876 PUSHACC3 
+    2877 ADDINT 
+    2878 GTINT 
+    2879 BRANCHIFNOT 2888
+    2881 GETGLOBAL "Array.fill"
+    2883 PUSHGETGLOBALFIELD Pervasives, 2
+    2886 APPTERM1 5
+    2888 ACC1 
+    2889 PUSHACC3 
+    2890 PUSHACC3 
+    2891 ADDINT 
+    2892 OFFSETINT -1
+    2894 PUSH 
+    2895 BRANCH 2908
+    2897 CHECK_SIGNALS 
+    2898 ACC5 
+    2899 PUSHACC2 
+    2900 PUSHACC4 
+    2901 C_CALL3 array_unsafe_set
+    2903 ACC1 
+    2904 OFFSETINT 1
+    2906 ASSIGN 1
+    2908 ACC0 
+    2909 PUSHACC2 
+    2910 LEINT 
+    2911 BRANCHIF 2897
+    2913 CONST0 
+    2914 RETURN 6
+    2916 RESTART 
+    2917 GRAB 2
+    2919 CONST0 
+    2920 PUSHACC2 
+    2921 LTINT 
+    2922 BRANCHIF 2937
+    2924 CONST0 
+    2925 PUSHACC3 
+    2926 LTINT 
+    2927 BRANCHIF 2937
+    2929 ACC0 
+    2930 VECTLENGTH 
+    2931 PUSHACC3 
+    2932 PUSHACC3 
+    2933 ADDINT 
+    2934 GTINT 
+    2935 BRANCHIFNOT 2944
+    2937 GETGLOBAL "Array.sub"
+    2939 PUSHGETGLOBALFIELD Pervasives, 2
+    2942 APPTERM1 4
+    2944 CONST0 
+    2945 PUSHACC3 
+    2946 EQ 
+    2947 BRANCHIFNOT 2952
+    2949 ATOM0 
+    2950 RETURN 3
+    2952 ACC1 
+    2953 PUSHACC1 
+    2954 C_CALL2 array_unsafe_get
+    2956 PUSHACC3 
+    2957 C_CALL2 make_vect
+    2959 PUSHCONST1 
+    2960 PUSHACC4 
+    2961 OFFSETINT -1
+    2963 PUSH 
+    2964 BRANCH 2982
+    2966 CHECK_SIGNALS 
+    2967 ACC1 
+    2968 PUSHACC5 
+    2969 ADDINT 
+    2970 PUSHACC4 
+    2971 C_CALL2 array_unsafe_get
+    2973 PUSHACC2 
+    2974 PUSHACC4 
+    2975 C_CALL3 array_unsafe_set
+    2977 ACC1 
+    2978 OFFSETINT 1
+    2980 ASSIGN 1
+    2982 ACC0 
+    2983 PUSHACC2 
+    2984 LEINT 
+    2985 BRANCHIF 2966
+    2987 CONST0 
+    2988 POP 2
+    2990 ACC0 
+    2991 RETURN 4
+    2993 ACC0 
+    2994 BRANCHIFNOT 3017
+    2996 ACC0 
+    2997 GETFIELD0 
+    2998 PUSHCONST0 
+    2999 PUSHACC1 
+    3000 VECTLENGTH 
+    3001 GTINT 
+    3002 BRANCHIFNOT 3012
+    3004 ENVACC2 
+    3005 PUSHCONST0 
+    3006 PUSHACC2 
+    3007 C_CALL2 array_unsafe_get
+    3009 PUSHENVACC1 
+    3010 APPTERM2 4
+    3012 ACC1 
+    3013 GETFIELD1 
+    3014 PUSHOFFSETCLOSURE0 
+    3015 APPTERM1 3
+    3017 ATOM0 
+    3018 RETURN 1
+    3020 ACC0 
+    3021 PUSHENVACC1 
+    3022 CLOSUREREC 2, 2993
+    3026 ACC1 
+    3027 PUSHACC1 
+    3028 APPTERM1 3
+    3030 CONST0 
+    3031 PUSHACC1 
+    3032 VECTLENGTH 
+    3033 OFFSETINT -1
+    3035 PUSH 
+    3036 BRANCH 3056
+    3038 CHECK_SIGNALS 
+    3039 ACC1 
+    3040 PUSHACC3 
+    3041 C_CALL2 array_unsafe_get
+    3043 PUSHENVACC2 
+    3044 GETFIELD0 
+    3045 PUSHENVACC1 
+    3046 C_CALL3 array_unsafe_set
+    3048 ENVACC2 
+    3049 OFFSETREF 1
+    3051 ACC1 
+    3052 OFFSETINT 1
+    3054 ASSIGN 1
+    3056 ACC0 
+    3057 PUSHACC2 
+    3058 LEINT 
+    3059 BRANCHIF 3038
+    3061 CONST0 
+    3062 RETURN 3
+    3064 RESTART 
+    3065 GRAB 1
+    3067 ACC1 
+    3068 VECTLENGTH 
+    3069 PUSHACC1 
+    3070 ADDINT 
+    3071 RETURN 2
+    3073 RESTART 
+    3074 GRAB 1
+    3076 ACC1 
+    3077 PUSHCONST0 
+    3078 PUSH 
+    3079 CLOSURE 0, 3065
+    3082 PUSHGETGLOBALFIELD List, 12
+    3085 APPLY3 
+    3086 PUSHACC1 
+    3087 PUSHACC1 
+    3088 C_CALL2 make_vect
+    3090 PUSHCONST0 
+    3091 MAKEBLOCK1 0
+    3093 PUSHACC4 
+    3094 PUSHACC1 
+    3095 PUSHACC3 
+    3096 CLOSURE 2, 3030
+    3099 PUSHGETGLOBALFIELD List, 9
+    3102 APPLY2 
+    3103 ACC1 
+    3104 RETURN 5
+    3106 RESTART 
+    3107 GRAB 1
+    3109 ACC0 
+    3110 VECTLENGTH 
+    3111 PUSHACC2 
+    3112 VECTLENGTH 
+    3113 PUSHCONST0 
+    3114 PUSHACC2 
+    3115 EQ 
+    3116 BRANCHIFNOT 3126
+    3118 CONST0 
+    3119 PUSHACC1 
+    3120 EQ 
+    3121 BRANCHIFNOT 3126
+    3123 ATOM0 
+    3124 RETURN 4
+    3126 CONST0 
+    3127 PUSHCONST0 
+    3128 PUSHACC3 
+    3129 GTINT 
+    3130 BRANCHIFNOT 3135
+    3132 ACC3 
+    3133 BRANCH 3136
+    3135 ACC4 
+    3136 C_CALL2 array_unsafe_get
+    3138 PUSHACC1 
+    3139 PUSHACC3 
+    3140 ADDINT 
+    3141 C_CALL2 make_vect
+    3143 PUSHCONST0 
+    3144 PUSHACC3 
+    3145 OFFSETINT -1
+    3147 PUSH 
+    3148 BRANCH 3164
+    3150 CHECK_SIGNALS 
+    3151 ACC1 
+    3152 PUSHACC6 
+    3153 C_CALL2 array_unsafe_get
+    3155 PUSHACC2 
+    3156 PUSHACC4 
+    3157 C_CALL3 array_unsafe_set
+    3159 ACC1 
+    3160 OFFSETINT 1
+    3162 ASSIGN 1
+    3164 ACC0 
+    3165 PUSHACC2 
+    3166 LEINT 
+    3167 BRANCHIF 3150
+    3169 CONST0 
+    3170 POP 2
+    3172 CONST0 
+    3173 PUSHACC2 
+    3174 OFFSETINT -1
+    3176 PUSH 
+    3177 BRANCH 3195
+    3179 CHECK_SIGNALS 
+    3180 ACC1 
+    3181 PUSHACC7 
+    3182 C_CALL2 array_unsafe_get
+    3184 PUSHACC5 
+    3185 PUSHACC3 
+    3186 ADDINT 
+    3187 PUSHACC4 
+    3188 C_CALL3 array_unsafe_set
+    3190 ACC1 
+    3191 OFFSETINT 1
+    3193 ASSIGN 1
+    3195 ACC0 
+    3196 PUSHACC2 
+    3197 LEINT 
+    3198 BRANCHIF 3179
+    3200 CONST0 
+    3201 POP 2
+    3203 ACC0 
+    3204 RETURN 5
+    3206 ACC0 
+    3207 VECTLENGTH 
+    3208 PUSHCONST0 
+    3209 PUSHACC1 
+    3210 EQ 
+    3211 BRANCHIFNOT 3216
+    3213 ATOM0 
+    3214 RETURN 2
+    3216 CONST0 
+    3217 PUSHACC2 
+    3218 C_CALL2 array_unsafe_get
+    3220 PUSHACC1 
+    3221 C_CALL2 make_vect
+    3223 PUSHCONST1 
+    3224 PUSHACC2 
+    3225 OFFSETINT -1
+    3227 PUSH 
+    3228 BRANCH 3244
+    3230 CHECK_SIGNALS 
+    3231 ACC1 
+    3232 PUSHACC5 
+    3233 C_CALL2 array_unsafe_get
+    3235 PUSHACC2 
+    3236 PUSHACC4 
+    3237 C_CALL3 array_unsafe_set
+    3239 ACC1 
+    3240 OFFSETINT 1
+    3242 ASSIGN 1
+    3244 ACC0 
+    3245 PUSHACC2 
+    3246 LEINT 
+    3247 BRANCHIF 3230
+    3249 CONST0 
+    3250 POP 2
+    3252 ACC0 
+    3253 RETURN 3
+    3255 RESTART 
+    3256 GRAB 2
+    3258 ATOM0 
+    3259 PUSHACC1 
+    3260 C_CALL2 make_vect
+    3262 PUSHCONST0 
+    3263 PUSHACC2 
+    3264 OFFSETINT -1
+    3266 PUSH 
+    3267 BRANCH 3282
+    3269 CHECK_SIGNALS 
+    3270 ACC5 
+    3271 PUSHACC5 
+    3272 C_CALL2 make_vect
+    3274 PUSHACC2 
+    3275 PUSHACC4 
+    3276 SETVECTITEM 
+    3277 ACC1 
+    3278 OFFSETINT 1
+    3280 ASSIGN 1
+    3282 ACC0 
+    3283 PUSHACC2 
+    3284 LEINT 
+    3285 BRANCHIF 3269
+    3287 CONST0 
+    3288 POP 2
+    3290 ACC0 
+    3291 RETURN 4
+    3293 RESTART 
+    3294 GRAB 1
+    3296 CONST0 
+    3297 PUSHACC1 
+    3298 EQ 
+    3299 BRANCHIFNOT 3304
+    3301 ATOM0 
+    3302 RETURN 2
+    3304 CONST0 
+    3305 PUSHACC2 
+    3306 APPLY1 
+    3307 PUSHACC1 
+    3308 C_CALL2 make_vect
+    3310 PUSHCONST1 
+    3311 PUSHACC2 
+    3312 OFFSETINT -1
+    3314 PUSH 
+    3315 BRANCH 3330
+    3317 CHECK_SIGNALS 
+    3318 ACC1 
+    3319 PUSHACC5 
+    3320 APPLY1 
+    3321 PUSHACC2 
+    3322 PUSHACC4 
+    3323 C_CALL3 array_unsafe_set
+    3325 ACC1 
+    3326 OFFSETINT 1
+    3328 ASSIGN 1
+    3330 ACC0 
+    3331 PUSHACC2 
+    3332 LEINT 
+    3333 BRANCHIF 3317
+    3335 CONST0 
+    3336 POP 2
+    3338 ACC0 
+    3339 RETURN 3
+    3341 CLOSURE 0, 3294
+    3344 PUSH 
+    3345 CLOSURE 0, 3256
+    3348 PUSH 
+    3349 CLOSURE 0, 3206
+    3352 PUSH 
+    3353 CLOSURE 0, 3107
+    3356 PUSH 
+    3357 CLOSURE 0, 3074
+    3360 PUSHACC0 
+    3361 CLOSURE 1, 3020
+    3364 PUSH 
+    3365 CLOSURE 0, 2917
+    3368 PUSH 
+    3369 CLOSURE 0, 2861
+    3372 PUSH 
+    3373 CLOSURE 0, 2749
+    3376 PUSH 
+    3377 CLOSURE 0, 2718
+    3380 PUSH 
+    3381 CLOSURE 0, 2662
+    3384 PUSH 
+    3385 CLOSURE 0, 2630
+    3388 PUSH 
+    3389 CLOSURE 0, 2572
+    3392 PUSH 
+    3393 CLOSURE 0, 2558
+    3396 PUSH 
+    3397 CLOSURE 0, 2505
+    3400 PUSH 
+    3401 CLOSURE 0, 2445
+    3404 PUSH 
+    3405 CLOSURE 0, 2407
+    3408 PUSHACC0 
+    3409 PUSHACC2 
+    3410 PUSHACC6 
+    3411 PUSHACC 8
+    3413 PUSHACC 10
+    3415 PUSHACC 12
+    3417 PUSHACC 8
+    3419 PUSHACC 10
+    3421 PUSHACC 16
+    3423 PUSHACC 18
+    3425 PUSHACC 24
+    3427 PUSHACC 21
+    3429 PUSHACC 23
+    3431 PUSHACC 26
+    3433 PUSHACC 29
+    3435 PUSHACC 30
+    3437 PUSHACC 32
+    3439 MAKEBLOCK 17, 0
+    3442 POP 17
+    3444 SETGLOBAL Array
+    3446 BRANCH 3480
+    3448 ENVACC1 
+    3449 MAKEBLOCK1 0
+    3451 RAISE 
+    3452 ACC0 
+    3453 BRANCHIFNOT 3465
+    3455 ENVACC3 
+    3456 CLOSURE 1, 3448
+    3459 MAKEBLOCK1 0
+    3461 PUSHENVACC2 
+    3462 PUSHENVACC1 
+    3463 APPTERM2 3
+    3465 CONST0 
+    3466 PUSHENVACC2 
+    3467 PUSHENVACC1 
+    3468 APPTERM2 3
+    3470 RESTART 
+    3471 GRAB 1
+    3473 ACC1 
+    3474 PUSHACC1 
+    3475 C_CALL2 install_signal_handler
+    3477 CONST0 
+    3478 RETURN 2
+    3480 CONST0 
+    3481 C_CALL1 sys_get_argv
+    3483 PUSHCONST0 
+    3484 C_CALL1 sys_get_config
+    3486 PUSHACC0 
+    3487 GETFIELD1 
+    3488 PUSHACC0 
+    3489 OFFSETINT -10
+    3491 PUSHCONST1 
+    3492 LSLINT 
+    3493 OFFSETINT -1
+    3495 PUSHACC0 
+    3496 PUSHCONSTINT 8
+    3498 PUSHACC3 
+    3499 DIVINT 
+    3500 MULINT 
+    3501 OFFSETINT -1
+    3503 PUSHCONST0 
+    3504 MAKEBLOCK1 0
+    3506 PUSH 
+    3507 CLOSURE 0, 3471
+    3510 PUSHCONSTINT -1
+    3512 PUSHCONSTINT -2
+    3514 PUSHCONSTINT -3
+    3516 PUSHCONSTINT -4
+    3518 PUSHCONSTINT -5
+    3520 PUSHCONSTINT -6
+    3522 PUSHCONSTINT -7
+    3524 PUSHCONSTINT -8
+    3526 PUSHCONSTINT -9
+    3528 PUSHCONSTINT -10
+    3530 PUSHCONSTINT -11
+    3532 PUSHCONSTINT -12
+    3534 PUSHCONSTINT -13
+    3536 PUSHCONSTINT -14
+    3538 PUSHCONSTINT -15
+    3540 PUSHCONSTINT -16
+    3542 PUSHCONSTINT -17
+    3544 PUSHCONSTINT -18
+    3546 PUSHCONSTINT -19
+    3548 PUSHCONSTINT -20
+    3550 PUSHCONSTINT -21
+    3552 PUSHGETGLOBAL "Sys.Break"
+    3554 MAKEBLOCK1 0
+    3556 PUSHACC0 
+    3557 PUSHACC 17
+    3559 PUSHACC 24
+    3561 CLOSURE 3, 3452
+    3564 PUSHACC0 
+    3565 PUSHACC2 
+    3566 PUSHACC4 
+    3567 PUSHACC6 
+    3568 PUSHACC 8
+    3570 PUSHACC 10
+    3572 PUSHACC 12
+    3574 PUSHACC 14
+    3576 PUSHACC 16
+    3578 PUSHACC 18
+    3580 PUSHACC 20
+    3582 PUSHACC 22
+    3584 PUSHACC 24
+    3586 PUSHACC 26
+    3588 PUSHACC 28
+    3590 PUSHACC 30
+    3592 PUSHACC 32
+    3594 PUSHACC 34
+    3596 PUSHACC 36
+    3598 PUSHACC 38
+    3600 PUSHACC 40
+    3602 PUSHACC 42
+    3604 PUSHACC 44
+    3606 PUSHACC 46
+    3608 PUSHACC 50
+    3610 PUSHACC 50
+    3612 PUSHACC 53
+    3614 PUSHACC 55
+    3616 GETFIELD0 
+    3617 PUSHACC 52
+    3619 PUSHACC 58
+    3621 MAKEBLOCK 30, 0
+    3624 POP 30
+    3626 SETGLOBAL Sys
+    3628 BRANCH 4510
+    3630 RESTART 
+    3631 GRAB 1
+    3633 CONST0 
+    3634 PUSHACC1 
+    3635 LTINT 
+    3636 BRANCHIFNOT 3641
+    3638 CONST1 
+    3639 RETURN 2
+    3641 ACC1 
+    3642 BRANCHIFNOT 3652
+    3644 ACC1 
+    3645 GETFIELD2 
+    3646 PUSHACC1 
+    3647 OFFSETINT -1
+    3649 PUSHOFFSETCLOSURE0 
+    3650 APPTERM2 4
+    3652 RETURN 2
+    3654 ACC0 
+    3655 BRANCHIFNOT 3670
+    3657 ENVACC2 
+    3658 PUSHACC1 
+    3659 GETFIELD0 
+    3660 PUSHENVACC1 
+    3661 GETFIELD0 
+    3662 APPLY2 
+    3663 BRANCHIF 3670
+    3665 ACC0 
+    3666 GETFIELD2 
+    3667 PUSHOFFSETCLOSURE0 
+    3668 APPTERM1 2
+    3670 RETURN 1
+    3672 RESTART 
+    3673 GRAB 1
+    3675 ACC1 
+    3676 PUSHENVACC1 
+    3677 CLOSUREREC 2, 3654
+    3681 ACC1 
+    3682 GETFIELD1 
+    3683 VECTLENGTH 
+    3684 PUSHACC3 
+    3685 PUSHENVACC1 
+    3686 GETFIELD1 
+    3687 APPLY1 
+    3688 MODINT 
+    3689 PUSHACC2 
+    3690 GETFIELD1 
+    3691 C_CALL2 array_get_addr
+    3693 PUSHACC1 
+    3694 APPTERM1 4
+    3696 ACC0 
+    3697 BRANCHIFNOT 3722
+    3699 ACC0 
+    3700 GETFIELD2 
+    3701 PUSHENVACC2 
+    3702 PUSHACC2 
+    3703 GETFIELD0 
+    3704 PUSHENVACC1 
+    3705 GETFIELD0 
+    3706 APPLY2 
+    3707 BRANCHIFNOT 3718
+    3709 ACC0 
+    3710 PUSHOFFSETCLOSURE0 
+    3711 APPLY1 
+    3712 PUSHACC2 
+    3713 GETFIELD1 
+    3714 MAKEBLOCK2 0
+    3716 RETURN 2
+    3718 ACC0 
+    3719 PUSHOFFSETCLOSURE0 
+    3720 APPTERM1 3
+    3722 RETURN 1
+    3724 RESTART 
+    3725 GRAB 1
+    3727 ACC1 
+    3728 PUSHENVACC1 
+    3729 CLOSUREREC 2, 3696
+    3733 ACC1 
+    3734 GETFIELD1 
+    3735 VECTLENGTH 
+    3736 PUSHACC3 
+    3737 PUSHENVACC1 
+    3738 GETFIELD1 
+    3739 APPLY1 
+    3740 MODINT 
+    3741 PUSHACC2 
+    3742 GETFIELD1 
+    3743 C_CALL2 array_get_addr
+    3745 PUSHACC1 
+    3746 APPTERM1 4
+    3748 ACC0 
+    3749 BRANCHIFNOT 3768
+    3751 ACC0 
+    3752 GETFIELD0 
+    3753 PUSHENVACC2 
+    3754 PUSHENVACC1 
+    3755 GETFIELD0 
+    3756 APPLY2 
+    3757 BRANCHIFNOT 3763
+    3759 ACC0 
+    3760 GETFIELD1 
+    3761 RETURN 1
+    3763 ACC0 
+    3764 GETFIELD2 
+    3765 PUSHOFFSETCLOSURE0 
+    3766 APPTERM1 2
+    3768 GETGLOBAL Not_found
+    3770 MAKEBLOCK1 0
+    3772 RAISE 
+    3773 RESTART 
+    3774 GRAB 1
+    3776 ACC0 
+    3777 GETFIELD1 
+    3778 VECTLENGTH 
+    3779 PUSHACC2 
+    3780 PUSHENVACC1 
+    3781 GETFIELD1 
+    3782 APPLY1 
+    3783 MODINT 
+    3784 PUSHACC1 
+    3785 GETFIELD1 
+    3786 C_CALL2 array_get_addr
+    3788 PUSHACC0 
+    3789 BRANCHIFNOT 3858
+    3791 ACC0 
+    3792 GETFIELD2 
+    3793 PUSHACC1 
+    3794 GETFIELD0 
+    3795 PUSHACC4 
+    3796 PUSHENVACC1 
+    3797 GETFIELD0 
+    3798 APPLY2 
+    3799 BRANCHIFNOT 3805
+    3801 ACC1 
+    3802 GETFIELD1 
+    3803 RETURN 4
+    3805 ACC0 
+    3806 BRANCHIFNOT 3853
+    3808 ACC0 
+    3809 GETFIELD2 
+    3810 PUSHACC1 
+    3811 GETFIELD0 
+    3812 PUSHACC5 
+    3813 PUSHENVACC1 
+    3814 GETFIELD0 
+    3815 APPLY2 
+    3816 BRANCHIFNOT 3822
+    3818 ACC1 
+    3819 GETFIELD1 
+    3820 RETURN 5
+    3822 ACC0 
+    3823 BRANCHIFNOT 3848
+    3825 ACC0 
+    3826 GETFIELD0 
+    3827 PUSHACC5 
+    3828 PUSHENVACC1 
+    3829 GETFIELD0 
+    3830 APPLY2 
+    3831 BRANCHIFNOT 3837
+    3833 ACC0 
+    3834 GETFIELD1 
+    3835 RETURN 5
+    3837 ACC4 
+    3838 PUSHENVACC1 
+    3839 CLOSUREREC 2, 3748
+    3843 ACC1 
+    3844 GETFIELD2 
+    3845 PUSHACC1 
+    3846 APPTERM1 7
+    3848 GETGLOBAL Not_found
+    3850 MAKEBLOCK1 0
+    3852 RAISE 
+    3853 GETGLOBAL Not_found
+    3855 MAKEBLOCK1 0
+    3857 RAISE 
+    3858 GETGLOBAL Not_found
+    3860 MAKEBLOCK1 0
+    3862 RAISE 
+    3863 ACC0 
+    3864 BRANCHIFNOT 3890
+    3866 ACC0 
+    3867 GETFIELD0 
+    3868 PUSHACC1 
+    3869 GETFIELD2 
+    3870 PUSHENVACC2 
+    3871 PUSHACC2 
+    3872 PUSHENVACC1 
+    3873 GETFIELD0 
+    3874 APPLY2 
+    3875 BRANCHIFNOT 3880
+    3877 ACC0 
+    3878 RETURN 3
+    3880 ACC0 
+    3881 PUSHOFFSETCLOSURE0 
+    3882 APPLY1 
+    3883 PUSHACC3 
+    3884 GETFIELD1 
+    3885 PUSHACC3 
+    3886 MAKEBLOCK3 0
+    3888 POP 2
+    3890 RETURN 1
+    3892 RESTART 
+    3893 GRAB 1
+    3895 ACC1 
+    3896 PUSHENVACC1 
+    3897 CLOSUREREC 2, 3863
+    3901 ACC1 
+    3902 GETFIELD1 
+    3903 VECTLENGTH 
+    3904 PUSHACC3 
+    3905 PUSHENVACC1 
+    3906 GETFIELD1 
+    3907 APPLY1 
+    3908 MODINT 
+    3909 PUSHACC0 
+    3910 PUSHACC3 
+    3911 GETFIELD1 
+    3912 C_CALL2 array_get_addr
+    3914 PUSHACC2 
+    3915 APPLY1 
+    3916 PUSHACC1 
+    3917 PUSHACC4 
+    3918 GETFIELD1 
+    3919 C_CALL3 array_set_addr
+    3921 RETURN 4
+    3923 RESTART 
+    3924 GRAB 2
+    3926 ACC0 
+    3927 GETFIELD1 
+    3928 VECTLENGTH 
+    3929 PUSHACC2 
+    3930 PUSHENVACC3 
+    3931 GETFIELD1 
+    3932 APPLY1 
+    3933 MODINT 
+    3934 PUSHACC0 
+    3935 PUSHACC2 
+    3936 GETFIELD1 
+    3937 C_CALL2 array_get_addr
+    3939 PUSHACC4 
+    3940 PUSHACC4 
+    3941 MAKEBLOCK3 0
+    3943 PUSHACC0 
+    3944 PUSHACC2 
+    3945 PUSHACC4 
+    3946 GETFIELD1 
+    3947 C_CALL3 array_set_addr
+    3949 ACC0 
+    3950 PUSHACC3 
+    3951 GETFIELD0 
+    3952 PUSHENVACC2 
+    3953 APPLY2 
+    3954 BRANCHIFNOT 3962
+    3956 ACC2 
+    3957 PUSHENVACC3 
+    3958 GETFIELD1 
+    3959 PUSHENVACC1 
+    3960 APPTERM2 7
+    3962 RETURN 5
+    3964 ACC0 
+    3965 PUSHENVACC 4
+    3967 PUSHENVACC3 
+    3968 CLOSURE 3, 3924
+    3971 PUSHACC1 
+    3972 CLOSURE 1, 3893
+    3975 PUSHACC2 
+    3976 CLOSURE 1, 3774
+    3979 PUSHACC3 
+    3980 CLOSURE 1, 3725
+    3983 PUSHACC4 
+    3984 CLOSURE 1, 3673
+    3987 PUSHENVACC 5
+    3989 PUSHACC1 
+    3990 PUSHACC3 
+    3991 PUSHACC5 
+    3992 PUSHACC7 
+    3993 PUSHACC 9
+    3995 PUSHENVACC2 
+    3996 PUSHENVACC1 
+    3997 MAKEBLOCK 8, 0
+    4000 RETURN 6
+    4002 ACC0 
+    4003 BRANCHIFNOT 4016
+    4005 ACC0 
+    4006 GETFIELD1 
+    4007 PUSHACC1 
+    4008 GETFIELD0 
+    4009 PUSHENVACC1 
+    4010 APPLY2 
+    4011 ACC0 
+    4012 GETFIELD2 
+    4013 PUSHOFFSETCLOSURE0 
+    4014 APPTERM1 2
+    4016 RETURN 1
+    4018 RESTART 
+    4019 GRAB 1
+    4021 ACC0 
+    4022 CLOSUREREC 1, 4002
+    4026 ACC2 
+    4027 GETFIELD1 
+    4028 PUSHCONST0 
+    4029 PUSHACC1 
+    4030 VECTLENGTH 
+    4031 OFFSETINT -1
+    4033 PUSH 
+    4034 BRANCH 4048
+    4036 CHECK_SIGNALS 
+    4037 ACC1 
+    4038 PUSHACC3 
+    4039 C_CALL2 array_get_addr
+    4041 PUSHACC4 
+    4042 APPLY1 
+    4043 ACC1 
+    4044 OFFSETINT 1
+    4046 ASSIGN 1
+    4048 ACC0 
+    4049 PUSHACC2 
+    4050 LEINT 
+    4051 BRANCHIF 4036
+    4053 CONST0 
+    4054 RETURN 6
+    4056 ACC0 
+    4057 BRANCHIFNOT 4071
+    4059 ENVACC1 
+    4060 PUSHACC1 
+    4061 GETFIELD0 
+    4062 C_CALL2 equal
+    4064 BRANCHIF 4071
+    4066 ACC0 
+    4067 GETFIELD2 
+    4068 PUSHOFFSETCLOSURE0 
+    4069 APPTERM1 2
+    4071 RETURN 1
+    4073 RESTART 
+    4074 GRAB 1
+    4076 ACC1 
+    4077 CLOSUREREC 1, 4056
+    4081 ACC1 
+    4082 GETFIELD1 
+    4083 VECTLENGTH 
+    4084 PUSHACC3 
+    4085 PUSHENVACC1 
+    4086 APPLY1 
+    4087 MODINT 
+    4088 PUSHACC2 
+    4089 GETFIELD1 
+    4090 C_CALL2 array_get_addr
+    4092 PUSHACC1 
+    4093 APPTERM1 4
+    4095 ACC0 
+    4096 BRANCHIFNOT 4120
+    4098 ACC0 
+    4099 GETFIELD2 
+    4100 PUSHENVACC1 
+    4101 PUSHACC2 
+    4102 GETFIELD0 
+    4103 C_CALL2 equal
+    4105 BRANCHIFNOT 4116
+    4107 ACC0 
+    4108 PUSHOFFSETCLOSURE0 
+    4109 APPLY1 
+    4110 PUSHACC2 
+    4111 GETFIELD1 
+    4112 MAKEBLOCK2 0
+    4114 RETURN 2
+    4116 ACC0 
+    4117 PUSHOFFSETCLOSURE0 
+    4118 APPTERM1 3
+    4120 RETURN 1
+    4122 RESTART 
+    4123 GRAB 1
+    4125 ACC1 
+    4126 CLOSUREREC 1, 4095
+    4130 ACC1 
+    4131 GETFIELD1 
+    4132 VECTLENGTH 
+    4133 PUSHACC3 
+    4134 PUSHENVACC1 
+    4135 APPLY1 
+    4136 MODINT 
+    4137 PUSHACC2 
+    4138 GETFIELD1 
+    4139 C_CALL2 array_get_addr
+    4141 PUSHACC1 
+    4142 APPTERM1 4
+    4144 ACC0 
+    4145 BRANCHIFNOT 4163
+    4147 ACC0 
+    4148 GETFIELD0 
+    4149 PUSHENVACC1 
+    4150 C_CALL2 equal
+    4152 BRANCHIFNOT 4158
+    4154 ACC0 
+    4155 GETFIELD1 
+    4156 RETURN 1
+    4158 ACC0 
+    4159 GETFIELD2 
+    4160 PUSHOFFSETCLOSURE0 
+    4161 APPTERM1 2
+    4163 GETGLOBAL Not_found
+    4165 MAKEBLOCK1 0
+    4167 RAISE 
+    4168 RESTART 
+    4169 GRAB 1
+    4171 ACC0 
+    4172 GETFIELD1 
+    4173 VECTLENGTH 
+    4174 PUSHACC2 
+    4175 PUSHENVACC1 
+    4176 APPLY1 
+    4177 MODINT 
+    4178 PUSHACC1 
+    4179 GETFIELD1 
+    4180 C_CALL2 array_get_addr
+    4182 PUSHACC0 
+    4183 BRANCHIFNOT 4248
+    4185 ACC0 
+    4186 GETFIELD2 
+    4187 PUSHACC1 
+    4188 GETFIELD0 
+    4189 PUSHACC4 
+    4190 C_CALL2 equal
+    4192 BRANCHIFNOT 4198
+    4194 ACC1 
+    4195 GETFIELD1 
+    4196 RETURN 4
+    4198 ACC0 
+    4199 BRANCHIFNOT 4243
+    4201 ACC0 
+    4202 GETFIELD2 
+    4203 PUSHACC1 
+    4204 GETFIELD0 
+    4205 PUSHACC5 
+    4206 C_CALL2 equal
+    4208 BRANCHIFNOT 4214
+    4210 ACC1 
+    4211 GETFIELD1 
+    4212 RETURN 5
+    4214 ACC0 
+    4215 BRANCHIFNOT 4238
+    4217 ACC0 
+    4218 GETFIELD0 
+    4219 PUSHACC5 
+    4220 C_CALL2 equal
+    4222 BRANCHIFNOT 4228
+    4224 ACC0 
+    4225 GETFIELD1 
+    4226 RETURN 5
+    4228 ACC4 
+    4229 CLOSUREREC 1, 4144
+    4233 ACC1 
+    4234 GETFIELD2 
+    4235 PUSHACC1 
+    4236 APPTERM1 7
+    4238 GETGLOBAL Not_found
+    4240 MAKEBLOCK1 0
+    4242 RAISE 
+    4243 GETGLOBAL Not_found
+    4245 MAKEBLOCK1 0
+    4247 RAISE 
+    4248 GETGLOBAL Not_found
+    4250 MAKEBLOCK1 0
+    4252 RAISE 
+    4253 ACC0 
+    4254 BRANCHIFNOT 4279
+    4256 ACC0 
+    4257 GETFIELD0 
+    4258 PUSHACC1 
+    4259 GETFIELD2 
+    4260 PUSHENVACC1 
+    4261 PUSHACC2 
+    4262 C_CALL2 equal
+    4264 BRANCHIFNOT 4269
+    4266 ACC0 
+    4267 RETURN 3
+    4269 ACC0 
+    4270 PUSHOFFSETCLOSURE0 
+    4271 APPLY1 
+    4272 PUSHACC3 
+    4273 GETFIELD1 
+    4274 PUSHACC3 
+    4275 MAKEBLOCK3 0
+    4277 POP 2
+    4279 RETURN 1
+    4281 RESTART 
+    4282 GRAB 1
+    4284 ACC1 
+    4285 CLOSUREREC 1, 4253
+    4289 ACC1 
+    4290 GETFIELD1 
+    4291 VECTLENGTH 
+    4292 PUSHACC3 
+    4293 PUSHENVACC1 
+    4294 APPLY1 
+    4295 MODINT 
+    4296 PUSHACC0 
+    4297 PUSHACC3 
+    4298 GETFIELD1 
+    4299 C_CALL2 array_get_addr
+    4301 PUSHACC2 
+    4302 APPLY1 
+    4303 PUSHACC1 
+    4304 PUSHACC4 
+    4305 GETFIELD1 
+    4306 C_CALL3 array_set_addr
+    4308 RETURN 4
+    4310 RESTART 
+    4311 GRAB 2
+    4313 ACC0 
+    4314 GETFIELD1 
+    4315 VECTLENGTH 
+    4316 PUSHACC2 
+    4317 PUSHENVACC1 
+    4318 APPLY1 
+    4319 MODINT 
+    4320 PUSHACC0 
+    4321 PUSHACC2 
+    4322 GETFIELD1 
+    4323 C_CALL2 array_get_addr
+    4325 PUSHACC4 
+    4326 PUSHACC4 
+    4327 MAKEBLOCK3 0
+    4329 PUSHACC0 
+    4330 PUSHACC2 
+    4331 PUSHACC4 
+    4332 GETFIELD1 
+    4333 C_CALL3 array_set_addr
+    4335 ACC0 
+    4336 PUSHACC3 
+    4337 GETFIELD0 
+    4338 PUSHENVACC3 
+    4339 APPLY2 
+    4340 BRANCHIFNOT 4347
+    4342 ACC2 
+    4343 PUSHENVACC1 
+    4344 PUSHENVACC2 
+    4345 APPTERM2 7
+    4347 RETURN 5
+    4349 ACC0 
+    4350 BRANCHIFNOT 4378
+    4352 ACC0 
+    4353 GETFIELD0 
+    4354 PUSHACC1 
+    4355 GETFIELD2 
+    4356 PUSHOFFSETCLOSURE0 
+    4357 APPLY1 
+    4358 ENVACC2 
+    4359 PUSHACC1 
+    4360 PUSHENVACC1 
+    4361 APPLY1 
+    4362 MODINT 
+    4363 PUSHACC0 
+    4364 PUSHENVACC3 
+    4365 C_CALL2 array_get_addr
+    4367 PUSHACC3 
+    4368 GETFIELD1 
+    4369 PUSHACC3 
+    4370 MAKEBLOCK3 0
+    4372 PUSHACC1 
+    4373 PUSHENVACC3 
+    4374 C_CALL3 array_set_addr
+    4376 POP 2
+    4378 RETURN 1
+    4380 RESTART 
+    4381 GRAB 1
+    4383 ACC1 
+    4384 GETFIELD1 
+    4385 PUSHACC0 
+    4386 VECTLENGTH 
+    4387 PUSHACC0 
+    4388 PUSHCONST2 
+    4389 MULINT 
+    4390 OFFSETINT 1
+    4392 PUSHCONST0 
+    4393 PUSHACC1 
+    4394 C_CALL2 make_vect
+    4396 PUSHACC0 
+    4397 PUSHACC2 
+    4398 PUSHACC6 
+    4399 CLOSUREREC 3, 4349
+    4403 CONST0 
+    4404 PUSHACC4 
+    4405 OFFSETINT -1
+    4407 PUSH 
+    4408 BRANCH 4422
+    4410 CHECK_SIGNALS 
+    4411 ACC1 
+    4412 PUSHACC7 
+    4413 C_CALL2 array_get_addr
+    4415 PUSHACC3 
+    4416 APPLY1 
+    4417 ACC1 
+    4418 OFFSETINT 1
+    4420 ASSIGN 1
+    4422 ACC0 
+    4423 PUSHACC2 
+    4424 LEINT 
+    4425 BRANCHIF 4410
+    4427 CONST0 
+    4428 POP 2
+    4430 ACC1 
+    4431 PUSHACC7 
+    4432 SETFIELD1 
+    4433 ACC6 
+    4434 GETFIELD0 
+    4435 PUSHCONST2 
+    4436 MULINT 
+    4437 PUSHACC7 
+    4438 SETFIELD0 
+    4439 RETURN 7
+    4441 CONST0 
+    4442 PUSHACC1 
+    4443 GETFIELD1 
+    4444 VECTLENGTH 
+    4445 OFFSETINT -1
+    4447 PUSH 
+    4448 BRANCH 4462
+    4450 CHECK_SIGNALS 
+    4451 CONST0 
+    4452 PUSHACC2 
+    4453 PUSHACC4 
+    4454 GETFIELD1 
+    4455 C_CALL3 array_set_addr
+    4457 ACC1 
+    4458 OFFSETINT 1
+    4460 ASSIGN 1
+    4462 ACC0 
+    4463 PUSHACC2 
+    4464 LEINT 
+    4465 BRANCHIF 4450
+    4467 CONST0 
+    4468 RETURN 3
+    4470 CONST1 
+    4471 PUSHACC1 
+    4472 LTINT 
+    4473 BRANCHIFNOT 4478
+    4475 CONST1 
+    4476 BRANCH 4479
+    4478 ACC0 
+    4479 PUSHGETGLOBALFIELD Sys, 5
+    4482 PUSHACC1 
+    4483 GTINT 
+    4484 BRANCHIFNOT 4491
+    4486 GETGLOBALFIELD Sys, 5
+    4489 BRANCH 4492
+    4491 ACC0 
+    4492 PUSHCONST0 
+    4493 PUSHACC1 
+    4494 C_CALL2 make_vect
+    4496 PUSHCONST3 
+    4497 MAKEBLOCK2 0
+    4499 RETURN 3
+    4501 ACC0 
+    4502 PUSHCONSTINT 100
+    4504 PUSHCONSTINT 10
+    4506 C_CALL3 hash_univ_param
+    4508 RETURN 1
+    4510 CLOSURE 0, 4501
+    4513 PUSH 
+    4514 CLOSURE 0, 4470
+    4517 PUSH 
+    4518 CLOSURE 0, 4441
+    4521 PUSH 
+    4522 CLOSURE 0, 4381
+    4525 PUSH 
+    4526 CLOSUREREC 0, 3631
+    4530 ACC0 
+    4531 PUSHACC2 
+    4532 PUSHACC6 
+    4533 CLOSURE 3, 4311
+    4536 PUSHACC5 
+    4537 CLOSURE 1, 4282
+    4540 PUSHACC6 
+    4541 CLOSURE 1, 4169
+    4544 PUSHACC7 
+    4545 CLOSURE 1, 4123
+    4548 PUSHACC 8
+    4550 CLOSURE 1, 4074
+    4553 PUSH 
+    4554 CLOSURE 0, 4019
+    4557 PUSHACC0 
+    4558 PUSHACC7 
+    4559 PUSHACC 9
+    4561 PUSHACC 11
+    4563 PUSHACC 13
+    4565 CLOSURE 5, 3964
+    4568 PUSHACC 11
+    4570 PUSHACC1 
+    4571 PUSHACC3 
+    4572 PUSHACC 8
+    4574 PUSHACC6 
+    4575 PUSHACC 8
+    4577 PUSHACC 10
+    4579 PUSHACC 13
+    4581 PUSHACC 17
+    4583 PUSHACC 19
+    4585 MAKEBLOCK 10, 0
+    4588 POP 12
+    4590 SETGLOBAL Hashtbl
+    4592 BRANCH 5073
+    4594 RESTART 
+    4595 GRAB 2
+    4597 ACC1 
+    4598 BRANCHIFNOT 4638
+    4600 ACC1 
+    4601 GETFIELD0 
+    4602 PUSHACC3 
+    4603 BRANCHIFNOT 4635
+    4605 ACC3 
+    4606 GETFIELD0 
+    4607 PUSHACC0 
+    4608 PUSHACC2 
+    4609 PUSHACC4 
+    4610 APPLY2 
+    4611 BRANCHIFNOT 4624
+    4613 ACC4 
+    4614 PUSHACC4 
+    4615 GETFIELD1 
+    4616 PUSHACC4 
+    4617 PUSHOFFSETCLOSURE0 
+    4618 APPLY3 
+    4619 PUSHACC2 
+    4620 MAKEBLOCK2 0
+    4622 RETURN 5
+    4624 ACC4 
+    4625 GETFIELD1 
+    4626 PUSHACC4 
+    4627 PUSHACC4 
+    4628 PUSHOFFSETCLOSURE0 
+    4629 APPLY3 
+    4630 PUSHACC1 
+    4631 MAKEBLOCK2 0
+    4633 RETURN 5
+    4635 ACC2 
+    4636 RETURN 4
+    4638 ACC2 
+    4639 RETURN 3
+    4641 RESTART 
+    4642 GRAB 1
+    4644 CONSTINT 6
+    4646 PUSHACC1 
+    4647 PUSHACC3 
+    4648 SUBINT 
+    4649 GEINT 
+    4650 BRANCHIFNOT 4809
+    4652 CONST1 
+    4653 PUSHACC2 
+    4654 PUSHACC2 
+    4655 ADDINT 
+    4656 LSRINT 
+    4657 PUSHACC1 
+    4658 PUSHENVACC3 
+    4659 C_CALL2 array_unsafe_get
+    4661 PUSHACC1 
+    4662 PUSHENVACC3 
+    4663 C_CALL2 array_unsafe_get
+    4665 PUSHENVACC2 
+    4666 APPLY2 
+    4667 BRANCHIFNOT 4674
+    4669 ACC1 
+    4670 PUSHACC1 
+    4671 PUSHENVACC3 
+    4672 PUSHENVACC1 
+    4673 APPLY3 
+    4674 ACC0 
+    4675 PUSHENVACC3 
+    4676 C_CALL2 array_unsafe_get
+    4678 PUSHACC3 
+    4679 PUSHENVACC3 
+    4680 C_CALL2 array_unsafe_get
+    4682 PUSHENVACC2 
+    4683 APPLY2 
+    4684 BRANCHIFNOT 4708
+    4686 ACC2 
+    4687 PUSHACC1 
+    4688 PUSHENVACC3 
+    4689 PUSHENVACC1 
+    4690 APPLY3 
+    4691 ACC1 
+    4692 PUSHENVACC3 
+    4693 C_CALL2 array_unsafe_get
+    4695 PUSHACC1 
+    4696 PUSHENVACC3 
+    4697 C_CALL2 array_unsafe_get
+    4699 PUSHENVACC2 
+    4700 APPLY2 
+    4701 BRANCHIFNOT 4708
+    4703 ACC1 
+    4704 PUSHACC1 
+    4705 PUSHENVACC3 
+    4706 PUSHENVACC1 
+    4707 APPLY3 
+    4708 ACC0 
+    4709 PUSHENVACC3 
+    4710 C_CALL2 array_unsafe_get
+    4712 PUSHACC2 
+    4713 OFFSETINT 1
+    4715 PUSHACC4 
+    4716 OFFSETINT -1
+    4718 PUSH 
+    4719 BRANCH 4777
+    4721 CHECK_SIGNALS 
+    4722 BRANCH 4730
+    4724 CHECK_SIGNALS 
+    4725 ACC1 
+    4726 OFFSETINT 1
+    4728 ASSIGN 1
+    4730 ACC1 
+    4731 PUSHENVACC3 
+    4732 C_CALL2 array_unsafe_get
+    4734 PUSHACC3 
+    4735 PUSHENVACC2 
+    4736 APPLY2 
+    4737 BRANCHIFNOT 4724
+    4739 CONST0 
+    4740 BRANCH 4748
+    4742 CHECK_SIGNALS 
+    4743 ACC0 
+    4744 OFFSETINT -1
+    4746 ASSIGN 0
+    4748 ACC2 
+    4749 PUSHACC1 
+    4750 PUSHENVACC3 
+    4751 C_CALL2 array_unsafe_get
+    4753 PUSHENVACC2 
+    4754 APPLY2 
+    4755 BRANCHIFNOT 4742
+    4757 ACC0 
+    4758 PUSHACC2 
+    4759 LTINT 
+    4760 BRANCHIFNOT 4767
+    4762 ACC0 
+    4763 PUSHACC2 
+    4764 PUSHENVACC3 
+    4765 PUSHENVACC1 
+    4766 APPLY3 
+    4767 ACC1 
+    4768 OFFSETINT 1
+    4770 ASSIGN 1
+    4772 ACC0 
+    4773 OFFSETINT -1
+    4775 ASSIGN 0
+    4777 ACC0 
+    4778 PUSHACC2 
+    4779 LTINT 
+    4780 BRANCHIF 4721
+    4782 ACC1 
+    4783 PUSHACC6 
+    4784 SUBINT 
+    4785 PUSHACC5 
+    4786 PUSHACC2 
+    4787 SUBINT 
+    4788 LEINT 
+    4789 BRANCHIFNOT 4800
+    4791 ACC0 
+    4792 PUSHACC5 
+    4793 PUSHOFFSETCLOSURE0 
+    4794 APPLY2 
+    4795 ACC5 
+    4796 PUSHACC2 
+    4797 PUSHOFFSETCLOSURE0 
+    4798 APPTERM2 8
+    4800 ACC5 
+    4801 PUSHACC2 
+    4802 PUSHOFFSETCLOSURE0 
+    4803 APPLY2 
+    4804 ACC0 
+    4805 PUSHACC5 
+    4806 PUSHOFFSETCLOSURE0 
+    4807 APPTERM2 8
+    4809 RETURN 2
+    4811 RESTART 
+    4812 GRAB 1
+    4814 ACC1 
+    4815 PUSHACC1 
+    4816 PUSHENVACC1 
+    4817 CLOSUREREC 3, 4642
+    4821 ACC2 
+    4822 VECTLENGTH 
+    4823 OFFSETINT -1
+    4825 PUSHCONST0 
+    4826 PUSHACC2 
+    4827 APPLY2 
+    4828 CONST1 
+    4829 PUSHACC3 
+    4830 VECTLENGTH 
+    4831 OFFSETINT -1
+    4833 PUSH 
+    4834 BRANCH 4918
+    4836 CHECK_SIGNALS 
+    4837 ACC1 
+    4838 PUSHACC5 
+    4839 C_CALL2 array_unsafe_get
+    4841 PUSHACC0 
+    4842 PUSHACC3 
+    4843 OFFSETINT -1
+    4845 PUSHACC7 
+    4846 C_CALL2 array_unsafe_get
+    4848 PUSHACC6 
+    4849 APPLY2 
+    4850 BOOLNOT 
+    4851 BRANCHIFNOT 4911
+    4853 ACC2 
+    4854 OFFSETINT -1
+    4856 PUSHACC6 
+    4857 C_CALL2 array_unsafe_get
+    4859 PUSHACC3 
+    4860 PUSHACC7 
+    4861 C_CALL3 array_unsafe_set
+    4863 ACC2 
+    4864 OFFSETINT -1
+    4866 PUSH 
+    4867 BRANCH 4886
+    4869 CHECK_SIGNALS 
+    4870 ACC0 
+    4871 OFFSETINT -1
+    4873 PUSHACC7 
+    4874 C_CALL2 array_unsafe_get
+    4876 PUSHACC1 
+    4877 PUSHACC 8
+    4879 C_CALL3 array_unsafe_set
+    4881 ACC0 
+    4882 OFFSETINT -1
+    4884 ASSIGN 0
+    4886 CONST1 
+    4887 PUSHACC1 
+    4888 GEINT 
+    4889 BRANCHIFNOT 4903
+    4891 ACC1 
+    4892 PUSHACC1 
+    4893 OFFSETINT -1
+    4895 PUSHACC 8
+    4897 C_CALL2 array_unsafe_get
+    4899 PUSHACC7 
+    4900 APPLY2 
+    4901 BRANCHIFNOT 4869
+    4903 ACC1 
+    4904 PUSHACC1 
+    4905 PUSHACC 8
+    4907 C_CALL3 array_unsafe_set
+    4909 POP 1
+    4911 POP 1
+    4913 ACC1 
+    4914 OFFSETINT 1
+    4916 ASSIGN 1
+    4918 ACC0 
+    4919 PUSHACC2 
+    4920 LEINT 
+    4921 BRANCHIF 4836
+    4923 CONST0 
+    4924 RETURN 5
+    4926 RESTART 
+    4927 GRAB 2
+    4929 ACC1 
+    4930 PUSHACC1 
+    4931 C_CALL2 array_unsafe_get
+    4933 PUSHACC3 
+    4934 PUSHACC2 
+    4935 C_CALL2 array_unsafe_get
+    4937 PUSHACC3 
+    4938 PUSHACC3 
+    4939 C_CALL3 array_unsafe_set
+    4941 ACC0 
+    4942 PUSHACC4 
+    4943 PUSHACC3 
+    4944 C_CALL3 array_unsafe_set
+    4946 RETURN 4
+    4948 ACC0 
+    4949 BRANCHIFNOT 4999
+    4951 ACC0 
+    4952 GETFIELD0 
+    4953 PUSHACC1 
+    4954 GETFIELD1 
+    4955 PUSHACC0 
+    4956 BRANCHIFNOT 4990
+    4958 ACC0 
+    4959 GETFIELD0 
+    4960 PUSHACC1 
+    4961 GETFIELD1 
+    4962 PUSHOFFSETCLOSURE0 
+    4963 APPLY1 
+    4964 PUSHACC1 
+    4965 PUSHACC4 
+    4966 PUSHENVACC1 
+    4967 APPLY2 
+    4968 BRANCHIFNOT 4979
+    4970 CONST0 
+    4971 PUSHACC2 
+    4972 MAKEBLOCK2 0
+    4974 PUSHACC4 
+    4975 MAKEBLOCK2 0
+    4977 BRANCH 4986
+    4979 CONST0 
+    4980 PUSHACC4 
+    4981 MAKEBLOCK2 0
+    4983 PUSHACC2 
+    4984 MAKEBLOCK2 0
+    4986 MAKEBLOCK2 0
+    4988 RETURN 4
+    4990 CONST0 
+    4991 PUSHCONST0 
+    4992 PUSHACC3 
+    4993 MAKEBLOCK2 0
+    4995 MAKEBLOCK2 0
+    4997 POP 2
+    4999 RETURN 1
+    5001 ACC0 
+    5002 BRANCHIFNOT 5028
+    5004 ACC0 
+    5005 GETFIELD1 
+    5006 PUSHACC0 
+    5007 BRANCHIFNOT 5024
+    5009 ACC0 
+    5010 GETFIELD1 
+    5011 PUSHOFFSETCLOSURE0 
+    5012 APPLY1 
+    5013 PUSHACC1 
+    5014 GETFIELD0 
+    5015 PUSHACC3 
+    5016 GETFIELD0 
+    5017 PUSHENVACC2 
+    5018 PUSHENVACC1 
+    5019 APPLY3 
+    5020 MAKEBLOCK2 0
+    5022 RETURN 2
+    5024 POP 1
+    5026 BRANCH 5028
+    5028 ACC0 
+    5029 RETURN 1
+    5031 ACC0 
+    5032 BRANCHIFNOT 5040
+    5034 ACC0 
+    5035 GETFIELD1 
+    5036 BRANCHIF 5042
+    5038 ACC0 
+    5039 GETFIELD0 
+    5040 RETURN 1
+    5042 ACC0 
+    5043 PUSHENVACC1 
+    5044 APPLY1 
+    5045 PUSHOFFSETCLOSURE0 
+    5046 APPTERM1 2
+    5048 RESTART 
+    5049 GRAB 1
+    5051 ACC0 
+    5052 CLOSUREREC 1, 4948
+    5056 ACC1 
+    5057 PUSHENVACC1 
+    5058 CLOSUREREC 2, 5001
+    5062 ACC0 
+    5063 CLOSUREREC 1, 5031
+    5067 ACC4 
+    5068 PUSHACC3 
+    5069 APPLY1 
+    5070 PUSHACC1 
+    5071 APPTERM1 6
+    5073 CLOSUREREC 0, 4595
+    5077 ACC0 
+    5078 CLOSURE 1, 5049
+    5081 PUSH 
+    5082 CLOSURE 0, 4927
+    5085 PUSHACC0 
+    5086 CLOSURE 1, 4812
+    5089 PUSHACC3 
+    5090 PUSHACC1 
+    5091 PUSHACC4 
+    5092 MAKEBLOCK3 0
+    5094 POP 4
+    5096 SETGLOBAL Sort
+    5098 BRANCH 5847
+    5100 ACC0 
+    5101 PUSHENVACC1 
+    5102 APPLY1 
+    5103 PUSHACC0 
+    5104 GETFIELD 11
+    5106 PUSHACC1 
+    5107 GETFIELD 10
+    5109 PUSHACC2 
+    5110 GETFIELD 9
+    5112 PUSHACC3 
+    5113 GETFIELD 6
+    5115 PUSHACC4 
+    5116 GETFIELD 8
+    5118 PUSHACC5 
+    5119 GETFIELD 5
+    5121 PUSHACC6 
+    5122 GETFIELD 4
+    5124 PUSHACC7 
+    5125 GETFIELD0 
+    5126 MAKEBLOCK 8, 0
+    5129 RETURN 2
+    5131 RESTART 
+    5132 GRAB 2
+    5134 ACC2 
+    5135 BRANCHIFNOT 5201
+    5137 ACC2 
+    5138 GETFIELD0 
+    5139 PUSHACC3 
+    5140 GETFIELD1 
+    5141 PUSHACC4 
+    5142 GETFIELD2 
+    5143 PUSHACC5 
+    5144 GETFIELD3 
+    5145 PUSHACC2 
+    5146 PUSHACC5 
+    5147 PUSHENVACC1 
+    5148 GETFIELD0 
+    5149 APPLY2 
+    5150 PUSHCONST0 
+    5151 PUSHACC1 
+    5152 EQ 
+    5153 BRANCHIFNOT 5170
+    5155 ACC7 
+    5156 GETFIELD 4
+    5158 PUSHACC2 
+    5159 PUSHACC 8
+    5161 PUSHACC 8
+    5163 PUSHACC 8
+    5165 MAKEBLOCK 5, 0
+    5168 RETURN 8
+    5170 CONST0 
+    5171 PUSHACC1 
+    5172 LTINT 
+    5173 BRANCHIFNOT 5189
+    5175 ACC1 
+    5176 PUSHACC3 
+    5177 PUSHACC5 
+    5178 PUSHACC7 
+    5179 PUSHACC 10
+    5181 PUSHACC 10
+    5183 PUSHOFFSETCLOSURE0 
+    5184 APPLY3 
+    5185 PUSHENVACC2 
+    5186 APPTERM 4, 12
+    5189 ACC1 
+    5190 PUSHACC7 
+    5191 PUSHACC7 
+    5192 PUSHOFFSETCLOSURE0 
+    5193 APPLY3 
+    5194 PUSHACC3 
+    5195 PUSHACC5 
+    5196 PUSHACC7 
+    5197 PUSHENVACC2 
+    5198 APPTERM 4, 12
+    5201 CONST1 
+    5202 PUSHCONST0 
+    5203 PUSHACC3 
+    5204 PUSHACC3 
+    5205 PUSHCONST0 
+    5206 MAKEBLOCK 5, 0
+    5209 RETURN 3
+    5211 RESTART 
+    5212 GRAB 1
+    5214 ACC1 
+    5215 BRANCHIFNOT 5247
+    5217 ACC1 
+    5218 GETFIELD1 
+    5219 PUSHACC1 
+    5220 PUSHENVACC1 
+    5221 GETFIELD0 
+    5222 APPLY2 
+    5223 PUSHCONST0 
+    5224 PUSHACC1 
+    5225 EQ 
+    5226 BRANCHIFNOT 5232
+    5228 ACC2 
+    5229 GETFIELD2 
+    5230 RETURN 3
+    5232 CONST0 
+    5233 PUSHACC1 
+    5234 LTINT 
+    5235 BRANCHIFNOT 5241
+    5237 ACC2 
+    5238 GETFIELD0 
+    5239 BRANCH 5243
+    5241 ACC2 
+    5242 GETFIELD3 
+    5243 PUSHACC2 
+    5244 PUSHOFFSETCLOSURE0 
+    5245 APPTERM2 5
+    5247 GETGLOBAL Not_found
+    5249 MAKEBLOCK1 0
+    5251 RAISE 
+    5252 RESTART 
+    5253 GRAB 1
+    5255 ACC1 
+    5256 BRANCHIFNOT 5286
+    5258 ACC1 
+    5259 GETFIELD1 
+    5260 PUSHACC1 
+    5261 PUSHENVACC1 
+    5262 GETFIELD0 
+    5263 APPLY2 
+    5264 PUSHCONST0 
+    5265 PUSHACC1 
+    5266 EQ 
+    5267 BRANCHIF 5284
+    5269 CONST0 
+    5270 PUSHACC1 
+    5271 LTINT 
+    5272 BRANCHIFNOT 5278
+    5274 ACC2 
+    5275 GETFIELD0 
+    5276 BRANCH 5280
+    5278 ACC2 
+    5279 GETFIELD3 
+    5280 PUSHACC2 
+    5281 PUSHOFFSETCLOSURE0 
+    5282 APPTERM2 5
+    5284 POP 1
+    5286 RETURN 2
+    5288 RESTART 
+    5289 GRAB 1
+    5291 ACC0 
+    5292 BRANCHIF 5297
+    5294 ACC1 
+    5295 RETURN 2
+    5297 ACC1 
+    5298 BRANCHIF 5303
+    5300 ACC0 
+    5301 RETURN 2
+    5303 ACC0 
+    5304 BRANCHIFNOT 5336
+    5306 ACC1 
+    5307 BRANCHIFNOT 5336
+    5309 PUSH_RETADDR 5326
+    5311 ACC4 
+    5312 GETFIELD3 
+    5313 PUSHACC5 
+    5314 GETFIELD2 
+    5315 PUSHACC6 
+    5316 GETFIELD1 
+    5317 PUSHACC7 
+    5318 GETFIELD0 
+    5319 PUSHACC7 
+    5320 GETFIELD3 
+    5321 PUSHOFFSETCLOSURE0 
+    5322 APPLY2 
+    5323 PUSHENVACC1 
+    5324 APPLY 4
+    5326 PUSHACC1 
+    5327 GETFIELD2 
+    5328 PUSHACC2 
+    5329 GETFIELD1 
+    5330 PUSHACC3 
+    5331 GETFIELD0 
+    5332 PUSHENVACC1 
+    5333 APPTERM 4, 6
+    5336 GETGLOBAL <0>("map.ml", 3614, 3797)
+    5338 PUSHGETGLOBAL Match_failure
+    5340 MAKEBLOCK2 0
+    5342 RAISE 
+    5343 RESTART 
+    5344 GRAB 1
+    5346 ACC1 
+    5347 BRANCHIFNOT 5400
+    5349 ACC1 
+    5350 GETFIELD0 
+    5351 PUSHACC2 
+    5352 GETFIELD1 
+    5353 PUSHACC3 
+    5354 GETFIELD2 
+    5355 PUSHACC4 
+    5356 GETFIELD3 
+    5357 PUSHACC2 
+    5358 PUSHACC5 
+    5359 PUSHENVACC1 
+    5360 GETFIELD0 
+    5361 APPLY2 
+    5362 PUSHCONST0 
+    5363 PUSHACC1 
+    5364 EQ 
+    5365 BRANCHIFNOT 5372
+    5367 ACC1 
+    5368 PUSHACC5 
+    5369 PUSHENVACC3 
+    5370 APPTERM2 9
+    5372 CONST0 
+    5373 PUSHACC1 
+    5374 LTINT 
+    5375 BRANCHIFNOT 5389
+    5377 ACC1 
+    5378 PUSHACC3 
+    5379 PUSHACC5 
+    5380 PUSHACC7 
+    5381 PUSHACC 9
+    5383 PUSHOFFSETCLOSURE0 
+    5384 APPLY2 
+    5385 PUSHENVACC2 
+    5386 APPTERM 4, 11
+    5389 ACC1 
+    5390 PUSHACC6 
+    5391 PUSHOFFSETCLOSURE0 
+    5392 APPLY2 
+    5393 PUSHACC3 
+    5394 PUSHACC5 
+    5395 PUSHACC7 
+    5396 PUSHENVACC2 
+    5397 APPTERM 4, 11
+    5400 RETURN 2
+    5402 RESTART 
+    5403 GRAB 1
+    5405 ACC1 
+    5406 BRANCHIFNOT 5425
+    5408 ACC1 
+    5409 GETFIELD0 
+    5410 PUSHACC1 
+    5411 PUSHOFFSETCLOSURE0 
+    5412 APPLY2 
+    5413 ACC1 
+    5414 GETFIELD2 
+    5415 PUSHACC2 
+    5416 GETFIELD1 
+    5417 PUSHACC2 
+    5418 APPLY2 
+    5419 ACC1 
+    5420 GETFIELD3 
+    5421 PUSHACC1 
+    5422 PUSHOFFSETCLOSURE0 
+    5423 APPTERM2 4
+    5425 RETURN 2
+    5427 RESTART 
+    5428 GRAB 1
+    5430 ACC1 
+    5431 BRANCHIFNOT 5455
+    5433 ACC1 
+    5434 GETFIELD 4
+    5436 PUSHACC2 
+    5437 GETFIELD3 
+    5438 PUSHACC2 
+    5439 PUSHOFFSETCLOSURE0 
+    5440 APPLY2 
+    5441 PUSHACC3 
+    5442 GETFIELD2 
+    5443 PUSHACC3 
+    5444 APPLY1 
+    5445 PUSHACC4 
+    5446 GETFIELD1 
+    5447 PUSHACC5 
+    5448 GETFIELD0 
+    5449 PUSHACC5 
+    5450 PUSHOFFSETCLOSURE0 
+    5451 APPLY2 
+    5452 MAKEBLOCK 5, 0
+    5455 RETURN 2
+    5457 RESTART 
+    5458 GRAB 2
+    5460 ACC1 
+    5461 BRANCHIFNOT 5481
+    5463 ACC2 
+    5464 PUSHACC2 
+    5465 GETFIELD3 
+    5466 PUSHACC2 
+    5467 PUSHOFFSETCLOSURE0 
+    5468 APPLY3 
+    5469 PUSHACC2 
+    5470 GETFIELD2 
+    5471 PUSHACC3 
+    5472 GETFIELD1 
+    5473 PUSHACC3 
+    5474 APPLY3 
+    5475 PUSHACC2 
+    5476 GETFIELD0 
+    5477 PUSHACC2 
+    5478 PUSHOFFSETCLOSURE0 
+    5479 APPTERM3 6
+    5481 ACC2 
+    5482 RETURN 3
+    5484 RESTART 
+    5485 GRAB 3
+    5487 ACC0 
+    5488 BRANCHIFNOT 5495
+    5490 ACC0 
+    5491 GETFIELD 4
+    5493 BRANCH 5496
+    5495 CONST0 
+    5496 PUSHACC4 
+    5497 BRANCHIFNOT 5504
+    5499 ACC4 
+    5500 GETFIELD 4
+    5502 BRANCH 5505
+    5504 CONST0 
+    5505 PUSHACC0 
+    5506 OFFSETINT 2
+    5508 PUSHACC2 
+    5509 GTINT 
+    5510 BRANCHIFNOT 5603
+    5512 ACC2 
+    5513 BRANCHIFNOT 5596
+    5515 ACC2 
+    5516 GETFIELD0 
+    5517 PUSHACC3 
+    5518 GETFIELD1 
+    5519 PUSHACC4 
+    5520 GETFIELD2 
+    5521 PUSHACC5 
+    5522 GETFIELD3 
+    5523 PUSHACC0 
+    5524 PUSHENVACC1 
+    5525 APPLY1 
+    5526 PUSHACC4 
+    5527 PUSHENVACC1 
+    5528 APPLY1 
+    5529 GEINT 
+    5530 BRANCHIFNOT 5551
+    5532 PUSH_RETADDR 5544
+    5534 ACC 12
+    5536 PUSHACC 12
+    5538 PUSHACC 12
+    5540 PUSHACC6 
+    5541 PUSHENVACC2 
+    5542 APPLY 4
+    5544 PUSHACC2 
+    5545 PUSHACC4 
+    5546 PUSHACC6 
+    5547 PUSHENVACC2 
+    5548 APPTERM 4, 14
+    5551 ACC0 
+    5552 BRANCHIFNOT 5589
+    5554 PUSH_RETADDR 5567
+    5556 ACC 12
+    5558 PUSHACC 12
+    5560 PUSHACC 12
+    5562 PUSHACC6 
+    5563 GETFIELD3 
+    5564 PUSHENVACC2 
+    5565 APPLY 4
+    5567 PUSHACC1 
+    5568 GETFIELD2 
+    5569 PUSHACC2 
+    5570 GETFIELD1 
+    5571 PUSH 
+    5572 PUSH_RETADDR 5585
+    5574 ACC6 
+    5575 GETFIELD0 
+    5576 PUSHACC 8
+    5578 PUSHACC 10
+    5580 PUSHACC 12
+    5582 PUSHENVACC2 
+    5583 APPLY 4
+    5585 PUSHENVACC2 
+    5586 APPTERM 4, 14
+    5589 GETGLOBAL "Map.bal"
+    5591 PUSHGETGLOBALFIELD Pervasives, 2
+    5594 APPTERM1 11
+    5596 GETGLOBAL "Map.bal"
+    5598 PUSHGETGLOBALFIELD Pervasives, 2
+    5601 APPTERM1 7
+    5603 ACC1 
+    5604 OFFSETINT 2
+    5606 PUSHACC1 
+    5607 GTINT 
+    5608 BRANCHIFNOT 5703
+    5610 ACC5 
+    5611 BRANCHIFNOT 5696
+    5613 ACC5 
+    5614 GETFIELD0 
+    5615 PUSHACC6 
+    5616 GETFIELD1 
+    5617 PUSHACC7 
+    5618 GETFIELD2 
+    5619 PUSHACC 8
+    5621 GETFIELD3 
+    5622 PUSHACC3 
+    5623 PUSHENVACC1 
+    5624 APPLY1 
+    5625 PUSHACC1 
+    5626 PUSHENVACC1 
+    5627 APPLY1 
+    5628 GEINT 
+    5629 BRANCHIFNOT 5652
+    5631 ACC0 
+    5632 PUSHACC2 
+    5633 PUSHACC4 
+    5634 PUSH 
+    5635 PUSH_RETADDR 5648
+    5637 ACC 9
+    5639 PUSHACC 15
+    5641 PUSHACC 15
+    5643 PUSHACC 15
+    5645 PUSHENVACC2 
+    5646 APPLY 4
+    5648 PUSHENVACC2 
+    5649 APPTERM 4, 14
+    5652 ACC3 
+    5653 BRANCHIFNOT 5689
+    5655 PUSH_RETADDR 5666
+    5657 ACC3 
+    5658 PUSHACC5 
+    5659 PUSHACC7 
+    5660 PUSHACC 9
+    5662 GETFIELD3 
+    5663 PUSHENVACC2 
+    5664 APPLY 4
+    5666 PUSHACC4 
+    5667 GETFIELD2 
+    5668 PUSHACC5 
+    5669 GETFIELD1 
+    5670 PUSH 
+    5671 PUSH_RETADDR 5685
+    5673 ACC 9
+    5675 GETFIELD0 
+    5676 PUSHACC 15
+    5678 PUSHACC 15
+    5680 PUSHACC 15
+    5682 PUSHENVACC2 
+    5683 APPLY 4
+    5685 PUSHENVACC2 
+    5686 APPTERM 4, 14
+    5689 GETGLOBAL "Map.bal"
+    5691 PUSHGETGLOBALFIELD Pervasives, 2
+    5694 APPTERM1 11
+    5696 GETGLOBAL "Map.bal"
+    5698 PUSHGETGLOBALFIELD Pervasives, 2
+    5701 APPTERM1 7
+    5703 ACC0 
+    5704 PUSHACC2 
+    5705 GEINT 
+    5706 BRANCHIFNOT 5713
+    5708 ACC1 
+    5709 OFFSETINT 1
+    5711 BRANCH 5716
+    5713 ACC0 
+    5714 OFFSETINT 1
+    5716 PUSHACC6 
+    5717 PUSHACC6 
+    5718 PUSHACC6 
+    5719 PUSHACC6 
+    5720 MAKEBLOCK 5, 0
+    5723 RETURN 6
+    5725 RESTART 
+    5726 GRAB 3
+    5728 ACC0 
+    5729 PUSHENVACC1 
+    5730 APPLY1 
+    5731 PUSHACC4 
+    5732 PUSHENVACC1 
+    5733 APPLY1 
+    5734 PUSHACC0 
+    5735 PUSHACC2 
+    5736 GEINT 
+    5737 BRANCHIFNOT 5744
+    5739 ACC1 
+    5740 OFFSETINT 1
+    5742 BRANCH 5747
+    5744 ACC0 
+    5745 OFFSETINT 1
+    5747 PUSHACC6 
+    5748 PUSHACC6 
+    5749 PUSHACC6 
+    5750 PUSHACC6 
+    5751 MAKEBLOCK 5, 0
+    5754 RETURN 6
+    5756 ACC0 
+    5757 BRANCHIFNOT 5764
+    5759 ACC0 
+    5760 GETFIELD 4
+    5762 RETURN 1
+    5764 CONST0 
+    5765 RETURN 1
+    5767 CONST0 
+    5768 PUSH 
+    5769 CLOSURE 0, 5756
+    5772 PUSHACC0 
+    5773 CLOSURE 1, 5726
+    5776 PUSHACC0 
+    5777 PUSHACC2 
+    5778 CLOSURE 2, 5485
+    5781 PUSHACC0 
+    5782 PUSHACC5 
+    5783 CLOSUREREC 2, 5132
+    5787 ACC5 
+    5788 CLOSUREREC 1, 5212
+    5792 ACC6 
+    5793 CLOSUREREC 1, 5253
+    5797 ACC3 
+    5798 CLOSUREREC 1, 5289
+    5802 ACC0 
+    5803 PUSHACC5 
+    5804 PUSHACC 10
+    5806 CLOSUREREC 3, 5344
+    5810 CLOSUREREC 0, 5403
+    5814 CLOSUREREC 0, 5428
+    5818 CLOSUREREC 0, 5458
+    5822 ACC0 
+    5823 PUSHACC2 
+    5824 PUSHACC4 
+    5825 PUSHACC6 
+    5826 PUSHACC 8
+    5828 PUSHACC 10
+    5830 PUSHACC 12
+    5832 PUSHACC 14
+    5834 PUSHACC 16
+    5836 PUSHACC 18
+    5838 PUSHACC 20
+    5840 PUSHACC 22
+    5842 MAKEBLOCK 12, 0
+    5845 RETURN 13
+    5847 CLOSURE 0, 5767
+    5850 PUSHACC0 
+    5851 CLOSURE 1, 5100
+    5854 MAKEBLOCK1 0
+    5856 POP 1
+    5858 SETGLOBAL Map
+    5860 BRANCH 5957
+    5862 CONSTINT 16
+    5864 C_CALL1 create_string
+    5866 PUSH 
+    5867 PUSH_RETADDR 5879
+    5869 CONSTINT 16
+    5871 PUSHCONST0 
+    5872 PUSHACC5 
+    5873 PUSHACC7 
+    5874 PUSHGETGLOBALFIELD Pervasives, 56
+    5877 APPLY 4
+    5879 ACC0 
+    5880 RETURN 2
+    5882 RESTART 
+    5883 GRAB 1
+    5885 CONSTINT 16
+    5887 PUSHCONST0 
+    5888 PUSHACC3 
+    5889 PUSHACC3 
+    5890 PUSHGETGLOBALFIELD Pervasives, 41
+    5893 APPTERM 4, 6
+    5896 ACC0 
+    5897 PUSHGETGLOBALFIELD Pervasives, 51
+    5900 APPLY1 
+    5901 PUSHACC0 
+    5902 PUSHGETGLOBALFIELD Pervasives, 62
+    5905 APPLY1 
+    5906 PUSHACC1 
+    5907 C_CALL2 md5_chan
+    5909 PUSHACC1 
+    5910 PUSHGETGLOBALFIELD Pervasives, 63
+    5913 APPLY1 
+    5914 ACC0 
+    5915 RETURN 3
+    5917 RESTART 
+    5918 GRAB 2
+    5920 CONST0 
+    5921 PUSHACC2 
+    5922 LTINT 
+    5923 BRANCHIF 5934
+    5925 ACC0 
+    5926 C_CALL1 ml_string_length
+    5928 PUSHACC3 
+    5929 PUSHACC3 
+    5930 ADDINT 
+    5931 GTINT 
+    5932 BRANCHIFNOT 5941
+    5934 GETGLOBAL "Digest.substring"
+    5936 PUSHGETGLOBALFIELD Pervasives, 2
+    5939 APPTERM1 4
+    5941 ACC2 
+    5942 PUSHACC2 
+    5943 PUSHACC2 
+    5944 C_CALL3 md5_string
+    5946 RETURN 3
+    5948 ACC0 
+    5949 C_CALL1 ml_string_length
+    5951 PUSHCONST0 
+    5952 PUSHACC2 
+    5953 C_CALL3 md5_string
+    5955 RETURN 1
+    5957 CLOSURE 0, 5948
+    5960 PUSH 
+    5961 CLOSURE 0, 5918
+    5964 PUSH 
+    5965 CLOSURE 0, 5896
+    5968 PUSH 
+    5969 CLOSURE 0, 5883
+    5972 PUSH 
+    5973 CLOSURE 0, 5862
+    5976 PUSHACC0 
+    5977 PUSHACC2 
+    5978 PUSHACC4 
+    5979 PUSHACC6 
+    5980 PUSHACC 8
+    5982 MAKEBLOCK 5, 0
+    5985 POP 5
+    5987 SETGLOBAL Digest
+    5989 BRANCH 6245
+    5991 CONST0 
+    5992 PUSHENVACC1 
+    5993 APPLY1 
+    5994 PUSHACC1 
+    5995 PUSHACC1 
+    5996 GEINT 
+    5997 BRANCHIFNOT 6003
+    5999 ACC1 
+    6000 PUSHOFFSETCLOSURE0 
+    6001 APPTERM1 3
+    6003 ACC0 
+    6004 RETURN 2
+    6006 CONST0 
+    6007 C_CALL1 sys_random_seed
+    6009 PUSHENVACC1 
+    6010 APPTERM1 2
+    6012 CONSTINT 27182818
+    6014 PUSHENVACC2 
+    6015 APPLY1 
+    6016 CONST0 
+    6017 PUSHACC1 
+    6018 VECTLENGTH 
+    6019 OFFSETINT -1
+    6021 PUSH 
+    6022 BRANCH 6046
+    6024 CHECK_SIGNALS 
+    6025 CONSTINT 55
+    6027 PUSHACC2 
+    6028 MODINT 
+    6029 PUSHACC2 
+    6030 PUSHACC4 
+    6031 GETVECTITEM 
+    6032 PUSHACC1 
+    6033 PUSHENVACC1 
+    6034 GETVECTITEM 
+    6035 ADDINT 
+    6036 PUSHACC1 
+    6037 PUSHENVACC1 
+    6038 SETVECTITEM 
+    6039 POP 1
+    6041 ACC1 
+    6042 OFFSETINT 1
+    6044 ASSIGN 1
+    6046 ACC0 
+    6047 PUSHACC2 
+    6048 LEINT 
+    6049 BRANCHIF 6024
+    6051 CONST0 
+    6052 RETURN 3
+    6054 ENVACC1 
+    6055 GETFIELD0 
+    6056 OFFSETINT 1
+    6058 PUSHENVACC1 
+    6059 SETFIELD0 
+    6060 ENVACC1 
+    6061 GETFIELD0 
+    6062 PUSHGETGLOBALFIELD Pervasives, 14
+    6065 APPLY1 
+    6066 PUSHGETGLOBALFIELD Digest, 0
+    6069 APPLY1 
+    6070 PUSHCONSTINT 22
+    6072 PUSHCONST3 
+    6073 PUSHACC2 
+    6074 C_CALL2 string_get
+    6076 LSLINT 
+    6077 PUSHCONSTINT 16
+    6079 PUSHCONST2 
+    6080 PUSHACC3 
+    6081 C_CALL2 string_get
+    6083 LSLINT 
+    6084 PUSHCONSTINT 8
+    6086 PUSHCONST1 
+    6087 PUSHACC4 
+    6088 C_CALL2 string_get
+    6090 LSLINT 
+    6091 PUSHCONST0 
+    6092 PUSHACC4 
+    6093 C_CALL2 string_get
+    6095 ADDINT 
+    6096 ADDINT 
+    6097 XORINT 
+    6098 RETURN 2
+    6100 ACC0 
+    6101 MAKEBLOCK1 0
+    6103 PUSHACC0 
+    6104 CLOSURE 1, 6054
+    6107 PUSHCONST0 
+    6108 PUSHCONSTINT 54
+    6110 PUSH 
+    6111 BRANCH 6125
+    6113 CHECK_SIGNALS 
+    6114 CONST0 
+    6115 PUSHACC3 
+    6116 APPLY1 
+    6117 PUSHACC2 
+    6118 PUSHENVACC1 
+    6119 SETVECTITEM 
+    6120 ACC1 
+    6121 OFFSETINT 1
+    6123 ASSIGN 1
+    6125 ACC0 
+    6126 PUSHACC2 
+    6127 LEINT 
+    6128 BRANCHIF 6113
+    6130 CONST0 
+    6131 POP 2
+    6133 CONST0 
+    6134 PUSHENVACC2 
+    6135 SETFIELD0 
+    6136 RETURN 3
+    6138 ACC0 
+    6139 PUSHCONST0 
+    6140 PUSHENVACC1 
+    6141 APPLY1 
+    6142 C_CALL2 mul_float
+    6144 RETURN 1
+    6146 CONSTINT 1073741823
+    6148 PUSHACC1 
+    6149 GTINT 
+    6150 BRANCHIF 6157
+    6152 CONST0 
+    6153 PUSHACC1 
+    6154 LEINT 
+    6155 BRANCHIFNOT 6164
+    6157 GETGLOBAL "Random.int"
+    6159 PUSHGETGLOBALFIELD Pervasives, 2
+    6162 APPTERM1 2
+    6164 ACC0 
+    6165 PUSHACC1 
+    6166 PUSHACC2 
+    6167 PUSHCONSTINT 1073741823
+    6169 DIVINT 
+    6170 MULINT 
+    6171 PUSHENVACC1 
+    6172 APPLY1 
+    6173 MODINT 
+    6174 RETURN 1
+    6176 GETGLOBAL 1073741824
+    6178 PUSHCONST0 
+    6179 PUSHENVACC1 
+    6180 APPLY1 
+    6181 C_CALL1 float_of_int
+    6183 PUSHCONST0 
+    6184 PUSHENVACC1 
+    6185 APPLY1 
+    6186 C_CALL1 float_of_int
+    6188 PUSHCONST0 
+    6189 PUSHENVACC1 
+    6190 APPLY1 
+    6191 C_CALL1 float_of_int
+    6193 PUSHACC3 
+    6194 PUSHACC1 
+    6195 PUSHACC5 
+    6196 PUSHACC4 
+    6197 PUSHACC7 
+    6198 PUSHACC7 
+    6199 C_CALL2 div_float
+    6201 C_CALL2 add_float
+    6203 C_CALL2 div_float
+    6205 C_CALL2 add_float
+    6207 C_CALL2 div_float
+    6209 RETURN 5
+    6211 CONSTINT 55
+    6213 PUSHENVACC2 
+    6214 GETFIELD0 
+    6215 OFFSETINT 1
+    6217 MODINT 
+    6218 PUSHENVACC2 
+    6219 SETFIELD0 
+    6220 ENVACC2 
+    6221 GETFIELD0 
+    6222 PUSHENVACC1 
+    6223 GETVECTITEM 
+    6224 PUSHCONSTINT 55
+    6226 PUSHENVACC2 
+    6227 GETFIELD0 
+    6228 OFFSETINT 24
+    6230 MODINT 
+    6231 PUSHENVACC1 
+    6232 GETVECTITEM 
+    6233 ADDINT 
+    6234 PUSHACC0 
+    6235 PUSHENVACC2 
+    6236 GETFIELD0 
+    6237 PUSHENVACC1 
+    6238 SETVECTITEM 
+    6239 CONSTINT 1073741823
+    6241 PUSHACC1 
+    6242 ANDINT 
+    6243 RETURN 2
+    6245 CONSTINT 440266690
+    6247 PUSHCONSTINT 124177607
+    6249 PUSHCONSTINT 414576093
+    6251 PUSHCONSTINT 180326017
+    6253 PUSHCONSTINT 33747835
+    6255 PUSHCONSTINT 896816596
+    6257 PUSHCONSTINT 21528564
+    6259 PUSHCONSTINT 414383108
+    6261 PUSHCONSTINT 514922558
+    6263 PUSHCONSTINT 979459837
+    6265 PUSHCONSTINT 146577263
+    6267 PUSHCONSTINT 714526560
+    6269 PUSHCONSTINT 187230644
+    6271 PUSHCONSTINT 22990936
+    6273 PUSHCONSTINT 310632349
+    6275 PUSHCONSTINT 781847598
+    6277 PUSHCONSTINT 854580894
+    6279 PUSHCONSTINT 804670393
+    6281 PUSHCONSTINT 268309077
+    6283 PUSHCONSTINT 4136554
+    6285 PUSHCONSTINT 567327260
+    6287 PUSHCONSTINT 768795410
+    6289 PUSHCONSTINT 868098973
+    6291 PUSHCONSTINT 462134267
+    6293 PUSHCONSTINT 32881167
+    6295 PUSHCONSTINT 708896334
+    6297 PUSHCONSTINT 572927557
+    6299 PUSHCONSTINT 933858406
+    6301 PUSHCONSTINT 965168955
+    6303 PUSHCONSTINT 233350272
+    6305 PUSHCONSTINT 878960411
+    6307 PUSHCONSTINT 971004788
+    6309 PUSHCONSTINT 762624501
+    6311 PUSHCONSTINT 796925167
+    6313 PUSHCONSTINT 206134737
+    6315 PUSHCONSTINT 281896889
+    6317 PUSHCONSTINT 814302728
+    6319 PUSHCONSTINT 477485839
+    6321 PUSHCONSTINT 998499212
+    6323 PUSHCONSTINT 473370118
+    6325 PUSHCONSTINT 66770770
+    6327 PUSHCONSTINT 337696531
+    6329 PUSHCONSTINT 848741663
+    6331 PUSHCONSTINT 71648846
+    6333 PUSHCONSTINT 869261341
+    6335 PUSHCONSTINT 951240904
+    6337 PUSHCONSTINT 147054819
+    6339 PUSHCONSTINT 486882977
+    6341 PUSHCONSTINT 552627506
+    6343 PUSHCONSTINT 615350359
+    6345 PUSHCONSTINT 1023641486
+    6347 PUSHCONSTINT 9858203
+    6349 PUSHCONSTINT 764306064
+    6351 PUSHCONSTINT 1051173471
+    6353 PUSHCONSTINT 561073064
+    6355 MAKEBLOCK 55, 0
+    6358 PUSHCONST0 
+    6359 MAKEBLOCK1 0
+    6361 PUSHACC0 
+    6362 PUSHACC2 
+    6363 CLOSURE 2, 6211
+    6366 PUSHACC0 
+    6367 CLOSURE 1, 6176
+    6370 PUSHACC1 
+    6371 CLOSUREREC 1, 5991
+    6375 ACC0 
+    6376 CLOSURE 1, 6146
+    6379 PUSHACC2 
+    6380 CLOSURE 1, 6138
+    6383 PUSHACC5 
+    6384 PUSHACC7 
+    6385 CLOSURE 2, 6100
+    6388 PUSHACC0 
+    6389 PUSHACC 8
+    6391 CLOSURE 2, 6012
+    6394 PUSHACC1 
+    6395 CLOSURE 1, 6006
+    6398 PUSHACC3 
+    6399 PUSHACC5 
+    6400 PUSHACC 9
+    6402 PUSHACC3 
+    6403 PUSHACC5 
+    6404 PUSHACC7 
+    6405 MAKEBLOCK 6, 0
+    6408 POP 10
+    6410 SETGLOBAL Random
+    6412 BRANCH 8038
+    6414 RESTART 
+    6415 GRAB 1
+    6417 ACC1 
+    6418 BRANCHIFNOT 6441
+    6420 ACC1 
+    6421 GETFIELD0 
+    6422 PUSHACC2 
+    6423 GETFIELD1 
+    6424 PUSHACC1 
+    6425 PUSHACC3 
+    6426 EQ 
+    6427 BRANCHIFNOT 6432
+    6429 ACC0 
+    6430 RETURN 4
+    6432 ACC0 
+    6433 PUSHACC3 
+    6434 PUSHOFFSETCLOSURE0 
+    6435 APPLY2 
+    6436 PUSHACC2 
+    6437 MAKEBLOCK2 0
+    6439 POP 2
+    6441 RETURN 2
+    6443 RESTART 
+    6444 GRAB 1
+    6446 CONST0 
+    6447 PUSHACC2 
+    6448 GTINT 
+    6449 BRANCHIFNOT 6512
+    6451 CONST0 
+    6452 PUSHENVACC2 
+    6453 GETFIELD0 
+    6454 GTINT 
+    6455 BRANCHIFNOT 6512
+    6457 ENVACC2 
+    6458 GETFIELD0 
+    6459 PUSHGETGLOBALFIELD Random, 4
+    6462 APPLY1 
+    6463 PUSHACC0 
+    6464 PUSHENVACC1 
+    6465 GETFIELD0 
+    6466 C_CALL2 array_get_addr
+    6468 PUSHENVACC 5
+    6470 APPLY1 
+    6471 BRANCHIF 6482
+    6473 ACC0 
+    6474 PUSHENVACC 4
+    6476 APPLY1 
+    6477 ACC2 
+    6478 PUSHACC2 
+    6479 PUSHOFFSETCLOSURE0 
+    6480 APPTERM2 5
+    6482 PUSHTRAP 6496
+    6484 ACC5 
+    6485 PUSHACC5 
+    6486 PUSHENVACC1 
+    6487 GETFIELD0 
+    6488 C_CALL2 array_get_addr
+    6490 PUSHENVACC 7
+    6492 APPLY2 
+    6493 POPTRAP 
+    6494 RETURN 3
+    6496 PUSHENVACC 6
+    6498 PUSHACC1 
+    6499 GETFIELD0 
+    6500 EQ 
+    6501 BRANCHIFNOT 6510
+    6503 ACC3 
+    6504 OFFSETINT -1
+    6506 PUSHACC3 
+    6507 PUSHOFFSETCLOSURE0 
+    6508 APPTERM2 6
+    6510 ACC0 
+    6511 RAISE 
+    6512 ACC0 
+    6513 PUSHENVACC3 
+    6514 APPLY1 
+    6515 ACC0 
+    6516 RETURN 2
+    6518 RESTART 
+    6519 GRAB 1
+    6521 ACC1 
+    6522 BRANCHIFNOT 6534
+    6524 ACC0 
+    6525 PUSHACC2 
+    6526 GETFIELD0 
+    6527 APPLY1 
+    6528 ACC1 
+    6529 GETFIELD1 
+    6530 PUSHACC1 
+    6531 PUSHOFFSETCLOSURE0 
+    6532 APPTERM2 4
+    6534 RETURN 2
+    6536 CONST0 
+    6537 PUSHENVACC1 
+    6538 OFFSETINT -1
+    6540 PUSH 
+    6541 BRANCH 6567
+    6543 CHECK_SIGNALS 
+    6544 ENVACC2 
+    6545 PUSHACC2 
+    6546 PUSHACC4 
+    6547 C_CALL2 array_get
+    6549 EQ 
+    6550 BRANCHIFNOT 6556
+    6552 CONSTINT 46
+    6554 BRANCH 6558
+    6556 CONSTINT 42
+    6558 PUSHGETGLOBALFIELD Pervasives, 20
+    6561 APPLY1 
+    6562 ACC1 
+    6563 OFFSETINT 1
+    6565 ASSIGN 1
+    6567 ACC0 
+    6568 PUSHACC2 
+    6569 LEINT 
+    6570 BRANCHIF 6543
+    6572 CONST0 
+    6573 POP 2
+    6575 CONST0 
+    6576 PUSHGETGLOBALFIELD Pervasives, 25
+    6579 APPTERM1 2
+    6581 ENVACC3 
+    6582 GETFIELD0 
+    6583 PUSHENVACC 4
+    6585 APPLY1 
+    6586 PUSHENVACC2 
+    6587 PUSHENVACC1 
+    6588 CLOSURE 2, 6536
+    6591 PUSHGETGLOBALFIELD List, 9
+    6594 APPTERM2 3
+    6596 ACC0 
+    6597 GETFIELD1 
+    6598 RETURN 1
+    6600 RESTART 
+    6601 GRAB 1
+    6603 ACC1 
+    6604 GETFIELD0 
+    6605 PUSHACC1 
+    6606 GETFIELD0 
+    6607 LEINT 
+    6608 RETURN 2
+    6610 ACC0 
+    6611 PUSHACC1 
+    6612 PUSHENVACC1 
+    6613 APPLY1 
+    6614 MAKEBLOCK2 0
+    6616 RETURN 1
+    6618 ACC0 
+    6619 PUSHENVACC1 
+    6620 CLOSURE 1, 6610
+    6623 PUSHGETGLOBALFIELD List, 10
+    6626 APPLY2 
+    6627 PUSH 
+    6628 CLOSURE 0, 6601
+    6631 PUSHGETGLOBALFIELD Sort, 0
+    6634 APPLY2 
+    6635 PUSH 
+    6636 CLOSURE 0, 6596
+    6639 PUSHGETGLOBALFIELD List, 10
+    6642 APPTERM2 3
+    6644 ENVACC3 
+    6645 GETFIELD0 
+    6646 VECTLENGTH 
+    6647 PUSHENVACC 4
+    6649 GETFIELD0 
+    6650 PUSHCONST0 
+    6651 PUSHENVACC 8
+    6653 APPLY1 
+    6654 PUSHENVACC2 
+    6655 GETFIELD0 
+    6656 PUSHGETGLOBALFIELD List, 0
+    6659 APPLY1 
+    6660 PUSHENVACC 7
+    6662 GETFIELD0 
+    6663 PUSHENVACC 6
+    6665 GETFIELD0 
+    6666 PUSHENVACC1 
+    6667 GETFIELD0 
+    6668 PUSHENVACC 5
+    6670 GETFIELD0 
+    6671 MAKEBLOCK 8, 0
+    6674 RETURN 1
+    6676 ACC0 
+    6677 PUSHENVACC1 
+    6678 APPLY1 
+    6679 PUSHACC0 
+    6680 OFFSETINT -1
+    6682 PUSHENVACC2 
+    6683 C_CALL2 array_get_addr
+    6685 OFFSETINT 1
+    6687 PUSHACC1 
+    6688 OFFSETINT -1
+    6690 PUSHENVACC2 
+    6691 C_CALL3 array_set_addr
+    6693 RETURN 2
+    6695 CONST0 
+    6696 PUSHCONSTINT 32
+    6698 C_CALL2 make_vect
+    6700 PUSHENVACC1 
+    6701 GETFIELD0 
+    6702 PUSHACC1 
+    6703 PUSHENVACC2 
+    6704 CLOSURE 2, 6676
+    6707 PUSHGETGLOBALFIELD List, 9
+    6710 APPLY2 
+    6711 ACC0 
+    6712 RETURN 2
+    6714 RESTART 
+    6715 GRAB 1
+    6717 ACC1 
+    6718 PUSHENVACC1 
+    6719 APPLY1 
+    6720 PUSHACC1 
+    6721 PUSHACC1 
+    6722 GETFIELD1 
+    6723 PUSHACC2 
+    6724 GETFIELD0 
+    6725 PUSHCONST0 
+    6726 PUSHACC5 
+    6727 C_CALL2 array_get_addr
+    6729 C_CALL2 array_get_addr
+    6731 C_CALL2 array_get_addr
+    6733 APPTERM1 4
+    6735 ACC0 
+    6736 GETFIELD0 
+    6737 C_CALL1 obj_dup
+    6739 PUSHENVACC1 
+    6740 PUSHACC1 
+    6741 PUSHENVACC2 
+    6742 APPLY2 
+    6743 ACC1 
+    6744 GETFIELD2 
+    6745 PUSHACC1 
+    6746 PUSHENVACC3 
+    6747 APPLY2 
+    6748 ACC0 
+    6749 RETURN 2
+    6751 RESTART 
+    6752 GRAB 1
+    6754 ACC1 
+    6755 GETFIELD 7
+    6757 PUSHCONST0 
+    6758 PUSHACC1 
+    6759 NEQ 
+    6760 BRANCHIFNOT 6767
+    6762 ACC0 
+    6763 PUSHACC2 
+    6764 PUSHENVACC1 
+    6765 APPTERM2 5
+    6767 RETURN 3
+    6769 ACC0 
+    6770 GETFIELD0 
+    6771 PUSHENVACC1 
+    6772 C_CALL2 obj_block
+    6774 PUSHACC1 
+    6775 GETFIELD1 
+    6776 PUSHCONST0 
+    6777 PUSHACC2 
+    6778 C_CALL3 array_unsafe_set
+    6780 ENVACC2 
+    6781 PUSHACC1 
+    6782 PUSHENVACC3 
+    6783 APPLY2 
+    6784 ACC0 
+    6785 RETURN 2
+    6787 ACC0 
+    6788 GETFIELD0 
+    6789 PUSHENVACC3 
+    6790 GETFIELD0 
+    6791 ADDINT 
+    6792 OFFSETINT -1
+    6794 PUSHENVACC3 
+    6795 SETFIELD0 
+    6796 ENVACC1 
+    6797 GETFIELD0 
+    6798 BRANCHIFNOT 6804
+    6800 ACC0 
+    6801 GETFIELD1 
+    6802 PUSHENVACC2 
+    6803 APPLY1 
+    6804 ACC0 
+    6805 GETFIELD 7
+    6807 PUSHGETGLOBALFIELD List, 4
+    6810 APPLY1 
+    6811 PUSHACC1 
+    6812 SETFIELD 7
+    6814 RETURN 1
+    6816 ACC0 
+    6817 PUSHENVACC1 
+    6818 APPLY1 
+    6819 PUSHENVACC 4
+    6821 GETFIELD2 
+    6822 PUSHACC1 
+    6823 PUSHACC3 
+    6824 PUSHENVACC2 
+    6825 GETFIELD1 
+    6826 APPLY3 
+    6827 PUSHENVACC 4
+    6829 SETFIELD2 
+    6830 ENVACC4 
+    6831 GETFIELD3 
+    6832 PUSHCONST1 
+    6833 PUSHACC2 
+    6834 PUSHENVACC3 
+    6835 GETFIELD1 
+    6836 APPLY3 
+    6837 PUSHENVACC 4
+    6839 SETFIELD3 
+    6840 RETURN 2
+    6842 CONST0 
+    6843 PUSHENVACC 4
+    6845 APPLY1 
+    6846 PUSHACC1 
+    6847 PUSHACC1 
+    6848 PUSHENVACC3 
+    6849 PUSHENVACC2 
+    6850 PUSHENVACC1 
+    6851 CLOSURE 4, 6816
+    6854 PUSHGETGLOBALFIELD List, 9
+    6857 APPLY2 
+    6858 ACC0 
+    6859 RETURN 2
+    6861 RESTART 
+    6862 GRAB 1
+    6864 ACC0 
+    6865 GETFIELD 7
+    6867 PUSHACC2 
+    6868 MAKEBLOCK2 0
+    6870 PUSHACC1 
+    6871 SETFIELD 7
+    6873 RETURN 2
+    6875 ENVACC1 
+    6876 PUSHENVACC3 
+    6877 PUSH 
+    6878 BRANCH 6895
+    6880 CHECK_SIGNALS 
+    6881 ACC1 
+    6882 PUSHENVACC2 
+    6883 GETVECTITEM 
+    6884 PUSHENVACC 4
+    6886 PUSHACC3 
+    6887 ADDINT 
+    6888 PUSHACC4 
+    6889 SETVECTITEM 
+    6890 ACC1 
+    6891 OFFSETINT 1
+    6893 ASSIGN 1
+    6895 ACC0 
+    6896 PUSHACC2 
+    6897 LEINT 
+    6898 BRANCHIF 6880
+    6900 CONST0 
+    6901 RETURN 3
+    6903 ENVACC2 
+    6904 GETFIELD0 
+    6905 PUSHENVACC2 
+    6906 GETFIELD2 
+    6907 GETFIELD0 
+    6908 OFFSETINT -1
+    6910 PUSHENVACC3 
+    6911 GETFIELD0 
+    6912 OFFSETINT -1
+    6914 PUSHACC1 
+    6915 PUSHACC1 
+    6916 SUBINT 
+    6917 PUSHACC0 
+    6918 PUSHACC3 
+    6919 PUSHACC5 
+    6920 PUSHENVACC1 
+    6921 CLOSURE 4, 6875
+    6924 RETURN 5
+    6926 RESTART 
+    6927 GRAB 1
+    6929 CONST0 
+    6930 ACC1 
+    6931 PUSHACC1 
+    6932 PUSHENVACC1 
+    6933 CLOSURE 3, 6903
+    6936 RETURN 2
+    6938 RESTART 
+    6939 GRAB 1
+    6941 ACC0 
+    6942 GETFIELD 6
+    6944 PUSHACC2 
+    6945 PUSHENVACC1 
+    6946 GETFIELD2 
+    6947 APPTERM2 4
+    6949 RESTART 
+    6950 GRAB 1
+    6952 ACC0 
+    6953 PUSHENVACC2 
+    6954 APPLY1 
+    6955 PUSHACC1 
+    6956 GETFIELD 6
+    6958 PUSHACC1 
+    6959 PUSHACC4 
+    6960 PUSHENVACC1 
+    6961 GETFIELD1 
+    6962 APPLY3 
+    6963 PUSHACC2 
+    6964 SETFIELD 6
+    6966 ACC0 
+    6967 RETURN 3
+    6969 ACC0 
+    6970 GETFIELD0 
+    6971 PUSHACC0 
+    6972 OFFSETINT 1
+    6974 PUSHACC2 
+    6975 SETFIELD0 
+    6976 ACC0 
+    6977 RETURN 2
+    6979 RESTART 
+    6980 GRAB 1
+    6982 CONST0 
+    6983 PUSHACC1 
+    6984 PUSHACC3 
+    6985 GETFIELD1 
+    6986 APPTERM2 4
+    6988 RESTART 
+    6989 GRAB 1
+    6991 ENVACC1 
+    6992 GETFIELD 4
+    6994 PUSHACC1 
+    6995 GETFIELD0 
+    6996 PUSHGETGLOBALFIELD List, 23
+    6999 APPLY2 
+    7000 BRANCHIFNOT 7005
+    7002 ACC1 
+    7003 RETURN 2
+    7005 ACC1 
+    7006 PUSHACC1 
+    7007 MAKEBLOCK2 0
+    7009 RETURN 2
+    7011 RESTART 
+    7012 GRAB 1
+    7014 ACC0 
+    7015 PUSHENVACC2 
+    7016 GETFIELD 6
+    7018 PUSHACC3 
+    7019 PUSHENVACC1 
+    7020 GETFIELD2 
+    7021 APPLY2 
+    7022 PUSHACC3 
+    7023 PUSHENVACC1 
+    7024 GETFIELD1 
+    7025 APPTERM3 5
+    7027 ACC0 
+    7028 GETFIELD 4
+    7030 PUSHGETGLOBALFIELD List, 1
+    7033 APPLY1 
+    7034 PUSHACC1 
+    7035 GETFIELD 4
+    7037 PUSHGETGLOBALFIELD List, 2
+    7040 APPLY1 
+    7041 PUSHACC2 
+    7042 SETFIELD 4
+    7044 ACC0 
+    7045 GETFIELD 5
+    7047 PUSHACC1 
+    7048 GETFIELD3 
+    7049 PUSHACC3 
+    7050 PUSHENVACC1 
+    7051 CLOSURE 2, 7012
+    7054 PUSHGETGLOBALFIELD List, 12
+    7057 APPLY3 
+    7058 PUSHACC2 
+    7059 SETFIELD 6
+    7061 ACC0 
+    7062 GETFIELD0 
+    7063 PUSHACC2 
+    7064 SETFIELD2 
+    7065 ACC0 
+    7066 GETFIELD1 
+    7067 PUSHACC2 
+    7068 SETFIELD3 
+    7069 ACC0 
+    7070 GETFIELD2 
+    7071 PUSHACC2 
+    7072 GETFIELD 5
+    7074 PUSHACC2 
+    7075 CLOSURE 1, 6989
+    7078 PUSHGETGLOBALFIELD List, 13
+    7081 APPLY3 
+    7082 PUSHACC2 
+    7083 SETFIELD 5
+    7085 RETURN 2
+    7087 RESTART 
+    7088 GRAB 1
+    7090 ENVACC1 
+    7091 PUSHACC1 
+    7092 GETFIELD0 
+    7093 PUSHGETGLOBALFIELD List, 23
+    7096 APPLY2 
+    7097 BRANCHIFNOT 7102
+    7099 ACC1 
+    7100 RETURN 2
+    7102 ACC1 
+    7103 PUSHACC1 
+    7104 MAKEBLOCK2 0
+    7106 RETURN 2
+    7108 RESTART 
+    7109 GRAB 1
+    7111 ENVACC3 
+    7112 GETFIELD0 
+    7113 PUSHACC2 
+    7114 PUSHACC2 
+    7115 PUSHENVACC1 
+    7116 GETFIELD1 
+    7117 APPLY3 
+    7118 PUSHENVACC3 
+    7119 SETFIELD0 
+    7120 ENVACC4 
+    7121 GETFIELD0 
+    7122 PUSHCONST0 
+    7123 PUSHACC3 
+    7124 PUSHENVACC2 
+    7125 GETFIELD1 
+    7126 APPLY3 
+    7127 PUSHENVACC 4
+    7129 SETFIELD0 
+    7130 RETURN 2
+    7132 ACC0 
+    7133 PUSHENVACC 4
+    7135 PUSHENVACC3 
+    7136 APPLY2 
+    7137 PUSHENVACC 5
+    7139 GETFIELD0 
+    7140 PUSHACC1 
+    7141 PUSHACC3 
+    7142 PUSHENVACC1 
+    7143 GETFIELD1 
+    7144 APPLY3 
+    7145 PUSHENVACC 5
+    7147 SETFIELD0 
+    7148 ENVACC 6
+    7150 GETFIELD0 
+    7151 PUSH 
+    7152 PUSHTRAP 7163
+    7154 ENVACC4 
+    7155 GETFIELD3 
+    7156 PUSHACC6 
+    7157 PUSHENVACC2 
+    7158 GETFIELD2 
+    7159 APPLY2 
+    7160 POPTRAP 
+    7161 BRANCH 7177
+    7163 PUSHGETGLOBAL Not_found
+    7165 PUSHACC1 
+    7166 GETFIELD0 
+    7167 EQ 
+    7168 BRANCHIFNOT 7173
+    7170 CONST1 
+    7171 BRANCH 7175
+    7173 ACC0 
+    7174 RAISE 
+    7175 POP 1
+    7177 PUSHACC2 
+    7178 PUSHENVACC2 
+    7179 GETFIELD1 
+    7180 APPLY3 
+    7181 PUSHENVACC 6
+    7183 SETFIELD0 
+    7184 RETURN 2
+    7186 RESTART 
+    7187 GRAB 3
+    7189 ACC2 
+    7190 PUSHACC1 
+    7191 PUSHENVACC 4
+    7193 APPLY1 
+    7194 PUSHGETGLOBALFIELD List, 10
+    7197 APPLY2 
+    7198 PUSHACC1 
+    7199 GETFIELD 4
+    7201 PUSHACC3 
+    7202 PUSHACC2 
+    7203 PUSHACC4 
+    7204 GETFIELD 6
+    7206 PUSHACC5 
+    7207 GETFIELD 5
+    7209 PUSHACC6 
+    7210 GETFIELD3 
+    7211 PUSHACC7 
+    7212 GETFIELD2 
+    7213 MAKEBLOCK 6, 0
+    7216 MAKEBLOCK2 0
+    7218 PUSHACC2 
+    7219 SETFIELD 4
+    7221 ENVACC1 
+    7222 GETFIELD0 
+    7223 PUSHACC2 
+    7224 SETFIELD 6
+    7226 ENVACC2 
+    7227 GETFIELD0 
+    7228 MAKEBLOCK1 0
+    7230 PUSHENVACC3 
+    7231 GETFIELD0 
+    7232 MAKEBLOCK1 0
+    7234 PUSHACC6 
+    7235 PUSHACC1 
+    7236 PUSHACC3 
+    7237 PUSHACC6 
+    7238 PUSHENVACC 4
+    7240 PUSHENVACC3 
+    7241 PUSHENVACC2 
+    7242 CLOSURE 6, 7132
+    7245 PUSHGETGLOBALFIELD List, 9
+    7248 APPLY2 
+    7249 ACC2 
+    7250 PUSHACC6 
+    7251 PUSHACC2 
+    7252 PUSHACC4 
+    7253 PUSHENVACC3 
+    7254 PUSHENVACC2 
+    7255 CLOSURE 4, 7109
+    7258 PUSHGETGLOBALFIELD List, 14
+    7261 APPLY3 
+    7262 ACC1 
+    7263 GETFIELD0 
+    7264 PUSHACC4 
+    7265 SETFIELD2 
+    7266 ACC0 
+    7267 GETFIELD0 
+    7268 PUSHACC4 
+    7269 SETFIELD3 
+    7270 CONST0 
+    7271 PUSHACC4 
+    7272 GETFIELD 5
+    7274 PUSHACC4 
+    7275 CLOSURE 1, 7088
+    7278 PUSHGETGLOBALFIELD List, 13
+    7281 APPLY3 
+    7282 PUSHACC4 
+    7283 SETFIELD 5
+    7285 RETURN 7
+    7287 RESTART 
+    7288 GRAB 1
+    7290 PUSHTRAP 7303
+    7292 ACC4 
+    7293 GETFIELD 5
+    7295 PUSHACC6 
+    7296 PUSHGETGLOBALFIELD List, 29
+    7299 APPLY2 
+    7300 POPTRAP 
+    7301 RETURN 2
+    7303 PUSHGETGLOBAL Not_found
+    7305 PUSHACC1 
+    7306 GETFIELD0 
+    7307 EQ 
+    7308 BRANCHIFNOT 7325
+    7310 ACC2 
+    7311 PUSHENVACC1 
+    7312 APPLY1 
+    7313 PUSHACC0 
+    7314 GETFIELD1 
+    7315 PUSHACC1 
+    7316 GETFIELD0 
+    7317 PUSHACC4 
+    7318 GETFIELD1 
+    7319 C_CALL2 array_get_addr
+    7321 C_CALL2 array_get
+    7323 RETURN 4
+    7325 ACC0 
+    7326 RAISE 
+    7327 RESTART 
+    7328 GRAB 2
+    7330 ENVACC3 
+    7331 OFFSETREF 1
+    7333 ACC0 
+    7334 GETFIELD3 
+    7335 PUSHACC2 
+    7336 PUSHENVACC1 
+    7337 GETFIELD2 
+    7338 APPLY2 
+    7339 BRANCHIFNOT 7347
+    7341 ACC2 
+    7342 PUSHACC2 
+    7343 PUSHACC2 
+    7344 PUSHENVACC2 
+    7345 APPTERM3 6
+    7347 ACC0 
+    7348 GETFIELD 5
+    7350 PUSHACC3 
+    7351 PUSHACC3 
+    7352 MAKEBLOCK2 0
+    7354 MAKEBLOCK2 0
+    7356 PUSHACC1 
+    7357 SETFIELD 5
+    7359 RETURN 3
+    7361 RESTART 
+    7362 GRAB 1
+    7364 PUSHTRAP 7375
+    7366 ACC4 
+    7367 GETFIELD2 
+    7368 PUSHACC6 
+    7369 PUSHENVACC2 
+    7370 GETFIELD2 
+    7371 APPLY2 
+    7372 POPTRAP 
+    7373 RETURN 2
+    7375 PUSHGETGLOBAL Not_found
+    7377 PUSHACC1 
+    7378 GETFIELD0 
+    7379 EQ 
+    7380 BRANCHIFNOT 7406
+    7382 CONST0 
+    7383 PUSHENVACC1 
+    7384 APPLY1 
+    7385 PUSHACC2 
+    7386 GETFIELD2 
+    7387 PUSHACC1 
+    7388 PUSHACC5 
+    7389 PUSHENVACC2 
+    7390 GETFIELD1 
+    7391 APPLY3 
+    7392 PUSHACC3 
+    7393 SETFIELD2 
+    7394 ACC2 
+    7395 GETFIELD3 
+    7396 PUSHCONST1 
+    7397 PUSHACC2 
+    7398 PUSHENVACC3 
+    7399 GETFIELD1 
+    7400 APPLY3 
+    7401 PUSHACC3 
+    7402 SETFIELD3 
+    7403 ACC0 
+    7404 RETURN 4
+    7406 ACC0 
+    7407 RAISE 
+    7408 RESTART 
+    7409 GRAB 2
+    7411 ACC1 
+    7412 PUSHENVACC1 
+    7413 APPLY1 
+    7414 PUSHACC0 
+    7415 GETFIELD0 
+    7416 PUSHACC0 
+    7417 OFFSETINT 1
+    7419 PUSHACC3 
+    7420 PUSHENVACC 4
+    7422 APPLY2 
+    7423 ACC0 
+    7424 PUSHACC3 
+    7425 GETFIELD1 
+    7426 C_CALL2 array_get_addr
+    7428 PUSHENVACC2 
+    7429 PUSHACC1 
+    7430 EQ 
+    7431 BRANCHIFNOT 7444
+    7433 CONST0 
+    7434 PUSHENVACC3 
+    7435 APPLY1 
+    7436 ASSIGN 0
+    7438 ACC0 
+    7439 PUSHACC2 
+    7440 PUSHACC5 
+    7441 GETFIELD1 
+    7442 C_CALL3 array_set_addr
+    7444 ACC5 
+    7445 PUSHACC3 
+    7446 GETFIELD1 
+    7447 PUSHACC2 
+    7448 C_CALL3 array_set
+    7450 RETURN 6
+    7452 RESTART 
+    7453 GRAB 1
+    7455 ACC0 
+    7456 GETFIELD1 
+    7457 VECTLENGTH 
+    7458 PUSHACC0 
+    7459 PUSHACC3 
+    7460 GTINT 
+    7461 BRANCHIFNOT 7487
+    7463 ENVACC1 
+    7464 PUSHACC3 
+    7465 C_CALL2 make_vect
+    7467 PUSH 
+    7468 PUSH_RETADDR 7482
+    7470 ACC4 
+    7471 PUSHCONST0 
+    7472 PUSHACC5 
+    7473 PUSHCONST0 
+    7474 PUSHACC 9
+    7476 GETFIELD1 
+    7477 PUSHGETGLOBALFIELD Array, 8
+    7480 APPLY 5
+    7482 ACC0 
+    7483 PUSHACC3 
+    7484 SETFIELD1 
+    7485 POP 1
+    7487 RETURN 3
+    7489 ENVACC 5
+    7491 OFFSETREF 1
+    7493 CONST0 
+    7494 PUSHENVACC2 
+    7495 GETFIELD0 
+    7496 PUSHCONST0 
+    7497 PUSHCONST0 
+    7498 PUSHENVACC 4
+    7500 GETFIELD0 
+    7501 PUSHENVACC3 
+    7502 GETFIELD0 
+    7503 PUSH 
+    7504 ATOM0 
+    7505 PUSHENVACC1 
+    7506 MAKEBLOCK 8, 0
+    7509 RETURN 1
+    7511 RESTART 
+    7512 GRAB 1
+    7514 ACC1 
+    7515 PUSHACC1 
+    7516 C_CALL2 compare
+    7518 RETURN 2
+    7520 RESTART 
+    7521 GRAB 1
+    7523 ACC1 
+    7524 PUSHACC1 
+    7525 C_CALL2 compare
+    7527 RETURN 2
+    7529 RESTART 
+    7530 GRAB 1
+    7532 ACC1 
+    7533 PUSHACC1 
+    7534 C_CALL2 compare
+    7536 RETURN 2
+    7538 PUSHTRAP 7549
+    7540 ACC4 
+    7541 PUSHENVACC1 
+    7542 PUSHGETGLOBALFIELD Hashtbl, 3
+    7545 APPLY2 
+    7546 POPTRAP 
+    7547 RETURN 1
+    7549 PUSHGETGLOBAL Not_found
+    7551 PUSHACC1 
+    7552 GETFIELD0 
+    7553 EQ 
+    7554 BRANCHIFNOT 7569
+    7556 CONST0 
+    7557 PUSHENVACC2 
+    7558 APPLY1 
+    7559 PUSHACC0 
+    7560 PUSHACC3 
+    7561 PUSHENVACC1 
+    7562 PUSHGETGLOBALFIELD Hashtbl, 2
+    7565 APPLY3 
+    7566 ACC0 
+    7567 RETURN 3
+    7569 ACC0 
+    7570 RAISE 
+    7571 ENVACC2 
+    7572 GETFIELD0 
+    7573 PUSHENVACC2 
+    7574 GETFIELD0 
+    7575 PUSHENVACC1 
+    7576 APPLY1 
+    7577 PUSHENVACC2 
+    7578 SETFIELD0 
+    7579 ACC0 
+    7580 RETURN 2
+    7582 ENVACC1 
+    7583 PUSHACC1 
+    7584 VECTLENGTH 
+    7585 OFFSETINT -1
+    7587 PUSH 
+    7588 BRANCH 7606
+    7590 CHECK_SIGNALS 
+    7591 ACC1 
+    7592 PUSHACC3 
+    7593 C_CALL2 array_get_addr
+    7595 PUSHENVACC2 
+    7596 APPLY1 
+    7597 PUSHACC2 
+    7598 PUSHACC4 
+    7599 C_CALL3 array_set_addr
+    7601 ACC1 
+    7602 OFFSETINT 1
+    7604 ASSIGN 1
+    7606 ACC0 
+    7607 PUSHACC2 
+    7608 LEINT 
+    7609 BRANCHIF 7590
+    7611 CONST0 
+    7612 RETURN 3
+    7614 ENVACC4 
+    7615 PUSHACC1 
+    7616 NEQ 
+    7617 BRANCHIFNOT 7640
+    7619 ENVACC2 
+    7620 GETFIELD0 
+    7621 PUSHACC1 
+    7622 PUSHENVACC3 
+    7623 APPLY1 
+    7624 EQ 
+    7625 BRANCHIFNOT 7640
+    7627 ACC0 
+    7628 PUSHENVACC 5
+    7630 APPLY1 
+    7631 BRANCHIFNOT 7640
+    7633 ENVACC1 
+    7634 GETFIELD3 
+    7635 PUSHACC1 
+    7636 PUSHENVACC 6
+    7638 APPTERM2 3
+    7640 ACC0 
+    7641 RETURN 1
+    7643 RESTART 
+    7644 GRAB 1
+    7646 CONST0 
+    7647 PUSHENVACC1 
+    7648 OFFSETINT -1
+    7650 PUSH 
+    7651 BRANCH 7690
+    7653 CHECK_SIGNALS 
+    7654 ENVACC2 
+    7655 PUSHACC2 
+    7656 PUSHACC5 
+    7657 C_CALL2 array_get
+    7659 NEQ 
+    7660 BRANCHIFNOT 7679
+    7662 ENVACC2 
+    7663 PUSHACC2 
+    7664 PUSHACC4 
+    7665 C_CALL2 array_get
+    7667 NEQ 
+    7668 BRANCHIFNOT 7679
+    7670 ACC1 
+    7671 PUSHACC3 
+    7672 C_CALL2 array_get
+    7674 PUSHACC2 
+    7675 PUSHACC5 
+    7676 C_CALL2 array_get
+    7678 NEQ 
+    7679 BRANCHIFNOT 7685
+    7681 ENVACC4 
+    7682 MAKEBLOCK1 0
+    7684 RAISE 
+    7685 ACC1 
+    7686 OFFSETINT 1
+    7688 ASSIGN 1
+    7690 ACC0 
+    7691 PUSHACC2 
+    7692 LEINT 
+    7693 BRANCHIF 7653
+    7695 CONST0 
+    7696 POP 2
+    7698 CONST0 
+    7699 PUSHENVACC1 
+    7700 OFFSETINT -1
+    7702 PUSH 
+    7703 BRANCH 7727
+    7705 CHECK_SIGNALS 
+    7706 ENVACC2 
+    7707 PUSHACC2 
+    7708 PUSHACC5 
+    7709 C_CALL2 array_get
+    7711 NEQ 
+    7712 BRANCHIFNOT 7722
+    7714 ACC1 
+    7715 PUSHACC4 
+    7716 C_CALL2 array_get
+    7718 PUSHACC2 
+    7719 PUSHACC4 
+    7720 C_CALL3 array_set
+    7722 ACC1 
+    7723 OFFSETINT 1
+    7725 ASSIGN 1
+    7727 ACC0 
+    7728 PUSHACC2 
+    7729 LEINT 
+    7730 BRANCHIF 7705
+    7732 CONST0 
+    7733 POP 2
+    7735 ENVACC3 
+    7736 GETFIELD0 
+    7737 PUSHACC2 
+    7738 PUSHENVACC 5
+    7740 APPLY2 
+    7741 PUSHENVACC3 
+    7742 SETFIELD0 
+    7743 ACC0 
+    7744 RETURN 2
+    7746 ENVACC1 
+    7747 GETFIELD 4
+    7749 PUSHACC1 
+    7750 PUSHENVACC2 
+    7751 APPLY1 
+    7752 LEINT 
+    7753 RETURN 1
+    7755 CONST0 
+    7756 PUSHCONST0 
+    7757 PUSHENVACC1 
+    7758 OFFSETINT -1
+    7760 PUSH 
+    7761 BRANCH 7782
+    7763 CHECK_SIGNALS 
+    7764 ENVACC2 
+    7765 PUSHACC2 
+    7766 PUSHACC5 
+    7767 C_CALL2 array_get
+    7769 NEQ 
+    7770 BRANCHIFNOT 7777
+    7772 ACC2 
+    7773 OFFSETINT 1
+    7775 ASSIGN 2
+    7777 ACC1 
+    7778 OFFSETINT 1
+    7780 ASSIGN 1
+    7782 ACC0 
+    7783 PUSHACC2 
+    7784 LEINT 
+    7785 BRANCHIF 7763
+    7787 CONST0 
+    7788 POP 2
+    7790 ACC0 
+    7791 RETURN 2
+    7793 ENVACC2 
+    7794 GETFIELD0 
+    7795 OFFSETINT -1
+    7797 PUSHENVACC1 
+    7798 GETFIELD0 
+    7799 C_CALL2 array_get_addr
+    7801 PUSHACC1 
+    7802 PUSHENVACC1 
+    7803 GETFIELD0 
+    7804 C_CALL3 array_set_addr
+    7806 ENVACC2 
+    7807 OFFSETREF -1
+    7809 RETURN 1
+    7811 ENVACC1 
+    7812 GETFIELD0 
+    7813 VECTLENGTH 
+    7814 PUSHACC0 
+    7815 PUSHENVACC2 
+    7816 GETFIELD0 
+    7817 GEINT 
+    7818 BRANCHIFNOT 7845
+    7820 ATOM0 
+    7821 PUSHACC1 
+    7822 PUSHCONST2 
+    7823 MULINT 
+    7824 C_CALL2 make_vect
+    7826 PUSH 
+    7827 PUSH_RETADDR 7840
+    7829 ACC4 
+    7830 PUSHCONST0 
+    7831 PUSHACC5 
+    7832 PUSHCONST0 
+    7833 PUSHENVACC1 
+    7834 GETFIELD0 
+    7835 PUSHGETGLOBALFIELD Array, 8
+    7838 APPLY 5
+    7840 ACC0 
+    7841 PUSHENVACC1 
+    7842 SETFIELD0 
+    7843 POP 1
+    7845 ACC1 
+    7846 PUSHENVACC2 
+    7847 GETFIELD0 
+    7848 PUSHENVACC1 
+    7849 GETFIELD0 
+    7850 C_CALL3 array_set_addr
+    7852 ENVACC2 
+    7853 OFFSETREF 1
+    7855 RETURN 2
+    7857 ACC0 
+    7858 GETFIELD0 
+    7859 PUSHENVACC1 
+    7860 APPLY1 
+    7861 PUSHENVACC2 
+    7862 PUSHACC1 
+    7863 GETFIELD0 
+    7864 EQ 
+    7865 BRANCHIFNOT 7874
+    7867 ACC1 
+    7868 GETFIELD1 
+    7869 PUSHACC1 
+    7870 GETFIELD1 
+    7871 PUSHENVACC3 
+    7872 C_CALL3 array_set
+    7874 RETURN 2
+    7876 RESTART 
+    7877 GRAB 1
+    7879 CONST0 
+    7880 PUSHENVACC2 
+    7881 APPLY1 
+    7882 PUSHACC2 
+    7883 PUSHGETGLOBALFIELD List, 4
+    7886 APPLY1 
+    7887 PUSHACC1 
+    7888 PUSHACC3 
+    7889 PUSHENVACC1 
+    7890 CLOSURE 3, 7857
+    7893 PUSHGETGLOBALFIELD List, 9
+    7896 APPLY2 
+    7897 ACC0 
+    7898 RETURN 3
+    7900 ACC0 
+    7901 PUSHGETGLOBALFIELD Array, 6
+    7904 APPLY1 
+    7905 PUSHACC0 
+    7906 PUSHENVACC3 
+    7907 APPLY1 
+    7908 ENVACC2 
+    7909 GETFIELD0 
+    7910 PUSHENVACC1 
+    7911 PUSHACC2 
+    7912 C_CALL3 array_set
+    7914 ENVACC4 
+    7915 GETFIELD0 
+    7916 PUSHACC1 
+    7917 MAKEBLOCK2 0
+    7919 PUSHENVACC 4
+    7921 SETFIELD0 
+    7922 ACC0 
+    7923 RETURN 2
+    7925 ENVACC2 
+    7926 PUSHENVACC1 
+    7927 OFFSETINT 1
+    7929 C_CALL2 make_vect
+    7931 PUSHACC0 
+    7932 PUSHENVACC3 
+    7933 APPLY1 
+    7934 ENVACC4 
+    7935 GETFIELD0 
+    7936 PUSHACC1 
+    7937 MAKEBLOCK2 0
+    7939 PUSHENVACC 4
+    7941 SETFIELD0 
+    7942 ACC0 
+    7943 RETURN 2
+    7945 ENVACC1 
+    7946 PUSHACC1 
+    7947 C_CALL2 array_get
+    7949 RETURN 1
+    7951 ENVACC2 
+    7952 GETFIELD0 
+    7953 PUSHENVACC1 
+    7954 PUSHACC2 
+    7955 C_CALL3 array_set
+    7957 RETURN 1
+    7959 ENVACC1 
+    7960 PUSHENVACC2 
+    7961 PUSHENVACC1 
+    7962 MULINT 
+    7963 PUSHACC2 
+    7964 MODINT 
+    7965 DIVINT 
+    7966 PUSHENVACC1 
+    7967 PUSHCONSTINT 65536
+    7969 PUSHACC3 
+    7970 DIVINT 
+    7971 DIVINT 
+    7972 MAKEBLOCK2 0
+    7974 RETURN 1
+    7976 ENVACC3 
+    7977 OFFSETREF 1
+    7979 ENVACC1 
+    7980 PUSHACC1 
+    7981 ADDINT 
+    7982 PUSHCONST0 
+    7983 PUSHENVACC2 
+    7984 PUSHENVACC1 
+    7985 MULINT 
+    7986 PUSHACC2 
+    7987 MODINT 
+    7988 EQ 
+    7989 BRANCHIFNOT 8001
+    7991 ENVACC2 
+    7992 PUSHCONSTINT 65536
+    7994 SUBINT 
+    7995 PUSHENVACC1 
+    7996 MULINT 
+    7997 PUSHACC1 
+    7998 ADDINT 
+    7999 RETURN 2
+    8001 ACC0 
+    8002 RETURN 2
+    8004 ACC0 
+    8005 C_CALL1 obj_dup
+    8007 PUSHENVACC1 
+    8008 PUSHACC1 
+    8009 PUSHENVACC2 
+    8010 APPLY2 
+    8011 ACC0 
+    8012 RETURN 2
+    8014 RESTART 
+    8015 GRAB 1
+    8017 ACC1 
+    8018 GETFIELD0 
+    8019 PUSHACC0 
+    8020 PUSHCONST1 
+    8021 PUSHACC3 
+    8022 SETVECTITEM 
+    8023 ACC0 
+    8024 OFFSETINT 1
+    8026 PUSHACC3 
+    8027 SETFIELD0 
+    8028 RETURN 3
+    8030 ENVACC1 
+    8031 GETFIELD0 
+    8032 PUSHENVACC1 
+    8033 OFFSETREF 1
+    8035 ACC0 
+    8036 RETURN 2
+    8038 CONSTINT 248
+    8040 PUSHCONST0 
+    8041 MAKEBLOCK1 0
+    8043 PUSHACC0 
+    8044 CLOSURE 1, 8030
+    8047 PUSH 
+    8048 CLOSURE 0, 8015
+    8051 PUSHACC0 
+    8052 PUSHACC3 
+    8053 CLOSURE 2, 8004
+    8056 PUSHCONSTINT 16
+    8058 PUSHCONST3 
+    8059 PUSHCONST1 
+    8060 PUSHCONST1 
+    8061 PUSHCONST1 
+    8062 MAKEBLOCK 5, 0
+    8065 PUSHCONSTINT 16
+    8067 PUSHGETGLOBALFIELD Sys, 3
+    8070 DIVINT 
+    8071 PUSHCONST0 
+    8072 PUSHCONSTINT 32
+    8074 PUSHCONST2 
+    8075 PUSHCONST0 
+    8076 MAKEBLOCK1 0
+    8078 PUSHACC0 
+    8079 PUSHACC3 
+    8080 PUSHACC6 
+    8081 CLOSURE 3, 7976
+    8084 PUSHACC3 
+    8085 PUSHACC6 
+    8086 CLOSURE 2, 7959
+    8089 PUSHCONST0 
+    8090 PUSHCONST0 
+    8091 MAKEBLOCK1 0
+    8093 PUSHACC0 
+    8094 PUSHACC7 
+    8095 CLOSURE 2, 7951
+    8098 PUSHACC7 
+    8099 CLOSURE 1, 7945
+    8102 PUSHCONST0 
+    8103 MAKEBLOCK1 0
+    8105 PUSH 
+    8106 ATOM0 
+    8107 PUSHACC1 
+    8108 PUSHACC4 
+    8109 PUSHACC7 
+    8110 PUSHACC 13
+    8112 CLOSURE 4, 7925
+    8115 PUSHACC2 
+    8116 PUSHACC5 
+    8117 PUSHACC7 
+    8118 PUSHACC 14
+    8120 CLOSURE 4, 7900
+    8123 PUSHACC1 
+    8124 PUSHACC 9
+    8126 CLOSURE 2, 7877
+    8129 PUSH 
+    8130 ATOM0 
+    8131 PUSHCONSTINT 10
+    8133 C_CALL2 make_vect
+    8135 MAKEBLOCK1 0
+    8137 PUSHCONST0 
+    8138 MAKEBLOCK1 0
+    8140 PUSHACC0 
+    8141 PUSHACC2 
+    8142 CLOSURE 2, 7811
+    8145 PUSHACC1 
+    8146 PUSHACC3 
+    8147 CLOSURE 2, 7793
+    8150 PUSHACC 12
+    8152 PUSHACC 18
+    8154 CLOSURE 2, 7755
+    8157 PUSHACC0 
+    8158 PUSHACC 22
+    8160 CLOSURE 2, 7746
+    8163 PUSHGETGLOBAL "Oo.Failed"
+    8165 MAKEBLOCK1 0
+    8167 PUSH 
+    8168 CLOSUREREC 0, 6415
+    8172 ACC0 
+    8173 PUSHACC2 
+    8174 PUSHACC 14
+    8176 PUSHACC 19
+    8178 PUSHACC 25
+    8180 CLOSURE 5, 7644
+    8183 PUSHACC0 
+    8184 PUSHACC3 
+    8185 PUSHACC5 
+    8186 PUSHACC 8
+    8188 PUSHACC 10
+    8190 PUSHACC 12
+    8192 PUSHACC 14
+    8194 CLOSUREREC 7, 6444
+    8198 ACC0 
+    8199 PUSHACC5 
+    8200 PUSHACC 15
+    8202 PUSHACC 18
+    8204 PUSHACC 21
+    8206 PUSHACC 31
+    8208 CLOSURE 6, 7614
+    8211 PUSHACC0 
+    8212 PUSHACC 26
+    8214 CLOSURE 2, 7582
+    8217 PUSHACC 27
+    8219 PUSHCONSTINT 65536
+    8221 PUSHACC 28
+    8223 MULINT 
+    8224 MULINT 
+    8225 PUSHACC0 
+    8226 MAKEBLOCK1 0
+    8228 PUSHCONSTINT 101
+    8230 PUSHGETGLOBALFIELD Hashtbl, 0
+    8233 APPLY1 
+    8234 PUSHACC1 
+    8235 PUSHACC 26
+    8237 CLOSURE 2, 7571
+    8240 PUSHACC0 
+    8241 PUSHACC2 
+    8242 CLOSURE 2, 7538
+    8245 PUSH 
+    8246 CLOSURE 0, 7530
+    8249 PUSHACC0 
+    8250 MAKEBLOCK1 0
+    8252 POP 1
+    8254 PUSHGETGLOBALFIELD Map, 0
+    8257 APPLY1 
+    8258 PUSH 
+    8259 CLOSURE 0, 7521
+    8262 PUSHACC0 
+    8263 MAKEBLOCK1 0
+    8265 POP 1
+    8267 PUSHGETGLOBALFIELD Map, 0
+    8270 APPLY1 
+    8271 PUSH 
+    8272 CLOSURE 0, 7512
+    8275 PUSHACC0 
+    8276 MAKEBLOCK1 0
+    8278 POP 1
+    8280 PUSHGETGLOBALFIELD Map, 0
+    8283 APPLY1 
+    8284 PUSHCONST0 
+    8285 MAKEBLOCK1 0
+    8287 PUSHACC0 
+    8288 PUSHACC2 
+    8289 PUSHACC4 
+    8290 PUSHACC6 
+    8291 PUSHACC 37
+    8293 CLOSURE 5, 7489
+    8296 PUSHACC 25
+    8298 CLOSURE 1, 7453
+    8301 PUSHACC0 
+    8302 PUSHACC 26
+    8304 PUSHACC 28
+    8306 PUSHACC 35
+    8308 CLOSURE 4, 7409
+    8311 PUSHCONST0 
+    8312 MAKEBLOCK1 0
+    8314 PUSHCONST0 
+    8315 MAKEBLOCK1 0
+    8317 PUSHACC6 
+    8318 PUSHACC 8
+    8320 PUSHACC 12
+    8322 CLOSURE 3, 7362
+    8325 PUSHACC2 
+    8326 PUSHACC4 
+    8327 PUSHACC 9
+    8329 CLOSURE 3, 7328
+    8332 PUSHACC 37
+    8334 CLOSURE 1, 7288
+    8337 PUSHACC2 
+    8338 PUSHACC 10
+    8340 PUSHACC 12
+    8342 PUSHACC 14
+    8344 CLOSURE 4, 7187
+    8347 PUSHACC 12
+    8349 CLOSURE 1, 7027
+    8352 PUSH 
+    8353 CLOSURE 0, 6980
+    8356 PUSH 
+    8357 CLOSURE 0, 6969
+    8360 PUSHACC0 
+    8361 PUSHACC 16
+    8363 CLOSURE 2, 6950
+    8366 PUSHACC 16
+    8368 CLOSURE 1, 6939
+    8371 PUSHACC 47
+    8373 CLOSURE 1, 6927
+    8376 PUSH 
+    8377 CLOSURE 0, 6862
+    8380 PUSHACC 15
+    8382 PUSHACC 18
+    8384 PUSHACC 20
+    8386 PUSHACC 23
+    8388 CLOSURE 4, 6842
+    8391 PUSHACC 12
+    8393 PUSHACC 27
+    8395 PUSHACC 56
+    8397 CLOSURE 3, 6787
+    8400 PUSHACC 57
+    8402 PUSHACC 60
+    8404 PUSHACC 62
+    8406 CLOSURE 3, 6769
+    8409 PUSH 
+    8410 CLOSUREREC 0, 6519
+    8414 ACC0 
+    8415 CLOSURE 1, 6752
+    8418 PUSHACC0 
+    8419 PUSHACC 61
+    8421 PUSHACC 64
+    8423 CLOSURE 3, 6735
+    8426 PUSHACC 52
+    8428 CLOSURE 1, 6715
+    8431 PUSHACC 39
+    8433 PUSHACC 49
+    8435 CLOSURE 2, 6695
+    8438 PUSHACC0 
+    8439 PUSHACC 20
+    8441 PUSHACC 22
+    8443 PUSHACC 27
+    8445 PUSHACC 47
+    8447 PUSHACC 49
+    8449 PUSHACC 55
+    8451 PUSHACC 63
+    8453 CLOSURE 8, 6644
+    8456 PUSHACC 41
+    8458 CLOSURE 1, 6618
+    8461 PUSHACC0 
+    8462 PUSHACC 52
+    8464 PUSHACC 57
+    8466 PUSHACC 63
+    8468 CLOSURE 4, 6581
+    8471 PUSHACC0 
+    8472 PUSHACC3 
+    8473 PUSHACC 66
+    8475 PUSHACC7 
+    8476 PUSHACC 9
+    8478 PUSHACC 11
+    8480 PUSHACC 14
+    8482 PUSHACC 16
+    8484 PUSHACC 18
+    8486 PUSHACC 20
+    8488 PUSHACC 27
+    8490 PUSHACC 29
+    8492 PUSHACC 32
+    8494 PUSHACC 32
+    8496 PUSHACC 35
+    8498 PUSHACC 27
+    8500 PUSHACC 29
+    8502 PUSHACC 31
+    8504 PUSHACC 34
+    8506 PUSHACC 50
+    8508 PUSHACC 85
+    8510 MAKEBLOCK 21, 0
+    8513 POP 70
+    8515 SETGLOBAL Oo
+    8517 BRANCH 8568
+    8519 ACC0 
+    8520 BRANCHIFNOT 8525
+    8522 ACC0 
+    8523 BRANCH 8530
+    8525 ENVACC1 
+    8526 PUSHGETGLOBALFIELD Oo, 14
+    8529 APPLY1 
+    8530 PUSHCONST0 
+    8531 ACC1 
+    8532 BRANCHIFNOT 8537
+    8534 CONST0 
+    8535 BRANCH 8543
+    8537 ENVACC1 
+    8538 PUSHACC1 
+    8539 PUSHGETGLOBALFIELD Oo, 15
+    8542 APPLY2 
+    8543 ACC0 
+    8544 RETURN 2
+    8546 CONSTINT 23
+    8548 RETURN 1
+    8550 CLOSURE 0, 8546
+    8553 PUSHACC0 
+    8554 POP 1
+    8556 PUSHENVACC1 
+    8557 PUSHACC2 
+    8558 PUSHGETGLOBALFIELD Oo, 8
+    8561 APPLY3 
+    8562 ACC0 
+    8563 CLOSURE 1, 8519
+    8566 RETURN 1
+    8568 GETGLOBALFIELD Oo, 1
+    8571 PUSHGETGLOBAL "m"
+    8573 PUSHACC1 
+    8574 APPLY1 
+    8575 PUSHCONST3 
+    8576 C_CALL1 alloc_dummy
+    8578 PUSHGETGLOBAL <0>("m", 0)
+    8580 PUSHGETGLOBALFIELD Oo, 12
+    8583 APPLY1 
+    8584 PUSHACC2 
+    8585 CLOSURE 1, 8550
+    8588 PUSHACC1 
+    8589 PUSHACC1 
+    8590 APPLY1 
+    8591 PUSHACC2 
+    8592 PUSHGETGLOBALFIELD Oo, 13
+    8595 APPLY1 
+    8596 ACC2 
+    8597 PUSHACC2 
+    8598 PUSHACC2 
+    8599 MAKEBLOCK3 0
+    8601 POP 3
+    8603 PUSHACC1 
+    8604 C_CALL2 update_dummy
+    8606 CONST0 
+    8607 PUSHACC1 
+    8608 GETFIELD0 
+    8609 APPLY1 
+    8610 PUSHCONSTINT 23
+    8612 PUSHACC1 
+    8613 PUSHACC4 
+    8614 GETMETHOD 
+    8615 APPLY1 
+    8616 NEQ 
+    8617 BRANCHIFNOT 8624
+    8619 GETGLOBAL Not_found
+    8621 MAKEBLOCK1 0
+    8623 RAISE 
+    8624 POP 1
+    8626 ACC0 
+    8627 MAKEBLOCK1 0
+    8629 POP 3
+    8631 SETGLOBAL T300-getmethod
+    8633 STOP 
+**)
diff --git a/test/testinterp/t301-object.ml b/test/testinterp/t301-object.ml
new file mode 100644 (file)
index 0000000..8c14262
--- /dev/null
@@ -0,0 +1,29 @@
+(**** file testinterp/t301-object.ml 
+   suggested by Jacques Garrigue to Basile Starynkevitch 
+
+   compilable with
+ocamlc -nostdlib -I ../../stdlib \
+  ../../stdlib/pervasives.cmo ../../stdlib/camlinternalOO.cmo \
+  t301-object.ml -o t301-object.byte
+
+***)
+(* $Id: t301-object.ml,v 1.2 2004/06/02 09:42:01 basile Exp $ *)
+
+
+class c = object (self)
+  method pubmet = 1
+  method privmet = self#pubmet + 1
+  val o = object method a = 3 method m = 4 end
+  method dynmet = o#m
+end;;
+
+let f () =
+  let c = new c in
+  (c#pubmet, c#privmet, c#dynmet);;
+
+let (x,y,z) = f () in
+  if x <> 1 then raise Not_found;
+  if y <> 2 then raise Not_found;
+  if z <> 4 then raise Not_found;;
+
+(**** eof $Id: t301-object.ml,v 1.2 2004/06/02 09:42:01 basile Exp $ *)
diff --git a/test/testinterp/t310-alloc-1.ml b/test/testinterp/t310-alloc-1.ml
new file mode 100644 (file)
index 0000000..c438cc9
--- /dev/null
@@ -0,0 +1,1587 @@
+open Lib;;
+let rec f a n =
+  if n <= 0 then a
+  else f (1::a) (n-1)
+in
+let l = f [] 30000 in
+if List.fold_left (+) 0 l <> 30000 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2435
+    2406 RESTART 
+    2407 GRAB 1
+    2409 CONST0 
+    2410 PUSHACC2 
+    2411 LEINT 
+    2412 BRANCHIFNOT 2417
+    2414 ACC0 
+    2415 RETURN 2
+    2417 ACC1 
+    2418 OFFSETINT -1
+    2420 PUSHACC1 
+    2421 PUSHCONST1 
+    2422 MAKEBLOCK2 0
+    2424 PUSHOFFSETCLOSURE0 
+    2425 APPTERM2 4
+    2427 RESTART 
+    2428 GRAB 1
+    2430 ACC1 
+    2431 PUSHACC1 
+    2432 ADDINT 
+    2433 RETURN 2
+    2435 CLOSUREREC 0, 2407
+    2439 CONSTINT 30000
+    2441 PUSHCONST0 
+    2442 PUSHACC2 
+    2443 APPLY2 
+    2444 PUSHCONSTINT 30000
+    2446 PUSHACC1 
+    2447 PUSHCONST0 
+    2448 PUSH 
+    2449 CLOSURE 0, 2428
+    2452 PUSHGETGLOBALFIELD List, 12
+    2455 APPLY3 
+    2456 NEQ 
+    2457 BRANCHIFNOT 2464
+    2459 GETGLOBAL Not_found
+    2461 MAKEBLOCK1 0
+    2463 RAISE 
+    2464 POP 2
+    2466 ATOM0 
+    2467 SETGLOBAL T310-alloc-1
+    2469 STOP 
+**)
diff --git a/test/testinterp/t310-alloc-2.ml b/test/testinterp/t310-alloc-2.ml
new file mode 100644 (file)
index 0000000..81034e7
--- /dev/null
@@ -0,0 +1,2313 @@
+open Lib;;
+let v = Array.make 200000 2 in
+let t = ref 0 in
+Array.iter (fun x -> t := !t + x) v;
+if !t <> 400000 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 3341
+    2406 RESTART 
+    2407 GRAB 2
+    2409 ACC2 
+    2410 PUSHACC2 
+    2411 VECTLENGTH 
+    2412 OFFSETINT -1
+    2414 PUSHCONST0 
+    2415 PUSH 
+    2416 BRANCH 2433
+    2418 CHECK_SIGNALS 
+    2419 ACC2 
+    2420 PUSHACC2 
+    2421 PUSHACC6 
+    2422 C_CALL2 array_unsafe_get
+    2424 PUSHACC5 
+    2425 APPLY2 
+    2426 ASSIGN 2
+    2428 ACC1 
+    2429 OFFSETINT -1
+    2431 ASSIGN 1
+    2433 ACC0 
+    2434 PUSHACC2 
+    2435 GEINT 
+    2436 BRANCHIF 2418
+    2438 CONST0 
+    2439 POP 2
+    2441 ACC0 
+    2442 RETURN 4
+    2444 RESTART 
+    2445 GRAB 2
+    2447 ACC1 
+    2448 PUSHCONST0 
+    2449 PUSHACC4 
+    2450 VECTLENGTH 
+    2451 OFFSETINT -1
+    2453 PUSH 
+    2454 BRANCH 2471
+    2456 CHECK_SIGNALS 
+    2457 ACC1 
+    2458 PUSHACC6 
+    2459 C_CALL2 array_unsafe_get
+    2461 PUSHACC3 
+    2462 PUSHACC5 
+    2463 APPLY2 
+    2464 ASSIGN 2
+    2466 ACC1 
+    2467 OFFSETINT 1
+    2469 ASSIGN 1
+    2471 ACC0 
+    2472 PUSHACC2 
+    2473 LEINT 
+    2474 BRANCHIF 2456
+    2476 CONST0 
+    2477 POP 2
+    2479 ACC0 
+    2480 RETURN 4
+    2482 RESTART 
+    2483 GRAB 1
+    2485 ACC1 
+    2486 BRANCHIFNOT 2502
+    2488 ACC1 
+    2489 GETFIELD0 
+    2490 PUSHACC1 
+    2491 PUSHENVACC1 
+    2492 C_CALL3 array_unsafe_set
+    2494 ACC1 
+    2495 GETFIELD1 
+    2496 PUSHACC1 
+    2497 OFFSETINT 1
+    2499 PUSHOFFSETCLOSURE0 
+    2500 APPTERM2 4
+    2502 ENVACC1 
+    2503 RETURN 2
+    2505 ACC0 
+    2506 BRANCHIFNOT 2531
+    2508 ACC0 
+    2509 GETFIELD1 
+    2510 PUSHACC1 
+    2511 GETFIELD0 
+    2512 PUSHACC1 
+    2513 PUSHGETGLOBALFIELD List, 0
+    2516 APPLY1 
+    2517 OFFSETINT 1
+    2519 C_CALL2 make_vect
+    2521 PUSHACC0 
+    2522 CLOSUREREC 1, 2483
+    2526 ACC2 
+    2527 PUSHCONST1 
+    2528 PUSHACC2 
+    2529 APPTERM2 6
+    2531 ATOM0 
+    2532 RETURN 1
+    2534 RESTART 
+    2535 GRAB 1
+    2537 CONST0 
+    2538 PUSHACC1 
+    2539 LTINT 
+    2540 BRANCHIFNOT 2545
+    2542 ACC1 
+    2543 RETURN 2
+    2545 ACC1 
+    2546 PUSHACC1 
+    2547 PUSHENVACC1 
+    2548 C_CALL2 array_unsafe_get
+    2550 MAKEBLOCK2 0
+    2552 PUSHACC1 
+    2553 OFFSETINT -1
+    2555 PUSHOFFSETCLOSURE0 
+    2556 APPTERM2 4
+    2558 ACC0 
+    2559 CLOSUREREC 1, 2535
+    2563 CONST0 
+    2564 PUSHACC2 
+    2565 VECTLENGTH 
+    2566 OFFSETINT -1
+    2568 PUSHACC2 
+    2569 APPTERM2 4
+    2571 RESTART 
+    2572 GRAB 1
+    2574 ACC1 
+    2575 VECTLENGTH 
+    2576 PUSHCONST0 
+    2577 PUSHACC1 
+    2578 EQ 
+    2579 BRANCHIFNOT 2584
+    2581 ATOM0 
+    2582 RETURN 3
+    2584 CONST0 
+    2585 PUSHACC3 
+    2586 C_CALL2 array_unsafe_get
+    2588 PUSHCONST0 
+    2589 PUSHACC3 
+    2590 APPLY2 
+    2591 PUSHACC1 
+    2592 C_CALL2 make_vect
+    2594 PUSHCONST1 
+    2595 PUSHACC2 
+    2596 OFFSETINT -1
+    2598 PUSH 
+    2599 BRANCH 2618
+    2601 CHECK_SIGNALS 
+    2602 ACC1 
+    2603 PUSHACC6 
+    2604 C_CALL2 array_unsafe_get
+    2606 PUSHACC2 
+    2607 PUSHACC6 
+    2608 APPLY2 
+    2609 PUSHACC2 
+    2610 PUSHACC4 
+    2611 C_CALL3 array_unsafe_set
+    2613 ACC1 
+    2614 OFFSETINT 1
+    2616 ASSIGN 1
+    2618 ACC0 
+    2619 PUSHACC2 
+    2620 LEINT 
+    2621 BRANCHIF 2601
+    2623 CONST0 
+    2624 POP 2
+    2626 ACC0 
+    2627 RETURN 4
+    2629 RESTART 
+    2630 GRAB 1
+    2632 CONST0 
+    2633 PUSHACC2 
+    2634 VECTLENGTH 
+    2635 OFFSETINT -1
+    2637 PUSH 
+    2638 BRANCH 2653
+    2640 CHECK_SIGNALS 
+    2641 ACC1 
+    2642 PUSHACC4 
+    2643 C_CALL2 array_unsafe_get
+    2645 PUSHACC2 
+    2646 PUSHACC4 
+    2647 APPLY2 
+    2648 ACC1 
+    2649 OFFSETINT 1
+    2651 ASSIGN 1
+    2653 ACC0 
+    2654 PUSHACC2 
+    2655 LEINT 
+    2656 BRANCHIF 2640
+    2658 CONST0 
+    2659 RETURN 4
+    2661 RESTART 
+    2662 GRAB 1
+    2664 ACC1 
+    2665 VECTLENGTH 
+    2666 PUSHCONST0 
+    2667 PUSHACC1 
+    2668 EQ 
+    2669 BRANCHIFNOT 2674
+    2671 ATOM0 
+    2672 RETURN 3
+    2674 CONST0 
+    2675 PUSHACC3 
+    2676 C_CALL2 array_unsafe_get
+    2678 PUSHACC2 
+    2679 APPLY1 
+    2680 PUSHACC1 
+    2681 C_CALL2 make_vect
+    2683 PUSHCONST1 
+    2684 PUSHACC2 
+    2685 OFFSETINT -1
+    2687 PUSH 
+    2688 BRANCH 2706
+    2690 CHECK_SIGNALS 
+    2691 ACC1 
+    2692 PUSHACC6 
+    2693 C_CALL2 array_unsafe_get
+    2695 PUSHACC5 
+    2696 APPLY1 
+    2697 PUSHACC2 
+    2698 PUSHACC4 
+    2699 C_CALL3 array_unsafe_set
+    2701 ACC1 
+    2702 OFFSETINT 1
+    2704 ASSIGN 1
+    2706 ACC0 
+    2707 PUSHACC2 
+    2708 LEINT 
+    2709 BRANCHIF 2690
+    2711 CONST0 
+    2712 POP 2
+    2714 ACC0 
+    2715 RETURN 4
+    2717 RESTART 
+    2718 GRAB 1
+    2720 CONST0 
+    2721 PUSHACC2 
+    2722 VECTLENGTH 
+    2723 OFFSETINT -1
+    2725 PUSH 
+    2726 BRANCH 2740
+    2728 CHECK_SIGNALS 
+    2729 ACC1 
+    2730 PUSHACC4 
+    2731 C_CALL2 array_unsafe_get
+    2733 PUSHACC3 
+    2734 APPLY1 
+    2735 ACC1 
+    2736 OFFSETINT 1
+    2738 ASSIGN 1
+    2740 ACC0 
+    2741 PUSHACC2 
+    2742 LEINT 
+    2743 BRANCHIF 2728
+    2745 CONST0 
+    2746 RETURN 4
+    2748 RESTART 
+    2749 GRAB 4
+    2751 CONST0 
+    2752 PUSHACC5 
+    2753 LTINT 
+    2754 BRANCHIF 2782
+    2756 CONST0 
+    2757 PUSHACC2 
+    2758 LTINT 
+    2759 BRANCHIF 2782
+    2761 ACC0 
+    2762 VECTLENGTH 
+    2763 PUSHACC5 
+    2764 PUSHACC3 
+    2765 ADDINT 
+    2766 GTINT 
+    2767 BRANCHIF 2782
+    2769 CONST0 
+    2770 PUSHACC4 
+    2771 LTINT 
+    2772 BRANCHIF 2782
+    2774 ACC2 
+    2775 VECTLENGTH 
+    2776 PUSHACC5 
+    2777 PUSHACC5 
+    2778 ADDINT 
+    2779 GTINT 
+    2780 BRANCHIFNOT 2789
+    2782 GETGLOBAL "Array.blit"
+    2784 PUSHGETGLOBALFIELD Pervasives, 2
+    2787 APPTERM1 6
+    2789 ACC3 
+    2790 PUSHACC2 
+    2791 LTINT 
+    2792 BRANCHIFNOT 2827
+    2794 ACC4 
+    2795 OFFSETINT -1
+    2797 PUSHCONST0 
+    2798 PUSH 
+    2799 BRANCH 2819
+    2801 CHECK_SIGNALS 
+    2802 ACC1 
+    2803 PUSHACC4 
+    2804 ADDINT 
+    2805 PUSHACC3 
+    2806 C_CALL2 array_unsafe_get
+    2808 PUSHACC2 
+    2809 PUSHACC7 
+    2810 ADDINT 
+    2811 PUSHACC6 
+    2812 C_CALL3 array_unsafe_set
+    2814 ACC1 
+    2815 OFFSETINT -1
+    2817 ASSIGN 1
+    2819 ACC0 
+    2820 PUSHACC2 
+    2821 GEINT 
+    2822 BRANCHIF 2801
+    2824 CONST0 
+    2825 RETURN 7
+    2827 CONST0 
+    2828 PUSHACC5 
+    2829 OFFSETINT -1
+    2831 PUSH 
+    2832 BRANCH 2852
+    2834 CHECK_SIGNALS 
+    2835 ACC1 
+    2836 PUSHACC4 
+    2837 ADDINT 
+    2838 PUSHACC3 
+    2839 C_CALL2 array_unsafe_get
+    2841 PUSHACC2 
+    2842 PUSHACC7 
+    2843 ADDINT 
+    2844 PUSHACC6 
+    2845 C_CALL3 array_unsafe_set
+    2847 ACC1 
+    2848 OFFSETINT 1
+    2850 ASSIGN 1
+    2852 ACC0 
+    2853 PUSHACC2 
+    2854 LEINT 
+    2855 BRANCHIF 2834
+    2857 CONST0 
+    2858 RETURN 7
+    2860 RESTART 
+    2861 GRAB 3
+    2863 CONST0 
+    2864 PUSHACC2 
+    2865 LTINT 
+    2866 BRANCHIF 2881
+    2868 CONST0 
+    2869 PUSHACC3 
+    2870 LTINT 
+    2871 BRANCHIF 2881
+    2873 ACC0 
+    2874 VECTLENGTH 
+    2875 PUSHACC3 
+    2876 PUSHACC3 
+    2877 ADDINT 
+    2878 GTINT 
+    2879 BRANCHIFNOT 2888
+    2881 GETGLOBAL "Array.fill"
+    2883 PUSHGETGLOBALFIELD Pervasives, 2
+    2886 APPTERM1 5
+    2888 ACC1 
+    2889 PUSHACC3 
+    2890 PUSHACC3 
+    2891 ADDINT 
+    2892 OFFSETINT -1
+    2894 PUSH 
+    2895 BRANCH 2908
+    2897 CHECK_SIGNALS 
+    2898 ACC5 
+    2899 PUSHACC2 
+    2900 PUSHACC4 
+    2901 C_CALL3 array_unsafe_set
+    2903 ACC1 
+    2904 OFFSETINT 1
+    2906 ASSIGN 1
+    2908 ACC0 
+    2909 PUSHACC2 
+    2910 LEINT 
+    2911 BRANCHIF 2897
+    2913 CONST0 
+    2914 RETURN 6
+    2916 RESTART 
+    2917 GRAB 2
+    2919 CONST0 
+    2920 PUSHACC2 
+    2921 LTINT 
+    2922 BRANCHIF 2937
+    2924 CONST0 
+    2925 PUSHACC3 
+    2926 LTINT 
+    2927 BRANCHIF 2937
+    2929 ACC0 
+    2930 VECTLENGTH 
+    2931 PUSHACC3 
+    2932 PUSHACC3 
+    2933 ADDINT 
+    2934 GTINT 
+    2935 BRANCHIFNOT 2944
+    2937 GETGLOBAL "Array.sub"
+    2939 PUSHGETGLOBALFIELD Pervasives, 2
+    2942 APPTERM1 4
+    2944 CONST0 
+    2945 PUSHACC3 
+    2946 EQ 
+    2947 BRANCHIFNOT 2952
+    2949 ATOM0 
+    2950 RETURN 3
+    2952 ACC1 
+    2953 PUSHACC1 
+    2954 C_CALL2 array_unsafe_get
+    2956 PUSHACC3 
+    2957 C_CALL2 make_vect
+    2959 PUSHCONST1 
+    2960 PUSHACC4 
+    2961 OFFSETINT -1
+    2963 PUSH 
+    2964 BRANCH 2982
+    2966 CHECK_SIGNALS 
+    2967 ACC1 
+    2968 PUSHACC5 
+    2969 ADDINT 
+    2970 PUSHACC4 
+    2971 C_CALL2 array_unsafe_get
+    2973 PUSHACC2 
+    2974 PUSHACC4 
+    2975 C_CALL3 array_unsafe_set
+    2977 ACC1 
+    2978 OFFSETINT 1
+    2980 ASSIGN 1
+    2982 ACC0 
+    2983 PUSHACC2 
+    2984 LEINT 
+    2985 BRANCHIF 2966
+    2987 CONST0 
+    2988 POP 2
+    2990 ACC0 
+    2991 RETURN 4
+    2993 ACC0 
+    2994 BRANCHIFNOT 3017
+    2996 ACC0 
+    2997 GETFIELD0 
+    2998 PUSHCONST0 
+    2999 PUSHACC1 
+    3000 VECTLENGTH 
+    3001 GTINT 
+    3002 BRANCHIFNOT 3012
+    3004 ENVACC2 
+    3005 PUSHCONST0 
+    3006 PUSHACC2 
+    3007 C_CALL2 array_unsafe_get
+    3009 PUSHENVACC1 
+    3010 APPTERM2 4
+    3012 ACC1 
+    3013 GETFIELD1 
+    3014 PUSHOFFSETCLOSURE0 
+    3015 APPTERM1 3
+    3017 ATOM0 
+    3018 RETURN 1
+    3020 ACC0 
+    3021 PUSHENVACC1 
+    3022 CLOSUREREC 2, 2993
+    3026 ACC1 
+    3027 PUSHACC1 
+    3028 APPTERM1 3
+    3030 CONST0 
+    3031 PUSHACC1 
+    3032 VECTLENGTH 
+    3033 OFFSETINT -1
+    3035 PUSH 
+    3036 BRANCH 3056
+    3038 CHECK_SIGNALS 
+    3039 ACC1 
+    3040 PUSHACC3 
+    3041 C_CALL2 array_unsafe_get
+    3043 PUSHENVACC2 
+    3044 GETFIELD0 
+    3045 PUSHENVACC1 
+    3046 C_CALL3 array_unsafe_set
+    3048 ENVACC2 
+    3049 OFFSETREF 1
+    3051 ACC1 
+    3052 OFFSETINT 1
+    3054 ASSIGN 1
+    3056 ACC0 
+    3057 PUSHACC2 
+    3058 LEINT 
+    3059 BRANCHIF 3038
+    3061 CONST0 
+    3062 RETURN 3
+    3064 RESTART 
+    3065 GRAB 1
+    3067 ACC1 
+    3068 VECTLENGTH 
+    3069 PUSHACC1 
+    3070 ADDINT 
+    3071 RETURN 2
+    3073 RESTART 
+    3074 GRAB 1
+    3076 ACC1 
+    3077 PUSHCONST0 
+    3078 PUSH 
+    3079 CLOSURE 0, 3065
+    3082 PUSHGETGLOBALFIELD List, 12
+    3085 APPLY3 
+    3086 PUSHACC1 
+    3087 PUSHACC1 
+    3088 C_CALL2 make_vect
+    3090 PUSHCONST0 
+    3091 MAKEBLOCK1 0
+    3093 PUSHACC4 
+    3094 PUSHACC1 
+    3095 PUSHACC3 
+    3096 CLOSURE 2, 3030
+    3099 PUSHGETGLOBALFIELD List, 9
+    3102 APPLY2 
+    3103 ACC1 
+    3104 RETURN 5
+    3106 RESTART 
+    3107 GRAB 1
+    3109 ACC0 
+    3110 VECTLENGTH 
+    3111 PUSHACC2 
+    3112 VECTLENGTH 
+    3113 PUSHCONST0 
+    3114 PUSHACC2 
+    3115 EQ 
+    3116 BRANCHIFNOT 3126
+    3118 CONST0 
+    3119 PUSHACC1 
+    3120 EQ 
+    3121 BRANCHIFNOT 3126
+    3123 ATOM0 
+    3124 RETURN 4
+    3126 CONST0 
+    3127 PUSHCONST0 
+    3128 PUSHACC3 
+    3129 GTINT 
+    3130 BRANCHIFNOT 3135
+    3132 ACC3 
+    3133 BRANCH 3136
+    3135 ACC4 
+    3136 C_CALL2 array_unsafe_get
+    3138 PUSHACC1 
+    3139 PUSHACC3 
+    3140 ADDINT 
+    3141 C_CALL2 make_vect
+    3143 PUSHCONST0 
+    3144 PUSHACC3 
+    3145 OFFSETINT -1
+    3147 PUSH 
+    3148 BRANCH 3164
+    3150 CHECK_SIGNALS 
+    3151 ACC1 
+    3152 PUSHACC6 
+    3153 C_CALL2 array_unsafe_get
+    3155 PUSHACC2 
+    3156 PUSHACC4 
+    3157 C_CALL3 array_unsafe_set
+    3159 ACC1 
+    3160 OFFSETINT 1
+    3162 ASSIGN 1
+    3164 ACC0 
+    3165 PUSHACC2 
+    3166 LEINT 
+    3167 BRANCHIF 3150
+    3169 CONST0 
+    3170 POP 2
+    3172 CONST0 
+    3173 PUSHACC2 
+    3174 OFFSETINT -1
+    3176 PUSH 
+    3177 BRANCH 3195
+    3179 CHECK_SIGNALS 
+    3180 ACC1 
+    3181 PUSHACC7 
+    3182 C_CALL2 array_unsafe_get
+    3184 PUSHACC5 
+    3185 PUSHACC3 
+    3186 ADDINT 
+    3187 PUSHACC4 
+    3188 C_CALL3 array_unsafe_set
+    3190 ACC1 
+    3191 OFFSETINT 1
+    3193 ASSIGN 1
+    3195 ACC0 
+    3196 PUSHACC2 
+    3197 LEINT 
+    3198 BRANCHIF 3179
+    3200 CONST0 
+    3201 POP 2
+    3203 ACC0 
+    3204 RETURN 5
+    3206 ACC0 
+    3207 VECTLENGTH 
+    3208 PUSHCONST0 
+    3209 PUSHACC1 
+    3210 EQ 
+    3211 BRANCHIFNOT 3216
+    3213 ATOM0 
+    3214 RETURN 2
+    3216 CONST0 
+    3217 PUSHACC2 
+    3218 C_CALL2 array_unsafe_get
+    3220 PUSHACC1 
+    3221 C_CALL2 make_vect
+    3223 PUSHCONST1 
+    3224 PUSHACC2 
+    3225 OFFSETINT -1
+    3227 PUSH 
+    3228 BRANCH 3244
+    3230 CHECK_SIGNALS 
+    3231 ACC1 
+    3232 PUSHACC5 
+    3233 C_CALL2 array_unsafe_get
+    3235 PUSHACC2 
+    3236 PUSHACC4 
+    3237 C_CALL3 array_unsafe_set
+    3239 ACC1 
+    3240 OFFSETINT 1
+    3242 ASSIGN 1
+    3244 ACC0 
+    3245 PUSHACC2 
+    3246 LEINT 
+    3247 BRANCHIF 3230
+    3249 CONST0 
+    3250 POP 2
+    3252 ACC0 
+    3253 RETURN 3
+    3255 RESTART 
+    3256 GRAB 2
+    3258 ATOM0 
+    3259 PUSHACC1 
+    3260 C_CALL2 make_vect
+    3262 PUSHCONST0 
+    3263 PUSHACC2 
+    3264 OFFSETINT -1
+    3266 PUSH 
+    3267 BRANCH 3282
+    3269 CHECK_SIGNALS 
+    3270 ACC5 
+    3271 PUSHACC5 
+    3272 C_CALL2 make_vect
+    3274 PUSHACC2 
+    3275 PUSHACC4 
+    3276 SETVECTITEM 
+    3277 ACC1 
+    3278 OFFSETINT 1
+    3280 ASSIGN 1
+    3282 ACC0 
+    3283 PUSHACC2 
+    3284 LEINT 
+    3285 BRANCHIF 3269
+    3287 CONST0 
+    3288 POP 2
+    3290 ACC0 
+    3291 RETURN 4
+    3293 RESTART 
+    3294 GRAB 1
+    3296 CONST0 
+    3297 PUSHACC1 
+    3298 EQ 
+    3299 BRANCHIFNOT 3304
+    3301 ATOM0 
+    3302 RETURN 2
+    3304 CONST0 
+    3305 PUSHACC2 
+    3306 APPLY1 
+    3307 PUSHACC1 
+    3308 C_CALL2 make_vect
+    3310 PUSHCONST1 
+    3311 PUSHACC2 
+    3312 OFFSETINT -1
+    3314 PUSH 
+    3315 BRANCH 3330
+    3317 CHECK_SIGNALS 
+    3318 ACC1 
+    3319 PUSHACC5 
+    3320 APPLY1 
+    3321 PUSHACC2 
+    3322 PUSHACC4 
+    3323 C_CALL3 array_unsafe_set
+    3325 ACC1 
+    3326 OFFSETINT 1
+    3328 ASSIGN 1
+    3330 ACC0 
+    3331 PUSHACC2 
+    3332 LEINT 
+    3333 BRANCHIF 3317
+    3335 CONST0 
+    3336 POP 2
+    3338 ACC0 
+    3339 RETURN 3
+    3341 CLOSURE 0, 3294
+    3344 PUSH 
+    3345 CLOSURE 0, 3256
+    3348 PUSH 
+    3349 CLOSURE 0, 3206
+    3352 PUSH 
+    3353 CLOSURE 0, 3107
+    3356 PUSH 
+    3357 CLOSURE 0, 3074
+    3360 PUSHACC0 
+    3361 CLOSURE 1, 3020
+    3364 PUSH 
+    3365 CLOSURE 0, 2917
+    3368 PUSH 
+    3369 CLOSURE 0, 2861
+    3372 PUSH 
+    3373 CLOSURE 0, 2749
+    3376 PUSH 
+    3377 CLOSURE 0, 2718
+    3380 PUSH 
+    3381 CLOSURE 0, 2662
+    3384 PUSH 
+    3385 CLOSURE 0, 2630
+    3388 PUSH 
+    3389 CLOSURE 0, 2572
+    3392 PUSH 
+    3393 CLOSURE 0, 2558
+    3396 PUSH 
+    3397 CLOSURE 0, 2505
+    3400 PUSH 
+    3401 CLOSURE 0, 2445
+    3404 PUSH 
+    3405 CLOSURE 0, 2407
+    3408 PUSHACC0 
+    3409 PUSHACC2 
+    3410 PUSHACC6 
+    3411 PUSHACC 8
+    3413 PUSHACC 10
+    3415 PUSHACC 12
+    3417 PUSHACC 8
+    3419 PUSHACC 10
+    3421 PUSHACC 16
+    3423 PUSHACC 18
+    3425 PUSHACC 24
+    3427 PUSHACC 21
+    3429 PUSHACC 23
+    3431 PUSHACC 26
+    3433 PUSHACC 29
+    3435 PUSHACC 30
+    3437 PUSHACC 32
+    3439 MAKEBLOCK 17, 0
+    3442 POP 17
+    3444 SETGLOBAL Array
+    3446 BRANCH 3456
+    3448 ACC0 
+    3449 PUSHENVACC1 
+    3450 GETFIELD0 
+    3451 ADDINT 
+    3452 PUSHENVACC1 
+    3453 SETFIELD0 
+    3454 RETURN 1
+    3456 CONST2 
+    3457 PUSHCONSTINT 200000
+    3459 C_CALL2 make_vect
+    3461 PUSHCONST0 
+    3462 MAKEBLOCK1 0
+    3464 PUSHACC1 
+    3465 PUSHACC1 
+    3466 CLOSURE 1, 3448
+    3469 PUSHGETGLOBALFIELD Array, 11
+    3472 APPLY2 
+    3473 CONSTINT 400000
+    3475 PUSHACC1 
+    3476 GETFIELD0 
+    3477 NEQ 
+    3478 BRANCHIFNOT 3485
+    3480 GETGLOBAL Not_found
+    3482 MAKEBLOCK1 0
+    3484 RAISE 
+    3485 POP 2
+    3487 ATOM0 
+    3488 SETGLOBAL T310-alloc-2
+    3490 STOP 
+**)
diff --git a/test/testinterp/t320-gc-1.ml b/test/testinterp/t320-gc-1.ml
new file mode 100644 (file)
index 0000000..4d5d6d9
--- /dev/null
@@ -0,0 +1,1589 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then []
+  else n :: f (n-1)
+in
+let l = f 300 in
+Gc.minor ();
+if List.fold_left (+) 0 l <> 301 * 150 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2432
+    2406 CONST0 
+    2407 PUSHACC1 
+    2408 LEINT 
+    2409 BRANCHIFNOT 2414
+    2411 CONST0 
+    2412 RETURN 1
+    2414 ACC0 
+    2415 OFFSETINT -1
+    2417 PUSHOFFSETCLOSURE0 
+    2418 APPLY1 
+    2419 PUSHACC1 
+    2420 MAKEBLOCK2 0
+    2422 RETURN 1
+    2424 RESTART 
+    2425 GRAB 1
+    2427 ACC1 
+    2428 PUSHACC1 
+    2429 ADDINT 
+    2430 RETURN 2
+    2432 CLOSUREREC 0, 2406
+    2436 CONSTINT 300
+    2438 PUSHACC1 
+    2439 APPLY1 
+    2440 PUSHCONST0 
+    2441 C_CALL1 gc_minor
+    2443 CONSTINT 150
+    2445 PUSHCONSTINT 301
+    2447 MULINT 
+    2448 PUSHACC1 
+    2449 PUSHCONST0 
+    2450 PUSH 
+    2451 CLOSURE 0, 2425
+    2454 PUSHGETGLOBALFIELD List, 12
+    2457 APPLY3 
+    2458 NEQ 
+    2459 BRANCHIFNOT 2466
+    2461 GETGLOBAL Not_found
+    2463 MAKEBLOCK1 0
+    2465 RAISE 
+    2466 POP 2
+    2468 ATOM0 
+    2469 SETGLOBAL T320-gc-1
+    2471 STOP 
+**)
diff --git a/test/testinterp/t320-gc-2.ml b/test/testinterp/t320-gc-2.ml
new file mode 100644 (file)
index 0000000..f607f65
--- /dev/null
@@ -0,0 +1,1589 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then []
+  else n :: f (n-1)
+in
+let l = f 300 in
+Gc.major ();
+if List.fold_left (+) 0 l <> 301 * 150 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2432
+    2406 CONST0 
+    2407 PUSHACC1 
+    2408 LEINT 
+    2409 BRANCHIFNOT 2414
+    2411 CONST0 
+    2412 RETURN 1
+    2414 ACC0 
+    2415 OFFSETINT -1
+    2417 PUSHOFFSETCLOSURE0 
+    2418 APPLY1 
+    2419 PUSHACC1 
+    2420 MAKEBLOCK2 0
+    2422 RETURN 1
+    2424 RESTART 
+    2425 GRAB 1
+    2427 ACC1 
+    2428 PUSHACC1 
+    2429 ADDINT 
+    2430 RETURN 2
+    2432 CLOSUREREC 0, 2406
+    2436 CONSTINT 300
+    2438 PUSHACC1 
+    2439 APPLY1 
+    2440 PUSHCONST0 
+    2441 C_CALL1 gc_major
+    2443 CONSTINT 150
+    2445 PUSHCONSTINT 301
+    2447 MULINT 
+    2448 PUSHACC1 
+    2449 PUSHCONST0 
+    2450 PUSH 
+    2451 CLOSURE 0, 2425
+    2454 PUSHGETGLOBALFIELD List, 12
+    2457 APPLY3 
+    2458 NEQ 
+    2459 BRANCHIFNOT 2466
+    2461 GETGLOBAL Not_found
+    2463 MAKEBLOCK1 0
+    2465 RAISE 
+    2466 POP 2
+    2468 ATOM0 
+    2469 SETGLOBAL T320-gc-2
+    2471 STOP 
+**)
diff --git a/test/testinterp/t320-gc-3.ml b/test/testinterp/t320-gc-3.ml
new file mode 100644 (file)
index 0000000..7c33d2f
--- /dev/null
@@ -0,0 +1,1589 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then []
+  else n :: f (n-1)
+in
+let l = f 300 in
+Gc.full_major ();
+if List.fold_left (+) 0 l <> 301 * 150 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2432
+    2406 CONST0 
+    2407 PUSHACC1 
+    2408 LEINT 
+    2409 BRANCHIFNOT 2414
+    2411 CONST0 
+    2412 RETURN 1
+    2414 ACC0 
+    2415 OFFSETINT -1
+    2417 PUSHOFFSETCLOSURE0 
+    2418 APPLY1 
+    2419 PUSHACC1 
+    2420 MAKEBLOCK2 0
+    2422 RETURN 1
+    2424 RESTART 
+    2425 GRAB 1
+    2427 ACC1 
+    2428 PUSHACC1 
+    2429 ADDINT 
+    2430 RETURN 2
+    2432 CLOSUREREC 0, 2406
+    2436 CONSTINT 300
+    2438 PUSHACC1 
+    2439 APPLY1 
+    2440 PUSHCONST0 
+    2441 C_CALL1 gc_full_major
+    2443 CONSTINT 150
+    2445 PUSHCONSTINT 301
+    2447 MULINT 
+    2448 PUSHACC1 
+    2449 PUSHCONST0 
+    2450 PUSH 
+    2451 CLOSURE 0, 2425
+    2454 PUSHGETGLOBALFIELD List, 12
+    2457 APPLY3 
+    2458 NEQ 
+    2459 BRANCHIFNOT 2466
+    2461 GETGLOBAL Not_found
+    2463 MAKEBLOCK1 0
+    2465 RAISE 
+    2466 POP 2
+    2468 ATOM0 
+    2469 SETGLOBAL T320-gc-3
+    2471 STOP 
+**)
diff --git a/test/testinterp/t330-compact-1.ml b/test/testinterp/t330-compact-1.ml
new file mode 100644 (file)
index 0000000..efa958f
--- /dev/null
@@ -0,0 +1,15 @@
+open Lib;;
+Gc.compact ();;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 CONST0 
+      10 C_CALL1 gc_compaction
+      12 ATOM0 
+      13 SETGLOBAL T330-compact-1
+      15 STOP 
+**)
diff --git a/test/testinterp/t330-compact-2.ml b/test/testinterp/t330-compact-2.ml
new file mode 100644 (file)
index 0000000..62ab014
--- /dev/null
@@ -0,0 +1,755 @@
+open Lib;;
+Gc.compact ();;
+let _ = Pervasives.do_at_exit();;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 CONST0 
+    1198 C_CALL1 gc_compaction
+    1200 CONST0 
+    1201 PUSHGETGLOBALFIELD Pervasives, 68
+    1204 APPLY1 
+    1205 ATOM0 
+    1206 SETGLOBAL T330-compact-2
+    1208 STOP 
+**)
diff --git a/test/testinterp/t330-compact-3.ml b/test/testinterp/t330-compact-3.ml
new file mode 100644 (file)
index 0000000..f25c64e
--- /dev/null
@@ -0,0 +1,1589 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then []
+  else n :: f (n-1)
+in
+let l = f 300 in
+Gc.compact ();
+if List.fold_left (+) 0 l <> 301 * 150 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2432
+    2406 CONST0 
+    2407 PUSHACC1 
+    2408 LEINT 
+    2409 BRANCHIFNOT 2414
+    2411 CONST0 
+    2412 RETURN 1
+    2414 ACC0 
+    2415 OFFSETINT -1
+    2417 PUSHOFFSETCLOSURE0 
+    2418 APPLY1 
+    2419 PUSHACC1 
+    2420 MAKEBLOCK2 0
+    2422 RETURN 1
+    2424 RESTART 
+    2425 GRAB 1
+    2427 ACC1 
+    2428 PUSHACC1 
+    2429 ADDINT 
+    2430 RETURN 2
+    2432 CLOSUREREC 0, 2406
+    2436 CONSTINT 300
+    2438 PUSHACC1 
+    2439 APPLY1 
+    2440 PUSHCONST0 
+    2441 C_CALL1 gc_compaction
+    2443 CONSTINT 150
+    2445 PUSHCONSTINT 301
+    2447 MULINT 
+    2448 PUSHACC1 
+    2449 PUSHCONST0 
+    2450 PUSH 
+    2451 CLOSURE 0, 2425
+    2454 PUSHGETGLOBALFIELD List, 12
+    2457 APPLY3 
+    2458 NEQ 
+    2459 BRANCHIFNOT 2466
+    2461 GETGLOBAL Not_found
+    2463 MAKEBLOCK1 0
+    2465 RAISE 
+    2466 POP 2
+    2468 ATOM0 
+    2469 SETGLOBAL T330-compact-3
+    2471 STOP 
+**)
diff --git a/test/testinterp/t330-compact-4.ml b/test/testinterp/t330-compact-4.ml
new file mode 100644 (file)
index 0000000..1c190f7
--- /dev/null
@@ -0,0 +1,1589 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then []
+  else n :: f (n-1)
+in
+Gc.compact ();
+let l = f 300 in
+if List.fold_left (+) 0 l <> 301 * 150 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2432
+    2406 CONST0 
+    2407 PUSHACC1 
+    2408 LEINT 
+    2409 BRANCHIFNOT 2414
+    2411 CONST0 
+    2412 RETURN 1
+    2414 ACC0 
+    2415 OFFSETINT -1
+    2417 PUSHOFFSETCLOSURE0 
+    2418 APPLY1 
+    2419 PUSHACC1 
+    2420 MAKEBLOCK2 0
+    2422 RETURN 1
+    2424 RESTART 
+    2425 GRAB 1
+    2427 ACC1 
+    2428 PUSHACC1 
+    2429 ADDINT 
+    2430 RETURN 2
+    2432 CLOSUREREC 0, 2406
+    2436 CONST0 
+    2437 C_CALL1 gc_compaction
+    2439 CONSTINT 300
+    2441 PUSHACC1 
+    2442 APPLY1 
+    2443 PUSHCONSTINT 150
+    2445 PUSHCONSTINT 301
+    2447 MULINT 
+    2448 PUSHACC1 
+    2449 PUSHCONST0 
+    2450 PUSH 
+    2451 CLOSURE 0, 2425
+    2454 PUSHGETGLOBALFIELD List, 12
+    2457 APPLY3 
+    2458 NEQ 
+    2459 BRANCHIFNOT 2466
+    2461 GETGLOBAL Not_found
+    2463 MAKEBLOCK1 0
+    2465 RAISE 
+    2466 POP 2
+    2468 ATOM0 
+    2469 SETGLOBAL T330-compact-4
+    2471 STOP 
+**)
diff --git a/test/testinterp/t340-weak.ml b/test/testinterp/t340-weak.ml
new file mode 100644 (file)
index 0000000..e36dbab
--- /dev/null
@@ -0,0 +1,2551 @@
+open Lib;;
+let x = Array.make 20 "" in
+let w = weak_create 20 in
+for i = 0 to 19 do
+  x.(i) <- String.make 20 's';
+  weak_set w i (Some x.(i));
+done;
+Gc.full_major ();
+for i = 0 to 19 do
+  match weak_get w i with
+  | None -> raise Not_found
+  | _ -> ()
+done;
+for i = 0 to 19 do
+  if i mod 2 = 0 then x.(i) <- ""
+done;
+Gc.full_major ();
+for i = 0 to 19 do
+  match weak_get w i with
+  | None when i mod 2 = 0 -> ()
+  | Some s when i mod 2 = 1 -> if s.[5] <> 's' then raise Not_found
+  | _ -> raise Not_found
+done
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2622
+    2406 CONSTINT 97
+    2408 PUSHACC1 
+    2409 GEINT 
+    2410 BRANCHIFNOT 2418
+    2412 CONSTINT 122
+    2414 PUSHACC1 
+    2415 LEINT 
+    2416 BRANCHIF 2442
+    2418 CONSTINT 224
+    2420 PUSHACC1 
+    2421 GEINT 
+    2422 BRANCHIFNOT 2430
+    2424 CONSTINT 246
+    2426 PUSHACC1 
+    2427 LEINT 
+    2428 BRANCHIF 2442
+    2430 CONSTINT 248
+    2432 PUSHACC1 
+    2433 GEINT 
+    2434 BRANCHIFNOT 2447
+    2436 CONSTINT 254
+    2438 PUSHACC1 
+    2439 LEINT 
+    2440 BRANCHIFNOT 2447
+    2442 ACC0 
+    2443 OFFSETINT -32
+    2445 RETURN 1
+    2447 ACC0 
+    2448 RETURN 1
+    2450 CONSTINT 65
+    2452 PUSHACC1 
+    2453 GEINT 
+    2454 BRANCHIFNOT 2462
+    2456 CONSTINT 90
+    2458 PUSHACC1 
+    2459 LEINT 
+    2460 BRANCHIF 2486
+    2462 CONSTINT 192
+    2464 PUSHACC1 
+    2465 GEINT 
+    2466 BRANCHIFNOT 2474
+    2468 CONSTINT 214
+    2470 PUSHACC1 
+    2471 LEINT 
+    2472 BRANCHIF 2486
+    2474 CONSTINT 216
+    2476 PUSHACC1 
+    2477 GEINT 
+    2478 BRANCHIFNOT 2491
+    2480 CONSTINT 222
+    2482 PUSHACC1 
+    2483 LEINT 
+    2484 BRANCHIFNOT 2491
+    2486 ACC0 
+    2487 OFFSETINT 32
+    2489 RETURN 1
+    2491 ACC0 
+    2492 RETURN 1
+    2494 CONSTINT 39
+    2496 PUSHACC1 
+    2497 LTINT 
+    2498 BRANCHIFNOT 2520
+    2500 CONSTINT 9
+    2502 PUSHACC1 
+    2503 EQ 
+    2504 BRANCHIFNOT 2510
+    2506 GETGLOBAL "\\t"
+    2508 RETURN 1
+    2510 CONSTINT 13
+    2512 PUSHACC1 
+    2513 EQ 
+    2514 BRANCHIFNOT 2540
+    2516 GETGLOBAL "\\n"
+    2518 RETURN 1
+    2520 CONSTINT 39
+    2522 PUSHACC1 
+    2523 EQ 
+    2524 BRANCHIFNOT 2530
+    2526 GETGLOBAL "\\'"
+    2528 RETURN 1
+    2530 CONSTINT 92
+    2532 PUSHACC1 
+    2533 EQ 
+    2534 BRANCHIFNOT 2540
+    2536 GETGLOBAL "\\\\"
+    2538 RETURN 1
+    2540 ACC0 
+    2541 C_CALL1 is_printable
+    2543 BRANCHIFNOT 2555
+    2545 CONST1 
+    2546 C_CALL1 create_string
+    2548 PUSHACC1 
+    2549 PUSHCONST0 
+    2550 PUSHACC2 
+    2551 SETSTRINGCHAR 
+    2552 ACC0 
+    2553 RETURN 2
+    2555 ACC0 
+    2556 PUSHCONSTINT 4
+    2558 C_CALL1 create_string
+    2560 PUSHCONSTINT 92
+    2562 PUSHCONST0 
+    2563 PUSHACC2 
+    2564 SETSTRINGCHAR 
+    2565 CONSTINT 100
+    2567 PUSHACC2 
+    2568 DIVINT 
+    2569 PUSHCONSTINT 48
+    2571 ADDINT 
+    2572 PUSHCONST1 
+    2573 PUSHACC2 
+    2574 SETSTRINGCHAR 
+    2575 CONSTINT 10
+    2577 PUSHCONSTINT 10
+    2579 PUSHACC3 
+    2580 DIVINT 
+    2581 MODINT 
+    2582 PUSHCONSTINT 48
+    2584 ADDINT 
+    2585 PUSHCONST2 
+    2586 PUSHACC2 
+    2587 SETSTRINGCHAR 
+    2588 CONSTINT 10
+    2590 PUSHACC2 
+    2591 MODINT 
+    2592 PUSHCONSTINT 48
+    2594 ADDINT 
+    2595 PUSHCONST3 
+    2596 PUSHACC2 
+    2597 SETSTRINGCHAR 
+    2598 ACC0 
+    2599 RETURN 3
+    2601 CONST0 
+    2602 PUSHACC1 
+    2603 LTINT 
+    2604 BRANCHIF 2612
+    2606 CONSTINT 255
+    2608 PUSHACC1 
+    2609 GTINT 
+    2610 BRANCHIFNOT 2619
+    2612 GETGLOBAL "Char.chr"
+    2614 PUSHGETGLOBALFIELD Pervasives, 2
+    2617 APPTERM1 2
+    2619 ACC0 
+    2620 RETURN 1
+    2622 CLOSURE 0, 2601
+    2625 PUSH 
+    2626 CLOSURE 0, 2494
+    2629 PUSH 
+    2630 CLOSURE 0, 2450
+    2633 PUSH 
+    2634 CLOSURE 0, 2406
+    2637 PUSHACC0 
+    2638 PUSHACC2 
+    2639 PUSHACC4 
+    2640 PUSHACC6 
+    2641 MAKEBLOCK 4, 0
+    2644 POP 4
+    2646 SETGLOBAL Char
+    2648 BRANCH 3540
+    2650 RESTART 
+    2651 GRAB 3
+    2653 ACC1 
+    2654 PUSHACC3 
+    2655 GEINT 
+    2656 BRANCHIFNOT 2663
+    2658 GETGLOBAL Not_found
+    2660 MAKEBLOCK1 0
+    2662 RAISE 
+    2663 ACC3 
+    2664 PUSHACC3 
+    2665 PUSHACC2 
+    2666 GETSTRINGCHAR 
+    2667 EQ 
+    2668 BRANCHIFNOT 2673
+    2670 ACC2 
+    2671 RETURN 4
+    2673 ACC3 
+    2674 PUSHACC3 
+    2675 OFFSETINT 1
+    2677 PUSHACC3 
+    2678 PUSHACC3 
+    2679 PUSHOFFSETCLOSURE0 
+    2680 APPTERM 4, 8
+    2683 RESTART 
+    2684 GRAB 2
+    2686 CONST0 
+    2687 PUSHACC2 
+    2688 LTINT 
+    2689 BRANCHIFNOT 2696
+    2691 GETGLOBAL Not_found
+    2693 MAKEBLOCK1 0
+    2695 RAISE 
+    2696 ACC2 
+    2697 PUSHACC2 
+    2698 PUSHACC2 
+    2699 GETSTRINGCHAR 
+    2700 EQ 
+    2701 BRANCHIFNOT 2706
+    2703 ACC1 
+    2704 RETURN 3
+    2706 ACC2 
+    2707 PUSHACC2 
+    2708 OFFSETINT -1
+    2710 PUSHACC2 
+    2711 PUSHOFFSETCLOSURE0 
+    2712 APPTERM3 6
+    2714 RESTART 
+    2715 GRAB 1
+    2717 ACC1 
+    2718 PUSHCONST0 
+    2719 PUSHACC2 
+    2720 PUSHENVACC1 
+    2721 APPTERM3 5
+    2723 RESTART 
+    2724 GRAB 2
+    2726 CONST0 
+    2727 PUSHACC2 
+    2728 LTINT 
+    2729 BRANCHIF 2738
+    2731 ACC0 
+    2732 C_CALL1 ml_string_length
+    2734 PUSHACC2 
+    2735 GEINT 
+    2736 BRANCHIFNOT 2745
+    2738 GETGLOBAL "String.rcontains_from"
+    2740 PUSHGETGLOBALFIELD Pervasives, 2
+    2743 APPTERM1 4
+    2745 PUSHTRAP 2756
+    2747 ACC6 
+    2748 PUSHACC6 
+    2749 PUSHACC6 
+    2750 PUSHENVACC1 
+    2751 APPLY3 
+    2752 CONST1 
+    2753 POPTRAP 
+    2754 RETURN 3
+    2756 PUSHGETGLOBAL Not_found
+    2758 PUSHACC1 
+    2759 GETFIELD0 
+    2760 EQ 
+    2761 BRANCHIFNOT 2766
+    2763 CONST0 
+    2764 RETURN 4
+    2766 ACC0 
+    2767 RAISE 
+    2768 RESTART 
+    2769 GRAB 2
+    2771 CONST0 
+    2772 PUSHACC2 
+    2773 LTINT 
+    2774 BRANCHIF 2783
+    2776 ACC0 
+    2777 C_CALL1 ml_string_length
+    2779 PUSHACC2 
+    2780 GTINT 
+    2781 BRANCHIFNOT 2790
+    2783 GETGLOBAL "String.contains_from"
+    2785 PUSHGETGLOBALFIELD Pervasives, 2
+    2788 APPTERM1 4
+    2790 PUSHTRAP 2811
+    2792 PUSH_RETADDR 2807
+    2794 ACC 9
+    2796 PUSHACC 9
+    2798 PUSHACC 9
+    2800 C_CALL1 ml_string_length
+    2802 PUSHACC 10
+    2804 PUSHENVACC1 
+    2805 APPLY 4
+    2807 CONST1 
+    2808 POPTRAP 
+    2809 RETURN 3
+    2811 PUSHGETGLOBAL Not_found
+    2813 PUSHACC1 
+    2814 GETFIELD0 
+    2815 EQ 
+    2816 BRANCHIFNOT 2821
+    2818 CONST0 
+    2819 RETURN 4
+    2821 ACC0 
+    2822 RAISE 
+    2823 RESTART 
+    2824 GRAB 2
+    2826 CONST0 
+    2827 PUSHACC2 
+    2828 LTINT 
+    2829 BRANCHIF 2838
+    2831 ACC0 
+    2832 C_CALL1 ml_string_length
+    2834 PUSHACC2 
+    2835 GEINT 
+    2836 BRANCHIFNOT 2845
+    2838 GETGLOBAL "String.rindex_from"
+    2840 PUSHGETGLOBALFIELD Pervasives, 2
+    2843 APPTERM1 4
+    2845 ACC2 
+    2846 PUSHACC2 
+    2847 PUSHACC2 
+    2848 PUSHENVACC1 
+    2849 APPTERM3 6
+    2851 RESTART 
+    2852 GRAB 1
+    2854 ACC1 
+    2855 PUSHACC1 
+    2856 C_CALL1 ml_string_length
+    2858 OFFSETINT -1
+    2860 PUSHACC2 
+    2861 PUSHENVACC1 
+    2862 APPTERM3 5
+    2864 RESTART 
+    2865 GRAB 2
+    2867 CONST0 
+    2868 PUSHACC2 
+    2869 LTINT 
+    2870 BRANCHIF 2879
+    2872 ACC0 
+    2873 C_CALL1 ml_string_length
+    2875 PUSHACC2 
+    2876 GTINT 
+    2877 BRANCHIFNOT 2886
+    2879 GETGLOBAL "String.index_from"
+    2881 PUSHGETGLOBALFIELD Pervasives, 2
+    2884 APPTERM1 4
+    2886 ACC2 
+    2887 PUSHACC2 
+    2888 PUSHACC2 
+    2889 C_CALL1 ml_string_length
+    2891 PUSHACC3 
+    2892 PUSHENVACC1 
+    2893 APPTERM 4, 7
+    2896 RESTART 
+    2897 GRAB 1
+    2899 ACC1 
+    2900 PUSHCONST0 
+    2901 PUSHACC2 
+    2902 C_CALL1 ml_string_length
+    2904 PUSHACC3 
+    2905 PUSHENVACC1 
+    2906 APPTERM 4, 6
+    2909 ACC0 
+    2910 PUSHGETGLOBALFIELD Char, 2
+    2913 PUSHENVACC1 
+    2914 APPTERM2 3
+    2916 ACC0 
+    2917 PUSHGETGLOBALFIELD Char, 3
+    2920 PUSHENVACC1 
+    2921 APPTERM2 3
+    2923 RESTART 
+    2924 GRAB 1
+    2926 CONST0 
+    2927 PUSHACC2 
+    2928 C_CALL1 ml_string_length
+    2930 EQ 
+    2931 BRANCHIFNOT 2936
+    2933 ACC1 
+    2934 RETURN 2
+    2936 ACC1 
+    2937 PUSHENVACC1 
+    2938 APPLY1 
+    2939 PUSHCONST0 
+    2940 PUSHACC3 
+    2941 GETSTRINGCHAR 
+    2942 PUSHACC2 
+    2943 APPLY1 
+    2944 PUSHCONST0 
+    2945 PUSHACC2 
+    2946 SETSTRINGCHAR 
+    2947 ACC0 
+    2948 RETURN 3
+    2950 ACC0 
+    2951 PUSHGETGLOBALFIELD Char, 2
+    2954 PUSHENVACC1 
+    2955 APPTERM2 3
+    2957 ACC0 
+    2958 PUSHGETGLOBALFIELD Char, 3
+    2961 PUSHENVACC1 
+    2962 APPTERM2 3
+    2964 RESTART 
+    2965 GRAB 1
+    2967 ACC1 
+    2968 C_CALL1 ml_string_length
+    2970 PUSHCONST0 
+    2971 PUSHACC1 
+    2972 EQ 
+    2973 BRANCHIFNOT 2978
+    2975 ACC2 
+    2976 RETURN 3
+    2978 ACC0 
+    2979 C_CALL1 create_string
+    2981 PUSHCONST0 
+    2982 PUSHACC2 
+    2983 OFFSETINT -1
+    2985 PUSH 
+    2986 BRANCH 3002
+    2988 CHECK_SIGNALS 
+    2989 ACC1 
+    2990 PUSHACC6 
+    2991 GETSTRINGCHAR 
+    2992 PUSHACC5 
+    2993 APPLY1 
+    2994 PUSHACC2 
+    2995 PUSHACC4 
+    2996 SETSTRINGCHAR 
+    2997 ACC1 
+    2998 OFFSETINT 1
+    3000 ASSIGN 1
+    3002 ACC0 
+    3003 PUSHACC2 
+    3004 LEINT 
+    3005 BRANCHIF 2988
+    3007 CONST0 
+    3008 POP 2
+    3010 ACC0 
+    3011 RETURN 4
+    3013 CONST0 
+    3014 PUSHCONST0 
+    3015 PUSHACC2 
+    3016 C_CALL1 ml_string_length
+    3018 OFFSETINT -1
+    3020 PUSH 
+    3021 BRANCH 3059
+    3023 CHECK_SIGNALS 
+    3024 ACC1 
+    3025 PUSHACC4 
+    3026 GETSTRINGCHAR 
+    3027 PUSHACC0 
+    3028 PUSHGETGLOBAL "\000\"\000\000\004\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
+    3030 C_CALL2 bitvect_test
+    3032 BRANCHIFNOT 3038
+    3034 CONST0 
+    3035 CONST2 
+    3036 BRANCH 3048
+    3038 ACC0 
+    3039 C_CALL1 is_printable
+    3041 BRANCHIFNOT 3046
+    3043 CONST1 
+    3044 BRANCH 3048
+    3046 CONSTINT 4
+    3048 POP 1
+    3050 PUSHACC3 
+    3051 ADDINT 
+    3052 ASSIGN 2
+    3054 ACC1 
+    3055 OFFSETINT 1
+    3057 ASSIGN 1
+    3059 ACC0 
+    3060 PUSHACC2 
+    3061 LEINT 
+    3062 BRANCHIF 3023
+    3064 CONST0 
+    3065 POP 2
+    3067 ACC1 
+    3068 C_CALL1 ml_string_length
+    3070 PUSHACC1 
+    3071 EQ 
+    3072 BRANCHIFNOT 3077
+    3074 ACC1 
+    3075 RETURN 2
+    3077 ACC0 
+    3078 C_CALL1 create_string
+    3080 PUSHCONST0 
+    3081 ASSIGN 1
+    3083 CONST0 
+    3084 PUSHACC3 
+    3085 C_CALL1 ml_string_length
+    3087 OFFSETINT -1
+    3089 PUSH 
+    3090 BRANCH 3245
+    3092 CHECK_SIGNALS 
+    3093 ACC1 
+    3094 PUSHACC5 
+    3095 GETSTRINGCHAR 
+    3096 PUSHACC0 
+    3097 PUSHGETGLOBAL "\000\000\000\000\004\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
+    3099 C_CALL2 bitvect_test
+    3101 BRANCHIFNOT 3120
+    3103 CONST0 
+    3104 CONSTINT 92
+    3106 PUSHACC5 
+    3107 PUSHACC5 
+    3108 SETSTRINGCHAR 
+    3109 ACC4 
+    3110 OFFSETINT 1
+    3112 ASSIGN 4
+    3114 ACC0 
+    3115 PUSHACC5 
+    3116 PUSHACC5 
+    3117 SETSTRINGCHAR 
+    3118 BRANCH 3233
+    3120 CONSTINT 9
+    3122 PUSHACC1 
+    3123 EQ 
+    3124 BRANCHIFNOT 3143
+    3126 CONSTINT 92
+    3128 PUSHACC5 
+    3129 PUSHACC5 
+    3130 SETSTRINGCHAR 
+    3131 ACC4 
+    3132 OFFSETINT 1
+    3134 ASSIGN 4
+    3136 CONSTINT 116
+    3138 PUSHACC5 
+    3139 PUSHACC5 
+    3140 SETSTRINGCHAR 
+    3141 BRANCH 3233
+    3143 CONSTINT 13
+    3145 PUSHACC1 
+    3146 EQ 
+    3147 BRANCHIFNOT 3166
+    3149 CONSTINT 92
+    3151 PUSHACC5 
+    3152 PUSHACC5 
+    3153 SETSTRINGCHAR 
+    3154 ACC4 
+    3155 OFFSETINT 1
+    3157 ASSIGN 4
+    3159 CONSTINT 110
+    3161 PUSHACC5 
+    3162 PUSHACC5 
+    3163 SETSTRINGCHAR 
+    3164 BRANCH 3233
+    3166 ACC0 
+    3167 C_CALL1 is_printable
+    3169 BRANCHIFNOT 3177
+    3171 ACC0 
+    3172 PUSHACC5 
+    3173 PUSHACC5 
+    3174 SETSTRINGCHAR 
+    3175 BRANCH 3233
+    3177 ACC0 
+    3178 PUSHCONSTINT 92
+    3180 PUSHACC6 
+    3181 PUSHACC6 
+    3182 SETSTRINGCHAR 
+    3183 ACC5 
+    3184 OFFSETINT 1
+    3186 ASSIGN 5
+    3188 CONSTINT 100
+    3190 PUSHACC1 
+    3191 DIVINT 
+    3192 PUSHCONSTINT 48
+    3194 ADDINT 
+    3195 PUSHACC6 
+    3196 PUSHACC6 
+    3197 SETSTRINGCHAR 
+    3198 ACC5 
+    3199 OFFSETINT 1
+    3201 ASSIGN 5
+    3203 CONSTINT 10
+    3205 PUSHCONSTINT 10
+    3207 PUSHACC2 
+    3208 DIVINT 
+    3209 MODINT 
+    3210 PUSHCONSTINT 48
+    3212 ADDINT 
+    3213 PUSHACC6 
+    3214 PUSHACC6 
+    3215 SETSTRINGCHAR 
+    3216 ACC5 
+    3217 OFFSETINT 1
+    3219 ASSIGN 5
+    3221 CONSTINT 10
+    3223 PUSHACC1 
+    3224 MODINT 
+    3225 PUSHCONSTINT 48
+    3227 ADDINT 
+    3228 PUSHACC6 
+    3229 PUSHACC6 
+    3230 SETSTRINGCHAR 
+    3231 POP 1
+    3233 POP 1
+    3235 ACC3 
+    3236 OFFSETINT 1
+    3238 ASSIGN 3
+    3240 ACC1 
+    3241 OFFSETINT 1
+    3243 ASSIGN 1
+    3245 ACC0 
+    3246 PUSHACC2 
+    3247 LEINT 
+    3248 BRANCHIF 3092
+    3250 CONST0 
+    3251 POP 2
+    3253 ACC0 
+    3254 RETURN 3
+    3256 ENVACC1 
+    3257 C_CALL1 ml_string_length
+    3259 PUSHENVACC3 
+    3260 GETFIELD0 
+    3261 PUSHENVACC2 
+    3262 PUSHCONST0 
+    3263 PUSHENVACC1 
+    3264 C_CALL5 blit_string
+    3266 ENVACC1 
+    3267 C_CALL1 ml_string_length
+    3269 PUSHENVACC3 
+    3270 GETFIELD0 
+    3271 ADDINT 
+    3272 PUSHENVACC3 
+    3273 SETFIELD0 
+    3274 ACC0 
+    3275 C_CALL1 ml_string_length
+    3277 PUSHENVACC3 
+    3278 GETFIELD0 
+    3279 PUSHENVACC2 
+    3280 PUSHCONST0 
+    3281 PUSHACC4 
+    3282 C_CALL5 blit_string
+    3284 ACC0 
+    3285 C_CALL1 ml_string_length
+    3287 PUSHENVACC3 
+    3288 GETFIELD0 
+    3289 ADDINT 
+    3290 PUSHENVACC3 
+    3291 SETFIELD0 
+    3292 RETURN 1
+    3294 ENVACC1 
+    3295 OFFSETREF 1
+    3297 ACC0 
+    3298 C_CALL1 ml_string_length
+    3300 PUSHENVACC2 
+    3301 GETFIELD0 
+    3302 ADDINT 
+    3303 PUSHENVACC2 
+    3304 SETFIELD0 
+    3305 RETURN 1
+    3307 RESTART 
+    3308 GRAB 1
+    3310 ACC1 
+    3311 BRANCHIFNOT 3374
+    3313 ACC1 
+    3314 GETFIELD0 
+    3315 PUSHCONST0 
+    3316 MAKEBLOCK1 0
+    3318 PUSHCONST0 
+    3319 MAKEBLOCK1 0
+    3321 PUSHACC4 
+    3322 PUSHACC1 
+    3323 PUSHACC3 
+    3324 CLOSURE 2, 3294
+    3327 PUSHGETGLOBALFIELD List, 9
+    3330 APPLY2 
+    3331 ACC1 
+    3332 GETFIELD0 
+    3333 OFFSETINT -1
+    3335 PUSHACC4 
+    3336 C_CALL1 ml_string_length
+    3338 MULINT 
+    3339 PUSHACC1 
+    3340 GETFIELD0 
+    3341 ADDINT 
+    3342 C_CALL1 create_string
+    3344 PUSHACC3 
+    3345 C_CALL1 ml_string_length
+    3347 PUSHCONST0 
+    3348 PUSHACC2 
+    3349 PUSHCONST0 
+    3350 PUSHACC7 
+    3351 C_CALL5 blit_string
+    3353 ACC3 
+    3354 C_CALL1 ml_string_length
+    3356 MAKEBLOCK1 0
+    3358 PUSHACC6 
+    3359 GETFIELD1 
+    3360 PUSHACC1 
+    3361 PUSHACC3 
+    3362 PUSHACC 8
+    3364 CLOSURE 3, 3256
+    3367 PUSHGETGLOBALFIELD List, 9
+    3370 APPLY2 
+    3371 ACC1 
+    3372 RETURN 7
+    3374 GETGLOBAL ""
+    3376 RETURN 2
+    3378 RESTART 
+    3379 GRAB 4
+    3381 CONST0 
+    3382 PUSHACC5 
+    3383 LTINT 
+    3384 BRANCHIF 3414
+    3386 CONST0 
+    3387 PUSHACC2 
+    3388 LTINT 
+    3389 BRANCHIF 3414
+    3391 ACC0 
+    3392 C_CALL1 ml_string_length
+    3394 PUSHACC5 
+    3395 PUSHACC3 
+    3396 ADDINT 
+    3397 GTINT 
+    3398 BRANCHIF 3414
+    3400 CONST0 
+    3401 PUSHACC4 
+    3402 LTINT 
+    3403 BRANCHIF 3414
+    3405 ACC2 
+    3406 C_CALL1 ml_string_length
+    3408 PUSHACC5 
+    3409 PUSHACC5 
+    3410 ADDINT 
+    3411 GTINT 
+    3412 BRANCHIFNOT 3421
+    3414 GETGLOBAL "String.blit"
+    3416 PUSHGETGLOBALFIELD Pervasives, 2
+    3419 APPTERM1 6
+    3421 ACC4 
+    3422 PUSHACC4 
+    3423 PUSHACC4 
+    3424 PUSHACC4 
+    3425 PUSHACC4 
+    3426 C_CALL5 blit_string
+    3428 RETURN 5
+    3430 RESTART 
+    3431 GRAB 3
+    3433 CONST0 
+    3434 PUSHACC2 
+    3435 LTINT 
+    3436 BRANCHIF 3452
+    3438 CONST0 
+    3439 PUSHACC3 
+    3440 LTINT 
+    3441 BRANCHIF 3452
+    3443 ACC0 
+    3444 C_CALL1 ml_string_length
+    3446 PUSHACC3 
+    3447 PUSHACC3 
+    3448 ADDINT 
+    3449 GTINT 
+    3450 BRANCHIFNOT 3459
+    3452 GETGLOBAL "String.fill"
+    3454 PUSHGETGLOBALFIELD Pervasives, 2
+    3457 APPTERM1 5
+    3459 ACC3 
+    3460 PUSHACC3 
+    3461 PUSHACC3 
+    3462 PUSHACC3 
+    3463 C_CALL4 fill_string
+    3465 RETURN 4
+    3467 RESTART 
+    3468 GRAB 2
+    3470 CONST0 
+    3471 PUSHACC2 
+    3472 LTINT 
+    3473 BRANCHIF 3489
+    3475 CONST0 
+    3476 PUSHACC3 
+    3477 LTINT 
+    3478 BRANCHIF 3489
+    3480 ACC0 
+    3481 C_CALL1 ml_string_length
+    3483 PUSHACC3 
+    3484 PUSHACC3 
+    3485 ADDINT 
+    3486 GTINT 
+    3487 BRANCHIFNOT 3496
+    3489 GETGLOBAL "String.sub"
+    3491 PUSHGETGLOBALFIELD Pervasives, 2
+    3494 APPTERM1 4
+    3496 ACC2 
+    3497 C_CALL1 create_string
+    3499 PUSHACC3 
+    3500 PUSHCONST0 
+    3501 PUSHACC2 
+    3502 PUSHACC5 
+    3503 PUSHACC5 
+    3504 C_CALL5 blit_string
+    3506 ACC0 
+    3507 RETURN 4
+    3509 ACC0 
+    3510 C_CALL1 ml_string_length
+    3512 PUSHACC0 
+    3513 C_CALL1 create_string
+    3515 PUSHACC1 
+    3516 PUSHCONST0 
+    3517 PUSHACC2 
+    3518 PUSHCONST0 
+    3519 PUSHACC6 
+    3520 C_CALL5 blit_string
+    3522 ACC0 
+    3523 RETURN 3
+    3525 RESTART 
+    3526 GRAB 1
+    3528 ACC0 
+    3529 C_CALL1 create_string
+    3531 PUSHACC2 
+    3532 PUSHACC2 
+    3533 PUSHCONST0 
+    3534 PUSHACC3 
+    3535 C_CALL4 fill_string
+    3537 ACC0 
+    3538 RETURN 3
+    3540 CLOSURE 0, 3526
+    3543 PUSH 
+    3544 CLOSURE 0, 3509
+    3547 PUSH 
+    3548 CLOSURE 0, 3468
+    3551 PUSH 
+    3552 CLOSURE 0, 3431
+    3555 PUSH 
+    3556 CLOSURE 0, 3379
+    3559 PUSH 
+    3560 CLOSURE 0, 3308
+    3563 PUSH 
+    3564 CLOSURE 0, 3013
+    3567 PUSH 
+    3568 CLOSURE 0, 2965
+    3571 PUSHACC0 
+    3572 CLOSURE 1, 2957
+    3575 PUSHACC1 
+    3576 CLOSURE 1, 2950
+    3579 PUSHACC 8
+    3581 CLOSURE 1, 2924
+    3584 PUSHACC0 
+    3585 CLOSURE 1, 2916
+    3588 PUSHACC1 
+    3589 CLOSURE 1, 2909
+    3592 PUSH 
+    3593 CLOSUREREC 0, 2651
+    3597 ACC0 
+    3598 CLOSURE 1, 2897
+    3601 PUSHACC1 
+    3602 CLOSURE 1, 2865
+    3605 PUSH 
+    3606 CLOSUREREC 0, 2684
+    3610 ACC0 
+    3611 CLOSURE 1, 2852
+    3614 PUSHACC1 
+    3615 CLOSURE 1, 2824
+    3618 PUSHACC5 
+    3619 CLOSURE 1, 2769
+    3622 PUSHACC3 
+    3623 CLOSURE 1, 2724
+    3626 PUSHACC1 
+    3627 CLOSURE 1, 2715
+    3630 PUSHACC 9
+    3632 PUSHACC 11
+    3634 PUSHACC 14
+    3636 PUSHACC 16
+    3638 PUSHACC5 
+    3639 PUSHACC7 
+    3640 PUSHACC6 
+    3641 PUSHACC 10
+    3643 PUSHACC 14
+    3645 PUSHACC 13
+    3647 PUSHACC 17
+    3649 PUSHACC 26
+    3651 PUSHACC 28
+    3653 PUSHACC 30
+    3655 PUSHACC 32
+    3657 PUSHACC 34
+    3659 PUSHACC 36
+    3661 PUSHACC 38
+    3663 MAKEBLOCK 18, 0
+    3666 POP 22
+    3668 SETGLOBAL String
+    3670 GETGLOBAL ""
+    3672 PUSHCONSTINT 20
+    3674 C_CALL2 make_vect
+    3676 PUSHCONSTINT 20
+    3678 C_CALL1 weak_create
+    3680 PUSHCONST0 
+    3681 PUSHCONSTINT 19
+    3683 PUSH 
+    3684 BRANCH 3712
+    3686 CHECK_SIGNALS 
+    3687 CONSTINT 115
+    3689 PUSHCONSTINT 20
+    3691 PUSHGETGLOBALFIELD String, 0
+    3694 APPLY2 
+    3695 PUSHACC2 
+    3696 PUSHACC5 
+    3697 SETVECTITEM 
+    3698 ACC1 
+    3699 PUSHACC4 
+    3700 GETVECTITEM 
+    3701 MAKEBLOCK1 0
+    3703 PUSHACC2 
+    3704 PUSHACC4 
+    3705 C_CALL3 weak_set
+    3707 ACC1 
+    3708 OFFSETINT 1
+    3710 ASSIGN 1
+    3712 ACC0 
+    3713 PUSHACC2 
+    3714 LEINT 
+    3715 BRANCHIF 3686
+    3717 CONST0 
+    3718 POP 2
+    3720 CONST0 
+    3721 C_CALL1 gc_full_major
+    3723 CONST0 
+    3724 PUSHCONSTINT 19
+    3726 PUSH 
+    3727 BRANCH 3750
+    3729 CHECK_SIGNALS 
+    3730 ACC1 
+    3731 PUSHACC3 
+    3732 C_CALL2 weak_get
+    3734 PUSHACC0 
+    3735 BRANCHIF 3742
+    3737 GETGLOBAL Not_found
+    3739 MAKEBLOCK1 0
+    3741 RAISE 
+    3742 CONST0 
+    3743 POP 1
+    3745 ACC1 
+    3746 OFFSETINT 1
+    3748 ASSIGN 1
+    3750 ACC0 
+    3751 PUSHACC2 
+    3752 LEINT 
+    3753 BRANCHIF 3729
+    3755 CONST0 
+    3756 POP 2
+    3758 CONST0 
+    3759 PUSHCONSTINT 19
+    3761 PUSH 
+    3762 BRANCH 3782
+    3764 CHECK_SIGNALS 
+    3765 CONST0 
+    3766 PUSHCONST2 
+    3767 PUSHACC3 
+    3768 MODINT 
+    3769 EQ 
+    3770 BRANCHIFNOT 3777
+    3772 GETGLOBAL ""
+    3774 PUSHACC2 
+    3775 PUSHACC5 
+    3776 SETVECTITEM 
+    3777 ACC1 
+    3778 OFFSETINT 1
+    3780 ASSIGN 1
+    3782 ACC0 
+    3783 PUSHACC2 
+    3784 LEINT 
+    3785 BRANCHIF 3764
+    3787 CONST0 
+    3788 POP 2
+    3790 CONST0 
+    3791 C_CALL1 gc_full_major
+    3793 CONST0 
+    3794 PUSHCONSTINT 19
+    3796 PUSH 
+    3797 BRANCH 3851
+    3799 CHECK_SIGNALS 
+    3800 ACC1 
+    3801 PUSHACC3 
+    3802 C_CALL2 weak_get
+    3804 PUSHACC0 
+    3805 BRANCHIFNOT 3829
+    3807 CONST1 
+    3808 PUSHCONST2 
+    3809 PUSHACC4 
+    3810 MODINT 
+    3811 EQ 
+    3812 BRANCHIFNOT 3839
+    3814 CONSTINT 115
+    3816 PUSHCONSTINT 5
+    3818 PUSHACC2 
+    3819 GETFIELD0 
+    3820 GETSTRINGCHAR 
+    3821 NEQ 
+    3822 BRANCHIFNOT 3844
+    3824 GETGLOBAL Not_found
+    3826 MAKEBLOCK1 0
+    3828 RAISE 
+    3829 CONST0 
+    3830 PUSHCONST2 
+    3831 PUSHACC4 
+    3832 MODINT 
+    3833 EQ 
+    3834 BRANCHIFNOT 3839
+    3836 CONST0 
+    3837 BRANCH 3844
+    3839 GETGLOBAL Not_found
+    3841 MAKEBLOCK1 0
+    3843 RAISE 
+    3844 POP 1
+    3846 ACC1 
+    3847 OFFSETINT 1
+    3849 ASSIGN 1
+    3851 ACC0 
+    3852 PUSHACC2 
+    3853 LEINT 
+    3854 BRANCHIF 3799
+    3856 CONST0 
+    3857 POP 4
+    3859 ATOM0 
+    3860 SETGLOBAL T340-weak
+    3862 STOP 
+**)
diff --git a/test/testinterp/t350-heapcheck.ml b/test/testinterp/t350-heapcheck.ml
new file mode 100644 (file)
index 0000000..ef4557c
--- /dev/null
@@ -0,0 +1,2554 @@
+open Lib;;
+ignore (Gc.stat ());
+let x = Array.make 20 "" in
+let w = weak_create 20 in
+for i = 0 to 19 do
+  x.(i) <- String.make 20 's';
+  weak_set w i (Some x.(i));
+done;
+Gc.full_major ();
+for i = 0 to 19 do
+  match weak_get w i with
+  | None -> raise Not_found
+  | _ -> ()
+done;
+for i = 0 to 19 do
+  if i mod 2 = 0 then x.(i) <- ""
+done;
+Gc.full_major ();
+for i = 0 to 19 do
+  match weak_get w i with
+  | None when i mod 2 = 0 -> ()
+  | Some s when i mod 2 = 1 -> if s.[5] <> 's' then raise Not_found
+  | _ -> raise Not_found
+done
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 746
+      11 RESTART 
+      12 GRAB 1
+      14 ACC0 
+      15 BRANCHIFNOT 28
+      17 ACC1 
+      18 PUSHACC1 
+      19 GETFIELD1 
+      20 PUSHOFFSETCLOSURE0 
+      21 APPLY2 
+      22 PUSHACC1 
+      23 GETFIELD0 
+      24 MAKEBLOCK2 0
+      26 RETURN 2
+      28 ACC1 
+      29 RETURN 2
+      31 RESTART 
+      32 GRAB 3
+      34 CONST0 
+      35 PUSHACC4 
+      36 LEINT 
+      37 BRANCHIFNOT 42
+      39 CONST0 
+      40 RETURN 4
+      42 ACC3 
+      43 PUSHACC3 
+      44 PUSHACC3 
+      45 PUSHACC3 
+      46 C_CALL4 caml_input
+      48 PUSHCONST0 
+      49 PUSHACC1 
+      50 EQ 
+      51 BRANCHIFNOT 58
+      53 GETGLOBAL End_of_file
+      55 MAKEBLOCK1 0
+      57 RAISE 
+      58 ACC0 
+      59 PUSHACC5 
+      60 SUBINT 
+      61 PUSHACC1 
+      62 PUSHACC5 
+      63 ADDINT 
+      64 PUSHACC4 
+      65 PUSHACC4 
+      66 PUSHOFFSETCLOSURE0 
+      67 APPTERM 4, 9
+      70 ACC0 
+      71 C_CALL1 caml_input_scan_line
+      73 PUSHCONST0 
+      74 PUSHACC1 
+      75 EQ 
+      76 BRANCHIFNOT 83
+      78 GETGLOBAL End_of_file
+      80 MAKEBLOCK1 0
+      82 RAISE 
+      83 CONST0 
+      84 PUSHACC1 
+      85 GTINT 
+      86 BRANCHIFNOT 107
+      88 ACC0 
+      89 OFFSETINT -1
+      91 C_CALL1 create_string
+      93 PUSHACC1 
+      94 OFFSETINT -1
+      96 PUSHCONST0 
+      97 PUSHACC2 
+      98 PUSHACC5 
+      99 C_CALL4 caml_input
+     101 ACC2 
+     102 C_CALL1 caml_input_char
+     104 ACC0 
+     105 RETURN 3
+     107 ACC0 
+     108 NEGINT 
+     109 C_CALL1 create_string
+     111 PUSHACC1 
+     112 NEGINT 
+     113 PUSHCONST0 
+     114 PUSHACC2 
+     115 PUSHACC5 
+     116 C_CALL4 caml_input
+     118 CONST0 
+     119 PUSHTRAP 130
+     121 ACC6 
+     122 PUSHOFFSETCLOSURE0 
+     123 APPLY1 
+     124 PUSHACC5 
+     125 PUSHENVACC1 
+     126 APPLY2 
+     127 POPTRAP 
+     128 RETURN 3
+     130 PUSHGETGLOBAL End_of_file
+     132 PUSHACC1 
+     133 GETFIELD0 
+     134 EQ 
+     135 BRANCHIFNOT 140
+     137 ACC1 
+     138 RETURN 4
+     140 ACC0 
+     141 RAISE 
+     142 ACC0 
+     143 C_CALL1 caml_flush
+     145 RETURN 1
+     147 RESTART 
+     148 GRAB 1
+     150 ACC1 
+     151 PUSHACC1 
+     152 C_CALL2 caml_output_char
+     154 RETURN 2
+     156 RESTART 
+     157 GRAB 1
+     159 ACC1 
+     160 PUSHACC1 
+     161 C_CALL2 caml_output_char
+     163 RETURN 2
+     165 RESTART 
+     166 GRAB 1
+     168 ACC1 
+     169 PUSHACC1 
+     170 C_CALL2 caml_output_int
+     172 RETURN 2
+     174 RESTART 
+     175 GRAB 1
+     177 ACC1 
+     178 PUSHACC1 
+     179 C_CALL2 caml_seek_out
+     181 RETURN 2
+     183 ACC0 
+     184 C_CALL1 caml_pos_out
+     186 RETURN 1
+     188 ACC0 
+     189 C_CALL1 caml_channel_size
+     191 RETURN 1
+     193 RESTART 
+     194 GRAB 1
+     196 ACC1 
+     197 PUSHACC1 
+     198 C_CALL2 caml_set_binary_mode
+     200 RETURN 2
+     202 ACC0 
+     203 C_CALL1 caml_input_char
+     205 RETURN 1
+     207 ACC0 
+     208 C_CALL1 caml_input_char
+     210 RETURN 1
+     212 ACC0 
+     213 C_CALL1 caml_input_int
+     215 RETURN 1
+     217 ACC0 
+     218 C_CALL1 input_value
+     220 RETURN 1
+     222 RESTART 
+     223 GRAB 1
+     225 ACC1 
+     226 PUSHACC1 
+     227 C_CALL2 caml_seek_in
+     229 RETURN 2
+     231 ACC0 
+     232 C_CALL1 caml_pos_in
+     234 RETURN 1
+     236 ACC0 
+     237 C_CALL1 caml_channel_size
+     239 RETURN 1
+     241 ACC0 
+     242 C_CALL1 caml_close_channel
+     244 RETURN 1
+     246 RESTART 
+     247 GRAB 1
+     249 ACC1 
+     250 PUSHACC1 
+     251 C_CALL2 caml_set_binary_mode
+     253 RETURN 2
+     255 CONST0 
+     256 PUSHENVACC1 
+     257 APPLY1 
+     258 ACC0 
+     259 C_CALL1 sys_exit
+     261 RETURN 1
+     263 CONST0 
+     264 PUSHENVACC1 
+     265 GETFIELD0 
+     266 APPTERM1 2
+     268 CONST0 
+     269 PUSHENVACC1 
+     270 APPLY1 
+     271 CONST0 
+     272 PUSHENVACC2 
+     273 APPTERM1 2
+     275 ENVACC1 
+     276 GETFIELD0 
+     277 PUSHACC0 
+     278 PUSHACC2 
+     279 CLOSURE 2, 268
+     282 PUSHENVACC1 
+     283 SETFIELD0 
+     284 RETURN 2
+     286 ENVACC1 
+     287 C_CALL1 caml_flush
+     289 ENVACC2 
+     290 C_CALL1 caml_flush
+     292 RETURN 1
+     294 CONST0 
+     295 PUSHENVACC1 
+     296 APPLY1 
+     297 C_CALL1 float_of_string
+     299 RETURN 1
+     301 CONST0 
+     302 PUSHENVACC1 
+     303 APPLY1 
+     304 C_CALL1 int_of_string
+     306 RETURN 1
+     308 ENVACC2 
+     309 C_CALL1 caml_flush
+     311 ENVACC1 
+     312 PUSHENVACC3 
+     313 APPTERM1 2
+     315 CONSTINT 13
+     317 PUSHENVACC1 
+     318 C_CALL2 caml_output_char
+     320 ENVACC1 
+     321 C_CALL1 caml_flush
+     323 RETURN 1
+     325 ACC0 
+     326 PUSHENVACC1 
+     327 PUSHENVACC2 
+     328 APPLY2 
+     329 CONSTINT 13
+     331 PUSHENVACC1 
+     332 C_CALL2 caml_output_char
+     334 ENVACC1 
+     335 C_CALL1 caml_flush
+     337 RETURN 1
+     339 ACC0 
+     340 PUSHENVACC1 
+     341 APPLY1 
+     342 PUSHENVACC2 
+     343 PUSHENVACC3 
+     344 APPTERM2 3
+     346 ACC0 
+     347 PUSHENVACC1 
+     348 APPLY1 
+     349 PUSHENVACC2 
+     350 PUSHENVACC3 
+     351 APPTERM2 3
+     353 ACC0 
+     354 PUSHENVACC1 
+     355 PUSHENVACC2 
+     356 APPTERM2 3
+     358 ACC0 
+     359 PUSHENVACC1 
+     360 C_CALL2 caml_output_char
+     362 RETURN 1
+     364 CONSTINT 13
+     366 PUSHENVACC1 
+     367 C_CALL2 caml_output_char
+     369 ENVACC1 
+     370 C_CALL1 caml_flush
+     372 RETURN 1
+     374 ACC0 
+     375 PUSHENVACC1 
+     376 PUSHENVACC2 
+     377 APPLY2 
+     378 CONSTINT 13
+     380 PUSHENVACC1 
+     381 C_CALL2 caml_output_char
+     383 RETURN 1
+     385 ACC0 
+     386 PUSHENVACC1 
+     387 APPLY1 
+     388 PUSHENVACC2 
+     389 PUSHENVACC3 
+     390 APPTERM2 3
+     392 ACC0 
+     393 PUSHENVACC1 
+     394 APPLY1 
+     395 PUSHENVACC2 
+     396 PUSHENVACC3 
+     397 APPTERM2 3
+     399 ACC0 
+     400 PUSHENVACC1 
+     401 PUSHENVACC2 
+     402 APPTERM2 3
+     404 ACC0 
+     405 PUSHENVACC1 
+     406 C_CALL2 caml_output_char
+     408 RETURN 1
+     410 RESTART 
+     411 GRAB 3
+     413 CONST0 
+     414 PUSHACC3 
+     415 LTINT 
+     416 BRANCHIF 427
+     418 ACC1 
+     419 C_CALL1 ml_string_length
+     421 PUSHACC4 
+     422 PUSHACC4 
+     423 ADDINT 
+     424 GTINT 
+     425 BRANCHIFNOT 432
+     427 GETGLOBAL "really_input"
+     429 PUSHENVACC1 
+     430 APPTERM1 5
+     432 ACC3 
+     433 PUSHACC3 
+     434 PUSHACC3 
+     435 PUSHACC3 
+     436 PUSHENVACC2 
+     437 APPTERM 4, 8
+     440 RESTART 
+     441 GRAB 3
+     443 CONST0 
+     444 PUSHACC3 
+     445 LTINT 
+     446 BRANCHIF 457
+     448 ACC1 
+     449 C_CALL1 ml_string_length
+     451 PUSHACC4 
+     452 PUSHACC4 
+     453 ADDINT 
+     454 GTINT 
+     455 BRANCHIFNOT 462
+     457 GETGLOBAL "input"
+     459 PUSHENVACC1 
+     460 APPTERM1 5
+     462 ACC3 
+     463 PUSHACC3 
+     464 PUSHACC3 
+     465 PUSHACC3 
+     466 C_CALL4 caml_input
+     468 RETURN 4
+     470 ACC0 
+     471 PUSHCONST0 
+     472 PUSHGETGLOBAL <0>(0, <0>(6, 0))
+     474 PUSHENVACC1 
+     475 APPTERM3 4
+     477 ACC0 
+     478 PUSHCONST0 
+     479 PUSHGETGLOBAL <0>(0, <0>(7, 0))
+     481 PUSHENVACC1 
+     482 APPTERM3 4
+     484 RESTART 
+     485 GRAB 2
+     487 ACC1 
+     488 PUSHACC1 
+     489 PUSHACC4 
+     490 C_CALL3 sys_open
+     492 C_CALL1 caml_open_descriptor
+     494 RETURN 3
+     496 ACC0 
+     497 C_CALL1 caml_flush
+     499 ACC0 
+     500 C_CALL1 caml_close_channel
+     502 RETURN 1
+     504 RESTART 
+     505 GRAB 1
+     507 CONST0 
+     508 PUSHACC2 
+     509 PUSHACC2 
+     510 C_CALL3 output_value
+     512 RETURN 2
+     514 RESTART 
+     515 GRAB 3
+     517 CONST0 
+     518 PUSHACC3 
+     519 LTINT 
+     520 BRANCHIF 531
+     522 ACC1 
+     523 C_CALL1 ml_string_length
+     525 PUSHACC4 
+     526 PUSHACC4 
+     527 ADDINT 
+     528 GTINT 
+     529 BRANCHIFNOT 536
+     531 GETGLOBAL "output"
+     533 PUSHENVACC1 
+     534 APPTERM1 5
+     536 ACC3 
+     537 PUSHACC3 
+     538 PUSHACC3 
+     539 PUSHACC3 
+     540 C_CALL4 caml_output
+     542 RETURN 4
+     544 RESTART 
+     545 GRAB 1
+     547 ACC1 
+     548 C_CALL1 ml_string_length
+     550 PUSHCONST0 
+     551 PUSHACC3 
+     552 PUSHACC3 
+     553 C_CALL4 caml_output
+     555 RETURN 2
+     557 ACC0 
+     558 PUSHCONSTINT 438
+     560 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(6, 0))))
+     562 PUSHENVACC1 
+     563 APPTERM3 4
+     565 ACC0 
+     566 PUSHCONSTINT 438
+     568 PUSHGETGLOBAL <0>(1, <0>(3, <0>(4, <0>(7, 0))))
+     570 PUSHENVACC1 
+     571 APPTERM3 4
+     573 RESTART 
+     574 GRAB 2
+     576 ACC1 
+     577 PUSHACC1 
+     578 PUSHACC4 
+     579 C_CALL3 sys_open
+     581 C_CALL1 caml_open_descriptor
+     583 RETURN 3
+     585 ACC0 
+     586 PUSHGETGLOBAL "%.12g"
+     588 C_CALL2 format_float
+     590 RETURN 1
+     592 ACC0 
+     593 PUSHGETGLOBAL "%d"
+     595 C_CALL2 format_int
+     597 RETURN 1
+     599 GETGLOBAL "false"
+     601 PUSHACC1 
+     602 C_CALL2 string_equal
+     604 BRANCHIFNOT 609
+     606 CONST0 
+     607 RETURN 1
+     609 GETGLOBAL "true"
+     611 PUSHACC1 
+     612 C_CALL2 string_equal
+     614 BRANCHIFNOT 619
+     616 CONST1 
+     617 RETURN 1
+     619 GETGLOBAL "bool_of_string"
+     621 PUSHENVACC1 
+     622 APPTERM1 2
+     624 ACC0 
+     625 BRANCHIFNOT 631
+     627 GETGLOBAL "true"
+     629 RETURN 1
+     631 GETGLOBAL "false"
+     633 RETURN 1
+     635 CONST0 
+     636 PUSHACC1 
+     637 LTINT 
+     638 BRANCHIF 646
+     640 CONSTINT 255
+     642 PUSHACC1 
+     643 GTINT 
+     644 BRANCHIFNOT 651
+     646 GETGLOBAL "char_of_int"
+     648 PUSHENVACC1 
+     649 APPTERM1 2
+     651 ACC0 
+     652 RETURN 1
+     654 RESTART 
+     655 GRAB 1
+     657 ACC0 
+     658 C_CALL1 ml_string_length
+     660 PUSHACC2 
+     661 C_CALL1 ml_string_length
+     663 PUSHACC0 
+     664 PUSHACC2 
+     665 ADDINT 
+     666 C_CALL1 create_string
+     668 PUSHACC2 
+     669 PUSHCONST0 
+     670 PUSHACC2 
+     671 PUSHCONST0 
+     672 PUSHACC7 
+     673 C_CALL5 blit_string
+     675 ACC1 
+     676 PUSHACC3 
+     677 PUSHACC2 
+     678 PUSHCONST0 
+     679 PUSHACC 8
+     681 C_CALL5 blit_string
+     683 ACC0 
+     684 RETURN 5
+     686 CONSTINT -1
+     688 PUSHACC1 
+     689 XORINT 
+     690 RETURN 1
+     692 CONST0 
+     693 PUSHACC1 
+     694 GEINT 
+     695 BRANCHIFNOT 700
+     697 ACC0 
+     698 RETURN 1
+     700 ACC0 
+     701 NEGINT 
+     702 RETURN 1
+     704 RESTART 
+     705 GRAB 1
+     707 ACC1 
+     708 PUSHACC1 
+     709 C_CALL2 greaterequal
+     711 BRANCHIFNOT 716
+     713 ACC0 
+     714 RETURN 2
+     716 ACC1 
+     717 RETURN 2
+     719 RESTART 
+     720 GRAB 1
+     722 ACC1 
+     723 PUSHACC1 
+     724 C_CALL2 lessequal
+     726 BRANCHIFNOT 731
+     728 ACC0 
+     729 RETURN 2
+     731 ACC1 
+     732 RETURN 2
+     734 ACC0 
+     735 PUSHGETGLOBAL Invalid_argument
+     737 MAKEBLOCK2 0
+     739 RAISE 
+     740 ACC0 
+     741 PUSHGETGLOBAL Failure
+     743 MAKEBLOCK2 0
+     745 RAISE 
+     746 CLOSURE 0, 740
+     749 PUSH 
+     750 CLOSURE 0, 734
+     753 PUSHGETGLOBAL "Pervasives.Exit"
+     755 MAKEBLOCK1 0
+     757 PUSHGETGLOBAL "Pervasives.Assert_failure"
+     759 MAKEBLOCK1 0
+     761 PUSH 
+     762 CLOSURE 0, 720
+     765 PUSH 
+     766 CLOSURE 0, 705
+     769 PUSH 
+     770 CLOSURE 0, 692
+     773 PUSH 
+     774 CLOSURE 0, 686
+     777 PUSHCONST0 
+     778 PUSHCONSTINT 31
+     780 PUSHCONST1 
+     781 LSLINT 
+     782 EQ 
+     783 BRANCHIFNOT 789
+     785 CONSTINT 30
+     787 BRANCH 791
+     789 CONSTINT 62
+     791 PUSHCONST1 
+     792 LSLINT 
+     793 PUSHACC0 
+     794 OFFSETINT -1
+     796 PUSH 
+     797 CLOSURE 0, 655
+     800 PUSHACC 9
+     802 CLOSURE 1, 635
+     805 PUSH 
+     806 CLOSURE 0, 624
+     809 PUSHACC 11
+     811 CLOSURE 1, 599
+     814 PUSH 
+     815 CLOSURE 0, 592
+     818 PUSH 
+     819 CLOSURE 0, 585
+     822 PUSH 
+     823 CLOSUREREC 0, 12
+     827 CONST0 
+     828 C_CALL1 caml_open_descriptor
+     830 PUSHCONST1 
+     831 C_CALL1 caml_open_descriptor
+     833 PUSHCONST2 
+     834 C_CALL1 caml_open_descriptor
+     836 PUSH 
+     837 CLOSURE 0, 574
+     840 PUSHACC0 
+     841 CLOSURE 1, 565
+     844 PUSHACC1 
+     845 CLOSURE 1, 557
+     848 PUSH 
+     849 CLOSURE 0, 545
+     852 PUSHACC 22
+     854 CLOSURE 1, 515
+     857 PUSH 
+     858 CLOSURE 0, 505
+     861 PUSH 
+     862 CLOSURE 0, 496
+     865 PUSH 
+     866 CLOSURE 0, 485
+     869 PUSHACC0 
+     870 CLOSURE 1, 477
+     873 PUSHACC1 
+     874 CLOSURE 1, 470
+     877 PUSHACC 28
+     879 CLOSURE 1, 441
+     882 PUSH 
+     883 CLOSUREREC 0, 32
+     887 ACC0 
+     888 PUSHACC 31
+     890 CLOSURE 2, 411
+     893 PUSHACC 22
+     895 CLOSUREREC 1, 70
+     899 ACC 15
+     901 CLOSURE 1, 404
+     904 PUSHACC 11
+     906 PUSHACC 17
+     908 CLOSURE 2, 399
+     911 PUSHACC 12
+     913 PUSHACC 18
+     915 PUSHACC 23
+     917 CLOSURE 3, 392
+     920 PUSHACC 13
+     922 PUSHACC 19
+     924 PUSHACC 23
+     926 CLOSURE 3, 385
+     929 PUSHACC 14
+     931 PUSHACC 20
+     933 CLOSURE 2, 374
+     936 PUSHACC 20
+     938 CLOSURE 1, 364
+     941 PUSHACC 20
+     943 CLOSURE 1, 358
+     946 PUSHACC 17
+     948 PUSHACC 22
+     950 CLOSURE 2, 353
+     953 PUSHACC 18
+     955 PUSHACC 23
+     957 PUSHACC 29
+     959 CLOSURE 3, 346
+     962 PUSHACC 19
+     964 PUSHACC 24
+     966 PUSHACC 29
+     968 CLOSURE 3, 339
+     971 PUSHACC 20
+     973 PUSHACC 25
+     975 CLOSURE 2, 325
+     978 PUSHACC 25
+     980 CLOSURE 1, 315
+     983 PUSHACC 12
+     985 PUSHACC 28
+     987 PUSHACC 30
+     989 CLOSURE 3, 308
+     992 PUSHACC0 
+     993 CLOSURE 1, 301
+     996 PUSHACC1 
+     997 CLOSURE 1, 294
+    1000 PUSHACC 29
+    1002 PUSHACC 31
+    1004 CLOSURE 2, 286
+    1007 MAKEBLOCK1 0
+    1009 PUSHACC0 
+    1010 CLOSURE 1, 275
+    1013 PUSHACC1 
+    1014 CLOSURE 1, 263
+    1017 PUSHACC0 
+    1018 CLOSURE 1, 255
+    1021 PUSHACC1 
+    1022 PUSHACC 22
+    1024 PUSHACC4 
+    1025 PUSHACC3 
+    1026 PUSH 
+    1027 CLOSURE 0, 247
+    1030 PUSH 
+    1031 CLOSURE 0, 241
+    1034 PUSH 
+    1035 CLOSURE 0, 236
+    1038 PUSH 
+    1039 CLOSURE 0, 231
+    1042 PUSH 
+    1043 CLOSURE 0, 223
+    1046 PUSH 
+    1047 CLOSURE 0, 217
+    1050 PUSH 
+    1051 CLOSURE 0, 212
+    1054 PUSH 
+    1055 CLOSURE 0, 207
+    1058 PUSHACC 32
+    1060 PUSHACC 35
+    1062 PUSHACC 33
+    1064 PUSH 
+    1065 CLOSURE 0, 202
+    1068 PUSHACC 41
+    1070 PUSHACC 40
+    1072 PUSHACC 42
+    1074 PUSH 
+    1075 CLOSURE 0, 194
+    1078 PUSHACC 46
+    1080 PUSH 
+    1081 CLOSURE 0, 188
+    1084 PUSH 
+    1085 CLOSURE 0, 183
+    1088 PUSH 
+    1089 CLOSURE 0, 175
+    1092 PUSHACC 51
+    1094 PUSH 
+    1095 CLOSURE 0, 166
+    1098 PUSH 
+    1099 CLOSURE 0, 157
+    1102 PUSHACC 55
+    1104 PUSHACC 57
+    1106 PUSH 
+    1107 CLOSURE 0, 148
+    1110 PUSH 
+    1111 CLOSURE 0, 142
+    1114 PUSHACC 63
+    1116 PUSHACC 62
+    1118 PUSHACC 64
+    1120 PUSHACC 38
+    1122 PUSHACC 40
+    1124 PUSHACC 42
+    1126 PUSHACC 44
+    1128 PUSHACC 46
+    1130 PUSHACC 48
+    1132 PUSHACC 50
+    1134 PUSHACC 52
+    1136 PUSHACC 54
+    1138 PUSHACC 56
+    1140 PUSHACC 58
+    1142 PUSHACC 60
+    1144 PUSHACC 62
+    1146 PUSHACC 64
+    1148 PUSHACC 66
+    1150 PUSHACC 82
+    1152 PUSHACC 84
+    1154 PUSHACC 86
+    1156 PUSHACC 88
+    1158 PUSHACC 90
+    1160 PUSHACC 92
+    1162 PUSHACC 94
+    1164 PUSHACC 96
+    1166 PUSHACC 98
+    1168 PUSHACC 100
+    1170 PUSHACC 104
+    1172 PUSHACC 104
+    1174 PUSHACC 104
+    1176 PUSHACC 108
+    1178 PUSHACC 110
+    1180 PUSHACC 112
+    1182 PUSHACC 117
+    1184 PUSHACC 117
+    1186 PUSHACC 117
+    1188 PUSHACC 117
+    1190 MAKEBLOCK 69, 0
+    1193 POP 53
+    1195 SETGLOBAL Pervasives
+    1197 BRANCH 2177
+    1199 RESTART 
+    1200 GRAB 1
+    1202 ACC1 
+    1203 BRANCHIFNOT 1213
+    1205 ACC1 
+    1206 GETFIELD1 
+    1207 PUSHACC1 
+    1208 OFFSETINT 1
+    1210 PUSHOFFSETCLOSURE0 
+    1211 APPTERM2 4
+    1213 ACC0 
+    1214 RETURN 2
+    1216 RESTART 
+    1217 GRAB 1
+    1219 ACC0 
+    1220 BRANCHIFNOT 1251
+    1222 CONST0 
+    1223 PUSHACC2 
+    1224 EQ 
+    1225 BRANCHIFNOT 1231
+    1227 ACC0 
+    1228 GETFIELD0 
+    1229 RETURN 2
+    1231 CONST0 
+    1232 PUSHACC2 
+    1233 GTINT 
+    1234 BRANCHIFNOT 1244
+    1236 ACC1 
+    1237 OFFSETINT -1
+    1239 PUSHACC1 
+    1240 GETFIELD1 
+    1241 PUSHOFFSETCLOSURE0 
+    1242 APPTERM2 4
+    1244 GETGLOBAL "List.nth"
+    1246 PUSHGETGLOBALFIELD Pervasives, 2
+    1249 APPTERM1 3
+    1251 GETGLOBAL "nth"
+    1253 PUSHGETGLOBALFIELD Pervasives, 3
+    1256 APPTERM1 3
+    1258 RESTART 
+    1259 GRAB 1
+    1261 ACC0 
+    1262 BRANCHIFNOT 1274
+    1264 ACC1 
+    1265 PUSHACC1 
+    1266 GETFIELD0 
+    1267 MAKEBLOCK2 0
+    1269 PUSHACC1 
+    1270 GETFIELD1 
+    1271 PUSHOFFSETCLOSURE0 
+    1272 APPTERM2 4
+    1274 ACC1 
+    1275 RETURN 2
+    1277 ACC0 
+    1278 BRANCHIFNOT 1291
+    1280 ACC0 
+    1281 GETFIELD1 
+    1282 PUSHOFFSETCLOSURE0 
+    1283 APPLY1 
+    1284 PUSHACC1 
+    1285 GETFIELD0 
+    1286 PUSHGETGLOBALFIELD Pervasives, 16
+    1289 APPTERM2 3
+    1291 RETURN 1
+    1293 RESTART 
+    1294 GRAB 1
+    1296 ACC1 
+    1297 BRANCHIFNOT 1313
+    1299 ACC1 
+    1300 GETFIELD0 
+    1301 PUSHACC1 
+    1302 APPLY1 
+    1303 PUSHACC2 
+    1304 GETFIELD1 
+    1305 PUSHACC2 
+    1306 PUSHOFFSETCLOSURE0 
+    1307 APPLY2 
+    1308 PUSHACC1 
+    1309 MAKEBLOCK2 0
+    1311 POP 1
+    1313 RETURN 2
+    1315 RESTART 
+    1316 GRAB 1
+    1318 ACC1 
+    1319 BRANCHIFNOT 1331
+    1321 ACC1 
+    1322 GETFIELD0 
+    1323 PUSHACC1 
+    1324 APPLY1 
+    1325 ACC1 
+    1326 GETFIELD1 
+    1327 PUSHACC1 
+    1328 PUSHOFFSETCLOSURE0 
+    1329 APPTERM2 4
+    1331 RETURN 2
+    1333 RESTART 
+    1334 GRAB 2
+    1336 ACC2 
+    1337 BRANCHIFNOT 1350
+    1339 ACC2 
+    1340 GETFIELD1 
+    1341 PUSHACC3 
+    1342 GETFIELD0 
+    1343 PUSHACC3 
+    1344 PUSHACC3 
+    1345 APPLY2 
+    1346 PUSHACC2 
+    1347 PUSHOFFSETCLOSURE0 
+    1348 APPTERM3 6
+    1350 ACC1 
+    1351 RETURN 3
+    1353 RESTART 
+    1354 GRAB 2
+    1356 ACC1 
+    1357 BRANCHIFNOT 1370
+    1359 ACC2 
+    1360 PUSHACC2 
+    1361 GETFIELD1 
+    1362 PUSHACC2 
+    1363 PUSHOFFSETCLOSURE0 
+    1364 APPLY3 
+    1365 PUSHACC2 
+    1366 GETFIELD0 
+    1367 PUSHACC2 
+    1368 APPTERM2 5
+    1370 ACC2 
+    1371 RETURN 3
+    1373 RESTART 
+    1374 GRAB 2
+    1376 ACC1 
+    1377 BRANCHIFNOT 1400
+    1379 ACC2 
+    1380 BRANCHIFNOT 1407
+    1382 ACC2 
+    1383 GETFIELD0 
+    1384 PUSHACC2 
+    1385 GETFIELD0 
+    1386 PUSHACC2 
+    1387 APPLY2 
+    1388 PUSHACC3 
+    1389 GETFIELD1 
+    1390 PUSHACC3 
+    1391 GETFIELD1 
+    1392 PUSHACC3 
+    1393 PUSHOFFSETCLOSURE0 
+    1394 APPLY3 
+    1395 PUSHACC1 
+    1396 MAKEBLOCK2 0
+    1398 RETURN 4
+    1400 ACC2 
+    1401 BRANCHIFNOT 1405
+    1403 BRANCH 1407
+    1405 RETURN 3
+    1407 GETGLOBAL "List.map2"
+    1409 PUSHGETGLOBALFIELD Pervasives, 2
+    1412 APPTERM1 4
+    1414 RESTART 
+    1415 GRAB 2
+    1417 ACC1 
+    1418 BRANCHIFNOT 1437
+    1420 ACC2 
+    1421 BRANCHIFNOT 1444
+    1423 ACC2 
+    1424 GETFIELD0 
+    1425 PUSHACC2 
+    1426 GETFIELD0 
+    1427 PUSHACC2 
+    1428 APPLY2 
+    1429 ACC2 
+    1430 GETFIELD1 
+    1431 PUSHACC2 
+    1432 GETFIELD1 
+    1433 PUSHACC2 
+    1434 PUSHOFFSETCLOSURE0 
+    1435 APPTERM3 6
+    1437 ACC2 
+    1438 BRANCHIFNOT 1442
+    1440 BRANCH 1444
+    1442 RETURN 3
+    1444 GETGLOBAL "List.iter2"
+    1446 PUSHGETGLOBALFIELD Pervasives, 2
+    1449 APPTERM1 4
+    1451 RESTART 
+    1452 GRAB 3
+    1454 ACC2 
+    1455 BRANCHIFNOT 1476
+    1457 ACC3 
+    1458 BRANCHIFNOT 1482
+    1460 ACC3 
+    1461 GETFIELD1 
+    1462 PUSHACC3 
+    1463 GETFIELD1 
+    1464 PUSHACC5 
+    1465 GETFIELD0 
+    1466 PUSHACC5 
+    1467 GETFIELD0 
+    1468 PUSHACC5 
+    1469 PUSHACC5 
+    1470 APPLY3 
+    1471 PUSHACC3 
+    1472 PUSHOFFSETCLOSURE0 
+    1473 APPTERM 4, 8
+    1476 ACC3 
+    1477 BRANCHIF 1482
+    1479 ACC1 
+    1480 RETURN 4
+    1482 GETGLOBAL "List.fold_left2"
+    1484 PUSHGETGLOBALFIELD Pervasives, 2
+    1487 APPTERM1 5
+    1489 RESTART 
+    1490 GRAB 3
+    1492 ACC1 
+    1493 BRANCHIFNOT 1516
+    1495 ACC2 
+    1496 BRANCHIFNOT 1522
+    1498 PUSH_RETADDR 1509
+    1500 ACC6 
+    1501 PUSHACC6 
+    1502 GETFIELD1 
+    1503 PUSHACC6 
+    1504 GETFIELD1 
+    1505 PUSHACC6 
+    1506 PUSHOFFSETCLOSURE0 
+    1507 APPLY 4
+    1509 PUSHACC3 
+    1510 GETFIELD0 
+    1511 PUSHACC3 
+    1512 GETFIELD0 
+    1513 PUSHACC3 
+    1514 APPTERM3 7
+    1516 ACC2 
+    1517 BRANCHIF 1522
+    1519 ACC3 
+    1520 RETURN 4
+    1522 GETGLOBAL "List.fold_right2"
+    1524 PUSHGETGLOBALFIELD Pervasives, 2
+    1527 APPTERM1 5
+    1529 RESTART 
+    1530 GRAB 1
+    1532 ACC1 
+    1533 BRANCHIFNOT 1549
+    1535 ACC1 
+    1536 GETFIELD0 
+    1537 PUSHACC1 
+    1538 APPLY1 
+    1539 BRANCHIFNOT 1547
+    1541 ACC1 
+    1542 GETFIELD1 
+    1543 PUSHACC1 
+    1544 PUSHOFFSETCLOSURE0 
+    1545 APPTERM2 4
+    1547 RETURN 2
+    1549 CONST1 
+    1550 RETURN 2
+    1552 RESTART 
+    1553 GRAB 1
+    1555 ACC1 
+    1556 BRANCHIFNOT 1570
+    1558 ACC1 
+    1559 GETFIELD0 
+    1560 PUSHACC1 
+    1561 APPLY1 
+    1562 BRANCHIF 1570
+    1564 ACC1 
+    1565 GETFIELD1 
+    1566 PUSHACC1 
+    1567 PUSHOFFSETCLOSURE0 
+    1568 APPTERM2 4
+    1570 RETURN 2
+    1572 RESTART 
+    1573 GRAB 2
+    1575 ACC1 
+    1576 BRANCHIFNOT 1599
+    1578 ACC2 
+    1579 BRANCHIFNOT 1605
+    1581 ACC2 
+    1582 GETFIELD0 
+    1583 PUSHACC2 
+    1584 GETFIELD0 
+    1585 PUSHACC2 
+    1586 APPLY2 
+    1587 BRANCHIFNOT 1597
+    1589 ACC2 
+    1590 GETFIELD1 
+    1591 PUSHACC2 
+    1592 GETFIELD1 
+    1593 PUSHACC2 
+    1594 PUSHOFFSETCLOSURE0 
+    1595 APPTERM3 6
+    1597 RETURN 3
+    1599 ACC2 
+    1600 BRANCHIF 1605
+    1602 CONST1 
+    1603 RETURN 3
+    1605 GETGLOBAL "List.for_all2"
+    1607 PUSHGETGLOBALFIELD Pervasives, 2
+    1610 APPTERM1 4
+    1612 RESTART 
+    1613 GRAB 2
+    1615 ACC1 
+    1616 BRANCHIFNOT 1639
+    1618 ACC2 
+    1619 BRANCHIFNOT 1646
+    1621 ACC2 
+    1622 GETFIELD0 
+    1623 PUSHACC2 
+    1624 GETFIELD0 
+    1625 PUSHACC2 
+    1626 APPLY2 
+    1627 BRANCHIF 1637
+    1629 ACC2 
+    1630 GETFIELD1 
+    1631 PUSHACC2 
+    1632 GETFIELD1 
+    1633 PUSHACC2 
+    1634 PUSHOFFSETCLOSURE0 
+    1635 APPTERM3 6
+    1637 RETURN 3
+    1639 ACC2 
+    1640 BRANCHIFNOT 1644
+    1642 BRANCH 1646
+    1644 RETURN 3
+    1646 GETGLOBAL "List.exists2"
+    1648 PUSHGETGLOBALFIELD Pervasives, 2
+    1651 APPTERM1 4
+    1653 RESTART 
+    1654 GRAB 1
+    1656 ACC1 
+    1657 BRANCHIFNOT 1672
+    1659 ACC0 
+    1660 PUSHACC2 
+    1661 GETFIELD0 
+    1662 C_CALL2 equal
+    1664 BRANCHIF 1672
+    1666 ACC1 
+    1667 GETFIELD1 
+    1668 PUSHACC1 
+    1669 PUSHOFFSETCLOSURE0 
+    1670 APPTERM2 4
+    1672 RETURN 2
+    1674 RESTART 
+    1675 GRAB 1
+    1677 ACC1 
+    1678 BRANCHIFNOT 1692
+    1680 ACC0 
+    1681 PUSHACC2 
+    1682 GETFIELD0 
+    1683 EQ 
+    1684 BRANCHIF 1692
+    1686 ACC1 
+    1687 GETFIELD1 
+    1688 PUSHACC1 
+    1689 PUSHOFFSETCLOSURE0 
+    1690 APPTERM2 4
+    1692 RETURN 2
+    1694 RESTART 
+    1695 GRAB 1
+    1697 ACC1 
+    1698 BRANCHIFNOT 1719
+    1700 ACC1 
+    1701 GETFIELD0 
+    1702 PUSHACC1 
+    1703 PUSHACC1 
+    1704 GETFIELD0 
+    1705 C_CALL2 equal
+    1707 BRANCHIFNOT 1713
+    1709 ACC0 
+    1710 GETFIELD1 
+    1711 RETURN 3
+    1713 ACC2 
+    1714 GETFIELD1 
+    1715 PUSHACC2 
+    1716 PUSHOFFSETCLOSURE0 
+    1717 APPTERM2 5
+    1719 GETGLOBAL Not_found
+    1721 MAKEBLOCK1 0
+    1723 RAISE 
+    1724 RESTART 
+    1725 GRAB 1
+    1727 ACC1 
+    1728 BRANCHIFNOT 1748
+    1730 ACC1 
+    1731 GETFIELD0 
+    1732 PUSHACC1 
+    1733 PUSHACC1 
+    1734 GETFIELD0 
+    1735 EQ 
+    1736 BRANCHIFNOT 1742
+    1738 ACC0 
+    1739 GETFIELD1 
+    1740 RETURN 3
+    1742 ACC2 
+    1743 GETFIELD1 
+    1744 PUSHACC2 
+    1745 PUSHOFFSETCLOSURE0 
+    1746 APPTERM2 5
+    1748 GETGLOBAL Not_found
+    1750 MAKEBLOCK1 0
+    1752 RAISE 
+    1753 RESTART 
+    1754 GRAB 1
+    1756 ACC1 
+    1757 BRANCHIFNOT 1773
+    1759 ACC0 
+    1760 PUSHACC2 
+    1761 GETFIELD0 
+    1762 GETFIELD0 
+    1763 C_CALL2 equal
+    1765 BRANCHIF 1773
+    1767 ACC1 
+    1768 GETFIELD1 
+    1769 PUSHACC1 
+    1770 PUSHOFFSETCLOSURE0 
+    1771 APPTERM2 4
+    1773 RETURN 2
+    1775 RESTART 
+    1776 GRAB 1
+    1778 ACC1 
+    1779 BRANCHIFNOT 1794
+    1781 ACC0 
+    1782 PUSHACC2 
+    1783 GETFIELD0 
+    1784 GETFIELD0 
+    1785 EQ 
+    1786 BRANCHIF 1794
+    1788 ACC1 
+    1789 GETFIELD1 
+    1790 PUSHACC1 
+    1791 PUSHOFFSETCLOSURE0 
+    1792 APPTERM2 4
+    1794 RETURN 2
+    1796 RESTART 
+    1797 GRAB 1
+    1799 ACC1 
+    1800 BRANCHIFNOT 1825
+    1802 ACC1 
+    1803 GETFIELD0 
+    1804 PUSHACC2 
+    1805 GETFIELD1 
+    1806 PUSHACC2 
+    1807 PUSHACC2 
+    1808 GETFIELD0 
+    1809 C_CALL2 equal
+    1811 BRANCHIFNOT 1816
+    1813 ACC0 
+    1814 RETURN 4
+    1816 ACC0 
+    1817 PUSHACC3 
+    1818 PUSHOFFSETCLOSURE0 
+    1819 APPLY2 
+    1820 PUSHACC2 
+    1821 MAKEBLOCK2 0
+    1823 POP 2
+    1825 RETURN 2
+    1827 RESTART 
+    1828 GRAB 1
+    1830 ACC1 
+    1831 BRANCHIFNOT 1855
+    1833 ACC1 
+    1834 GETFIELD0 
+    1835 PUSHACC2 
+    1836 GETFIELD1 
+    1837 PUSHACC2 
+    1838 PUSHACC2 
+    1839 GETFIELD0 
+    1840 EQ 
+    1841 BRANCHIFNOT 1846
+    1843 ACC0 
+    1844 RETURN 4
+    1846 ACC0 
+    1847 PUSHACC3 
+    1848 PUSHOFFSETCLOSURE0 
+    1849 APPLY2 
+    1850 PUSHACC2 
+    1851 MAKEBLOCK2 0
+    1853 POP 2
+    1855 RETURN 2
+    1857 RESTART 
+    1858 GRAB 1
+    1860 ACC1 
+    1861 BRANCHIFNOT 1879
+    1863 ACC1 
+    1864 GETFIELD0 
+    1865 PUSHACC0 
+    1866 PUSHACC2 
+    1867 APPLY1 
+    1868 BRANCHIFNOT 1873
+    1870 ACC0 
+    1871 RETURN 3
+    1873 ACC2 
+    1874 GETFIELD1 
+    1875 PUSHACC2 
+    1876 PUSHOFFSETCLOSURE0 
+    1877 APPTERM2 5
+    1879 GETGLOBAL Not_found
+    1881 MAKEBLOCK1 0
+    1883 RAISE 
+    1884 RESTART 
+    1885 GRAB 2
+    1887 ACC2 
+    1888 BRANCHIFNOT 1917
+    1890 ACC2 
+    1891 GETFIELD0 
+    1892 PUSHACC3 
+    1893 GETFIELD1 
+    1894 PUSHACC1 
+    1895 PUSHENVACC2 
+    1896 APPLY1 
+    1897 BRANCHIFNOT 1908
+    1899 ACC0 
+    1900 PUSHACC4 
+    1901 PUSHACC4 
+    1902 PUSHACC4 
+    1903 MAKEBLOCK2 0
+    1905 PUSHOFFSETCLOSURE0 
+    1906 APPTERM3 8
+    1908 ACC0 
+    1909 PUSHACC4 
+    1910 PUSHACC3 
+    1911 MAKEBLOCK2 0
+    1913 PUSHACC4 
+    1914 PUSHOFFSETCLOSURE0 
+    1915 APPTERM3 8
+    1917 ACC1 
+    1918 PUSHENVACC1 
+    1919 APPLY1 
+    1920 PUSHACC1 
+    1921 PUSHENVACC1 
+    1922 APPLY1 
+    1923 MAKEBLOCK2 0
+    1925 RETURN 3
+    1927 RESTART 
+    1928 GRAB 1
+    1930 ACC0 
+    1931 PUSHENVACC1 
+    1932 CLOSUREREC 2, 1885
+    1936 ACC2 
+    1937 PUSHCONST0 
+    1938 PUSHCONST0 
+    1939 PUSHACC3 
+    1940 APPTERM3 6
+    1942 ACC0 
+    1943 BRANCHIFNOT 1967
+    1945 ACC0 
+    1946 GETFIELD0 
+    1947 PUSHACC1 
+    1948 GETFIELD1 
+    1949 PUSHOFFSETCLOSURE0 
+    1950 APPLY1 
+    1951 PUSHACC0 
+    1952 GETFIELD1 
+    1953 PUSHACC2 
+    1954 GETFIELD1 
+    1955 MAKEBLOCK2 0
+    1957 PUSHACC1 
+    1958 GETFIELD0 
+    1959 PUSHACC3 
+    1960 GETFIELD0 
+    1961 MAKEBLOCK2 0
+    1963 MAKEBLOCK2 0
+    1965 RETURN 3
+    1967 GETGLOBAL <0>(0, 0)
+    1969 RETURN 1
+    1971 RESTART 
+    1972 GRAB 1
+    1974 ACC0 
+    1975 BRANCHIFNOT 1996
+    1977 ACC1 
+    1978 BRANCHIFNOT 2003
+    1980 ACC1 
+    1981 GETFIELD1 
+    1982 PUSHACC1 
+    1983 GETFIELD1 
+    1984 PUSHOFFSETCLOSURE0 
+    1985 APPLY2 
+    1986 PUSHACC2 
+    1987 GETFIELD0 
+    1988 PUSHACC2 
+    1989 GETFIELD0 
+    1990 MAKEBLOCK2 0
+    1992 MAKEBLOCK2 0
+    1994 RETURN 2
+    1996 ACC1 
+    1997 BRANCHIFNOT 2001
+    1999 BRANCH 2003
+    2001 RETURN 2
+    2003 GETGLOBAL "List.combine"
+    2005 PUSHGETGLOBALFIELD Pervasives, 2
+    2008 APPTERM1 3
+    2010 RESTART 
+    2011 GRAB 1
+    2013 ACC1 
+    2014 BRANCHIFNOT 2038
+    2016 ACC1 
+    2017 GETFIELD0 
+    2018 PUSHACC2 
+    2019 GETFIELD1 
+    2020 PUSHACC1 
+    2021 PUSHENVACC2 
+    2022 APPLY1 
+    2023 BRANCHIFNOT 2033
+    2025 ACC0 
+    2026 PUSHACC3 
+    2027 PUSHACC3 
+    2028 MAKEBLOCK2 0
+    2030 PUSHOFFSETCLOSURE0 
+    2031 APPTERM2 6
+    2033 ACC0 
+    2034 PUSHACC3 
+    2035 PUSHOFFSETCLOSURE0 
+    2036 APPTERM2 6
+    2038 ACC0 
+    2039 PUSHENVACC1 
+    2040 APPTERM1 3
+    2042 ACC0 
+    2043 PUSHENVACC1 
+    2044 CLOSUREREC 2, 2011
+    2048 CONST0 
+    2049 PUSHACC1 
+    2050 APPTERM1 3
+    2052 RESTART 
+    2053 GRAB 2
+    2055 ACC1 
+    2056 BRANCHIFNOT 2077
+    2058 ACC2 
+    2059 BRANCHIFNOT 2084
+    2061 ACC2 
+    2062 GETFIELD1 
+    2063 PUSHACC2 
+    2064 GETFIELD1 
+    2065 PUSHACC2 
+    2066 PUSHACC5 
+    2067 GETFIELD0 
+    2068 PUSHACC5 
+    2069 GETFIELD0 
+    2070 PUSHENVACC1 
+    2071 APPLY2 
+    2072 MAKEBLOCK2 0
+    2074 PUSHOFFSETCLOSURE0 
+    2075 APPTERM3 6
+    2077 ACC2 
+    2078 BRANCHIFNOT 2082
+    2080 BRANCH 2084
+    2082 RETURN 3
+    2084 GETGLOBAL "List.rev_map2"
+    2086 PUSHGETGLOBALFIELD Pervasives, 2
+    2089 APPTERM1 4
+    2091 RESTART 
+    2092 GRAB 2
+    2094 ACC0 
+    2095 CLOSUREREC 1, 2053
+    2099 ACC3 
+    2100 PUSHACC3 
+    2101 PUSHCONST0 
+    2102 PUSHACC3 
+    2103 APPTERM3 7
+    2105 RESTART 
+    2106 GRAB 1
+    2108 ACC1 
+    2109 BRANCHIFNOT 2123
+    2111 ACC1 
+    2112 GETFIELD1 
+    2113 PUSHACC1 
+    2114 PUSHACC3 
+    2115 GETFIELD0 
+    2116 PUSHENVACC1 
+    2117 APPLY1 
+    2118 MAKEBLOCK2 0
+    2120 PUSHOFFSETCLOSURE0 
+    2121 APPTERM2 4
+    2123 ACC0 
+    2124 RETURN 2
+    2126 RESTART 
+    2127 GRAB 1
+    2129 ACC0 
+    2130 CLOSUREREC 1, 2106
+    2134 ACC2 
+    2135 PUSHCONST0 
+    2136 PUSHACC2 
+    2137 APPTERM2 5
+    2139 CONST0 
+    2140 PUSHACC1 
+    2141 PUSHENVACC1 
+    2142 APPTERM2 3
+    2144 ACC0 
+    2145 BRANCHIFNOT 2151
+    2147 ACC0 
+    2148 GETFIELD1 
+    2149 RETURN 1
+    2151 GETGLOBAL "tl"
+    2153 PUSHGETGLOBALFIELD Pervasives, 3
+    2156 APPTERM1 2
+    2158 ACC0 
+    2159 BRANCHIFNOT 2165
+    2161 ACC0 
+    2162 GETFIELD0 
+    2163 RETURN 1
+    2165 GETGLOBAL "hd"
+    2167 PUSHGETGLOBALFIELD Pervasives, 3
+    2170 APPTERM1 2
+    2172 ACC0 
+    2173 PUSHCONST0 
+    2174 PUSHENVACC1 
+    2175 APPTERM2 3
+    2177 CLOSUREREC 0, 1200
+    2181 ACC0 
+    2182 CLOSURE 1, 2172
+    2185 PUSH 
+    2186 CLOSURE 0, 2158
+    2189 PUSH 
+    2190 CLOSURE 0, 2144
+    2193 PUSH 
+    2194 CLOSUREREC 0, 1217
+    2198 GETGLOBALFIELD Pervasives, 16
+    2201 PUSH 
+    2202 CLOSUREREC 0, 1259
+    2206 ACC0 
+    2207 CLOSURE 1, 2139
+    2210 PUSH 
+    2211 CLOSUREREC 0, 1277
+    2215 CLOSUREREC 0, 1294
+    2219 CLOSURE 0, 2127
+    2222 PUSH 
+    2223 CLOSUREREC 0, 1316
+    2227 CLOSUREREC 0, 1334
+    2231 CLOSUREREC 0, 1354
+    2235 CLOSUREREC 0, 1374
+    2239 CLOSURE 0, 2092
+    2242 PUSH 
+    2243 CLOSUREREC 0, 1415
+    2247 CLOSUREREC 0, 1452
+    2251 CLOSUREREC 0, 1490
+    2255 CLOSUREREC 0, 1530
+    2259 CLOSUREREC 0, 1553
+    2263 CLOSUREREC 0, 1573
+    2267 CLOSUREREC 0, 1613
+    2271 CLOSUREREC 0, 1654
+    2275 CLOSUREREC 0, 1675
+    2279 CLOSUREREC 0, 1695
+    2283 CLOSUREREC 0, 1725
+    2287 CLOSUREREC 0, 1754
+    2291 CLOSUREREC 0, 1776
+    2295 CLOSUREREC 0, 1797
+    2299 CLOSUREREC 0, 1828
+    2303 CLOSUREREC 0, 1858
+    2307 ACC 24
+    2309 CLOSURE 1, 2042
+    2312 PUSHACC 25
+    2314 CLOSUREREC 1, 1928
+    2318 CLOSUREREC 0, 1942
+    2322 CLOSUREREC 0, 1972
+    2326 ACC0 
+    2327 PUSHACC2 
+    2328 PUSHACC7 
+    2329 PUSHACC 9
+    2331 PUSHACC 11
+    2333 PUSHACC 13
+    2335 PUSHACC 15
+    2337 PUSHACC 17
+    2339 PUSHACC 10
+    2341 PUSHACC 12
+    2343 PUSHACC 13
+    2345 PUSHACC 15
+    2347 PUSHACC 23
+    2349 PUSHACC 25
+    2351 PUSHACC 27
+    2353 PUSHACC 29
+    2355 PUSHACC 31
+    2357 PUSHACC 33
+    2359 PUSHACC 35
+    2361 PUSHACC 37
+    2363 PUSHACC 40
+    2365 PUSHACC 42
+    2367 PUSHACC 41
+    2369 PUSHACC 45
+    2371 PUSHACC 47
+    2373 PUSHACC 50
+    2375 PUSHACC 52
+    2377 PUSHACC 51
+    2379 PUSHACC 55
+    2381 PUSHACC 56
+    2383 PUSHACC 59
+    2385 PUSHACC 61
+    2387 PUSHACC 60
+    2389 PUSHACC 64
+    2391 PUSHACC 66
+    2393 PUSHACC 68
+    2395 PUSHACC 70
+    2397 MAKEBLOCK 37, 0
+    2400 POP 36
+    2402 SETGLOBAL List
+    2404 BRANCH 2622
+    2406 CONSTINT 97
+    2408 PUSHACC1 
+    2409 GEINT 
+    2410 BRANCHIFNOT 2418
+    2412 CONSTINT 122
+    2414 PUSHACC1 
+    2415 LEINT 
+    2416 BRANCHIF 2442
+    2418 CONSTINT 224
+    2420 PUSHACC1 
+    2421 GEINT 
+    2422 BRANCHIFNOT 2430
+    2424 CONSTINT 246
+    2426 PUSHACC1 
+    2427 LEINT 
+    2428 BRANCHIF 2442
+    2430 CONSTINT 248
+    2432 PUSHACC1 
+    2433 GEINT 
+    2434 BRANCHIFNOT 2447
+    2436 CONSTINT 254
+    2438 PUSHACC1 
+    2439 LEINT 
+    2440 BRANCHIFNOT 2447
+    2442 ACC0 
+    2443 OFFSETINT -32
+    2445 RETURN 1
+    2447 ACC0 
+    2448 RETURN 1
+    2450 CONSTINT 65
+    2452 PUSHACC1 
+    2453 GEINT 
+    2454 BRANCHIFNOT 2462
+    2456 CONSTINT 90
+    2458 PUSHACC1 
+    2459 LEINT 
+    2460 BRANCHIF 2486
+    2462 CONSTINT 192
+    2464 PUSHACC1 
+    2465 GEINT 
+    2466 BRANCHIFNOT 2474
+    2468 CONSTINT 214
+    2470 PUSHACC1 
+    2471 LEINT 
+    2472 BRANCHIF 2486
+    2474 CONSTINT 216
+    2476 PUSHACC1 
+    2477 GEINT 
+    2478 BRANCHIFNOT 2491
+    2480 CONSTINT 222
+    2482 PUSHACC1 
+    2483 LEINT 
+    2484 BRANCHIFNOT 2491
+    2486 ACC0 
+    2487 OFFSETINT 32
+    2489 RETURN 1
+    2491 ACC0 
+    2492 RETURN 1
+    2494 CONSTINT 39
+    2496 PUSHACC1 
+    2497 LTINT 
+    2498 BRANCHIFNOT 2520
+    2500 CONSTINT 9
+    2502 PUSHACC1 
+    2503 EQ 
+    2504 BRANCHIFNOT 2510
+    2506 GETGLOBAL "\\t"
+    2508 RETURN 1
+    2510 CONSTINT 13
+    2512 PUSHACC1 
+    2513 EQ 
+    2514 BRANCHIFNOT 2540
+    2516 GETGLOBAL "\\n"
+    2518 RETURN 1
+    2520 CONSTINT 39
+    2522 PUSHACC1 
+    2523 EQ 
+    2524 BRANCHIFNOT 2530
+    2526 GETGLOBAL "\\'"
+    2528 RETURN 1
+    2530 CONSTINT 92
+    2532 PUSHACC1 
+    2533 EQ 
+    2534 BRANCHIFNOT 2540
+    2536 GETGLOBAL "\\\\"
+    2538 RETURN 1
+    2540 ACC0 
+    2541 C_CALL1 is_printable
+    2543 BRANCHIFNOT 2555
+    2545 CONST1 
+    2546 C_CALL1 create_string
+    2548 PUSHACC1 
+    2549 PUSHCONST0 
+    2550 PUSHACC2 
+    2551 SETSTRINGCHAR 
+    2552 ACC0 
+    2553 RETURN 2
+    2555 ACC0 
+    2556 PUSHCONSTINT 4
+    2558 C_CALL1 create_string
+    2560 PUSHCONSTINT 92
+    2562 PUSHCONST0 
+    2563 PUSHACC2 
+    2564 SETSTRINGCHAR 
+    2565 CONSTINT 100
+    2567 PUSHACC2 
+    2568 DIVINT 
+    2569 PUSHCONSTINT 48
+    2571 ADDINT 
+    2572 PUSHCONST1 
+    2573 PUSHACC2 
+    2574 SETSTRINGCHAR 
+    2575 CONSTINT 10
+    2577 PUSHCONSTINT 10
+    2579 PUSHACC3 
+    2580 DIVINT 
+    2581 MODINT 
+    2582 PUSHCONSTINT 48
+    2584 ADDINT 
+    2585 PUSHCONST2 
+    2586 PUSHACC2 
+    2587 SETSTRINGCHAR 
+    2588 CONSTINT 10
+    2590 PUSHACC2 
+    2591 MODINT 
+    2592 PUSHCONSTINT 48
+    2594 ADDINT 
+    2595 PUSHCONST3 
+    2596 PUSHACC2 
+    2597 SETSTRINGCHAR 
+    2598 ACC0 
+    2599 RETURN 3
+    2601 CONST0 
+    2602 PUSHACC1 
+    2603 LTINT 
+    2604 BRANCHIF 2612
+    2606 CONSTINT 255
+    2608 PUSHACC1 
+    2609 GTINT 
+    2610 BRANCHIFNOT 2619
+    2612 GETGLOBAL "Char.chr"
+    2614 PUSHGETGLOBALFIELD Pervasives, 2
+    2617 APPTERM1 2
+    2619 ACC0 
+    2620 RETURN 1
+    2622 CLOSURE 0, 2601
+    2625 PUSH 
+    2626 CLOSURE 0, 2494
+    2629 PUSH 
+    2630 CLOSURE 0, 2450
+    2633 PUSH 
+    2634 CLOSURE 0, 2406
+    2637 PUSHACC0 
+    2638 PUSHACC2 
+    2639 PUSHACC4 
+    2640 PUSHACC6 
+    2641 MAKEBLOCK 4, 0
+    2644 POP 4
+    2646 SETGLOBAL Char
+    2648 BRANCH 3540
+    2650 RESTART 
+    2651 GRAB 3
+    2653 ACC1 
+    2654 PUSHACC3 
+    2655 GEINT 
+    2656 BRANCHIFNOT 2663
+    2658 GETGLOBAL Not_found
+    2660 MAKEBLOCK1 0
+    2662 RAISE 
+    2663 ACC3 
+    2664 PUSHACC3 
+    2665 PUSHACC2 
+    2666 GETSTRINGCHAR 
+    2667 EQ 
+    2668 BRANCHIFNOT 2673
+    2670 ACC2 
+    2671 RETURN 4
+    2673 ACC3 
+    2674 PUSHACC3 
+    2675 OFFSETINT 1
+    2677 PUSHACC3 
+    2678 PUSHACC3 
+    2679 PUSHOFFSETCLOSURE0 
+    2680 APPTERM 4, 8
+    2683 RESTART 
+    2684 GRAB 2
+    2686 CONST0 
+    2687 PUSHACC2 
+    2688 LTINT 
+    2689 BRANCHIFNOT 2696
+    2691 GETGLOBAL Not_found
+    2693 MAKEBLOCK1 0
+    2695 RAISE 
+    2696 ACC2 
+    2697 PUSHACC2 
+    2698 PUSHACC2 
+    2699 GETSTRINGCHAR 
+    2700 EQ 
+    2701 BRANCHIFNOT 2706
+    2703 ACC1 
+    2704 RETURN 3
+    2706 ACC2 
+    2707 PUSHACC2 
+    2708 OFFSETINT -1
+    2710 PUSHACC2 
+    2711 PUSHOFFSETCLOSURE0 
+    2712 APPTERM3 6
+    2714 RESTART 
+    2715 GRAB 1
+    2717 ACC1 
+    2718 PUSHCONST0 
+    2719 PUSHACC2 
+    2720 PUSHENVACC1 
+    2721 APPTERM3 5
+    2723 RESTART 
+    2724 GRAB 2
+    2726 CONST0 
+    2727 PUSHACC2 
+    2728 LTINT 
+    2729 BRANCHIF 2738
+    2731 ACC0 
+    2732 C_CALL1 ml_string_length
+    2734 PUSHACC2 
+    2735 GEINT 
+    2736 BRANCHIFNOT 2745
+    2738 GETGLOBAL "String.rcontains_from"
+    2740 PUSHGETGLOBALFIELD Pervasives, 2
+    2743 APPTERM1 4
+    2745 PUSHTRAP 2756
+    2747 ACC6 
+    2748 PUSHACC6 
+    2749 PUSHACC6 
+    2750 PUSHENVACC1 
+    2751 APPLY3 
+    2752 CONST1 
+    2753 POPTRAP 
+    2754 RETURN 3
+    2756 PUSHGETGLOBAL Not_found
+    2758 PUSHACC1 
+    2759 GETFIELD0 
+    2760 EQ 
+    2761 BRANCHIFNOT 2766
+    2763 CONST0 
+    2764 RETURN 4
+    2766 ACC0 
+    2767 RAISE 
+    2768 RESTART 
+    2769 GRAB 2
+    2771 CONST0 
+    2772 PUSHACC2 
+    2773 LTINT 
+    2774 BRANCHIF 2783
+    2776 ACC0 
+    2777 C_CALL1 ml_string_length
+    2779 PUSHACC2 
+    2780 GTINT 
+    2781 BRANCHIFNOT 2790
+    2783 GETGLOBAL "String.contains_from"
+    2785 PUSHGETGLOBALFIELD Pervasives, 2
+    2788 APPTERM1 4
+    2790 PUSHTRAP 2811
+    2792 PUSH_RETADDR 2807
+    2794 ACC 9
+    2796 PUSHACC 9
+    2798 PUSHACC 9
+    2800 C_CALL1 ml_string_length
+    2802 PUSHACC 10
+    2804 PUSHENVACC1 
+    2805 APPLY 4
+    2807 CONST1 
+    2808 POPTRAP 
+    2809 RETURN 3
+    2811 PUSHGETGLOBAL Not_found
+    2813 PUSHACC1 
+    2814 GETFIELD0 
+    2815 EQ 
+    2816 BRANCHIFNOT 2821
+    2818 CONST0 
+    2819 RETURN 4
+    2821 ACC0 
+    2822 RAISE 
+    2823 RESTART 
+    2824 GRAB 2
+    2826 CONST0 
+    2827 PUSHACC2 
+    2828 LTINT 
+    2829 BRANCHIF 2838
+    2831 ACC0 
+    2832 C_CALL1 ml_string_length
+    2834 PUSHACC2 
+    2835 GEINT 
+    2836 BRANCHIFNOT 2845
+    2838 GETGLOBAL "String.rindex_from"
+    2840 PUSHGETGLOBALFIELD Pervasives, 2
+    2843 APPTERM1 4
+    2845 ACC2 
+    2846 PUSHACC2 
+    2847 PUSHACC2 
+    2848 PUSHENVACC1 
+    2849 APPTERM3 6
+    2851 RESTART 
+    2852 GRAB 1
+    2854 ACC1 
+    2855 PUSHACC1 
+    2856 C_CALL1 ml_string_length
+    2858 OFFSETINT -1
+    2860 PUSHACC2 
+    2861 PUSHENVACC1 
+    2862 APPTERM3 5
+    2864 RESTART 
+    2865 GRAB 2
+    2867 CONST0 
+    2868 PUSHACC2 
+    2869 LTINT 
+    2870 BRANCHIF 2879
+    2872 ACC0 
+    2873 C_CALL1 ml_string_length
+    2875 PUSHACC2 
+    2876 GTINT 
+    2877 BRANCHIFNOT 2886
+    2879 GETGLOBAL "String.index_from"
+    2881 PUSHGETGLOBALFIELD Pervasives, 2
+    2884 APPTERM1 4
+    2886 ACC2 
+    2887 PUSHACC2 
+    2888 PUSHACC2 
+    2889 C_CALL1 ml_string_length
+    2891 PUSHACC3 
+    2892 PUSHENVACC1 
+    2893 APPTERM 4, 7
+    2896 RESTART 
+    2897 GRAB 1
+    2899 ACC1 
+    2900 PUSHCONST0 
+    2901 PUSHACC2 
+    2902 C_CALL1 ml_string_length
+    2904 PUSHACC3 
+    2905 PUSHENVACC1 
+    2906 APPTERM 4, 6
+    2909 ACC0 
+    2910 PUSHGETGLOBALFIELD Char, 2
+    2913 PUSHENVACC1 
+    2914 APPTERM2 3
+    2916 ACC0 
+    2917 PUSHGETGLOBALFIELD Char, 3
+    2920 PUSHENVACC1 
+    2921 APPTERM2 3
+    2923 RESTART 
+    2924 GRAB 1
+    2926 CONST0 
+    2927 PUSHACC2 
+    2928 C_CALL1 ml_string_length
+    2930 EQ 
+    2931 BRANCHIFNOT 2936
+    2933 ACC1 
+    2934 RETURN 2
+    2936 ACC1 
+    2937 PUSHENVACC1 
+    2938 APPLY1 
+    2939 PUSHCONST0 
+    2940 PUSHACC3 
+    2941 GETSTRINGCHAR 
+    2942 PUSHACC2 
+    2943 APPLY1 
+    2944 PUSHCONST0 
+    2945 PUSHACC2 
+    2946 SETSTRINGCHAR 
+    2947 ACC0 
+    2948 RETURN 3
+    2950 ACC0 
+    2951 PUSHGETGLOBALFIELD Char, 2
+    2954 PUSHENVACC1 
+    2955 APPTERM2 3
+    2957 ACC0 
+    2958 PUSHGETGLOBALFIELD Char, 3
+    2961 PUSHENVACC1 
+    2962 APPTERM2 3
+    2964 RESTART 
+    2965 GRAB 1
+    2967 ACC1 
+    2968 C_CALL1 ml_string_length
+    2970 PUSHCONST0 
+    2971 PUSHACC1 
+    2972 EQ 
+    2973 BRANCHIFNOT 2978
+    2975 ACC2 
+    2976 RETURN 3
+    2978 ACC0 
+    2979 C_CALL1 create_string
+    2981 PUSHCONST0 
+    2982 PUSHACC2 
+    2983 OFFSETINT -1
+    2985 PUSH 
+    2986 BRANCH 3002
+    2988 CHECK_SIGNALS 
+    2989 ACC1 
+    2990 PUSHACC6 
+    2991 GETSTRINGCHAR 
+    2992 PUSHACC5 
+    2993 APPLY1 
+    2994 PUSHACC2 
+    2995 PUSHACC4 
+    2996 SETSTRINGCHAR 
+    2997 ACC1 
+    2998 OFFSETINT 1
+    3000 ASSIGN 1
+    3002 ACC0 
+    3003 PUSHACC2 
+    3004 LEINT 
+    3005 BRANCHIF 2988
+    3007 CONST0 
+    3008 POP 2
+    3010 ACC0 
+    3011 RETURN 4
+    3013 CONST0 
+    3014 PUSHCONST0 
+    3015 PUSHACC2 
+    3016 C_CALL1 ml_string_length
+    3018 OFFSETINT -1
+    3020 PUSH 
+    3021 BRANCH 3059
+    3023 CHECK_SIGNALS 
+    3024 ACC1 
+    3025 PUSHACC4 
+    3026 GETSTRINGCHAR 
+    3027 PUSHACC0 
+    3028 PUSHGETGLOBAL "\000\"\000\000\004\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
+    3030 C_CALL2 bitvect_test
+    3032 BRANCHIFNOT 3038
+    3034 CONST0 
+    3035 CONST2 
+    3036 BRANCH 3048
+    3038 ACC0 
+    3039 C_CALL1 is_printable
+    3041 BRANCHIFNOT 3046
+    3043 CONST1 
+    3044 BRANCH 3048
+    3046 CONSTINT 4
+    3048 POP 1
+    3050 PUSHACC3 
+    3051 ADDINT 
+    3052 ASSIGN 2
+    3054 ACC1 
+    3055 OFFSETINT 1
+    3057 ASSIGN 1
+    3059 ACC0 
+    3060 PUSHACC2 
+    3061 LEINT 
+    3062 BRANCHIF 3023
+    3064 CONST0 
+    3065 POP 2
+    3067 ACC1 
+    3068 C_CALL1 ml_string_length
+    3070 PUSHACC1 
+    3071 EQ 
+    3072 BRANCHIFNOT 3077
+    3074 ACC1 
+    3075 RETURN 2
+    3077 ACC0 
+    3078 C_CALL1 create_string
+    3080 PUSHCONST0 
+    3081 ASSIGN 1
+    3083 CONST0 
+    3084 PUSHACC3 
+    3085 C_CALL1 ml_string_length
+    3087 OFFSETINT -1
+    3089 PUSH 
+    3090 BRANCH 3245
+    3092 CHECK_SIGNALS 
+    3093 ACC1 
+    3094 PUSHACC5 
+    3095 GETSTRINGCHAR 
+    3096 PUSHACC0 
+    3097 PUSHGETGLOBAL "\000\000\000\000\004\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
+    3099 C_CALL2 bitvect_test
+    3101 BRANCHIFNOT 3120
+    3103 CONST0 
+    3104 CONSTINT 92
+    3106 PUSHACC5 
+    3107 PUSHACC5 
+    3108 SETSTRINGCHAR 
+    3109 ACC4 
+    3110 OFFSETINT 1
+    3112 ASSIGN 4
+    3114 ACC0 
+    3115 PUSHACC5 
+    3116 PUSHACC5 
+    3117 SETSTRINGCHAR 
+    3118 BRANCH 3233
+    3120 CONSTINT 9
+    3122 PUSHACC1 
+    3123 EQ 
+    3124 BRANCHIFNOT 3143
+    3126 CONSTINT 92
+    3128 PUSHACC5 
+    3129 PUSHACC5 
+    3130 SETSTRINGCHAR 
+    3131 ACC4 
+    3132 OFFSETINT 1
+    3134 ASSIGN 4
+    3136 CONSTINT 116
+    3138 PUSHACC5 
+    3139 PUSHACC5 
+    3140 SETSTRINGCHAR 
+    3141 BRANCH 3233
+    3143 CONSTINT 13
+    3145 PUSHACC1 
+    3146 EQ 
+    3147 BRANCHIFNOT 3166
+    3149 CONSTINT 92
+    3151 PUSHACC5 
+    3152 PUSHACC5 
+    3153 SETSTRINGCHAR 
+    3154 ACC4 
+    3155 OFFSETINT 1
+    3157 ASSIGN 4
+    3159 CONSTINT 110
+    3161 PUSHACC5 
+    3162 PUSHACC5 
+    3163 SETSTRINGCHAR 
+    3164 BRANCH 3233
+    3166 ACC0 
+    3167 C_CALL1 is_printable
+    3169 BRANCHIFNOT 3177
+    3171 ACC0 
+    3172 PUSHACC5 
+    3173 PUSHACC5 
+    3174 SETSTRINGCHAR 
+    3175 BRANCH 3233
+    3177 ACC0 
+    3178 PUSHCONSTINT 92
+    3180 PUSHACC6 
+    3181 PUSHACC6 
+    3182 SETSTRINGCHAR 
+    3183 ACC5 
+    3184 OFFSETINT 1
+    3186 ASSIGN 5
+    3188 CONSTINT 100
+    3190 PUSHACC1 
+    3191 DIVINT 
+    3192 PUSHCONSTINT 48
+    3194 ADDINT 
+    3195 PUSHACC6 
+    3196 PUSHACC6 
+    3197 SETSTRINGCHAR 
+    3198 ACC5 
+    3199 OFFSETINT 1
+    3201 ASSIGN 5
+    3203 CONSTINT 10
+    3205 PUSHCONSTINT 10
+    3207 PUSHACC2 
+    3208 DIVINT 
+    3209 MODINT 
+    3210 PUSHCONSTINT 48
+    3212 ADDINT 
+    3213 PUSHACC6 
+    3214 PUSHACC6 
+    3215 SETSTRINGCHAR 
+    3216 ACC5 
+    3217 OFFSETINT 1
+    3219 ASSIGN 5
+    3221 CONSTINT 10
+    3223 PUSHACC1 
+    3224 MODINT 
+    3225 PUSHCONSTINT 48
+    3227 ADDINT 
+    3228 PUSHACC6 
+    3229 PUSHACC6 
+    3230 SETSTRINGCHAR 
+    3231 POP 1
+    3233 POP 1
+    3235 ACC3 
+    3236 OFFSETINT 1
+    3238 ASSIGN 3
+    3240 ACC1 
+    3241 OFFSETINT 1
+    3243 ASSIGN 1
+    3245 ACC0 
+    3246 PUSHACC2 
+    3247 LEINT 
+    3248 BRANCHIF 3092
+    3250 CONST0 
+    3251 POP 2
+    3253 ACC0 
+    3254 RETURN 3
+    3256 ENVACC1 
+    3257 C_CALL1 ml_string_length
+    3259 PUSHENVACC3 
+    3260 GETFIELD0 
+    3261 PUSHENVACC2 
+    3262 PUSHCONST0 
+    3263 PUSHENVACC1 
+    3264 C_CALL5 blit_string
+    3266 ENVACC1 
+    3267 C_CALL1 ml_string_length
+    3269 PUSHENVACC3 
+    3270 GETFIELD0 
+    3271 ADDINT 
+    3272 PUSHENVACC3 
+    3273 SETFIELD0 
+    3274 ACC0 
+    3275 C_CALL1 ml_string_length
+    3277 PUSHENVACC3 
+    3278 GETFIELD0 
+    3279 PUSHENVACC2 
+    3280 PUSHCONST0 
+    3281 PUSHACC4 
+    3282 C_CALL5 blit_string
+    3284 ACC0 
+    3285 C_CALL1 ml_string_length
+    3287 PUSHENVACC3 
+    3288 GETFIELD0 
+    3289 ADDINT 
+    3290 PUSHENVACC3 
+    3291 SETFIELD0 
+    3292 RETURN 1
+    3294 ENVACC1 
+    3295 OFFSETREF 1
+    3297 ACC0 
+    3298 C_CALL1 ml_string_length
+    3300 PUSHENVACC2 
+    3301 GETFIELD0 
+    3302 ADDINT 
+    3303 PUSHENVACC2 
+    3304 SETFIELD0 
+    3305 RETURN 1
+    3307 RESTART 
+    3308 GRAB 1
+    3310 ACC1 
+    3311 BRANCHIFNOT 3374
+    3313 ACC1 
+    3314 GETFIELD0 
+    3315 PUSHCONST0 
+    3316 MAKEBLOCK1 0
+    3318 PUSHCONST0 
+    3319 MAKEBLOCK1 0
+    3321 PUSHACC4 
+    3322 PUSHACC1 
+    3323 PUSHACC3 
+    3324 CLOSURE 2, 3294
+    3327 PUSHGETGLOBALFIELD List, 9
+    3330 APPLY2 
+    3331 ACC1 
+    3332 GETFIELD0 
+    3333 OFFSETINT -1
+    3335 PUSHACC4 
+    3336 C_CALL1 ml_string_length
+    3338 MULINT 
+    3339 PUSHACC1 
+    3340 GETFIELD0 
+    3341 ADDINT 
+    3342 C_CALL1 create_string
+    3344 PUSHACC3 
+    3345 C_CALL1 ml_string_length
+    3347 PUSHCONST0 
+    3348 PUSHACC2 
+    3349 PUSHCONST0 
+    3350 PUSHACC7 
+    3351 C_CALL5 blit_string
+    3353 ACC3 
+    3354 C_CALL1 ml_string_length
+    3356 MAKEBLOCK1 0
+    3358 PUSHACC6 
+    3359 GETFIELD1 
+    3360 PUSHACC1 
+    3361 PUSHACC3 
+    3362 PUSHACC 8
+    3364 CLOSURE 3, 3256
+    3367 PUSHGETGLOBALFIELD List, 9
+    3370 APPLY2 
+    3371 ACC1 
+    3372 RETURN 7
+    3374 GETGLOBAL ""
+    3376 RETURN 2
+    3378 RESTART 
+    3379 GRAB 4
+    3381 CONST0 
+    3382 PUSHACC5 
+    3383 LTINT 
+    3384 BRANCHIF 3414
+    3386 CONST0 
+    3387 PUSHACC2 
+    3388 LTINT 
+    3389 BRANCHIF 3414
+    3391 ACC0 
+    3392 C_CALL1 ml_string_length
+    3394 PUSHACC5 
+    3395 PUSHACC3 
+    3396 ADDINT 
+    3397 GTINT 
+    3398 BRANCHIF 3414
+    3400 CONST0 
+    3401 PUSHACC4 
+    3402 LTINT 
+    3403 BRANCHIF 3414
+    3405 ACC2 
+    3406 C_CALL1 ml_string_length
+    3408 PUSHACC5 
+    3409 PUSHACC5 
+    3410 ADDINT 
+    3411 GTINT 
+    3412 BRANCHIFNOT 3421
+    3414 GETGLOBAL "String.blit"
+    3416 PUSHGETGLOBALFIELD Pervasives, 2
+    3419 APPTERM1 6
+    3421 ACC4 
+    3422 PUSHACC4 
+    3423 PUSHACC4 
+    3424 PUSHACC4 
+    3425 PUSHACC4 
+    3426 C_CALL5 blit_string
+    3428 RETURN 5
+    3430 RESTART 
+    3431 GRAB 3
+    3433 CONST0 
+    3434 PUSHACC2 
+    3435 LTINT 
+    3436 BRANCHIF 3452
+    3438 CONST0 
+    3439 PUSHACC3 
+    3440 LTINT 
+    3441 BRANCHIF 3452
+    3443 ACC0 
+    3444 C_CALL1 ml_string_length
+    3446 PUSHACC3 
+    3447 PUSHACC3 
+    3448 ADDINT 
+    3449 GTINT 
+    3450 BRANCHIFNOT 3459
+    3452 GETGLOBAL "String.fill"
+    3454 PUSHGETGLOBALFIELD Pervasives, 2
+    3457 APPTERM1 5
+    3459 ACC3 
+    3460 PUSHACC3 
+    3461 PUSHACC3 
+    3462 PUSHACC3 
+    3463 C_CALL4 fill_string
+    3465 RETURN 4
+    3467 RESTART 
+    3468 GRAB 2
+    3470 CONST0 
+    3471 PUSHACC2 
+    3472 LTINT 
+    3473 BRANCHIF 3489
+    3475 CONST0 
+    3476 PUSHACC3 
+    3477 LTINT 
+    3478 BRANCHIF 3489
+    3480 ACC0 
+    3481 C_CALL1 ml_string_length
+    3483 PUSHACC3 
+    3484 PUSHACC3 
+    3485 ADDINT 
+    3486 GTINT 
+    3487 BRANCHIFNOT 3496
+    3489 GETGLOBAL "String.sub"
+    3491 PUSHGETGLOBALFIELD Pervasives, 2
+    3494 APPTERM1 4
+    3496 ACC2 
+    3497 C_CALL1 create_string
+    3499 PUSHACC3 
+    3500 PUSHCONST0 
+    3501 PUSHACC2 
+    3502 PUSHACC5 
+    3503 PUSHACC5 
+    3504 C_CALL5 blit_string
+    3506 ACC0 
+    3507 RETURN 4
+    3509 ACC0 
+    3510 C_CALL1 ml_string_length
+    3512 PUSHACC0 
+    3513 C_CALL1 create_string
+    3515 PUSHACC1 
+    3516 PUSHCONST0 
+    3517 PUSHACC2 
+    3518 PUSHCONST0 
+    3519 PUSHACC6 
+    3520 C_CALL5 blit_string
+    3522 ACC0 
+    3523 RETURN 3
+    3525 RESTART 
+    3526 GRAB 1
+    3528 ACC0 
+    3529 C_CALL1 create_string
+    3531 PUSHACC2 
+    3532 PUSHACC2 
+    3533 PUSHCONST0 
+    3534 PUSHACC3 
+    3535 C_CALL4 fill_string
+    3537 ACC0 
+    3538 RETURN 3
+    3540 CLOSURE 0, 3526
+    3543 PUSH 
+    3544 CLOSURE 0, 3509
+    3547 PUSH 
+    3548 CLOSURE 0, 3468
+    3551 PUSH 
+    3552 CLOSURE 0, 3431
+    3555 PUSH 
+    3556 CLOSURE 0, 3379
+    3559 PUSH 
+    3560 CLOSURE 0, 3308
+    3563 PUSH 
+    3564 CLOSURE 0, 3013
+    3567 PUSH 
+    3568 CLOSURE 0, 2965
+    3571 PUSHACC0 
+    3572 CLOSURE 1, 2957
+    3575 PUSHACC1 
+    3576 CLOSURE 1, 2950
+    3579 PUSHACC 8
+    3581 CLOSURE 1, 2924
+    3584 PUSHACC0 
+    3585 CLOSURE 1, 2916
+    3588 PUSHACC1 
+    3589 CLOSURE 1, 2909
+    3592 PUSH 
+    3593 CLOSUREREC 0, 2651
+    3597 ACC0 
+    3598 CLOSURE 1, 2897
+    3601 PUSHACC1 
+    3602 CLOSURE 1, 2865
+    3605 PUSH 
+    3606 CLOSUREREC 0, 2684
+    3610 ACC0 
+    3611 CLOSURE 1, 2852
+    3614 PUSHACC1 
+    3615 CLOSURE 1, 2824
+    3618 PUSHACC5 
+    3619 CLOSURE 1, 2769
+    3622 PUSHACC3 
+    3623 CLOSURE 1, 2724
+    3626 PUSHACC1 
+    3627 CLOSURE 1, 2715
+    3630 PUSHACC 9
+    3632 PUSHACC 11
+    3634 PUSHACC 14
+    3636 PUSHACC 16
+    3638 PUSHACC5 
+    3639 PUSHACC7 
+    3640 PUSHACC6 
+    3641 PUSHACC 10
+    3643 PUSHACC 14
+    3645 PUSHACC 13
+    3647 PUSHACC 17
+    3649 PUSHACC 26
+    3651 PUSHACC 28
+    3653 PUSHACC 30
+    3655 PUSHACC 32
+    3657 PUSHACC 34
+    3659 PUSHACC 36
+    3661 PUSHACC 38
+    3663 MAKEBLOCK 18, 0
+    3666 POP 22
+    3668 SETGLOBAL String
+    3670 CONST0 
+    3671 C_CALL1 gc_stat
+    3673 GETGLOBAL ""
+    3675 PUSHCONSTINT 20
+    3677 C_CALL2 make_vect
+    3679 PUSHCONSTINT 20
+    3681 C_CALL1 weak_create
+    3683 PUSHCONST0 
+    3684 PUSHCONSTINT 19
+    3686 PUSH 
+    3687 BRANCH 3715
+    3689 CHECK_SIGNALS 
+    3690 CONSTINT 115
+    3692 PUSHCONSTINT 20
+    3694 PUSHGETGLOBALFIELD String, 0
+    3697 APPLY2 
+    3698 PUSHACC2 
+    3699 PUSHACC5 
+    3700 SETVECTITEM 
+    3701 ACC1 
+    3702 PUSHACC4 
+    3703 GETVECTITEM 
+    3704 MAKEBLOCK1 0
+    3706 PUSHACC2 
+    3707 PUSHACC4 
+    3708 C_CALL3 weak_set
+    3710 ACC1 
+    3711 OFFSETINT 1
+    3713 ASSIGN 1
+    3715 ACC0 
+    3716 PUSHACC2 
+    3717 LEINT 
+    3718 BRANCHIF 3689
+    3720 CONST0 
+    3721 POP 2
+    3723 CONST0 
+    3724 C_CALL1 gc_full_major
+    3726 CONST0 
+    3727 PUSHCONSTINT 19
+    3729 PUSH 
+    3730 BRANCH 3753
+    3732 CHECK_SIGNALS 
+    3733 ACC1 
+    3734 PUSHACC3 
+    3735 C_CALL2 weak_get
+    3737 PUSHACC0 
+    3738 BRANCHIF 3745
+    3740 GETGLOBAL Not_found
+    3742 MAKEBLOCK1 0
+    3744 RAISE 
+    3745 CONST0 
+    3746 POP 1
+    3748 ACC1 
+    3749 OFFSETINT 1
+    3751 ASSIGN 1
+    3753 ACC0 
+    3754 PUSHACC2 
+    3755 LEINT 
+    3756 BRANCHIF 3732
+    3758 CONST0 
+    3759 POP 2
+    3761 CONST0 
+    3762 PUSHCONSTINT 19
+    3764 PUSH 
+    3765 BRANCH 3785
+    3767 CHECK_SIGNALS 
+    3768 CONST0 
+    3769 PUSHCONST2 
+    3770 PUSHACC3 
+    3771 MODINT 
+    3772 EQ 
+    3773 BRANCHIFNOT 3780
+    3775 GETGLOBAL ""
+    3777 PUSHACC2 
+    3778 PUSHACC5 
+    3779 SETVECTITEM 
+    3780 ACC1 
+    3781 OFFSETINT 1
+    3783 ASSIGN 1
+    3785 ACC0 
+    3786 PUSHACC2 
+    3787 LEINT 
+    3788 BRANCHIF 3767
+    3790 CONST0 
+    3791 POP 2
+    3793 CONST0 
+    3794 C_CALL1 gc_full_major
+    3796 CONST0 
+    3797 PUSHCONSTINT 19
+    3799 PUSH 
+    3800 BRANCH 3854
+    3802 CHECK_SIGNALS 
+    3803 ACC1 
+    3804 PUSHACC3 
+    3805 C_CALL2 weak_get
+    3807 PUSHACC0 
+    3808 BRANCHIFNOT 3832
+    3810 CONST1 
+    3811 PUSHCONST2 
+    3812 PUSHACC4 
+    3813 MODINT 
+    3814 EQ 
+    3815 BRANCHIFNOT 3842
+    3817 CONSTINT 115
+    3819 PUSHCONSTINT 5
+    3821 PUSHACC2 
+    3822 GETFIELD0 
+    3823 GETSTRINGCHAR 
+    3824 NEQ 
+    3825 BRANCHIFNOT 3847
+    3827 GETGLOBAL Not_found
+    3829 MAKEBLOCK1 0
+    3831 RAISE 
+    3832 CONST0 
+    3833 PUSHCONST2 
+    3834 PUSHACC4 
+    3835 MODINT 
+    3836 EQ 
+    3837 BRANCHIFNOT 3842
+    3839 CONST0 
+    3840 BRANCH 3847
+    3842 GETGLOBAL Not_found
+    3844 MAKEBLOCK1 0
+    3846 RAISE 
+    3847 POP 1
+    3849 ACC1 
+    3850 OFFSETINT 1
+    3852 ASSIGN 1
+    3854 ACC0 
+    3855 PUSHACC2 
+    3856 LEINT 
+    3857 BRANCHIF 3802
+    3859 CONST0 
+    3860 POP 4
+    3862 ATOM0 
+    3863 SETGLOBAL T350-heapcheck
+    3865 STOP 
+**)
diff --git a/test/testinterp/t360-stacks-1.ml b/test/testinterp/t360-stacks-1.ml
new file mode 100644 (file)
index 0000000..100fbab
--- /dev/null
@@ -0,0 +1,43 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then 12
+  else 1 + f (n-1)
+in
+if f 30000 <> 30012 then raise Not_found
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 29
+      11 CONST0 
+      12 PUSHACC1 
+      13 LEINT 
+      14 BRANCHIFNOT 20
+      16 CONSTINT 12
+      18 RETURN 1
+      20 ACC0 
+      21 OFFSETINT -1
+      23 PUSHOFFSETCLOSURE0 
+      24 APPLY1 
+      25 PUSHCONST1 
+      26 ADDINT 
+      27 RETURN 1
+      29 CLOSUREREC 0, 11
+      33 CONSTINT 30012
+      35 PUSHCONSTINT 30000
+      37 PUSHACC2 
+      38 APPLY1 
+      39 NEQ 
+      40 BRANCHIFNOT 47
+      42 GETGLOBAL Not_found
+      44 MAKEBLOCK1 0
+      46 RAISE 
+      47 POP 1
+      49 ATOM0 
+      50 SETGLOBAL T360-stacks-1
+      52 STOP 
+**)
diff --git a/test/testinterp/t360-stacks-2.ml b/test/testinterp/t360-stacks-2.ml
new file mode 100644 (file)
index 0000000..8d13c7d
--- /dev/null
@@ -0,0 +1,54 @@
+open Lib;;
+let rec f n =
+  if n <= 0 then 12
+  else 1 + f (n-1)
+in
+try
+  ignore (f 3000000);
+  raise Not_found
+with Stack_overflow -> ()
+;;
+
+(**
+       0 CONSTINT 42
+       2 PUSHACC0 
+       3 MAKEBLOCK1 0
+       5 POP 1
+       7 SETGLOBAL Lib
+       9 BRANCH 29
+      11 CONST0 
+      12 PUSHACC1 
+      13 LEINT 
+      14 BRANCHIFNOT 20
+      16 CONSTINT 12
+      18 RETURN 1
+      20 ACC0 
+      21 OFFSETINT -1
+      23 PUSHOFFSETCLOSURE0 
+      24 APPLY1 
+      25 PUSHCONST1 
+      26 ADDINT 
+      27 RETURN 1
+      29 CLOSUREREC 0, 11
+      33 PUSHTRAP 44
+      35 CONSTINT 3000000
+      37 PUSHACC5 
+      38 APPLY1 
+      39 GETGLOBAL Not_found
+      41 MAKEBLOCK1 0
+      43 RAISE 
+      44 PUSHGETGLOBAL Stack_overflow
+      46 PUSHACC1 
+      47 GETFIELD0 
+      48 EQ 
+      49 BRANCHIFNOT 54
+      51 CONST0 
+      52 BRANCH 56
+      54 ACC0 
+      55 RAISE 
+      56 POP 1
+      58 POP 1
+      60 ATOM0 
+      61 SETGLOBAL T360-stacks-2
+      63 STOP 
+**)
diff --git a/testasmcomp/.cvsignore b/testasmcomp/.cvsignore
new file mode 100644 (file)
index 0000000..76174b5
--- /dev/null
@@ -0,0 +1,5 @@
+codegen
+parsecmm.ml
+parsecmm.mli
+lexcmm.ml
+*.out
diff --git a/testasmcomp/.depend b/testasmcomp/.depend
new file mode 100644 (file)
index 0000000..282114b
--- /dev/null
@@ -0,0 +1,17 @@
+lexcmm.cmi: parsecmm.cmi 
+parsecmm.cmi: ../asmcomp/cmm.cmi 
+parsecmmaux.cmi: ../typing/ident.cmi 
+lexcmm.cmo: ../utils/misc.cmi parsecmm.cmi lexcmm.cmi 
+lexcmm.cmx: ../utils/misc.cmx parsecmm.cmx lexcmm.cmi 
+main.cmo: ../asmcomp/asmgen.cmi ../utils/clflags.cmo ../asmcomp/compilenv.cmi \
+    ../asmcomp/emit.cmi lexcmm.cmi parsecmm.cmi parsecmmaux.cmi \
+    ../asmcomp/printmach.cmi 
+main.cmx: ../asmcomp/asmgen.cmx ../utils/clflags.cmx ../asmcomp/compilenv.cmx \
+    ../asmcomp/emit.cmx lexcmm.cmx parsecmm.cmx parsecmmaux.cmx \
+    ../asmcomp/printmach.cmx 
+parsecmm.cmo: ../asmcomp/arch.cmo ../asmcomp/cmm.cmi ../utils/misc.cmi \
+    parsecmmaux.cmi parsecmm.cmi 
+parsecmm.cmx: ../asmcomp/arch.cmx ../asmcomp/cmm.cmx ../utils/misc.cmx \
+    parsecmmaux.cmx parsecmm.cmi 
+parsecmmaux.cmo: ../typing/ident.cmi parsecmmaux.cmi 
+parsecmmaux.cmx: ../typing/ident.cmx parsecmmaux.cmi 
diff --git a/testasmcomp/Makefile b/testasmcomp/Makefile
new file mode 100644 (file)
index 0000000..28fc7cc
--- /dev/null
@@ -0,0 +1,159 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the Q Public License version 1.0.                #
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.33 2003/06/30 08:28:46 xleroy Exp $
+
+include ../config/Makefile
+
+CAMLC=../boot/ocamlrun ../boot/ocamlc -I ../boot
+COMPFLAGS=$(INCLUDES) -g
+LINKFLAGS=-g
+CAMLYACC=../boot/ocamlyacc
+YACCFLAGS=
+CAMLLEX=../boot/ocamlrun ../boot/ocamllex
+CAMLDEP=../boot/ocamlrun ../tools/ocamldep
+DEPFLAGS=$(INCLUDES)
+CAMLRUN=../boot/ocamlrun
+
+CODEGEN=./codegen
+CC=$(NATIVECC)
+CFLAGS=$(NATIVECCCOMPOPTS) -g
+
+PROGS=fib.out tak.out quicksort.out quicksort2.out soli.out integr.out \
+      arith.out checkbound.out
+
+all: codegen $(PROGS)
+
+INCLUDES=-I ../utils -I ../typing -I ../asmcomp
+
+OTHEROBJS=../utils/misc.cmo ../utils/config.cmo ../utils/tbl.cmo \
+  ../utils/clflags.cmo ../utils/ccomp.cmo \
+  ../utils/config.cmo ../utils/clflags.cmo ../utils/warnings.cmo \
+  ../utils/consistbl.cmo \
+  ../parsing/linenum.cmo ../parsing/location.cmo \
+  ../typing/ident.cmo ../typing/path.cmo ../typing/types.cmo \
+  ../typing/btype.cmo ../typing/subst.cmo ../typing/primitive.cmo \
+  ../typing/predef.cmo ../typing/datarepr.cmo ../typing/env.cmo \
+  ../bytecomp/lambda.cmo ../bytecomp/switch.cmo \
+  ../asmcomp/arch.cmo ../asmcomp/cmm.cmo ../asmcomp/printcmm.cmo \
+  ../asmcomp/clambda.cmo ../asmcomp/compilenv.cmo \
+  ../asmcomp/reg.cmo ../asmcomp/mach.cmo ../asmcomp/proc.cmo \
+  ../asmcomp/closure.cmo ../asmcomp/cmmgen.cmo \
+  ../asmcomp/printmach.cmo \
+  ../asmcomp/selectgen.cmo ../asmcomp/selection.cmo ../asmcomp/comballoc.cmo \
+  ../asmcomp/liveness.cmo ../asmcomp/spill.cmo ../asmcomp/split.cmo \
+  ../asmcomp/interf.cmo ../asmcomp/coloring.cmo \
+  ../asmcomp/reloadgen.cmo ../asmcomp/reload.cmo \
+  ../asmcomp/linearize.cmo ../asmcomp/schedgen.cmo ../asmcomp/scheduling.cmo \
+  ../asmcomp/printlinear.cmo ../asmcomp/emitaux.cmo \
+  ../asmcomp/emit.cmo ../asmcomp/asmgen.cmo
+
+OBJS=parsecmmaux.cmo parsecmm.cmo lexcmm.cmo main.cmo
+
+codegen: $(OTHEROBJS) $(OBJS)
+       $(CAMLC) $(LINKFLAGS) -o codegen $(OTHEROBJS) $(OBJS)
+clean::
+       rm -f codegen
+
+# The parser
+
+parsecmm.mli parsecmm.ml: parsecmm.mly
+       $(CAMLYACC) $(YACCFLAGS) parsecmm.mly
+
+clean::
+       rm -f parsecmm.mli parsecmm.ml parsecmm.output
+
+beforedepend:: parsecmm.mli parsecmm.ml
+
+# The lexer
+
+lexcmm.ml: lexcmm.mll
+       $(CAMLLEX) lexcmm.mll
+
+clean::
+       rm -f lexcmm.ml
+
+beforedepend:: lexcmm.ml
+
+# The test programs
+
+$(PROGS:.out=.o): codegen
+
+fib.out: main.c fib.o $(ARCH).o
+       $(CC) $(CFLAGS) -o fib.out -DINT_INT -DFUN=fib main.c fib.o $(ARCH).o
+
+tak.out: main.c tak.o $(ARCH).o
+       $(CC) $(CFLAGS) -o tak.out -DUNIT_INT -DFUN=takmain main.c tak.o $(ARCH).o
+
+quicksort.out: main.c quicksort.o $(ARCH).o
+       $(CC) $(CFLAGS) -o quicksort.out -DSORT -DFUN=quicksort main.c quicksort.o $(ARCH).o
+
+quicksort2.out: main.c quicksort2.o $(ARCH).o
+       $(CC) $(CFLAGS) -o quicksort2.out -DSORT -DFUN=quicksort main.c quicksort2.o $(ARCH).o
+
+soli.out: main.c soli.o $(ARCH).o
+       $(CC) $(CFLAGS) -o soli.out -DUNIT_INT -DFUN=solitaire main.c soli.o $(ARCH).o
+
+integr.out: main.c integr.o $(ARCH).o
+       $(CC) $(CFLAGS) -o integr.out -DINT_FLOAT -DFUN=test main.c integr.o $(ARCH).o
+
+tagged-fib.out: main.c tagged-fib.o $(ARCH).o
+       $(CC) $(CFLAGS) -o tagged-fib.out -DINT_INT -DFUN=fib main.c tagged-fib.o $(ARCH).o
+
+tagged-tak.out: main.c tagged-tak.o $(ARCH).o
+       $(CC) $(CFLAGS) -o tagged-tak.out -DUNIT_INT -DFUN=takmain main.c tagged-tak.o $(ARCH).o
+
+tagged-quicksort.out: main.c tagged-quicksort.o $(ARCH).o
+       $(CC) $(CFLAGS) -o tagged-quicksort.out -DSORT -DFUN=quicksort main.c tagged-quicksort.o $(ARCH).o
+
+tagged-integr.out: main.c tagged-integr.o $(ARCH).o
+       $(CC) $(CFLAGS) -o tagged-integr.out -DINT_FLOAT -DFUN=test main.c tagged-integr.o $(ARCH).o
+
+arith.out: mainarith.c arith.o $(ARCH).o
+       $(CC) $(CFLAGS) -o arith.out mainarith.c arith.o $(ARCH).o
+
+checkbound.out: main.c checkbound.o $(ARCH).o
+       $(CC) $(CFLAGS) -o checkbound.out -DCHECKBOUND main.c checkbound.o $(ARCH).o
+
+# The runtime environment
+
+power.o: power-$(SYSTEM).o
+       cp power-$(SYSTEM).o power.o
+
+.SUFFIXES:
+.SUFFIXES: .cmm .c .o .S .ml .mli .cmo .cmi .s
+
+.ml.cmo:
+       $(CAMLC) $(COMPFLAGS) -c $<
+
+.mli.cmi:
+       $(CAMLC) $(COMPFLAGS) -c $<
+
+.cmm.o:
+       $(CAMLRUN) $(CODEGEN) $*.cmm > $*.s
+       $(AS) $(ASFLAGS) -o $*.o $*.s
+
+.S.o:
+       $(ASPP) $(ASPPFLAGS) -o $*.o $*.S
+
+.s.o:
+       $(ASPP) $(ASPPFLAGS) -o $*.o $*.s
+
+clean::
+       rm -f *.out *.cm[io] *.s *.o *~
+
+$(PROGS:.out=.o): $(CODEGEN)
+
+depend: beforedepend
+       $(CAMLDEP) $(DEPFLAGS) *.mli *.ml > .depend
+
+include .depend
diff --git a/testasmcomp/alpha.S b/testasmcomp/alpha.S
new file mode 100644 (file)
index 0000000..bb7a959
--- /dev/null
@@ -0,0 +1,62 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: alpha.S,v 1.4 1999/11/29 19:04:18 doligez Exp $ */
+
+        .globl  call_gen_code
+        .ent    call_gen_code
+
+call_gen_code:
+        lda     $sp, -80($sp)
+        stq     $26, 0($sp)
+        stq     $9, 8($sp)
+        stq     $10, 16($sp)
+        stq     $11, 24($sp)
+        stq     $12, 32($sp)
+        stt     $f2, 40($sp)
+        stt     $f3, 48($sp)
+        stt     $f4, 56($sp)
+        stt     $f5, 64($sp)
+        mov     $16, $27
+        mov     $17, $16
+        mov     $18, $17
+        mov     $19, $18
+        mov     $20, $19
+        jsr     ($27)
+        ldq     $26, 0($sp)
+        ldq     $9, 8($sp)
+        ldq     $10, 16($sp)
+        ldq     $11, 24($sp)
+        ldq     $12, 32($sp)
+        ldt     $f2, 40($sp)
+        ldt     $f3, 48($sp)
+        ldt     $f4, 56($sp)
+        ldt     $f5, 64($sp)
+        lda     $sp, 80($sp)
+        ret     ($26)
+
+        .end    call_gen_code
+
+        .globl  caml_c_call
+        .ent    caml_c_call
+caml_c_call:
+        lda     $sp, -16($sp)
+        stq     $26, 0($sp)
+        stq     $gp, 8($sp)
+        mov     $25, $27
+        jsr     ($25)
+        ldq     $26, 0($sp)
+        ldq     $gp, 8($sp)
+        lda     $sp, 16($sp)
+        ret     ($26)
+
+        .end    caml_c_call
diff --git a/testasmcomp/amd64.S b/testasmcomp/amd64.S
new file mode 100644 (file)
index 0000000..e4f943c
--- /dev/null
@@ -0,0 +1,53 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 2000 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: amd64.S,v 1.1 2003/06/30 08:28:46 xleroy Exp $ */
+
+        .globl  call_gen_code
+        .align  16
+call_gen_code:
+        pushq   %rbx
+        pushq   %rbp
+        pushq   %r12
+        pushq   %r13
+        pushq   %r14
+        pushq   %r15
+       movq    %rdi, %r10
+       movq    %rsi, %rax
+       movq    %rdx, %rbx
+       movq    %rcx, %rdi
+       movq    %r8, %rsi
+        call   *%r10
+        popq    %r15
+        popq    %r14
+        popq    %r13
+        popq    %r12
+        popq    %rbp
+        popq    %rbx
+        ret
+
+        .globl  caml_c_call
+        .align  16
+caml_c_call:
+        jmp     *%rax
+
+       .section        .rodata.cst8,"aM",@progbits,8
+        .globl  caml_negf_mask
+        .align  16
+caml_negf_mask:
+       .quad   0x8000000000000000, 0
+        .globl  caml_absf_mask
+        .align  16
+caml_absf_mask:
+       .quad   0x7FFFFFFFFFFFFFFF, 0
+
+        .comm   young_limit, 8
diff --git a/testasmcomp/arith.cmm b/testasmcomp/arith.cmm
new file mode 100644 (file)
index 0000000..442b658
--- /dev/null
@@ -0,0 +1,222 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: arith.cmm,v 1.9 2000/06/29 11:45:23 xleroy Exp $ *)
+
+(* Regression test for arithmetic instructions *)
+
+(function "testarith" ()
+   (let r "R"
+   (let d "D"
+   (let x (load int "X")
+   (let y (load int "Y")
+   (let f (load float "F")
+   (let g (load float "G")
+      (addraset r 0 0)
+      (addraset r 1 1)
+      (addraset r 2 -1)
+      (addraset r 3 256)
+      (addraset r 4 65536)
+      (addraset r 5 16777216)
+      (addraset r 6 -256)
+      (addraset r 7 -65536)
+      (addraset r 8 -16777216)
+
+      (addraset r 9 (+ x y))
+      (addraset r 10 (+ x 1))
+      (addraset r 11 (+ x -1))
+
+      (addraset r 12 (+a "R" 8))
+      (addraset r 13 (+a "R" y))
+
+      (addraset r 14 (- x y))
+      (addraset r 15 (- x 1))
+      (addraset r 16 (- x -1))
+
+      (addraset r 17 (-a "R" 8))
+      (addraset r 18 (-a "R" y))
+
+      (addraset r 19 ( * x 2))
+      (addraset r 20 ( * 2 x))
+      (addraset r 21 ( * x 16))
+      (addraset r 22 ( * 16 x))
+      (addraset r 23 ( * x 12345))
+      (addraset r 24 ( * 12345 x))
+      (addraset r 25 ( * x y))
+
+      (addraset r 26 (/ x 2))
+      (addraset r 27 (/ x 16))
+      (addraset r 28 (/ x 7))
+      (addraset r 29 (if (!= y 0) (/ x y) 0))
+
+      (addraset r 30 (mod x 2))
+      (addraset r 31 (mod x 16))
+      (addraset r 32 (if (!= y 0) (mod x y) 0))
+
+      (addraset r 33 (and x y))
+      (addraset r 34 (and x 3))
+      (addraset r 35 (and 3 x))
+
+      (addraset r 36 (or x y))
+      (addraset r 37 (or x 3))
+      (addraset r 38 (or 3 x))
+
+      (addraset r 39 (xor x y))
+      (addraset r 40 (xor x 3))
+      (addraset r 41 (xor 3 x))
+
+      (addraset r 42 (<< x y))
+      (addraset r 43 (<< x 1))
+      (addraset r 44 (<< x 8))
+
+      (addraset r 45 (>>u x y))
+      (addraset r 46 (>>u x 1))
+      (addraset r 47 (>>u x 8))
+
+      (addraset r 48 (>>s x y))
+      (addraset r 49 (>>s x 1))
+      (addraset r 50 (>>s x 8))
+
+      (addraset r 51 (== x y))
+      (addraset r 52 (!= x y))
+      (addraset r 53 (< x y))
+      (addraset r 54 (> x y))
+      (addraset r 55 (<= x y))
+      (addraset r 56 (>= x y))
+      (addraset r 57 (== x 1))
+      (addraset r 58 (!= x 1))
+      (addraset r 59 (< x 1))
+      (addraset r 60 (> x 1))
+      (addraset r 61 (<= x 1))
+      (addraset r 62 (>= x 1))
+
+      (addraset r 63 (==a x y))
+      (addraset r 64 (!=a x y))
+      (addraset r 65 (<a x y))
+      (addraset r 66 (>a x y))
+      (addraset r 67 (<=a x y))
+      (addraset r 68 (>=a x y))
+      (addraset r 69 (==a x 1))
+      (addraset r 70 (!=a x 1))
+      (addraset r 71 (<a x 1))
+      (addraset r 72 (>a x 1))
+      (addraset r 73 (<=a x 1))
+      (addraset r 74 (>=a x 1))
+
+      (addraset r 75 (+ x (<< y 1)))
+      (addraset r 76 (+ x (<< y 2)))
+      (addraset r 77 (+ x (<< y 3)))
+      (addraset r 78 (- x (<< y 1)))
+      (addraset r 79 (- x (<< y 2)))
+      (addraset r 80 (- x (<< y 3)))
+
+      (floataset d 0 0.0)
+      (floataset d 1 1.0)
+      (floataset d 2 -1.0)
+      (floataset d 3 (+f f g))
+      (floataset d 4 (-f f g))
+      (floataset d 5 ( *f f g))
+      (floataset d 6 (/f f g))
+
+      (floataset d 7 (+f f (+f g 1.0)))
+      (floataset d 8 (-f f (+f g 1.0)))
+      (floataset d 9 ( *f f (+f g 1.0)))
+      (floataset d 10 (/f f (+f g 1.0)))
+
+      (floataset d 11 (+f (+f f 1.0) g))
+      (floataset d 12 (-f (+f f 1.0) g))
+      (floataset d 13 ( *f (+f f 1.0) g))
+      (floataset d 14 (/f (+f f 1.0) g))
+
+      (floataset d 15 (+f (+f f 1.0) (+f g 1.0)))
+      (floataset d 16 (-f (+f f 1.0) (+f g 1.0)))
+      (floataset d 17 ( *f (+f f 1.0) (+f g 1.0)))
+      (floataset d 18 (/f (+f f 1.0) (+f g 1.0)))
+
+      (addraset r 81 (==f f g))
+      (addraset r 82 (!=f f g))
+      (addraset r 83 (<f f g))
+      (addraset r 84 (>f f g))
+      (addraset r 85 (<=f f g))
+      (addraset r 86 (>=f f g))
+
+      (floataset d 19 (floatofint x))
+      (addraset r 87 (intoffloat f))
+
+      (if (and (>= x 0) (< x y))
+          (seq (checkbound y x) (addraset r 88 1))
+        (addraset r 88 0))
+
+      (if (< 0 y)
+          (seq (checkbound y 0) (addraset r 89 1))
+        (addraset r 89 0))
+
+      (if (< 5 y)
+          (seq (checkbound y 5) (addraset r 90 1))
+        (addraset r 90 0))
+
+      (addraset r 91 (let res 1 (if (==f f g) [] (assign res 0)) res))
+      (addraset r 92 (let res 1 (if (!=f f g) [] (assign res 0)) res))
+      (addraset r 93 (let res 1 (if (<f f g) [] (assign res 0)) res))
+      (addraset r 94 (let res 1 (if (>f f g) [] (assign res 0)) res))
+      (addraset r 95 (let res 1 (if (<=f f g) [] (assign res 0)) res))
+      (addraset r 96 (let res 1 (if (>=f f g) [] (assign res 0)) res))
+
+      (addraset r 97 (==f (+f f 1.0) (+f g 1.0)))
+      (addraset r 98 (!=f (+f f 1.0) (+f g 1.0)))
+      (addraset r 99 (<f (+f f 1.0) (+f g 1.0)))
+      (addraset r 100 (>f (+f f 1.0) (+f g 1.0)))
+      (addraset r 101 (<=f (+f f 1.0) (+f g 1.0)))
+      (addraset r 102 (>=f (+f f 1.0) (+f g 1.0)))
+
+      (addraset r 103 (==f f (+f g 1.0)))
+      (addraset r 104 (!=f f (+f g 1.0)))
+      (addraset r 105 (<f f (+f g 1.0)))
+      (addraset r 106 (>f f (+f g 1.0)))
+      (addraset r 107 (<=f f (+f g 1.0)))
+      (addraset r 108 (>=f f (+f g 1.0)))
+
+      (addraset r 109 (==f (+f f 1.0) g))
+      (addraset r 110 (!=f (+f f 1.0) g))
+      (addraset r 111 (<f (+f f 1.0) g))
+      (addraset r 112 (>f (+f f 1.0) g))
+      (addraset r 113 (<=f (+f f 1.0) g))
+      (addraset r 114 (>=f (+f f 1.0) g))
+
+      (floataset d 20 (+f (floatofint x) 1.0))
+      (addraset r 115 (intoffloat (+f f 1.0)))
+
+      (floataset d 21 (+f f (load float "G")))
+      (floataset d 22 (+f (load float "G") f))
+      (floataset d 23 (-f f (load float "G")))
+      (floataset d 24 (-f (load float "G") f))
+      (floataset d 25 ( *f f (load float "G")))
+      (floataset d 26 ( *f (load float "G") f))
+      (floataset d 27 (/f f (load float "G")))
+      (floataset d 28 (/f (load float "G") f))
+
+      (floataset d 29 (+f ( *f f 2.0) (load float "G")))
+      (floataset d 30 (+f (load float "G") ( *f f 2.0)))
+      (floataset d 31 (-f ( *f f 2.0) (load float "G")))
+      (floataset d 32 (-f (load float "G") ( *f f 2.0)))
+      (floataset d 33 ( *f ( +f f 2.0) (load float "G")))
+      (floataset d 34 ( *f (load float "G") ( +f f 2.0)))
+      (floataset d 35 (/f ( *f f 2.0) (load float "G")))
+      (floataset d 36 (/f (load float "G") ( *f f 2.0)))
+
+      (floataset d 37 (-f f))
+      (floataset d 38 (absf f))
+
+)))))))
+
+
+
diff --git a/testasmcomp/arm.S b/testasmcomp/arm.S
new file mode 100644 (file)
index 0000000..271b034
--- /dev/null
@@ -0,0 +1,45 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1998 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: arm.S,v 1.3 2000/01/07 16:44:17 doligez Exp $ */
+
+fp      .req    r11
+ip      .req    r12
+sp      .req    r13
+lr      .req    r14
+pc      .req    r15
+
+        .text
+
+        .global call_gen_code
+        .type   call_gen_code, %function
+        .align  0
+call_gen_code:
+        mov     ip, sp
+        stmfd   sp!, {r4, r5, r6, r7, r8, r9, fp, ip, lr, pc}
+        sub     fp, ip, #4
+    @ r0 is function to call
+    @ r1, r2, r3 are arguments 1, 2, 3
+        mov     r4, r0
+        mov     r0, r1
+        mov     r1, r2
+        mov     r2, r3
+        mov     lr, pc
+        mov     pc, r4
+        ldmea   fp, {r4, r5, r6, r7, r8, r9, fp, sp, pc}
+
+        .global caml_c_call
+        .type   caml_c_call, %function
+        .align  0
+caml_c_call:
+    @ function to call is in r10
+        mov     pc, r10
diff --git a/testasmcomp/checkbound.cmm b/testasmcomp/checkbound.cmm
new file mode 100644 (file)
index 0000000..ed82306
--- /dev/null
@@ -0,0 +1,21 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: checkbound.cmm,v 1.3 1999/11/17 18:58:41 xleroy Exp $ *)
+
+(function "checkbound2" (x: int y: int)
+  (checkbound x y))
+
+(function "checkbound1" (x: int)
+  (checkbound x 2))
+
+
diff --git a/testasmcomp/fib.cmm b/testasmcomp/fib.cmm
new file mode 100644 (file)
index 0000000..0a7b1da
--- /dev/null
@@ -0,0 +1,19 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: fib.cmm,v 1.4 1999/11/17 18:58:41 xleroy Exp $ *)
+
+(function "fib" (n: int)
+  (if (< n 2)
+      1
+    (+ (app "fib" (- n 1) int)
+       (app "fib" (- n 2) int))))
diff --git a/testasmcomp/hppa.S b/testasmcomp/hppa.S
new file mode 100644 (file)
index 0000000..6a5ce92
--- /dev/null
@@ -0,0 +1,162 @@
+;*********************************************************************
+;*                                                                   *
+;*                          Objective Caml                           *
+;*                                                                   *
+;*           Xavier Leroy, projet Cristal, INRIA Rocquencourt        *
+;*                                                                   *
+;* Copyright 1996 Institut National de Recherche en Informatique et  *
+;* en Automatique.  All rights reserved.  This file is distributed   *
+;* under the terms of the Q Public License version 1.0.              *
+;*                                                                   *
+;*********************************************************************
+
+; $Id: hppa.S,v 1.3 1999/11/17 18:58:41 xleroy Exp $
+; Must be preprocessed by cpp
+
+#ifdef SYS_hpux
+#define G(x) x
+#define CODESPACE .code
+#define CODE_ALIGN 4
+#define EXPORT_CODE(x) .export x, entry, priv_lev=3
+#define STARTPROC .proc ! .callinfo frame=0, no_calls ! .entry
+#define ENDPROC .exit ! .procend
+#endif
+
+#ifdef SYS_nextstep
+#define G(x) _##x
+#define CODESPACE .text
+#define CODE_ALIGN 2
+#define EXPORT_CODE(x) .globl x
+#define STARTPROC
+#define ENDPROC
+#endif
+
+#ifdef SYS_hpux
+       .space $PRIVATE$
+       .subspa $DATA$,quad=1,align=8,access=31
+       .subspa $BSS$,quad=1,align=8,access=31,zero,sort=82
+       .space $TEXT$
+       .subspa $LIT$,quad=0,align=8,access=44
+       .subspa $CODE$,quad=0,align=8,access=44,code_only
+       .import $global$, data
+        .import $$dyncall, millicode
+#endif
+
+        CODESPACE
+        .align  CODE_ALIGN
+        EXPORT_CODE(G(call_gen_code))
+G(call_gen_code):
+        STARTPROC
+       stw     %r2,-20(%r30)
+        ldo    256(%r30), %r30
+; Save the callee-save registers
+        ldo     -32(%r30), %r1
+        stws,ma %r3, -4(%r1)
+        stws,ma %r4, -4(%r1)
+        stws,ma %r5, -4(%r1)
+        stws,ma %r6, -4(%r1)
+        stws,ma %r7, -4(%r1)
+        stws,ma %r8, -4(%r1)
+        stws,ma %r9, -4(%r1)
+        stws,ma %r10, -4(%r1)
+        stws,ma %r11, -4(%r1)
+        stws,ma %r12, -4(%r1)
+        stws,ma %r13, -4(%r1)
+        stws,ma %r14, -4(%r1)
+        stws,ma %r15, -4(%r1)
+        stws,ma %r16, -4(%r1)
+        stws,ma %r17, -4(%r1)
+        stws,ma %r18, -4(%r1)
+       fstds,ma %fr12, -8(%r1)
+       fstds,ma %fr13, -8(%r1)
+       fstds,ma %fr14, -8(%r1)
+       fstds,ma %fr15, -8(%r1)
+       fstds,ma %fr16, -8(%r1)
+       fstds,ma %fr17, -8(%r1)
+       fstds,ma %fr18, -8(%r1)
+       fstds,ma %fr19, -8(%r1)
+       fstds,ma %fr20, -8(%r1)
+       fstds,ma %fr21, -8(%r1)
+       fstds,ma %fr22, -8(%r1)
+       fstds,ma %fr23, -8(%r1)
+       fstds,ma %fr24, -8(%r1)
+       fstds,ma %fr25, -8(%r1)
+       fstds,ma %fr26, -8(%r1)
+       fstds,ma %fr27, -8(%r1)
+       fstds,ma %fr28, -8(%r1)
+       fstds,ma %fr29, -8(%r1)
+       fstds,ma %fr30, -8(%r1)
+       fstds,ma %fr31, -8(%r1)
+
+; Shuffle the arguments and call
+        copy    %r26, %r22
+        copy    %r25, %r26
+        copy    %r24, %r25
+        copy    %r23, %r24
+        fcpy,dbl %fr5, %fr4
+#ifdef SYS_hpux
+        bl      $$dyncall, %r2
+        nop
+#else
+        ble     0(4, %r22)
+        copy    %r31, %r2
+#endif
+; Shuffle the results
+        copy    %r26, %r28
+; Restore the callee-save registers
+        ldo     -32(%r30), %r1
+        ldws,ma -4(%r1), %r3
+        ldws,ma -4(%r1), %r4
+        ldws,ma -4(%r1), %r5
+        ldws,ma -4(%r1), %r6
+        ldws,ma -4(%r1), %r7
+        ldws,ma -4(%r1), %r8
+        ldws,ma -4(%r1), %r9
+        ldws,ma -4(%r1), %r10
+        ldws,ma -4(%r1), %r11
+        ldws,ma -4(%r1), %r12
+        ldws,ma -4(%r1), %r13
+        ldws,ma -4(%r1), %r14
+        ldws,ma -4(%r1), %r15
+        ldws,ma -4(%r1), %r16
+        ldws,ma -4(%r1), %r17
+        ldws,ma -4(%r1), %r18
+       fldds,ma -8(%r1), %fr12
+       fldds,ma -8(%r1), %fr13
+       fldds,ma -8(%r1), %fr14
+       fldds,ma -8(%r1), %fr15
+       fldds,ma -8(%r1), %fr16
+       fldds,ma -8(%r1), %fr17
+       fldds,ma -8(%r1), %fr18
+       fldds,ma -8(%r1), %fr19
+       fldds,ma -8(%r1), %fr20
+       fldds,ma -8(%r1), %fr21
+       fldds,ma -8(%r1), %fr22
+       fldds,ma -8(%r1), %fr23
+       fldds,ma -8(%r1), %fr24
+       fldds,ma -8(%r1), %fr25
+       fldds,ma -8(%r1), %fr26
+       fldds,ma -8(%r1), %fr27
+       fldds,ma -8(%r1), %fr28
+       fldds,ma -8(%r1), %fr29
+       fldds,ma -8(%r1), %fr30
+       fldds,ma -8(%r1), %fr31
+
+        ldo    -256(%r30), %r30
+       ldw     -20(%r30), %r2
+        bv      0(%r2)
+        nop
+        ENDPROC
+
+       .align  CODE_ALIGN
+       EXPORT_CODE(caml_c_call)
+G(caml_c_call):
+        STARTPROC
+#ifdef SYS_hpux
+        bl $$dyncall, %r0
+        nop
+#else
+        bv     0(%r22)
+        nop
+#endif
+        ENDPROC
diff --git a/testasmcomp/i386.S b/testasmcomp/i386.S
new file mode 100644 (file)
index 0000000..c38c180
--- /dev/null
@@ -0,0 +1,56 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: i386.S,v 1.5 1999/11/17 18:58:41 xleroy Exp $ */
+
+/* Linux with ELF binaries does not prefix identifiers with _.
+   Linux with a.out binaries, FreeBSD, and NextStep do. */
+
+#ifdef SYS_linux_elf
+#define G(x) x
+#define FUNCTION_ALIGN 16
+#else
+#define G(x) _##x
+#define FUNCTION_ALIGN 4
+#endif
+
+        .globl  G(call_gen_code)
+        .align  FUNCTION_ALIGN
+G(call_gen_code):
+        pushl %ebp
+        movl %esp,%ebp
+        pushl %ebx
+        pushl %esi
+        pushl %edi
+        movl 12(%ebp),%eax
+        movl 16(%ebp),%ebx
+        movl 20(%ebp),%ecx
+        movl 24(%ebp),%edx
+        call *8(%ebp)
+        popl %edi
+        popl %esi
+        popl %ebx
+        popl %ebp
+        ret
+
+        .globl  G(caml_c_call)
+        .align  FUNCTION_ALIGN
+G(caml_c_call):
+        ffree   %st(0)
+        ffree   %st(1)
+        ffree   %st(2)
+        ffree   %st(3)
+        jmp     *%eax
+
+        .comm   G(caml_exception_pointer), 4
+        .comm   G(young_ptr), 4
+        .comm   G(young_start), 4
diff --git a/testasmcomp/i386nt.asm b/testasmcomp/i386nt.asm
new file mode 100644 (file)
index 0000000..72eb374
--- /dev/null
@@ -0,0 +1,67 @@
+;*********************************************************************
+;                                                                     
+;                           Objective Caml                            
+;                                                                     
+;            Xavier Leroy, projet Cristal, INRIA Rocquencourt         
+;                                                                     
+;  Copyright 1996 Institut National de Recherche en Informatique et   
+;  en Automatique.  All rights reserved.  This file is distributed    
+;  under the terms of the Q Public License version 1.0.               
+;                                                                     
+;*********************************************************************
+
+; $Id: i386nt.asm,v 1.3 1999/11/17 18:58:42 xleroy Exp $
+
+       .386
+       .MODEL FLAT
+
+        .CODE
+        PUBLIC  _call_gen_code
+        ALIGN   4
+_call_gen_code:
+        push   ebp
+        mov    ebp, esp
+        push   ebx
+        push   esi
+        push   edi
+        mov    eax, [ebp+12]
+        mov    ebx, [ebp+16]
+        mov    ecx, [ebp+20]
+        mov    edx, [ebp+24]
+        call   DWORD PTR [ebp+8]
+        pop    edi
+        pop    esi
+        pop    ebx
+        pop    ebp
+        ret    
+
+        PUBLIC  _caml_c_call
+        ALIGN   4
+_caml_c_call:
+        ffree  st(0)
+        ffree  st(1)
+        ffree  st(2)
+        ffree  st(3)
+        jmp    eax
+
+        PUBLIC  _caml_call_gc
+        PUBLIC  _caml_alloc
+        PUBLIC  _caml_alloc1
+        PUBLIC  _caml_alloc2
+        PUBLIC  _caml_alloc3       
+_caml_call_gc:
+_caml_alloc:
+_caml_alloc1:
+_caml_alloc2:
+_caml_alloc3:
+        int     3      
+
+        .DATA
+        PUBLIC _caml_exception_pointer
+_caml_exception_pointer        dword 0
+        PUBLIC _young_ptr
+_young_ptr     dword 0
+        PUBLIC _young_limit
+_young_limit   dword 0
+
+        END
diff --git a/testasmcomp/ia64.S b/testasmcomp/ia64.S
new file mode 100644 (file)
index 0000000..a3e89fc
--- /dev/null
@@ -0,0 +1,118 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: ia64.S,v 1.5 2001/07/12 12:54:24 doligez Exp $ */
+
+#define ST8OFF(a,b,d) st8 [a] = b, d
+#define LD8OFF(a,b,d) ld8 a = [b], d
+#define STFDOFF(a,b,d) stfd [a] = b, d
+#define LDFDOFF(a,b,d) ldfd a = [b], d
+#define STFSPILLOFF(a,b,d) stf.spill [a] = b, d
+#define LDFFILLOFF(a,b,d) ldf.fill a = [b], d
+
+        .text
+        .align 16
+
+        .global call_gen_code#
+        .proc   call_gen_code#
+
+call_gen_code:
+        /* Allocate 64 "out" registers (for the Caml code) and no locals */
+        alloc   r3 = ar.pfs, 0, 0, 64, 0
+
+        /* Save PFS, return address and GP on stack */
+        add     sp = -368, sp ;;
+        add     r2 = 16, sp ;;
+        ST8OFF(r2,r3,8) ;;
+        mov     r3 = b0 ;;
+        ST8OFF(r2,r3,8) ;;
+        ST8OFF(r2,gp,8) ;;
+
+        /* Save predicates on stack */
+        mov     r3 = pr ;;
+        st8     [r2] = r3
+
+        /* Save callee-save floating-point registers on stack */
+        add     r2 = 48, sp
+        add     r3 = 64, sp ;;
+        STFSPILLOFF(r2,f2,16) ;;
+        STFSPILLOFF(r3,f3,16) ;;
+        STFSPILLOFF(r2,f4,16) ;;
+        STFSPILLOFF(r3,f5,16) ;;
+        STFSPILLOFF(r2,f16,16) ;;
+        STFSPILLOFF(r3,f17,16) ;;
+        STFSPILLOFF(r2,f18,16) ;;
+        STFSPILLOFF(r3,f19,16) ;;
+        STFSPILLOFF(r2,f20,16) ;;
+        STFSPILLOFF(r3,f21,16) ;;
+        STFSPILLOFF(r2,f22,16) ;;
+        STFSPILLOFF(r3,f23,16) ;;
+        STFSPILLOFF(r2,f24,16) ;;
+        STFSPILLOFF(r3,f25,16) ;;
+        STFSPILLOFF(r2,f26,16) ;;
+        STFSPILLOFF(r3,f27,16) ;;
+        STFSPILLOFF(r2,f28,16) ;;
+        STFSPILLOFF(r3,f29,16) ;;
+        STFSPILLOFF(r2,f30,16) ;;
+        STFSPILLOFF(r3,f31,16) ;;
+
+        /* Recover entry point and gp from the function pointer in in0 */
+        LD8OFF(r2,r32,8) ;;
+        ld8     r3 = [r32] ;;
+        mov     b6 = r2
+        mov     gp = r3 ;;
+
+        /* Shift arguments r33 ... r35 to r32 ... r34 */
+        mov     r32 = r33
+        mov     r33 = r34
+        mov     r34 = r35
+
+        /* Do the call */
+        br.call.sptk b0 = b6 ;;
+
+        /* Restore the saved floating-point registers */
+        add     r2 = 48, sp
+        add     r3 = 64, sp ;;
+        LDFFILLOFF(f2,r2,16) ;;
+        LDFFILLOFF(f3,r3,16) ;;
+        LDFFILLOFF(f4,r2,16) ;;
+        LDFFILLOFF(f5,r3,16) ;;
+        LDFFILLOFF(f16,r2,16) ;;
+        LDFFILLOFF(f17,r3,16) ;;
+        LDFFILLOFF(f18,r2,16) ;;
+        LDFFILLOFF(f19,r3,16) ;;
+        LDFFILLOFF(f20,r2,16) ;;
+        LDFFILLOFF(f21,r3,16) ;;
+        LDFFILLOFF(f22,r2,16) ;;
+        LDFFILLOFF(f23,r3,16) ;;
+        LDFFILLOFF(f24,r2,16) ;;
+        LDFFILLOFF(f25,r3,16) ;;
+        LDFFILLOFF(f26,r2,16) ;;
+        LDFFILLOFF(f27,r3,16) ;;
+        LDFFILLOFF(f28,r2,16) ;;
+        LDFFILLOFF(f29,r3,16) ;;
+        LDFFILLOFF(f30,r2,16) ;;
+        LDFFILLOFF(f31,r3,16) ;;
+
+        /* Restore gp, predicates and return */
+        add     r2 = 16, sp ;;
+        LD8OFF(r3,r2,8) ;;
+        mov     ar.pfs = r3
+        LD8OFF(r3,r2,8) ;;
+        mov     b0 = r3
+        LD8OFF(gp,r2,8) ;;
+        LD8OFF(r3,r2,8) ;;
+        mov     pr = r3, -1
+
+        br.ret.sptk.many b0 ;;
+
+        .endp   call_gen_code#
diff --git a/testasmcomp/integr.cmm b/testasmcomp/integr.cmm
new file mode 100644 (file)
index 0000000..3f55b60
--- /dev/null
@@ -0,0 +1,30 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: integr.cmm,v 1.5 2000/06/29 11:45:23 xleroy Exp $ *)
+
+(function "square" (x: float)
+   ( *f x x))
+
+(function "integr" (f: addr low: float high: float n: int)
+  (let (h (/f (-f high low) (floatofint n))
+        x low
+        s 0.0
+        i n)
+    (while (> i 0)
+      (assign s (+f s (app f x float)))
+      (assign x (+f x h))
+      (assign i (- i 1)))
+    ( *f s h)))
+
+(function "test" (n: int)
+  (app "integr" "square" 0.0 1.0 n float))
diff --git a/testasmcomp/lexcmm.mli b/testasmcomp/lexcmm.mli
new file mode 100644 (file)
index 0000000..f81000e
--- /dev/null
@@ -0,0 +1,24 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: lexcmm.mli,v 1.4 1999/11/17 18:58:42 xleroy Exp $ *)
+
+val token: Lexing.lexbuf -> Parsecmm.token
+
+type error =
+    Illegal_character
+  | Unterminated_comment
+  | Unterminated_string
+
+exception Error of error
+
+val report_error: Lexing.lexbuf -> error -> unit
diff --git a/testasmcomp/lexcmm.mll b/testasmcomp/lexcmm.mll
new file mode 100644 (file)
index 0000000..b498d7f
--- /dev/null
@@ -0,0 +1,228 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: lexcmm.mll,v 1.8 2000/06/25 19:54:50 xleroy Exp $ *)
+
+{
+open Parsecmm
+
+type error =
+    Illegal_character
+  | Unterminated_comment
+  | Unterminated_string
+
+exception Error of error
+
+(* For nested comments *)
+
+let comment_depth = ref 0
+
+(* The table of keywords *)
+
+let keyword_table =
+  Misc.create_hashtable 149 [
+    "absf", ABSF;
+    "addr", ADDR;
+    "align", ALIGN;
+    "alloc", ALLOC;
+    "and", AND;
+    "app", APPLY;
+    "assign", ASSIGN;
+    "byte", BYTE;
+    "case", CASE;
+    "catch", CATCH;
+    "checkbound", CHECKBOUND;
+    "exit", EXIT;
+    "extcall", EXTCALL;
+    "float", FLOAT;
+    "float32", FLOAT32;
+    "float64", FLOAT64;
+    "floatofint", FLOATOFINT;
+    "function", FUNCTION;
+    "half", HALF;
+    "if", IF;
+    "int", INT;
+    "int32", INT32;
+    "intoffloat", INTOFFLOAT;
+    "string", KSTRING;
+    "let", LET;
+    "load", LOAD;
+    "mod", MODI;
+    "or", OR;
+    "proj", PROJ;
+    "raise", RAISE;
+    "seq", SEQ;
+    "signed", SIGNED;
+    "skip", SKIP;
+    "store", STORE;
+    "switch", SWITCH;
+    "try", TRY;
+    "unit", UNIT;
+    "unsigned", UNSIGNED;
+    "while", WHILE;
+    "with", WITH;
+    "xor", XOR;
+    "addraref", ADDRAREF;
+    "intaref", INTAREF;
+    "floataref", FLOATAREF;
+    "addraset", ADDRASET;
+    "intaset", INTASET;
+    "floataset", FLOATASET
+]
+
+(* To buffer string literals *)
+
+let initial_string_buffer = String.create 256
+let string_buff = ref initial_string_buffer
+let string_index = ref 0
+
+let reset_string_buffer () =
+  string_buff := initial_string_buffer;
+  string_index := 0
+
+let store_string_char c =
+  if !string_index >= String.length (!string_buff) then begin
+    let new_buff = String.create (String.length (!string_buff) * 2) in
+      String.blit (!string_buff) 0 new_buff 0 (String.length (!string_buff));
+      string_buff := new_buff
+  end;
+  String.unsafe_set (!string_buff) (!string_index) c;
+  incr string_index
+
+let get_stored_string () =
+  let s = String.sub (!string_buff) 0 (!string_index) in
+  string_buff := initial_string_buffer;
+  s
+
+(* To translate escape sequences *)
+
+let char_for_backslash = function
+    'n' -> '\010'
+  | 'r' -> '\013'
+  | 'b' -> '\008'
+  | 't' -> '\009'
+  | c   -> c
+
+let char_for_decimal_code lexbuf i =
+  Char.chr(100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
+               10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
+                    (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48))
+
+(* Error report *)
+
+let report_error lexbuf msg =
+  prerr_string "Lexical error around character ";
+  prerr_int (Lexing.lexeme_start lexbuf);
+  match msg with
+    Illegal_character ->
+      prerr_string ": illegal character"
+  | Unterminated_comment ->
+      prerr_string ": unterminated comment"
+  | Unterminated_string ->
+      prerr_string ": unterminated string"
+
+}
+
+rule token = parse
+    [' ' '\010' '\013' '\009' '\012'] +
+      { token lexbuf }
+  | "+a" { ADDA }
+  | "+f" { ADDF }
+  | "+" { ADDI }
+  | ">>s" { ASR }
+  | ":" { COLON }
+  | "/f" { DIVF }
+  | "/" { DIVI }
+  | eof { EOF }
+  | "==a" { EQA }
+  | "==f" { EQF }
+  | "==" { EQI }
+  | ">=a" { GEA }
+  | ">=f" { GEF }
+  | ">=" { GEI }
+  | ">a" { GTA }
+  | ">f" { GTF }
+  | ">" { GTI }
+  | "[" { LBRACKET }
+  | "<=a" { LEA }
+  | "<=f" { LEF }
+  | "<=" { LEI }
+  | "(" { LPAREN }
+  | "<<" { LSL }
+  | ">>u" { LSR }
+  | "<a" { LTA }
+  | "<f" { LTF }
+  | "<" { LTI }
+  | "*f" { MULF }
+  | "*" { MULI }
+  | "!=a" { NEA }
+  | "!=f" { NEF }
+  | "!=" { NEI }
+  | "]" { RBRACKET }
+  | ")" { RPAREN }
+  | "*" { STAR }
+  | "-a" { SUBA }
+  | "-f" { SUBF }
+  | "-" { SUBI }
+  | '-'? (['0'-'9']+ | "0x" ['0'-'9' 'a'-'f' 'A'-'F']+
+                     | "0o" ['0'-'7']+ | "0b" ['0'-'1']+)
+      { INTCONST(int_of_string(Lexing.lexeme lexbuf)) }
+  | '-'? ['0'-'9']+ 'a'
+      { let s = Lexing.lexeme lexbuf in
+        POINTER(int_of_string(String.sub s 0 (String.length s - 1))) }
+  | '-'? ['0'-'9']+ ('.' ['0'-'9']*)? (['e' 'E'] ['+' '-']? ['0'-'9']+)?
+      { FLOATCONST(Lexing.lexeme lexbuf) }
+  | ['A'-'Z' 'a'-'z' '\223'-'\246' '\248'-'\255' ]
+    (['A'-'Z' 'a'-'z' '_' '\192'-'\214' '\216'-'\246' '\248'-'\255'
+      '\'' '0'-'9' ]) *
+      { let s = Lexing.lexeme lexbuf in
+        try
+          Hashtbl.find keyword_table s
+        with Not_found ->
+          IDENT s }
+  | "\""
+      { reset_string_buffer();
+        string lexbuf;
+        STRING (get_stored_string()) }
+  | "(*"
+      { comment_depth := 1;
+        comment lexbuf;
+        token lexbuf }
+  | _ { raise(Error(Illegal_character)) }
+
+and comment = parse
+    "(*"
+      { comment_depth := succ !comment_depth; comment lexbuf }
+  | "*)"
+      { comment_depth := pred !comment_depth;
+        if !comment_depth > 0 then comment lexbuf }
+  | eof
+      { raise (Error(Unterminated_comment)) }
+  | _
+      { comment lexbuf }
+
+and string = parse
+    '"'
+      { () }
+  | '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
+      { string lexbuf }
+  | '\\' ['\\' '"' 'n' 't' 'b' 'r']
+      { store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
+        string lexbuf }
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
+      { store_string_char(char_for_decimal_code lexbuf 1);
+         string lexbuf }
+  | eof
+      { raise (Error(Unterminated_string)) }
+  | _
+      { store_string_char(Lexing.lexeme_char lexbuf 0);
+        string lexbuf }
diff --git a/testasmcomp/m68k.S b/testasmcomp/m68k.S
new file mode 100644 (file)
index 0000000..86bed12
--- /dev/null
@@ -0,0 +1,59 @@
+|***********************************************************************
+|*                                                                     *
+|*                           Objective Caml                            *
+|*                                                                     *
+|*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *
+|*                                                                     *
+|*  Copyright 1996 Institut National de Recherche en Informatique et   *
+|*  en Automatique.  All rights reserved.  This file is distributed    *
+|*  under the terms of the Q Public License version 1.0.               *
+|*                                                                     *
+|***********************************************************************
+
+| $Id: m68k.S,v 1.2 1999/11/17 18:58:42 xleroy Exp $
+
+| call_gen_code is used with the following types:
+|       unit -> int
+|       int -> int
+|       int -> double
+|       int * int * address -> void
+|       int * int -> void
+|       unit -> unit
+| Hence arg1 -> d0, arg2 -> d1, arg3 -> a0, 
+| and we need a special case for int -> double
+
+        .text
+        .globl  _call_gen_code
+_call_gen_code:
+        link    a6, #0
+        movem   d2-d7/a2-a6, a7@-
+        fmovem  fp2-fp7, a7@-
+        movel   a6@(8), a1
+        movel   a6@(12), d0
+        movel   a6@(16), d1
+        movel   a6@(20), a0
+        jsr     a1@
+        fmovem  a7@+, fp2-fp7
+        movem   a7@+, d2-d7/a2-a6
+        unlk    a6
+        rts
+
+        .globl  _call_gen_code_float
+_call_gen_code_float:
+        link    a6, #0
+        moveml  d2-d7/a2-a6, a7@-
+        fmovem  fp2-fp7, a7@-
+        movel   a6@(8), a1
+        movel   a6@(12), d0
+        jsr     a1@
+        fmoved  fp0, a7@-
+        movel   a7@+, d0
+        movel   a7@+, d1
+        fmovem  a7@+, fp2-fp7
+        moveml  a7@+, d2-d7/a2-a6
+        unlk    a6
+        rts
+
+        .globl  _caml_c_call
+_caml_c_call:
+        jmp     a0@
diff --git a/testasmcomp/main.c b/testasmcomp/main.c
new file mode 100644 (file)
index 0000000..02f6e18
--- /dev/null
@@ -0,0 +1,126 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: main.c,v 1.12 2003/06/30 08:28:46 xleroy Exp $ */
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void caml_array_bound_error(void)
+{
+  fprintf(stderr, "Fatal error: out-of-bound access in array or string\n");
+  exit(2);
+}
+
+void print_string(char * s)
+{
+  fputs(s, stdout);
+}
+
+void printf_int(char * fmt, int arg)
+{
+  printf(fmt, arg);
+}
+
+#ifdef SORT
+
+int cmpint(const void * i, const void * j)
+{
+  long vi = *((long *) i);
+  long vj = *((long *) j);
+  if (vi == vj) return 0;
+  if (vi < vj) return -1;
+  return 1;
+}
+
+#endif
+
+int main(int argc, char **argv)
+{
+#ifdef UNIT_INT
+  { extern int FUN();
+    extern int call_gen_code();
+    printf("%d\n", call_gen_code(FUN));
+  }
+#else
+  if (argc < 2) {
+    fprintf(stderr, "Usage: %s [int arg]\n", argv[0]);
+    exit(2);
+  }
+#ifdef INT_INT
+  { extern int FUN();
+    extern int call_gen_code();
+    printf("%d\n", call_gen_code(FUN, atoi(argv[1])));
+  }
+#endif
+#ifdef INT_FLOAT
+  { extern double FUN();
+#ifdef __mc68020__
+#define call_gen_code call_gen_code_float
+#endif
+    extern double call_gen_code();
+    printf("%f\n", call_gen_code(FUN, atoi(argv[1])));
+  }
+#endif
+#ifdef SORT
+  { extern void FUN();
+    extern void call_gen_code();
+    long n;
+    long * a, * b;
+    long i;
+
+    srand(argc >= 3 ? atoi(argv[2]) : time((char *) 0));
+    n = atoi(argv[1]);
+    a = (long *) malloc(n * sizeof(long));
+    for (i = 0 ; i < n; i++) a[i] = rand() & 0xFFF;
+#ifdef DEBUG
+    for (i = 0; i < n; i++) printf("%ld ", a[i]); printf("\n");
+#endif
+    b = (long *) malloc(n * sizeof(long));
+    for (i = 0; i < n; i++) b[i] = a[i];
+    call_gen_code(FUN, 0, n-1, a);
+#ifdef DEBUG
+    for (i = 0; i < n; i++) printf("%ld ", a[i]); printf("\n");
+#endif
+    qsort(b, n, sizeof(long), cmpint);
+    for (i = 0; i < n; i++) {
+      if (a[i] != b[i]) { printf("Bug!\n"); return 2; }
+    }
+    printf("OK\n");
+  }
+#endif
+#endif
+#ifdef CHECKBOUND
+  { extern void checkbound1(), checkbound2();
+    extern void call_gen_code();
+    long x, y;
+    x = atoi(argv[1]);
+    if (argc >= 3) {
+      y = atoi(argv[2]);
+      if ((unsigned long) x < (unsigned long) y)
+        printf("Should not trap\n");
+      else
+        printf("Should trap\n");
+      call_gen_code(checkbound2, y, x);
+    } else {
+      if (2 < (unsigned long) x)
+        printf("Should not trap\n");
+      else
+        printf("Should trap\n");
+      call_gen_code(checkbound1, x);
+    }
+    printf("OK\n");
+  }
+#endif
+  return 0;
+}
diff --git a/testasmcomp/main.ml b/testasmcomp/main.ml
new file mode 100644 (file)
index 0000000..4866a1a
--- /dev/null
@@ -0,0 +1,60 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: main.ml,v 1.12 2000/07/07 14:09:23 xleroy Exp $ *)
+
+open Clflags
+
+let compile_file filename =
+  Compilenv.reset "test";
+  Emit.begin_assembly();
+  let ic = open_in filename in
+  let lb = Lexing.from_channel ic in
+  try
+    while true do
+      Asmgen.compile_phrase Format.std_formatter (Parsecmm.phrase Lexcmm.token lb)
+    done
+  with
+      End_of_file ->
+        close_in ic; Emit.end_assembly()
+    | Lexcmm.Error msg ->
+        close_in ic; Lexcmm.report_error lb msg
+    | Parsing.Parse_error ->
+        close_in ic;
+        prerr_string "Syntax error near character ";
+        prerr_int (Lexing.lexeme_start lb);
+        prerr_newline()
+    | Parsecmmaux.Error msg ->
+        close_in ic; Parsecmmaux.report_error msg
+    | x ->
+        close_in ic; raise x
+
+let usage = "Usage: codegen <options> <files>\noptions are:"
+
+let main() =
+  Arg.parse [
+     "-dcmm", Arg.Set dump_cmm, "";
+     "-dsel", Arg.Set dump_selection, "";
+     "-dlive", Arg.Unit(fun () -> dump_live := true;
+                                  Printmach.print_live := true), "";
+     "-dspill", Arg.Set dump_spill, "";
+     "-dsplit", Arg.Set dump_split, "";
+     "-dinterf", Arg.Set dump_interf, "";
+     "-dprefer", Arg.Set dump_prefer, "";
+     "-dalloc", Arg.Set dump_regalloc, "";
+     "-dreload", Arg.Set dump_reload, "";
+     "-dscheduling", Arg.Set dump_scheduling, "";
+     "-dlinear", Arg.Set dump_linear, ""
+    ] compile_file usage
+
+let _ = (*Printexc.catch*) main (); exit 0
+
diff --git a/testasmcomp/mainarith.c b/testasmcomp/mainarith.c
new file mode 100644 (file)
index 0000000..9594c25
--- /dev/null
@@ -0,0 +1,304 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: mainarith.c,v 1.20 2000/07/21 08:09:05 xleroy Exp $ */
+
+#include <stdio.h>
+#include <math.h>
+
+void caml_array_bound_error(void)
+{
+  fprintf(stderr, "Fatal error: out-of-bound access in array or string\n");
+  exit(2);
+}
+
+long R[200];
+double D[40];
+long X, Y;
+double F, G;
+
+#define INTTEST(arg,res) \
+  { long result = (res); \
+    if (arg != result) \
+      printf("Failed test \"%s == %s\" for X=%ld and Y=%ld: result %ld, expected %ld\n", \
+             #arg, #res, X, Y, arg, result); \
+  }
+#define INTFLOATTEST(arg,res) \
+  { long result = (res); \
+    if (arg != result) \
+      printf("Failed test \"%s == %s\" for F=%.15g and G=%.15g: result %ld, expected %ld\n", \
+             #arg, #res, F, G, arg, result); \
+  }
+#define FLOATTEST(arg,res) \
+  { double result = (res); \
+    if (arg < result || arg > result) \
+      printf("Failed test \"%s == %s\" for F=%.15g and G=%.15g: result %.15g, expected %.15g\n", \
+             #arg, #res, F, G, arg, result); \
+  }
+#define FLOATINTTEST(arg,res) \
+  { double result = (res); \
+    if (arg < result || arg > result) \
+      printf("Failed test \"%s == %s\" for X=%ld and Y=%ld: result %.15g, expected %.15g\n", \
+             #arg, #res, X, Y, arg, result); \
+  }
+
+extern void call_gen_code();
+extern void testarith();
+
+void do_test(void)
+{
+      call_gen_code(testarith);
+
+      INTTEST(R[0], 0);
+      INTTEST(R[1], 1);
+      INTTEST(R[2], -1);
+      INTTEST(R[3], 256);
+      INTTEST(R[4], 65536);
+      INTTEST(R[5], 16777216);
+      INTTEST(R[6], -256);
+      INTTEST(R[7], -65536);
+      INTTEST(R[8], -16777216);
+
+      INTTEST(R[9], (X + Y));
+      INTTEST(R[10], (X + 1));
+      INTTEST(R[11], (X + -1));
+
+      INTTEST(R[12], ((long) ((char *)R + 8)));
+      INTTEST(R[13], ((long) ((char *)R + Y)));
+
+      INTTEST(R[14], (X - Y));
+      INTTEST(R[15], (X - 1));
+      INTTEST(R[16], (X - -1));
+
+      INTTEST(R[17], ((long) ((char *)R - 8)));
+      INTTEST(R[18], ((long) ((char *)R - Y)));
+
+      INTTEST(R[19], (X * 2));
+      INTTEST(R[20], (2 * X));
+      INTTEST(R[21], (X * 16));
+      INTTEST(R[22], (16 * X));
+      INTTEST(R[23], (X * 12345));
+      INTTEST(R[24], (12345 * X));
+      INTTEST(R[25], (X * Y));
+
+      INTTEST(R[26], (X / 2));
+      INTTEST(R[27], (X / 16));
+      INTTEST(R[28], (X / 7));
+      INTTEST(R[29], (Y != 0 ? X / Y : 0));
+
+      INTTEST(R[30], (X % 2));
+      INTTEST(R[31], (X % 16));
+      INTTEST(R[32], (Y != 0 ? X % Y : 0));
+
+      INTTEST(R[33], (X & Y));
+      INTTEST(R[34], (X & 3));
+      INTTEST(R[35], (3 & X));
+
+      INTTEST(R[36], (X | Y));
+      INTTEST(R[37], (X | 3));
+      INTTEST(R[38], (3 | X));
+
+      INTTEST(R[39], (X ^ Y));
+      INTTEST(R[40], (X ^ 3));
+      INTTEST(R[41], (3 ^ X));
+
+      INTTEST(R[42], (X << Y));
+      INTTEST(R[43], (X << 1));
+      INTTEST(R[44], (X << 8));
+
+      INTTEST(R[45], ((unsigned long) X >> Y));
+      INTTEST(R[46], ((unsigned long) X >> 1));
+      INTTEST(R[47], ((unsigned long) X >> 8));
+
+      INTTEST(R[48], (X >> Y));
+      INTTEST(R[49], (X >> 1));
+      INTTEST(R[50], (X >> 8));
+
+      INTTEST(R[51], (X == Y));
+      INTTEST(R[52], (X != Y));
+      INTTEST(R[53], (X < Y));
+      INTTEST(R[54], (X > Y));
+      INTTEST(R[55], (X <= Y));
+      INTTEST(R[56], (X >= Y));
+      INTTEST(R[57], (X == 1));
+      INTTEST(R[58], (X != 1));
+      INTTEST(R[59], (X < 1));
+      INTTEST(R[60], (X > 1));
+      INTTEST(R[61], (X <= 1));
+      INTTEST(R[62], (X >= 1));
+
+      INTTEST(R[63], ((char *)X == (char *)Y));
+      INTTEST(R[64], ((char *)X != (char *)Y));
+      INTTEST(R[65], ((char *)X < (char *)Y));
+      INTTEST(R[66], ((char *)X > (char *)Y));
+      INTTEST(R[67], ((char *)X <= (char *)Y));
+      INTTEST(R[68], ((char *)X >= (char *)Y));
+      INTTEST(R[69], ((char *)X == (char *)1));
+      INTTEST(R[70], ((char *)X != (char *)1));
+      INTTEST(R[71], ((char *)X < (char *)1));
+      INTTEST(R[72], ((char *)X > (char *)1));
+      INTTEST(R[73], ((char *)X <= (char *)1));
+      INTTEST(R[74], ((char *)X >= (char *)1));
+
+      INTTEST(R[75], (X + (Y << 1)));
+      INTTEST(R[76], (X + (Y << 2)));
+      INTTEST(R[77], (X + (Y << 3)));
+      INTTEST(R[78], (X - (Y << 1)));
+      INTTEST(R[79], (X - (Y << 2)));
+      INTTEST(R[80], (X - (Y << 3)));
+
+      FLOATTEST(D[0], 0.0);
+      FLOATTEST(D[1], 1.0);
+      FLOATTEST(D[2], -1.0);
+      FLOATTEST(D[3], (F + G));
+      FLOATTEST(D[4], (F - G));
+      FLOATTEST(D[5], (F * G));
+      FLOATTEST(D[6], F / G);
+
+      FLOATTEST(D[7], (F + (G + 1.0)));
+      FLOATTEST(D[8], (F - (G + 1.0)));
+      FLOATTEST(D[9], (F * (G + 1.0)));
+      FLOATTEST(D[10], F / (G + 1.0));
+
+      FLOATTEST(D[11], ((F + 1.0) + G));
+      FLOATTEST(D[12], ((F + 1.0) - G));
+      FLOATTEST(D[13], ((F + 1.0) * G));
+      FLOATTEST(D[14], (F + 1.0) / G);
+
+      FLOATTEST(D[15], ((F + 1.0) + (G + 1.0)));
+      FLOATTEST(D[16], ((F + 1.0) - (G + 1.0)));
+      FLOATTEST(D[17], ((F + 1.0) * (G + 1.0)));
+      FLOATTEST(D[18], (F + 1.0) / (G + 1.0));
+
+      INTFLOATTEST(R[81], (F == G));
+      INTFLOATTEST(R[82], (F != G));
+      INTFLOATTEST(R[83], (F < G));
+      INTFLOATTEST(R[84], (F > G));
+      INTFLOATTEST(R[85], (F <= G));
+      INTFLOATTEST(R[86], (F >= G));
+
+      FLOATINTTEST(D[19], (double) X);
+      INTFLOATTEST(R[87], (long) F);
+
+      INTTEST(R[88], (X >= 0) && (X < Y));
+      INTTEST(R[89], (0 < Y));
+      INTTEST(R[90], (5 < Y));
+
+      INTFLOATTEST(R[91], (F == G));
+      INTFLOATTEST(R[92], (F != G));
+      INTFLOATTEST(R[93], (F < G));
+      INTFLOATTEST(R[94], (F > G));
+      INTFLOATTEST(R[95], (F <= G));
+      INTFLOATTEST(R[96], (F >= G));
+
+      INTFLOATTEST(R[97], (F + 1.0 == G + 1.0));
+      INTFLOATTEST(R[98], (F + 1.0 != G + 1.0));
+      INTFLOATTEST(R[99], (F + 1.0 < G + 1.0));
+      INTFLOATTEST(R[100], (F + 1.0 > G + 1.0));
+      INTFLOATTEST(R[101], (F + 1.0 <= G + 1.0));
+      INTFLOATTEST(R[102], (F + 1.0 >= G + 1.0));
+
+      INTFLOATTEST(R[103], (F == G + 1.0));
+      INTFLOATTEST(R[104], (F != G + 1.0));
+      INTFLOATTEST(R[105], (F < G + 1.0));
+      INTFLOATTEST(R[106], (F > G + 1.0));
+      INTFLOATTEST(R[107], (F <= G + 1.0));
+      INTFLOATTEST(R[108], (F >= G + 1.0));
+
+      INTFLOATTEST(R[109], (F + 1.0 == G));
+      INTFLOATTEST(R[110], (F + 1.0 != G));
+      INTFLOATTEST(R[111], (F + 1.0 < G));
+      INTFLOATTEST(R[112], (F + 1.0 > G));
+      INTFLOATTEST(R[113], (F + 1.0 <= G));
+      INTFLOATTEST(R[114], (F + 1.0 >= G));
+
+      FLOATINTTEST(D[20], ((double) X) + 1.0);
+      INTFLOATTEST(R[115], (long)(F + 1.0));
+
+      FLOATTEST(D[21], F + G);
+      FLOATTEST(D[22], G + F);
+      FLOATTEST(D[23], F - G);
+      FLOATTEST(D[24], G - F);
+      FLOATTEST(D[25], F * G);
+      FLOATTEST(D[26], G * F);
+      FLOATTEST(D[27], F / G);
+      FLOATTEST(D[28], G / F);
+
+      FLOATTEST(D[29], (F * 2.0) + G);
+      FLOATTEST(D[30], G + (F * 2.0));
+      FLOATTEST(D[31], (F * 2.0) - G);
+      FLOATTEST(D[32], G - (F * 2.0));
+      FLOATTEST(D[33], (F + 2.0) * G);
+      FLOATTEST(D[34], G * (F + 2.0));
+      FLOATTEST(D[35], (F * 2.0) / G);
+      FLOATTEST(D[36], G / (F * 2.0));
+
+      FLOATTEST(D[37], - F);
+      FLOATTEST(D[38], fabs(F));
+}
+
+#ifdef __i386__
+#ifdef __FreeBSD__
+#include <floatingpoint.h>
+#endif
+#endif
+
+void init_ieee_floats(void)
+{
+#ifdef __i386__
+#ifdef __FreeBSD__
+  fpsetmask(0);
+#endif
+#endif
+}
+
+int main(int argc, char **argv)
+{
+  double weird[4];
+
+  init_ieee_floats();
+
+  if (argc >= 5) {
+    X = atoi(argv[1]);
+    Y = atoi(argv[2]);
+    sscanf(argv[3], "%lf", &F);
+    sscanf(argv[4], "%lf", &G);
+    do_test();
+    return 0;
+  }
+  for(Y = -2; Y <= 2; Y++) {
+    for (X = -2; X <= 2; X++) {
+      F = X; G = Y; do_test();
+    }
+  }
+  if (!(argc >= 2 && strcmp(argv[1], "noinf"))) {
+    weird[0] = 0.0;
+    weird[1] = 1.0 / weird[0];         /* +infty */
+    weird[2] = -1.0 / weird[0];        /* -infty */
+    weird[3] = 0.0 / weird[0];         /* NaN */
+    for (X = 0; X < 4; X++) {
+      for (Y = 0; Y < 4; Y++) {
+        F = weird[X]; G = weird[Y]; do_test();
+      }
+    }
+  }
+  while(1) {
+    X = (rand() & 0x1FFFFFFF) - 0x10000000;
+    Y = (rand() & 0x1FFFFFFF) - 0x10000000;
+    F = X / 1e3;
+    G = Y / 1e3;
+    do_test();
+    printf("."); fflush(stdout);
+  }
+  return 0;
+}
+
diff --git a/testasmcomp/mips.s b/testasmcomp/mips.s
new file mode 100644 (file)
index 0000000..f5bc84d
--- /dev/null
@@ -0,0 +1,71 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: mips.s,v 1.3 1999/11/29 19:04:19 doligez Exp $ */
+
+        .globl  call_gen_code
+        .ent    call_gen_code
+call_gen_code:
+        subu    $sp, $sp, 0x90
+        sd      $31, 0x88($sp)
+    /* Save all callee-save registers */
+        sd      $16, 0x0($sp)
+        sd      $17, 0x8($sp)
+        sd      $18, 0x10($sp)
+        sd      $19, 0x18($sp)
+        sd      $20, 0x20($sp)
+        sd      $21, 0x28($sp)
+        sd      $22, 0x30($sp)
+        sd      $23, 0x38($sp)
+        sd      $30, 0x40($sp)
+        s.d     $f20, 0x48($sp)
+        s.d     $f22, 0x50($sp)
+        s.d     $f24, 0x58($sp)
+        s.d     $f26, 0x60($sp)
+        s.d     $f28, 0x68($sp)
+        s.d     $f30, 0x70($sp)
+    /* Shuffle arguments */
+        move    $8, $5
+        move    $9, $6
+        move    $10, $7
+        move    $25, $4
+        jal     $4
+    /* Restore registers */
+        ld      $31, 0x88($sp)
+        ld      $16, 0x0($sp)
+        ld      $17, 0x8($sp)
+        ld      $18, 0x10($sp)
+        ld      $19, 0x18($sp)
+        ld      $20, 0x20($sp)
+        ld      $21, 0x28($sp)
+        ld      $22, 0x30($sp)
+        ld      $23, 0x38($sp)
+        ld      $30, 0x40($sp)
+        l.d     $f20, 0x48($sp)
+        l.d     $f22, 0x50($sp)
+        l.d     $f24, 0x58($sp)
+        l.d     $f26, 0x60($sp)
+        l.d     $f28, 0x68($sp)
+        l.d     $f30, 0x70($sp)
+        addu    $sp, $sp, 0x90
+        j       $31
+
+        .end    call_gen_code
+
+/* Call a C function */
+
+        .globl  caml_c_call
+        .ent    caml_c_call
+caml_c_call:
+        move    $25, $24
+        j       $24
+        .end    caml_c_call
diff --git a/testasmcomp/parsecmm.mly b/testasmcomp/parsecmm.mly
new file mode 100644 (file)
index 0000000..99ef8df
--- /dev/null
@@ -0,0 +1,325 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: parsecmm.mly,v 1.11 2003/06/30 08:28:48 xleroy Exp $ */
+
+/* A simple parser for C-- */
+
+%{
+open Cmm
+open Parsecmmaux
+
+let rec make_letdef def body =
+  match def with
+    [] -> body
+  | (id, def) :: rem ->
+      unbind_ident id;
+      Clet(id, def, make_letdef rem body)
+
+let make_switch n selector caselist =
+  let index = Array.create n 0 in
+  let casev = Array.of_list caselist in
+  let actv = Array.create (Array.length casev) (Cexit(0,[])) in
+  for i = 0 to Array.length casev - 1 do
+    let (posl, e) = casev.(i) in
+    List.iter (fun pos -> index.(pos) <- i) posl;
+    actv.(i) <- e
+  done;
+  Cswitch(selector, index, actv)
+
+let access_array base numelt size =
+  match numelt with
+    Cconst_int 0 -> base
+  | Cconst_int n -> Cop(Cadda, [base; Cconst_int(n * size)])
+  | _ -> Cop(Cadda, [base;
+                     Cop(Clsl, [numelt; Cconst_int(Misc.log2 size)])])
+
+%}
+
+%token ABSF
+%token ADDA
+%token ADDF
+%token ADDI
+%token ADDR
+%token ALIGN
+%token ALLOC
+%token AND
+%token APPLY
+%token ASR
+%token ASSIGN
+%token BYTE
+%token CASE
+%token CATCH
+%token CHECKBOUND
+%token COLON
+%token DIVF
+%token DIVI
+%token EOF
+%token EQA
+%token EQF
+%token EQI
+%token EXIT
+%token EXTCALL
+%token FLOAT
+%token FLOAT32
+%token FLOAT64
+%token <string> FLOATCONST
+%token FLOATOFINT
+%token FUNCTION
+%token GEA
+%token GEF
+%token GEI
+%token GTA
+%token GTF
+%token GTI
+%token HALF
+%token <string> IDENT
+%token IF
+%token INT
+%token INT32
+%token <int> INTCONST
+%token INTOFFLOAT
+%token KSTRING
+%token LBRACKET
+%token LEA
+%token LEF
+%token LEI
+%token LET
+%token LOAD
+%token LPAREN
+%token LSL
+%token LSR
+%token LTA
+%token LTF
+%token LTI
+%token MODI
+%token MULF
+%token MULI
+%token NEA
+%token NEF
+%token NEI
+%token OR
+%token <int> POINTER
+%token PROJ
+%token RAISE
+%token RBRACKET
+%token RPAREN
+%token SEQ
+%token SIGNED
+%token SKIP
+%token STAR
+%token STORE
+%token <string> STRING
+%token SUBA
+%token SUBF
+%token SUBI
+%token SWITCH
+%token TRY
+%token UNIT
+%token UNSIGNED
+%token WHILE
+%token WITH
+%token XOR
+%token ADDRAREF
+%token INTAREF
+%token FLOATAREF
+%token ADDRASET
+%token INTASET
+%token FLOATASET
+
+%start phrase
+%type <Cmm.phrase> phrase
+
+%%
+
+phrase:
+    fundecl     { Cfunction $1 }
+  | datadecl    { Cdata $1 }
+  | EOF         { raise End_of_file }
+;
+fundecl:
+    LPAREN FUNCTION STRING LPAREN params RPAREN sequence RPAREN
+      { List.iter (fun (id, ty) -> unbind_ident id) $5;
+        {fun_name = $3; fun_args = $5; fun_body = $7; fun_fast = true} }
+;
+params:
+    oneparam params     { $1 :: $2 }
+  | /**/                { [] }
+;
+oneparam:
+    IDENT COLON machtype { (bind_ident $1, $3) }
+;
+machtype:
+    UNIT                        { [||] }
+  | componentlist               { Array.of_list(List.rev $1) }
+;
+component:
+    ADDR                        { Addr }
+  | INT                         { Int }
+  | FLOAT                       { Float }
+;
+componentlist:
+    component                    { [$1] }
+  | componentlist STAR component { $3 :: $1 }
+;
+expr:
+    INTCONST    { Cconst_int $1 }
+  | FLOATCONST  { Cconst_float $1 }
+  | STRING      { Cconst_symbol $1 }
+  | POINTER     { Cconst_pointer $1 }
+  | IDENT       { Cvar(find_ident $1) }
+  | LBRACKET RBRACKET { Ctuple [] }
+  | LPAREN LET letdef sequence RPAREN { make_letdef $3 $4 }
+  | LPAREN ASSIGN IDENT expr RPAREN { Cassign(find_ident $3, $4) }
+  | LPAREN APPLY expr exprlist machtype RPAREN { Cop(Capply $5, $3 :: List.rev $4) }
+  | LPAREN EXTCALL STRING exprlist machtype RPAREN { Cop(Cextcall($3, $5, false), List.rev $4) }
+  | LPAREN SUBF expr RPAREN { Cop(Cnegf, [$3]) }
+  | LPAREN SUBF expr expr RPAREN { Cop(Csubf, [$3; $4]) }
+  | LPAREN unaryop expr RPAREN { Cop($2, [$3]) }
+  | LPAREN binaryop expr expr RPAREN { Cop($2, [$3; $4]) }
+  | LPAREN SEQ sequence RPAREN { $3 }
+  | LPAREN IF expr expr expr RPAREN { Cifthenelse($3, $4, $5) }
+  | LPAREN SWITCH INTCONST expr caselist RPAREN { make_switch $3 $4 $5 }
+  | LPAREN WHILE expr sequence RPAREN
+      { let body =
+          match $3 with
+            Cconst_int x when x <> 0 -> $4
+          | _ -> Cifthenelse($3, $4, (Cexit(0,[]))) in
+        Ccatch(0, [], Cloop body, Ctuple []) }
+  | LPAREN CATCH sequence WITH sequence RPAREN { Ccatch(0, [], $3, $5) }
+  | EXIT        { Cexit(0,[]) }
+  | LPAREN TRY sequence WITH bind_ident sequence RPAREN
+                { unbind_ident $5; Ctrywith($3, $5, $6) }
+  | LPAREN ADDRAREF expr expr RPAREN
+      { Cop(Cload Word, [access_array $3 $4 Arch.size_addr]) }
+  | LPAREN INTAREF expr expr RPAREN
+      { Cop(Cload Word, [access_array $3 $4 Arch.size_int]) }
+  | LPAREN FLOATAREF expr expr RPAREN
+      { Cop(Cload Double_u, [access_array $3 $4 Arch.size_float]) }
+  | LPAREN ADDRASET expr expr expr RPAREN
+      { Cop(Cstore Word, [access_array $3 $4 Arch.size_addr; $5]) }
+  | LPAREN INTASET expr expr expr RPAREN
+      { Cop(Cstore Word, [access_array $3 $4 Arch.size_int; $5]) }
+  | LPAREN FLOATASET expr expr expr RPAREN
+      { Cop(Cstore Double_u, [access_array $3 $4 Arch.size_float; $5]) }
+;
+exprlist:
+    exprlist expr               { $2 :: $1 }
+  | /**/                        { [] }
+;
+letdef:
+    oneletdef                   { [$1] }
+  | LPAREN letdefmult RPAREN    { $2 }
+;
+letdefmult:
+    /**/                        { [] }
+  | oneletdef letdefmult        { $1 :: $2 }
+;
+oneletdef:
+    IDENT expr                  { (bind_ident $1, $2) }
+;
+chunk:
+    UNSIGNED BYTE               { Byte_unsigned }
+  | SIGNED BYTE                 { Byte_signed }
+  | UNSIGNED HALF               { Sixteen_unsigned }
+  | SIGNED HALF                 { Sixteen_signed }
+  | UNSIGNED INT32              { Thirtytwo_unsigned }
+  | SIGNED INT32                { Thirtytwo_signed }
+  | INT                         { Word }
+  | ADDR                        { Word }
+  | FLOAT32                     { Single }
+  | FLOAT64                     { Double }
+  | FLOAT                       { Double_u }
+
+;
+unaryop:
+    LOAD chunk                  { Cload $2 }
+  | ALLOC                       { Calloc }
+  | FLOATOFINT                  { Cfloatofint }
+  | INTOFFLOAT                  { Cintoffloat }
+  | RAISE                       { Craise }
+  | ABSF                        { Cabsf }
+;
+binaryop:
+    STORE chunk                 { Cstore $2 }
+  | ADDI                        { Caddi }
+  | SUBI                        { Csubi }
+  | MULI                        { Cmuli }
+  | DIVI                        { Cdivi }
+  | MODI                        { Cmodi }
+  | AND                         { Cand }
+  | OR                          { Cor }
+  | XOR                         { Cxor }
+  | LSL                         { Clsl }
+  | LSR                         { Clsr }
+  | ASR                         { Casr }
+  | EQI                         { Ccmpi Ceq }
+  | NEI                         { Ccmpi Cne }
+  | LTI                         { Ccmpi Clt }
+  | LEI                         { Ccmpi Cle }
+  | GTI                         { Ccmpi Cgt }
+  | GEI                         { Ccmpi Cge }
+  | ADDA                        { Cadda }
+  | SUBA                        { Csuba }
+  | EQA                         { Ccmpa Ceq }
+  | NEA                         { Ccmpa Cne }
+  | LTA                         { Ccmpa Clt }
+  | LEA                         { Ccmpa Cle }
+  | GTA                         { Ccmpa Cgt }
+  | GEA                         { Ccmpa Cge }
+  | ADDF                        { Caddf }
+  | MULF                        { Cmulf }
+  | DIVF                        { Cdivf }
+  | EQF                         { Ccmpf Ceq }
+  | NEF                         { Ccmpf Cne }
+  | LTF                         { Ccmpf Clt }
+  | LEF                         { Ccmpf Cle }
+  | GTF                         { Ccmpf Cgt }
+  | GEF                         { Ccmpf Cge }
+  | CHECKBOUND                  { Ccheckbound }
+;
+sequence:
+    expr sequence               { Csequence($1, $2) }
+  | expr                        { $1 }
+;
+caselist:
+    onecase sequence caselist   { ($1, $2) :: $3 }
+  | /**/                        { [] }
+;
+onecase:
+    CASE INTCONST COLON onecase { $2 :: $4 }
+  | CASE INTCONST COLON         { [$2] }
+;
+bind_ident:
+    IDENT                       { bind_ident $1 }
+;
+datadecl:
+    LPAREN datalist RPAREN      { List.rev $2 }
+;
+datalist:
+    datalist dataitem           { $2 :: $1 }
+  | /**/                        { [] }
+;
+dataitem:
+    STRING COLON                { Cdefine_symbol $1 }
+  | INTCONST COLON              { Cdefine_label $1 }
+  | BYTE INTCONST               { Cint8 $2 }
+  | HALF INTCONST               { Cint16 $2 }
+  | INT INTCONST                { Cint(Nativeint.of_int $2) }
+  | FLOAT FLOATCONST            { Cdouble $2 }
+  | ADDR STRING                 { Csymbol_address $2 }
+  | ADDR INTCONST               { Clabel_address $2 }
+  | KSTRING STRING              { Cstring $2 }
+  | SKIP INTCONST               { Cskip $2 }
+  | ALIGN INTCONST              { Calign $2 }
+;
+
diff --git a/testasmcomp/parsecmmaux.ml b/testasmcomp/parsecmmaux.ml
new file mode 100644 (file)
index 0000000..013b4c3
--- /dev/null
@@ -0,0 +1,40 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: parsecmmaux.ml,v 1.4 1999/11/17 18:58:43 xleroy Exp $ *)
+
+(* Auxiliary functions for parsing *)
+
+type error =
+    Unbound of string
+
+exception Error of error
+
+let tbl_ident = (Hashtbl.create 57 : (string, Ident.t) Hashtbl.t)
+
+let bind_ident s =
+  let id = Ident.create s in
+  Hashtbl.add tbl_ident s id;
+  id
+
+let find_ident s =
+  try
+    Hashtbl.find tbl_ident s
+  with Not_found ->
+    raise(Error(Unbound s))
+
+let unbind_ident id =
+  Hashtbl.remove tbl_ident (Ident.name id)
+
+let report_error = function
+    Unbound s ->
+      prerr_string "Unbound identifier "; prerr_string s; prerr_endline "."
diff --git a/testasmcomp/parsecmmaux.mli b/testasmcomp/parsecmmaux.mli
new file mode 100644 (file)
index 0000000..4636ed0
--- /dev/null
@@ -0,0 +1,26 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: parsecmmaux.mli,v 1.4 1999/11/17 18:58:43 xleroy Exp $ *)
+
+(* Auxiliary functions for parsing *)
+
+val bind_ident: string -> Ident.t
+val find_ident: string -> Ident.t
+val unbind_ident: Ident.t -> unit
+
+type error =
+    Unbound of string
+
+exception Error of error
+
+val report_error: error -> unit
diff --git a/testasmcomp/power-aix.S b/testasmcomp/power-aix.S
new file mode 100644 (file)
index 0000000..c3fce8c
--- /dev/null
@@ -0,0 +1,152 @@
+#*********************************************************************
+#*                                                                   *
+#*                          Objective Caml                           *
+#*                                                                   *
+#*           Xavier Leroy, projet Cristal, INRIA Rocquencourt        *
+#*                                                                   *
+#* Copyright 1996 Institut National de Recherche en Informatique et  *
+#* en Automatique.  All rights reserved.  This file is distributed   *
+#* under the terms of the Q Public License version 1.0.              *
+#*                                                                   *
+#*********************************************************************
+
+# $Id: power-aix.S,v 1.3 2000/04/05 18:30:22 doligez Exp $
+
+        .csect  .text[PR]
+
+        .globl  .call_gen_code
+.call_gen_code:
+# Save return address
+        mflr 0
+        stw 0, 8(1)
+# Save all callee-save registers
+        stw 13,-76(1)
+        stw 14,-72(1)
+        stw 15,-68(1)
+        stw 16,-64(1)
+        stw 17,-60(1)
+        stw 18,-56(1)
+        stw 19,-52(1)
+        stw 20,-48(1)
+        stw 21,-44(1)
+        stw 22,-40(1)
+        stw 23,-36(1)
+        stw 24,-32(1)
+        stw 25,-28(1)
+        stw 26,-24(1)
+        stw 27,-20(1)
+        stw 28,-16(1)
+        stw 29,-12(1)
+        stw 30,-8(1)
+        stw 31,-4(1)
+        stfd 14, -224(1)
+        stfd 15, -216(1)
+        stfd 16, -208(1)
+        stfd 17, -200(1)
+        stfd 18, -192(1)
+        stfd 19, -184(1)
+        stfd 20, -176(1)
+        stfd 21, -168(1)
+        stfd 22, -160(1)
+        stfd 23, -152(1)
+        stfd 24, -144(1)
+        stfd 25, -136(1)
+        stfd 26, -128(1)
+        stfd 27, -120(1)
+        stfd 28, -112(1)
+        stfd 29, -104(1)
+        stfd 30, -96(1)
+        stfd 31, -88(1)
+# Allocate and link stack frame
+        stwu 1, -280(1)
+# Save global pointer
+        stw 2, 20(1)
+# Load code to call
+        lwz 0, 0(3)
+        lwz 2, 4(3)
+        mtlr 0
+# Shuffle arguments
+        mr 3, 4
+        mr 4, 5
+        mr 5, 6
+        mr 6, 7
+# Call the function
+        blrl
+# Restore global pointer
+        lwz 2, 20(1)
+# Deallocate stack frame
+        addic 1, 1, 280
+# Restore callee-save registers
+        lwz 13,-76(1)
+        lwz 14,-72(1)
+        lwz 15,-68(1)
+        lwz 16,-64(1)
+        lwz 17,-60(1)
+        lwz 18,-56(1)
+        lwz 19,-52(1)
+        lwz 20,-48(1)
+        lwz 21,-44(1)
+        lwz 22,-40(1)
+        lwz 23,-36(1)
+        lwz 24,-32(1)
+        lwz 25,-28(1)
+        lwz 26,-24(1)
+        lwz 27,-20(1)
+        lwz 28,-16(1)
+        lwz 29,-12(1)
+        lwz 30,-8(1)
+        lwz 31,-4(1)
+        lfd 14, -224(1)
+        lfd 15, -216(1)
+        lfd 16, -208(1)
+        lfd 17, -200(1)
+        lfd 18, -192(1)
+        lfd 19, -184(1)
+        lfd 20, -176(1)
+        lfd 21, -168(1)
+        lfd 22, -160(1)
+        lfd 23, -152(1)
+        lfd 24, -144(1)
+        lfd 25, -136(1)
+        lfd 26, -128(1)
+        lfd 27, -120(1)
+        lfd 28, -112(1)
+        lfd 29, -104(1)
+        lfd 30, -96(1)
+        lfd 31, -88(1)
+# Reload return address
+        lwz 0, 8(1)
+        mtlr 0
+# Return
+        blr
+
+        .globl  .caml_c_call
+.caml_c_call:
+# Preserve RTOC and return address in callee-save registers
+# The C function will preserve them, and the Caml code does not
+# expect them to be preserved
+# Return address is in 25, RTOC is in 26
+        mflr    25
+        mr      26, 2
+# Call desired function (descriptor in r11)
+        lwz     0, 0(11)
+        lwz     2, 4(11)
+        mtlr    0
+        blrl
+# Restore return address and RTOC
+        mtlr    25
+        mr      2, 26
+# Return to caller
+        blr
+
+# Function closures
+
+        .globl  call_gen_code
+        .csect  call_gen_code[DS]
+call_gen_code:
+        .long   .call_gen_code, TOC[tc0], 0
+
+        .globl  caml_c_call
+        .csect  caml_c_call[DS]
+caml_c_call:
+        .long   .caml_c_call, TOC[tc0], 0
diff --git a/testasmcomp/power-elf.S b/testasmcomp/power-elf.S
new file mode 100644 (file)
index 0000000..cfdceef
--- /dev/null
@@ -0,0 +1,131 @@
+/*********************************************************************/
+/*                                                                   */
+/*                          Objective Caml                           */
+/*                                                                   */
+/*           Xavier Leroy, projet Cristal, INRIA Rocquencourt        */
+/*                                                                   */
+/* Copyright 1996 Institut National de Recherche en Informatique et  */
+/* en Automatique.  All rights reserved.  This file is distributed   */
+/* under the terms of the Q Public License version 1.0.              */
+/*                                                                   */
+/*********************************************************************/
+
+/* $Id: power-elf.S,v 1.3 1999/11/17 18:58:43 xleroy Exp $ */
+
+/* Save and restore all callee-save registers */
+/* GPR 14 at sp+16 ... GPR 31 at sp+84
+   FPR 14 at sp+92 ... FPR 31 at sp+228 */
+
+#define Save_callee_save \
+        addic   11, 1, 16-4; \
+        stwu    14, 4(11); \
+        stwu    15, 4(11); \
+        stwu    16, 4(11); \
+        stwu    17, 4(11); \
+        stwu    18, 4(11); \
+        stwu    19, 4(11); \
+        stwu    20, 4(11); \
+        stwu    21, 4(11); \
+        stwu    22, 4(11); \
+        stwu    23, 4(11); \
+        stwu    24, 4(11); \
+        stwu    25, 4(11); \
+        stwu    26, 4(11); \
+        stwu    27, 4(11); \
+        stwu    28, 4(11); \
+        stwu    29, 4(11); \
+        stwu    30, 4(11); \
+        stwu    31, 4(11); \
+        stfdu   14, 8(11); \
+        stfdu   15, 8(11); \
+        stfdu   16, 8(11); \
+        stfdu   17, 8(11); \
+        stfdu   18, 8(11); \
+        stfdu   19, 8(11); \
+        stfdu   20, 8(11); \
+        stfdu   21, 8(11); \
+        stfdu   22, 8(11); \
+        stfdu   23, 8(11); \
+        stfdu   24, 8(11); \
+        stfdu   25, 8(11); \
+        stfdu   26, 8(11); \
+        stfdu   27, 8(11); \
+        stfdu   28, 8(11); \
+        stfdu   29, 8(11); \
+        stfdu   30, 8(11); \
+        stfdu   31, 8(11)
+
+#define Restore_callee_save \
+        addic   11, 1, 16-4; \
+        lwzu    14, 4(11); \
+        lwzu    15, 4(11); \
+        lwzu    16, 4(11); \
+        lwzu    17, 4(11); \
+        lwzu    18, 4(11); \
+        lwzu    19, 4(11); \
+        lwzu    20, 4(11); \
+        lwzu    21, 4(11); \
+        lwzu    22, 4(11); \
+        lwzu    23, 4(11); \
+        lwzu    24, 4(11); \
+        lwzu    25, 4(11); \
+        lwzu    26, 4(11); \
+        lwzu    27, 4(11); \
+        lwzu    28, 4(11); \
+        lwzu    29, 4(11); \
+        lwzu    30, 4(11); \
+        lwzu    31, 4(11); \
+        lfdu    14, 8(11); \
+        lfdu    15, 8(11); \
+        lfdu    16, 8(11); \
+        lfdu    17, 8(11); \
+        lfdu    18, 8(11); \
+        lfdu    19, 8(11); \
+        lfdu    20, 8(11); \
+        lfdu    21, 8(11); \
+        lfdu    22, 8(11); \
+        lfdu    23, 8(11); \
+        lfdu    24, 8(11); \
+        lfdu    25, 8(11); \
+        lfdu    26, 8(11); \
+        lfdu    27, 8(11); \
+        lfdu    28, 8(11); \
+        lfdu    29, 8(11); \
+        lfdu    30, 8(11); \
+        lfdu    31, 8(11)
+
+        .section ".text"
+
+        .globl  call_gen_code
+        .type   call_gen_code, @function
+call_gen_code:
+    /* Allocate and link stack frame */
+        stwu    1, -256(1)
+    /* Save return address */
+        mflr    0
+        stw     0, 256+4(1)
+    /* Save all callee-save registers */
+        Save_callee_save
+    /* Shuffle arguments */
+        mtlr    3
+        mr 3, 4
+        mr 4, 5
+        mr 5, 6
+        mr 6, 7
+    /* Call the function */
+        blrl
+    /* Restore callee-save registers */
+        Restore_callee_save
+    /* Reload return address */
+        lwz     0, 256+4(1)
+        mtlr    0
+    /* Return */
+        addi    1, 1, 256
+        blr
+
+        .globl  caml_c_call
+        .type   caml_c_call, @function
+caml_c_call:
+    /* Jump to C function (address in 11) */
+        mtctr   11
+        bctr
diff --git a/testasmcomp/power-rhapsody.S b/testasmcomp/power-rhapsody.S
new file mode 100644 (file)
index 0000000..69f2782
--- /dev/null
@@ -0,0 +1,129 @@
+/*********************************************************************/
+/*                                                                   */
+/*                          Objective Caml                           */
+/*                                                                   */
+/*           Xavier Leroy, projet Cristal, INRIA Rocquencourt        */
+/*                                                                   */
+/* Copyright 1996 Institut National de Recherche en Informatique et  */
+/* en Automatique.  All rights reserved.  This file is distributed   */
+/* under the terms of the Q Public License version 1.0.              */
+/*                                                                   */
+/*********************************************************************/
+
+/* $Id: power-rhapsody.S,v 1.3 1999/11/17 18:58:44 xleroy Exp $ */
+
+/* Save and restore all callee-save registers */
+/* GPR 14 at sp+16 ... GPR 31 at sp+84
+   FPR 14 at sp+92 ... FPR 31 at sp+228 */
+
+#define Save_callee_save \
+        addic   r11, r1, 16-4; \
+        stwu    r14, 4(r11); \
+        stwu    r15, 4(r11); \
+        stwu    r16, 4(r11); \
+        stwu    r17, 4(r11); \
+        stwu    r18, 4(r11); \
+        stwu    r19, 4(r11); \
+        stwu    r20, 4(r11); \
+        stwu    r21, 4(r11); \
+        stwu    r22, 4(r11); \
+        stwu    r23, 4(r11); \
+        stwu    r24, 4(r11); \
+        stwu    r25, 4(r11); \
+        stwu    r26, 4(r11); \
+        stwu    r27, 4(r11); \
+        stwu    r28, 4(r11); \
+        stwu    r29, 4(r11); \
+        stwu    r30, 4(r11); \
+        stwu    r31, 4(r11); \
+        stfdu   f14, 8(r11); \
+        stfdu   f15, 8(r11); \
+        stfdu   f16, 8(r11); \
+        stfdu   f17, 8(r11); \
+        stfdu   f18, 8(r11); \
+        stfdu   f19, 8(r11); \
+        stfdu   f20, 8(r11); \
+        stfdu   f21, 8(r11); \
+        stfdu   f22, 8(r11); \
+        stfdu   f23, 8(r11); \
+        stfdu   f24, 8(r11); \
+        stfdu   f25, 8(r11); \
+        stfdu   f26, 8(r11); \
+        stfdu   f27, 8(r11); \
+        stfdu   f28, 8(r11); \
+        stfdu   f29, 8(r11); \
+        stfdu   f30, 8(r11); \
+        stfdu   f31, 8(r11)
+
+#define Restore_callee_save \
+        addic   r11, r1, 16-4; \
+        lwzu    r14, 4(r11); \
+        lwzu    r15, 4(r11); \
+        lwzu    r16, 4(r11); \
+        lwzu    r17, 4(r11); \
+        lwzu    r18, 4(r11); \
+        lwzu    r19, 4(r11); \
+        lwzu    r20, 4(r11); \
+        lwzu    r21, 4(r11); \
+        lwzu    r22, 4(r11); \
+        lwzu    r23, 4(r11); \
+        lwzu    r24, 4(r11); \
+        lwzu    r25, 4(r11); \
+        lwzu    r26, 4(r11); \
+        lwzu    r27, 4(r11); \
+        lwzu    r28, 4(r11); \
+        lwzu    r29, 4(r11); \
+        lwzu    r30, 4(r11); \
+        lwzu    r31, 4(r11); \
+        lfdu    f14, 8(r11); \
+        lfdu    f15, 8(r11); \
+        lfdu    f16, 8(r11); \
+        lfdu    f17, 8(r11); \
+        lfdu    f18, 8(r11); \
+        lfdu    f19, 8(r11); \
+        lfdu    f20, 8(r11); \
+        lfdu    f21, 8(r11); \
+        lfdu    f22, 8(r11); \
+        lfdu    f23, 8(r11); \
+        lfdu    f24, 8(r11); \
+        lfdu    f25, 8(r11); \
+        lfdu    f26, 8(r11); \
+        lfdu    f27, 8(r11); \
+        lfdu    f28, 8(r11); \
+        lfdu    f29, 8(r11); \
+        lfdu    f30, 8(r11); \
+        lfdu    f31, 8(r11)
+
+        .text
+
+        .globl  _call_gen_code
+_call_gen_code:
+    /* Allocate and link stack frame */
+        stwu    r1, -256(r1)
+    /* Save return address */
+        mflr    r0
+        stw     r0, 256+4(r1)
+    /* Save all callee-save registers */
+        Save_callee_save
+    /* Shuffle arguments */
+        mtlr    r3
+        mr r3, r4
+        mr r4, r5
+        mr r5, r6
+        mr r6, r7
+    /* Call the function */
+        blrl
+    /* Restore callee-save registers */
+        Restore_callee_save
+    /* Reload return address */
+        lwz     r0, 256+4(r1)
+        mtlr    r0
+    /* Return */
+        addi    r1, r1, 256
+        blr
+
+        .globl  _caml_c_call
+_caml_c_call:
+    /* Jump to C function (address in 11) */
+        mtctr   r11
+        bctr
diff --git a/testasmcomp/quicksort.cmm b/testasmcomp/quicksort.cmm
new file mode 100644 (file)
index 0000000..94c1006
--- /dev/null
@@ -0,0 +1,43 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: quicksort.cmm,v 1.6 2000/06/25 19:54:50 xleroy Exp $ *)
+
+(function "quicksort" (lo: int hi: int a: addr)
+  (if (< lo hi)
+      (let (i lo
+            j hi
+            pivot (addraref a hi))
+        (while (< i j)
+          (catch
+              (while 1
+                (if (>= i hi) exit [])
+                (if (> (addraref a i) pivot) exit [])
+                (assign i (+ i 1)))
+           with [])
+          (catch
+              (while 1
+                (if (<= j lo) exit [])
+                (if (< (addraref a j) pivot) exit [])
+                (assign j (- j 1)))
+           with [])
+          (if (< i j)
+              (let temp (addraref a i)
+                   (addraset a i (addraref a j))
+                   (addraset a j temp))
+            []))
+        (let temp (addraref a i)
+             (addraset a i (addraref a hi))
+             (addraset a hi temp))
+        (app "quicksort" lo (- i 1) a unit)
+        (app "quicksort" (+ i 1) hi a unit))
+    []))
diff --git a/testasmcomp/quicksort2.cmm b/testasmcomp/quicksort2.cmm
new file mode 100644 (file)
index 0000000..3cb14ee
--- /dev/null
@@ -0,0 +1,49 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: quicksort2.cmm,v 1.8 2000/06/29 11:45:23 xleroy Exp $ *)
+
+(function "cmp" (i: int j: int)
+  (- i j))
+
+(function "quick" (lo: int hi: int a: addr cmp: addr)
+  (if (< lo hi)
+      (let (i lo
+            j hi
+            pivot (intaref a hi))
+        (while (< i j)
+          (catch
+            (while 1
+              (if (>= i hi) exit [])
+              (if (> (app cmp (intaref a i) pivot int) 0) exit [])
+              (assign i (+ i 1)))
+            with [])
+          (catch
+            (while 1
+              (if (<= j lo) exit [])
+              (if (< (app cmp (intaref a j) pivot int) 0) exit [])
+              (assign j (- j 1)))
+           with [])
+          (if (< i j)
+              (let temp (intaref a i)
+                   (intaset a i (intaref a j))
+                   (intaset a j temp))
+            []))
+        (let temp (intaref a i)
+             (intaset a i (intaref a hi))
+             (intaset a hi temp))
+        (app "quick" lo (- i 1) a cmp unit)
+        (app "quick" (+ i 1) hi a cmp unit))
+    []))
+
+(function "quicksort" (lo: int hi: int a: addr)
+  (app "quick" lo hi a "cmp" unit))
diff --git a/testasmcomp/soli.cmm b/testasmcomp/soli.cmm
new file mode 100644 (file)
index 0000000..6110075
--- /dev/null
@@ -0,0 +1,109 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: soli.cmm,v 1.7 2003/06/30 08:28:48 xleroy Exp $ *)
+
+("d1": int 0 int 1
+ "d2": int 1 int 0
+ "d3": int 0 int -1
+ "d4": int -1 int 0
+ "dir": addr "d1" addr "d2" addr "d3" addr "d4")
+
+("counter": int 0)
+
+(* Out = 0  Empty = 1  Peg = 2 *)
+
+("line0": int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0
+ "line1": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0
+ "line2": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0
+ "line3": int 0 int 2 int 2 int 2 int 2 int 2 int 2 int 2 int 0
+ "line4": int 0 int 2 int 2 int 2 int 1 int 2 int 2 int 2 int 0
+ "line5": int 0 int 2 int 2 int 2 int 2 int 2 int 2 int 2 int 0
+ "line6": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0
+ "line7": int 0 int 0 int 0 int 2 int 2 int 2 int 0 int 0 int 0
+ "line8": int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0 int 0
+ "board": addr "line0" addr "line1" addr "line2" addr "line3"
+          addr "line4" addr "line5" addr "line6" addr "line7" addr "line8")
+
+("format": string "%d\n\000")
+
+(function "solve" (m: int)
+  (store int "counter" (+ (load int "counter") 1))
+  (if (== m 31)
+      (== (intaref (addraref "board" 4) 4) 2)
+    (try
+     (if (== (mod (load int "counter") 500) 0)
+          (extcall "printf_int" "format" (load int "counter") unit)
+       [])
+     (let i 1
+       (while (<= i 7)
+         (let j 1
+           (while (<= j 7)
+             (if (== (intaref (addraref "board" i) j) 2)
+                 (seq
+                  (let k 0
+                    (while (<= k 3)
+                      (let (d1 (intaref (addraref "dir" k) 0)
+                            d2 (intaref (addraref "dir" k) 1)
+                            i1 (+ i d1)
+                            i2 (+ i1 d1)
+                            j1 (+ j d2)
+                            j2 (+ j1 d2))
+                        (if (== (intaref (addraref "board" i1) j1) 2)
+                            (if (== (intaref (addraref "board" i2) j2) 1)
+                                (seq
+                                 (intaset (addraref "board" i) j 1)
+                                 (intaset (addraref "board" i1) j1 1)
+                                 (intaset (addraref "board" i2) j2 2)
+                                 (if (app "solve" (+ m 1) int)
+                                     (raise 0a)
+                                   [])
+                                 (intaset (addraref "board" i) j 2)
+                                 (intaset (addraref "board" i1) j1 2)
+                                 (intaset (addraref "board" i2) j2 1))
+                              [])
+                          []))
+                      (assign k (+ k 1)))))
+               [])
+             (assign j (+ j 1))))
+         (assign i (+ i 1))))
+     0
+   with bucket
+     1)))
+
+("format_out": string ".\000")
+("format_empty": string " \000")
+("format_peg": string "$\000")
+("format_newline": string "\n\000")
+
+(function "print_board" ()
+  (let i 0
+    (while (< i 9)
+      (let j 0
+        (while (< j 9)
+          (switch 3 (intaref (addraref "board" i) j)
+            case 0:
+              (extcall "print_string" "format_out" unit)
+            case 1:
+              (extcall "print_string" "format_empty" unit)
+            case 2:
+              (extcall "print_string" "format_peg" unit))
+          (assign j (+ j 1))))
+      (extcall "print_string" "format_newline" unit)
+      (assign i (+ i 1)))))
+
+(function "solitaire" ()
+  (seq
+    (if (app "solve" 0 int)
+        (app "print_board" [] unit)
+      [])
+    0))
diff --git a/testasmcomp/sparc.S b/testasmcomp/sparc.S
new file mode 100644 (file)
index 0000000..a2edbf5
--- /dev/null
@@ -0,0 +1,41 @@
+/***********************************************************************/
+/*                                                                     */
+/*                           Objective Caml                            */
+/*                                                                     */
+/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1996 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the Q Public License version 1.0.               */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: sparc.S,v 1.2 1999/11/17 18:58:44 xleroy Exp $ */
+
+#ifndef SYS_solaris
+#define Call_gen_code _call_gen_code
+#define Caml_c_call _caml_c_call
+#else
+#define Call_gen_code call_gen_code
+#define Caml_c_call caml_c_call
+#endif
+
+        .global Call_gen_code
+Call_gen_code:
+        save    %sp, -96, %sp
+        mov     %i0, %l0
+        mov     %i1, %i0
+        mov     %i2, %i1
+        mov     %i3, %i2
+        mov     %i4, %i3
+        mov     %i5, %i4
+        call    %l0
+        nop
+        mov     %o0, %i0
+        ret
+        restore
+
+        .global Caml_c_call
+Caml_c_call:
+        jmp     %g4
+        nop
diff --git a/testasmcomp/tagged-fib.cmm b/testasmcomp/tagged-fib.cmm
new file mode 100644 (file)
index 0000000..0d10ce2
--- /dev/null
@@ -0,0 +1,19 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: tagged-fib.cmm,v 1.4 1999/11/17 18:58:44 xleroy Exp $ *)
+
+(function "fib" (n: int)
+  (if (< n 5)
+      3
+    (-  (+ (app "fib" (- n 2) int) (app "fib" (- n 4) int)) 1)))
+
diff --git a/testasmcomp/tagged-integr.cmm b/testasmcomp/tagged-integr.cmm
new file mode 100644 (file)
index 0000000..c42eef7
--- /dev/null
@@ -0,0 +1,45 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: tagged-integr.cmm,v 1.5 2000/07/07 14:09:23 xleroy Exp $ *)
+
+("res_square": skip 8)
+("h": skip 8)
+("x": skip 8)
+("s": skip 8)
+("res_integr": skip 8)
+
+(function "square" (x: addr)
+   (let r "res_square"
+        (store float r ( *f (load float x) (load float x)))
+        r))
+
+(function "integr" (f: addr low: addr high: addr n: int)
+  (let (h "h" x "x" s "s" i n)
+    (store float h (/f (-f (load float high) (load float low)) (floatofint n)))
+    (store float x (load float low))
+    (store float s 0.0)
+    (while (> i 0)
+      (store float s (+f (load float s) (load float (app f x addr))))
+      (store float x (+f (load float x) (load float h)))
+      (assign i (- i 1)))
+    (store float "res_integr" ( *f (load float s) (load float h)))
+    "res_integr"))
+
+("low": skip 8)
+("hi": skip 8)
+
+(function "test" (n: int)
+  (store float "low" 0.0)
+  (store float "hi" 1.0)
+  (load float (app "integr" "square" "low" "hi" n addr)))
+
diff --git a/testasmcomp/tagged-quicksort.cmm b/testasmcomp/tagged-quicksort.cmm
new file mode 100644 (file)
index 0000000..1672710
--- /dev/null
@@ -0,0 +1,46 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: tagged-quicksort.cmm,v 1.5 2000/06/29 11:45:24 xleroy Exp $ *)
+
+(function "quick" (lo: int hi: int a: addr)
+  (if (< lo hi)
+      (let (i lo
+            j hi
+            pivot (addraref a (>>s hi 1)))
+        (while (< i j)
+          (catch
+              (while 1
+                (if (>= i hi) exit [])
+                (if (> (addraref a (>>s i 1)) pivot) exit [])
+                (assign i (+ i 2)))
+           with [])
+          (catch
+              (while 1
+                (if (<= j lo) exit [])
+                (if (< (addraref a (>>s j 1)) pivot) exit [])
+                (assign j (- j 2)))
+           with [])
+          (if (< i j)
+              (let temp (addraref a (>>s i 1))
+                   (addraset a (>>s i 1) (addraref a (>>s j 1)))
+                   (addraset a (>>s j 1) temp))
+            []))
+        (let temp (addraref a (>>s i 1))
+             (addraset a (>>s i 1) (addraref a (>>s hi 1)))
+             (addraset a (>>s hi 1) temp))
+        (app "quick" lo (- i 2) a unit)
+        (app "quick" (+ i 2) hi a unit))
+    []))
+
+(function "quicksort" (lo: int hi: int a: addr)
+   (app "quick" (+ (<< lo 1) 1) (+ (<< hi 1) 1) a unit))
diff --git a/testasmcomp/tagged-tak.cmm b/testasmcomp/tagged-tak.cmm
new file mode 100644 (file)
index 0000000..af3c5c6
--- /dev/null
@@ -0,0 +1,23 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: tagged-tak.cmm,v 1.6 2000/07/07 14:09:23 xleroy Exp $ *)
+
+(function "tak" (x:int y:int z:int)
+  (if (> x y)
+      (app "tak" (app "tak" (- x 2) y z int)
+                 (app "tak" (- y 2) z x int)
+                 (app "tak" (- z 2) x y int) int)
+      z))
+
+(function "takmain" (dummy: int)
+   (app "tak" 37 25 13 int))
diff --git a/testasmcomp/tak.cmm b/testasmcomp/tak.cmm
new file mode 100644 (file)
index 0000000..5dcee85
--- /dev/null
@@ -0,0 +1,23 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                           Objective Caml                            *)
+(*                                                                     *)
+(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the Q Public License version 1.0.               *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: tak.cmm,v 1.5 2000/06/25 19:54:50 xleroy Exp $ *)
+
+(function "tak" (x:int y:int z:int)
+  (if (> x y)
+      (app "tak" (app "tak" (- x 1) y z int)
+                 (app "tak" (- y 1) z x int)
+                 (app "tak" (- z 1) x y int) int)
+      z))
+
+(function "takmain" (dummy: int)
+   (app "tak" 18 12 6 int))
diff --git a/testlabl/.cvsignore b/testlabl/.cvsignore
new file mode 100644 (file)
index 0000000..4c57147
--- /dev/null
@@ -0,0 +1 @@
+*.out *.out2
\ No newline at end of file
diff --git a/testlabl/Makefile b/testlabl/Makefile
new file mode 100644 (file)
index 0000000..e3b39cf
--- /dev/null
@@ -0,0 +1,17 @@
+# $Id: Makefile,v 1.3 2002/06/18 10:47:22 garrigue Exp $
+# Test extensions
+
+CAMLTOP=../boot/ocamlrun ../ocaml -I ../stdlib
+
+test: test-poly
+
+test-poly:
+       TERM=norepeat $(CAMLTOP) < poly.ml > poly.out 2>&1
+       TERM=norepeat $(CAMLTOP) -principal < poly.ml > poly.out2 2>&1
+       @diff poly.exp poly.out && echo ocaml OK || echo ocaml changed
+       @diff poly.exp2 poly.out2 && echo ocaml -principal OK \
+          || echo ocaml -principal changed
+
+promote:
+       mv poly.out poly.exp
+       mv poly.out2 poly.exp2
diff --git a/testlabl/bugs/yamagata021012.ml b/testlabl/bugs/yamagata021012.ml
new file mode 100644 (file)
index 0000000..212a168
--- /dev/null
@@ -0,0 +1,193 @@
+(* The module begins *)
+exception Out_of_range
+
+class type ['a] cursor =
+  object
+    method get : 'a
+    method incr : unit -> unit
+    method is_last : bool
+  end
+
+class type ['a] storage =
+  object ('self)
+    method first : 'a cursor
+    method len : int
+    method nth : int -> 'a cursor
+    method copy : 'self
+    method sub : int -> int -> 'self
+    method concat : 'a storage -> 'self
+    method fold : 'b. ('a -> int -> 'b -> 'b) -> 'b -> 'b
+    method iter : ('a -> unit) -> unit
+  end
+
+class virtual ['a, 'cursor] storage_base =
+  object (self : 'self)
+    constraint 'cursor = 'a #cursor
+    method virtual first : 'cursor
+    method virtual len : int
+    method virtual copy : 'self
+    method virtual sub : int -> int -> 'self
+    method virtual concat : 'a storage -> 'self
+    method fold : 'b. ('a -> int -> 'b -> 'b) -> 'b -> 'b = fun f a0 ->
+      let cur = self#first in
+      let rec loop count a =
+       if count >= self#len then a else
+       let a' = f cur#get count a in
+       cur#incr (); loop (count + 1) a'
+      in
+      loop 0 a0
+    method iter proc =
+      let p = self#first in
+      for i = 0 to self#len - 2 do proc p#get; p#incr () done;
+      if self#len > 0 then proc p#get else ()
+  end
+
+class type ['a] obj_input_channel =
+  object
+    method get : unit -> 'a
+    method close : unit -> unit
+  end
+
+class type ['a] obj_output_channel =
+  object
+    method put : 'a -> unit
+    method flush : unit -> unit
+    method close : unit -> unit
+  end
+
+module UChar =
+struct
+
+  type t = int
+
+  let highest_bit = 1 lsl 30
+  let lower_bits = highest_bit - 1
+
+  let char_of c = 
+    try Char.chr c with Invalid_argument _ ->  raise Out_of_range
+
+  let of_char = Char.code
+
+  let code c =
+    if c lsr 30 = 0
+    then c
+    else raise Out_of_range
+
+  let chr n =
+    if n >= 0 && (n lsr 31 = 0) then n else raise Out_of_range
+
+  let uint_code c = c
+  let chr_of_uint n = n
+
+end
+
+type uchar = UChar.t
+
+let int_of_uchar u = UChar.uint_code u
+let uchar_of_int n = UChar.chr_of_uint n
+
+class type ucursor = [uchar] cursor
+
+class type ustorage = [uchar] storage
+
+class virtual ['ucursor] ustorage_base = [uchar, 'ucursor] storage_base
+
+module UText =
+struct
+
+(* the internal representation is UCS4 with big endian*)
+(* The most significant digit appears first. *)
+let get_buf s i =
+  let n = Char.code s.[i] in
+  let n = (n lsl 8) lor (Char.code s.[i + 1]) in
+  let n = (n lsl 8) lor (Char.code s.[i + 2]) in
+  let n = (n lsl 8) lor (Char.code s.[i + 3]) in
+  UChar.chr_of_uint n
+
+let set_buf s i u =
+  let n = UChar.uint_code u in
+  begin
+    s.[i] <- Char.chr (n lsr 24);
+    s.[i + 1] <- Char.chr (n lsr 16 lor 0xff);
+    s.[i + 2] <- Char.chr (n lsr 8 lor 0xff);
+    s.[i + 3] <- Char.chr (n lor 0xff);
+  end
+
+let init_buf buf pos init =
+  if init#len = 0 then () else
+  let cur = init#first in
+  for i = 0 to init#len - 2 do
+    set_buf buf (pos + i lsl 2) (cur#get); cur#incr ()
+  done;
+  set_buf buf (pos + (init#len - 1) lsl 2) (cur#get)
+
+let make_buf init =
+  let s = String.create (init#len lsl 2) in
+  init_buf s 0 init; s
+
+class text_raw buf =
+  object (self : 'self)
+    inherit [cursor] ustorage_base
+    val contents = buf
+    method first = new cursor (self :> text_raw) 0 
+    method len = (String.length contents) / 4
+    method get i = get_buf contents (4 * i)
+    method nth i = new cursor (self :> text_raw) i
+    method copy = {< contents = String.copy contents >}
+    method sub pos len =
+      {< contents = String.sub contents (pos * 4) (len * 4) >}
+    method concat (text : ustorage) =
+      let buf = String.create (String.length contents + 4 * text#len) in
+      String.blit contents 0 buf 0 (String.length contents);
+      init_buf buf (String.length contents) text;
+      {< contents = buf >}
+  end
+and cursor text i =
+  object
+    val contents = text
+    val mutable pos = i
+    method get = contents#get pos
+    method incr () = pos <- pos + 1
+    method is_last = (pos + 1 >= contents#len)
+  end
+
+class string_raw buf =
+  object
+    inherit text_raw buf
+    method set i u = set_buf contents (4 * i) u
+  end
+
+class text init = text_raw (make_buf init)
+class string init = string_raw (make_buf init)
+
+let of_string s =
+  let buf = String.make (4 * String.length s) '\000' in
+  for i = 0 to String.length s - 1 do
+    buf.[4 * i] <- s.[i]
+  done;
+  new text_raw buf
+
+let make len u =
+  let s = String.create (4 * len) in
+  for i = 0 to len - 1 do set_buf s (4 * i) u done;
+  new string_raw s
+
+let create len = make len (UChar.chr 0)
+
+let copy s = s#copy
+
+let sub s start len = s#sub start len
+
+let fill s start len u =
+  for i = start to start + len - 1 do s#set i u done
+
+let blit src srcoff dst dstoff len =
+  for i = 0 to len - 1 do
+    let u = src#get (srcoff + i) in
+    dst#set (dstoff + i) u
+  done
+
+let concat s1 s2 = s1#concat (s2 (* : #ustorage *) :> uchar storage)
+
+let iter proc s = s#iter proc
+end
diff --git a/testlabl/dirs_multimatch b/testlabl/dirs_multimatch
new file mode 100644 (file)
index 0000000..b449514
--- /dev/null
@@ -0,0 +1 @@
+parsing typing bytecomp driver toplevel
\ No newline at end of file
diff --git a/testlabl/dirs_poly b/testlabl/dirs_poly
new file mode 100644 (file)
index 0000000..3aec606
--- /dev/null
@@ -0,0 +1 @@
+bytecomp byterun driver parsing stdlib tools toplevel typing utils otherlibs/labltk/browser/searchpos.ml
diff --git a/testlabl/fixedtypes.ml b/testlabl/fixedtypes.ml
new file mode 100644 (file)
index 0000000..a7d7ca4
--- /dev/null
@@ -0,0 +1,77 @@
+(* cvs update -r fixedtypes parsing typing *)
+
+(* recursive types *)
+class c = object (self) method m = 1 method s = self end
+module type S = sig type t = private #c end;;
+
+module M : S = struct type t = c end
+module type S' = S with type t = c;;
+
+class d = object inherit c method n = 2 end
+module type S2 = S with type t = private #d;;
+module M2 : S = struct type t = d end;;
+module M3 : S = struct type t = private #d end;;
+
+module T1 = struct
+  type ('a,'b) a = [`A of 'a | `B of 'b]
+  type ('a,'b) b = [`Z | ('a,'b) a]
+end
+module type T2 = sig
+  type a and b
+  val evala : a -> int
+  val evalb : b -> int
+end
+module type T3 = sig
+  type a0 = private [> (a0,b0) T1.a]
+  and b0 = private [> (a0,b0) T1.b]
+end
+module type T4 = sig
+  include T3
+  include T2 with type a = a0 and type b = b0
+end
+module F(X:T4) = struct
+  type a = X.a and b = X.b
+  let a = X.evala (`B `Z)
+  let b = X.evalb (`A(`B `Z))
+  let a2b (x : a) : b = `A x
+  let b2a (x : b) : a = `B x
+end
+module M4 = struct
+  type a = [`A of a | `B of b | `ZA]
+  and b = [`A of a | `B of b | `Z]
+  type a0 = a
+  type b0 = b
+  let rec eval0 = function
+      `A a -> evala a
+    | `B b -> evalb b
+  and evala : a -> int = function
+      #T1.a as x -> 1 + eval0 x
+    | `ZA -> 3
+  and evalb : b -> int = function
+      #T1.a as x -> 1 + eval0 x
+    | `Z -> 7
+end
+module M5 = F(M4)
+
+module M6 : sig
+  class ci : int ->
+    object
+      val x : int
+      method x : int
+      method move : int -> unit
+    end      
+  type c = private #ci
+  val create : int -> c
+end = struct
+  class ci x = object
+    val mutable x : int = x
+    method x = x
+    method move d = x <- x+d
+  end
+  type c = ci
+  let create = new ci
+end
+let f (x : M6.c) = x#move 3; x#x;;
+
+module M : sig type t = private [> `A of bool] end =
+  struct type t = [`A of int] end
diff --git a/testlabl/mixin.ml b/testlabl/mixin.ml
new file mode 100644 (file)
index 0000000..f3339d3
--- /dev/null
@@ -0,0 +1,146 @@
+(* $Id: mixin.ml,v 1.3 2003/11/19 02:36:57 garrigue Exp $ *)
+
+open StdLabels
+open MoreLabels
+
+(* Use maps for substitutions and sets for free variables *)
+
+module Subst = Map.Make(struct type t = string let compare = compare end)
+module Names = Set.Make(struct type t = string let compare = compare end)
+
+
+(* Variables are common to lambda and expr *)
+
+type var = [`Var of string]
+
+let subst_var ~subst : var -> _ =
+  function `Var s as x ->
+    try Subst.find s subst
+    with Not_found -> x
+
+let free_var : var -> _ = function `Var s -> Names.singleton s
+
+
+(* The lambda language: free variables, substitutions, and evaluation *)
+
+type 'a lambda = [`Var of string | `Abs of string * 'a | `App of 'a * 'a]
+
+let free_lambda ~free_rec : _ lambda -> _ = function
+    #var as x -> free_var x
+  | `Abs (s, t) -> Names.remove s (free_rec t)
+  | `App (t1, t2) -> Names.union (free_rec t1) (free_rec t2)
+
+let map_lambda ~map_rec : _ lambda -> _ = function
+    #var as x -> x
+  | `Abs (s, t) as l ->
+      let t' = map_rec t in
+      if t == t' then l else `Abs(s, t')
+  | `App (t1, t2) as l ->
+      let t'1 = map_rec t1 and t'2 = map_rec t2 in
+      if t'1 == t1 && t'2 == t2 then l else `App (t'1, t'2)
+
+let next_id =
+  let current = ref 3 in
+  fun () -> incr current; !current
+
+let subst_lambda ~subst_rec ~free ~subst : _ lambda -> _ = function
+    #var as x -> subst_var ~subst x
+  | `Abs(s, t) as l ->
+      let used = free t in
+      let used_expr =
+        Subst.fold subst ~init:[]
+          ~f:(fun ~key ~data acc ->
+                if Names.mem s used then data::acc else acc) in
+      if List.exists used_expr ~f:(fun t -> Names.mem s (free t)) then
+        let name = s ^ string_of_int (next_id ()) in
+        `Abs(name,
+             subst_rec ~subst:(Subst.add ~key:s ~data:(`Var name) subst) t)
+      else
+        map_lambda ~map_rec:(subst_rec ~subst:(Subst.remove s subst)) l
+  | `App _ as l ->
+      map_lambda ~map_rec:(subst_rec ~subst) l
+
+let eval_lambda ~eval_rec ~subst l =
+  match map_lambda ~map_rec:eval_rec l with
+    `App(`Abs(s,t1), t2) ->
+      eval_rec (subst ~subst:(Subst.add ~key:s ~data:t2 Subst.empty) t1)
+  | t -> t
+
+(* Specialized versions to use on lambda *)
+
+let rec free1 x = free_lambda ~free_rec:free1 x
+let rec subst1 ~subst = subst_lambda ~subst_rec:subst1 ~free:free1 ~subst
+let rec eval1 x = eval_lambda ~eval_rec:eval1 ~subst:subst1 x
+
+
+(* The expr language of arithmetic expressions *)
+
+type 'a expr =
+    [`Var of string | `Num of int | `Add of 'a * 'a
+    | `Neg of 'a | `Mult of 'a * 'a]
+
+let free_expr ~free_rec : _ expr -> _ = function
+    #var as x -> free_var x
+  | `Num _ -> Names.empty
+  | `Add(x, y) -> Names.union (free_rec x) (free_rec y)
+  | `Neg x -> free_rec x
+  | `Mult(x, y) -> Names.union (free_rec x) (free_rec y)
+
+(* Here map_expr helps a lot *)
+let map_expr ~map_rec : _ expr -> _ = function
+    #var as x -> x
+  | `Num _ as x -> x
+  | `Add(x, y) as e ->
+      let x' = map_rec x and y' = map_rec y in
+      if x == x' && y == y' then e
+      else `Add(x', y')
+  | `Neg x as e ->
+      let x' = map_rec x in
+      if x == x' then e else `Neg x'
+  | `Mult(x, y) as e ->
+      let x' = map_rec x and y' = map_rec y in
+      if x == x' && y == y' then e
+      else `Mult(x', y')
+
+let subst_expr ~subst_rec ~subst : _ expr -> _ = function
+    #var as x -> subst_var ~subst x
+  | #expr as e -> map_expr ~map_rec:(subst_rec ~subst) e
+
+let eval_expr ~eval_rec e =
+  match map_expr ~map_rec:eval_rec e with
+    `Add(`Num m, `Num n) -> `Num (m+n)
+  | `Neg(`Num n) -> `Num (-n)
+  | `Mult(`Num m, `Num n) -> `Num (m*n)
+  | #expr as e -> e
+
+(* Specialized versions *)
+
+let rec free2 x = free_expr ~free_rec:free2 x
+let rec subst2 ~subst = subst_expr ~subst_rec:subst2 ~subst
+let rec eval2 x = eval_expr ~eval_rec:eval2 x
+
+
+(* The lexpr language, reunion of lambda and expr *)
+
+type lexpr =
+  [ `Var of string | `Abs of string * lexpr | `App of lexpr * lexpr
+  | `Num of int | `Add of lexpr * lexpr | `Neg of lexpr
+  | `Mult of lexpr * lexpr ]
+
+let rec free : lexpr -> _ = function
+    #lambda as x -> free_lambda ~free_rec:free x
+  | #expr as x -> free_expr ~free_rec:free x
+
+let rec subst ~subst:s : lexpr -> _ = function
+    #lambda as x -> subst_lambda ~subst_rec:subst ~subst:s ~free x
+  | #expr as x -> subst_expr ~subst_rec:subst ~subst:s x
+
+let rec eval : lexpr -> _ = function
+    #lambda as x -> eval_lambda ~eval_rec:eval ~subst x
+  | #expr as x -> eval_expr ~eval_rec:eval x
+
+(* A few examples:
+eval1 (`App(`Abs("x",`Var"x"), `Var"y"));;
+eval2 (`Add(`Mult(`Num 3,`Neg(`Num 2)), `Var"x"));;
+eval (`Add(`App(`Abs("x",`Mult(`Var"x",`Var"x")),`Num 2), `Num 5));;
+*)
diff --git a/testlabl/mixin2.ml b/testlabl/mixin2.ml
new file mode 100644 (file)
index 0000000..35fe213
--- /dev/null
@@ -0,0 +1,179 @@
+(* $Id: mixin2.ml,v 1.1 2003/11/19 02:36:57 garrigue Exp $ *)
+
+(* Full fledge version, using objects to structure code *)
+
+open StdLabels
+open MoreLabels
+
+(* Use maps for substitutions and sets for free variables *)
+
+module Subst = Map.Make(struct type t = string let compare = compare end)
+module Names = Set.Make(struct type t = string let compare = compare end)
+
+(* To build recursive objects *)
+
+let lazy_fix make =
+  let rec obj () = make (lazy (obj ()) : _ Lazy.t) in
+  obj ()
+
+let (!!) = Lazy.force
+
+(* The basic operations *)
+
+class type ['a, 'b] ops =
+  object
+    method free : 'b -> Names.t
+    method subst : sub:'a Subst.t -> 'b -> 'a
+    method eval : 'b -> 'a
+  end
+
+(* Variables are common to lambda and expr *)
+
+type var = [`Var of string]
+
+class ['a] var_ops = object (self : ('a, var) #ops)
+  constraint 'a = [> var]
+  method subst ~sub (`Var s as x) =
+    try Subst.find s sub with Not_found -> x
+  method free (`Var s) =
+    Names.singleton s
+  method eval (#var as v) = v
+end
+
+(* The lambda language: free variables, substitutions, and evaluation *)
+
+type 'a lambda = [`Var of string | `Abs of string * 'a | `App of 'a * 'a]
+
+let next_id =
+  let current = ref 3 in
+  fun () -> incr current; !current
+
+class ['a] lambda_ops (ops : ('a,'a) #ops Lazy.t) =
+  let var : 'a var_ops = new var_ops
+  and free = lazy !!ops#free
+  and subst = lazy !!ops#subst
+  and eval = lazy !!ops#eval in
+  object (self : ('a, 'a lambda) #ops)
+    constraint 'a = [> 'a lambda]
+    method free = function
+        #var as x -> var#free x
+      | `Abs (s, t) -> Names.remove s (!!free t)
+      | `App (t1, t2) -> Names.union (!!free t1) (!!free t2)
+
+    method map ~f = function
+        #var as x -> x
+      | `Abs (s, t) as l ->
+          let t' = f t in
+          if t == t' then l else `Abs(s, t')
+      | `App (t1, t2) as l ->
+          let t'1 = f t1 and t'2 = f t2 in
+          if t'1 == t1 && t'2 == t2 then l else `App (t'1, t'2)
+
+    method subst ~sub = function
+        #var as x -> var#subst ~sub x
+      | `Abs(s, t) as l ->
+          let used = !!free t in
+          let used_expr =
+            Subst.fold sub ~init:[]
+              ~f:(fun ~key ~data acc ->
+                if Names.mem s used then data::acc else acc) in
+          if List.exists used_expr ~f:(fun t -> Names.mem s (!!free t)) then
+            let name = s ^ string_of_int (next_id ()) in
+            `Abs(name,
+                 !!subst ~sub:(Subst.add ~key:s ~data:(`Var name) sub) t)
+          else
+            self#map ~f:(!!subst ~sub:(Subst.remove s sub)) l
+      | `App _ as l ->
+          self#map ~f:(!!subst ~sub) l
+
+    method eval l =
+      match self#map ~f:!!eval l with
+        `App(`Abs(s,t1), t2) ->
+          !!eval (!!subst ~sub:(Subst.add ~key:s ~data:t2 Subst.empty) t1)
+      | t -> t
+end
+
+(* Operations specialized to lambda *)
+
+let lambda = lazy_fix (new lambda_ops)
+
+(* The expr language of arithmetic expressions *)
+
+type 'a expr =
+    [ `Var of string | `Num of int | `Add of 'a * 'a
+    | `Neg of 'a | `Mult of 'a * 'a]
+
+class ['a] expr_ops (ops : ('a,'a) #ops Lazy.t) =
+  let var : 'a var_ops = new var_ops
+  and free = lazy !!ops#free
+  and subst = lazy !!ops#subst
+  and eval = lazy !!ops#eval in
+  object (self : ('a, 'a expr) #ops)
+    constraint 'a = [> 'a expr]
+    method free = function
+        #var as x -> var#free x
+      | `Num _ -> Names.empty
+      | `Add(x, y) -> Names.union (!!free x) (!!free y)
+      | `Neg x -> !!free x
+      | `Mult(x, y) -> Names.union (!!free x) (!!free y)
+
+    method map ~f = function
+        #var as x -> x
+      | `Num _ as x -> x
+      | `Add(x, y) as e ->
+          let x' = f x and y' = f y in
+          if x == x' && y == y' then e
+          else `Add(x', y')
+      | `Neg x as e ->
+          let x' = f x in
+          if x == x' then e else `Neg x'
+      | `Mult(x, y) as e ->
+          let x' = f x and y' = f y in
+          if x == x' && y == y' then e
+          else `Mult(x', y')
+
+    method subst ~sub = function
+        #var as x -> var#subst ~sub x
+      | #expr as e -> self#map ~f:(!!subst ~sub) e
+
+    method eval (#expr as e) =
+      match self#map ~f:!!eval e with
+        `Add(`Num m, `Num n) -> `Num (m+n)
+      | `Neg(`Num n) -> `Num (-n)
+      | `Mult(`Num m, `Num n) -> `Num (m*n)
+      | e -> e
+  end
+
+(* Specialized versions *)
+
+let expr = lazy_fix (new expr_ops)
+
+(* The lexpr language, reunion of lambda and expr *)
+
+type 'a lexpr = [ 'a lambda | 'a expr ]
+
+class ['a] lexpr_ops (ops : ('a,'a) #ops Lazy.t) =
+  let lambda = new lambda_ops ops in
+  let expr = new expr_ops ops in
+  object (self : ('a, 'a lexpr) #ops)
+    constraint 'a = [> 'a lexpr]
+    method free = function
+        #lambda as x -> lambda#free x
+      | #expr as x -> expr#free x
+
+    method subst ~sub = function
+        #lambda as x -> lambda#subst ~sub x
+      | #expr as x -> expr#subst ~sub x
+
+    method eval = function
+        #lambda as x -> lambda#eval x
+      | #expr as x -> expr#eval x
+end
+
+let lexpr = lazy_fix (new lexpr_ops)
+
+(* A few examples:
+lambda#eval (`App(`Abs("x",`Var"x"), `Var"y"));;
+expr#eval (`Add(`Mult(`Num 3,`Neg(`Num 2)), `Var"x"));;
+lexpr#eval (`Add(`App(`Abs("x",`Mult(`Var"x",`Var"x")),`Num 2), `Num 5));;
+*)
diff --git a/testlabl/mixin3.ml b/testlabl/mixin3.ml
new file mode 100644 (file)
index 0000000..2be0bd4
--- /dev/null
@@ -0,0 +1,173 @@
+(* $Id: mixin3.ml,v 1.1 2003/11/19 02:36:57 garrigue Exp $ *)
+
+(* Full fledge version, using objects to structure code *)
+
+open StdLabels
+open MoreLabels
+
+(* Use maps for substitutions and sets for free variables *)
+
+module Subst = Map.Make(struct type t = string let compare = compare end)
+module Names = Set.Make(struct type t = string let compare = compare end)
+
+(* To build recursive objects *)
+
+let lazy_fix make =
+  let rec obj () = make (lazy (obj ()) : _ Lazy.t) in
+  obj ()
+
+let (!!) = Lazy.force
+
+(* The basic operations *)
+
+class type ['a, 'b] ops =
+  object
+    method free : 'b -> Names.t
+    method subst : sub:'a Subst.t -> 'b -> 'a
+    method eval : 'b -> 'a
+  end
+
+(* Variables are common to lambda and expr *)
+
+type var = [`Var of string]
+
+let var = object (self : ([>var], var) #ops)
+  method subst ~sub (`Var s as x) =
+    try Subst.find s sub with Not_found -> x
+  method free (`Var s) =
+    Names.singleton s
+  method eval (#var as v) = v
+end
+
+(* The lambda language: free variables, substitutions, and evaluation *)
+
+type 'a lambda = [`Var of string | `Abs of string * 'a | `App of 'a * 'a]
+
+let next_id =
+  let current = ref 3 in
+  fun () -> incr current; !current
+
+let lambda_ops (ops : ('a,'a) #ops Lazy.t) =
+  let free = lazy !!ops#free
+  and subst = lazy !!ops#subst
+  and eval = lazy !!ops#eval in
+  object (self : ([> 'a lambda], 'a lambda) #ops)
+    method free = function
+        #var as x -> var#free x
+      | `Abs (s, t) -> Names.remove s (!!free t)
+      | `App (t1, t2) -> Names.union (!!free t1) (!!free t2)
+
+    method private map ~f = function
+        #var as x -> x
+      | `Abs (s, t) as l ->
+          let t' = f t in
+          if t == t' then l else `Abs(s, t')
+      | `App (t1, t2) as l ->
+          let t'1 = f t1 and t'2 = f t2 in
+          if t'1 == t1 && t'2 == t2 then l else `App (t'1, t'2)
+
+    method subst ~sub = function
+        #var as x -> var#subst ~sub x
+      | `Abs(s, t) as l ->
+          let used = !!free t in
+          let used_expr =
+            Subst.fold sub ~init:[]
+              ~f:(fun ~key ~data acc ->
+                if Names.mem s used then data::acc else acc) in
+          if List.exists used_expr ~f:(fun t -> Names.mem s (!!free t)) then
+            let name = s ^ string_of_int (next_id ()) in
+            `Abs(name,
+                 !!subst ~sub:(Subst.add ~key:s ~data:(`Var name) sub) t)
+          else
+            self#map ~f:(!!subst ~sub:(Subst.remove s sub)) l
+      | `App _ as l ->
+          self#map ~f:(!!subst ~sub) l
+
+    method eval l =
+      match self#map ~f:!!eval l with
+        `App(`Abs(s,t1), t2) ->
+          !!eval (!!subst ~sub:(Subst.add ~key:s ~data:t2 Subst.empty) t1)
+      | t -> t
+end
+
+(* Operations specialized to lambda *)
+
+let lambda = lazy_fix lambda_ops
+
+(* The expr language of arithmetic expressions *)
+
+type 'a expr =
+    [ `Var of string | `Num of int | `Add of 'a * 'a
+    | `Neg of 'a | `Mult of 'a * 'a]
+
+let expr_ops (ops : ('a,'a) #ops Lazy.t) =
+  let free = lazy !!ops#free
+  and subst = lazy !!ops#subst
+  and eval = lazy !!ops#eval in
+  object (self : ([> 'a expr], 'a expr) #ops)
+    method free = function
+        #var as x -> var#free x
+      | `Num _ -> Names.empty
+      | `Add(x, y) -> Names.union (!!free x) (!!free y)
+      | `Neg x -> !!free x
+      | `Mult(x, y) -> Names.union (!!free x) (!!free y)
+
+    method private map ~f = function
+        #var as x -> x
+      | `Num _ as x -> x
+      | `Add(x, y) as e ->
+          let x' = f x and y' = f y in
+          if x == x' && y == y' then e
+          else `Add(x', y')
+      | `Neg x as e ->
+          let x' = f x in
+          if x == x' then e else `Neg x'
+      | `Mult(x, y) as e ->
+          let x' = f x and y' = f y in
+          if x == x' && y == y' then e
+          else `Mult(x', y')
+
+    method subst ~sub = function
+        #var as x -> var#subst ~sub x
+      | #expr as e -> self#map ~f:(!!subst ~sub) e
+
+    method eval (#expr as e) =
+      match self#map ~f:!!eval e with
+        `Add(`Num m, `Num n) -> `Num (m+n)
+      | `Neg(`Num n) -> `Num (-n)
+      | `Mult(`Num m, `Num n) -> `Num (m*n)
+      | e -> e
+  end
+
+(* Specialized versions *)
+
+let expr = lazy_fix expr_ops
+
+(* The lexpr language, reunion of lambda and expr *)
+
+type 'a lexpr = [ 'a lambda | 'a expr ]
+
+let lexpr_ops (ops : ('a,'a) #ops Lazy.t) =
+  let lambda = lambda_ops ops in
+  let expr = expr_ops ops in
+  object (self : ([> 'a lexpr], 'a lexpr) #ops)
+    method free = function
+        #lambda as x -> lambda#free x
+      | #expr as x -> expr#free x
+
+    method subst ~sub = function
+        #lambda as x -> lambda#subst ~sub x
+      | #expr as x -> expr#subst ~sub x
+
+    method eval = function
+        #lambda as x -> lambda#eval x
+      | #expr as x -> expr#eval x
+end
+
+let lexpr = lazy_fix lexpr_ops
+
+(* A few examples:
+lambda#eval (`App(`Abs("x",`Var"x"), `Var"y"));;
+expr#eval (`Add(`Mult(`Num 3,`Neg(`Num 2)), `Var"x"));;
+lexpr#eval (`Add(`App(`Abs("x",`Mult(`Var"x",`Var"x")),`Num 2), `Num 5));;
+*)
diff --git a/testlabl/multimatch.ml b/testlabl/multimatch.ml
new file mode 100644 (file)
index 0000000..4add221
--- /dev/null
@@ -0,0 +1,157 @@
+(* Simple example *)
+let f x =
+  (multimatch x with `A -> 1 | `B -> true),
+  (multimatch x with `A -> 1. | `B -> "1");;
+
+(* OK *)
+module M : sig
+  val f :
+    [< `A & 'a = int & 'b = float | `B &   'b =string & 'a =  bool] -> 'a * 'b
+end = struct let f = f end;;
+
+(* Bad *)
+module M : sig
+  val f :
+    [< `A & 'a = int & 'b = float | `B &   'b =string & 'a =   int] -> 'a * 'b
+end = struct let f = f end;;
+
+(* Should be good! *)
+module M : sig
+  val f :
+    [< `A & 'a = int * float | `B & 'a = bool * string] -> 'a
+end = struct let f = f end;;
+
+let f = multifun `A|`B as x -> f x;;
+
+(* Two-level example *)
+let f = multifun
+    `A -> (multifun `C -> 1 | `D -> 1.)
+  | `B -> (multifun `C -> true | `D -> "1");;
+
+(* OK *)
+module M : sig
+  val f :
+    [< `A & 'b = [< `C & 'a = int | `D & 'a = float & 'c = bool] -> 'a
+     | `B & 'b = [< `C & 'c = bool | `D & 'c = string] -> 'c] -> 'b
+end = struct let f = f end;;
+
+(* Bad *)
+module M : sig
+  val f :
+    [< `A & 'b = [< `C & 'a = int | `D & 'a = bool] -> 'a
+     | `B & 'b = [< `C & 'c = bool | `D & 'c = string] -> 'c] -> 'b
+end = struct let f = f end;;
+
+module M : sig
+  val f :
+    [< `A & 'b = [< `C & 'a = int | `D] -> 'a
+     | `B & 'b = [< `C & 'c = bool | `D & 'c = string] -> 'c] -> 'b
+end = struct let f = f end;;
+
+
+(* Examples with hidden sharing *)
+let r = ref []
+let f = multifun `A -> 1 | `B -> true
+let g x = r := [f x];;
+
+(* Bad! *)
+module M : sig
+  val g : [< `A & 'a = int | `B & 'a = bool] -> unit
+end = struct let g = g end;;
+
+let r = ref []
+let f = multifun `A -> r | `B -> ref [];;
+(* Now OK *)
+module M : sig
+  val f : [< `A & 'b = int list ref | `B & 'b = 'c list ref] -> 'b
+end = struct let f = f end;;
+(* Still OK *)
+let l : int list ref = r;;
+module M : sig
+  val f : [< `A & 'b = int list ref | `B & 'b = 'c list ref] -> 'b
+end = struct let f = f end;;
+
+
+(* Examples that would need unification *)
+let f = multifun `A -> (1, []) | `B -> (true, [])
+let g x = fst (f x);;
+(* Didn't work, now Ok *)
+module M : sig
+  val g : [< `A & 'a * 'b = int * bool | `B & 'a * 'b = bool * int] -> 'a
+end = struct let g = g end;;
+let g = multifun (`A|`B) as x -> g x;;
+
+(* Other examples *)
+
+let f x =
+  let a = multimatch x with `A -> 1 | `B -> "1" in
+  (multifun `A -> print_int | `B -> print_string) x a
+;;
+
+let f = multifun (`A|`B) as x -> f x;;
+
+type unit_op = [`Set of int | `Move of int]
+type int_op = [`Get]
+
+let op r =
+  multifun
+    `Get     -> !r
+  | `Set x   -> r := x
+  | `Move dx -> r := !r + dx
+;;
+
+let rec trace r = function
+    [] -> []
+  | op1 :: ops ->
+      multimatch op1 with
+        #int_op as op1 ->
+          let x = op r op1 in
+          x :: trace r ops
+      | #unit_op as op1 ->
+          op r op1;
+          trace r ops
+;;
+
+class point x = object
+  val mutable x : int = x
+  method get = x
+  method set y = x <- y
+  method move dx = x <- x + dx
+end;;
+
+let poly sort coeffs x =
+  let add, mul, zero =
+    multimatch sort with
+      `Int -> (+), ( * ), 0
+    | `Float -> (+.), ( *. ), 0.
+  in
+  let rec compute = function
+      []     -> zero
+    | c :: cs -> add c (mul x (compute cs))
+  in
+  compute coeffs
+;;
+
+module M : sig
+  val poly : [< `Int & 'a = int | `Float & 'a = float] -> 'a list -> 'a -> 'a
+end = struct let poly = poly end;;
+
+type ('a,'b) num_sort =
+  'b constraint 'b = [< `Int & 'a = int | `Float & 'a = float]
+module M : sig
+  val poly : ('a,_) num_sort -> 'a list -> 'a -> 'a
+end = struct let poly = poly end;;
+
+
+(* type dispatch *)
+
+let print0 = multifun
+    `Int -> print_int
+  | `Float -> print_float
+;;
+let print1 = multifun
+    #num as x -> print0 x
+  | `List t -> List.iter (print0 t)
+  | `Pair(t1,t2) -> (fun (x,y) -> print0 t1 x; print0 t2 y)
+;;
+print1 (`Pair(`Int,`Float)) (1,1.0);;
diff --git a/testlabl/newlabels.ps b/testlabl/newlabels.ps
new file mode 100644 (file)
index 0000000..01eac19
--- /dev/null
@@ -0,0 +1,1458 @@
+%!PS-Adobe-2.0
+%%Creator: dvipsk 5.78 p1.4 Copyright 1996-98 ASCII Corp.(www-ptex@ascii.co.jp)
+%%dvipsk 5.78 Copyright 1998 Radical Eye Software (www.radicaleye.com)
+%%Title: newlabels.dvi
+%%Pages: 2 0
+%%PageOrder: Ascend
+%%BoundingBox: 0 0 596 842
+%%EndComments
+%%BeginProcSet: PStoPS 1 15
+userdict begin
+[/showpage/erasepage/copypage]{dup where{pop dup load
+ type/operatortype eq{1 array cvx dup 0 3 index cvx put
+ bind def}{pop}ifelse}{pop}ifelse}forall
+[/letter/legal/executivepage/a4/a4small/b5/com10envelope
+ /monarchenvelope/c5envelope/dlenvelope/lettersmall/note
+ /folio/quarto/a5]{dup where{dup wcheck{exch{}put}
+ {pop{}def}ifelse}{pop}ifelse}forall
+/setpagedevice {pop}bind 1 index where{dup wcheck{3 1 roll put}
+ {pop def}ifelse}{def}ifelse
+/PStoPSmatrix matrix currentmatrix def
+/PStoPSxform matrix def/PStoPSclip{clippath}def
+/defaultmatrix{PStoPSmatrix exch PStoPSxform exch concatmatrix}bind def
+/initmatrix{matrix defaultmatrix setmatrix}bind def
+/initclip[{matrix currentmatrix PStoPSmatrix setmatrix
+ [{currentpoint}stopped{$error/newerror false put{newpath}}
+ {/newpath cvx 3 1 roll/moveto cvx 4 array astore cvx}ifelse]
+ {[/newpath cvx{/moveto cvx}{/lineto cvx}
+ {/curveto cvx}{/closepath cvx}pathforall]cvx exch pop}
+ stopped{$error/errorname get/invalidaccess eq{cleartomark
+ $error/newerror false put cvx exec}{stop}ifelse}if}bind aload pop
+ /initclip dup load dup type dup/operatortype eq{pop exch pop}
+ {dup/arraytype eq exch/packedarraytype eq or
+  {dup xcheck{exch pop aload pop}{pop cvx}ifelse}
+  {pop cvx}ifelse}ifelse
+ {newpath PStoPSclip clip newpath exec setmatrix} bind aload pop]cvx def
+/initgraphics{initmatrix newpath initclip 1 setlinewidth
+ 0 setlinecap 0 setlinejoin []0 setdash 0 setgray
+ 10 setmiterlimit}bind def
+end
+%%EndProcSet
+%DVIPSCommandLine: dvips -f newlabels
+%DVIPSParameters: dpi=300
+%DVIPSSource:  TeX output 1999.10.26:1616
+%%BeginProcSet: tex.pro
+%!
+/TeXDict 300 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N
+/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72
+mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1}
+ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
+isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div
+hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul
+TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if}
+forall round exch round exch]setmatrix}N /@landscape{/isls true N}B
+/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B
+/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{
+/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N
+string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N
+end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{
+/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]
+N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup
+length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{
+128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub
+get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data
+dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N
+/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup
+/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx
+0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff
+setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff
+.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]}
+if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup
+length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{
+cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin
+0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul
+add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict
+/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook
+known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X
+/IE 256 array N 2 string 0 1 255{IE S dup 360 add 36 4 index cvrs cvn
+put}for pop 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N
+/RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley
+X /rulex X V}B /V{}B /RV statusdict begin /product where{pop false[
+(Display)(NeXT)(LaserWriter 16/600)]{dup length product length le{dup
+length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}
+forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false
+RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1
+false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform
+round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg
+rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail
+{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}
+B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{
+4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{
+p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p
+a}B /bos{/SS save N}B /eos{SS restore}B end
+
+%%EndProcSet
+TeXDict begin 39158280 55380996 1000 300 300 (newlabels.dvi)
+@start
+%DVIPSBitmapFont: Fa cmr6 6 2
+/Fa 2 51 df<187898181818181818181818181818FF08107D8F0F> 49
+D<1F00618040C08060C0600060006000C00180030006000C00102020207FC0FFC00B107F
+8F0F> I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fb cmmi8 8 4
+/Fb 4 111 df<FFC0FF1C00181C00101C00101C00103800203800203800203800207000
+40700040700040700040E00080E00080E00080E00080E00100E00200E004006008003830
+000FC00018177E9618> 85 D<0300038003000000000000000000000000001C00240046
+0046008C000C0018001800180031003100320032001C0009177F960C> 105
+D<383C1E0044C6630047028100460301008E0703000C0603000C0603000C060300180C06
+00180C0620180C0C20180C0C40301804C0301807001B0E7F8D1F> 109
+D<383C0044C6004702004602008E06000C06000C06000C0600180C00180C401818401818
+80300980300E00120E7F8D15> I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fc cmbx8 8 4
+/Fc 4 111 df<01800780FF80FF80078007800780078007800780078007800780078007
+800780078007800780FFF8FFF80D157D9414> 49 D<387C7C7C3800000000FCFC3C3C3C
+3C3C3C3C3C3C3C3CFFFF08187F970B> 105 D<FC7E0FC0FD8730E03E07C0F03E07C0F03C
+0780F03C0780F03C0780F03C0780F03C0780F03C0780F03C0780F03C0780F03C0780F0FF
+1FE3FCFF1FE3FC1E0F7E8E23> 109 D<FC7C00FD8E003E0F003E0F003C0F003C0F003C0F
+003C0F003C0F003C0F003C0F003C0F003C0F00FF3FC0FF3FC0120F7E8E17> I
+E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fd cmsy8 8 3
+/Fd 3 93 df<FFFFF0FFFFF014027D881B> 0 D<020002000200C218F2783AE00F800F80
+3AE0F278C2180200020002000D0E7E8E12> 3 D<03F8001FFF003C07806000C0C00060C0
+0060C00060C00060C00060C00060C00060C00060C00060C00060C00060C00060C00060C0
+006040002013137E9218> 92 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fe cmtt12 12 43
+/Fe 43 125 df<01818003C3C003C3C003C3C003C3C003C3C003C3C07FFFF0FFFFF8FFFF
+F87FFFF00787800787800787800F8F800F0F000F0F000F0F000F0F007FFFF0FFFFF8FFFF
+F87FFFF01E1E001E1E001E1E001E1E001E1E001E1E000C0C00151E7E9D1A> 35
+D<00E00003F00007F8000738000E1C000E1C000E1C000E1C000E38000E39FC0E71FC07F1
+FC07E1C007C1C00781C00783800F83801FC3803DC70078E70070EE00E07E00E07E00E03C
+08E03C1CE07E1C70FF1C7FE7F83FC3F80F00E0161E7F9D1A> 38
+D<0038007800F001E003C007800F000E001C001C0038003800700070007000E000E000E0
+00E000E000E000E000E000E000E000700070007000380038001C001C000E000F00078003
+C001E000F8007800380D2878A21A> 40 D<6000F00078003C001E000F000780038001C0
+01C000E000E0007000700070003800380038003800380038003800380038003800700070
+007000E000E001C001C0038007800F001E003C007800F00060000D287CA21A> I<7FFFC0
+FFFFE0FFFFE07FFFC013047D901A> 45 D<00C001C001C003C007C00FC07FC0FDC071C0
+01C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C0
+7FFF7FFF7FFF101E7B9D1A> 49 D<03F8000FFE001FFF803C07C07801E07000E0E00070
+F00070F000706000700000700000700000E00000E00001C00003C0000780000F00001E00
+003C0000780000F00003E00007C0000F00001E00703C00707FFFF0FFFFF07FFFF0141E7D
+9D1A> I<03FC000FFF003FFFC03C03E07800E07800707800700000700000700000E00001
+E00007C003FF8003FF0003FFC00003E00000E0000070000078000038000038600038F000
+38F00078E000707000E07E03E03FFFC00FFF0001FC00151E7E9D1A> I<01FC0007FF001F
+FFC01F07C03C01E07800F07000707000707000707800F03800E01E03C00FFF8003FE0007
+FF001F8FC03C01E07800F0700070E00038E00038E00038E00038F000787000707800F03E
+03E01FFFC007FF0001FC00151E7E9D1A> 56 D<01F00007FC001FFE003E0F0038078070
+03807001C0E001C0E001C0E001E0E000E0E000E0E001E07001E07803E03C0FE01FFFE00F
+FCE003F0E00001C00001C00001C0000380600380F00700F00F00F03E007FFC003FF0000F
+C000131E7D9D1A> I<3078FCFC78300000000000000000003078FCFC7830061576941A>
+I<183C7E7E3C18000000000000000000183C7E7E3E1E0E0E1C3CF8F060071C77941A> I<
+0000C00003E00007E0000FC0003F80007E0000FC0003F80007E0000FC0003F80007E0000
+FC0000FC00007E00003F80000FC00007E00003F80000FC00007E00003F80000FC00007E0
+0003E00000C0131A7D9B1A> I<7FFFF0FFFFF8FFFFF87FFFF00000000000000000000000
+007FFFF0FFFFF8FFFFF87FFFF0150C7E941A> I<600000F80000FC00007E00003F80000F
+C00007E00003F80000FC00007E00003F80000FC00007E00007E0000FC0003F80007E0000
+FC0003F80007E0000FC0003F80007E0000FC0000F80000600000131A7D9B1A> I<007C38
+01FF3807FFF80F83F81E00F81C0078380078380038700038700038700000E00000E00000
+E00000E00000E00000E00000E00000E000007000007000387000383800383800381C0070
+1E00F00F83E007FFC001FF80007C00151E7E9D1A> 67 D<FE03FEFF03FEFF03FE1D8070
+1D80701DC0701CC0701CC0701CE0701CE0701C60701C70701C70701C30701C38701C3870
+1C18701C1C701C1C701C0C701C0E701C0E701C06701C06701C07701C03701C0370FF81F0
+FF81F0FF80F0171E7F9D1A> 78 D<03F8E00FFEE01FFFE03C07E07801E0F001E0E000E0
+E000E0E000E0E000007000007800003F80001FF80007FF00007FC00007E00000F0000070
+000038000038600038E00038E00038E00070F000F0FE01E0FFFFC0EFFF80E1FE00151E7E
+9D1A> 83 D<7FFFFEFFFFFEFFFFFEE0380EE0380EE0380EE0380E003800003800003800
+003800003800003800003800003800003800003800003800003800003800003800003800
+00380000380000380000380000380003FF8003FF8003FF80171E7F9D1A> I<FFFCFFFCFF
+FCE000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E0
+00E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000FFFCFFFCFF
+FC0E2776A21A> 91 D<FFFCFFFCFFFC001C001C001C001C001C001C001C001C001C001C
+001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C001C
+001C001C001C001C001CFFFCFFFCFFFC0E277FA21A> 93 D<1FF0003FFC007FFE00780F
+00300700000380000380007F8007FF801FFF803F8380780380700380E00380E00380E003
+80700780780F803FFFFC1FFDFC07F0FC16157D941A> 97 D<7E0000FE00007E00000E00
+000E00000E00000E00000E00000E00000E3E000EFF800FFFE00FC1F00F80700F00380E00
+380E001C0E001C0E001C0E001C0E001C0E001C0E001C0F00380F00780F80F00FC1E00FFF
+C00EFF80063E00161E7F9D1A> I<00FF8003FFC00FFFE01F01E03C00C078000070000070
+0000E00000E00000E00000E00000E000007000007000007800703C00701F01F00FFFE003
+FFC000FE0014157D941A> I<000FC0001FC0000FC00001C00001C00001C00001C00001C0
+0001C001F1C007FDC00FFFC01E0FC03C07C07803C07001C0E001C0E001C0E001C0E001C0
+E001C0E001C0E001C07003C07003C03807C03E0FC01FFFF807FDFC01F1F8161E7E9D1A>
+I<01F80007FF000FFF801E07C03C01C07800E07000E0E00070E00070FFFFF0FFFFF0FFFF
+F0E000007000007000007800703C00701F01F00FFFE003FF8000FE0014157D941A> I<00
+07E0001FF0003FF800787800F03000E00000E00000E00000E0007FFFF0FFFFF0FFFFF000
+E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000
+E00000E00000E0003FFF807FFFC03FFF80151E7F9D1A> I<7E0000FE00007E00000E0000
+0E00000E00000E00000E00000E00000E3E000EFF800FFFC00FC1C00F80E00F00E00E00E0
+0E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E07FC3FC
+FFE7FE7FC3FC171E7F9D1A> 104 D<00C00001E00001E00000C000000000000000000000
+0000000000000000007FE0007FE0007FE00000E00000E00000E00000E00000E00000E000
+00E00000E00000E00000E00000E00000E00000E00000E00000E0007FFF80FFFFC07FFF80
+121F7C9E1A> I<7FE000FFE0007FE00000E00000E00000E00000E00000E00000E00000E0
+0000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0
+0000E00000E00000E00000E00000E0007FFFC0FFFFE07FFFC0131E7D9D1A> 108
+D<7CE0E000FFFBF8007FFFF8001F1F1C001E1E1C001E1E1C001C1C1C001C1C1C001C1C1C
+001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C001C1C1C
+007F1F1F00FFBFBF807F1F1F00191580941A> I<7E3E00FEFF807FFFC00FC1C00F80E00F
+00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E
+00E07FC3FCFFE7FE7FC3FC17157F941A> I<01F00007FC001FFF003E0F803C07807803C0
+7001C0E000E0E000E0E000E0E000E0E000E0E000E0F001E07001C07803C03C07803E0F80
+1FFF0007FC0001F00013157D941A> I<7E3E00FEFF807FFFE00FC1F00F80700F00380E00
+380E001C0E001C0E001C0E001C0E001C0E001C0E001C0F00380F00780F80F00FC1E00FFF
+C00EFF800E3E000E00000E00000E00000E00000E00000E00000E00000E00007FC000FFE0
+007FC00016207F941A> I<7F81F8FF8FFC7F9FFE03FE1E03F80C03E00003E00003C00003
+80000380000380000380000380000380000380000380000380000380007FFF00FFFF007F
+FF0017157F941A> 114 D<07FB801FFF807FFF80780780E00380E00380E003807800007F
+C0001FFC0007FE00003F800007806001C0E001C0E001C0F003C0FC0780FFFF00EFFE00E3
+F80012157C941A> I<0180000380000380000380000380000380000380007FFFE0FFFFE0
+FFFFE0038000038000038000038000038000038000038000038000038000038000038070
+03807003807003807001C1E001FFE000FF80003F00141C7F9B1A> I<7E07E0FE0FE07E07
+E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00E00
+E00E00E00E01E00F03E007FFFC03FFFE00FCFC17157F941A> I<7F83FCFFC7FE7F83FC0E
+00E00E00E00E00E00701C00701C00701C003838003838003838001C70001C70001C70000
+EE0000EE0000EE00007C00007C0000380017157F941A> I<FF83FEFF83FEFF83FE380038
+3800381C00701C00701C00701C38701C7C701C7C700C6C600EEEE00EEEE00EEEE00EEEE0
+0EC6E006C6C007C7C00783C00783C017157F941A> I<7FC7F87FCFFC7FC7F80703C00383
+8003C70001EF0000FE00007C00007800003800007C0000EE0001EE0001C7000383800783
+C00F01C07FC7FCFFC7FE7FC7FC17157F941A> I<7F83FCFFC7FE7F83FC0E00E00E00E007
+00E00701C00701C00381C003838003C38001C38001C70000E70000E70000E60000660000
+6E00003C00003C00003C0000380000380000380000700000700030F00078E00071E0007F
+C0003F80001E000017207F941A> I<60F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0
+F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F060042775A21A> 124 D
+E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Ff cmr8 8 3
+/Ff 3 51 df<003000003000003000003000003000003000003000003000003000003000
+003000FFFFFCFFFFFC003000003000003000003000003000003000003000003000003000
+00300000300016187E931B> 43 D<06000E00FE000E000E000E000E000E000E000E000E
+000E000E000E000E000E000E000E000E000E00FFE00B157D9412> 49
+D<0F8030E040708030C038E0384038003800700070006000C00180030006000C08080810
+183FF07FF0FFF00D157E9412> I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fg cmmi12 12 13
+/Fg 13 121 df<0FFFF81FFFFC3FFFF870200040200080200080600000600000600000C0
+0000C00000C00000C00001C0000180000180000380000380000380000700000300001615
+7E9415> 28 D<0000100000002000000020000000200000002000000040000000400000
+004000000040000000800000008000000080000000800000010000000FE00000711C0001
+C10600030203000E0203801C020180180201C0380401C0700401C0700401C0700401C0E0
+080380E0080380E00807006008070070100E0030101C00301038001C10E0000623800001
+FE0000002000000020000000400000004000000040000000400000008000000080000000
+800000008000001A2D7EA21D> 30 D<70F8F8F87005057C840E> 58
+D<70F8FCFC7404040404080810102040060F7C840E> I<00008000018000018000030000
+0300000300000600000600000600000C00000C00000C0000180000180000180000300000
+300000300000600000600000600000C00000C00000C00001800001800001800001800003
+00000300000300000600000600000600000C00000C00000C000018000018000018000030
+0000300000300000600000600000600000C00000C00000C0000011317DA418> 61
+D<00FFFC00000F8000000F0000000F0000001E0000001E0000001E0000001E0000003C00
+00003C0000003C0000003C00000078000000780000007800000078000000F0000000F000
+0000F0000000F0000001E0000001E0000001E0002001E0002003C0004003C0004003C000
+8003C0008007800180078001000780030007800F000F803E00FFFFFE001B227DA121> 76
+D<1FFFFFFE1E01E00E1801E0063001E0062003C0062003C0064003C0044003C004400780
+04800780048007800400078000000F0000000F0000000F0000000F0000001E0000001E00
+00001E0000001E0000003C0000003C0000003C0000003C00000078000000780000007800
+000078000000F0000000F0000000F0000000F0000001F000007FFFC0001F227EA11D> 84
+D<3FFE01FF8003C0003C0003C000300003C0001000078000200007800020000780002000
+07800020000F000040000F000040000F000040000F000040001E000080001E000080001E
+000080001E000080003C000100003C000100003C000100003C0001000078000200007800
+020000780002000078000200007000040000F000040000F0000800007000080000700010
+00007000200000380040000038008000001C01000000060600000001F800000021237DA1
+21> I<007E000381000700800E00801C0080380080780100700600FFF800F00000F00000
+E00000E00000E00000E00000E00080E000807003003004001838000FC00011157D9417>
+101 D<01E00FC001C001C001C0038003800380038007000700070007000E000E000E000E
+001C001C001C001C0038003800380038007000700070007080E100E100E100620062003C
+000B237EA20F> 108 D<03C0F004631C04740E08780E08700708700708700F00E00F00E0
+0F00E00F00E00F01C01E01C01E01C01E01C03C03803803803803C07003C0E0072180071E
+000700000700000E00000E00000E00000E00001C00001C00001C0000FF8000181F819418
+> 112 D<3C0F004630C04741C08783C08783C08701808700000E00000E00000E00000E00
+001C00001C00001C00001C000038000038000038000038000070000030000012157E9416
+> 114 D<01E0F006310C081A1C101A3C201C3C201C18201C000038000038000038000038
+0000700000700000700000700860E010F0E010F0E020E170404230803C1F0016157E941C
+> 120 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fh cmti12 12 22
+/Fh 22 122 df<FFF0FFF0FFE00C037C8B11> 45 D<70F8F8F0E005057A840F> I<00F8
+C00185C00705C00E03800E03801C03803C0380380700780700780700780700F00E00F00E
+00F00E00F00E10F01C20701C20703C20305C40308C400F078014157B9419> 97
+D<03C01F8003800380038007000700070007000E000E000E000E001C001CF81D0C1E0E3C
+0638073807380F700F700F700F700FE01EE01EE01EE03CE038E038607060E031C01F0010
+237BA216> I<007E0001C1000301800703800E07801C07803C0000380000780000780000
+780000F00000F00000F00000F00000F00100700100700200300C001830000FC00011157B
+9416> I<00003C0003F80000380000380000380000700000700000700000700000E00000
+E00000E00000E00001C000F9C00185C00705C00E03800E03801C03803C03803807007807
+00780700780700F00E00F00E00F00E00F00E10F01C20701C20703C20305C40308C400F07
+8016237BA219> I<00F803840E021C023C0238027804F018FFE0F000F000E000E000E000
+E000E002E0026004701830600F800F157A9416> I<00003E0000470000CF00018F000186
+000380000380000380000700000700000700000700000700000E0000FFF0000E00000E00
+000E00001C00001C00001C00001C00001C00003800003800003800003800003800007000
+00700000700000700000700000E00000E00000E00000E00000C00001C00001C000718000
+F18000F300006200003C0000182D82A20F> I<001F180030B800E0B801C07001C0700380
+700780700700E00F00E00F00E00F00E01E01C01E01C01E01C01E01C01E03800E03800E07
+80060B8006170001E700000700000700000E00000E00000E00701C00F01800F0300060E0
+003F8000151F7E9416> I<00C001E001C001C0000000000000000000000000000000001E
+002300430043008700870087000E000E001C001C001C0038003800384070807080708071
+0032001C000B217BA00F> 105 D<00F00007E00000E00000E00000E00001C00001C00001
+C00001C0000380000380000380000380000700000701E00702100704700E08F00E10F00E
+20600E40001D80001E00001FC0001C7000383800383800381C00381C2070384070384070
+3840701880E01880600F0014237DA216> 107 D<01E00FC001C001C001C0038003800380
+038007000700070007000E000E000E000E001C001C001C001C0038003800380038007000
+700070007100E200E200E200E200640038000B237CA20C> I<1C0F80F8002610C10C0047
+6066060087807807008780780700870070070087007007000E00E00E000E00E00E000E00
+E00E000E00E00E001C01C01C001C01C01C001C01C01C001C01C038203803803840380380
+70403803807080380380308070070031003003001E0023157B9428> I<380F804C30C04E
+40608E80708F00708E00708E00701C00E01C00E01C00E01C00E03801C03801C03801C038
+0384700388700308700708700310E003106001E016157B941B> I<007E0001C300038180
+0701C00E01C01C01E03C01E03801E07801E07801E07801E0F003C0F003C0F00380F00780
+700700700E00700C0030180018700007C00013157B9419> I<01C1F002621804741C0878
+0C08700E08700E08701E00E01E00E01E00E01E00E01E01C03C01C03C01C03C01C0780380
+7003807003C0E003C1C0072380071E000700000700000E00000E00000E00000E00001C00
+001C00001C0000FFC000171F7F9419> I<1C1F002620804741C08783C08703C087018087
+00000E00000E00000E00000E00001C00001C00001C00001C000038000038000038000038
+000070000030000012157B9415> 114 D<00FC000183000200800401800C03800C03000C
+00000F00000FF00007FC0003FE00003E00000F00000700700700F00600F00600E0040040
+08002030001FC00011157D9414> I<00C001C001C001C001C003800380038003800700FF
+F8070007000E000E000E000E001C001C001C001C00380038003800381070207020704070
+8031001E000D1F7C9E10> I<1E0060E02300E0F04380E1F04381C0F08381C0708701C030
+8701C030070380200E0380200E0380200E0380201C0700401C0700401C0700401C070080
+1C0700801C0701001C0F01000C0B02000613840003E0F8001C157B9420> 119
+D<03C1E0046210083470103CF02038F020386020380000700000700000700000700000E0
+0000E00000E00000E02061C040F1C040F1C080E2C100446200383C0014157D9416> I<1E
+00302300704380704380E08380E08700E08700E00701C00E01C00E01C00E01C01C03801C
+03801C03801C03801C07001C07001C07001C0F000C3E0003CE00000E00000E00001C0060
+1C00F03800F03000E0600080C0004380003E0000141F7B9418> I
+E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fi cmbx12 12 20
+/Fi 20 122 df<FFFFFF8000FFFFFFF00007F003FC0007F0007E0007F0003F0007F0001F
+8007F0000FC007F00007E007F00007E007F00007F007F00003F007F00003F007F00003F0
+07F00003F807F00003F807F00003F807F00003F807F00003F807F00003F807F00003F807
+F00003F807F00003F807F00003F007F00003F007F00003F007F00007E007F00007E007F0
+000FC007F0001F8007F0003F0007F0007E0007F003FC00FFFFFFF000FFFFFF800025227E
+A12B> 68 D<01FE0207FF861F01FE3C007E7C001E78000E78000EF80006F80006FC0006
+FC0000FF0000FFE0007FFF007FFFC03FFFF01FFFF80FFFFC03FFFE003FFE0003FE00007F
+00003F00003FC0001FC0001FC0001FE0001EE0001EF0003CFC003CFF00F8C7FFE080FF80
+18227DA11F> 83 D<7FFFFFFF807FFFFFFF807E03F80F807803F807807003F803806003
+F80180E003F801C0E003F801C0C003F800C0C003F800C0C003F800C0C003F800C00003F8
+00000003F800000003F800000003F800000003F800000003F800000003F800000003F800
+000003F800000003F800000003F800000003F800000003F800000003F800000003F80000
+0003F800000003F800000003F800000003F800000003F8000001FFFFF00001FFFFF00022
+227EA127> I<0FFC003FFF807E07C07E03E07E01E07E01F03C01F00001F00001F0003FF0
+03FDF01FC1F03F01F07E01F0FC01F0FC01F0FC01F0FC01F07E02F07E0CF81FF87F07E03F
+18167E951B> 97 D<FF000000FF0000001F0000001F0000001F0000001F0000001F0000
+001F0000001F0000001F0000001F0000001F0000001F0000001F0FE0001F3FF8001FE07C
+001F803E001F001F001F000F801F000F801F000FC01F000FC01F000FC01F000FC01F000F
+C01F000FC01F000FC01F000FC01F000F801F001F801F801F001FC03E001EE07C001C3FF8
+00180FC0001A237EA21F> I<00FF8007FFE00F83F01F03F03E03F07E03F07C01E07C0000
+FC0000FC0000FC0000FC0000FC0000FC00007C00007E00007E00003E00181F00300FC060
+07FFC000FF0015167E9519> I<00FE0007FF800F87C01E01E03E01F07C00F07C00F8FC00
+F8FC00F8FFFFF8FFFFF8FC0000FC0000FC00007C00007C00007E00003E00181F00300FC0
+7003FFC000FF0015167E951A> 101 D<001FC0007FE000F1F001E3F003E3F007C3F007C1
+E007C00007C00007C00007C00007C00007C000FFFE00FFFE0007C00007C00007C00007C0
+0007C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007C00007C0
+0007C00007C0003FFC003FFC00142380A211> I<01FE0F0007FFBF800F87C7801F03E780
+1E01E0003E01F0003E01F0003E01F0003E01F0003E01F0001E01E0001F03E0000F87C000
+0FFF800009FE000018000000180000001C0000001FFFE0000FFFF80007FFFE001FFFFF00
+3C003F0078000F80F0000780F0000780F0000780F000078078000F003C001E001F007C00
+0FFFF80001FFC00019217F951C> I<1C003E007F007F007F003E001C0000000000000000
+00000000000000FF00FF001F001F001F001F001F001F001F001F001F001F001F001F001F
+001F001F001F001F001F00FFE0FFE00B247EA310> 105 D<FF00FF001F001F001F001F00
+1F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F00
+1F001F001F001F001F001F001F001F001F00FFE0FFE00B237EA210> 108
+D<FF07F007F000FF1FFC1FFC001F303E303E001F403E403E001F801F801F001F801F801F
+001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F
+001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F001F
+001F001F001F001F001F001F00FFE0FFE0FFE0FFE0FFE0FFE02B167E9530> I<FF07E000
+FF1FF8001F307C001F403C001F803E001F803E001F003E001F003E001F003E001F003E00
+1F003E001F003E001F003E001F003E001F003E001F003E001F003E001F003E001F003E00
+1F003E00FFE1FFC0FFE1FFC01A167E951F> I<00FE0007FFC00F83E01E00F03E00F87C00
+7C7C007C7C007CFC007EFC007EFC007EFC007EFC007EFC007EFC007E7C007C7C007C3E00
+F81F01F00F83E007FFC000FE0017167E951C> I<FF0FE000FF3FF8001FE07C001F803E00
+1F001F001F001F801F001F801F000FC01F000FC01F000FC01F000FC01F000FC01F000FC0
+1F000FC01F000FC01F001F801F001F801F803F001FC03E001FE0FC001F3FF8001F0FC000
+1F0000001F0000001F0000001F0000001F0000001F0000001F0000001F000000FFE00000
+FFE000001A207E951F> I<0FF3003FFF00781F00600700E00300E00300F00300FC00007F
+E0007FF8003FFE000FFF0001FF00000F80C00780C00380E00380E00380F00700FC0E00EF
+FC00C7F00011167E9516> 115 D<01800001800001800001800003800003800007800007
+80000F80003F8000FFFF00FFFF000F80000F80000F80000F80000F80000F80000F80000F
+80000F80000F80000F80000F81800F81800F81800F81800F81800F830007C30003FE0000
+F80011207F9F16> I<FF01FE00FF01FE001F003E001F003E001F003E001F003E001F003E
+001F003E001F003E001F003E001F003E001F003E001F003E001F003E001F003E001F003E
+001F003E001F007E001F00FE000F81BE0007FF3FC001FC3FC01A167E951F> I<FFE07FC0
+FFE07FC00F801C0007C0380003E0700003F0600001F8C00000F98000007F8000003F0000
+001F0000001F8000003FC0000037C0000063E00000C1F00001C0F8000380FC0007007E00
+0E003E00FF80FFE0FF80FFE01B167F951E> 120 D<FFE01FE0FFE01FE01F8007000F8006
+000FC00E0007C00C0007E00C0003E0180003E0180001F0300001F0300000F8600000F860
+00007CC000007CC000007FC000003F8000003F8000001F0000001F0000000E0000000E00
+00000C0000000C00000018000078180000FC380000FC300000FC60000069C000007F8000
+001F0000001B207F951E> I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fj cmsy10 12 15
+/Fj 15 107 df<FFFFFFFCFFFFFFFC1E027C8C27> 0 D<03F0000FFC001FFE003FFF007F
+FF807FFF80FFFFC0FFFFC0FFFFC0FFFFC0FFFFC0FFFFC0FFFFC0FFFFC07FFF807FFF803F
+FF001FFE000FFC0003F00012147D9519> 15 D<000FFFFC007FFFFC01F0000003800000
+060000000C0000001800000030000000300000006000000060000000C0000000C0000000
+C0000000C0000000C0000000C0000000C0000000C0000000600000006000000030000000
+30000000180000000C000000060000000380000001E00000007FFFFC001FFFFC1E1E7C9A
+27> 26 D<00000001800000000001800000000001800000000001800000000000C00000
+000000C000000000006000000000003000000000003000000000001C00000000000E0000
+0000000700FFFFFFFFFFE0FFFFFFFFFFE0000000000700000000000E00000000001C0000
+000000300000000000300000000000600000000000C00000000000C00000000001800000
+00000180000000000180000000000180002B1A7D9832> 33 D<001FFF007FFF01E00003
+80000600000C0000180000300000300000600000600000600000C00000C00000FFFFFFFF
+FFFFC00000C000006000006000006000003000003000001800000C000006000003800001
+E000007FFF001FFF181E7C9A21> 50 D<00000300000300000600000600000C00000C00
+00180000180000300000300000600000600000C00000C00000C000018000018000030000
+0300000600000600000C00000C0000180000180000300000300000600000600000C00000
+C0000180000180000300000300000300000600000600000C00000C000018000018000030
+0000300000600000600000C00000400000183079A300> 54 D<C0C0C0C0C0C0C0C0E0E0
+C0C0C0C0C0C0C0C003127D9400> I<00008000018001F980070F000C0300180380180780
+3006C03006C0700CE0600C60600C60600C60E01870E01870E01870E03070E03070E03070
+E06070E06070E06070E06070E0C070E0C070E0C070E18070E180706180606300607300E0
+7300E03300C03600C01E01801E01800C03000F0E000DF800180000180000180000142A7E
+A519> 59 D<000100000003000000030000000300000003000000030000000300000003
+000000030000000300000003000000030000000300000003000000030000000300000003
+000000030000000300000003000000030000000300000003000000030000000300000003
+000000030000000300000003000000030000FFFFFFFEFFFFFFFE1F207C9F27> 63
+D<40000040C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000
+C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000
+C0C00000C0C00000C0C00000C0C00000C0C00000C0600001806000018030000300180006
+000E001C000780780001FFE000007F80001A1F7D9D21> 91 D<007F800001FFE0000780
+78000E001C0018000600300003006000018060000180C00000C0C00000C0C00000C0C000
+00C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C000
+00C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C00000C0C000
+00C0400000401A1F7D9D21> I<000C0000000C0000001E0000001E0000001E0000003300
+0000330000006180000061800000C0C00000C0C00000C0C0000180600001806000030030
+00030030000300300006001800060018000C000C000C000C000C000C0018000600180006
+003000030030000300600001806000018060000180C00000C0C00000401A1F7D9D21> 94
+D<0003C0001E0000380000700000E00000E00000E00000E00000E00000E00000E00000E0
+0000E00000E00000E00000E00000E00000E00000E00000E00000E00001C0000380000F00
+00F800000F000003800001C00000E00000E00000E00000E00000E00000E00000E00000E0
+0000E00000E00000E00000E00000E00000E00000E00000E00000E000007000003800001E
+000003C012317DA419> 102 D<F800000F000003800001C00000E00000E00000E00000E0
+0000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0
+0000E000007000003800001E000003C0001E0000380000700000E00000E00000E00000E0
+0000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E00000E0
+0000E00001C0000380000F0000F8000012317DA419> I<C0C0C0C0C0C0C0C0C0C0C0C0C0
+C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0
+02317AA40E> 106 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fk cmr12 12 65
+/Fk 65 125 df<001FC1F00070371800C03E3C01807C3C0380783C070038000700380007
+003800070038000700380007003800070038000700380007003800FFFFFFC00700380007
+003800070038000700380007003800070038000700380007003800070038000700380007
+0038000700380007003800070038000700380007003800070038000700380007003C007F
+E1FFC01E2380A21C> 11 D<001FC0000070200000C01000018038000380780007007800
+0700300007000000070000000700000007000000070000000700000007000000FFFFF800
+070078000700380007003800070038000700380007003800070038000700380007003800
+070038000700380007003800070038000700380007003800070038000700380007003800
+070038007FE1FF80192380A21B> I<001FD8000070380000C07800018078000380780007
+0038000700380007003800070038000700380007003800070038000700380007003800FF
+FFF800070038000700380007003800070038000700380007003800070038000700380007
+003800070038000700380007003800070038000700380007003800070038000700380007
+003800070038007FF3FF80192380A21B> I<000FC07F00007031C08000E00B004001801E
+00E003803E01E007003C01E007001C00C007001C000007001C000007001C000007001C00
+0007001C000007001C000007001C0000FFFFFFFFE007001C01E007001C00E007001C00E0
+07001C00E007001C00E007001C00E007001C00E007001C00E007001C00E007001C00E007
+001C00E007001C00E007001C00E007001C00E007001C00E007001C00E007001C00E00700
+1C00E007001C00E07FF1FFCFFE272380A229> I<70F8FCFC740404040408081010204006
+0F7CA20E> 39 D<00200040008001000300060004000C000C0018001800300030003000
+7000600060006000E000E000E000E000E000E000E000E000E000E000E000E000E000E000
+6000600060007000300030003000180018000C000C000400060003000100008000400020
+0B327CA413> I<800040002000100018000C000400060006000300030001800180018001
+C000C000C000C000E000E000E000E000E000E000E000E000E000E000E000E000E000E000
+C000C000C001C0018001800180030003000600060004000C00180010002000400080000B
+327DA413> I<70F8FCFC7404040404080810102040060F7C840E> 44
+D<FFF8FFF80D02808B10> I<70F8F8F87005057C840E> I<01F000071C000C0600180300
+3803803803807001C07001C07001C07001C0F001E0F001E0F001E0F001E0F001E0F001E0
+F001E0F001E0F001E0F001E0F001E0F001E0F001E0F001E07001C07001C07001C07803C0
+3803803803801C07000C0600071C0001F00013227EA018> 48 D<008003800F80F38003
+800380038003800380038003800380038003800380038003800380038003800380038003
+800380038003800380038003800380038007C0FFFE0F217CA018> I<03F0000C1C001007
+002007804003C04003C08003E0F003E0F801E0F801E0F801E02003E00003E00003C00003
+C0000780000700000E00001C0000180000300000600000C0000180000100000200200400
+200800201800603000403FFFC07FFFC0FFFFC013217EA018> I<03F8000C1E00100F0020
+07804007C07807C07803C07807C03807C0000780000780000700000F00000C0000380003
+F000001C00000F000007800007800003C00003C00003E02003E07003E0F803E0F803E0F0
+03C04003C0400780200780100F000C1C0003F00013227EA018> I<000300000300000700
+000700000F00001700001700002700006700004700008700018700010700020700060700
+040700080700080700100700200700200700400700C00700FFFFF8000700000700000700
+000700000700000700000700000F80007FF015217FA018> I<70F8F8F870000000000000
+000000000070F8F8F87005157C940E> 58 D<FFFFFFFEFFFFFFFE000000000000000000
+0000000000000000000000000000000000000000000000FFFFFFFEFFFFFFFE1F0C7D9126
+> 61 D<07E01838201C400E800FF00FF00FF00F000F000E001C00380030006000C000C0
+00800080018001000100010001000100010000000000000000000000038007C007C007C0
+038010237DA217> 63 D<0001800000018000000180000003C0000003C0000003C00000
+05E0000005E0000009F0000008F0000008F00000107800001078000010780000203C0000
+203C0000203C0000401E0000401E0000C01F0000800F0000800F0001FFFF800100078001
+000780020003C0020003C0020003C0040001E0040001E0040001E0080000F01C0000F03E
+0001F8FF800FFF20237EA225> 65 D<FFFFF8000F800E0007800780078003C0078003E0
+078001E0078001F0078001F0078001F0078001F0078001F0078001E0078003E0078007C0
+07800F8007803E0007FFFE0007800780078003C0078001E0078001F0078000F0078000F8
+078000F8078000F8078000F8078000F8078000F8078001F0078001F0078003E0078007C0
+0F800F00FFFFFC001D227EA123> I<0007E0100038183000E0063001C00170038000F007
+0000F00E0000701E0000701C0000303C0000303C0000307C0000107800001078000010F8
+000000F8000000F8000000F8000000F8000000F8000000F8000000F80000007800000078
+0000107C0000103C0000103C0000101C0000201E0000200E000040070000400380008001
+C0010000E0020000381C000007E0001C247DA223> I<FFFFF0000F801E00078007000780
+0380078001C0078000E0078000F007800078078000780780007C0780003C0780003C0780
+003C0780003E0780003E0780003E0780003E0780003E0780003E0780003E0780003E0780
+003E0780003C0780003C0780007C0780007807800078078000F0078000E0078001E00780
+03C0078007000F801E00FFFFF0001F227EA125> I<FFFFFFC00F8007C0078001C0078000
+C00780004007800040078000600780002007800020078000200780202007802000078020
+0007802000078060000780E00007FFE0000780E000078060000780200007802000078020
+000780200007800000078000000780000007800000078000000780000007800000078000
+00078000000FC00000FFFE00001B227EA120> 70 D<0007F008003C0C1800E0021801C0
+01B8038000F8070000780F0000381E0000381E0000183C0000183C0000187C0000087800
+000878000008F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800
+1FFF780000F8780000787C0000783C0000783C0000781E0000781E0000780F0000780700
+0078038000B801C000B800E00318003C0C080007F00020247DA226> I<FFFC3FFF0FC003
+F0078001E0078001E0078001E0078001E0078001E0078001E0078001E0078001E0078001
+E0078001E0078001E0078001E0078001E0078001E007FFFFE0078001E0078001E0078001
+E0078001E0078001E0078001E0078001E0078001E0078001E0078001E0078001E0078001
+E0078001E0078001E0078001E00FC003F0FFFC3FFF20227EA125> I<FFFC0FC007800780
+078007800780078007800780078007800780078007800780078007800780078007800780
+07800780078007800780078007800780078007800FC0FFFC0E227EA112> I<FFFC00FF80
+0FC0007C0007800030000780002000078000400007800080000780010000078002000007
+80040000078008000007801000000780200000078040000007808000000781C000000783
+E000000785E000000788F000000790F0000007A078000007C03C000007803C000007801E
+000007800F000007800F00000780078000078007C000078003C000078001E000078001E0
+00078000F000078000F8000FC000FC00FFFC07FF8021227EA126> 75
+D<FFFC001F80000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00
+000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00010F00
+010F00010F00010F00030F00030F00020F00060F00060F001E1F007EFFFFFE18227DA11E
+> I<FF8007FF07C000F807C0007005E0002004F0002004F0002004780020047C0020043C
+0020041E0020041F0020040F002004078020040780200403C0200401E0200401E0200400
+F0200400F8200400782004003C2004003E2004001E2004000F2004000F20040007A00400
+03E0040003E0040001E0040001E0040000E00E0000601F000060FFE0002020227EA125>
+78 D<000FE00000783C0000E00E0003C00780078003C00F0001E00E0000E01E0000F03C
+0000783C0000787C00007C7C00007C7800003C7800003CF800003EF800003EF800003EF8
+00003EF800003EF800003EF800003EF800003EF800003E7800003C7C00007C7C00007C3C
+0000783E0000F81E0000F00F0001E00F0001E0078003C003C0078000E00E0000783C0000
+0FE0001F247DA226> I<FFFFF0000F803C0007800F0007800780078007C0078003C00780
+03E0078003E0078003E0078003E0078003E0078003E0078003C0078007C0078007800780
+0F0007803C0007FFF0000780000007800000078000000780000007800000078000000780
+0000078000000780000007800000078000000780000007800000078000000FC00000FFFC
+00001B227EA121> I<FFFFE000000F803C000007800E00000780078000078007C0000780
+03C000078003E000078003E000078003E000078003E000078003E000078003C000078007
+C000078007800007800E000007803C000007FFE000000780700000078038000007801C00
+0007801E000007800E000007800F000007800F000007800F000007800F000007800F8000
+07800F800007800F800007800F808007800FC080078007C0800FC003C100FFFC01E20000
+00007C0021237EA124> 82 D<03F0200C0C601802603001E07000E0600060E00060E000
+60E00020E00020E00020F00000F000007800007F00003FF0001FFE000FFF0003FF80003F
+C00007E00001E00000F00000F0000070800070800070800070800070C00060C00060E000
+C0F000C0C80180C6070081FC0014247DA21B> I<7FFFFFF8780780786007801840078008
+4007800840078008C007800C800780048007800480078004800780040007800000078000
+000780000007800000078000000780000007800000078000000780000007800000078000
+000780000007800000078000000780000007800000078000000780000007800000078000
+00078000000FC00001FFFE001E227EA123> I<FFF0007FC01F80001F000F00000C000F80
+000C000780000800078000080003C000100003C000100003C000100001E000200001E000
+200001F000600000F000400000F000400000780080000078008000007C008000003C0100
+00003C010000001E020000001E020000001E020000000F040000000F040000000F8C0000
+000788000000078800000003D000000003D000000003F000000001E000000001E0000000
+00C000000000C000000000C0000022237FA125> 86 D<FFF03FFC03FE1F8007E000F80F
+0003C000700F0003C000200F0001E00020078001E00040078001E00040078003F0004003
+C002F0008003C002F0008003C002F0008003E00478018001E00478010001E00478010001
+E0083C010000F0083C020000F0083C020000F0101E02000078101E04000078101E040000
+78200F0400003C200F0800003C200F0800003C600F8800001E40079000001E4007900000
+1E4007D000001F8003F000000F8003E000000F8003E000000F0001E00000070001C00000
+070001C00000060000C0000002000080002F237FA132> I<FEFEC0C0C0C0C0C0C0C0C0C0
+C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0FE
+FE07317BA40E> 91 D<FEFE060606060606060606060606060606060606060606060606
+060606060606060606060606060606060606060606FEFE07317FA40E> 93
+D<1FE000303800780C00780E0030070000070000070000070000FF0007C7001E07003C07
+00780700700700F00708F00708F00708F00F087817083C23900FC1E015157E9418> 97
+D<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E00000E00000E00
+000E00000E00000E1F000E61C00E80600F00300E00380E003C0E001C0E001E0E001E0E00
+1E0E001E0E001E0E001E0E001E0E001C0E003C0E00380F00700C80600C41C0083F001723
+7FA21B> I<01FE000703000C07801C0780380300780000700000F00000F00000F00000F0
+0000F00000F00000F000007000007800403800401C00800C010007060001F80012157E94
+16> I<0000E0000FE00001E00000E00000E00000E00000E00000E00000E00000E00000E0
+0000E00000E00000E001F8E00704E00C02E01C01E03800E07800E07000E0F000E0F000E0
+F000E0F000E0F000E0F000E0F000E07000E07800E03800E01801E00C02E0070CF001F0FE
+17237EA21B> I<01FC000707000C03801C01C03801C07801E07000E0F000E0FFFFE0F000
+00F00000F00000F00000F000007000007800203800201C00400E008007030000FC001315
+7F9416> I<003E0000E30001C78003878003078007000007000007000007000007000007
+0000070000070000070000FFF80007000007000007000007000007000007000007000007
+00000700000700000700000700000700000700000700000700000700000700000780007F
+F000112380A20F> I<00007003F1980E1E181C0E18380700380700780780780780780780
+7807803807003807001C0E001E1C0033F0002000002000003000003800003FFE001FFFC0
+0FFFE03000F0600030C00018C00018C00018C000186000306000303800E00E038003FE00
+15217F9518> I<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E00
+000E00000E00000E00000E00000E1F800E60C00E80E00F00700F00700E00700E00700E00
+700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00
+70FFE7FF18237FA21B> I<1C003E003E003E001C00000000000000000000000000000000
+000E007E001E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E
+000E000E00FFC00A227FA10E> I<00E001F001F001F000E0000000000000000000000000
+00000000007007F000F00070007000700070007000700070007000700070007000700070
+00700070007000700070007000700070007000706070F0E0F0C061803F000C2C83A10F>
+I<0E0000FE00001E00000E00000E00000E00000E00000E00000E00000E00000E00000E00
+000E00000E00000E03FC0E01F00E01C00E01800E02000E04000E08000E10000E38000EF8
+000F1C000E1E000E0E000E07000E07800E03C00E01C00E01E00E00F00E00F8FFE3FE1723
+7FA21A> I<0E00FE001E000E000E000E000E000E000E000E000E000E000E000E000E000E
+000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E000E
+00FFE00B237FA20E> I<0E1FC07F00FE60E183801E807201C00F003C00E00F003C00E00E
+003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E00
+3800E00E003800E00E003800E00E003800E00E003800E00E003800E00E003800E00E0038
+00E0FFE3FF8FFE27157F942A> I<0E1F80FE60C01E80E00F00700F00700E00700E00700E
+00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E
+0070FFE7FF18157F941B> I<01FC000707000C01801800C03800E0700070700070F00078
+F00078F00078F00078F00078F00078F000787000707800F03800E01C01C00E0380070700
+01FC0015157F9418> I<0E1F00FE61C00E80600F00700E00380E003C0E003C0E001E0E00
+1E0E001E0E001E0E001E0E001E0E001E0E003C0E003C0E00380F00700E80E00E41C00E3F
+000E00000E00000E00000E00000E00000E00000E00000E00000E0000FFE000171F7F941B
+> I<01F8200704600E02601C01603801E07800E07800E0F000E0F000E0F000E0F000E0F0
+00E0F000E0F000E07800E07800E03801E01C01E00C02E0070CE001F0E00000E00000E000
+00E00000E00000E00000E00000E00000E00000E0000FFE171F7E941A> I<0E3CFE461E8F
+0F0F0F060F000E000E000E000E000E000E000E000E000E000E000E000E000E000F00FFF0
+10157F9413> I<0F8830786018C018C008C008E008F0007F003FE00FF001F8003C801C80
+0C800CC00CC008E018D0308FC00E157E9413> I<02000200020002000600060006000E00
+1E003E00FFFC0E000E000E000E000E000E000E000E000E000E000E000E040E040E040E04
+0E040E040708030801F00E1F7F9E13> I<0E0070FE07F01E00F00E00700E00700E00700E
+00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00F00E00F006
+017003827800FC7F18157F941B> I<FF80FE1E00781E00300E00200E0020070040070040
+0780C003808003808001C10001C10000E20000E20000E200007400007400003800003800
+00380000100017157F941A> I<FF8FF87F3E01E03C1C01C0181C01E0180E01E0100E0260
+100E027010070270200704302007043820038438400388184003881C4001C81C8001D00C
+8001D00E8000F00F0000E0070000E00700006006000040020020157F9423> I<FF83FE1F
+00F00E00C007008007810003830001C20000E400007800007800003800003C00004E0000
+8F000187000103800201C00401E00C00E03E01F0FF03FE17157F941A> I<FF80FE1E0078
+1E00300E00200E00200700400700400780C003808003808001C10001C10000E20000E200
+00E200007400007400003800003800003800001000001000002000002000002000004000
+F04000F08000F180004300003C0000171F7F941A> I<3FFFC0380380300780200700600E
+00401C00403C0040380000700000E00001E00001C0000380400700400F00400E00C01C00
+80380080780180700780FFFF8012157F9416> I<FFFFFFFFFFFF3001808C31> 124
+D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fl cmbx12 14.4 19
+/Fl 19 118 df<00007FE0030007FFFC07001FFFFF0F007FF00F9F00FF0001FF01FC0000
+FF03F800007F07F000003F0FE000001F1FC000001F1FC000000F3F8000000F3F80000007
+7F800000077F800000077F00000000FF00000000FF00000000FF00000000FF00000000FF
+00000000FF00000000FF00000000FF00000000FF000000007F000000007F800000007F80
+0000073F800000073F800000071FC00000071FC000000E0FE000000E07F000001C03F800
+003C01FC00007800FF0001F0007FF007C0001FFFFF800007FFFE0000007FF00028297CA8
+31> 67 D<FFFFFC0000FFFFFC0000FFFFFC000003FC00000003FC00000003FC00000003
+FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC
+00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00000003FC00
+000003FC00000003FC00000003FC00000003FC0001C003FC0001C003FC0001C003FC0001
+C003FC0003C003FC00038003FC00038003FC00078003FC00078003FC000F8003FC000F80
+03FC001F8003FC007F8003FC01FF00FFFFFFFF00FFFFFFFF00FFFFFFFF0022297EA828>
+76 D<0000FFC00000000FFFFC0000003F807F000000FE001FC00001F80007E00003F000
+03F00007E00001F8000FE00001FC001FC00000FE001FC00000FE003F8000007F003F8000
+007F007F8000007F807F0000003F807F0000003F807F0000003F80FF0000003FC0FF0000
+003FC0FF0000003FC0FF0000003FC0FF0000003FC0FF0000003FC0FF0000003FC0FF0000
+003FC0FF0000003FC0FF0000003FC07F0000003F807F8000007F807F8000007F803F8000
+007F003F8000007F001FC00000FE001FC00000FE000FE00001FC0007F00003F80003F800
+07F00001FC000FE00000FE001FC000003FC0FF0000000FFFFC00000000FFC000002A297C
+A833> 79 D<FFFFF0007FFFFFFFF0007FFFFFFFF0007FFF03FE000001C001FE00000380
+01FE0000038001FF0000078000FF0000070000FF80000F00007F80000E00007FC0000E00
+003FC0001C00003FC0001C00003FE0003C00001FE0003800001FF0007800000FF0007000
+000FF80070000007F800E0000007F800E0000003FC01C0000003FC01C0000003FE03C000
+0001FE0380000001FF0780000000FF0700000000FF87000000007F8E000000007F8E0000
+00007FDE000000003FDC000000003FFC000000001FF8000000001FF8000000000FF00000
+00000FF0000000000FF00000000007E00000000007E00000000003C00000000003C00000
+30297FA833> 86 D<03FF80000FFFF0001F01FC003F80FE003F807F003F803F003F803F
+801F003F8000003F8000003F8000003F8000003F80003FFF8001FC3F800FE03F801F803F
+803F003F807E003F80FC003F80FC003F80FC003F80FC003F80FC005F807E00DF803F839F
+FC1FFE0FFC03FC03FC1E1B7E9A21> 97 D<FFE00000FFE00000FFE000000FE000000FE0
+00000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE0
+00000FE000000FE1FE000FEFFF800FFE07E00FF803F00FF001F80FE000FC0FE000FC0FE0
+007E0FE0007E0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0
+007F0FE0007E0FE0007E0FE0007E0FE000FC0FE000FC0FF001F80FF803F00F9C0FE00F0F
+FF800E01FC00202A7EA925> I<00007FF000007FF000007FF0000007F0000007F0000007
+F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007F0000007
+F0003F87F001FFF7F007F03FF00FC00FF01F8007F03F0007F03F0007F07E0007F07E0007
+F07E0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007
+F07E0007F07E0007F03F0007F03F0007F01F800FF00FC01FF007E07FFF01FFE7FF007F87
+FF202A7EA925> 100 D<003FC00001FFF00003E07C000F803E001F801F001F001F003F00
+0F807E000F807E000FC07E000FC0FE0007C0FE0007C0FFFFFFC0FFFFFFC0FE000000FE00
+0000FE0000007E0000007E0000007F0000003F0001C01F0001C00F80038007C0070003F0
+1E0000FFFC00003FE0001A1B7E9A1F> I<0007F8003FFC007E3E01FC7F03F87F03F07F07
+F07F07F03E07F00007F00007F00007F00007F00007F00007F000FFFFC0FFFFC0FFFFC007
+F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007F00007
+F00007F00007F00007F00007F00007F00007F00007F00007F0007FFF807FFF807FFF8018
+2A7EA915> I<FFE00000FFE00000FFE000000FE000000FE000000FE000000FE000000FE0
+00000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE07E000FE1
+FF800FE30FC00FE40FE00FE807E00FF807F00FF007F00FF007F00FE007F00FE007F00FE0
+07F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE0
+07F00FE007F00FE007F00FE007F00FE007F0FFFE3FFFFFFE3FFFFFFE3FFF202A7DA925>
+104 D<07000F801FC03FE03FE03FE01FC00F8007000000000000000000000000000000FF
+E0FFE0FFE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00F
+E00FE00FE00FE00FE00FE0FFFEFFFEFFFE0F2B7EAA12> I<FFE0FFE0FFE00FE00FE00FE0
+0FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0
+0FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE0FFFEFFFEFFFE
+0F2A7EA912> 108 D<FFC07E00FFC1FF80FFC30FC00FC40FE00FC807E00FD807F00FD007
+F00FD007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007
+F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F0FFFE3F
+FFFFFE3FFFFFFE3FFF201B7D9A25> 110 D<003FE00001FFFC0003F07E000FC01F801F80
+0FC03F0007E03F0007E07E0003F07E0003F07E0003F0FE0003F8FE0003F8FE0003F8FE00
+03F8FE0003F8FE0003F8FE0003F8FE0003F87E0003F07E0003F03F0007E03F0007E01F80
+0FC00FC01F8007F07F0001FFFC00003FE0001D1B7E9A22> I<FFE1FE00FFEFFF80FFFE0F
+E00FF803F00FF001F80FE001FC0FE000FC0FE000FE0FE000FE0FE0007F0FE0007F0FE000
+7F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007F0FE0007E0FE000FE0FE000FE0FE000
+FC0FE001FC0FF001F80FF807F00FFC0FE00FEFFF800FE1FC000FE000000FE000000FE000
+000FE000000FE000000FE000000FE000000FE000000FE00000FFFE0000FFFE0000FFFE00
+0020277E9A25> I<FFC1F0FFC7FCFFC63E0FCC7F0FD87F0FD07F0FD07F0FF03E0FE0000F
+E0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000F
+E0000FE0000FE000FFFF00FFFF00FFFF00181B7F9A1B> 114 D<03FE300FFFF03E03F078
+00F07000F0F00070F00070F80070FE0000FFE0007FFF007FFFC03FFFE01FFFF007FFF800
+FFF80007FC0000FCE0007CE0003CF0003CF00038F80038FC0070FF01E0E7FFC0C1FF0016
+1B7E9A1B> I<00E00000E00000E00000E00001E00001E00001E00003E00003E00007E000
+0FE0001FFFE0FFFFE0FFFFE00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE000
+0FE0000FE0000FE0000FE0000FE0000FE0700FE0700FE0700FE0700FE0700FE0700FE070
+07F0E003F0C001FF80007F0014267FA51A> I<FFE07FF0FFE07FF0FFE07FF00FE007F00F
+E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00F
+E007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE007F00FE00FF00F
+E00FF007E017F003F067FF01FFC7FF007F87FF201B7D9A25> I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fm cmr12 14.4 20
+/Fm 20 118 df<78FCFCFEFE7A02020202040404080810204007127B8510> 44
+D<00200000E00001E0000FE000FFE000F1E00001E00001E00001E00001E00001E00001E0
+0001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0
+0001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E00001E0
+0001E00003F000FFFFC0FFFFC012287BA71D> 49 D<01FC0007FF000C0FC01803E02001
+F06001F04000F84000F8F800FCFC00FCFC007CFC007CFC007C7800FC0000FC0000F80000
+F80001F00001F00003E00003C0000780000700000E00001C0000380000300000600000C0
+000180000300040200040400080800081000082000183FFFF87FFFF0FFFFF0FFFFF01628
+7DA71D> I<000FC0003FF000F01801C01803803C07007C0F007C0E00381E00003C00003C
+00003C0000780000780000780000F83F00F8C1C0F900E0FA0070FA0038FC003CFC001EFC
+001EF8001EF8001FF8001FF8001FF8001F78001F78001F78001F78001F3C001E3C001E1C
+003C1E003C0E007807007003C1E001FFC0007E0018297EA71D> 54
+D<007E0001FF800781C00F00E01E00703C00383C003878003C78003CF8001EF8001EF800
+1EF8001EF8001FF8001FF8001FF8001F78001F78003F78003F3C003F1C005F0E005F0700
+9F03831F00FC1F00001E00001E00001E00003E00003C00003C0000381C00783E00703E00
+E03C01C01803801C0F000FFE0003F80018297EA71D> 57 D<0000FF00100007FFE03000
+1FC07830003E000C7000F80006F001F00003F003E00001F007C00000F00F800000700F80
+0000701F000000303F000000303E000000303E000000107E000000107E000000107C0000
+0000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC000000
+00FC00000000FC0000FFFF7C0000FFFF7E000003F07E000001F03E000001F03E000001F0
+3F000001F01F000001F00F800001F00F800001F007C00001F003E00001F001F00002F000
+F80002F0003E000C70001FC038300007FFE0100000FF8000282B7DA92E> 71
+D<01FFFE01FFFE0007E00003E00003E00003E00003E00003E00003E00003E00003E00003
+E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003
+E00003E00003E00003E00003E00003E00003E00003E03003E07803E0FC03E0FC03E0FC03
+C0F807C0400780200F00300E000C3C0003F000172A7DA81E> 74
+D<0001FF0000000F01E000003C0078000078003C0000E0000E0001E0000F0003C0000780
+07800003C00F800003E01F000001F01F000001F03E000000F83E000000F87E000000FC7E
+000000FC7C0000007C7C0000007CFC0000007EFC0000007EFC0000007EFC0000007EFC00
+00007EFC0000007EFC0000007EFC0000007EFC0000007E7C0000007C7E000000FC7E0000
+00FC7E000000FC3E000000F83F000001F81F000001F01F000001F00F800003E007800003
+C007C00007C003E0000F8000F0001E000078003C00003C007800000F01E0000001FF0000
+272B7DA92E> 79 D<03FC00000C070000100380003C01C0003E01E0003E00F0001C00F0
+000800F0000000F0000000F0000000F000007FF00003E0F0000F80F0001E00F0003C00F0
+007C00F0007800F040F800F040F800F040F800F040F801F0407C01F0403C0278801E0C7F
+8007F01E001A1A7E991D> 97 D<0F000000FF000000FF0000001F0000000F0000000F00
+00000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F0000000F00
+00000F0000000F07E0000F1838000F600E000F8007000F8007800F0003C00F0003C00F00
+01E00F0001E00F0001F00F0001F00F0001F00F0001F00F0001F00F0001F00F0001F00F00
+01E00F0001E00F0003E00F0003C00F0003800F8007800E800F000E401C000C303800080F
+C0001C2A7EA921> I<007F0001C0E00700100E00781E00F83C00F83C00707C0020780000
+F80000F80000F80000F80000F80000F80000F80000F800007800007C00003C00083C0008
+1E00100E002007006001C180007E00151A7E991A> I<00FC000387800701C00E01E01C00
+E03C00F03C00F0780078780078F80078F80078FFFFF8F80000F80000F80000F80000F800
+007800007800003C00083C00081E00100E002007004001C180007E00151A7E991A> 101
+D<00000F0001FC3080070743800E03C3801E03C1003C01E0003C01E0007C01F0007C01F0
+007C01F0007C01F0007C01F0003C01E0003C01E0001E03C0000E0380001707000011FC00
+0030000000300000003000000030000000180000001FFF80000FFFF00007FFF80018007C
+0030001E0070000E0060000700E0000700E0000700E0000700E000070070000E0070000E
+0038001C001C0038000781E00000FF000019287E9A1D> 103 D<1E003F003F003F003F00
+1E000000000000000000000000000000000000000F00FF00FF001F000F000F000F000F00
+0F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F00FFF0FFF0
+0C297EA811> 105 D<007E0003C3C00700E00E00701C00383C003C3C003C78001E78001E
+F8001FF8001FF8001FF8001FF8001FF8001FF8001FF8001F78001E78001E3C003C3C003C
+1C00380E00700700E003C3C0007E00181A7E991D> 111 D<003F010001E0830003804300
+0F0027001E0017001E001F003C000F007C000F007C000F0078000F00F8000F00F8000F00
+F8000F00F8000F00F8000F00F8000F00F8000F007C000F007C000F003C000F003E001F00
+1E001F000F002F0007804F0001C18F00007E0F0000000F0000000F0000000F0000000F00
+00000F0000000F0000000F0000000F0000000F0000000F000000FFF00000FFF01C267E99
+1F> 113 D<0F0F80FF11C0FF23E01F43E00F83E00F81C00F80000F00000F00000F00000F
+00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F00000F
+00000F8000FFFC00FFFC00131A7E9917> I<07F0801C0D80300380600180E00180E00080
+E00080F00080F800007E00007FE0003FFC001FFE0007FF00003F800007808003C08003C0
+8001C0C001C0C001C0E00180E00380F00300CC0E0083F800121A7E9917> I<0080000080
+000080000080000180000180000180000380000380000780000F80001FFF80FFFF800780
+000780000780000780000780000780000780000780000780000780000780000780000780
+0007804007804007804007804007804007804007804003C08001C08000E100003E001225
+7FA417> I<0F000F00FF00FF00FF00FF001F001F000F000F000F000F000F000F000F000F
+000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F000F
+000F000F000F000F000F000F000F001F000F001F0007002F0003804F8001C08FF0007F0F
+F01C1A7E9921> I E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fn cmr17 20.74 18
+/Fn 18 119 df<000001FF00008000001FFFE0018000007F007801800001F8000E038000
+03E000070780000FC000018780001F000000CF80003E0000006F80007C0000003F8000F8
+0000003F8001F00000001F8003F00000000F8007E00000000F8007C000000007800FC000
+000007800FC000000007801F8000000003801F8000000003803F8000000003803F000000
+0001803F0000000001807F0000000001807F0000000001807E0000000000007E00000000
+0000FE000000000000FE000000000000FE000000000000FE000000000000FE0000000000
+00FE000000000000FE000000000000FE000000000000FE000000000000FE000000000000
+FE0000000000007E0000000000007E0000000000007F0000000000007F0000000001803F
+0000000001803F0000000001803F8000000001801F8000000001801F8000000003000FC0
+00000003000FC0000000030007E0000000060007E0000000060003F0000000060001F000
+00000C0000F80000001800007C0000001800003E0000003000001F0000006000000FC000
+01C0000003E0000380000001F8000E000000007F007C000000001FFFF00000000001FF00
+0000313D7CBB39> 67 D<FFFFFC000000FFFFFC00000003FE0000000001F80000000001
+F80000000001F80000000001F80000000001F80000000001F80000000001F80000000001
+F80000000001F80000000001F80000000001F80000000001F80000000001F80000000001
+F80000000001F80000000001F80000000001F80000000001F80000000001F80000000001
+F80000000001F80000000001F80000000001F80000000001F80000000001F80000000001
+F80000000001F80000000001F80000000001F80000000001F80000000001F80000000001
+F80000000001F80000000001F80000000001F80000006001F80000006001F80000006001
+F80000006001F80000006001F8000000E001F8000000C001F8000000C001F8000000C001
+F8000000C001F8000001C001F8000001C001F8000001C001F8000003C001F8000007C001
+F8000007C001F800000FC001F800003F8001F80000FF8003FC0007FF80FFFFFFFFFF80FF
+FFFFFFFF802B3B7CBA32> 76 D<000003FF00000000001E01E000000000F0003C000000
+03C0000F000000078000078000000F000003C000003E000001F000007C000000F80000F8
+0000007C0001F00000003E0001F00000003E0003E00000001F0007E00000001F8007C000
+00000F800FC00000000FC00F8000000007C01F8000000007E01F8000000007E03F000000
+0003F03F0000000003F03F0000000003F07F0000000003F87E0000000001F87E00000000
+01F87E0000000001F8FE0000000001FCFE0000000001FCFE0000000001FCFE0000000001
+FCFE0000000001FCFE0000000001FCFE0000000001FCFE0000000001FCFE0000000001FC
+FE0000000001FCFE0000000001FC7E0000000001F87F0000000003F87F0000000003F87F
+0000000003F87F0000000003F83F0000000003F03F8000000007F01F8000000007E01F80
+00000007E01FC00000000FE00FC00000000FC007C00000000F8007E00000001F8003E000
+00001F0001F00000003E0001F80000007E0000F80000007C00007C000000F800003E0000
+01F000000F000003C000000780000780000003E0001F00000000F8007C000000001E01E0
+0000000003FF000000363D7CBB3E> 79 D<003F80000001C0F0000003003C000004001E
+00000C000F000018000780001C0007C0003E0003C0003F0003E0003F0003E0003F0003E0
+001E0003E000000003E000000003E000000003E00000003FE000000FF3E000007E03E000
+01F803E00003E003E0000FC003E0001F8003E0003F0003E0003E0003E0007E0003E0007E
+0003E060FC0003E060FC0003E060FC0003E060FC0007E060FC0007E0607C000BE0607E00
+0BE0603E0011F0C01F0060F0C007C1807F8000FE003E0023257CA427> 97
+D<03E0000000FFE0000000FFE000000007E000000003E000000003E000000003E0000000
+03E000000003E000000003E000000003E000000003E000000003E000000003E000000003
+E000000003E000000003E000000003E000000003E000000003E000000003E000000003E0
+00000003E000000003E03FC00003E0E0780003E3001C0003E6000F0003E800078003F800
+03C003F00001E003E00001F003E00000F003E00000F803E00000F803E00000FC03E00000
+7C03E000007C03E000007E03E000007E03E000007E03E000007E03E000007E03E000007E
+03E000007E03E000007E03E000007E03E000007C03E000007C03E00000FC03E00000F803
+E00000F803E00001F003E00001E003F00003E003D80003C003C80007800384000E000383
+001C000381C0F00003003F8000273C7EBB2C> I<0007F800003C0E0000F0018001E000C0
+03C00060078000300F0000701F0000F81F0001F83E0001F83E0001F87E0000F07C000000
+7C000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000
+FC0000007C0000007C0000007E0000003E0000003E00000C1F00000C1F0000180F800018
+0780003003C0006001E000C000F00180003C0E000007F8001E257DA423> I<0007F80000
+3C1E0000F0078001C003C003C001E0078000F00F0000F81F0000781E00007C3E00007C3E
+00007C7E00003E7C00003E7C00003EFC00003EFC00003EFFFFFFFEFC000000FC000000FC
+000000FC000000FC000000FC0000007C0000007C0000007E0000003E0000003E0000061F
+0000060F00000C0F80000C0780001803C0003000E00060007000C0001E07000003FC001F
+257EA423> 101 D<0000FC0000078300000E0380001C07C0003C0FC000780FC000F80FC0
+00F8078000F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00000
+01F0000001F0000001F0000001F0000001F0000001F0000001F00000FFFFFC00FFFFFC00
+01F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00000
+01F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00000
+01F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00000
+01F0000001F0000001F0000001F0000001F0000003F800007FFFE0007FFFE0001A3C7FBB
+18> I<07000F801FC01FC01FC00F80070000000000000000000000000000000000000000
+0000000000000007C0FFC0FFC00FC007C007C007C007C007C007C007C007C007C007C007
+C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007
+C007C00FE0FFFEFFFE0F397DB815> 105 D<0003800007C0000FE0000FE0000FE00007C0
+000380000000000000000000000000000000000000000000000000000000000000000000
+0000000000000007E000FFE000FFE0000FE00003E00003E00003E00003E00003E00003E0
+0003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E0
+0003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E0
+0003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E00003E0
+7803C0FC07C0FC0780FC0780FC0F00780E00381C000FE000134A82B818> I<07C0FFC0FF
+C00FC007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007
+C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007
+C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007C007
+C00FE0FFFEFFFE0F3C7DBB15> 108 D<03E01FE0003FC000FFE0607C00C0F800FFE0801E
+01003C0007E3000F06001E0003E4000F88001F0003E4000F88001F0003E8000790000F00
+03E80007D0000F8003F00007E0000F8003F00007E0000F8003E00007C0000F8003E00007
+C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F80
+03E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007
+C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F80
+03E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007
+C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F8003E00007C0000F80
+07F0000FE0001FC0FFFF81FFFF03FFFEFFFF81FFFF03FFFE3F257EA443> I<03E01FE000
+FFE0607C00FFE0801E0007E3000F0003E4000F8003E4000F8003E800078003E80007C003
+F00007C003F00007C003E00007C003E00007C003E00007C003E00007C003E00007C003E0
+0007C003E00007C003E00007C003E00007C003E00007C003E00007C003E00007C003E000
+07C003E00007C003E00007C003E00007C003E00007C003E00007C003E00007C003E00007
+C003E00007C003E00007C003E00007C003E00007C007F0000FE0FFFF81FFFFFFFF81FFFF
+28257EA42C> I<0007FC0000001C070000007001C00001E000F00003C00078000780003C
+000F00001E001F00001F001E00000F003E00000F803E00000F807C000007C07C000007C0
+7C000007C0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC
+000007E0FC000007E0FC000007E07C000007C07C000007C07E00000FC03E00000F803E00
+000F801E00000F001F00001F000F00001E000780003C0003C000780001E000F000007001
+C000001C0700000007FC000023257EA427> I<03E03E00FFE0C300FFE1078007E20FC003
+E40FC003E80FC003E8078003E8030003F0000003F0000003F0000003E0000003E0000003
+E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003
+E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003
+E0000003E0000003E0000007F00000FFFFC000FFFFC0001A257EA41E> 114
+D<00FF02000700C6000C002E0010001E0030001E0060000E0060000E00E0000600E00006
+00E0000600F0000600F8000600FC0000007F0000003FF000003FFF80000FFFE00007FFF0
+0001FFFC00003FFE000001FE0000003F00C0001F00C0000F80C0000780E0000380E00003
+80E0000380E0000380F0000300F0000300F8000700F8000600E4000C00E2001800C18070
+00807F800019257DA41F> I<003000000030000000300000003000000030000000300000
+0070000000700000007000000070000000F0000000F0000001F0000001F0000003F00000
+07F000001FFFFE00FFFFFE0001F0000001F0000001F0000001F0000001F0000001F00000
+01F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F00000
+01F0000001F0000001F0000001F0000001F0018001F0018001F0018001F0018001F00180
+01F0018001F0018001F0018001F0018000F0010000F8030000F8030000780200003C0400
+000E08000003F00019357FB41E> I<FFFE000FFFFFFE000FFF07F00007F803E00003E003
+E00001C001F00001C001F000018001F800018000F800030000F8000300007C000600007C
+000600007E000600003E000C00003E000C00003F001C00001F001800001F001800000F80
+3000000F803000000FC070000007C060000007C060000003E0C0000003E0C0000003F1C0
+000001F180000001F180000000FB00000000FB00000000FF000000007E000000007E0000
+00003C000000003C000000003C0000000018000028257FA42A> 118
+D E
+%EndDVIPSBitmapFont
+end
+%%EndProlog
+%%BeginSetup
+%%Feature: *Resolution 300dpi
+TeXDict begin
+%%PaperSize: a4
+
+userdict/PStoPSxform PStoPSmatrix matrix currentmatrix
+ matrix invertmatrix matrix concatmatrix
+ matrix invertmatrix put
+%%EndSetup
+%%Page: (0,1) 1
+userdict/PStoPSsaved save put
+PStoPSmatrix setmatrix
+595.000000 0.271378 translate
+90 rotate
+0.706651 dup scale
+userdict/PStoPSmatrix matrix currentmatrix put
+userdict/PStoPSclip{0 0 moveto
+ 595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
+ closepath}put initclip
+/showpage{}def/copypage{}def/erasepage{}def
+PStoPSxform concat
+1 0 bop Fn 281 370 a(Cleaner) p 570 370 a(seman) n(tics) p
+927 370 a(for) p 1047 370 a(Ob) t(jectiv) n(e) p 1404
+370 a(Lab) r(el) p Fm 717 518 a(Jacques) p 934 518 a(Garrigue) 719
+634 y(Octob) r(er) p 945 634 a(26,) p 1040 634 a(1999) p
+Fl 11 836 a(Credits) p Fk 11 929 a(This) p 122 929 a(prop) q(osal) p
+319 929 a(con) o(tains) p 510 929 a(ideas) p 632 929
+a(from) p 747 929 a(Damien) p 928 929 a(Doligez) p 1101
+929 a(and) p 1196 929 a(Pierre) p 1340 929 a(W) l(eis.) p
+Fl 11 1073 a(Lab) r(els) p 221 1073 a(and) p 351 1073
+a(optionals) p Fk 11 1165 a(Lab) q(els) p 165 1165 a(and) p
+259 1165 a(optional) p 449 1165 a(argumen) o(ts) p 687
+1165 a(had) p 781 1165 a(t) o(w) o(o) p 873 1165 a(problems) p
+1082 1165 a(in) p 1139 1165 a(Ob) s(jectiv) o(e) p 1360
+1165 a(Lab) q(el.) p Fj 83 1280 a(\017) p Fk 133 1280
+a(They) p 259 1280 a(w) o(ere) p 372 1280 a(not) p 459
+1280 a(fully) p 570 1280 a(coheren) o(t) p 767 1280 a(with) p
+878 1280 a(the) p 963 1280 a(original) p 1139 1280 a(call-b) o(y-v) m
+(alue) p 1423 1280 a(seman) o(tics) p 1644 1280 a(of) p
+1700 1280 a(the) p 1784 1280 a(lan-) 133 1340 y(guage.) p
+303 1340 a(In) p 368 1340 a(some) p 495 1340 a(\(subtle\)) p
+681 1340 a(cases,) p 823 1340 a(a) p 868 1340 a(side-e\013ect) p
+1099 1340 a(migh) o(t) p 1243 1340 a(get) p 1329 1340
+a(dela) o(y) o(ed) p 1508 1340 a(more) p 1635 1340 a(than) p
+1753 1340 a(in) p 1814 1340 a(an) 133 1400 y(un) o(t) o(yp) q(ed) p
+322 1400 a(seman) o(tics.) p Fj 83 1502 a(\017) p Fk
+133 1502 a(F) l(or) p 220 1502 a(optional) p 410 1502
+a(argumen) o(ts,) p 660 1502 a(no) p 728 1502 a(un) o(t) o(yp) q(ed) p
+918 1502 a(seman) o(tics) p 1139 1502 a(existed.) 84
+1616 y(This) p 195 1616 a(new) p 295 1616 a(prop) q(osal) p
+492 1616 a(corrects) p 674 1616 a(these) p 799 1616 a(t) o(w) o(o) p
+891 1616 a(\015a) o(ws.) p Fi 11 1746 a(Syn) n(tax) p
+Fk 11 1838 a(W) l(e) p 95 1838 a(k) o(eep) p 206 1838
+a(Ob) s(jectiv) o(e) p 426 1838 a(Lab) q(el's) p 594
+1838 a(syn) o(tax,) p 764 1838 a(except) p 917 1838 a(for) p
+991 1838 a(default) p 1155 1838 a(v) m(alues) p 1301
+1838 a(in) p 1357 1838 a(optional) p 1547 1838 a(argumen) o(ts.) p
+Fh 329 1944 a(typ) n(expr) p Fk 528 1944 a(::=) p Fg
+634 1944 a(:) p 656 1944 a(:) p 678 1944 a(:) p Fj 579
+2004 a(j) p Fh 634 2004 a(typ) n(expr) p Fj 806 2004
+a(!) p Fh 870 2004 a(typ) n(expr) p Fj 579 2064 a(j) p
+Fk 634 2064 a([?]) p Fi(lab) r(el) p Fk 801 2064 a(:) p
+Fh(typ) n(expr) p Fj 987 2064 a(!) p Fh 1050 2064 a(typ) n(expr) 391
+2124 y(expr) p Fk 528 2124 a(::=) p Fg 634 2124 a(:) p
+656 2124 a(:) p 678 2124 a(:) p Fj 579 2185 a(j) p Fh
+634 2185 a(expr) p 746 2185 a(lab) n(ele) n(d-expr) p
+Ff 991 2163 a(+) p Fj 579 2245 a(j) p Fe 634 2245 a(fun) p
+Fj 728 2245 a(f) p Fh(lab) n(ele) n(d-simple-p) n(attern) p
+Fj 1209 2245 a(g) p Ff 1234 2227 a(+) p Fk 1280 2245
+a([) p Fe(when) p Fh 1412 2245 a(expr) p Fk 1507 2245
+a(]) p Fj 1535 2245 a(!) p Fh 1599 2245 a(expr) p Fj
+579 2305 a(j) p Fe 634 2305 a(function) p Fh 856 2305
+a(lab) n(ele) n(d-p) n(attern) p Fk 1177 2305 a([) p
+Fe(when) p Fh 1309 2305 a(expr) p Fk 1404 2305 a(]) p
+Fj 1432 2305 a(!) p Fh 1496 2305 a(expr) p Fj 785 2365
+a(f) p Fe(|) p Fh 851 2365 a(lab) n(ele) n(d-p) n(attern) p
+Fk 1172 2365 a([) p Fe(when) p Fg 1305 2365 a(expr) p
+Fk 1403 2365 a(]) p Fj 1430 2365 a(!) p Fh 1494 2365
+a(expr) p Fj 1589 2365 a(g) p Fd 1614 2347 a(\003) p
+Fh 242 2425 a(lab) n(ele) n(d-expr) p Fk 528 2425 a(::=) p
+634 2425 a([?]) p Fh(expr) p Fj 579 2486 a(j) p Fk 634
+2486 a([?]) p Fi(lab) r(el) p Fk 801 2486 a(:) p Fh(expr) 182
+2546 y(lab) n(ele) n(d-p) n(attern) p Fk 528 2546 a(::=) p
+Fh 634 2546 a(p) n(attern) p Fj 579 2606 a(j) p Fi 634
+2606 a(lab) r(el) p Fk 751 2606 a(:) p Fh(p) n(attern) p
+Fj 579 2666 a(j) p Fk 634 2666 a(?[) p Fe(\() p Fh(expr) p
+Fe(\)) p Fk(]) p Fi(lab) r(el) p Fk 943 2666 a(:) p Fh
+956 2666 a(p) n(attern) p Fk 926 2937 a(1) p eop
+PStoPSsaved restore
+userdict/PStoPSsaved save put
+PStoPSmatrix setmatrix
+595.000000 421.271378 translate
+90 rotate
+0.706651 dup scale
+userdict/PStoPSmatrix matrix currentmatrix put
+userdict/PStoPSclip{0 0 moveto
+ 595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
+ closepath}put initclip
+PStoPSxform concat
+2 1 bop Fi 11 168 a(Dynamic) p 247 168 a(seman) n(tics) p
+Fj 11 261 a(;) p Fk 52 261 a(is) p 101 261 a(a) p 141
+261 a(notation) p 337 261 a(for) p 411 261 a(the) p 495
+261 a(empt) o(y) p 644 261 a(lab) q(el.) 86 366 y(\() p
+Fe(fun) p Fi 198 366 a(l) p Fc 214 373 a(i) p Fk 227
+366 a(:) p Fg(x) p Fj 282 366 a(!) p Fg 346 366 a(e) p
+Fk(\)) p Fi 404 366 a(l) p Fc 420 373 a(1) p Fk 442 366
+a(:) p Fg 455 366 a(e) p Ff 478 373 a(1) p Fg 506 366
+a(:) p 528 366 a(:) p 550 366 a(:) p Fi 571 366 a(l) p
+Fc 587 373 a(n) p Fk 612 366 a(:) p Fg 625 366 a(e) p
+Fb 648 373 a(n) p Fj 515 427 a(!) p Fk 579 427 a(\() p
+Fg(e) p Fk([) p Fg(e) p Fb 658 434 a(i) p Fg 671 427
+a(=x) p Fk(]) p Fi 752 427 a(l) p Fc 768 434 a(1) p Fk
+790 427 a(:) p Fg(e) p Ff 827 434 a(1) p Fg 855 427 a(:) p
+877 427 a(:) p 899 427 a(:) p Fi 920 427 a(l) p Fc 936
+434 a(i) p Fd(\000) p Fc(1) p Fk 997 427 a(:) p Fg 1010
+427 a(e) p Fb 1033 434 a(i) p Fd(\000) p Ff(1) p Fi 1108
+427 a(l) p Fc 1124 434 a(i) p Ff(+) p Fc(1) p Fk 1185
+427 a(:) p Fg(e) p Fb 1222 434 a(i) p Ff(+1) p Fg 1289
+427 a(:) p 1311 427 a(:) p 1333 427 a(:) p Fi 1354 427
+a(l) p Fc 1370 434 a(n) p Fk 1395 427 a(:) p Fg 1408
+427 a(e) p Fb 1431 434 a(n) p Fk 86 487 a(\() p Fe(fun) p
+Fk 198 487 a(?) p Fi(l) p Fc 237 494 a(i) p Fk 250 487
+a(:) p Fg(x) p Fj 305 487 a(!) p Fg 369 487 a(e) p Fk(\)) p
+Fi 427 487 a(l) p Fc 443 494 a(1) p Fk 465 487 a(:) p
+Fg 478 487 a(e) p Ff 501 494 a(1) p Fg 529 487 a(:) p
+551 487 a(:) p 573 487 a(:) p Fi 594 487 a(l) p Fc 610
+494 a(n) p Fk 635 487 a(:) p Fg 648 487 a(e) p Fb 671
+494 a(n) p Fj 515 547 a(!) p Fg 579 547 a(e) p Fk([) p
+Fe(Some) p Fk 717 547 a(\() p Fg(e) p Fb 759 554 a(i) p
+Fk 773 547 a(\)) p Fg(=x) p Fk(]) p Fi 874 547 a(l) p
+Fc 890 554 a(1) p Fk 912 547 a(:) p Fg 925 547 a(e) p
+Ff 948 554 a(1) p Fg 976 547 a(:) p 998 547 a(:) p 1020
+547 a(:) p Fi 1042 547 a(l) p Fc 1058 554 a(i) p Fd(\000) p
+Fc(1) p Fk 1118 547 a(:) p Fg(e) p Fb 1155 554 a(i) p
+Fd(\000) p Ff(1) p Fi 1230 547 a(l) p Fc 1246 554 a(i) p
+Ff(+) p Fc(1) p Fk 1307 547 a(:) p Fg 1320 547 a(e) p
+Fb 1343 554 a(i) p Ff(+1) p Fg 1410 547 a(:) p 1432 547
+a(:) p 1454 547 a(:) p Fi 1476 547 a(l) p Fc 1492 554
+a(n) p Fk 1516 547 a(:) p Fg(e) p Fb 1553 554 a(n) p
+Fk 86 607 a(\() p Fe(fun) p Fk 198 607 a(?) p Fi(l) p
+Fk(:) p Fg 250 607 a(x) p Fj 292 607 a(!) p Fg 356 607
+a(e) p Fk(\)) p Fi 413 607 a(l) p Fc 429 614 a(1) p Fk
+451 607 a(:) p Fg(e) p Ff 488 614 a(1) p Fg 516 607 a(:) p
+538 607 a(:) p 560 607 a(:) p Fi 581 607 a(l) p Fc 597
+614 a(n) p Fk 621 607 a(:) p Fg(e) p Fb 658 614 a(n) p
+Fk 1154 607 a(when) p Fi 1281 607 a(l) p Fc 1297 614
+a(i) p Fk 1324 607 a(=) p Fj 1376 607 a(;) p Fk 1417
+607 a(and) p Fg 1512 607 a(l) p Fj 1541 607 a(62) p 1588
+607 a(f) p Fi(l) p Fc 1629 614 a(1) p Fg 1660 607 a(:) p
+1682 607 a(:) p 1704 607 a(:) p Fi 1725 607 a(l) p Fc
+1741 614 a(n) p Fj 1765 607 a(g) 515 667 y(!) p Fg 579
+667 a(e) p Fk([) p Fe(None) p Fg 717 667 a(=x) p Fk(]) p
+Fi 799 667 a(l) p Fc 815 674 a(1) p Fk 837 667 a(:) p
+Fg(e) p Ff 874 674 a(1) p Fg 901 667 a(:) p 923 667 a(:) p
+945 667 a(:) p Fi 967 667 a(l) p Fc 983 674 a(n) p Fk
+1007 667 a(:) p Fg(e) p Fb 1044 674 a(n) p Fk 86 728
+a(\(\() p Fe(fun) p Fi 217 728 a(l) p Fk(:) p Fg 246
+728 a(x) p Fj 288 728 a(!) p Fg 352 728 a(e) p Fk(\)) p
+Fi 409 728 a(l) p Fc 425 735 a(1) p Fk 447 728 a(:) p
+Fg(e) p Ff 484 735 a(1) p Fg 511 728 a(:) p 533 728 a(:) p
+555 728 a(:) p Fi 577 728 a(l) p Fc 593 735 a(m) p Fk
+629 728 a(:) p Fg 642 728 a(e) p Fb 665 735 a(m) p Fk
+698 728 a(\)) p Fi 733 728 a(l) p Fc 749 735 a(m) p Ff(+) p
+Fc(1) p Fk 833 728 a(:) p Fg 846 728 a(e) p Fb 869 735
+a(m) p Ff(+1) p Fg 955 728 a(:) p 977 728 a(:) p 999
+728 a(:) p Fi 1021 728 a(l) p Fc 1037 735 a(n) p Fk 1061
+728 a(:) p Fg(e) p Fb 1098 735 a(n) p Fk 1373 728 a(when) p
+Fi 1501 728 a(l) p Fj 1530 728 a(62) p 1577 728 a(f) p
+Fi(l) p Fc 1618 735 a(1) p Fg 1648 728 a(:) p 1670 728
+a(:) p 1692 728 a(:) p Fi 1714 728 a(l) p Fc 1730 735
+a(m) p Fj 1765 728 a(g) 515 788 y(!) p Fk 579 788 a(\() p
+Fe(fun) p Fi 691 788 a(l) p Fk(:) p Fg 720 788 a(x) p
+Fj 761 788 a(!) p Fg 825 788 a(e) p Fk(\)) p Fi 883 788
+a(l) p Fc 899 795 a(1) p Fk 921 788 a(:) p Fg 934 788
+a(e) p Ff 957 795 a(1) p Fg 985 788 a(:) p 1007 788 a(:) p
+1029 788 a(:) p Fi 1051 788 a(l) p Fc 1067 795 a(n) p
+Fk 1091 788 a(:) p Fg 1104 788 a(e) p Fb 1127 795 a(n) p
+Fk 86 848 a(\(\() p Fe(fun) p Fk 217 848 a(?) p Fi(l) p
+Fk(:) p Fg 269 848 a(x) p Fj 311 848 a(!) p Fg 375 848
+a(e) p Fk(\)) p Fi 432 848 a(l) p Fc 448 855 a(1) p Fk
+470 848 a(:) p Fg(e) p Ff 507 855 a(1) p Fg 535 848 a(:) p
+557 848 a(:) p 579 848 a(:) p Fi 600 848 a(l) p Fc 616
+855 a(m) p Fk 652 848 a(:) p Fg 665 848 a(e) p Fb 688
+855 a(m) p Fk 721 848 a(\)) p Fi 756 848 a(l) p Fc 772
+855 a(m) p Ff(+) p Fc(1) p Fk 856 848 a(:) p Fg 869 848
+a(e) p Fb 892 855 a(m) p Ff(+1) p Fg 978 848 a(:) p 1000
+848 a(:) p 1022 848 a(:) p Fi 1044 848 a(l) p Fc 1060
+855 a(n) p Fk 1084 848 a(:) p Fg(e) p Fb 1121 855 a(n) p
+Fk 1261 848 a(when) p Fj 1388 848 a(f) p Fi(l) p Fg(;) p
+Fj 1451 848 a(;g) p 1530 848 a(6) m(\\) p 1577 848 a(f) p
+Fi(l) p Fc 1618 855 a(1) p Fg 1648 848 a(:) p 1670 848
+a(:) p 1692 848 a(:) p Fi 1714 848 a(l) p Fc 1730 855
+a(m) p Fj 1765 848 a(g) 515 908 y(!) p Fk 579 908 a(\() p
+Fe(fun) p Fk 691 908 a(?) p Fi(l) p Fk(:) p Fg 743 908
+a(x) p Fj 785 908 a(!) p Fg 848 908 a(e) p Fk(\)) p Fi
+906 908 a(l) p Fc 922 915 a(1) p Fk 944 908 a(:) p Fg(e) p
+Ff 981 915 a(1) p Fg 1008 908 a(:) p 1030 908 a(:) p
+1052 908 a(:) p Fi 1074 908 a(l) p Fc 1090 915 a(n) p
+Fk 1114 908 a(:) p Fg 1127 908 a(e) p Fb 1150 915 a(n) p
+Fi 11 1035 a(T) n(yping) p Fk 11 1127 a(Seman) o(tics) p
+240 1127 a(are) p 321 1127 a(k) o(ept) p 430 1127 a(throughout) p
+685 1127 a(compilation) p 950 1127 a(b) o(y) p 1018 1127
+a(disallo) o(wing) p 1269 1127 a(lab) q(el) p 1387 1127
+a(comm) o(utation) p 1684 1127 a(for) p 1759 1127 a(func-) 11
+1187 y(tion) p 116 1187 a(t) o(yp) q(es.) p 278 1187
+a(Ho) o(w) o(ev) o(er,) p 494 1187 a(the) p 583 1187
+a(original) p 764 1187 a(comfort) p 949 1187 a(of) p
+1009 1187 a(out-of-order) p 1283 1187 a(application) p
+1540 1187 a(is) p 1594 1187 a(reco) o(v) o(ered) p 1814
+1187 a(b) o(y) 11 1247 y(allo) o(wing) p 207 1247 a(argumen) o(t) p
+431 1247 a(reordering) p 670 1247 a(in) p 732 1247 a(application,) p
+1005 1247 a(when) p 1138 1247 a(the) p 1227 1247 a(function's) p
+1457 1247 a(t) o(yp) q(e) p 1572 1247 a(is) p Fh 1626
+1247 a(wel) r(l) p 1731 1247 a(known) p Fk 11 1308 a(\() p
+Fh(c.f.) p Fk 118 1308 a(p) q(olymorphic) p 400 1308
+a(metho) q(ds\).) p Fl 11 1452 a(V) p 56 1452 a(arian) n(ts) p
+Fk 11 1544 a(V) l(arian) o(t) p 187 1544 a(t) o(yping,) p
+355 1544 a(as) p 417 1544 a(it) p 468 1544 a(is) p 519
+1544 a(presen) o(ted) p 739 1544 a(in) p 798 1544 a(the) p
+884 1544 a(user's) p 1022 1544 a(man) o(ual,) p 1210
+1544 a(is) p 1261 1544 a(not) p 1350 1544 a(principal:) p
+1576 1544 a(in) p 1635 1544 a(some) p 1760 1544 a(cases) 11
+1605 y(t) o(ypabilit) o(y) p 239 1605 a(of) p 301 1605
+a(an) p 375 1605 a(expression) p 616 1605 a(ma) o(y) p
+728 1605 a(dep) q(end) p 904 1605 a(on) p 978 1605 a(the) p
+1069 1605 a(order) p 1202 1605 a(in) p 1265 1605 a(whic) o(h) p
+1411 1605 a(the) p 1502 1605 a(t) o(yping) p 1660 1605
+a(algorithm) 11 1665 y(pro) q(ceeds.) p Fe 133 1779 a(#) p
+184 1779 a(let) p 286 1779 a(f1) p 363 1779 a(\(x) p
+440 1779 a(:) p 491 1779 a([<) p 568 1779 a(a) p 620
+1779 a(b\(int\)]\)) p 850 1779 a(=) p 902 1779 a(\(\)) 184
+1839 y(let) p 286 1839 a(f2) p 363 1839 a(\(x) p 440
+1839 a(:) p 491 1839 a([<) p 568 1839 a(a]\)) p 671 1839
+a(=) p 722 1839 a(\(\)) 184 1899 y(let) p 286 1899 a(f3) p
+363 1899 a(\(x) p 440 1899 a(:) p 491 1899 a([<) p 568
+1899 a(a) p 620 1899 a(b\(bool\)]\)) p 876 1899 a(=) p
+927 1899 a(\(\);;) 133 1960 y(val) p 235 1960 a(f1) p
+312 1960 a(:) p 363 1960 a([<) p 440 1960 a(a) p 491
+1960 a(b\(int\)]) p 696 1960 a(->) p 773 1960 a(unit) p
+902 1960 a(=) p 953 1960 a(<fun>) 133 2020 y(val) p 235
+2020 a(f2) p 312 2020 a(:) p 363 2020 a([<) p 440 2020
+a(a]) p 517 2020 a(->) p 594 2020 a(unit) p 722 2020
+a(=) p 773 2020 a(<fun>) 133 2080 y(val) p 235 2080 a(f3) p
+312 2080 a(:) p 363 2080 a([<) p 440 2080 a(a) p 491
+2080 a(b\(bool\)]) p 722 2080 a(->) p 799 2080 a(unit) p
+927 2080 a(=) p 978 2080 a(<fun>) 133 2140 y(#) p 184
+2140 a(fun) p 286 2140 a(x) p 338 2140 a(->) p 414 2140
+a(f1) p 491 2140 a(x;) p 568 2140 a(f2) p 645 2140 a(x;) p
+722 2140 a(f3) p 799 2140 a(x;;) 133 2200 y(-) p 184
+2200 a(:) p 235 2200 a([<) p 312 2200 a(a]) p 389 2200
+a(->) p 466 2200 a(unit) p 594 2200 a(=) p 645 2200 a(<fun>) 133
+2260 y(#) p 184 2260 a(fun) p 286 2260 a(x) p 338 2260
+a(->) p 414 2260 a(f1) p 491 2260 a(x;) p 568 2260 a(f3) p
+645 2260 a(x;;) 133 2321 y(Character) o(s) p 414 2321
+a(18-19:) 133 2381 y(This) p 261 2381 a(expressio) o(n) p
+543 2381 a(has) p 645 2381 a(type) p 773 2381 a([<) p
+850 2381 a(a) p 902 2381 a(b\(int\)]) p 1107 2381 a(but) p
+1209 2381 a(is) p 1286 2381 a(here) p 1414 2381 a(used) p
+1542 2381 a(with) p 1670 2381 a(type) 184 2441 y([<) p
+261 2441 a(a) p 312 2441 a(b\(bool\)]) p Fk 84 2555 a(Here) p
+204 2555 a(the) p 292 2555 a(constrain) o(t) p 526 2555
+a(in) o(tro) q(duced) p 775 2555 a(b) o(y) p Fe 848 2555
+a(f2) p Fk 920 2555 a(hides) p 1049 2555 a(the) p 1138
+2555 a(constructor) p Fe 1401 2555 a(b) p Fk(,) p 1462
+2555 a(and) p 1562 2555 a(a) o(v) o(oids) p 1714 2555
+a(a) p 1760 2555 a(clash) 11 2615 y(b) q(et) o(w) o(een) p
+Fe 199 2615 a(int) p Fk 292 2615 a(and) p Fe 387 2615
+a(bool) p Fk(.) 84 2676 y(An) p 163 2676 a(easy) p 270
+2676 a(w) o(a) o(y) p 369 2676 a(to) p 428 2676 a(solv) o(e) p
+547 2676 a(this) p 642 2676 a(w) o(ould) p 784 2676 a(b) q(e) p
+850 2676 a(to) p 909 2676 a(restrict) p 1077 2676 a(hiding) p
+1226 2676 a(absen) o(t) p 1379 2676 a(lab) q(els) p 1515
+2676 a(to) p 1575 2676 a(generic) p 1739 2676 a(t) o(yp) q(es.) 11
+2736 y(This) p 124 2736 a(w) o(a) o(y) p 224 2736 a(the) p
+310 2736 a(second) p 469 2736 a(case) p 574 2736 a(w) o(ould) p
+718 2736 a(still) p 814 2736 a(fail,) p 913 2736 a(since) p
+Fe 1034 2736 a(x) p Fk 1077 2736 a(has) p 1166 2736 a(a) p
+1208 2736 a(monorphic) p 1451 2736 a(t) o(yp) q(e.) p
+1584 2736 a(This) p 1697 2736 a(solution) 11 2796 y(w) o(ould) p
+153 2796 a(b) q(e) p 219 2796 a(correct) p 382 2796 a(and) p
+477 2796 a(principal.) 926 2937 y(2) p eop
+PStoPSsaved restore
+%%Page: (2,3) 2
+userdict/PStoPSsaved save put
+PStoPSmatrix setmatrix
+595.000000 0.271378 translate
+90 rotate
+0.706651 dup scale
+userdict/PStoPSmatrix matrix currentmatrix put
+userdict/PStoPSclip{0 0 moveto
+ 595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
+ closepath}put initclip
+/showpage{}def/copypage{}def/erasepage{}def
+PStoPSxform concat
+3 2 bop Fk 84 168 a(Ho) o(w) o(ev) o(er,) p 293 168 a(one) p
+382 168 a(can) p 472 168 a(easily) p 606 168 a(see) p
+684 168 a(that) p 789 168 a(this) p 884 168 a(solution) p
+1068 168 a(is) p 1117 168 a(coun) o(ter-in) o(tuitiv) o(e.) p
+1504 168 a(F) l(or) p 1591 168 a(the) p 1675 168 a(user,) p
+Fe 1791 168 a(b) p Fk 1833 168 a(is) 11 229 y(already) p
+183 229 a(an) p 250 229 a(imp) q(ossible) p 488 229 a(constructor,) p
+759 229 a(and) p 854 229 a(ha) o(ving) p 1011 229 a(a) p
+1052 229 a(clash) p 1174 229 a(on) p 1242 229 a(it) p
+1291 229 a(is) p 1340 229 a(hard) p 1453 229 a(to) p
+1513 229 a(understand.) 84 289 y(Another) p 277 289 a(solution) p
+463 289 a(is) p 514 289 a(to) p 575 289 a(go) p 642 289
+a(the) p 728 289 a(opp) q(osite) p 924 289 a(w) o(a) o(y) l(.) p
+1044 289 a(T) l(o) p 1117 289 a(accept) p 1271 289 a(more) p
+1395 289 a(programs.) p 1634 289 a(This) p 1747 289 a(is) p
+1798 289 a(the) 11 349 y(w) o(a) o(y) p 109 349 a(w) o(e) p
+181 349 a(explore) p 351 349 a(here,) p 470 349 a(with) p
+581 349 a(an) p 649 349 a(unc) o(hanged) p 891 349 a(syn) o(tax.) p
+Fi 11 479 a(T) n(yping) p Fk 11 571 a(The) p 114 571
+a(idea) p 220 571 a(is) p 273 571 a(to) p 336 571 a(dela) o(y) p
+466 571 a(uni\014cation) p 711 571 a(on) p 782 571 a(constructor) p
+1043 571 a(un) o(til) p 1161 571 a(they) p 1274 571 a(are) p
+1359 571 a(explicitely) p 1595 571 a(kno) o(wn) p 1753
+571 a(to) p 1816 571 a(b) q(e) 11 631 y(presen) o(t.) p
+199 631 a(W) l(e) p 280 631 a(k) o(eep) p 390 631 a(the) p
+472 631 a(\() p Fg(T) t(;) p 546 631 a(U;) p 601 631
+a(L) p Fk(\)) p 666 631 a(represen) o(tation) p 983 631
+a(of) p 1036 631 a(v) m(arian) o(t) p 1200 631 a(t) o(yp) q(es,) p
+1341 631 a(but) p Fg 1428 631 a(T) p Fk 1478 631 a(is) p
+1525 631 a(no) p 1591 631 a(longer) p 1735 631 a(a) p
+1774 631 a(map) 11 692 y(from) p 126 692 a(constructors) p
+403 692 a(to) p 462 692 a(t) o(yp) q(es,) p 605 692 a(but) p
+694 692 a(from) p 809 692 a(constructors) p 1086 692
+a(to) p 1146 692 a(sets) p 1241 692 a(of) p 1297 692
+a(t) o(yp) q(es.) 84 752 y(When) p 230 752 a(w) o(e) p
+307 752 a(unify) p 436 752 a(t) o(w) o(o) p 532 752 a(v) m(arian) o(t) p
+702 752 a(t) o(yp) q(es,) p 850 752 a(the) p 938 752
+a(\014rst) p 1043 752 a(step) p 1150 752 a(is) p 1204
+752 a(just) p 1305 752 a(to) p 1369 752 a(tak) o(e) p
+1479 752 a(the) p 1567 752 a(union) p 1707 752 a(of) p
+1767 752 a(b) q(oth) 11 812 y(t) o(yping) p 162 812 a(en) o(vironmen) o
+(ts,) p 476 812 a(dropping) p 682 812 a(unnecessary) p
+952 812 a(t) o(yp) q(es.) 204 932 y(\() p Fg(T) p Ff
+252 939 a(1) p Fg 272 932 a(;) p 294 932 a(U) p Ff 327
+939 a(1) p Fg 346 932 a(;) p 368 932 a(L) p Ff 401 939
+a(1) p Fk 421 932 a(\)) p Fj 451 932 a(^) p Fk 495 932
+a(\() p Fg(T) p Ff 543 939 a(2) p Fg 563 932 a(;) p 585
+932 a(U) p Ff 618 939 a(2) p Fg 637 932 a(;) p 659 932
+a(L) p Ff 692 939 a(2) p Fk 712 932 a(\)) p 745 932 a(=) p
+797 932 a(\(\() p Fg(T) p Ff 864 939 a(1) p Fj 883 932
+a(j) p Fb 897 939 a(U) p Fa 921 944 a(1) p Fd 938 939
+a(\\) p Fb(U) p Fa 986 944 a(2) p Fk 1005 932 a(\)) p
+Fj 1035 932 a([) p Fk 1079 932 a(\() p Fg(T) p Ff 1127
+939 a(2) p Fj 1146 932 a(j) p Fb 1160 939 a(U) p Fa 1184
+944 a(1) p Fd 1201 939 a(\\) p Fb(U) p Fa 1249 944 a(2) p
+Fk 1268 932 a(\)) p Fg(;) p 1309 932 a(U) p Ff 1342 939
+a(1) p Fj 1373 932 a(\\) p Fg 1417 932 a(U) p Ff 1450
+939 a(2) p Fg 1470 932 a(;) p 1492 932 a(L) p Ff 1525
+939 a(1) p Fj 1556 932 a([) p Fg 1600 932 a(L) p Ff 1633
+939 a(2) p Fk 1653 932 a(\)) 84 1042 y(Here) p 203 1042
+a(the) p 291 1042 a(union) p 431 1042 a(of) p 490 1042
+a(t) o(w) o(o) p 587 1042 a(t) o(yping) p 742 1042 a(en) o(vironmen) o
+(ts) p 1046 1042 a(is) p 1099 1042 a(the) p 1187 1042
+a(p) q(oin) o(t) o(wise) p 1407 1042 a(union) p 1547
+1042 a(of) p 1606 1042 a(their) p 1727 1042 a(sets) p
+1826 1042 a(of) 11 1102 y(t) o(yp) q(es) p 140 1102 a(for) p
+214 1102 a(eac) o(h) p 324 1102 a(constructor.) 84 1162
+y(This) p 195 1162 a(\014rst) p 296 1162 a(step) p 399
+1162 a(nev) o(er) p 529 1162 a(fails.) 84 1222 y(In) p
+145 1222 a(a) p 186 1222 a(second) p 343 1222 a(step,) p
+460 1222 a(structural) p 685 1222 a(constrain) o(ts) p
+934 1222 a(are) p 1015 1222 a(enforced) p 1209 1222 a(on) p
+1277 1222 a(the) p 1361 1222 a(resulting) p 1562 1222
+a(t) o(yp) q(e) p 1672 1222 a(\() p Fg(T) t(;) p 1746
+1222 a(U;) p 1801 1222 a(L) p Fk(\).) 11 1282 y(First,) p
+Fg 144 1282 a(L) p Fk 195 1282 a(should) p 351 1282 a(b) q(e) p
+418 1282 a(included) p 614 1282 a(in) p Fg 672 1282 a(U) p
+Fk 710 1282 a(.) p 749 1282 a(Then,) p 892 1282 a(for) p
+967 1282 a(all) p 1036 1282 a(constructors) p 1314 1282
+a(app) q(earing) p 1542 1282 a(in) p Fg 1600 1282 a(L) p
+Fk(,) p 1664 1282 a(the) p 1749 1282 a(set) p 1826 1282
+a(of) 11 1343 y(t) o(yp) q(es) p 136 1343 a(asso) q(ciated) p
+365 1343 a(with) p 472 1343 a(eac) o(h) p 578 1343 a(constructor) p
+833 1343 a(is) p 878 1343 a(collapsed) p 1084 1343 a(b) o(y) p
+1148 1343 a(uni\014cation.) p 1407 1343 a(This) p 1515
+1343 a(can) p 1600 1343 a(b) q(e) p 1663 1343 a(expressed) 11
+1403 y(b) o(y) p 78 1403 a(rewriting) p 287 1403 a(rules,) p
+417 1403 a(where) p Fg 558 1403 a(e) p Fk 597 1403 a(is) p
+646 1403 a(a) p 687 1403 a(m) o(ulti-equation) p 1015
+1403 a(and) p Fg 1109 1403 a(\036) p Fk 1155 1403 a(a) p
+1195 1403 a(set) p 1271 1403 a(of) p 1327 1403 a(m) o(ultiequations) 249
+1509 y(if) p Fg 294 1509 a(L) p Fj 341 1509 a(6\032) p
+Fg 393 1509 a(U) p Fk 448 1509 a(then) p 559 1509 a(\() p
+Fg(T) t(;) p 633 1509 a(U;) p 688 1509 a(L) p Fk(\)) p
+753 1509 a(=) p Fg 805 1509 a(e) p Fj 839 1509 a(^) p
+Fg 883 1509 a(\036) p Fj 926 1509 a(\000) p 956 1509
+a(!) p 1020 1509 a(?) p Fk 249 1629 a(if) p Fg 294 1629
+a(l) p Fj 323 1629 a(2) p Fg 370 1629 a(L) p Fk 420 1629
+a(and) p Fg 515 1629 a(T) p Fk 551 1629 a(\() p Fg(l) p
+Fk 586 1629 a(\)) p 617 1629 a(=) p Fj 669 1629 a(f) p
+Fg(\034) p Ff 715 1636 a(1) p Fg 735 1629 a(;) p 757
+1629 a(:) p 779 1629 a(:) p 801 1629 a(:) p 822 1629
+a(;) p 844 1629 a(\034) p Fb 865 1636 a(n) p Fj 889 1629
+a(g) p Fk 930 1629 a(then) 298 1689 y(\() p Fg(T) t(;) p
+372 1689 a(U;) p 427 1689 a(L) p Fk(\)) p 492 1689 a(=) p
+Fg 544 1689 a(e) p Fj 577 1689 a(^) p Fg 622 1689 a(\036) p
+Fj 664 1689 a(\000) p 695 1689 a(!) p Fk 759 1689 a(\() p
+Fg(T) p Fj 814 1689 a(f) p Fg(l) p Fj 867 1689 a(7!) p
+Fg 931 1689 a(\034) p Ff 952 1696 a(1) p Fj 972 1689
+a(g) p Fg(;) p 1019 1689 a(U;) p 1074 1689 a(L) p Fk(\)) p
+1139 1689 a(=) p Fg 1191 1689 a(e) p Fj 1225 1689 a(^) p
+Fg 1269 1689 a(\034) p Ff 1290 1696 a(1) p Fk 1324 1689
+a(=) p Fg 1376 1689 a(:) p 1398 1689 a(:) p 1420 1689
+a(:) p Fk 1447 1689 a(=) p Fg 1498 1689 a(\034) p Fb
+1519 1696 a(n) p Fj 1554 1689 a(^) p Fg 1598 1689 a(\036) p
+Fk 84 1796 a(Optionally) p 331 1796 a(one) p 425 1796
+a(can) p 519 1796 a(add) p 619 1796 a(rules) p 740 1796
+a(that) p 850 1796 a(remo) o(v) o(e) p 1022 1796 a(a) p
+1067 1796 a(constructor) p Fg 1329 1796 a(l) p Fk 1366
+1796 a(from) p Fg 1486 1796 a(U) p Fk 1545 1796 a(if) p
+1594 1796 a(the) p 1683 1796 a(equation) 11 1856 y(obtained) p
+211 1856 a(from) p Fg 326 1856 a(T) p Fk 362 1856 a(\() p
+Fg(l) p Fk 397 1856 a(\)) p 431 1856 a(has) p 518 1856
+a(no) p 586 1856 a(solution.) p 790 1856 a(Suc) o(h) p
+908 1856 a(rules) p 1024 1856 a(w) o(ould) p 1167 1856
+a(b) q(e) p 1233 1856 a(sound) p 1374 1856 a(and) p 1469
+1856 a(complete.) p Fi 11 1986 a(Syn) n(tax) p 198 1986
+a(of) p 262 1986 a(t) n(yp) r(es) p Fk 11 2078 a(Thanks) p
+188 2078 a(to) p 250 2078 a(the) p 336 2078 a(go) q(o) q(d) p
+458 2078 a(prop) q(erties) p 689 2078 a(of) p 747 2078
+a(these) p 874 2078 a(constrain) o(ts,) p 1139 2078 a(the) p
+1226 2078 a(surface) p 1392 2078 a(syn) o(tax) p 1551
+2078 a(of) p 1608 2078 a(t) o(yp) q(es) p 1740 2078 a(w) o(ould) 11
+2138 y(only) p 118 2138 a(ha) o(v) o(e) p 230 2138 a(to) p
+290 2138 a(b) q(e) p 356 2138 a(sligh) o(tly) p 527 2138
+a(extended.) p Fh 590 2244 a(tag-typ) n(e) p Fk 798 2244
+a(::=) p Fh 904 2244 a(ident) p Fj 849 2304 a(j) p Fh
+904 2304 a(ident) p Fe 1031 2304 a(\() p Fh(typ) n(expr-list) p
+Fe(\)) p Fh 523 2365 a(typ) n(expr-list) p Fk 798 2365
+a(::=) p Fh 904 2365 a(typ) n(expr) p Fj 849 2425 a(j) p
+Fh 904 2425 a(typ) n(expr) p Fe 1078 2425 a(&) p Fh 1120
+2425 a(typ) n(expr-list) p Fk 84 2531 a(Notice) p 234
+2531 a(that) p 336 2531 a(a) p 373 2531 a(0-ary) p 496
+2531 a(constructor) p 751 2531 a(and) p 842 2531 a(an) p
+907 2531 a(1-ary) p 1030 2531 a(construtor) p 1262 2531
+a(are) p 1340 2531 a(con) o(tradictory) l(,) p 1648 2531
+a(and) p 1740 2531 a(w) o(ould) 11 2592 y(result) p 146
+2592 a(in) p 203 2592 a(the) p 287 2592 a(absence) p
+466 2592 a(of) p 522 2592 a(this) p 617 2592 a(constructor.) 926
+2937 y(3) p eop
+PStoPSsaved restore
+userdict/PStoPSsaved save put
+PStoPSmatrix setmatrix
+595.000000 421.271378 translate
+90 rotate
+0.706651 dup scale
+userdict/PStoPSmatrix matrix currentmatrix put
+userdict/PStoPSclip{0 0 moveto
+ 595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
+ closepath}put initclip
+PStoPSxform concat
+4 3 bop Fi 11 168 a(Discussion) p Fk 11 261 a(Suc) o(h) p
+133 261 a(a) p 179 261 a(c) o(hange) p 345 261 a(has) p
+436 261 a(the) p 525 261 a(ma) s(jor) p 672 261 a(adv) m(an) o(tage) p
+907 261 a(of) p 967 261 a(b) q(oth) p 1087 261 a(reco) o(v) o(ering) p
+1324 261 a(principalit) o(y) p 1589 261 a(and) p 1688
+261 a(a) o(v) o(oiding) 11 321 y(unin) o(tuitiv) o(e) p
+266 321 a(error) p 392 321 a(messages.) p 640 321 a(Constrain) o(ts) p
+909 321 a(created) p 1087 321 a(in) p 1152 321 a(suc) o(h) p
+1269 321 a(a) p 1317 321 a(w) o(a) o(y) p 1423 321 a(are) p
+1512 321 a(v) o(ery) p 1626 321 a(ligh) o(t:) p 1772
+321 a(they) 11 381 y(alw) o(a) o(ys) p 165 381 a(app) q(ear) p
+325 381 a(inside) p 463 381 a(a) p 502 381 a(v) m(arian) o(t) p
+666 381 a(t) o(yp) q(e,) p 788 381 a(and) p 882 381 a(if) p
+926 381 a(the) p 1008 381 a(v) m(arian) o(t) p 1172 381
+a(t) o(yp) q(e) p 1281 381 a(do) q(es) p 1390 381 a(not) p
+1475 381 a(app) q(ear) p 1635 381 a(in) p 1691 381 a(the) p
+1774 381 a(\014nal) 11 441 y(t) o(yp) q(e) p 120 441
+a(sc) o(heme,) p 301 441 a(then) p 412 441 a(the) p 496
+441 a(constrain) o(t) p 725 441 a(can) p 815 441 a(b) q(e) p
+881 441 a(discarded) p 1098 441 a(safely) l(.) 84 501
+y(On) p 165 501 a(the) p 249 501 a(other) p 376 501 a(hand,) p
+512 501 a(there) p 637 501 a(are) p 718 501 a(t) o(w) o(o) p
+810 501 a(dra) o(wbac) o(ks.) p Fj 83 616 a(\017) p Fk
+133 616 a(Some) p 259 616 a(errors) p 393 616 a(will) p
+482 616 a(b) q(e) p 544 616 a(dela) o(y) o(ed) p 715
+616 a(longer) p 858 616 a(than) p 968 616 a(no) o(w,) p
+1080 616 a(un) o(til) p 1191 616 a(a) p 1228 616 a(construtor) p
+1460 616 a(is) p 1505 616 a(actually) p 1687 616 a(included) 133
+676 y(in) p Fg 189 676 a(L) p Fk(.) p 258 676 a(It) p
+311 676 a(is) p 360 676 a(not) p 446 676 a(clear) p 563
+676 a(ho) o(w) p 665 676 a(damageable) p 930 676 a(it) p
+979 676 a(is.) p Fj 83 777 a(\017) p Fk 133 777 a(While) p
+272 777 a(t) o(yp) q(e) p 378 777 a(inference) p 579
+777 a(is) p 625 777 a(simple) p 774 777 a(and) p 865
+777 a(costless) p 1036 777 a(for) p 1108 777 a(this) p
+1200 777 a(extension,) p 1426 777 a(simpli\014cation) p
+1724 777 a(of) p 1776 777 a(con-) 133 838 y(strain) o(ts) p
+310 838 a(|marking) p 551 838 a(constructors) p 830 838
+a(with) p 943 838 a(unsolv) m(able) p 1182 838 a(constrain) o(ts) p
+1432 838 a(as) p 1494 838 a(absen) o(t,) p 1663 838 a(and) p
+1760 838 a(elim-) 133 898 y(inating) p 300 898 a(redundan) o(t) p
+536 898 a(t) o(yp) q(es) p 667 898 a(in) p 726 898 a(constrain) o(ts|) p
+1025 898 a(is) p 1076 898 a(a) p 1119 898 a(bit) p 1197
+898 a(more) p 1320 898 a(exp) q(ensiv) o(e.) p 1565 898
+a(Also,) p 1691 898 a(allo) o(wing) 133 958 y(suc) o(h) p
+244 958 a(constrained) p 506 958 a(t) o(yp) q(es) p 637
+958 a(inside) p 777 958 a(signatures) p 1010 958 a(w) o(ould) p
+1154 958 a(mean) p 1286 958 a(ha) o(ving) p 1444 958
+a(to) p 1506 958 a(solv) o(e) p 1627 958 a(a) p 1669
+958 a(matc) o(hing) 133 1018 y(problem,) p 333 1018 a(whic) o(h) p
+469 1018 a(is) p 514 1018 a(exp) q(onen) o(tial) p 772
+1018 a(in) p 825 1018 a(the) p 906 1018 a(n) o(um) o(b) q(er) p
+1080 1018 a(of) p 1132 1018 a(connected) p 1356 1018
+a(constrain) o(ts) p 1600 1018 a(inside) p 1735 1018
+a(a) p 1772 1018 a(t) o(yp) q(e) 133 1078 y(sc) o(heme.) 84
+1193 y(Reasonably) p 340 1193 a(e\016cien) o(t) p 516
+1193 a(algorithms) p 754 1193 a(exist) p 866 1193 a(to) p
+922 1193 a(solv) o(e) p 1038 1193 a(these) p 1159 1193
+a(problems,) p 1379 1193 a(so) p 1435 1193 a(the) p 1515
+1193 a(di\016cult) o(y) p 1715 1193 a(is) p 1760 1193
+a(more) 11 1253 y(in) p 67 1253 a(the) p 151 1253 a(increased) p
+363 1253 a(complexit) o(y) p 611 1253 a(of) p 667 1253
+a(the) p 751 1253 a(t) o(yp) q(e-c) o(hec) o(k) o(er) p
+1031 1253 a(than) p 1145 1253 a(in) p 1202 1253 a(run-time) p
+1402 1253 a(cost.) p Fl 11 1397 a(Other) p 205 1397 a(features) p
+Fk 11 1490 a(Ob) s(jectiv) o(e) p 238 1490 a(Lab) q(el) p
+380 1490 a(con) o(tains) p 579 1490 a(t) o(w) o(o) p
+678 1490 a(other) p 812 1490 a(features:) p 1029 1490
+a(p) q(olymorphic) p 1318 1490 a(metho) q(ds) p 1521
+1490 a(and) p 1623 1490 a(t) o(yp) q(e-driv) o(en) 11
+1550 y(access) p 153 1550 a(of) p 208 1550 a(records.) p
+394 1550 a(Both) p 514 1550 a(of) p 568 1550 a(them) p
+692 1550 a(use) p 775 1550 a(the) p 857 1550 a(same) p
+978 1550 a(metho) q(d) p 1154 1550 a(of) p 1209 1550
+a(enforcing) p 1417 1550 a(principalit) o(y) p 1676 1550
+a(of) p 1730 1550 a(t) o(yping) 11 1610 y(through) p
+191 1610 a(tracing) p 351 1610 a(user) p 450 1610 a(pro) o(vided) p
+647 1610 a(t) o(yp) q(e) p 752 1610 a(information.) p
+1034 1610 a(With) p 1155 1610 a(this) p 1246 1610 a(tracing,) p
+1422 1610 a(their) p 1534 1610 a(implem) o(en) n(tation) 11
+1670 y(is) p 60 1670 a(v) o(ery) p 167 1670 a(easy) l(,) p
+283 1670 a(but) p 373 1670 a(without) p 554 1670 a(it) p
+603 1670 a(they) p 713 1670 a(lo) q(ose) p 834 1670 a(principalit) o(y)
+l(.) 84 1730 y(While) p 229 1730 a(these) p 357 1730
+a(features) p 543 1730 a(pro) o(vide) p 720 1730 a(some) p
+845 1730 a(comfort) p 1029 1730 a(in) p 1089 1730 a(writing) p
+1260 1730 a(user) p 1366 1730 a(programs,) p 1598 1730
+a(they) p 1711 1730 a(are) p 1795 1730 a(not) 11 1791
+y(strictly) p 182 1791 a(necessary) p 403 1791 a(for) p
+482 1791 a(the) p 571 1791 a(v) m(arious) p 742 1791
+a(libraries) p 934 1791 a(coming) p 1107 1791 a(with) p
+1223 1791 a(O'Labl) p 1391 1791 a(\(LablTk,) p 1602 1791
+a(LablGL) p 1787 1791 a(and) 11 1851 y(LablGTK\).) 926
+2937 y(4) p eop
+PStoPSsaved restore
+%%Trailer
+end
+userdict /end-hook known{end-hook}if
+%%EOF
diff --git a/testlabl/objvariant.ml b/testlabl/objvariant.ml
new file mode 100644 (file)
index 0000000..3233e03
--- /dev/null
@@ -0,0 +1,42 @@
+(* use with [cvs update -r objvariants typing] *)
+
+let f (x : [> ]) = x#m 3;;
+let o = object method m x = x+2 end;;
+f (`A o);;
+let l = [`A o; `B(object method m x = x -2 method y = 3 end)];;
+List.map f l;;
+let g = function `A x -> x#m 3 | `B x -> x#y;;
+List.map g l;;
+fun x -> ignore (x=f); List.map x l;;
+fun (x : [< `A of _ | `B of _] -> int) -> ignore (x=f); List.map x l;;
+
+
+class cvar name =
+  object
+    method name = name
+    method print ppf = Format.pp_print_string ppf name
+  end
+
+type var = [`Var of cvar]
+
+class cint n =
+  object
+    method n = n
+    method print ppf = Format.pp_print_int ppf n
+  end
+
+class ['a] cadd (e1 : 'a) (e2 : 'a) =
+  object
+    constraint 'a = [> ]
+    method e1 = e1
+    method e2 = e2
+    method print ppf = Format.fprintf ppf "(%t, %t)" e1#print e2#print
+  end
+
+type 'a expr = [var | `Int of cint | `Add of 'a cadd]
+
+type expr1 = expr1 expr
+
+let print = Format.printf "%t@."
+
+let e1 : expr1 = `Add (new cadd (`Var (new cvar "x")) (`Int (new cint 2)))
diff --git a/testlabl/poly.exp b/testlabl/poly.exp
new file mode 100644 (file)
index 0000000..ac1dca7
--- /dev/null
@@ -0,0 +1,436 @@
+        Objective Caml version 3.09+dev27 (2005-08-13)
+
+#   * * *       #   type 'a t = { t : 'a; }
+# type 'a fold = { fold : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b; }
+# val f : 'a list -> 'a fold = <fun>
+# - : int = 6
+#               class ['a] ilist :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#         class virtual ['a] vlist :
+  object ('b)
+    method virtual add : 'a -> 'b
+    method virtual fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#             class ilist2 :
+  int list ->
+  object ('a)
+    val l : int list
+    method add : int -> 'a
+    method fold : f:('b -> int -> 'b) -> init:'b -> 'b
+  end
+#             val ilist2 : 'a list -> 'a vlist = <fun>
+#             class ['a] ilist3 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#               class ['a] ilist4 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#                 class ['a] ilist5 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+    method fold2 : f:('d -> 'a -> 'd) -> init:'d -> 'd
+  end
+#                 class ['a] ilist6 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+    method fold2 : f:('d -> 'a -> 'd) -> init:'d -> 'd
+  end
+#       class virtual ['a] olist :
+  object method virtual fold : f:('a -> 'b -> 'b) -> init:'b -> 'b end
+#         class ['a] onil :
+  object method fold : f:('a -> 'b -> 'b) -> init:'b -> 'b end
+#             class ['a] ocons :
+  hd:'a ->
+  tl:'a olist ->
+  object
+    val hd : 'a
+    val tl : 'a olist
+    method fold : f:('a -> 'b -> 'b) -> init:'b -> 'b
+  end
+#               class ['a] ostream :
+  hd:'a ->
+  tl:'a ostream ->
+  object
+    val hd : 'a
+    val tl : 'a ostream
+    method empty : bool
+    method fold : f:('a -> 'b -> 'b) -> init:'b -> 'b
+  end
+#                   class ['a] ostream1 :
+  hd:'a ->
+  tl:'b ->
+  object ('b)
+    val hd : 'a
+    val tl : 'b
+    method fold : f:('a -> 'c -> 'c) -> init:'c -> 'c
+    method hd : 'a
+    method tl : 'b
+  end
+#           class vari : object method m : [< `A | `B | `C ] -> int end
+#       class vari : object method m : [< `A | `B | `C ] -> int end
+#           module V : sig type v = [ `A | `B | `C ] val m : [< v ] -> int end
+#         class varj : object method m : [< V.v ] -> int end
+#         module type T =
+  sig class vari : object method m : [< `A | `B | `C ] -> int end end
+#             module M0 :
+  sig class vari : object method m : [< `A | `B | `C ] -> int end end
+#   module M : T
+# val v : M.vari = <obj>
+# - : int = 1
+#               class point :
+  x:int ->
+  y:int -> object val x : int val y : int method x : int method y : int end
+#           class color_point :
+  x:int ->
+  y:int ->
+  color:string ->
+  object
+    val color : string
+    val x : int
+    val y : int
+    method color : string
+    method x : int
+    method y : int
+  end
+#                   class circle :
+  #point ->
+  r:int ->
+  object val p : point val r : int method distance : #point -> float end
+#           val p0 : point = <obj>
+val p1 : point = <obj>
+val cp : color_point = <obj>
+val c : circle = <obj>
+val d : float = 11.4536240470737098
+#   val f : < m : 'a. 'a -> 'a > -> < m : 'a. 'a -> 'a > = <fun>
+#   Characters 41-42:
+This expression has type < m : 'a. 'a -> 'a list > but is here used with type
+  < m : 'a. 'a -> 'b >
+The universal variable 'a would escape its scope
+#           class id : object method id : 'a -> 'a end
+#         class type id_spec = object method id : 'a -> 'a end
+#       class id_impl : object method id : 'a -> 'a end
+#               class a : object method m : bool end
+and b : object method id : 'a -> 'a end
+#           Characters 72-77:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'a
+#         Characters 75-80:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'a
+#           Characters 80-85:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'b
+#                 Characters 92-159:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'b
+#         class c : object method m : 'a -> 'b -> 'a end
+#     val f1 : id -> int * bool = <fun>
+#   val f2 : id -> int * bool = <fun>
+#   Characters 24-28:
+This expression has type bool but is here used with type int
+#   val f4 : id -> int * bool = <fun>
+#           class c : object method m : #id -> int * bool end
+#             class id2 : object method id : 'a -> 'a method mono : int -> int end
+#   val app : int * bool = (1, true)
+#   Characters 4-25:
+The type abbreviation foo is cyclic
+#     class ['a] bar : 'a -> object  end
+#   type 'a foo = 'a foo bar
+#   - : (< m : 'b. 'b * 'a > as 'a) -> 'c * 'a = <fun>
+# - : (< m : 'b. 'a * 'b list > as 'a) -> 'a * 'c list = <fun>
+# val f :
+  (< m : 'b. 'a * (< n : 'b; .. > as 'b) > as 'a) ->
+  'a * (< n : 'c; .. > as 'c) = <fun>
+# - : (< p : 'b. < m : 'b; n : 'a; .. > as 'b > as 'a) ->
+    (< m : 'c; n : 'a; .. > as 'c)
+= <fun>
+# - : (< m : 'b. 'b * < p : 'd. 'd * 'c * 'a > as 'c > as 'a) ->
+    ('f * < p : 'g. 'g * 'e * 'a > as 'e)
+= <fun>
+#   - : < m : 'a. < p : 'a; .. > as 'b > -> 'b = <fun>
+#   type sum = T of < id : 'a. 'a -> 'a >
+# - : sum -> 'a -> 'a = <fun>
+#   type record = { r : < id : 'a. 'a -> 'a >; }
+# - : record -> 'a -> 'a = <fun>
+# - : record -> 'a -> 'a = <fun>
+#       class myself : object ('a) method self : 'b -> 'a end
+#                       class number :
+  object ('a)
+    val num : int
+    method num : int
+    method prev : 'a
+    method succ : 'a
+    method switch : zero:(unit -> 'b) -> prev:('a -> 'b) -> 'b
+  end
+#     val id : 'a -> 'a = <fun>
+#       class c : object method id : 'a -> 'a end
+#         class c' : object method id : 'a -> 'a end
+#               class d :
+  object
+    val mutable count : int
+    method count : int
+    method id : 'a -> 'a
+    method old : 'b -> 'b
+  end
+#             class ['a] olist :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method cons : 'a -> 'b
+    method fold : f:('a -> 'c -> 'c) -> init:'c -> 'c
+  end
+#   val sum : int #olist -> int = <fun>
+#   val count : 'a #olist -> int = <fun>
+#     val append : 'a #olist -> ('a #olist as 'b) -> 'b = <fun>
+#     type 'a t = unit
+#   class o : object method x : [> `A ] t -> unit end
+#   class c : object method m : d end
+and d : ?x:int -> unit -> object  end
+# class d : ?x:int -> unit -> object  end
+and c : object method m : d end
+#           class type numeral = object method fold : ('a -> 'a) -> 'a -> 'a end
+class zero : object method fold : ('a -> 'a) -> 'a -> 'a end
+class next : #numeral -> object method fold : ('a -> 'a) -> 'a -> 'a end
+#       class type node_type = object method as_variant : [> `Node of node_type ] end
+#       class node : node_type
+#     class node : object method as_variant : [> `Node of node_type ] end
+#   type bad = { bad : 'a. 'a option ref; }
+# Characters 17-25:
+This field value has type 'a option ref which is less general than
+  'b. 'b option ref
+# type bad2 = { mutable bad2 : 'a. 'a option ref option; }
+# val bad2 : bad2 = {bad2 = None}
+# Characters 13-28:
+This field value has type 'a option ref option which is less general than
+  'b. 'b option ref option
+#       val f : < m : 'a. < p : 'a * 'b > as 'b > -> 'c -> unit = <fun>
+# val f :
+  < m : 'a. 'a * (< p : int * 'b > as 'b) > ->
+  (< p : int * 'c > as 'c) -> unit = <fun>
+#       type 'a t = [ `A of 'a ]
+#       class c : object method m : ([> 'a t ] as 'a) -> unit end
+#         class c : object method m : ([> 'a t ] as 'a) -> unit end
+#     class c : object method m : ([> 'a t ] as 'a) -> 'a end
+#     class c : object method m : ([> `A ] as 'a) option -> 'a end
+#           Characters 145-166:
+This type scheme cannot quantify 'a :
+it escapes this scope.
+#                 type ('a, 'b) list_visitor = < caseCons : 'b -> 'b list -> 'a; caseNil : 'a >
+type 'a alist = < visit : 'b. ('b, 'a) list_visitor -> 'b >
+class type ct = object ('a) method fold : ('b -> 'a -> 'b) -> 'b -> 'b end
+type t = { f : 'a 'b. ('b -> (#ct as 'a) -> 'b) -> 'b; }
+#     Characters 19-25:
+The type abbreviation t is cyclic
+#       class ['a] a : object constraint 'a = [> `A of 'a a ] end
+type t = [ `A of t a ]
+#     Characters 71-80:
+Constraints are not satisfied in this type.
+Type ('a, 'b) t should be an instance of ('c, 'c) t
+#     type 'a t = 'a
+and u = int t
+#     type 'a t constraint 'a = int
+# Characters 26-32:
+Constraints are not satisfied in this type.
+Type 'a u t should be an instance of int t
+# type 'a u = 'a constraint 'a = int
+and 'a v = 'a u t constraint 'a = int
+#     type g = int
+# type 'a t = unit constraint 'a = g
+# Characters 26-32:
+Constraints are not satisfied in this type.
+Type 'a u t should be an instance of g t
+# type 'a u = 'a constraint 'a = g
+and 'a v = 'a u t constraint 'a = int
+#     Characters 38-58:
+In the definition of v, type 'a list u should be 'a u
+#       type 'a t = 'a
+type 'a u = A of 'a t
+#     type 'a t = < a : 'a >
+# - : ('a t as 'a) -> 'a t = <fun>
+# type u = 'a t as 'a
+#       type t = A | B
+# - : [> `A ] * t -> int = <fun>
+# - : [> `A ] * t -> int = <fun>
+# - : [> `A ] option * t -> int = <fun>
+#   - : [> `A ] option * t -> int = <fun>
+# - : t * [< `A | `B ] -> int = <fun>
+# - : [< `A | `B ] * t -> int = <fun>
+# Characters 0-41:
+Warning P: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+(`AnyExtraTag, `AnyExtraTag)
+- : [> `A | `B ] * [> `A | `B ] -> int = <fun>
+# Characters 0-29:
+Warning P: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+(_, 0)
+Characters 21-24:
+Warning U: this match case is unused.
+- : [< `B ] * int -> int = <fun>
+# Characters 0-29:
+Warning P: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+(0, _)
+Characters 21-24:
+Warning U: this match case is unused.
+- : int * [< `B ] -> int = <fun>
+#       Characters 69-135:
+Constraints are not satisfied in this type.
+Type
+([> `B of 'a ], 'a) b as 'a
+should be an instance of
+(('b, [> `A of ('d, 'c) a as 'd ] as 'c) a as 'b, 'c) b
+#                             class type ['a, 'b] a =
+  object
+    constraint 'a = ('a, 'b) #a
+    constraint 'b = ('a, 'b) #b
+    method as_a : ('a, 'b) a
+    method b : 'b
+  end
+and ['a, 'b] b =
+  object
+    constraint 'a = ('a, 'b) #a
+    constraint 'b = ('a, 'b) #b
+    method a : 'a
+    method as_b : ('a, 'b) b
+  end
+class type ['a] ca =
+  object ('b)
+    constraint 'a = ('b, 'a) #b
+    method as_a : ('b, 'a) a
+    method b : 'a
+  end
+class type ['a] cb =
+  object ('b)
+    constraint 'a = ('a, 'b) #a
+    method a : 'a
+    method as_b : ('a, 'b) b
+  end
+type bt = 'a ca cb as 'a
+#     class c : object method m : int end
+# val f : unit -> c = <fun>
+# val f : unit -> c = <fun>
+# Characters 11-60:
+Warning X: the following private methods were made public implicitly:
+ n.
+val f : unit -> < m : int; n : int > = <fun>
+# Characters 11-56:
+This object is expected to have type c but has actually type
+  < m : int; n : 'a >
+Only the second object type has a method n
+# Characters 11-69:
+This object is expected to have type < n : int > but has actually type
+  < m : 'a >
+Only the first object type has a method n
+#         Characters 66-124:
+This object is expected to have type < x : int; .. > but has actually type
+  < x : int >
+Self type cannot be unified with a closed object type
+#         val o : < x : int > = <obj>
+#         Characters 76-77:
+This expression has type < m : 'b. 'b * < m : 'b * 'a > > as 'a
+but is here used with type
+  < m : 'b. 'b * (< m : 'b * < m : 'd. 'd * 'c > > as 'c) >
+Types for method m are incompatible
+#         Characters 176-177:
+This expression has type foo' = < m : 'a. 'a * 'a foo >
+but is here used with type bar' = < m : 'a. 'a * 'a bar >
+Type 'a foo = < m : 'a * 'a foo > is not compatible with type
+  'a bar = < m : 'a * < m : 'b. 'b * 'a bar > > 
+Type 'a foo = < m : 'a * 'a foo > is not compatible with type
+  < m : 'b. 'b * 'a bar > 
+Types for method m are incompatible
+#     Characters 67-68:
+This expression has type < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) >
+but is here used with type
+  < m : 'a. 'a * ('a * < m : 'c. 'c * ('c * 'd) >) > as 'd
+Types for method m are incompatible
+#   Characters 66-67:
+This expression has type < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) >
+but is here used with type
+  < m : 'a. 'a * ('a * < m : 'c. 'c * ('a * 'd) >) > as 'd
+Types for method m are incompatible
+#   Characters 51-52:
+This expression has type < m : 'b. 'b * ('b * 'a) > as 'a
+but is here used with type < m : 'b. 'b * ('b * < m : 'd. 'd * 'c > as 'c) >
+Types for method m are incompatible
+#     Characters 14-115:
+Type < m : 'a. 'a -> ('a * (< m : 'd. 'd -> 'b as 'e > as 'c) as 'b) >
+is not a subtype of type < m : 'a. 'a -> ('a * 'f as 'h) as 'g > as 'f 
+#       Characters 88-150:
+Signature mismatch:
+Modules do not match:
+  sig val f : (< m : 'b. 'b * ('b * 'a) > as 'a) -> unit end
+is not included in
+  sig val f : < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) > -> unit end
+Values do not match:
+  val f : (< m : 'b. 'b * ('b * 'a) > as 'a) -> unit
+is not included in
+  val f : < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) > -> unit
+#     Characters 78-132:
+Signature mismatch:
+Modules do not match:
+  sig type t = < m : 'b. 'b * ('b * 'a) > as 'a end
+is not included in
+  sig type t = < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) > end
+Type declarations do not match:
+  type t = < m : 'b. 'b * ('b * 'a) > as 'a
+is not included in
+  type t = < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) >
+#     module M : sig type 'a t type u = < m : 'a. 'a t > end
+#   module M : sig type 'a t val f : < m : 'a. 'a t > -> int end
+#     module M : sig type 'a t val f : < m : 'a. 'a t > -> int end
+#         val f :
+  (< m : 'b. 'b -> (< m : 'b. 'b -> 'c * <  > > as 'c) * < .. >; .. > as 'a) ->
+  'a -> bool = <fun>
+#         type t = [ `A | `B ]
+# type v = private [> t ]
+# - : t -> v = <fun>
+# type u = private [< t ]
+# - : u -> v = <fun>
+# Characters 9-21:
+Type v = [> `A | `B ] is not a subtype of type u = [< `A | `B ] 
+These two variant types have no intersection
+# type v = private [< t ]
+# Characters 9-21:
+Type u = [< `A | `B ] is not a subtype of type v = [< `A | `B ] 
+# type p = < x : p >
+# type q = private < x : p; .. >
+# - : q -> p = <fun>
+# Characters 9-21:
+Type p = < x : p > is not a subtype of type q = < x : p; .. > 
+#       Characters 14-100:
+Type < m : 'a. (< p : int; .. > as 'a) -> int > is not a subtype of type
+  < m : 'b. (< p : int; q : int; .. > as 'b) -> int > 
+#     val f2 :
+  < m : 'a. (< p : < a : int >; .. > as 'a) -> int > ->
+  < m : 'a. (< p : < a : int; b : int >; .. > as 'a) -> int > = <fun>
+#     Characters 13-107:
+Type < m : 'a. (< p : < a : int; b : int >; .. > as 'a) -> int >
+is not a subtype of type < m : 'a. (< p : < a : int >; .. > as 'a) -> int > 
+# Characters 11-55:
+Type < p : < a : int; b : int >; .. > is not a subtype of type
+  < p : < a : int >; .. > 
+Only the first object type has a method b
+#   val f5 :
+  < m : 'a. [< `A of < p : int > ] as 'a > ->
+  < m : 'a. [< `A of <  > ] as 'a > = <fun>
+#   Characters 13-83:
+Type < m : 'a. [< `A of <  > ] as 'a > is not a subtype of type
+  < m : 'a. [< `A of < p : int > ] as 'a > 
+# 
diff --git a/testlabl/poly.exp2 b/testlabl/poly.exp2
new file mode 100644 (file)
index 0000000..0e64a2c
--- /dev/null
@@ -0,0 +1,447 @@
+        Objective Caml version 3.09+dev27 (2005-08-13)
+
+#   * * *       #   type 'a t = { t : 'a; }
+# type 'a fold = { fold : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b; }
+# val f : 'a list -> 'a fold = <fun>
+# - : int = 6
+#               class ['a] ilist :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#         class virtual ['a] vlist :
+  object ('b)
+    method virtual add : 'a -> 'b
+    method virtual fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#             class ilist2 :
+  int list ->
+  object ('a)
+    val l : int list
+    method add : int -> 'a
+    method fold : f:('b -> int -> 'b) -> init:'b -> 'b
+  end
+#             val ilist2 : 'a list -> 'a vlist = <fun>
+#             class ['a] ilist3 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#               class ['a] ilist4 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+  end
+#                 class ['a] ilist5 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+    method fold2 : f:('d -> 'a -> 'd) -> init:'d -> 'd
+  end
+#                 class ['a] ilist6 :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method add : 'a -> 'b
+    method fold : f:('c -> 'a -> 'c) -> init:'c -> 'c
+    method fold2 : f:('d -> 'a -> 'd) -> init:'d -> 'd
+  end
+#       class virtual ['a] olist :
+  object method virtual fold : f:('a -> 'b -> 'b) -> init:'b -> 'b end
+#         class ['a] onil :
+  object method fold : f:('a -> 'b -> 'b) -> init:'b -> 'b end
+#             class ['a] ocons :
+  hd:'a ->
+  tl:'a olist ->
+  object
+    val hd : 'a
+    val tl : 'a olist
+    method fold : f:('a -> 'b -> 'b) -> init:'b -> 'b
+  end
+#               class ['a] ostream :
+  hd:'a ->
+  tl:'a ostream ->
+  object
+    val hd : 'a
+    val tl : < empty : bool; fold : 'b. f:('a -> 'b -> 'b) -> init:'b -> 'b >
+    method empty : bool
+    method fold : f:('a -> 'c -> 'c) -> init:'c -> 'c
+  end
+#                   class ['a] ostream1 :
+  hd:'a ->
+  tl:'b ->
+  object ('b)
+    val hd : 'a
+    val tl : 'b
+    method fold : f:('a -> 'c -> 'c) -> init:'c -> 'c
+    method hd : 'a
+    method tl : 'b
+  end
+#           class vari : object method m : [< `A | `B | `C ] -> int end
+#       class vari : object method m : [< `A | `B | `C ] -> int end
+#           module V : sig type v = [ `A | `B | `C ] val m : [< v ] -> int end
+#         class varj : object method m : [< V.v ] -> int end
+#         module type T =
+  sig class vari : object method m : [< `A | `B | `C ] -> int end end
+#             module M0 :
+  sig class vari : object method m : [< `A | `B | `C ] -> int end end
+#   module M : T
+# val v : M.vari = <obj>
+# - : int = 1
+#               class point :
+  x:int ->
+  y:int -> object val x : int val y : int method x : int method y : int end
+#           class color_point :
+  x:int ->
+  y:int ->
+  color:string ->
+  object
+    val color : string
+    val x : int
+    val y : int
+    method color : string
+    method x : int
+    method y : int
+  end
+#                   class circle :
+  #point ->
+  r:int ->
+  object val p : point val r : int method distance : #point -> float end
+#           val p0 : point = <obj>
+val p1 : point = <obj>
+val cp : color_point = <obj>
+val c : circle = <obj>
+val d : float = 11.4536240470737098
+#   val f : < m : 'a. 'a -> 'a > -> < m : 'b. 'b -> 'b > = <fun>
+#   Characters 41-42:
+This expression has type < m : 'a. 'a -> 'a list > but is here used with type
+  < m : 'a. 'a -> 'b >
+The universal variable 'a would escape its scope
+#           class id : object method id : 'a -> 'a end
+#         class type id_spec = object method id : 'a -> 'a end
+#       class id_impl : object method id : 'a -> 'a end
+#               class a : object method m : bool end
+and b : object method id : 'a -> 'a end
+#           Characters 72-77:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'a
+#         Characters 75-80:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'a
+#           Characters 80-85:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'b
+#                 Characters 92-159:
+This method has type 'a -> 'a which is less general than 'b. 'b -> 'b
+#         class c : object method m : 'a -> 'b -> 'a end
+#     val f1 : id -> int * bool = <fun>
+#   val f2 : id -> int * bool = <fun>
+#   Characters 24-28:
+This expression has type bool but is here used with type int
+#   Characters 27-31:
+Warning X: this use of a polymorphic method is not principal.
+Characters 35-39:
+Warning X: this use of a polymorphic method is not principal.
+val f4 : id -> int * bool = <fun>
+#           class c : object method m : #id -> int * bool end
+#             class id2 : object method id : 'a -> 'a method mono : int -> int end
+#   val app : int * bool = (1, true)
+#   Characters 4-25:
+The type abbreviation foo is cyclic
+#     class ['a] bar : 'a -> object  end
+#   type 'a foo = 'a foo bar
+#   - : (< m : 'b. 'b * 'a > as 'a) -> 'c * (< m : 'e. 'e * 'd > as 'd) = <fun>
+# - : (< m : 'b. 'a * 'b list > as 'a) ->
+    (< m : 'd. 'c * 'd list > as 'c) * 'e list
+= <fun>
+# val f :
+  (< m : 'b. 'a * (< n : 'b; .. > as 'b) > as 'a) ->
+  (< m : 'd. 'c * (< n : 'd; .. > as 'd) > as 'c) * (< n : 'e; .. > as 'e) =
+  <fun>
+# - : (< p : 'b. < m : 'b; n : 'a; .. > as 'b > as 'a) ->
+    (< m : 'c; n : < p : 'e. < m : 'e; n : 'd; .. > as 'e > as 'd; .. > as 'c)
+= <fun>
+# - : (< m : 'b. 'b * < p : 'd. 'd * 'c * 'a > as 'c > as 'a) ->
+    ('f *
+     < p : 'g.
+             'g * 'e *
+             (< m : 'i. 'i * < p : 'k. 'k * 'j * 'h > as 'j > as 'h) >
+     as 'e)
+= <fun>
+#   - : < m : 'a. < p : 'a; .. > as 'b > -> 'b = <fun>
+#   type sum = T of < id : 'a. 'a -> 'a >
+# - : sum -> 'a -> 'a = <fun>
+#   type record = { r : < id : 'a. 'a -> 'a >; }
+# - : record -> 'a -> 'a = <fun>
+# - : record -> 'a -> 'a = <fun>
+#       class myself : object ('a) method self : 'b -> 'a end
+#                       class number :
+  object ('a)
+    val num : int
+    method num : int
+    method prev : 'a
+    method succ : 'a
+    method switch : zero:(unit -> 'b) -> prev:('a -> 'b) -> 'b
+  end
+#     val id : 'a -> 'a = <fun>
+#       class c : object method id : 'a -> 'a end
+#         class c' : object method id : 'a -> 'a end
+#               class d :
+  object
+    val mutable count : int
+    method count : int
+    method id : 'a -> 'a
+    method old : 'b -> 'b
+  end
+#             class ['a] olist :
+  'a list ->
+  object ('b)
+    val l : 'a list
+    method cons : 'a -> 'b
+    method fold : f:('a -> 'c -> 'c) -> init:'c -> 'c
+  end
+#   val sum : int #olist -> int = <fun>
+#   val count : 'a #olist -> int = <fun>
+#     val append : 'a #olist -> ('a #olist as 'b) -> 'b = <fun>
+#     type 'a t = unit
+#   class o : object method x : [> `A ] t -> unit end
+#   class c : object method m : d end
+and d : ?x:int -> unit -> object  end
+# class d : ?x:int -> unit -> object  end
+and c : object method m : d end
+#           class type numeral = object method fold : ('a -> 'a) -> 'a -> 'a end
+class zero : object method fold : ('a -> 'a) -> 'a -> 'a end
+class next : #numeral -> object method fold : ('a -> 'a) -> 'a -> 'a end
+#       class type node_type = object method as_variant : [> `Node of node_type ] end
+#       class node : node_type
+#     class node : object method as_variant : [> `Node of node_type ] end
+#   type bad = { bad : 'a. 'a option ref; }
+# Characters 17-25:
+This field value has type 'a option ref which is less general than
+  'b. 'b option ref
+# type bad2 = { mutable bad2 : 'a. 'a option ref option; }
+# val bad2 : bad2 = {bad2 = None}
+# Characters 13-28:
+This field value has type 'a option ref option which is less general than
+  'b. 'b option ref option
+#       val f : < m : 'a. < p : 'a * 'b > as 'b > -> 'c -> unit = <fun>
+# val f :
+  < m : 'a. 'a * (< p : int * 'b > as 'b) > ->
+  (< p : int * 'c > as 'c) -> unit = <fun>
+#       type 'a t = [ `A of 'a ]
+#       class c : object method m : ([> 'a t ] as 'a) -> unit end
+#         class c : object method m : ([> 'a t ] as 'a) -> unit end
+#     class c : object method m : ([> 'a t ] as 'a) -> 'a end
+#     class c : object method m : ([> `A ] as 'a) option -> 'a end
+#           Characters 145-166:
+This type scheme cannot quantify 'a :
+it escapes this scope.
+#                 type ('a, 'b) list_visitor = < caseCons : 'b -> 'b list -> 'a; caseNil : 'a >
+type 'a alist = < visit : 'b. ('b, 'a) list_visitor -> 'b >
+class type ct = object ('a) method fold : ('b -> 'a -> 'b) -> 'b -> 'b end
+type t = { f : 'a 'b. ('b -> (#ct as 'a) -> 'b) -> 'b; }
+#     Characters 19-25:
+The type abbreviation t is cyclic
+#       class ['a] a : object constraint 'a = [> `A of 'a a ] end
+type t = [ `A of t a ]
+#     Characters 71-80:
+Constraints are not satisfied in this type.
+Type ('a, 'b) t should be an instance of ('c, 'c) t
+#     type 'a t = 'a
+and u = int t
+#     type 'a t constraint 'a = int
+# Characters 26-32:
+Constraints are not satisfied in this type.
+Type 'a u t should be an instance of int t
+# type 'a u = 'a constraint 'a = int
+and 'a v = 'a u t constraint 'a = int
+#     type g = int
+# type 'a t = unit constraint 'a = g
+# Characters 26-32:
+Constraints are not satisfied in this type.
+Type 'a u t should be an instance of g t
+# type 'a u = 'a constraint 'a = g
+and 'a v = 'a u t constraint 'a = int
+#     Characters 38-58:
+In the definition of v, type 'a list u should be 'a u
+#       type 'a t = 'a
+type 'a u = A of 'a t
+#     type 'a t = < a : 'a >
+# - : ('a t as 'a) -> ('b t as 'b) t = <fun>
+# type u = 'a t as 'a
+#       type t = A | B
+# - : [> `A ] * t -> int = <fun>
+# - : [> `A ] * t -> int = <fun>
+# - : [> `A ] option * t -> int = <fun>
+#   - : [> `A ] option * t -> int = <fun>
+# - : t * [< `A | `B ] -> int = <fun>
+# - : [< `A | `B ] * t -> int = <fun>
+# Characters 0-41:
+Warning P: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+(`AnyExtraTag, `AnyExtraTag)
+- : [> `A | `B ] * [> `A | `B ] -> int = <fun>
+# Characters 0-29:
+Warning P: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+(_, 0)
+Characters 21-24:
+Warning U: this match case is unused.
+- : [< `B ] * int -> int = <fun>
+# Characters 0-29:
+Warning P: this pattern-matching is not exhaustive.
+Here is an example of a value that is not matched:
+(0, _)
+Characters 21-24:
+Warning U: this match case is unused.
+- : int * [< `B ] -> int = <fun>
+#       Characters 69-135:
+Constraints are not satisfied in this type.
+Type
+([> `B of 'a ], 'a) b as 'a
+should be an instance of
+(('b, [> `A of ('d, 'c) a as 'd ] as 'c) a as 'b, 'c) b
+#                             class type ['a, 'b] a =
+  object
+    constraint 'a = ('a, 'b) #a
+    constraint 'b = ('a, 'b) #b
+    method as_a : ('a, 'b) a
+    method b : 'b
+  end
+and ['a, 'b] b =
+  object
+    constraint 'a = ('a, 'b) #a
+    constraint 'b = ('a, 'b) #b
+    method a : 'a
+    method as_b : ('a, 'b) b
+  end
+class type ['a] ca =
+  object ('b)
+    constraint 'a = ('b, 'a) #b
+    method as_a : ('b, 'a) a
+    method b : 'a
+  end
+class type ['a] cb =
+  object ('b)
+    constraint 'a = ('a, 'b) #a
+    method a : 'a
+    method as_b : ('a, 'b) b
+  end
+type bt = 'a ca cb as 'a
+#     class c : object method m : int end
+# val f : unit -> c = <fun>
+# val f : unit -> c = <fun>
+# Characters 11-60:
+Warning X: the following private methods were made public implicitly:
+ n.
+val f : unit -> < m : int; n : int > = <fun>
+# Characters 11-56:
+This object is expected to have type c but has actually type
+  < m : int; n : 'a >
+Only the second object type has a method n
+# Characters 11-69:
+This object is expected to have type < n : int > but has actually type
+  < m : 'a >
+Only the first object type has a method n
+#         Characters 66-124:
+This object is expected to have type < x : int; .. > but has actually type
+  < x : int >
+Self type cannot be unified with a closed object type
+#         val o : < x : int > = <obj>
+#         Characters 76-77:
+This expression has type < m : 'b. 'b * < m : 'b * 'a > > as 'a
+but is here used with type
+  < m : 'b. 'b * (< m : 'b * < m : 'd. 'd * 'c > > as 'c) >
+Types for method m are incompatible
+#         Characters 176-177:
+This expression has type foo' = < m : 'a. 'a * 'a foo >
+but is here used with type bar' = < m : 'a. 'a * 'a bar >
+Type 'a foo = < m : 'a * 'a foo > is not compatible with type
+  'a bar = < m : 'a * < m : 'b. 'b * 'a bar > > 
+Type 'a foo = < m : 'a * 'a foo > is not compatible with type
+  < m : 'b. 'b * 'a bar > 
+Types for method m are incompatible
+#     Characters 67-68:
+This expression has type < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) >
+but is here used with type
+  < m : 'a. 'a * ('a * < m : 'c. 'c * ('c * 'd) >) > as 'd
+Types for method m are incompatible
+#   Characters 66-67:
+This expression has type < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) >
+but is here used with type
+  < m : 'a. 'a * ('a * < m : 'c. 'c * ('a * 'd) >) > as 'd
+Types for method m are incompatible
+#   Characters 51-52:
+This expression has type < m : 'b. 'b * ('b * 'a) > as 'a
+but is here used with type < m : 'b. 'b * ('b * < m : 'd. 'd * 'c > as 'c) >
+Types for method m are incompatible
+#     Characters 14-115:
+Type < m : 'a. 'a -> ('a * (< m : 'd. 'd -> 'b as 'e > as 'c) as 'b) >
+is not a subtype of type < m : 'a. 'a -> ('a * 'f as 'h) as 'g > as 'f 
+#       Characters 88-150:
+Signature mismatch:
+Modules do not match:
+  sig val f : (< m : 'b. 'b * ('b * 'a) > as 'a) -> unit end
+is not included in
+  sig val f : < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) > -> unit end
+Values do not match:
+  val f : (< m : 'b. 'b * ('b * 'a) > as 'a) -> unit
+is not included in
+  val f : < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) > -> unit
+#     Characters 78-132:
+Signature mismatch:
+Modules do not match:
+  sig type t = < m : 'b. 'b * ('b * 'a) > as 'a end
+is not included in
+  sig type t = < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) > end
+Type declarations do not match:
+  type t = < m : 'b. 'b * ('b * 'a) > as 'a
+is not included in
+  type t = < m : 'a. 'a * ('a * < m : 'c. 'c * 'b > as 'b) >
+#     module M : sig type 'a t type u = < m : 'a. 'a t > end
+#   module M : sig type 'a t val f : < m : 'a. 'a t > -> int end
+#     module M : sig type 'a t val f : < m : 'a. 'a t > -> int end
+#         val f :
+  (< m : 'b. 'b -> (< m : 'b. 'b -> 'c * <  > > as 'c) * < .. >; .. > as 'a) ->
+  'a -> bool = <fun>
+#         type t = [ `A | `B ]
+# type v = private [> t ]
+# - : t -> v = <fun>
+# type u = private [< t ]
+# - : u -> v = <fun>
+# Characters 9-21:
+Type v = [> `A | `B ] is not a subtype of type u = [< `A | `B ] 
+These two variant types have no intersection
+# type v = private [< t ]
+# Characters 9-21:
+Type u = [< `A | `B ] is not a subtype of type v = [< `A | `B ] 
+# type p = < x : p >
+# type q = private < x : p; .. >
+# - : q -> p = <fun>
+# Characters 9-21:
+Type p = < x : p > is not a subtype of type q = < x : p; .. > 
+#       Characters 14-100:
+Type < m : 'a. (< p : int; .. > as 'a) -> int > is not a subtype of type
+  < m : 'b. (< p : int; q : int; .. > as 'b) -> int > 
+#     val f2 :
+  < m : 'a. (< p : < a : int >; .. > as 'a) -> int > ->
+  < m : 'a. (< p : < a : int; b : int >; .. > as 'a) -> int > = <fun>
+#     Characters 13-107:
+Type < m : 'a. (< p : < a : int; b : int >; .. > as 'a) -> int >
+is not a subtype of type < m : 'a. (< p : < a : int >; .. > as 'a) -> int > 
+# Characters 11-55:
+Type < p : < a : int; b : int >; .. > is not a subtype of type
+  < p : < a : int >; .. > 
+Only the first object type has a method b
+#   val f5 :
+  < m : 'a. [< `A of < p : int > ] as 'a > ->
+  < m : 'a. [< `A of <  > ] as 'a > = <fun>
+#   Characters 13-83:
+Type < m : 'a. [< `A of <  > ] as 'a > is not a subtype of type
+  < m : 'a. [< `A of < p : int > ] as 'a > 
+# 
diff --git a/testlabl/poly.ml b/testlabl/poly.ml
new file mode 100644 (file)
index 0000000..bf5b103
--- /dev/null
@@ -0,0 +1,556 @@
+(* $Id: poly.ml,v 1.35 2005/08/19 03:50:12 garrigue Exp $ *)
+(*
+   Polymorphic methods are now available in the main branch.
+   Enjoy.
+*)
+
+(* Tests for explicit polymorphism *)
+open StdLabels;;
+
+type 'a t = { t : 'a };;
+type 'a fold = { fold : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b };;
+let f l = { fold = List.fold_left l };;
+(f [1;2;3]).fold ~f:(+) ~init:0;;
+
+class ['b] ilist l = object
+  val l = l
+  method add x = {< l = x :: l >}
+  method fold : 'a. f:('a -> 'b -> 'a) -> init:'a -> 'a =
+    List.fold_left l
+end
+;;
+class virtual ['a] vlist = object (_ : 'self)
+  method virtual add : 'a -> 'self
+  method virtual fold : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b
+end
+;;
+class ilist2 l = object
+  inherit [int] vlist
+  val l = l
+  method add x = {< l = x :: l >}
+  method fold = List.fold_left l
+end
+;;
+let ilist2 l = object
+  inherit [_] vlist
+  val l = l
+  method add x = {< l = x :: l >}
+  method fold = List.fold_left l
+end
+;;
+class ['a] ilist3 l = object
+  inherit ['a] vlist
+  val l = l
+  method add x = {< l = x :: l >}
+  method fold = List.fold_left l
+end
+;;
+class ['a] ilist4 (l : 'a list) = object
+  val l = l
+  method virtual add : _
+  method add x = {< l = x :: l >}
+  method virtual fold : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b
+  method fold = List.fold_left l
+end
+;;
+class ['a] ilist5 (l : 'a list) = object (self)
+  val l = l
+  method add x = {< l = x :: l >}
+  method virtual fold : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b
+  method virtual fold2 : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b
+  method fold2 ~f ~init = self#fold ~f ~init:(self#fold ~f ~init)
+  method fold = List.fold_left l
+end
+;;
+class ['a] ilist6 l = object (self)
+  inherit ['a] vlist
+  val l = l
+  method add x = {< l = x :: l >}
+  method virtual fold2 : 'b. f:('b -> 'a -> 'b) -> init:'b -> 'b
+  method fold2 ~f ~init = self#fold ~f ~init:(self#fold ~f ~init)
+  method fold = List.fold_left l
+end
+;;
+class virtual ['a] olist = object
+  method virtual fold : 'c. f:('a -> 'c -> 'c) -> init:'c -> 'c
+end
+;;
+class ['a] onil = object
+  inherit ['a] olist
+  method fold ~f ~init = init
+end
+;;
+class ['a] ocons ~hd ~tl = object (_ : 'b)
+  inherit ['a] olist
+  val hd : 'a = hd
+  val tl : 'a olist = tl
+  method fold ~f ~init = f hd (tl#fold ~f ~init)
+end
+;;
+class ['a] ostream ~hd ~tl = object (_ : 'b)
+  inherit ['a] olist
+  val hd : 'a = hd
+  val tl : _ #olist = (tl : 'a ostream)
+  method fold ~f ~init = f hd (tl#fold ~f ~init)
+  method empty = false
+end
+;;
+class ['a] ostream1 ~hd ~tl = object (self : 'b)
+  inherit ['a] olist
+  val hd = hd
+  val tl : 'b = tl
+  method hd = hd
+  method tl = tl
+  method fold ~f ~init =
+    self#tl#fold ~f ~init:(f self#hd init)
+end
+;;
+
+class vari = object
+  method virtual m : 'a. ([< `A|`B|`C] as 'a) -> int
+  method m = function `A -> 1 | `B|`C  -> 0
+end
+;;
+class vari = object
+  method m : 'a. ([< `A|`B|`C] as 'a) -> int = function `A -> 1 | `B|`C -> 0
+end
+;;
+module V =
+  struct
+    type v = [`A | `B | `C]
+    let m : [< v] -> int = function `A -> 1 | #v -> 0
+  end
+;;
+class varj = object
+  method virtual m : 'a. ([< V.v] as 'a) -> int
+  method m = V.m
+end
+;;
+
+module type T = sig
+  class vari : object method m : 'a. ([< `A | `B | `C] as 'a) -> int end
+end
+;;
+module M0 = struct
+  class vari = object
+    method virtual m : 'a. ([< `A|`B|`C] as 'a) -> int
+    method m = function `A -> 1 | `B|`C -> 0
+  end
+end
+;;
+module M : T = M0
+;;
+let v = new M.vari;;
+v#m `A;;
+
+class point ~x ~y = object
+  val x : int = x
+  val y : int = y
+  method x = x
+  method y = y
+end
+;;
+class color_point ~x ~y ~color = object
+  inherit point ~x ~y
+  val color : string = color
+  method color = color
+end
+;;
+class circle (p : #point) ~r = object
+  val p = (p :> point)
+  val r = r
+  method virtual distance : 'a. (#point as 'a) -> float
+  method distance p' =
+    let dx = p#x - p'#x and dy = p#y - p'#y in
+    let d = sqrt (float (dx * dx + dy * dy)) -. float r in
+    if d < 0. then 0. else d
+end
+;;
+let p0 = new point ~x:3 ~y:5
+let p1 = new point ~x:10 ~y:13
+let cp = new color_point ~x:12 ~y:(-5) ~color:"green"
+let c = new circle p0 ~r:2
+let d = c#distance cp
+;;
+let f (x : < m : 'a. 'a -> 'a >) = (x : < m : 'b. 'b -> 'b >)
+;;
+let f (x : < m : 'a. 'a -> 'a list >) = (x : < m : 'b. 'b -> 'c >)
+;;
+
+class id = object
+  method virtual id : 'a. 'a -> 'a
+  method id x = x
+end
+;;
+
+class type id_spec = object
+  method id : 'a -> 'a
+end
+;;
+class id_impl = object (_ : #id_spec)
+  method id x = x
+end
+;;
+
+class a = object
+  method m = (new b : id_spec)#id true
+end
+and b = object (_ : #id_spec)
+  method id x = x
+end
+;;
+
+class ['a] id1 = object
+  method virtual id : 'b. 'b -> 'a
+  method id x = x
+end
+;;
+class id2 (x : 'a) = object
+  method virtual id : 'b. 'b -> 'a
+  method id x = x
+end
+;;
+class id3 x = object
+  val x = x
+  method virtual id : 'a. 'a -> 'a
+  method id _ = x
+end
+;;
+class id4 () = object
+  val mutable r = None
+  method virtual id : 'a. 'a -> 'a
+  method id x =
+    match r with
+      None -> r <- Some x; x
+    | Some y -> y
+end
+;;
+class c = object
+  method virtual m : 'a 'b. 'a -> 'b -> 'a
+  method m x y = x
+end
+;;
+
+let f1 (f : id) = f#id 1, f#id true
+;;
+let f2 f = (f : id)#id 1, (f : id)#id true
+;;
+let f3 f = f#id 1, f#id true
+;;
+let f4 f = ignore(f : id); f#id 1, f#id true
+;;
+
+class c = object
+  method virtual m : 'a. (#id as 'a) -> int * bool
+  method m (f : #id) = f#id 1, f#id true
+end
+;;
+
+class id2 = object (_ : 'b)
+  method virtual id : 'a. 'a -> 'a
+  method id x = x
+  method mono (x : int) = x
+end
+;;
+let app = new c #m (new id2)
+;;
+type 'a foo = 'a foo list
+;;
+
+class ['a] bar (x : 'a) = object end
+;;
+type 'a foo = 'a foo bar
+;;
+
+fun x -> (x : < m : 'a. 'a * 'b > as 'b)#m;;
+fun x -> (x : < m : 'a. 'b * 'a list> as 'b)#m;;
+let f x = (x : < m : 'a. 'b * (< n : 'a; .. > as 'a) > as 'b)#m;;
+fun (x : < p : 'a. < m : 'a ; n : 'b ; .. > as 'a > as 'b) -> x#p;;
+fun (x : <m:'a. 'a * <p:'b. 'b * 'c * 'd> as 'c> as 'd) -> x#m;;
+(* printer is wrong on the next (no official syntax) *)
+fun (x : <m:'a.<p:'a;..> >) -> x#m;;
+
+type sum = T of < id: 'a. 'a -> 'a > ;;
+fun (T x) -> x#id;;
+
+type record = { r: < id: 'a. 'a -> 'a > } ;;
+fun x -> x.r#id;;
+fun {r=x} -> x#id;;
+
+class myself = object (self)
+  method self : 'a. 'a -> 'b = fun _ -> self
+end;;
+
+class number = object (self : 'self)
+  val num = 0
+  method num = num
+  method succ = {< num = num + 1 >}
+  method prev =
+    self#switch ~zero:(fun () -> failwith "zero") ~prev:(fun x -> x)
+  method switch : 'a. zero:(unit -> 'a) -> prev:('self -> 'a) -> 'a =
+    fun ~zero ~prev ->
+      if num = 0 then zero () else prev {< num = num - 1 >}
+end
+;;
+
+let id x = x
+;;
+class c = object
+  method id : 'a. 'a -> 'a = id
+end
+;;
+class c' = object
+  inherit c
+  method id = id
+end
+;;
+class d = object
+  inherit c as c
+  val mutable count = 0
+  method id x = count <- count+1; x
+  method count = count
+  method old : 'a. 'a -> 'a = c#id
+end
+;;
+class ['a] olist l = object
+  val l = l
+  method fold : 'b. f:('a -> 'b -> 'b) -> init:'b -> 'b
+      = List.fold_right l
+  method cons a = {< l = a :: l >}
+end
+;;
+let sum (l : 'a #olist) = l#fold ~f:(fun x acc -> x+acc) ~init:0
+;;
+let count (l : 'a #olist) = l#fold ~f:(fun _ acc -> acc+1) ~init:0
+;;
+let append (l : 'a #olist) (l' : 'b #olist) =
+  l#fold ~init:l' ~f:(fun x acc -> acc#cons x)
+;;
+
+type 'a t = unit
+;;
+class o = object method x : 'a. ([> `A] as 'a) t -> unit = fun _ -> () end
+;;
+
+class c = object method m = new d () end and d ?(x=0) () = object end;;
+class d ?(x=0) () = object end and c = object method m = new d () end;;
+
+class type numeral = object method fold : ('a -> 'a) -> 'a -> 'a end
+class zero = object (_ : #numeral) method fold f x = x end
+class next (n : #numeral) =
+  object (_ : #numeral) method fold f x = n#fold f (f x) end
+;;
+
+class type node_type =  object
+  method as_variant : [> `Node of node_type]
+end;;
+class node : node_type = object (self)
+  method as_variant : 'a. [> `Node of node_type] as 'a
+                    = `Node (self :>  node_type)
+end;;
+class node = object (self : #node_type)
+  method as_variant = `Node (self :> node_type)
+end;;
+
+type bad = {bad : 'a. 'a option ref};;
+let bad = {bad = ref None};;
+type bad2 = {mutable bad2 : 'a. 'a option ref option};;
+let bad2 = {bad2 = None};;
+bad2.bad2 <- Some (ref None);;
+
+(* Type variable scope *)
+
+let f (x: <m:'a.<p: 'a * 'b> as 'b>) (y : 'b) = ();;
+let f (x: <m:'a. 'a * (<p:int*'b> as 'b)>) (y : 'b) = ();;
+
+(* PR#1374 *)
+
+type 'a t= [`A of 'a];;
+class c = object (self)
+  method m :  'a. ([> 'a t] as 'a) -> unit
+    = fun x -> self#m x
+end;;
+class c = object (self)
+  method m : 'a. ([> 'a t] as 'a) -> unit = function
+    | `A x' -> self#m x'
+    | _ -> failwith "c#m"
+end;;
+class c = object (self)
+  method m :  'a. ([> 'a t] as 'a) -> 'a = fun x -> self#m x
+end;;
+
+(* usage avant instance *)
+class c = object method m : 'a. 'a option -> ([> `A] as 'a) = fun x -> `A end;;
+
+(* various old bugs *)
+class virtual ['a] visitor =
+object method virtual caseNil : 'a end
+and virtual int_list =
+object method virtual visit : 'a.('a visitor -> 'a) end;;
+
+type ('a,'b) list_visitor = < caseNil : 'a; caseCons : 'b -> 'b list -> 'a >
+type 'b alist = < visit : 'a. ('a,'b) list_visitor -> 'a >
+
+(* PR#1607 *)
+class type ct = object ('s)
+  method fold : ('b -> 's -> 'b) -> 'b -> 'b
+end
+type t = {f : 'a 'b. ('b -> (#ct as 'a) -> 'b) -> 'b};;
+
+(* PR#1663 *)
+type t = u and u = t;;
+
+(* PR#1731 *)
+class ['t] a = object constraint 't = [> `A of 't a] end
+type t = [ `A of t a ];;
+
+(* Wrong in 3.06 *)
+type ('a,'b) t constraint 'a = 'b and ('a,'b) u = ('a,'b) t;;
+
+(* Full polymorphism if we do not expand *)
+type 'a t = 'a and u = int t;;
+
+(* Loose polymorphism if we expand *)
+type 'a t constraint 'a = int;;
+type 'a u = 'a and 'a v = 'a u t;;
+type 'a u = 'a and 'a v = 'a u t constraint 'a = int;;
+
+(* Behaviour is unstable *)
+type g = int;;
+type 'a t = unit constraint 'a = g;;
+type 'a u = 'a and 'a v = 'a u t;;
+type 'a u = 'a and 'a v = 'a u t constraint 'a = int;;
+
+(* Example of wrong expansion *)
+type 'a u = < m : 'a v > and 'a v = 'a list u;;
+
+(* PR#1744: Ctype.matches *)
+type 'a t = 'a
+type 'a u = A of 'a t;;
+
+(* Unification of cyclic terms *)
+type 'a t = < a : 'a >;;
+fun (x : 'a t as 'a) -> (x : 'b t);;
+type u = 'a t as 'a;;
+
+
+(* Variant tests *)
+type t = A | B;;
+function `A,_ -> 1 | _,A -> 2 | _,B -> 3;;
+function `A,_ -> 1 | _,(A|B) -> 2;;
+function Some `A, _ -> 1 | Some _, A -> 2 | None, A -> 3 | _, B -> 4;;
+function Some `A, A -> 1 | Some `A, B -> 1
+       | Some _, A -> 2  | None, A -> 3 | _, B -> 4;;
+function A, `A -> 1 | A, `B -> 2 | B, _ -> 3;;
+function `A, A -> 1 | `B, A -> 2 | _, B -> 3;;
+function (`A|`B), _ -> 0 | _,(`A|`B) -> 1;;
+function `B,1 -> 1 | _,1 -> 2;;
+function 1,`B -> 1 | 1,_ -> 2;;
+
+(* pass typetexp, but fails during Typedecl.check_recursion *)
+type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b] 
+and  ('a, 'b) b = 'b -> unit constraint 'b = [> `A of ('a, 'b) a as 'a];;
+
+(* PR#1917: expanding may change original in Ctype.unify2 *)
+class type ['a, 'b] a = object
+  method b: ('a, 'b) #b as 'b
+  method as_a: ('a, 'b) a
+end and ['a, 'b] b = object
+  method a: ('a, 'b) #a as 'a
+  method as_b: ('a, 'b) b 
+end
+
+class type ['b] ca = object ('s) inherit ['s, 'b] a end
+class type ['a] cb = object ('s) inherit ['a, 's] b end
+         
+type bt = 'b ca cb as 'b
+;;
+
+(* final classes, etc... *)
+class c = object method m = 1 end;;
+let f () = object (self:c) method m = 1 end;;
+let f () = object (self:c) method private n = 1 method m = self#n end;;
+let f () = object method private n = 1 method m = {<>}#n end;;
+let f () = object (self:c) method n = 1 method m = 2 end;;
+let f () = object (_:'s) constraint 's = < n : int > method m = 1 end;;
+class c = object (_ : 's)
+  method x = 1
+  method private m =
+    object (self: 's) method x = 3 method private m = self end
+end;;
+let o = object (_ : 's)
+  method x = 1
+  method private m =
+    object (self: 's) method x = 3 method private m = self end
+end;;
+
+
+(* Unsound! *)
+fun (x : <m : 'a. 'a * <m: 'b. 'a * 'foo> > as 'foo) ->
+  (x : <m : 'a. 'a * (<m:'b. 'a * <m:'c. 'c * 'bar> > as 'bar) >);;
+type 'a foo = <m: 'b. 'a * 'a foo>
+type foo' =   <m: 'a. 'a * 'a foo>
+type 'a bar = <m: 'b. 'a * <m: 'c. 'c * 'a bar> >
+type bar' =   <m: 'a. 'a * 'a bar >
+let f (x : foo') = (x : bar');;
+
+fun (x : <m : 'a. 'a * ('a * <m : 'a. 'a * 'foo> as 'foo)>) ->
+  (x : <m : 'b. 'b * ('b * <m : 'c. 'c * ('c * 'bar)>)> as 'bar);;
+fun (x : <m : 'a. 'a * ('a * <m : 'a. 'a * 'foo> as 'foo)>) ->
+  (x : <m : 'b. 'b * ('b * <m : 'c. 'c * ('b * 'bar)>)> as 'bar);;
+fun (x : <m : 'a. 'a * ('a * 'foo)> as 'foo) ->
+  (x : <m : 'b. 'b * ('b * <m:'c. 'c * 'bar> as 'bar)>);;
+let f x =
+    (x : <m : 'a. 'a -> ('a * <m:'c. 'c -> 'bar> as 'bar)>
+       :> <m : 'a. 'a -> ('a * 'foo)> as 'foo);;
+
+module M
+: sig val f : (<m : 'b. 'b * ('b * <m:'c. 'c * 'bar> as 'bar)>) -> unit end
+= struct let f (x : <m : 'a. 'a * ('a * 'foo)> as 'foo) = () end;;
+module M
+: sig type t = <m : 'b. 'b * ('b * <m:'c. 'c * 'bar> as 'bar)> end
+= struct type t = <m : 'a. 'a * ('a * 'foo)> as 'foo end;;
+
+module M : sig type 'a t type u = <m: 'a. 'a t> end
+= struct type 'a t = int type u = <m: int> end;;
+module M : sig type 'a t val f : <m: 'a. 'a t> -> int end
+= struct type 'a t = int let f (x : <m:int>) = x#m end;;
+(* The following should be accepted too! *)
+module M : sig type 'a t val f : <m: 'a. 'a t> -> int end
+= struct type 'a t = int let f x = x#m end;;
+
+let f x y =
+  ignore (x :> <m:'a.'a -> 'c * < > > as 'c);
+  ignore (y :> <m:'b.'b -> 'd * < > > as 'd);
+  x = y;;
+
+
+(* Subtyping *)
+
+type t = [`A|`B];;
+type v = private [> t];;
+fun x -> (x : t :> v);;
+type u = private [< t];;
+fun x -> (x : u :> v);;
+fun x -> (x : v :> u);;
+type v = private [< t];;
+fun x -> (x : u :> v);;
+type p = <x:p>;;
+type q = private <x:p; ..>;;
+fun x -> (x : q :> p);;
+fun x -> (x : p :> q);;
+
+let f1 x =
+  (x : <m:'a. (<p:int;..> as 'a) -> int>
+    :> <m:'b. (<p:int;q:int;..> as 'b) -> int>);;
+let f2 x =
+  (x : <m:'a. (<p:<a:int>;..> as 'a) -> int>
+    :> <m:'b. (<p:<a:int;b:int>;..> as 'b) -> int>);;
+let f3 x =
+  (x : <m:'a. (<p:<a:int;b:int>;..> as 'a) -> int>
+    :> <m:'b. (<p:<a:int>;..> as 'b) -> int>);;
+let f4 x = (x : <p:<a:int;b:int>;..> :> <p:<a:int>;..>);;
+let f5 x =
+  (x : <m:'a. [< `A of <p:int> ] as 'a> :> <m:'a. [< `A of < > ] as 'a>);;
+let f6 x =
+  (x : <m:'a. [< `A of < > ] as 'a> :> <m:'a. [< `A of <p:int> ] as 'a>);;
diff --git a/testlabl/printers.ml b/testlabl/printers.ml
new file mode 100644 (file)
index 0000000..2d06b4c
--- /dev/null
@@ -0,0 +1,11 @@
+(* $Id: printers.ml,v 1.1 2003/04/03 02:16:20 garrigue Exp $ *)
+
+open Types
+
+let ignore_abbrevs ppf ab =
+  let s = match ab with
+    Mnil -> "Mnil"
+  | Mlink _ -> "Mlink _"
+  | Mcons _ -> "Mcons _"
+  in
+  Format.pp_print_string ppf s
diff --git a/testlabl/tests.ml b/testlabl/tests.ml
new file mode 100644 (file)
index 0000000..daea8e0
--- /dev/null
@@ -0,0 +1,22 @@
+(* $Id: tests.ml,v 1.3 2000/01/07 16:44:44 doligez Exp $ *)
+
+let f1 = function `a x -> x=1 | `b -> true
+let f2 = function `a x -> x | `b -> true
+let f3 = function `b -> true
+let f x = f1 x && f2 x
+
+let sub s ?:pos{=0} ?:len{=String.length s - pos} () =
+  String.sub s pos len
+
+let cCAMLtoTKpack_options w = function
+        `After v1 -> "-after"
+        | `Anchor v1 -> "-anchor"
+        | `Before v1 -> "-before"
+        | `Expand v1 -> "-expand"
+        | `Fill v1 -> "-fill"
+        | `In v1 -> "-in"
+        | `Ipadx v1 -> "-ipadx"
+        | `Ipady v1 -> "-ipady"
+        | `Padx v1 -> "-padx"
+        | `Pady v1 -> "-pady"
+        | `Side v1 -> "-side"
diff --git a/testobjects/.cvsignore b/testobjects/.cvsignore
new file mode 100644 (file)
index 0000000..9c92a72
--- /dev/null
@@ -0,0 +1 @@
+*.proc
diff --git a/testobjects/Exemples.exp b/testobjects/Exemples.exp
new file mode 100644 (file)
index 0000000..5d55e08
--- /dev/null
@@ -0,0 +1,301 @@
+#           class point (int) =
+  val mutable x : int
+  method get_x : int
+  method move : int -> unit
+end
+#   val p : point = <obj>
+#   - : int = 7
+# - : unit = ()
+# - : int = 10
+#   val q : point = <obj>
+#   - : int * int = 10, 17
+#           class color_point (int) (string) =
+  val c : string
+  val mutable x : int
+  method color : string
+  method get_x : int
+  method move : int -> unit
+end
+#   val p' : color_point = <obj>
+#   - : int * string = 5, "red"
+#   val l : point list = [<obj>; <obj>]
+#   val get_x : < get_x : 'a; .. > -> 'a = <fun>
+# val set_x : < set_x : 'a; .. > -> 'a = <fun>
+# - : int list = [10; 5]
+#           Characters 6-86:
+The type variable 'a is not bound in implicit type definition
+  ref = < get : 'a; set : 'a -> unit >
+It should be captured by a class type parameter
+#           class ref (int) =
+  val mutable x : int
+  method get : int
+  method set : int -> unit
+end
+#           class 'a ref ('a) =
+  val mutable x : 'a
+  method get : 'a
+  method set : 'a -> unit
+end
+#   - : int = 2
+#             class 'a circle ('a) =
+  constraint 'a = < move : int -> unit; .. >
+  val mutable center : 'a
+  method center : 'a
+  method move : int -> unit
+  method set_center : 'a -> unit
+end
+#               class 'a circle ('a) =
+  constraint 'a = #point
+  val mutable center : 'a
+  method center : 'a
+  method move : int -> unit
+  method set_center : 'a -> unit
+end
+#   val c : point circle = <obj>
+val c' : color_point circle = <obj>
+#           class 'a color_circle ('a) =
+  constraint 'a = #color_point
+  val mutable center : 'a
+  method center : 'a
+  method color : string
+  method move : int -> unit
+  method set_center : 'a -> unit
+end
+#   Characters 28-29:
+This expression has type point = < get_x : int; move : int -> unit >
+but is here used with type
+  #color_point = < get_x : int; move : int -> unit; color : string; .. >
+# val c'' : color_point color_circle = <obj>
+#   - : color_point circle = <obj>
+# Characters 1-4:
+This expression cannot be coerced to type
+  point circle =
+    < center : point; set_center : point -> unit; move : int -> unit >;
+it has type
+  color_point color_circle =
+    < center : color_point; set_center : color_point -> unit;
+      move : int -> unit; color : string >
+but is here used with type
+  < center : color_point; set_center : point -> unit; move : int -> unit;
+    color : string >
+Type color_point = < get_x : int; move : int -> unit; color : string >
+is not compatible with type point = < get_x : int; move : int -> unit >
+# Characters 9-55:
+Type
+  color_point color_circle =
+    < center : color_point; set_center : color_point -> unit;
+      move : int -> unit; color : string >
+is not a subtype of type
+  point circle =
+    < center : point; set_center : point -> unit; move : int -> unit >
+Type color_point -> unit is not a subtype of type point -> unit
+Type point = < get_x : int; move : int -> unit > is not a subtype of type
+  color_point = < get_x : int; move : int -> unit; color : string >
+#         class printable_point (int) =
+  val mutable x : int
+  method get_x : int
+  method move : int -> unit
+  method print : unit
+end
+#   val p : printable_point = <obj>
+# 7- : unit = ()
+#                     class printable_color_point (int) (string) =
+  val c : string
+  val mutable x : int
+  method color : string
+  method get_x : int
+  method move : int -> unit
+  method print : unit
+end
+#   val p' : printable_color_point = <obj>
+# (7, red)- : unit = ()
+#           class functional_point (int) : 'a =
+  val x : int
+  method get_x : int
+  method move : int -> 'a
+end
+#   val p : functional_point = <obj>
+#   - : int = 7
+# - : int = 10
+# - : int = 7
+#   - : (< get_x : int; move : int -> 'a; .. > as 'a) -> functional_point = <fun>
+#                                                                       class virtual 'a lst (unit) =
+  virtual hd : 'a
+  method iter : ('a -> unit) -> unit
+  method map : ('a -> 'a) -> 'a lst
+  virtual null : bool
+  method print : ('a -> unit) -> unit
+  virtual tl : 'a lst
+end
+class 'a nil (unit) =
+  method hd : 'a
+  method iter : ('a -> unit) -> unit
+  method map : ('a -> 'a) -> 'a lst
+  method null : bool
+  method print : ('a -> unit) -> unit
+  method tl : 'a lst
+end
+class 'a cons ('a) ('a lst) =
+  val h : 'a
+  val t : 'a lst
+  method hd : 'a
+  method iter : ('a -> unit) -> unit
+  method map : ('a -> 'a) -> 'a lst
+  method null : bool
+  method print : ('a -> unit) -> unit
+  method tl : 'a lst
+end
+#   val l1 : int cons = <obj>
+#   (3::10::[])- : unit = ()
+#   val l2 : int lst = <obj>
+# (4::11::[])- : unit = ()
+#       val map_list : ('a -> 'b) -> 'a lst -> 'b lst = <fun>
+#   val p1 : printable_color_point lst = <obj>
+# ((3, red)::(10, red)::[])- : unit = ()
+#           class virtual comparable (unit) : 'a = virtual leq : 'a -> bool end
+#             class int_comparable (int) : 'a =
+  val x : int
+  method leq : 'a -> bool
+  method x : int
+end
+#           class int_comparable2 (int) : 'a =
+  method leq : 'a -> bool
+  method set_x : int -> unit
+  method x : int
+end
+#                         class 'a sorted_list (unit) =
+  constraint 'a = #comparable
+  val mutable l : 'a list
+  method add : 'a -> unit
+  method hd : 'a
+end
+#   val l : _#comparable sorted_list = <obj>
+# val c : int_comparable = <obj>
+# - : unit = ()
+#   val c2 : int_comparable2 = <obj>
+# Characters 7-9:
+This expression cannot be coerced to type
+  int_comparable = < leq : int_comparable -> bool; x : int >;
+it has type
+  int_comparable2 =
+    < leq : int_comparable2 -> bool; x : int; set_x : int -> unit >
+but is here used with type
+  < leq : int_comparable -> bool; x : int; set_x : int -> unit >
+Type
+  int_comparable2 =
+    < leq : int_comparable2 -> bool; x : int; set_x : int -> unit >
+is not compatible with type
+  int_comparable = < leq : int_comparable -> bool; x : int >
+# - : unit = ()
+#             class int_comparable3 (int) =
+  val mutable x : int
+  method leq : int_comparable -> bool
+  method setx : int -> unit
+  method x : int
+end
+#   val c3 : int_comparable3 = <obj>
+# - : unit = ()
+# Characters 25-27:
+This expression has type
+  int_comparable3 =
+    < leq : int_comparable -> bool; x : int; setx : int -> unit >
+but is here used with type
+  < leq : 'a -> bool; setx : int -> unit; x : int > as 'a
+Type int_comparable = < leq : int_comparable -> bool; x : int >
+is not compatible with type
+  int_comparable3 =
+    < leq : int_comparable -> bool; x : int; setx : int -> unit >
+#   val sort : (#comparable as 'a) list -> 'a list = <fun>
+#     val pr : < x : int; .. > list -> unit = <fun>
+#   val l : int_comparable list = [<obj>; <obj>; <obj>]
+# 5 2 4 
+- : unit = ()
+# 2 4 5 
+- : unit = ()
+# val l : int_comparable2 list = [<obj>; <obj>]
+# 2 0 
+- : unit = ()
+# 0 2 
+- : unit = ()
+#     val min : (#comparable as 'a) -> 'a -> 'a = <fun>
+#   - : int = 7
+# - : int = 3
+#                                 class 'a link ('a) : 'b =
+  val mutable next : 'b option
+  val mutable x : 'a
+  method append : 'b option -> unit
+  method next : 'b option
+  method set_next : 'b option -> unit
+  method set_x : 'a -> unit
+  method x : 'a
+end
+#                   class 'a double_link ('a) : 'b =
+  val mutable next : 'b option
+  val mutable prev : 'b option
+  val mutable x : 'a
+  method append : 'b option -> unit
+  method next : 'b option
+  method prev : 'b option
+  method set_next : 'b option -> unit
+  method set_prev : 'b option -> unit
+  method set_x : 'a -> unit
+  method x : 'a
+end
+#           val fold_right : ('a -> 'b -> 'b) -> 'a #link option -> 'b -> 'b = <fun>
+#                                       class calculator (unit) : 'a =
+  val mutable acc : float
+  val mutable arg : float
+  val mutable equals : 'a -> float
+  method acc : float
+  method add : 'a
+  method arg : float
+  method enter : float -> 'a
+  method equals : float
+  method sub : 'a
+end
+#   - : float = 5
+# - : float = 1.5
+# - : float = 15
+#                       class calculator (unit) : 'a =
+  val mutable acc : float
+  val mutable arg : float
+  val mutable equals : 'a -> float
+  method acc : float
+  method add : 'a
+  method arg : float
+  method enter : float -> 'a
+  method equals : float
+  method sub : 'a
+end
+#   - : float = 5
+# - : float = 1.5
+# - : float = 15
+#                                 class calculator (float) (float) =
+  val acc : float
+  val arg : float
+  method add : calculator_add
+  method enter : float -> calculator
+  method equals : float
+  method sub : calculator_sub
+end
+class calculator_add (float) (float) =
+  val acc : float
+  val arg : float
+  method add : calculator_add
+  method enter : float -> calculator
+  method equals : float
+  method sub : calculator_sub
+end
+class calculator_sub (float) (float) =
+  val acc : float
+  val arg : float
+  method add : calculator_add
+  method enter : float -> calculator
+  method equals : float
+  method sub : calculator_sub
+end
+#   val calculator : calculator = <obj>
+#   - : float = 5
+# - : float = 1.5
+# - : float = 15
+# 
diff --git a/testobjects/Exemples.ml b/testobjects/Exemples.ml
new file mode 100644 (file)
index 0000000..30db53a
--- /dev/null
@@ -0,0 +1,333 @@
+
+class point x_init =
+  val mutable x = x_init
+  method get_x = x
+  method move d = x <- x + d
+end;;
+
+let p = new point 7;;
+
+p#get_x;;
+p#move 3;;
+p#get_x;;
+
+let q = Oo.copy p;;
+
+q#move 7; p#get_x, q#get_x;;
+
+class color_point x (c : string) =
+  inherit point x
+  val c = c
+  method color = c
+end;;
+
+let p' = new color_point 5 "red";;
+
+p'#get_x, p'#color;;
+
+let l = [p; (p' :> point)];;
+
+let get_x p = p#get_x;;
+let set_x p = p#set_x;;
+List.map get_x l;;
+
+class ref x_init = 
+  val mutable x = x_init
+  method get = x
+  method set y = x <- y
+end;;
+
+class ref (x_init:int) = 
+  val mutable x = x_init
+  method get = x
+  method set y = x <- y
+end;;
+
+class 'a ref x_init = 
+  val mutable x = (x_init : 'a)
+  method get = x
+  method set y = x <- y
+end;;
+
+let r = new ref 1 in r#set 2; (r#get);;
+
+class 'a circle (c : 'a) =
+  val mutable center = c
+  method center = center
+  method set_center c = center <- c
+  method move = (center#move : int -> unit)
+end;;
+
+class 'a circle (c : 'a) =
+  constraint 'a = #point
+  val mutable center = c
+  method center = center
+  method set_center c = center <- c
+  method move = center#move
+end;;
+
+let (c, c') = (new circle p, new circle p');;
+
+class 'a color_circle c =
+  constraint 'a = #color_point
+  inherit ('a) circle c
+  method color = center#color
+end;;
+
+let c'' = new color_circle p;;
+let c'' = new color_circle p';;
+
+(c'' :> color_point circle);;
+(c'' :> point circle);;                 (* Echec *)
+fun x -> (x : color_point color_circle :> point circle);;
+
+class printable_point y as s =
+  inherit point y
+  method print = print_int s#get_x
+end;;
+
+let p = new printable_point 7;;
+p#print;;
+
+class printable_color_point y c as self =
+  inherit color_point y c
+  inherit printable_point y as super
+  method print =
+    print_string "(";
+    super#print;
+    print_string ", ";
+    print_string (self#color);
+    print_string ")"
+end;;
+
+let p' = new printable_color_point 7 "red";;
+p'#print;;
+
+class functional_point y =
+  val x = y
+  method get_x = x
+  method move d = {< x = x + d >}
+end;;
+
+let p = new functional_point 7;;
+
+p#get_x;;
+(p#move 3)#get_x;;
+p#get_x;;
+
+fun x -> (x :> functional_point);;
+
+(*******************************************************************)
+
+class virtual 'a lst () as self =
+  virtual null : bool
+  virtual hd : 'a
+  virtual tl : 'a lst
+  method map f =
+    (if self#null then
+       new nil ()
+     else
+       new cons (f self#hd) (self#tl#map f)
+     : 'a lst)
+  method iter (f : 'a -> unit) =
+    if self#null then ()
+    else begin
+      f self#hd;
+      self#tl#iter f
+    end
+  method print (f : 'a -> unit) = 
+    print_string "(";
+    self#iter (fun x -> f x; print_string "::");
+    print_string "[]";
+    print_string ")"
+and 'a nil () =
+  inherit ('a) lst ()
+  method null = true
+  method hd   = failwith "hd"
+  method tl   = failwith "tl"
+and 'a cons h t =
+  inherit ('a) lst ()
+  val h = h val t = t
+  method null = false
+  method hd   = h
+  method tl   = t
+end;;
+
+let l1 = new cons 3 (new cons 10 (new nil ()));;
+
+l1#print print_int;;
+
+let l2 = l1#map (fun x -> x + 1);;
+l2#print print_int;;
+
+let rec map_list f (x:'a lst) = 
+  if x#null then new nil() 
+  else new cons (f x#hd) (map_list f x#tl);;
+
+let p1 = (map_list (fun x -> new printable_color_point x "red") l1);;
+p1#print (fun x -> x#print);;
+
+(*******************************************************************)
+
+class virtual comparable () : 'a =
+  virtual leq : 'a -> bool
+  end;;
+
+class int_comparable (x : int) =
+  inherit comparable ()
+  val x = x
+  method x = x
+  method leq p = x <= p#x
+end;;
+
+class int_comparable2 x =
+  inherit int_comparable x
+  val private mutable x
+  method set_x y = x <- y
+end;;
+
+class 'a sorted_list () =
+  constraint 'a = #comparable
+  val mutable l = ([] : 'a list)
+  method add x =
+    let rec insert =
+      function
+            []     ->  [x]
+      | a::l as l' -> if a#leq x then a::(insert l) else x::l'
+    in
+      l <- insert l
+  method hd = List.hd l
+end;;
+
+let l = new sorted_list ();;
+let c = new int_comparable 10;;
+l#add c;;
+
+let c2 = new int_comparable2 15;;
+l#add (c2 :> int_comparable);;      (* Echec : 'a comp2 n'est un sous-type *)
+(new sorted_list ())#add c2;;
+
+class int_comparable3 (x : int) =
+  val mutable x = x
+  method leq (y : int_comparable) = x < y#x
+  method x = x
+  method setx y = x <- y
+end;;
+
+let c3 = new int_comparable3 15;;
+l#add (c3 :> int_comparable);;
+(new sorted_list ())#add c3;;   (* Echec : leq n'est pas binaire *)
+
+let sort (l : #comparable list) = Sort.list (fun x -> x#leq) l;;
+let pr l =
+  List.map (fun c -> print_int c#x; print_string " ") l;
+  print_newline ();;
+let l = [new int_comparable 5; (new int_comparable3 2 :> int_comparable);
+         new int_comparable 4];;
+pr l;;
+pr (sort l);;
+let l = [new int_comparable2 2; new int_comparable2 0];;
+pr l;;
+pr (sort l);;
+
+let min (x : #comparable) y =
+  if x#leq y then x else y;;
+
+(min (new int_comparable  7) (new int_comparable 11))#x;;
+(min (new int_comparable2 5) (new int_comparable2 3))#x;;
+
+(*******************************************************************)
+
+class 'a link (x : 'a) as self : 'b =
+  val mutable x = x
+  val mutable next = (None : 'b option)
+  method x = x
+  method  next = next
+  method  set_x y = x <- y
+  method  set_next l = next <- l
+  method  append l =
+    match next with
+      None ->
+        self#set_next l
+    | Some l' ->
+        l'#append l
+end;;
+
+class 'a double_link x as self =
+  inherit ('a) link x
+  val mutable prev = None
+  method prev = prev
+  method  set_next l =
+         next <- l;
+         match l with Some l -> l#set_prev (Some self) | None -> ()
+  method  set_prev l = prev <- l
+end;;
+
+let rec fold_right f (l : 'a #link option) accu =
+  match l with
+    None -> accu
+  | Some l ->
+      f l#x (fold_right f l#next accu);;
+
+(*******************************************************************)
+
+class calculator () as self =
+  val mutable arg = 0.
+  val mutable acc = 0.
+  val mutable equals = function s -> s#arg
+  method arg = arg
+  method acc = acc
+  method enter n = arg <- n; self
+  method add =
+    acc <- equals self;
+    equals <- (function s -> s#acc +. s#arg);
+    self
+  method sub =
+    acc <- equals self;
+    equals <- (function s -> s#acc -. s#arg);
+    self
+  method equals = equals self
+end;;
+
+((new calculator ())#enter 5.)#equals;;
+(((new calculator ())#enter 5.)#sub#enter 3.5)#equals;;
+((new calculator ())#enter 5.)#add#add#equals;;
+
+class calculator () as self =
+  val mutable arg = 0.
+  val mutable acc = 0.
+  val mutable equals = function s -> s#arg
+  method arg = arg
+  method acc = acc
+  method enter n = arg <- n; self
+  method add = {< acc = equals self; equals = function s -> s#acc +. s#arg >}
+  method sub = {< acc = equals self; equals = function s -> s#acc -. s#arg >}
+  method equals = equals self
+end;;
+
+((new calculator ())#enter 5.)#equals;;
+(((new calculator ())#enter 5.)#sub#enter 3.5)#equals;;
+((new calculator ())#enter 5.)#add#add#equals;;
+
+class calculator arg acc as self =
+  val arg = arg
+  val acc = acc
+  method enter n = new calculator n acc
+  method add = new calculator_add arg self#equals
+  method sub = new calculator_sub arg self#equals
+  method equals = arg
+and calculator_add arg acc =
+  inherit calculator arg acc
+  method enter n = new calculator_add n acc
+  method equals = acc +. arg
+and calculator_sub arg acc =
+  inherit calculator arg acc
+  method enter n = new calculator_sub n acc
+  method equals = acc -. arg
+end;;
+
+let calculator = new calculator 0. 0.;;
+
+(calculator#enter 5.)#equals;;
+((calculator#enter 5.)#sub#enter 3.5)#equals;;
+(calculator#enter 5.)#add#add#equals;;
diff --git a/testobjects/Makefile b/testobjects/Makefile
new file mode 100644 (file)
index 0000000..8470f90
--- /dev/null
@@ -0,0 +1,25 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1999 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the Q Public License version 1.0.                #
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.3 1999/11/17 18:58:45 xleroy Exp $
+
+# ocaml must be installed...
+
+test: Tests Exemples
+
+Tests:
+       TERM=dumb ../ocaml < Tests.ml | tail +3 > Tests.proc
+       - diff Tests.exp Tests.proc
+
+Exemples:
+       TERM=dumb ../ocaml < Exemples.ml | tail +3 > Exemples.proc
+       - diff Exemples.exp Exemples.proc
diff --git a/testobjects/Tests.exp b/testobjects/Tests.exp
new file mode 100644 (file)
index 0000000..c28ef5a
--- /dev/null
@@ -0,0 +1,228 @@
+#   - : < x : int > ->
+    < x : int > -> < x : int > -> < x : int > * < x : int > * < x : int >
+= <fun>
+#               class 'a c (unit) = constraint 'a = int method f : 'a c end
+class 'a d (unit) = method f : int c end
+#                 Characters 185-212:
+The type variable 'a is not bound in implicit type definition
+  d = < f : 'a -> unit >
+It should be captured by a class type parameter
+#             class virtual closed c ('a) : 'a = virtual f : int end
+class virtual closed d ('a) : 'a = virtual f : int end
+#     class virtual closed e ('a) : 'a = virtual f : int end
+#           class virtual closed c (c) = end
+#             class virtual c (unit) = end
+class 'a d (unit) = constraint 'a = < x : int; .. > method f : 'a -> int end
+#               class 'a c (unit) = constraint 'a = int end
+class 'a d (unit) = constraint 'a = int #c end
+#               class closed 'a c ('a) : 'a =
+  constraint 'a = < f : 'a c >
+  method f : 'a c
+end
+# - : (< f : 'a c > as 'a) c -> (< f : 'b c > as 'b) c = <fun>
+#           Characters 118-143:
+The class x should be virtual: its method f is undefined
+#               Characters 184-187:
+The class d inherits from the closed class c which has no method g
+#           Characters 37-97:
+The abbreviation c is used with parameters bool c
+wich are incompatible with constraints int c 
+#             class ('a, 'b) c (unit) =
+  constraint 'a = int -> 'c
+  constraint 'b = 'a * < x : 'b > * 'c * 'd
+  method f : 'a -> 'b -> unit
+end
+#     class ('a, 'b) d (unit) =
+  constraint 'a = int -> 'c
+  constraint 'b = 'a * < x : 'b > * 'c * 'd
+  method f : 'a -> 'b -> unit
+end
+#     val x : '_a list ref = {contents=[]}
+#     Characters 5-37:
+The type parameters of this class contains type variables that cannot be
+generalized: '_a list ref c
+#       type 'a c = < f : 'a c; g : 'a d > constraint 'a = int
+type 'a d = < f : 'a c > constraint 'a = int
+#   type 'a c = < f : 'a c; g : 'a d >
+type 'a d = < f : 'a c >
+#   type 'a c = < f : 'a c > constraint 'a = int
+type 'a d = < f : int c >
+#   type 'a u = < x : 'a > constraint 'a = 'b t
+type 'a t = 'a t u
+#   Characters 19-32:
+The type abbreviation t is cyclic
+# type 'a u = 'a
+# Characters 4-18:
+The type abbreviation t is cyclic
+#   type t = < x : t >
+# type 'a u = 'a
+# - : t -> t u -> bool = <fun>
+# - : t -> t u -> bool = <fun>
+#                         module M :
+  sig
+    class ('a, 'b) c ('c) ('b) =
+      constraint 'a = int -> bool
+      val x : 'd list
+      val y : 'b
+      method f : 'a -> unit
+      method g : 'b
+    end
+  end
+#                   module M' :
+  sig
+    class virtual ('a, 'b) c (int) ('b) =
+      constraint 'a = int -> bool
+      val x : float list
+      val y : 'b
+      method f : 'a -> unit
+      method g : 'b
+    end
+  end
+# class ('a, 'b) d (unit) ('b) =
+  constraint 'a = int -> bool
+  val x : 'c list
+  val y : 'b
+  method f : 'a -> unit
+  method g : 'b
+end
+# class ('a, 'b) e (unit) ('b) =
+  constraint 'a = int -> bool
+  val x : float list
+  val y : 'b
+  method f : 'a -> unit
+  method g : 'b
+end
+# - : string = "a"
+# Characters 1-9:
+One cannot create instances of the virtual class M'.c
+# - : int = 10
+# - : float = 7.1
+# # - : bool = true
+#     module M : sig class closed 'a c (unit) = method f : 'a -> unit end end
+#   module M' : sig class closed 'a c (unit) = method f : 'a -> unit end end
+# - : < f : 'a -> unit; .. > -> 'a M.c = <fun>
+# - : < f : 'a -> unit; .. > -> 'a M'.c = <fun>
+# class 'a c ('b #c) = end
+# class closed 'a c ('a c) = end
+#     class c (unit) = method f : int end
+class d (unit) = method f : int end
+# class e (unit) = method f : int end
+# - : int = 2
+# Characters 23-27:
+This expression has type bool but is here used with type int
+#   class c (unit) = method f : int method g : int method h : int end
+# class d (unit) = method h : int method i : int method j : int end
+#               class e (unit) =
+  method f : int
+  method g : int
+  method h : int
+  method i : int
+  method j : int
+end
+# val e : e = <obj>
+# - : int * int * int * int * int = 1, 3, 2, 2, 3
+#   class c ('a) = val a : 'a val x : int val y : int val z : int end
+# class d ('a) = val b : 'a val t : int val u : int val z : int end
+#                             class e (unit) =
+  val a : int
+  val b : int
+  val t : int
+  val u : int
+  val x : int
+  val y : int
+  val z : int
+  method a : int
+  method b : int
+  method t : int
+  method u : int
+  method x : int
+  method y : int
+  method z : int
+end
+# val e : e = <obj>
+# - : int * int * int * int * int * int * int = 1, 3, 2, 2, 3, 5, 7
+#             class c (int) (int) =
+  val x : int
+  val y : int
+  method x : int
+  method y : int
+end
+# class d (int) (int) =
+  val x : int
+  val y : int
+  method x : int
+  method y : int
+end
+# - : int * int = 1, 2
+# - : int * int = 1, 2
+#     class 'a c ('a) = end
+# - : 'a -> 'a c = <fun>
+#           module type M =
+  sig class c (unit) = val x : int end class d (unit) = val x : bool end end
+#         class c (int) = method get : int method set : int -> unit end
+# val c : c = <obj>
+# - : int = 5
+# - : int = 7
+#   class c (unit) = val x : int val y : int method c : int end
+# class d (unit) = val y : int method c : int method d : int end
+#     class e (unit) =
+  val x : int
+  val y : int
+  method c : int
+  method d : int
+  method x : int
+  method y : int
+end
+# - : int * int * int * int = 2, 1, 1, 1
+#                           module M : sig class c (unit) = method xc : int end end
+#         class d (unit) = val x : int method xc : int method xd : int end
+# - : int * int = 1, 2
+#         Characters 7-143:
+The type variable 'a is not bound in implicit type definition
+  'b matrix = < add : 'b matrix -> 'b; m : 'a >
+It should be captured by a class type parameter
+#   class c (unit) = method m : c end
+# - : c = <obj>
+# module M : sig class c (unit) = method m : c end end
+# - : M.c = <obj>
+#   type uu = | A of int | B of (< leq : 'a > as 'a)
+#   class virtual c (unit) : 'a = virtual m : 'a end
+#         module S : sig val f : (#c as 'a) -> 'a end
+#         Characters 12-43:
+Signature mismatch:
+Modules do not match:
+  sig val f : (#c as 'a) -> 'a end
+is not included in
+  sig val f : #c -> #c end
+Values do not match:
+  val f : (#c as 'a) -> 'a
+is not included in
+  val f : #c -> #c
+#   Characters 32-48:
+Multiple definition of the type name t.
+Names must be unique in a given structure.
+#   - : (< m : (< m : 'b -> 'b > as 'b) -> 'a; .. > as 'a) ->
+    (< m : 'c -> 'c > as 'c)
+= <fun>
+#   Characters 10-39:
+Type int -> bool is not a subtype of type int -> int
+Type bool is not a subtype of type int
+# Characters 9-40:
+Type int -> bool is not a subtype of type int -> int
+Type bool is not a subtype of type int
+# - : <  > -> <  > = <fun>
+# - : < .. > -> <  > = <fun>
+#   val x : '_a list ref = {contents=[]}
+#   module F : functor(X : sig end) -> sig type t = int end
+# - : < m : int > list ref = {contents=[]}
+#   type 'a t
+# - : ('a t as 'a) -> unit = <fun>
+# - : ('a t as 'a) -> unit = <fun>
+# type 'a t = < x : 'a >
+# - : (< x : 'a > as 'a) t -> unit = <fun>
+# - : (< x : 'a > as 'a) t -> unit = <fun>
+#         class c (unit) = private method m : int method n : int end
+#         class d (unit) = private method m : int method n : int method o : int end
+#   - : int * int = 1, 1
+#   class c (unit) = method m : int end
+# 
diff --git a/testobjects/Tests.ml b/testobjects/Tests.ml
new file mode 100644 (file)
index 0000000..29051fa
--- /dev/null
@@ -0,0 +1,316 @@
+(* Le sous-typage est "syntaxique" *)
+fun (x : < x : int >) y z -> (y :> 'a), (x :> 'a), (z :> 'a);;
+(* - : (< x : int > as 'a) -> 'a -> 'a * 'a = <fun> *)
+
+(* Bizarrerie du typage des classes *)
+class 'a c () =
+  method f = (new c (): int c)
+and 'a d () =
+  inherit ('a) c ()
+end;;
+(* class 'a c (unit) = constraint 'a = int method f : 'a c end *)
+(* class 'a d (unit) method f : int c end *)
+
+(* 'a libre dans classe d *)
+class 'a c () =
+  method f (x : 'a) = ()
+and d () =
+  inherit ('a) c ()
+end;;
+
+(* Ferme self ! *)
+(* Pas vraiment moyen de garder l'abbreviation en parametre *)
+class virtual closed c ((x : 'a): < f : int >) : 'a =
+and virtual closed d ((x : 'a): < f : int >) : 'a =
+  inherit c x
+end;;
+class virtual closed e x =
+  inherit d x
+end;;
+(* class virtual closed c (< f : int >) = virtual f : int end *)
+(* class virtual closed d (< f : int >) = virtual f : int end *)
+(* class virtual closed e (< f : int >) = virtual f : int end *)
+
+(* Self unifie avec une abreviation *)
+class virtual closed c ((x : 'a) : c) : 'a = end;;
+
+(* Instancie #c *)
+class virtual c () =
+and 'a d () =
+  constraint 'a = #c
+  method f (x : #c) = (x#x : int)
+end;;
+(* class virtual c (unit) = end
+   class 'a d (unit) = constraint 'a = < x: int; .. > method f : 'a -> int end *)
+
+class 'a c () =
+  constraint 'a = int
+and 'a d () =
+  constraint 'a = 'b #c
+end;;
+(* class 'a c (unit) = constraint 'a = int end
+   class 'a d (unit) = constraint 'a = int #c end *)
+
+(* Self en parametre *)
+class closed 'a c (x : 'a) as self : 'b =
+  constraint 'a = 'b
+  method f = self
+end;;
+new c;;
+(* class 'a c ('a) :'b = constraint 'a = 'a c method f : 'a end *)
+(* - : ('a c as 'a) -> 'b c as 'b = <fun> *)
+
+class x () =
+  virtual f : int
+end;;
+(* The class x should be virtual:  its methods f is undefined *)
+
+(* Methode g en trop *)
+class virtual closed c ((x : 'a): < f : int >) : 'a =
+and virtual closed d x : 'a =
+  inherit c x
+  method g = true
+end;;
+
+(* Contrainte non respectee *)
+class 'a c () =
+  constraint 'a = int
+  method f x = (x : bool c)
+end;;
+
+(* Differentes contraintes *)
+class ('a, 'b) c () =
+  constraint 'a = int -> 'c
+  constraint 'b = 'a * <x : 'b> * 'c * 'd
+  method f (x : 'a) (y : 'b) = ()
+end;;
+class ('a, 'b) d () =
+  inherit ('a, 'b) c ()
+end;;
+
+(* Contrainte non generique *)
+let x = ref [];;
+class 'a c () =
+  method f = (x : 'a)
+end;;
+
+(* Abreviations *)
+type 'a c = <f : 'a c; g : 'a d>
+and 'a d = <f : int c>;;
+type 'a c = <f : 'a c; g : 'a d>
+and 'a d = <f : 'a c>;;
+type 'a c = <f : 'a c>
+and 'a d = <f : int c>;;
+type 'a u = < x : 'a>
+and 'a t = 'a t u;;
+type 'a u = 'a
+and 'a t = 'a t u;;
+type 'a u = 'a;;
+type t = t u * t u;;
+
+type t = <x : 'a> as 'a;;
+type 'a u = 'a;;
+fun (x : t) (y : 'a u) -> x = y;;
+fun (x : t) (y : 'a u) -> y = x;;
+(* - : t -> t u -> bool = <fun> *)
+
+(* Modules *)
+module M =
+  struct
+    class ('a, 'b) c x (y: 'b) =
+      constraint 'a = int -> bool
+      val x = []
+      val y = y
+      method f (x : 'a) = ()
+      method g = y
+    end
+  end;;
+module M' = (M :
+  sig
+     class virtual ('a, 'b) c (int) ('b) =
+       constraint 'a = int -> bool
+       val x : float list
+       val y : 'b
+       method f : 'a -> unit
+       method g : 'b
+     end
+   end);;
+class ('a, 'b) d () y = inherit ('a, 'b) M.c () y end;;
+class ('a, 'b) e () y = inherit ('a, 'b) M'.c 1 y end;;
+(new M.c () "a")#g;;
+(new M'.c 1)#g;;
+(new d () 10)#g;;
+(new e () 7.1)#g;;
+open M;;
+(new c () true)#g;;
+
+(* #cl quand cl est fermee *)
+module M = struct class closed 'a c () = method f (x : 'a) = () end end;;
+module M' =
+  (M : sig class closed 'a c (unit) = method f : 'a -> unit end end);;
+fun x -> (x :> 'a #M.c);;
+fun x -> (x :> 'a #M'.c);;
+class 'a c (x : 'b #c) = end;;
+class closed 'a c (x : 'b #c) = end;;
+
+(* Ordre de calcul *)
+class c () = method f = 1 and d () = method f = 2 end;;
+class e () = inherit c () inherit d () end;;
+(new e ())#f;;
+class c () = val x = - true val y = -. () end;;
+
+class c () = method f = 1 method g = 1 method h = 1 end;;
+class d () = method h = 2 method i = 2 method j = 2 end;;
+class e () =
+  method f = 3
+  inherit c ()
+  method g = 3
+  method i = 3
+  inherit d ()
+  method j = 3
+end;;
+let e = new e ();;
+e#f, e#g, e#h, e#i, e#j;;
+
+class c a = val x = 1 val y = 1 val z = 1 val a = a end;;
+class d b = val z = 2 val t = 2 val u = 2 val b = b end;;
+class e () =
+  val x = 3
+  inherit c 5
+  val y = 3
+  val t = 3
+  inherit d 7
+  val u = 3
+  method x = x
+  method y = y
+  method z = z
+  method t = t
+  method u = u
+  method a = a
+  method b = b
+end;;
+let e = new e ();;
+e#x, e#y, e#z, e#t, e#u, e#a, e#b;;
+
+class c (x : int) (y : int) =
+  val x = x
+  val y = y
+  method x = x
+  method y = y
+end;;
+class d x y = inherit c x y end;;
+let c = new c 1 2 in c#x, c#y;;
+let d = new d 1 2 in d#x, d#y;;
+
+(* Parametres n'apparaissant pas dans le type de l'objet *)
+class 'a c (x : 'a) = end;;
+new c;;
+
+(* Variables privees *)
+module type M = sig
+  class c (unit) = val x : int end
+  class d (unit) = inherit c val private x : int val x : bool end
+end;;
+class c (x : int) =
+  val private mutable x = x
+  method get = x
+  method set y = x <- y
+end;;
+let c = new c 5;;
+c#get;;
+c#set 7; c#get;;
+
+class c () = val x = 1 val y = 1 method c = x end;;
+class d () = inherit c () val private x method d = x end;;
+class e () =
+  val x = 2 val y = 2 inherit d () method x = x method y = y
+end;;
+let e = new e () in e#x, e#y, e#c, e#d;;
+
+(* Oubli de variables dans l'interface *)
+module M :
+  sig
+    class c (unit) =
+      method xc : int
+    end
+  end =
+  struct
+    class c () =
+      val x = 1
+      method xc = x
+    end
+  end;;
+class d () =
+  val x = 2
+  method xd = x
+  inherit M.c ()
+end;;
+let d = new d () in d#xc, d#xd;;
+
+class virtual 'a matrix (sz, init : int * 'a) =
+  val m = Array.create_matrix sz sz init
+  method add (mtx : 'a matrix) = (mtx#m.(0).(0) : 'a)
+end;;
+
+class c () = method m = new c () end;;
+(new c ())#m;;
+module M = struct class c () = method m = new c () end end;;
+(new M.c ())#m;;
+
+type uu = A of int | B of (<leq: 'a> as 'a);;
+
+class virtual c () : 'a = virtual m : 'a end;;
+module S = (struct
+  let f (x : #c) = x
+end : sig
+  val f : #c as 'a -> 'a
+end);;
+module S = (struct
+  let f (x : #c) = x
+end : sig
+  val f : #c -> #c
+end);;
+
+module M = struct type t = int class t () = end end;;
+
+fun x -> (x :> < m : 'a -> 'a > as 'a);;
+
+fun x -> (x : int -> bool :> 'a -> 'a);;
+fun x -> (x : int -> bool :> int -> int);;
+fun x -> (x : < > :> < .. >);;
+fun x -> (x : < .. > :> < >);;
+
+let x = ref [];;
+module F(X : sig end) =
+  struct type t = int let _ = (x : < m : t> list ref) end;;
+x;;
+
+type 'a t;;
+fun (x : 'a t as 'a) -> ();;
+fun (x : 'a t) -> (x : 'a); ();;
+type 'a t = < x : 'a >;;
+fun (x : 'a t as 'a) -> ();;
+fun (x : 'a t) -> (x : 'a); ();;
+
+class 'a c () =
+  constraint 'a = < .. > -> unit
+  method m = (fun x -> () : 'a)
+end;;
+class 'a c () =
+  constraint 'a = unit -> < .. >
+  method m (f : 'a) = f ()
+end;;
+
+class c () as self =
+  private method m = 1
+  method n = self#m
+end;;
+
+class d () as self =
+  inherit c ()
+  method o = self#m
+end;;
+
+let x = new d () in x#n, x#o;;
+
+class c () = virtual m : int private method m = 1 end;;
index 7d7d63c99ca527902f3209fb895f3dc5a2c6f7b1..b68227d79393e41a5b79854f316f1d132cd89648 100644 (file)
@@ -10,7 +10,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile,v 1.61.2.1 2005/11/17 14:26:37 doligez Exp $
+# $Id: Makefile,v 1.61.2.2 2006/07/25 09:00:15 doligez Exp $
 
 include ../config/Makefile
 
@@ -195,7 +195,9 @@ clean::
        rm -f dumpobj
 
 opnames.ml: ../byterun/instruct.h
-       unset LC_ALL LC_CTYPE LC_COLLATE LANG; \
+       unset LC_ALL || : ; \
+       unset LC_CTYPE || : ; \
+       unset LC_COLLATE LANG || : ; \
        sed -e '/\/\*/d' \
             -e '/^#/d' \
             -e 's/enum \(.*\) {/let names_of_\1 = [|/' \
index c0d2cb969df1cd7e73c6f95e0fc3a2f4517b5988..db42d82a3252e19152aa78917bc1eb2e38ee6051 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamldep.ml,v 1.36 2005/03/24 17:20:54 doligez Exp $ *)
+(* $Id: ocamldep.ml,v 1.36.4.1 2006/05/02 14:54:35 guesdon Exp $ *)
 
 open Format
 open Location
@@ -58,7 +58,7 @@ let find_dependency modname (byt_deps, opt_deps) =
   try
     let filename = find_file (modname ^ ".mli") in
     let basename = Filename.chop_suffix filename ".mli" in
-    let optname = 
+    let optname =
       if Sys.file_exists (basename ^ ".ml")
       then basename ^ ".cmx"
       else basename ^ ".cmi" in
index 1a08690dcb0f3e3bd2ff3d357177cac34f14408a..9bdd09a0876d619604a82a0ca511eb9d65b4ec77 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ocamlprof.ml,v 1.38 2005/03/24 17:20:54 doligez Exp $ *)
+(* $Id: ocamlprof.ml,v 1.38.4.1 2006/05/02 14:54:35 guesdon Exp $ *)
 
 open Printf
 
@@ -100,7 +100,7 @@ let special_id = ref ""
 let add_val_counter (kind,pos) =
   if kind = Open then begin
     copy pos;
-    fprintf !outchan "(* %s%d *) " !special_id !counters.(!prof_counter); 
+    fprintf !outchan "(* %s%d *) " !special_id !counters.(!prof_counter);
     incr prof_counter;
   end
 ;;
@@ -129,7 +129,7 @@ let init_rewrite modes mod_name =
     fprintf !outchan "module %sProfiling = Profiling;; " modprefix;
     fprintf !outchan "let %s%s_cnt = Array.create 000000000" idprefix mod_name;
     pos_len := pos_out !outchan;
-    fprintf !outchan 
+    fprintf !outchan
             " 0;; Profiling.counters := \
               (\"%s\", (\"%s\", %s%s_cnt)) :: !Profiling.counters;; "
             mod_name modes idprefix mod_name;
@@ -235,7 +235,7 @@ and rw_exp iflag sexp =
       rewrite_exp iflag scond;
       rewrite_ifbody iflag sexp.pexp_loc.loc_ghost sifso;
       rewrite_ifbody iflag sexp.pexp_loc.loc_ghost sifnot
-      
+
   | Pexp_sequence(sexp1, sexp2) ->
     rewrite_exp iflag sexp1;
     rewrite_exp iflag sexp2
@@ -296,7 +296,7 @@ and rewrite_annotate_exp_list l =
   List.iter
     (function
      | {pexp_desc = Pexp_when(scond, sbody)}
-        -> insert_profile rw_exp scond; 
+        -> insert_profile rw_exp scond;
            insert_profile rw_exp sbody;
      | {pexp_desc = Pexp_constraint(sbody, _, _)} (* let f x : t = e *)
         -> insert_profile rw_exp sbody
@@ -307,7 +307,7 @@ and rewrite_function iflag = function
   | [spat, ({pexp_desc = Pexp_function _} as sexp)] -> rewrite_exp iflag sexp
   | l -> rewrite_funmatching l
 
-and rewrite_funmatching l = 
+and rewrite_funmatching l =
   rewrite_annotate_exp_list (List.map snd l)
 
 and rewrite_trymatching l =
@@ -449,6 +449,11 @@ open Format
 
 let usage = "Usage: ocamlprof <options> <files>\noptions are:"
 
+let print_version () =
+  printf "ocamlprof, version %s@." Sys.ocaml_version;
+  exit 0;
+;;
+
 let main () =
   try
     Arg.parse [
@@ -461,7 +466,9 @@ let main () =
        "-instrument", Arg.Set instr_mode, "  (undocumented)";
        "-intf", Arg.String process_intf_file,
                 "<file>  Process <file> as a .mli file";
-       "-m", Arg.String (fun s -> modes := s), "<flags>    (undocumented)"
+       "-m", Arg.String (fun s -> modes := s), "<flags>    (undocumented)";
+       "-version", Arg.Unit print_version,
+                   "     Print version and exit";
       ] process_anon_file usage;
     exit 0
   with x ->
index c2e79d3b478d8ebe119cd774e4426200e993dc72..e6d7df5cef6f54e2e769a370171277512234c848 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ctype.ml,v 1.197.2.6 2005/12/15 02:28:38 garrigue Exp $ *)
+(* $Id: ctype.ml,v 1.197.2.8 2006/06/23 03:02:19 garrigue Exp $ *)
 
 (* Operations on core types *)
 
@@ -1105,6 +1105,13 @@ let expand_abbrev env ty =
   | _ ->
       assert false
 
+let safe_abbrev env ty =
+  let snap = Btype.snapshot () in
+  try ignore (expand_abbrev env ty); true
+  with Cannot_expand | Unify _ ->
+    Btype.backtrack snap;
+    false
+
 (* Fully expand the head of a type.
    Raise Cannot_expand if the type cannot be expanded.
    May raise Unify, if a recursion was hidden in the type. *)
@@ -1128,7 +1135,10 @@ let expand_head_once env ty =
   try expand_abbrev env (repr ty) with Cannot_expand -> assert false
 
 (* Fully expand the head of a type. *)
-let rec expand_head env ty =
+let expand_head_unif env ty =
+  try try_expand_head env ty with Cannot_expand -> repr ty
+
+let expand_head env ty =
   let snap = Btype.snapshot () in
   try try_expand_head env ty
   with Cannot_expand | Unify _ -> (* expand_head shall never fail *)
@@ -1506,8 +1516,8 @@ let rec unify env t1 t2 =
 and unify2 env t1 t2 =
   (* Second step: expansion of abbreviations *)
   let rec expand_both t1'' t2'' =
-    let t1' = expand_head env t1 in
-    let t2' = expand_head env t2 in
+    let t1' = expand_head_unif env t1 in
+    let t2' = expand_head_unif env t2 in
     (* Expansion may have changed the representative of the types... *)
     if t1' == t1'' && t2' == t2'' then (t1',t2') else
     expand_both t1' t2'
@@ -1600,7 +1610,7 @@ and unify3 env t1 t1' t2 t2' =
       match t2.desc with
         Tconstr (p, tl, abbrev) ->
           forget_abbrev abbrev p;
-          let t2'' = expand_head env t2 in
+          let t2'' = expand_head_unif env t2 in
           if not (closed_parameterized_type tl t2'') then
             link_type (repr t2) (repr t2')
       | _ ->
@@ -1684,13 +1694,15 @@ and unify_row env row1 row2 =
   let rm1 = row_more row1 and rm2 = row_more row2 in
   if rm1 == rm2 then () else
   let r1, r2, pairs = merge_row_fields row1.row_fields row2.row_fields in
-  ignore (List.fold_left
-            (fun hl l ->
-              let h = hash_variant l in
-              try raise(Tags(l,List.assoc h hl))
-              with Not_found -> (h,l)::hl)
-            (List.map (fun (l,_) -> (hash_variant l, l)) row1.row_fields)
-            (List.map fst r2));
+  if r1 <> [] && r2 <> [] then begin
+    let ht = Hashtbl.create (List.length r1) in
+    List.iter (fun (l,_) -> Hashtbl.add ht (hash_variant l) l) r1;
+    List.iter
+      (fun (l,_) ->
+        try raise (Tags(l, Hashtbl.find ht (hash_variant l)))
+        with Not_found -> ())
+      r2
+  end;
   let more =
     if row1.row_fixed then rm1 else
     if row2.row_fixed then rm2 else
@@ -1849,7 +1861,7 @@ let unify env ty1 ty2 =
    (2) the original label is not optional
 *)
 let rec filter_arrow env t l =
-  let t = expand_head env t in
+  let t = expand_head_unif env t in
   match t.desc with
     Tvar ->
       let t1 = newvar () and t2 = newvar () in
@@ -1892,7 +1904,7 @@ let rec filter_method_field env name priv ty =
 
 (* Unify [ty] and [< name : 'a; .. >]. Return ['a]. *)
 let rec filter_method env name priv ty =
-  let ty = expand_head env ty in
+  let ty = expand_head_unif env ty in
   match ty.desc with
     Tvar ->
       let ty1 = newvar () in
@@ -1966,8 +1978,8 @@ let rec moregen inst_nongen type_pairs env t1 t2 =
     | (Tconstr (p1, [], _), Tconstr (p2, [], _)) when Path.same p1 p2 ->
         ()
     | _ ->
-        let t1' = expand_head env t1 in
-        let t2' = expand_head env t2 in
+        let t1' = expand_head_unif env t1 in
+        let t2' = expand_head_unif env t2 in
         (* Expansion may have changed the representative of the types... *)
         let t1' = repr t1' and t2' = repr t2' in
         if t1' == t2' then () else
@@ -2213,8 +2225,8 @@ let rec eqtype rename type_pairs subst env t1 t2 =
     | (Tconstr (p1, [], _), Tconstr (p2, [], _)) when Path.same p1 p2 ->
         ()
     | _ ->
-        let t1' = expand_head env t1 in
-        let t2' = expand_head env t2 in
+        let t1' = expand_head_unif env t1 in
+        let t2' = expand_head_unif env t2 in
         (* Expansion may have changed the representative of the types... *)
         let t1' = repr t1' and t2' = repr t2' in
         if t1' == t2' then () else
@@ -2700,7 +2712,8 @@ let rec build_subtype env visited loops posi level t =
       if c > Unchanged then (newty (Ttuple (List.map fst tlist')), c)
       else (t, Unchanged)
   | Tconstr(p, tl, abbrev)
-    when level > 0 && generic_abbrev env p && not (has_constr_row' env t) ->
+    when level > 0 && generic_abbrev env p && safe_abbrev env t
+    && not (has_constr_row' env t) ->
       let t' = repr (expand_abbrev env t) in
       let level' = pred_expand level in
       begin try match t'.desc with
@@ -2740,7 +2753,8 @@ let rec build_subtype env visited loops posi level t =
       let visited = t :: visited in
       begin try
         let decl = Env.find_type p env in
-        if level = 0 && generic_abbrev env p && not (has_constr_row' env t)
+        if level = 0 && generic_abbrev env p && safe_abbrev env t
+        && not (has_constr_row' env t)
         then warn := true;
         let tl' =
           List.map2
@@ -2871,9 +2885,11 @@ let rec subtype_rec env trace t1 t2 cstrs =
         subtype_list env trace tl1 tl2 cstrs
     | (Tconstr(p1, [], _), Tconstr(p2, [], _)) when Path.same p1 p2 ->
         cstrs
-    | (Tconstr(p1, tl1, abbrev1), _) when generic_abbrev env p1 ->
+    | (Tconstr(p1, tl1, abbrev1), _)
+      when generic_abbrev env p1 && safe_abbrev env t1 ->
         subtype_rec env trace (expand_abbrev env t1) t2 cstrs
-    | (_, Tconstr(p2, tl2, abbrev2)) when generic_abbrev env p2 ->
+    | (_, Tconstr(p2, tl2, abbrev2))
+      when generic_abbrev env p2 && safe_abbrev env t2 ->
         subtype_rec env trace t1 (expand_abbrev env t2) cstrs
     | (Tconstr(p1, tl1, _), Tconstr(p2, tl2, _)) when Path.same p1 p2 ->
         begin try
@@ -3063,8 +3079,9 @@ let cyclic_abbrev env id ty =
         p = Path.Pident id || List.memq ty seen ||
         begin try
           check_cycle (ty :: seen) (expand_abbrev env ty)
-        with Cannot_expand ->
-          false
+        with
+          Cannot_expand -> false
+        | Unify _ -> true
         end
     | _ ->
         false
index 0c7158ae231538d241ac07608c9f94841c7b4bfd..7451899d783e6c2ca9d3415246dac4f82e84a2d1 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: includemod.ml,v 1.37 2005/08/13 20:59:37 doligez Exp $ *)
+(* $Id: includemod.ml,v 1.37.2.1 2006/06/23 01:22:26 garrigue Exp $ *)
 
 (* Inclusion checks for the module language *)
 
@@ -35,6 +35,7 @@ type error =
   | Class_declarations of
       Ident.t * class_declaration * class_declaration *
       Ctype.class_match_failure list
+  | Unbound_modtype_path of Path.t
 
 exception Error of error list
 
@@ -89,7 +90,7 @@ let expand_module_path env path =
   try
     Env.find_modtype_expansion path env
   with Not_found ->
-    raise Dont_match
+    raise(Error[Unbound_modtype_path path])
 
 (* Extract name, kind and ident from a signature item *)
 
@@ -377,6 +378,8 @@ let include_err ppf = function
       (Printtyp.class_declaration id) d1
       (Printtyp.class_declaration id) d2
       Includeclass.report_error reason
+  | Unbound_modtype_path path ->
+      fprintf ppf "Unbound module type %a" Printtyp.path path
 
 let report_error ppf = function
   |  [] -> ()
index 1a68ea0f2c9045807f5621a2fbe8ed9af3ebc03d..25521c123c619952a737092b9eff2c92a3b709bb 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: includemod.mli,v 1.12 2000/03/06 22:12:00 weis Exp $ *)
+(* $Id: includemod.mli,v 1.12.42.1 2006/06/23 01:22:27 garrigue Exp $ *)
 
 (* Inclusion checks for the module language *)
 
@@ -40,6 +40,7 @@ type error =
   | Class_declarations of
       Ident.t * class_declaration * class_declaration *
       Ctype.class_match_failure list
+  | Unbound_modtype_path of Path.t
 
 exception Error of error list
 
index b2e2df4123ff928bab243447b827935bf6e9b146..d38c3a2223fa6185ceede7b6d847e80f73824187 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typecore.ml,v 1.176.2.4 2006/02/21 00:58:10 garrigue Exp $ *)
+(* $Id: typecore.ml,v 1.176.2.5 2006/05/01 01:16:28 garrigue Exp $ *)
 
 (* Typechecking for the core language *)
 
@@ -917,16 +917,18 @@ let rec type_exp env sexp =
         end_def ();
         generalize_structure funct.exp_type
       end;
-      let rec lower_args ty_fun =
-        match (expand_head env ty_fun).desc with
-          Tarrow (l, ty, ty_fun, com) ->
-            unify_var env (newvar()) ty;
-            lower_args ty_fun
+      let rec lower_args seen ty_fun =
+        let ty = expand_head env ty_fun in
+        if List.memq ty seen then () else
+        match ty.desc with
+          Tarrow (l, ty_arg, ty_fun, com) ->
+            unify_var env (newvar()) ty_arg;
+            lower_args (ty::seen) ty_fun
         | _ -> ()
       in
       let ty = instance funct.exp_type in
       end_def ();
-      lower_args ty;
+      lower_args [] ty;
       begin_def ();
       let (args, ty_res) = type_application env funct sargs in
       end_def ();
index 38bc97b6832f8e9024dfc7529e37bc4f6b2f9a7c..1396ef6e91f599d5db19cdabfefb85e4e605a6c5 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typemod.ml,v 1.73 2005/08/08 09:41:51 xleroy Exp $ *)
+(* $Id: typemod.ml,v 1.73.2.1 2006/04/21 06:18:51 garrigue Exp $ *)
 
 (* Type-checking of the module language *)
 
@@ -95,7 +95,8 @@ let merge_constraint initial_env loc sg lid constr =
            type_kind = Type_abstract;
            type_manifest = None;
            type_variance =
-             List.map (fun (c,n) -> (c,n,n)) sdecl.ptype_variance }
+             List.map (fun (c,n) -> (not n, not c, not c))
+             sdecl.ptype_variance }
        and id_row = Ident.create (s^"#row") in
        let initial_env = Env.add_type id_row decl_row initial_env in
         let newdecl = Typedecl.transl_with_constraint
index c16acd7c6d58cb8b2199b26969e790bc09a193dd..8c954e4f410913d1bcf28d1e93c507e59bd263c9 100644 (file)
@@ -97,7 +97,10 @@ type policy = Fixed | Extensible | Univars
 let rec transl_type env policy styp =
   match styp.ptyp_desc with
     Ptyp_any ->
-      if policy = Univars then new_pre_univar () else newvar ()
+      if policy = Univars then new_pre_univar () else
+      if policy = Fixed then
+        raise (Error (styp.ptyp_loc, Unbound_type_variable "_"))
+      else newvar ()
   | Ptyp_var name ->
       if name <> "" && name.[0] = '_' then
         raise (Error (styp.ptyp_loc, Invalid_variable_name ("'" ^ name)));
@@ -330,18 +333,17 @@ let rec transl_type env policy styp =
               raise(Error(styp.ptyp_loc, Present_has_no_type l)))
             present
       end;
-      ignore begin
-        List.fold_left
-          (fun hl (l,_) ->
-            let h = Btype.hash_variant l in
-            try
-              let l' = List.assoc h hl in
-              if l <> l' then raise(Error(styp.ptyp_loc, Variant_tags(l, l')));
-              hl
-            with Not_found -> (h,l) :: hl)
-          []
-          fields
-      end;
+      (* Check for tag conflicts *)
+      let ht = Hashtbl.create (List.length fields + 1) in
+      List.iter
+        (fun (l,_) ->
+          let h = Btype.hash_variant l in
+          try
+            let l' = Hashtbl.find ht h in
+            if l <> l' then raise(Error(styp.ptyp_loc, Variant_tags(l, l')))
+          with Not_found ->
+            Hashtbl.add ht h l)
+        fields;
       let row =
         { row_fields = List.rev fields; row_more = newvar ();
           row_bound = !bound; row_closed = closed;