Skip to main content
golf 107
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

Lazy K, 5891 58615861 5841 bytes

````ssk``s``si``s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`k
s``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``
si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks`ki`
`s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si
`ks``s``si`kk``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks`ki`kk``s``si`kk`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si
`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks
``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s`
`si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks
``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks
`ki`kk``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s`
`si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
`kk``s``si`ks`ki``s``si``s``si``s``si`ks`ks``s``si`ks``s``si``s``si`ks``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki`ki`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si`kk``s``si
`kk`ks``s``si`kk`kk``s``si`kk`kk``s``si``s``si`ks`ki`ki``s``si`kk`kk``s``si``s``
si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s`
`si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``s
i`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``s
i`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``
s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ks`ks``s``si``s``
si`ks``s``si`kk`ks`kk``s``si``s``si`ks`ki``s``si``s``si`ks`ki`ki``s``si``s``si`k
s``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`k
k``s``si``s``si`ks``s``si`kk`ks`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s
``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``
s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`k
k``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``
s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``
s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``s``si`ks`ks``s``si`k
k`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`k
s``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``s
i``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``s
i`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si``s``si`ks`ks`k
i``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki`ks``s``si``s``si`ks``s``s
i``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ki``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki`ks`ks``s``si``s``si`ks``s``s
s`ks``s``si`kk`ki``s``si``s``si``s``si`ks`ks``s``si``s``si`ks`ks`ki``s``si``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki``s``si``s``si`ks`ks``s``si`kk`ki
i`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``s
``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s
i`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``s
``si``s``si`ks``s``si`kk`ks`kk``s``si`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`i`kk`ks`kk``s``si`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``
ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si``s``si``s``si`ks`ki``s``si`ks``s``si`kk`ki``s``si`kk``s``si``s``si``s``si`ks`ki``s``si`ks``s``si`kk``s``si``s``si`
si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``s`
`s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si``s``si`ks``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si``s``si`ks``s``si``s``si`ks``s`
`s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks`ki`ki``s``si`kk``s``si`k`si`kk`ks`kk`ki`kk``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``si``s``si``s``
k``s``si``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``ssi`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si``s``s
i`kk`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`ki`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``s
k``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si``i``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``
s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk`ks``s``si`k
s``si`kk`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``k`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`
si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si
`si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk
``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s
``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s
``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s
``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki
``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`ks
``si`kk`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk
``si`kk`ks``s``si`kk`ki``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``ki``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si
`si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s``si`ks``s``kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si
`si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si`kk`ki``s``si`kk
``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ks``s``si``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk``s``si`kk``s``si
`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ki``s``si`kk``s``si``s``si`ks`ki``s```s``si`ks`ki``s``si`kk`ki``s``si`kk``s``si``s``si`ks`ki``s``si`kk`kk``s``si`kk`
`si`kk`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk`kk`kk``s``si`
`si`kk`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``skk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si`kk`ki
``si`kk``s``si`kk`kiii

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 57, 107 is reduced from 91 bytes to 7369, and 115 is reduced from 89 bytes to 57. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Lazy K, 5891 5861 bytes

````ssk``s``si``s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`k
s``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``
si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks`ki`
`s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si
`ks``s``si`kk``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks`ki`kk``s``si`kk`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si
`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks
``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s`
`si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks
``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks
`ki`kk``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s`
`si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
`kk``s``si`ks`ki``s``si``s``si``s``si`ks`ks``s``si`ks``s``si``s``si`ks``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki`ki`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si`kk``s``si
`kk`ks``s``si`kk`kk``s``si`kk`kk``s``si``s``si`ks`ki`ki``s``si`kk`kk``s``si``s``
si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s`
`si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``s
i`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``s
i`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``
s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ks`ks``s``si``s``
si`ks``s``si`kk`ks`kk``s``si``s``si`ks`ki``s``si``s``si`ks`ki`ki``s``si``s``si`k
s``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`k
k``s``si``s``si`ks``s``si`kk`ks`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s
``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``
s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`k
k``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``
s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``
s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``s``si`ks`ks``s``si`k
k`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`k
s``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``s
i``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``s
i`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si``s``si`ks`ks`k
i``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki`ks``s``si``s``si`ks``s``s
i``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`k
s`ks``s``si`kk`ki``s``si``s``si``s``si`ks`ks``s``si``s``si`ks`ks`ki``s``si``s``s
i`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s
``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``s
i`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks`ki``s``si`kk``s
``si``s``si`ks``s``si`kk`ks`kk``s``si`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`
ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si``s``si``s``si`ks`ki``s``si`ks``s``
si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si`
`s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si``s``si`ks`
`s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks`ki`ki``s``si`kk``s``si`k
k``s``si``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``s
i`kk`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si``
s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``
s``si`kk`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``
si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s`
`si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s
``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s
``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s
``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s
``si`kk`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s
``si`kk`ks``s``si`kk`ki``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s`
`si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s``si`ks``s`
`si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s
``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ks``s``si
`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ki``s``si`kk``s``si``s``si`ks`ki``s`
`si`kk`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s`
`si`kk`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s
``si`kk``s``si`kk`kii

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 57, 107 is reduced from 91 bytes to 73, and 115 is reduced from 89 bytes to 57. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Lazy K, 5891 5861 5841 bytes

