Object disoriented Turing-completeness proof

From Esolang
Jump to navigation Jump to search

This is an untested Brainfuck interpreter, written in Object_disoriented, to prove its turing completeness. Insert ] after the brainfuck program to mean the program's end and the start of the input.

e brainfuck interpreter in object disoriented, beta.

dmpair.
  r n
    r n
      cat cba ctb rb
    ap
  pz
zz

dconcat.
  rn
    rn
       rfbfap
    ap
  pz
zz

done.
  fpz rz
zz

dpush.
  rn
    rn
      cbs
      ra
    ap
  pz
zz


darraynext.
  cfpz a
  cfpz b
  cfazt
  cfflpush. t b b
  cfflmpair. a b p
  rz
zz

darrayprev.
  cfpz a
  cfpz b
  cfbzt
  cfflpush. t a a
  cfflmpair. a b p
  rz
zz

darraywrite.
  cfpz a
  cfpz b
  cfazt
  rt
zz

darraywrite.
  cfpz a
  cfpz b
  faz
  cfflpush.taa
zz

dinc8.
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. tb fflxor. tb t
  cfflpush. ftz a  cftz b
  flflip8.a
  cap
  rz
zz

ddec8.
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  cfpzt  cfflmpair. ffland. flnot.t b ffland. t flnot.b t
  cfflpush. ftz a  cftz b
  flflip8.a
  cap
  rz
zz

dflip8.
  cfflpush. fpz a a
  cfflpush. fpz a a
  cfflpush. fpz a a
  cfflpush. fpz a a
  cfflpush. fpz a a
  cfflpush. fpz a a
  cfflpush. fpz a a
  cfflpush. fpz a a
  cap
  rz
zz

disnonzero8.
  cpt
  c fflor.ftz a a
  c fflor.ftz a a
  c fflor.ftz a a
  c fflor.ftz a a
  c fflor.ftz a a
  c fflor.ftz a a
  c fflor.ftz a a
  c fflor.ftz a a
  ra
zz

doutput8.
  cpa
  flflip8.a
  ofaz
  ofaz
  ofaz
  ofaz
  ofaz
  ofaz
  ofaz
  ofaz
  rz
zz

dinput8.
  cafflpush. i a
  cafflpush. i a
  cafflpush. i a
  cafflpush. i a
  cafflpush. i a
  cafflpush. i a
  cafflpush. i a
  ra
zz

e  ascii hex   dec   bin       key   op
   +     2B    43    00101011  0011  increment
   -     2D    45    00101101  0001  decrement
   <     3C    60    00111100  0100  previous
   >     3E    62    00111110  0110  next
   ,     2C    44    00101100  0000  input
   dot   2E    46    00101110  0010  output
   [     5B    91    01011011  1 11  loop start 
   ]     5D    93    01011101  1 10  loop end, program end
.

dcheck+.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  ra
zz

dcheck-.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  ra
zz

dcheck<.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  ra
zz

dcheck>.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  ra
zz

dcheck,.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  ra
zz

dcheckdot.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  ra
zz

dcheck[.
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  ra
zz

dcheck].
  cpt
  flflip8.t
  calone.
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.f      tz a a
  c ffland.fflnot.tz a a
  c ffland.f      tz a a
  ra
zz



dand.
  cafflmpair. z p
  rn
    fpa
    rfaz
  az
zz

dor.
  cafflmpair. p lone.
  rn
    fpa
    rfaz
  az
zz

dxor.
  rn
    c fflmpair. z lone. t
    fat
    fpt
    rftz
  pz
zz

dnot.
  c fflmpair. lone. z t
  fpt
  rftz
zz

dopinc.
  cflarrayread. p a
  flinc8. a
  fflarraywrite. a p
  rp
zz

dopdec.
  cflarrayread. p a
  fldec8. a
  fflarraywrite. a p
  rp
zz

dopnext.
  flarraynext. p
  rp
zz

dopprev.
  flarrayprev. p
  rp
zz

dopin.
  fflarraywrite. flinput8.z p
  rp
zz

dopout.
  cflarrayread. p a
  floutput8.a
  rp
zz

dmakeloop1.
  rn
    fap
    c flarrayread. p t
    c flisnonzero8. t t
    c fft fflmpair. nrpzz s z t
    rftp
  pz
zz

dmakeloop.
  rn
    c flarrayread. p t
    c flisnonzero8. t t
    c fft fflmpair. z a t
    rftp
  fmakeloop1.pz
zz

dconstruct.
  c flinput8. a
  c fflconcat p flconstructop.a b
  c f flcheck[.a fflmpair. b fflconcat b flmakeloop. flconstruct.z b zt
  c f flcheck].a fflmpair. s nrpzz zt
  rftb
zz

dconstructop.
  cpa
  c f flcheck+.a   fflmpair. t lopinc.  z t
  c f flcheck-.a   fflmpair. t lopdec.  z t
  c f flcheck<.a   fflmpair. t lopprev. z t
  c f flcheck>.a   fflmpair. t lopnext. z t
  c f flcheckdot.a fflmpair. t lopout.  z t
  c f flcheck,.a   fflmpair. t lopin.   z t
  rt
zz

dmain.
  cflconstruct.za
  faz
zz