= The DAFNE square =
Axiomatic DAFNE "doorway" (Zimbu)
CLASS D

  CONST A="ROTASPEN"; CONST B="DAFNEBR0";

  FUNC m(c CHAR) CHAR
    VAR i=A.indexOf(c);
    RETURN i>=0?B[(3*i+5)%8]:c;
  END

  FUNC main()
    VAR W="SATOR AREPO TENET OPERA ROTAS".split(" ");
    VAR D LIST=[];
    FOR i IN 0..4
      VAR s=W[4-i],o="";
      FOR j IN 0..s.len()-1 o+=m(s[j]); OD
      D.append(o);
    OD

    Out.println("¿ĐAFNE?");
    WHILE TRUE
      VAR s=In.readLine().trim();
      VAR ok=TRUE;
      FOR i IN 0..s.len()-1 IF A.indexOf(s[i])<0 ok=FALSE; FI OD
      IF ok
        VAR t="";
        FOR i IN 0..s.len()-1 t+=m(s[i]); OD
        IF t==D[0]
          FOR r IN D Out.println(r); OD
        FI
      FI
    OD
  END

END
{| | |- | DAFNE |- | ABRDN |- | FR0RF |- | NDRBA |- | ENFAD |} 0D theta conversion operator
SATOR
    O
    T
    A
    S
=== Triadic expansion === (python)
#!SELF-MODIFYING
import re,sys

# ===============
# AXIOM
# ROTAS
# OPERA
# TENET
# AREPO
# SATOR
# ===============

A="ROTASPEN";B="DAFNEBR0"
f=lambda c:B[(3*A.index(c)+5)%8]if c in A else c
g=lambda t:"\n".join("".join(f(c)for c in l)for l in t.split("\n"))

def r():
 s=open(__file__,encoding="utf-8").read()
 m=re.search(r"AXIOM\n((?:# [A-Z0-9]{5}\n){5})",s)
 b=[ln[2:] for ln in m.group(1).splitlines()]
 return "\n".join(b),s

def w(b,s):
 x="\n".join("# "+l for l in b.split("\n"))+"\n"
 s=re.sub(r"(AXIOM\n)(?:# [A-Z0-9]{5}\n){5}",r"\1"+x,s)
 open(__file__,"w",encoding="utf-8").write(s)

b,s=r()

if b=="DAFNE\nABRDN\nFR0RF\nNDRBA\nENFAD":
 print(b)
else:
 nb=g(b)
 w(nb,s)
 print(nb)
{| |+ Dafne L-system |- ! # Axioms !! expansion rule |- |
# ROTAS
# OPERA
# TENET
# AREPO
# SATOR
||
DAFNE
ABRDN
FR0RF
NDRBA
ENFAD
BDFBR
D00BB
F0F0F
BB00D
RBFDB
BDNRA
DE0BR
N0F0N
RB0ED
ARNDB
|} === 1D expansion === ROTASPEN DAFNEBR0
DAFNE
ABRDN
FR0RF
NDRBA
ENFAD
expansion rules
[4,4,4,4,4,4,4,5,6]
[4,2,6,8,4,7,4,2,3]
[4,6,4,4,2,8,7,2,4]
[4,8,7,4,8,7,4,8,7]
[4,4,3,8,2,6,4,2,7]
[4,7,2,6,2,8,3,4,7]
[4,4,4,4,4,4,4,4,4]
[5,2,7,8,2,3,4,4,6]
[6,3,2,4,7,4,8,6,2]
[1,4,4,4,4,4,4,4,4]
NNNNABNBNN0RNNF
NNN0NRNAONOROAB
NEBNAFRANN0RNAR
NABNRANNNNNNN0R
0NRBAONNNNNNNOR
NAFFNRNNNNEBN0R
NBNNNNBFANNNNBN
NAONNNNRNNNNNAO
RANNNN0BANNNRAN
N0RNNNNNNNRANAB
NORNNNNNNBAO0NR
N0RNEBNNNFNRNAF
NNFN0RNBNNABNNN
OABNORNAO0NRNNN
NARN0RRANNAFNEB
''i.e''
s=[list("DAFNE"),list("ABRDN"),list("FR0RF"),list("NDRBA"),list("ENFAD")]
r=[[4,4,4,4,4,4,4,5,6],[4,2,6,8,4,7,4,2,3],[4,6,4,4,2,8,7,2,4],[4,8,7,4,8,7,4,8,7],
   [4,4,3,8,2,6,4,2,7],[4,7,2,6,2,8,3,4,7],[4,4,4,4,4,4,4,4,4],[5,2,7,8,2,3,4,4,6],
   [6,3,2,4,7,4,8,6,2],[1,4,4,4,4,4,4,4,4]]
expansion rule
u=[]
for row in s:
    for c in row:
        if c not in u:u.append(c)
while len(u)<9:u.append(u[-1])
m={i+1:u[i] for i in range(9)}
sr={u[i]:i for i in range(len(u))}
alternating 0/O
C=[0]
def z(x):
    if x!=8:return m[x]
    C[0]^=1
    return "0" if C[0] else "O"