````ssk``s``si``s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`k
s``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``
si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks`ki`
`s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si
`ks``s``si`kk``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks`ki`kk``s``si`kk`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si
`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks
``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s`
`si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks
``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks
`ki`kk``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s`
`si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
`kk``s``si`ks`ki``s``si``s``si``s``si`ks`ks``s``si`ks``s``si``s``si`ks``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki`ki`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si`kk``s``si
`kk`ks``s``si`kk`kk``s``si`kk`kk``s``si``s``si`ks`ki`ki``s``si`kk`kk``s``si``s``
si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s`
`si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``s
i`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``s
i`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``
s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ks`ks``s``si``s``
si`ks``s``si`kk`ks`kk``s``si``s``si`ks`ki``s``si``s``si`ks`ki`ki``s``si``s``si`k
s``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`k
k``s``si``s``si`ks``s``si`kk`ks`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s
``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``
s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`k
k``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``
s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``
s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``s``si`ks`ks``s``si`k
k`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`k
s``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``s
i``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``s
i`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si``s``si`ks`ks`k
i``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki`ks``s``si``s``si`ks``s``s
i``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki`ks`ks``s``si``s``si`ks``s``s
i``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki``s``si``s``si`ks`ks``s``si`kk`ki
``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``s
i`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s
``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``s
i`kk`ks`kk``s``si`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``
si`kk`ki``s``si`kk``s``si``s``si``s``si`ks`ki``s``si`ks``s``si`kk``s``si``s``si`
ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``s`
`si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si``s``si`ks``s``si``s``si`ks``s`
`si`kk`ks`kk`ki`kk``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``si``s``si``s``
si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si``s``s
i`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``s
i``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``
si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk`ks``s``si`k
k`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`
`s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si
`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s
``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s
``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`ks
``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk
`ki``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si
`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si
``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si`kk`ki``s``si`kk
``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk``s``si`kk``s``si
``s``si`ks`ki``s``si`kk`ki``s``si`kk``s``si``s``si`ks`ki``s``si`kk`kk``s``si`kk`
`s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk`kk`kk``s``si`
kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si`kk`ki
i

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 57, 107 is reduced from 91 bytes to 69, and 115 is reduced from 89 bytes to 57. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

more golfs + rewordings
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

Lazy K, 58915891 5861 bytes

````ssk``s``si``s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`k
s``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``
si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks`ki`
`s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si
`ks``s``si`kk``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks`ki`kk``s``si`kk`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si
`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks
``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s`
`si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks
``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks
`ki`kk``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s`
`si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
`kk``s``si`ks`ki``s``si``s``si``s``si`ks`ks``s``si`ks``s``si``s``si`ks``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki`ki`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si`kk``s``si
`kk`ks``s``si`kk`kk``s``si`kk`kk``s``si``s``si`ks`ki`ki``s``si`kk`kk``s``si``s``
si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s`
`si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``s
i`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``s
i`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``
s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ks`ks``s``si``s``
si`ks``s``si`kk`ks`kk``s``si``s``si`ks`ki``s``si``s``si`ks`ki`ki``s``si``s``si`k
s``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`k
k``s``si``s``si`ks``s``si`kk`ks`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s
``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``
s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`k
k``s``si``s``si``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks`kk`ki``s``si``s``
si`ks``s``si`kk``s``si`ks`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``k``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``
s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``
s``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``ss``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``s``si`ks`ks``s``si`k
i`kk``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``k`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`k
s``s``si``s``si`ks`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``ss``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``s
i`kk`ki``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ki``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``s
s``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`ki`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si``s``si`ks`ks`k
k`ki`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``i``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki`ks``s``si``s``si`ks``s``s
s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si``s``si``s``si`ks`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`k
i``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``si`ks``ss`ks``s``si`kk`ki``s``si``s``si``s``si`ks`ks``s``si``s``si`ks`ks`ki``s``si``s``s
``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s
i`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``s
``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si`kk`ks`kk``s``si`kk`kk``s``sii`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks`ki``s``si`kk``s
`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si``s````si``s``si`ks``s``si`kk`ks`kk``s``si`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`
si``s``si`ks`ki``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si``s``si``s``si`ks`ki``s``si`ks``s``
`s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s`si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si`
`si`ks`ki`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s```s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si``s``si`ks`
si`ks`ki`ki``s``si`kk``s``si`kk``s``si``s``si``s``si`ks`ki`ki``s``si``s``si`ks`k`s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks`ki`ki``s``si`kk``s``si`k
i`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk``s``si``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``s
k`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ki`kk`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
s``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``k``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si``
si``s``si`ks`ki``s``si`kk`ks``s``si`kk`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``
s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki`s``si`kk`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``
`s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``sisi``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s`
``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si
`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s
``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s
``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s
``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s
``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk`ki``s``si``s``si`ks``s``si`kk``si`kk`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s
``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk```si`kk`ks``s``si`kk`ki``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s`
`s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s`si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s``si`ks``s`
``si``s``si`ks`ki``s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s`si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s
``si`ks`ki``s``si`kk`ks``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ki``s```si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ks``s``si
`si`kk``s``si``s``si`ks`ki``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ki``s``si`kk``s``si``s``si`ks`ki``s`
`si`ks``s``si``s``si`ks`ki``s``si`kk`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`k`si`kk`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s`
i``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si`kk`kii`si`kk`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s
``si`kk``s``si`kk`kii
encode(S)[e] denotes the encoded form of the expression e:

[S]   = (K S)
encode(K)[K]   = (K K)
encode(I)[I]   = (IK I)
encode(f[a x)b] = S (S I (encode(f))[a]) (encode(x))[b]

This encoding introduces 3x overhead for combinators and 7x overhead for applications. There are about halfequally many applications asand combinators in any Lazy K term, so this encoding has ~5x overhead. There are other encodings which are more efficient than this. For example, @msullivan's quine uses a representation which exploits the fact that top-level terms are applied together to have just 1.5x overhead. However, this approach has several disadvantages. It supports only the S and K combinators, making the body of the quine more verbose. It relies on going outside of the Unlambda subset of the syntax, so I would need to make the parser more complex. Finally, it lacks a very useful feature of my representation: it can be trivially "interpreted" into the term it represents by passing I as the argument, avoiding the need to store both the encoded and decoded form of the quine payload. Nevertheless, the savings from using a more efficient representation like this are so large that it would probably be worth doing.

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 4957, 107 is reduced from 91 bytes to 6573, and 115 is reduced from 89 bytes to 5557. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Lazy K, 5891 bytes