'''Linear (X)'''
def X(g):
    o=[]
    for row in g:
        a=[[],[],[]]
        for c in row:
            t=r[sr[c]] if c in sr else [4]*9
            b=[z(x) for x in t]
            a[0]+=b[:3];a[1]+=b[3:6];a[2]+=b[6:]
        o+=a
    return o

for L in X(s):print("".join(L))
The ROTASPEN dictionary creates a "Dafne square" which is a condensed [https://en.wikipedia.org/wiki/Vedic_square Vedic square]. The vedic square can be observed via Vedic_square.pgm only slightly worse max{v,|Ds| |°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°| |_____________________________________________________________This machine is a program fragment of Yggashdryll._______________________________________________________________________________| |°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°| import random, sys ADJ = [ 'metal', 'rusty', 'brass', 'bronze', 'chrome-plated', 'steel', 'aluminium', 'chromium', 'iron', 'cast iron', 'copper', 'tarnished', 'corroded', 'dented', 'shiny', 'gleaming', 'scratched', 'embossed', 'electroplated', 'enamelled', ] THING = [ 'footstool', 'barstool', 'side-table', 'coffee table', 'bench', 'speaker housing', 'appliance case', 'drum', 'bathtub', 'tabletop', 'shelving fragment', 'stool', 'miniature cabinet', 'worktop', 'container', 'sink', ] def nongrill(n): random.seed(n) return f'{random.choice(ADJ)} {random.choice(THING)}' def indef(s, upper=0): eu = 'n' if s[0] in 'aeiou' else '' return f'{"aA"[upper]}{eu} {s}' def main(): pit_state = sys.argv[1] objects = sys.argv[2] adj = object_ptr = pit_ptr = 0 print(f'Bliss Pit spatio-temporal dimensionality reduction: {pit_state}') print('Initial table-like objects:', ', '.join('circular grill' if obj == 'G' else nongrill(i) for i, obj in enumerate(objects))) print('#'*18) while object_ptr < len(objects): state = pit_state[pit_ptr % len(pit_state)] table_like = objects[object_ptr] name = 'circular grill' if table_like == 'G' else nongrill(object_ptr) verb = 'continue' if adj == 'the same' else 'are' thing = indef(name) if not adj else f'{adj} {name}' print(f'\nThe dogs in the bliss pit {verb} snarling and yapping at {thing}.') if table_like == 'G': newname = nongrill(len(objects)) print(f'{indef(newname, 1)} is sourced and tumbles into the pit.') objects += 'n' if state == 'r': if table_like == 'G': print(f'The dogs snatch the meat from the {name} and hungrily devour it.') else: print(f'The meat on the {name} burns. The dogs gnash their teeth and salivate wildly.') object_ptr += 1 adj = 'a new' elif state == 'u': print(f'The dogs cannot reach the {name}. They snarl in fury.') adj = 'the same' if table_like == 'G': print('A circular grill is sourced and tumbles into the pit.') objects += 'G' pit_ptr += 1 print('\nThere are no more conductive table-like objects cooking meat in the pit!') print('The dogs rage without meat.') if __name__ == '__main__': main() |°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°|

Portal_ritual(Thermometer)¶|

||Inventory:°°°| ||1 Goldstone°°| ||1 Thermometer| °°°°°°°°°°°°°°°| \1. Throw thermometer. /roll for break@wall! //Breaks\Sleep I roll/Ambush|Gnome °°°°°°°°°°°°°|Throws thermometer \Saving throw! Sleep|Wake::Portal:Opens@Wall|°torment^Clevel! Otaf (Pit Lord) casts Conjure: Pit Lord| Pit Lord casts Conjure: Otaf| Otaf casts: Blink Charm pit lord|Extract 1 Pit Lord eyeball/ Craft Thermometer(Pit) This produces pit, a substance which when exposed to a mineral opens a portal to the corresponding elemental plain. P2 #🐅 1 1 x y bop 18 703 a Fn(Knuth's)42 b(Generalization)g(of)f(McCa)m(rthy's)670 819 y(91)g(F)m(unction)928 1086 y Fm(b)m(y)658 1243 y Fn(John)g(Co)m(wles)495 1360 y Fm(Universit)m(y)36 b(of)e(Wy)m(oming)623 1776 y(On)f(sabbatical)i(at) 354 1892 y(Advanced)d(T)-9 b(echnology)34 b(Center)632 2008 y(Ro)s(ckw)m(ell-Colli)q(ns)568 2125 y(Ceda)m(r)h(Rapids,)f(Io)m(w)m(a)1733 2686 y Fl(1)p eop %%Page: 2 2 bop 361 551 a Fn(McCa)m(rthy's)41 b(91)g(F)m(unction)58 970 y Fk(M)9 b Fm(\()p Fk(x)p Fm(\))348 925 y Fl(def)351 970 y Fj(\()70 b Fm(if)f Fk(x)25 b(>)f Fm(100)68 b(then)h Fk(x)20 b Fj(\000)f Fm(10)1025 1099 y(else)69 b Fk(M)9 b Fm(\()p Fk(M)g Fm(\()p Fk(x)21 b Fm(+)f(11\)\))p Fk(:)2 1681 y Fm(F)m(o)m(r)35 b(integer)g(inputs)f Fk(x)p Fm(,)242 1860 y Fk(M)9 b Fm(\()p Fk(x)p Fm(\))68 b(=)e(if)k Fk(x)25 b(>)f Fm(100)68 b(then)h Fk(x)19 b Fj(\000)h Fm(10)1195 1989 y(else)69 b(91)p Fk(:)2 2271 y Fm(So)34 b(fo)m(r)g(all)i(integers)f Fk(x)25 b Fj(\024)g Fm(101,)33 b Fk(M)9 b Fm(\()p Fk(x)p Fm(\))25 b(=)g(91.)1733 2686 y Fl(2)p eop %%Page: 3 3 bop 58 1095 a Fk(M)9 b Fm(\()p Fk(x)p Fm(\))348 1050 y Fl(def)351 1095 y Fj(\()70 b Fm(if)f Fk(x)25 b(>)f Fm(100)68 b(then)h Fk(x)20 b Fj(\000)f Fm(10)1025 1224 y(else)69 b Fk(M)9 b Fm(\()p Fk(M)g Fm(\()p Fk(x)21 b Fm(+)f(11\)\))p Fk(:)2 1806 y Fm(Ha)m(rd)34 b(fo)m(r)g(A)m(CL2)g(to)g(verify)h(the)f(recursion)2 1923 y(terminates.)1733 2686 y Fl(3)p eop %%Page: 4 4 bop 235 970 a Fk(M)9 b Fm(\()p Fk(x)p Fm(\))525 925 y Fl(def)528 970 y Fj(\()70 b Fm(if)f Fk(x)25 b(>)g Fm(100)67 b(then)i Fk(x)20 b Fj(\000)f Fm(10)1202 1099 y(else)69 b(91)p Fk(:)2 1681 y Fm(A)m(CL2)33 b(Theo)m(rem.)65 1860 y Fk(M)9 b Fm(\()p Fk(x)p Fm(\))68 b(=)e(if)k Fk(x)25 b(>)f Fm(100)68 b(then)h Fk(x)19 b Fj(\000)h Fm(10)1018 1989 y(else)69 b Fk(M)9 b Fm(\()p Fk(M)g Fm(\()p Fk(x)21 b Fm(+)f(11\)\))p Fk(:)1733 2686 y Fl(4)p eop %%Page: 5 5 bop 397 330 a Fn(Knuth's)42 b(Generalization)222 749 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))498 704 y Fl(def)502 749 y Fj(\()69 b Fm(if)h Fk(x)24 b(>)h(a)69 b Fm(then)f Fk(x)20 b Fj(\000)g Fk(b)1072 878 y Fm(else)70 b Fk(K)1376 844 y Fi(c)1409 878 y Fm(\()p Fk(x)20 b Fm(+)g Fk(d)p Fm(\))p Fk(:)74 1181 y Fj(\017)41 b Fm(Real)36 b Fk(a)74 1484 y Fj(\017)41 b Fm(Real)36 b Fk(b)24 b(>)g Fm(0)74 1787 y Fj(\017)41 b Fm(Integer)35 b Fk(c)24 b(>)h Fm(0)74 2090 y Fj(\017)41 b Fm(Real)36 b Fk(d)24 b(>)h Fm(0)112 2372 y Fh(The)41 b(generalized)i(91)f(recursion)g(with)452 2489 y(pa)m(rameters)49 b Fn(\()p Fg(a;)18 b(b;)g(c;)f(d)p Fn(\))1733 2686 y Fl(5)p eop %%Page: 6 6 bop 528 537 a Fn(Knuth's)41 b(Theo)m(rem)2 778 y Ff(Theo)m(rem)36 b(1)41 b Fe(The)22 b(generalized)j(91)d(recursion)h(with)2 894 y(pa)m(rameters)47 b Fm(\()p Fk(a;)15 b(b;)g(c;)g(d)p Fm(\))48 b Fe(de\014nes)d(a)j(total)g(function)2 1011 y(on)33 b(the)i(integers)f (i\013)i Fm(\()p Fk(c)20 b Fj(\000)g Fm(1\))f Fj(\001)h Fk(b)k(<)g(d)p Fe(.)2 1127 y(In)j(such)f(a)h(case)f(the)i(values)f(of)f Fk(K)6 b Fm(\()p Fk(x)p Fm(\))28 b Fe(also)f(ob)s(ey)g(the)2 1243 y(simpler)36 b(recurrence)35 1422 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))67 b(=)g Fe(if)i Fk(x)25 b(>)g(a)68 b Fe(then)h Fk(x)19 b Fj(\000)h Fk(b)871 1550 y Fe(else)69 b Fk(K)6 b Fm(\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)g Fm(\()p Fk(c)f Fj(\000)h Fm(1\))p Fk(b)p Fm(\))p Fk(:)512 2174 y Fn(Knuth's)41 b(Challenge)307 2290 y Fm(Prove)34 b(Theo)m(rem)h(1)f(b)m(y)g(computer.)1733 2686 y Fl(6)p eop %%Page: 7 7 bop 614 257 a Fn(Knuth's)41 b(Pro)s(of)229 626 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))67 b(=)g(if)i Fk(x)25 b(>)g(a)68 b Fm(then)h Fk(x)20 b Fj(\000)g Fk(b)1065 745 y Fm(else)69 b Fk(K)1368 711 y Fi(c)1402 745 y Fm(\()p Fk(x)20 b Fm(+)g Fk(d)p Fm(\))p Fk(:)37 1015 y Fm(1.)41 b(If)35 b(\()p Fk(c)19 b Fj(\000)h Fm(1\))g Fj(\001)f Fk(b)24 b Fj(\025)h Fk(d)p Fm(,)34 b(then)g(the)h(recursion)f(do)s(es)159 1122 y(not)g(terminate)i(fo)m(r)f(some)e(inputs)i Fk(x)25 b Fj(\024)f Fk(a)p Fm(.)37 1392 y(2.)41 b(If)35 b(\()p Fk(c)19 b Fj(\000)h Fm(1\))g Fj(\001)f Fk(b)24 b(<)h(d)p Fm(,)34 b(then)g(the)h (recursion)f(alw)m(a)m(ys)159 1498 y(terminates.)37 1769 y(3.)41 b(Any)34 b(total)h(function)f(that)g(satis\014es)g(the)159 1875 y(generalized)i(91)e(recursion)g(\(ab)s(ove\))g(must)159 1981 y(also)h(satisfy)f(the)g(simpler)i(recursion)f(\(b)s(elo)m(w\).)35 2412 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))67 b(=)g(if)i Fk(x)25 b(>)g(a)68 b Fm(then)h Fk(x)19 b Fj(\000)h Fk(b)871 2531 y Fm(else)69 b Fk(K)6 b Fm(\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)g Fm(\()p Fk(c)f Fj(\000)h Fm(1\))p Fk(b)p Fm(\))p Fk(:)1733 2686 y Fl(7)p eop %%Page: 8 8 bop 94 257 a Fn(\(Meta\)Co)m(rolla)m(ries)42 b(to)f(A)m(CL2)g(Results)37 559 y Fm(0.)g(F)m(o)m(r)35 b(all)i(choices)d(of)f(Real)j Fk(a)p Fm(,)e(Real)h Fk(b)24 b(>)h Fm(0,)159 675 y(Integer)35 b Fk(c)24 b(>)h Fm(0,)34 b(and)f(Real)j Fk(d)24 b(>)h Fm(0,)34 b(there)h(a)m(re)159 791 y(total)h(functions)d(on)h(the)g(Reals)h(that)g(satisfy)159 907 y(the)g(generalized)g(91)f(recursion.)37 1209 y(1.)41 b(If)34 b(\()p Fk(c)19 b Fj(\000)f Fm(1\))h Fj(\001)g Fk(b)24 b Fj(\025)g Fk(d)p Fm(,)34 b(then)f(there)h(a)m(re)g Fe(many)44 b Fm(total)159 1325 y(functions)34 b(on)f(the)i(reals)g(that)f(satisfy)g(the)159 1441 y(generalized)i(91)e(recursion.)37 1743 y(2.)41 b(If)35 b(\()p Fk(c)19 b Fj(\000)h Fm(1\))g Fj(\001)f Fk(b)24 b(<)h(d)p Fm(,)34 b(then)g(there)h(is)g Fe(only)g(one)159 1859 y Fm(total)h(function)d (on)h(the)g(reals)i(that)e(satis\014es)159 1974 y(the)h(generalized)g(91)f (recursion.)37 2276 y(3.)41 b(Any)34 b(total)h(function)f(that)g(satis\014es) g(the)159 2392 y(generalized)i(91)e(recursion)g(must)h(also)f(satisfy)159 2508 y(the)h(simpler)h(recursion.)1733 2686 y Fl(8)p eop %%Page: 9 9 bop 200 257 a Fn(T)-10 b(otal)40 b(F)m(unctions)h(and)g(Recursive)704 372 y(De\014nitions)2 672 y Ff(Question.)e Fm(Ho)m(w)c(many)f(total)h (functions,)e(over)159 787 y(the)i(nonnegative)e(integers,)i(satisfy)f(the) 159 902 y(recursive)h(equation?)2 1139 y Ff(Example)h(1)261 1315 y Fk(F)12 b Fm(\()p Fk(x)p Fm(\))67 b(=)g Fe(if)i Fk(x)25 b Fm(=)g(0)68 b Fe(then)h Fm(0)1085 1442 y Fe(else)g Fk(F)12 b Fm(\()p Fk(x)20 b Fj(\000)g Fm(1\))p Fk(:)2 1679 y Ff(Example)36 b(2)254 1856 y Fk(G)p Fm(\()p Fk(x)p Fm(\))68 b(=)f Fe(if)i Fk(x)25 b Fm(=)g(0)68 b Fe(then)g Fm(0)1079 1983 y Fe(else)h Fk(G)p Fm(\()p Fk(x)p Fm(\))21 b(+)f(1)p Fk(:)2 2220 y Ff(Example)36 b(3)244 2397 y Fk(H)6 b Fm(\()p Fk(x)p Fm(\))68 b(=)f Fe(if)i Fk(x)25 b Fm(=)g(0)68 b Fe(then)g Fm(0)1079 2524 y Fe(else)h Fk(H)6 b Fm(\()p Fk(x)21 b Fm(+)f(1\))p Fk(:)1733 2686 y Fl(9)p eop %%Page: 10 10 bop 200 552 a Fn(T)-10 b(otal)40 b(F)m(unctions)h(and)g(Recursive)704 668 y(De\014nitions)2 909 y Ff(Example)36 b(1)261 1087 y Fk(F)12 b Fm(\()p Fk(x)p Fm(\))67 b(=)g Fe(if)i Fk(x)25 b Fm(=)g(0)68 b Fe(then)h Fm(0)1085 1216 y Fe(else)g Fk(F)12 b Fm(\()p Fk(x)20 b Fj(\000)g Fm(1\))p Fk(:)2 1798 y Fe(Only)34 b(one)40 b Fm(function,)33 b(over)i(the)f(nonnegative)2 1914 y(integers,)g(satis\014es)g(the)g (recursive)h(equation.)779 2229 y Fk(F)12 b Fm(\()p Fk(x)p Fm(\))1001 2183 y Fl(def)1004 2229 y Fj(\()28 b Fm(0)1733 2686 y Fl(10)p eop %%Page: 11 11 bop 200 499 a Fn(T)-10 b(otal)40 b(F)m(unctions)h(and)g(Recursive)704 616 y(De\014nitions)2 856 y Ff(Example)36 b(2)254 1035 y Fk(G)p Fm(\()p Fk(x)p Fm(\))68 b(=)f Fe(if)i Fk(x)25 b Fm(=)g(0)68 b Fe(then)g Fm(0)1079 1164 y Fe(else)h Fk(G)p Fm(\()p Fk(x)p Fm(\))21 b(+)f(1)p Fk(:)2 1746 y Fe(No)40 b Fm(function,)34 b(over)g(the)g(nonnegative)g(integers,)2 1862 y(satis\014es)f(the)i (recursive)g(equation.)2 2103 y(F)m(o)m(r)g Fk(x)25 b(>)f Fm(0,)627 2281 y Fk(G)p Fm(\()p Fk(x)p Fm(\))h(=)g Fk(G)p Fm(\()p Fk(x)p Fm(\))c(+)f(1)1733 2686 y Fl(11)p eop %%Page: 12 12 bop 200 411 a Fn(T)-10 b(otal)40 b(F)m(unctions)h(and)g(Recursive)704 527 y(De\014nitions)2 768 y Ff(Example)36 b(3)244 946 y Fk(H)6 b Fm(\()p Fk(x)p Fm(\))68 b(=)f Fe(if)i Fk(x)25 b Fm(=)g(0)68 b Fe(then)g Fm(0)1079 1075 y Fe(else)h Fk(H)6 b Fm(\()p Fk(x)21 b Fm(+)f(1\))p Fk(:)2 1357 y Fe(Many)44 b Fm(functions,)33 b(over)i(the)f(nonnegative)2 1473 y(integers,)g(satisfy)g(the)h(recursive)g (equation.)2 1714 y(F)m(o)m(r)g(each)e(integer)j Fk(n)24 b Fj(\025)h Fm(0,)372 1893 y Fk(H)444 1903 y Fi(n)491 1893 y Fm(\()p Fk(x)p Fm(\))687 1847 y Fl(def)691 1893 y Fj(\()69 b Fm(if)h Fk(x)24 b Fm(=)h(0)69 b(then)f(0)1261 2021 y(else)i Fk(n:)229 2241 y(H)301 2252 y Fi(n)348 2241 y Fm(\(0\))c(=)h(0)231 2370 y Fk(H)303 2380 y Fi(n)350 2370 y Fm(\()p Fk(x)p Fm(\))g(=)g Fk(n)25 b Fm(=)f Fk(H)947 2380 y Fi(n)994 2370 y Fm(\()p Fk(x)c Fm(+)g(1\))34 b(fo)m(r)g Fk(x)25 b(>)g Fm(0)o Fk(:)1733 2686 y Fl(12)p eop %%Page: 13 13 bop 200 453 a Fn(T)-10 b(otal)40 b(F)m(unctions)h(and)g(Recursive)704 569 y(De\014nitions)2 810 y Ff(Example)36 b(4)69 988 y Fk(L)p Fm(\()p Fk(x;)16 b(y)s Fm(\))67 b(=)f Fe(if)k Fk(x)25 b Fm(=)f(0)69 b Fe(then)f Fm(0)971 1117 y Fe(else)h Fk(L)p Fm(\()p Fk(x)20 b Fj(\000)f Fm(1)p Fk(;)c(L)p Fm(\()p Fk(x;)g(y)s Fm(\)\))p Fk(:)74 1420 y Fj(\017)41 b Fe(Only)35 b(one)40 b Fm(function,)33 b(over)h(the)h(nonnegative)159 1536 y(integers,)g(satis\014es)f(the)g (recursive)h(equation.)819 1789 y Fk(L)p Fm(\()p Fk(x;)15 b(y)s Fm(\))1118 1743 y Fl(def)1122 1789 y Fj(\()27 b Fm(0)74 2092 y Fj(\017)41 b Fm(Recursion)35 b(do)s(es)e Fe(not)41 b Fm(terminate.)159 2208 y(Assuming)34 b(left-to-right,)i(innermost-\014rst)159 2324 y(evaluation)f(o)m(rder.)1733 2686 y Fl(13)p eop %%Page: 14 14 bop 717 490 a Fn(The)41 b(Reals)2 731 y Ff(Theo)m(rem)36 b(2)41 b Fe(There)34 b(is)h(\(up)f(to)g(o)m(rdered)h(\014eld)2 847 y(isomo)m(rphism\))g(exactly)g(one)f(complete)h(o)m(rdered)2 964 y(\014eld.)2 1204 y Fm(This)f(unique)g(\014eld)h(is)g(kno)m(wn)e(as)h (the)g(\014eld)g(of)g Fe(real)2 1321 y(numb)s(ers)41 b Fm(o)m(r)34 b(the)g Fe(Reals)p Fm(.)2 1624 y Ff(Completeness)k Fm(Every)d(nonempt)m(y)e (set)i(of)e(\014eld)159 1740 y(elements)i(b)s(ounded)d(ab)s(ove)i(has)f(a)h Fe(least)159 1856 y(upp)s(er)g(b)s(ound)p Fm(.)2 2159 y Ff(Example)39 b Fj(f)p Fk(x)25 b Fj(2)f Fm(Reals)c Fj(j)g Fk(x)975 2130 y Fd(2)1045 2159 y Fj(\024)25 b Fm(2)p Fj(g)159 2275 y Fm(has)34 b(least)h(upp)s(er)e(b)s(ound,)1160 2207 y Fj(p)p 1233 2207 52 4 v 68 x Fm(2)o(.)1733 2686 y Fl(14)p eop %%Page: 15 15 bop 274 257 a Fn(Achimedean)41 b(Ordered)h(Fields)2 495 y Fm(An)33 b(o)m(rdered)h(\014eld)h(is)g Fe(Archimedean)h Fm(i\013)f(every)g(\014eld)2 611 y(element)g(is)g(b)s(ounded)d(ab)s(ove)h(b)m(y)h(some)g(p)s(ositive)2 726 y(integer.)2 964 y(The)g(Archimedean)g(\014elds)g(a)m(re)g(exactly)i(the) 2 1080 y(sub\014elds)d(of)g(the)h(Reals.)74 1380 y Fj(\017)41 b Fm(Rationals)36 b(a)m(re)f(Archimedean.)74 1680 y Fj(\017)41 b Fm(Reals)35 b(a)m(re)g(Archimedean.)2 1981 y(Archimedean)f(\014elds)g(have) f(A)m(CL2)h(axioms)g(that)2 2096 y(A)m(CL2)f(can)h(sho)m(w)f(a)m(re)i (consistent.)2 2334 y(Prove)f(the)g(claims)i(ab)s(out)d(the)i Fe(Generalized)h(91)2 2449 y(Recursion)g Fm(over)e(a)m(rbitra)m(ry)j (Archimedean)d(\014elds)2 2565 y(\(instead)g(of)g(just)f(over)i(the)f (Reals\).)1733 2686 y Fl(15)p eop %%Page: 16 16 bop 114 277 a Fn(Axiomatize)42 b(Archimedean)f(Fields)g(in)831 393 y(A)m(CL2)74 696 y Fj(\017)g Fm(Constrain)35 b(with)g(encapsulate)159 812 y(Witness:)46 b(Rationals)74 1115 y Fj(\017)41 b Fm(Archimedean)34 b(Axioms)186 1325 y Ff({)41 b Fm(F)m(unction:)46 b Fc(Nat-Int-Bound)186 1534 y Ff({)41 b Fc(Nat-Int-Bound)o Fm(\()p Fk(x)p Fm(\))35 b(is)g(an)f(Integer)186 1744 y Ff({)41 b Fc(Nat-Int-Bound)o Fm(\()p Fk(x)p Fm(\))25 b Fj(\025)1077 1754 y Fi(a)1142 1744 y Fk(x)p Fm(,)35 b(if)g Fk(x)25 b Fj(\025)1486 1754 y Fi(a)1551 1744 y Fm(0)186 1954 y Ff({)41 b Fm(Witness:)46 b Fc(numerator)74 2257 y Fj(\017)41 b Fm(De\014ne)34 b(useful)g(function:)159 2373 y Fc(Least-Nat-Bound)o Fm(\()p Fk(x)p Fm(\))h(returns)f(the)h(least)159 2489 y(Natural)h Fe(la)m(rger)46 b Fm(than)34 b Fk(x)1733 2686 y Fl(16)p eop %%Page: 17 17 bop 58 901 a Fn(Axiomatize)41 b(the)h(P)m(a)m(rameters)c(in)k(A)m(CL2)2 1142 y Fm(Use)33 b(ecapsulate)h(to)h(constrain:)74 1445 y Fj(\017)41 b Fc(\(a\))p Fm(,)34 b Fc(\(b\))24 b Fk(>)578 1455 y Fi(a)644 1445 y Fm(0,)34 b(and)f Fc(\(d\))24 b Fk(>)1169 1455 y Fi(a)1235 1445 y Fm(0)34 b(a)m(re)h(elements)159 1561 y(of)f(an)g(Archimedean)g (\014eld.)74 1864 y Fj(\017)41 b Fm(Integer)35 b Fc(\(c\))24 b Fk(>)h Fm(0.)1733 2686 y Fl(17)p eop %%Page: 18 18 bop 122 533 a Fn(De\014ne)42 b(A)m(CL2)f(F)m(unctions)f Fb(K1)h Fn(and)g Fb(K2)74 836 y Fj(\017)g Fm(Prove)33 b Fc(K1)g Fm(and)f Fc(K2)h Fm(satisfy)g(the)g(Generalized)h(91)159 952 y(Recursion)h(with)g(pa)m (rameters)159 1069 y(\()p Fc(\(a\))p Fk(;)15 b Fc(\(b\))p Fk(;)g Fc(\(c\))p Fk(;)g Fc(\(d\))o Fm(\).)74 1372 y Fj(\017)41 b Fm(Prove)34 b Fc(K1)24 b Fj(6)p Fm(=)h Fc(K2)34 b Fm(when)f(\()p Fc(\(c\))18 b Fj(\000)h Fm(1\))f Fj(\001)1438 1382 y Fi(a)1498 1372 y Fc(\(b\))24 b Fj(\025)1722 1382 y Fi(a)1788 1372 y Fc(\(d\))p Fm(.)74 1675 y Fj(\017)41 b Fm(Use)34 b(Simpler)j(Recursion)e(to)f(help)h (de\014ne)e Fc(K1)159 1791 y Fm(and)h Fc(K2)p Fm(.)252 1969 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))67 b(=)f(if)k Fk(x)25 b(>)f(a)812 2098 y Fm(then)69 b Fk(x)19 b Fj(\000)h Fk(b)812 2227 y Fm(else)69 b Fk(K)6 b Fm(\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)g Fm(\()p Fk(c)f Fj(\000)h Fm(1\))p Fk(b)p Fm(\))p Fk(:)1733 2686 y Fl(18)p eop %%Page: 19 19 bop 355 440 a Fn(De\014nitions)42 b(fo)m(r)h Fb(K1)e Fn(and)g Fb(K2)76 859 y Fk(K)6 b Fm(1\()p Fk(x)p Fm(\))403 814 y Fl(def)407 859 y Fj(\()69 b Fm(if)h Fk(x)25 b(>)f(a)702 988 y Fm(then)68 b Fk(x)20 b Fj(\000)g Fk(b)702 1116 y Fm(else)35 b(if)69 b(\()p Fk(c)20 b Fj(\000)g Fm(1\))f Fj(\001)h Fk(b)k(<)h(d)771 1245 y Fm(then)68 b Fk(K)6 b Fm(1\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)f Fm(\()p Fk(c)h Fj(\000)g Fm(1\))p Fk(b)p Fm(\))771 1374 y(else)104 b Fk(a:)76 1835 y(K)6 b Fm(2\()p Fk(x)p Fm(\))403 1789 y Fl(def)407 1835 y Fj(\()69 b Fm(if)h Fk(x)25 b(>)f(a)702 1963 y Fm(then)68 b Fk(x)20 b Fj(\000)g Fk(b)702 2092 y Fm(else)35 b(if)69 b(\()p Fk(c)20 b Fj(\000)g Fm(1\))f Fj(\001)h Fk(b)k(<)h(d)771 2221 y Fm(then)68 b Fk(K)6 b Fm(2\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)f Fm(\()p Fk(c)h Fj(\000)g Fm(1\))p Fk(b)p Fm(\))771 2349 y(else)104 b Fk(a)19 b Fj(\000)h Fk(b:)1733 2686 y Fl(19)p eop %%Page: 20 20 bop 240 257 a Fn(Axiomatize)41 b(A)m(CL2)h(F)m(unction)e Fb(K)74 534 y Fj(\017)h Fm(Constrain)35 b Fc(K)f Fm(to)g(satisfy)h(Generalized)g(91) 159 642 y(Recursion)g(with)g(pa)m(rameters)159 750 y(\()p Fc(\(a\))p Fk(;)15 b Fc(\(b\))p Fk(;)g Fc(\(c\))p Fk(;)g Fc(\(d\))o Fm(\).)186 951 y Ff({)41 b Fm(Axiom)370 1115 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))67 b(=)g(if)j Fk(x)24 b(>)h(a)69 b Fm(then)f Fk(x)20 b Fj(\000)g Fk(b)1206 1236 y Fm(else)70 b Fk(K)1510 1201 y Fi(c)1543 1236 y Fm(\()p Fk(x)20 b Fm(+)g Fk(d)p Fm(\))p Fk(:)186 1437 y Ff({)41 b Fm(Use)34 b(encapsulate)284 1545 y(Witness:)46 b Fc(K1)74 1821 y Fj(\017)41 b Fm(Prove)34 b Fc(K)h Fm(satis\014es)e(Simpler) 38 b(Recursion.)252 1985 y Fk(K)6 b Fm(\()p Fk(x)p Fm(\))67 b(=)f(if)k Fk(x)25 b(>)f(a)812 2106 y Fm(then)69 b Fk(x)19 b Fj(\000)h Fk(b)812 2226 y Fm(else)69 b Fk(K)6 b Fm(\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)g Fm(\()p Fk(c)f Fj(\000)h Fm(1\))p Fk(b)p Fm(\))p Fk(:)74 2503 y Fj(\017)41 b Fm(Prove)34 b Fc(K)25 b Fm(=)g Fc(K1)34 b Fm(when)f(\()p Fc(\(c\))20 b Fj(\000)f Fm(1\))h Fj(\001)1399 2513 y Fi(a)1460 2503 y Fc(\(b\))k Fk(<)1684 2513 y Fi(a)1749 2503 y Fc(\(d\))p Fm(.)1733 2686 y Fl(20)p eop %%Page: 21 21 bop 187 332 a Fn(A)m(CL2)41 b(Pro)s(of)h(of)f Fb(K)29 b Fn(=)h Fb(K1)40 b Fn(when)h Fa(\001)18 b(\001)g(\001)74 635 y Fj(\017)41 b Fm(Constrain)35 b(A)m(CL2)e(function)h Fc(G1)g Fm(to)g(satisfy)159 751 y(Simpler)j(Recursion.)186 961 y Ff({)k Fm(Axiom)284 1139 y Fk(G)p Fm(1\()p Fk(x)p Fm(\))67 b(=)g(if)i Fk(x)25 b(>)g(a)885 1268 y Fm(then)68 b Fk(x)20 b Fj(\000)g Fk(b)885 1397 y Fm(else)69 b Fk(G)p Fm(1\()p Fk(x)20 b Fm(+)g Fk(d)g Fj(\000)f Fm(\()p Fk(c)h Fj(\000)g Fm(1\))p Fk(b)p Fm(\))p Fk(:)186 1606 y Ff({)41 b Fm(Use)34 b(encapsulate)284 1723 y(Witness:)46 b Fc(K1)74 2026 y Fj(\017)41 b Fm(Prove)34 b Fc(G1)24 b Fm(=)h Fc(K1)34 b Fm(when)f(\()p Fc(\(c\))18 b Fj(\000)h Fm(1\))f Fj(\001)1438 2036 y Fi(a)1498 2026 y Fc(\(b\))24 b Fk(<)1722 2036 y Fi(a)1788 2026 y Fc(\(d\))p Fm(.)74 2329 y Fj(\017)41 b Fm(Replace)35 b Fc(G1)g Fm(with)g Fc(K)f Fm(in)h(ab)s(ove)e(item.)159 2445 y(Use)h(F)m(unctional)i(Instantiation)1733 2686 y Fl(21)p eop %%Page: 22 22 bop 2 257 a Fm(Archimedean)34 b(o)m(rdered)g(\014eld)g(op)s(erations)g (extend)2 363 y(op)s(erations)f(on)h(rationals.)74 631 y Fj(\017)41 b Fc(Rationalp)34 b Fm(extended)f(b)m(y)h Fc(aofp)74 899 y Fj(\017)41 b Fm(+)35 b(extended)e(b)m(y)i(+)894 910 y Fi(a)74 1167 y Fj(\017)41 b(\003)35 b Fm(extended)e(b)m(y)h Fj(\003)821 1178 y Fi(a)74 1436 y Fj(\017)41 b Fk(<)35 b Fm(extended)e(b)m(y)h Fk(<)869 1446 y Fi(a)74 1704 y Fj(\017)41 b Fm(etc.)2 1972 y(Life)34 b(w)m(ould)g(b)s(e)g(easier:)74 2240 y Fj(\017)41 b Fm(Extend)34 b(linea)m(r)j(a)m(rithmetic)g(to)d Fk(<)1399 2250 y Fi(a)1440 2240 y Fm(.)74 2508 y Fj(\017)41 b Fm(Imp)m(roved)35 b(o)m(rdered)f(a)m(rithmetic.)1733 2686 y Fl(22)p eop }🐯