````ssk``s``si``s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`k
s``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``
si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks`ki`
`s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si
`ks``s``si`kk``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks`ki`kk``s``si`kk`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si
`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks
``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s`
`si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks
``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks
`ki`kk``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s`
`si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
`kk``s``si`ks`ki``s``si``s``si``s``si`ks`ks``s``si`ks``s``si``s``si`ks``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki`ki`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si`kk``s``si
`kk`ks``s``si`kk`kk``s``si`kk`kk``s``si``s``si`ks`ki`ki``s``si`kk`kk``s``si``s``
si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s`
`si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``s
i`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``s
i`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``
s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ks`ks``s``si``s``
si`ks``s``si`kk`ks`kk``s``si``s``si`ks`ki``s``si``s``si`ks`ki`ki``s``si``s``si`k
s``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`k
k``s``si``s``si`ks``s``si`kk`ks`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s
``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``
s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`k
k``s``si``s``si``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks`kk`ki``s``si``s``
si`ks``s``si`kk``s``si`ks`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``
s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`k
s``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``s
i`kk``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``
si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`k
s``s``si``s``si`ks`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``s
i`kk`ki``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`k
s``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`k
k`ki`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``
s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si``s``si``s``si`ks`ks``s``s
i``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``si`ks``s
``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk`kk``s
``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si`kk`ks`kk``s``si`kk`kk``s``si
`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si``s``
si``s``si`ks`ki``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`
`s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s`
`si`ks`ki`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``
si`ks`ki`ki``s``si`kk``s``si`kk``s``si``s``si``s``si`ks`ki`ki``s``si``s``si`ks`k
i`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`k
k`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`k
s``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``
si``s``si`ks`ki``s``si`kk`ks``s``si`kk`ks``s``si`kk`kk``s``si``s``si`ks``s``si``
s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki`
`s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk
`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s
``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s
``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s
``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s
``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s
``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``s``si`kk`ki``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk`
`s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s
``si``s``si`ks`ki``s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s
``si`ks`ki``s``si`kk`ks``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ki``s`
`si`kk``s``si``s``si`ks`ki``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s`
`si`ks``s``si``s``si`ks`ki``s``si`kk`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`k
i``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si`kk`kii
encode(S) = (K S)
encode(K) = (K K)
encode(I) = (I I)
encode(f x) = S (S I (encode(f))) (encode(x))

This encoding introduces 3x overhead for combinators and 7x overhead for applications. There are about half many applications as combinators in any Lazy K term, so this encoding has ~5x overhead. There are other encodings which are more efficient than this. For example, @msullivan's quine uses a representation which exploits the fact that top-level terms are applied together to have just 1.5x overhead. However, this approach has several disadvantages. It supports only the S and K combinators, making the body of the quine more verbose. It relies on going outside of the Unlambda subset of the syntax, so I would need to make the parser more complex. Finally, it lacks a very useful feature of my representation: it can be trivially "interpreted" into the term it represents by passing I as the argument, avoiding the need to store both the encoded and decoded form of the quine payload. Nevertheless, the savings from using a more efficient representation like this are so large that it would probably be worth doing.

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 49, 107 is reduced from 91 bytes to 65, and 115 is reduced from 89 bytes to 55. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Lazy K, 5891 5861 bytes

````ssk``s``si``s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`k
s``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``
si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks`ki`
`s``si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si
`ks``s``si`kk``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks`ki`kk``s``si`kk`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si
`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks`ki`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks
``s``si`kk`ks``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s`
`si`ks``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks
``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks
`ki`kk``s``si`kk`kk``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s`
`si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si
`kk``s``si`ks`ki``s``si``s``si``s``si`ks`ks``s``si`ks``s``si``s``si`ks``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki`ki`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk`ki``s``si`kk``s``si
`kk`ks``s``si`kk`kk``s``si`kk`kk``s``si``s``si`ks`ki`ki``s``si`kk`kk``s``si``s``
si`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s`
`si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``s
i`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`kk`kk
``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si`ks``s``si`kk``s``si``s``s
i`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si``s``si`ks``
s``si``s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ks`ks``s``si``s``
si`ks``s``si`kk`ks`kk``s``si``s``si`ks`ki``s``si``s``si`ks`ki`ki``s``si``s``si`k
s``s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks``s``si``s``si`ks``s``s
i`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`k
k``s``si``s``si`ks``s``si`kk`ks`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s
``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s
``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``
s``si`kk``s``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`k
k``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks`ks``
s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``
s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``si``s``si`ks`ks``s``si`k
k`ki``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s``si``
s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`ks`k
s``s``si`kk`ki``s``si``s``si`ks`ks``s``si``s``si`ks``s``si``s``si`ks`ks`ks``s``s
i``s``si``s``si`ks`ks`ki``s``si``s``si`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``s
i`ks`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si``s``si`ks`ks`k
i``s``si``s``si`ks`ks``s``si``s``si`ks`ks``s``si`kk`ki`ks``s``si``s``si`ks``s``s
i``s``si`ks`ki``s``si``s``si`ks`ks``s``si``s``si``s``si`ks`ks`ki``s``si``s``si`k
s`ks``s``si`kk`ki``s``si``s``si``s``si`ks`ks``s``si``s``si`ks`ks`ki``s``si``s``s
i`ks`ks``s``si`kk`ki``s``si`kk``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s
``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``s
i`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk`kk``s``si``s``si`ks`ki``s``si`kk``s
``si``s``si`ks``s``si`kk`ks`kk``s``si`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`
ki``s``si`kk`ki``s``si`kk`ki``s``si`kk``s``si``s``si``s``si`ks`ki``s``si`ks``s``
si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si`
`s``si``s``si`ks``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si``s``si`ks`
`s``si``s``si`ks``s``si`kk`ks`kk`ki`kk``s``si``s``si`ks`ki`ki``s``si`kk``s``si`k
k``s``si``s``si``s``si`ks`ki`ki``s``si``s``si`ks`ki`ki``s``si`kk``s``si`kk``s``s
i`kk`ki``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`k
k``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s``si``
s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk`ks``
s``si`kk`ks``s``si`kk`kk``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``
si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s``si``s``si`ks``s`
`si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si``s``si`ks``s``si`kk`ks``s``si
``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s``si`kk
``s``si`ks``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s
``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s
``si`kk`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s
``si`kk``s``si`ks``s``si`kk`kk``s``si``s``si`ks``s``si`kk`ks``s``si``s``si`ks``s
``si`kk``s``si`ks`ki``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s
``si`kk`ks``s``si`ks``s``si``s``si`ks`ki``s``si``s``si`ks``s``si``s``si`ks`ki``s
``si`kk`ks``s``si`kk`ki``s``si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s`
`si``s``si`ks``s``si`kk``s``si`ks`ki`kk``s``si`kk``s``si`kk``s``si``s``si`ks``s`
`si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks``s``si``s``si`ks`ki``s``si`kk``s
``si`kk`ki``s``si`kk``s``si`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ks``s``si
`kk``s``si`kk``s``si``s``si`ks`ki``s``si`kk`ki``s``si`kk``s``si``s``si`ks`ki``s`
`si`kk`kk``s``si`kk``s``si``s``si`ks``s``si`kk``s``si`ks``s``si``s``si`ks`ki``s`
`si`kk`kk`kk``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s``si`kk`ki``s
``si`kk``s``si`kk`kii
[e] denotes the encoded form of the expression e:

[S]   = (K S)
[K]   = (K K)
[I]   = (K I)
[a b] = S (S I [a]) [b]

This encoding introduces 3x overhead for combinators and 7x overhead for applications. There are about equally many applications and combinators in any Lazy K term, so this encoding has ~5x overhead. There are other encodings which are more efficient than this. For example, @msullivan's quine uses a representation which exploits the fact that top-level terms are applied together to have just 1.5x overhead. However, this approach has several disadvantages. It supports only the S and K combinators, making the body of the quine more verbose. It relies on going outside of the Unlambda subset of the syntax, so I would need to make the parser more complex. Finally, it lacks a very useful feature of my representation: it can be trivially "interpreted" into the term it represents by passing I as the argument, avoiding the need to store both the encoded and decoded form of the quine payload. Nevertheless, the savings from using a more efficient representation like this are so large that it would probably be worth doing.

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 57, 107 is reduced from 91 bytes to 73, and 115 is reduced from 89 bytes to 57. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Bounty Ended with 500 reputation awarded by user
added 6521 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

Line breaks added for clarity.

This program is written in, and is capable of parsing, only the Unlambda-syntax subset of Lazy K; that is:

program ::= "s" | "k" | "i" | "`" program program.

It expects input to be encoded in the standard format for Lazy K: an input stream is a pair whose first element is a Church numeral, representing the first byte of the stream, and whose second element is the remaining input stream. However, the output is expected to be only a single Church numeral rather than a full output stream.

The parsing part

If we look at the character codes for the relevant bits of Lazy K syntax, we notice something interesting:

  • s is 115, or 1 mod 6;
  • k is 107, or 5 mod 6;
  • i is 105, or 3 mod 6;
  • ` is 96, or 0 mod 6.

If we assume the input program is part of the relevant subset, we can distinguish application using only a parity test, and then distinguish the combinators from each other using remainder mod 3.

Doing these tests effectively in combinatory logic requires a little cleverness, though.

  • mod 2: the idea is to find terms a, b, and f such that f a = b and f b = a, and then call N f a and examine the result. Traditionally the Church booleans are used for a and b and f is not, but not is annoyingly difficult to encode in SKI. Instead, I did an automated search for terms that would work, and it came up with this:
    • S I K I = I (K I) = K I;
    • S I K (K I) = K I (K (K I)) = I.
  • mod 3: similarly, we find distinct terms a, b, c, f with f a = b, f b = c, f c = a. A search yielded:
    • S (S I I) K I = I I (K I) = K I;
    • S (S I I) K (K I) = K I (K I) (K (K I)) = K (K I);
    • S (S I I) K (K (K I)) = K (K I) (K (K I)) (K ...) = I.

Given these, we can write a fairly conventional recursive-descent parser:

parse : stream -> (term, stream)
parse (c, rest) =
  match (c mod 2)

    0 -> let (f, rest') = parse rest
         let (x, rest'') = parse rest'
         (f x, rest'')

    1 -> ((match (c mod 3)
           0 -> I
           1 -> S
           2 -> K), rest)

The quining part

This is the fun part. One of the most important parts of any quine is figuring out a data format to represent the encoded form of the program. This ends up being the largest source of overhead since it essentially multiplies the program's length.

The representation I went with involves a lambda that substitutes its argument for every application in the encoded term, but leaves combinators unchanged. For example, the SKI-term (S S) (K I) would be encoded as:

λf. f (f S S) (f K I)

In terms of SKI, the encoding looks like this:

encode(S) = (K S)
encode(K) = (K K)
encode(I) = (I I)
encode(f x) = S (S I (encode(f))) (encode(x))

This encoding introduces 3x overhead for combinators and 7x overhead for applications. There are about half many applications as combinators in any Lazy K term, so this encoding has ~5x overhead. There are other encodings which are more efficient than this. For example, @msullivan's quine uses a representation which exploits the fact that top-level terms are applied together to have just 1.5x overhead. However, this approach has several disadvantages. It supports only the S and K combinators, making the body of the quine more verbose. It relies on going outside of the Unlambda subset of the syntax, so I would need to make the parser more complex. Finally, it lacks a very useful feature of my representation: it can be trivially "interpreted" into the term it represents by passing I as the argument, avoiding the need to store both the encoded and decoded form of the quine payload. Nevertheless, the savings from using a more efficient representation like this are so large that it would probably be worth doing.

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 49, 107 is reduced from 91 bytes to 65, and 115 is reduced from 89 bytes to 55. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Also, there is the problem of traversing the encoded form of the program to build up the stringified form. For this, we effectively need f x y to be able to distinguish the cases when its arguments are combinators and when its arguments are further applications of f. We accomplish this using a helper function:

helper(x) = x (K I) (K (K (λt. t foo))) (K (λt. t baz)) (λt. t bar) t

This evaluates to t foo, t bar, and t baz when passed S, K, and I as arguments respectively, but you can also pass (λ a b c d e. something else) to distinguish applications. This kind of function is unfortunately relatively cumbersome when encoded in SKI, but I haven't found anything better. We use a difference list to accumulate the stringified representations, since it makes it very cheap to append (just function composition) and doesn't require modification to work with infinite streams.

Further golfing

How to improve this:

  • Use a better data representation, even though this comes at the cost of easy interpretation.
  • Find a more efficient way to distinguish the S, K, and I combinators. If a better way exists, it's too large for my search program to find it as-is, so I would need to make it more efficient somehow or make assumptions to reduce the search space.
  • Find more efficient representations of each of the numbers. 96 in particular feels like it could be improved a lot, although it's probably also too large for the search program.
  • Better optimize parse, since it has some room for improvement.

The Lazier code used to generate this program can be found here.

Line breaks added for clarity.

This program is written in, and is capable of parsing, only the Unlambda-syntax subset of Lazy K; that is:

program ::= "s" | "k" | "i" | "`" program program.

It expects input to be encoded in the standard format for Lazy K: an input stream is a pair whose first element is a Church numeral, representing the first byte of the stream, and whose second element is the remaining input stream. However, the output is expected to be only a single Church numeral rather than a full output stream.

The parsing part

If we look at the character codes for the relevant bits of Lazy K syntax, we notice something interesting:

  • s is 115, or 1 mod 6;
  • k is 107, or 5 mod 6;
  • i is 105, or 3 mod 6;
  • ` is 96, or 0 mod 6.

If we assume the input program is part of the relevant subset, we can distinguish application using only a parity test, and then distinguish the combinators from each other using remainder mod 3.

Doing these tests effectively in combinatory logic requires a little cleverness, though.

  • mod 2: the idea is to find terms a, b, and f such that f a = b and f b = a, and then call N f a and examine the result. Traditionally the Church booleans are used for a and b and f is not, but not is annoyingly difficult to encode in SKI. Instead, I did an automated search for terms that would work, and it came up with this:
    • S I K I = I (K I) = K I;
    • S I K (K I) = K I (K (K I)) = I.
  • mod 3: similarly, we find distinct terms a, b, c, f with f a = b, f b = c, f c = a. A search yielded:
    • S (S I I) K I = I I (K I) = K I;
    • S (S I I) K (K I) = K I (K I) (K (K I)) = K (K I);
    • S (S I I) K (K (K I)) = K (K I) (K (K I)) (K ...) = I.

Given these, we can write a fairly conventional recursive-descent parser:

parse : stream -> (term, stream)
parse (c, rest) =
  match (c mod 2)

    0 -> let (f, rest') = parse rest
         let (x, rest'') = parse rest'
         (f x, rest'')

    1 -> ((match (c mod 3)
           0 -> I
           1 -> S
           2 -> K), rest)

The quining part

This is the fun part. One of the most important parts of any quine is figuring out a data format to represent the encoded form of the program. This ends up being the largest source of overhead since it essentially multiplies the program's length.

The representation I went with involves a lambda that substitutes its argument for every application in the encoded term, but leaves combinators unchanged. For example, the SKI-term (S S) (K I) would be encoded as:

λf. f (f S S) (f K I)

In terms of SKI, the encoding looks like this:

encode(S) = (K S)
encode(K) = (K K)
encode(I) = (I I)
encode(f x) = S (S I (encode(f))) (encode(x))

This encoding introduces 3x overhead for combinators and 7x overhead for applications. There are about half many applications as combinators in any Lazy K term, so this encoding has ~5x overhead. There are other encodings which are more efficient than this. For example, @msullivan's quine uses a representation which exploits the fact that top-level terms are applied together to have just 1.5x overhead. However, this approach has several disadvantages. It supports only the S and K combinators, making the body of the quine more verbose. It relies on going outside of the Unlambda subset of the syntax, so I would need to make the parser more complex. Finally, it lacks a very useful feature of my representation: it can be trivially "interpreted" into the term it represents by passing I as the argument, avoiding the need to store both the encoded and decoded form of the quine payload. Nevertheless, the savings from using a more efficient representation like this are so large that it would probably be worth doing.

Finally there is the task of stringifying the encoded quine to obtain the source code and passing it to the parsed input term. For this we need to construct the Church numerals 96, 105, 107, and 115. For golfing purposes I was able to find terms which are much more efficient than the constructions given in the standard library: 96 is reduced from 63 bytes to 45, 105 is reduced from 81 bytes to 49, 107 is reduced from 91 bytes to 65, and 115 is reduced from 89 bytes to 55. I obtained these using alternative representation of numbers which can be easily converted to and from Church numerals. This representation admits much more compact definitions of succ and +, and only slightly less compact definitions of * and ^.

Also, there is the problem of traversing the encoded form of the program to build up the stringified form. For this, we effectively need f x y to be able to distinguish the cases when its arguments are combinators and when its arguments are further applications of f. We accomplish this using a helper function:

helper(x) = x (K I) (K (K (λt. t foo))) (K (λt. t baz)) (λt. t bar) t

This evaluates to t foo, t bar, and t baz when passed S, K, and I as arguments respectively, but you can also pass (λ a b c d e. something else) to distinguish applications. This kind of function is unfortunately relatively cumbersome when encoded in SKI, but I haven't found anything better. We use a difference list to accumulate the stringified representations, since it makes it very cheap to append (just function composition) and doesn't require modification to work with infinite streams.

Further golfing

How to improve this:

  • Use a better data representation, even though this comes at the cost of easy interpretation.
  • Find a more efficient way to distinguish the S, K, and I combinators. If a better way exists, it's too large for my search program to find it as-is, so I would need to make it more efficient somehow or make assumptions to reduce the search space.
  • Find more efficient representations of each of the numbers. 96 in particular feels like it could be improved a lot, although it's probably also too large for the search program.
  • Better optimize parse, since it has some room for improvement.

The Lazier code used to generate this program can be found here.

Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92
Loading