Rename primrec to tailrec.

This commit is contained in:
Simon Forman 2020-04-28 11:05:19 -07:00
parent 750f498512
commit 4704799c37
3 changed files with 8 additions and 6 deletions

View File

@ -8,3 +8,5 @@ test/*
gnu-prolog/thun gnu-prolog/thun
venv venv
build build
Thun.egg-info
dist

View File

@ -68,7 +68,7 @@ treestep == swap [map] swoncat [TS1 [TS0] dip] dip genrec
Q == [tuck / + 2 /] unary Q == [tuck / + 2 /] unary
eps == [sqr - abs] nullary eps == [sqr - abs] nullary
K == [<] [popop swap pop] [popd [Q eps] dip] primrec K == [<] [popop swap pop] [popd [Q eps] dip] tailrec
@ -77,7 +77,7 @@ incr_value == [[popd incr_at] unary] dip
add_value == [+] cons dipd add_value == [+] cons dipd
incr_step_count == [++] dip incr_step_count == [++] dip
F == [popop 5 >=] [roll< popop] [get_value incr_value add_value incr_step_count] primrec F == [popop 5 >=] [roll< popop] [get_value incr_value add_value incr_step_count] tailrec
G == [first % not] [first /] [rest [not] [popop 0]] [ifte] genrec G == [first % not] [first /] [rest [not] [popop 0]] [ifte] genrec

View File

@ -245,7 +245,7 @@ make_generator == [codireco] ccons
nullary == [stack] dinfrirst nullary == [stack] dinfrirst
of == swap at of == swap at
pam == [i] map pam == [i] map
primrec == [i] genrec tailrec == [i] genrec
product == 1 swap [*] step product == 1 swap [*] step
quoted == [unit] dip quoted == [unit] dip
range == [0 <=] [1 - dup] anamorphism range == [0 <=] [1 - dup] anamorphism
@ -1067,7 +1067,7 @@ def genrec(stack, expression, dictionary):
Primitive recursive functions are those where R2 == i. Primitive recursive functions are those where R2 == i.
:: ::
P == [I] [T] [R] primrec P == [I] [T] [R] tailrec
== [I] [T] [R [P] i] ifte == [I] [T] [R [P] i] ifte
== [I] [T] [R P] ifte == [I] [T] [R P] ifte
@ -1423,7 +1423,7 @@ def times(stack, expression, dictionary):
# -------------------------------------- # --------------------------------------
# [P] nullary [Q [P] nullary] loop # [P] nullary [Q [P] nullary] loop
# while == [pop i not] [popop] [dudipd] primrec # while == [pop i not] [popop] [dudipd] tailrec
#def while_(S, expression, dictionary): #def while_(S, expression, dictionary):
# '''[if] [body] while''' # '''[if] [body] while'''
@ -1629,7 +1629,7 @@ for name in ('''
## range == [0 <=] [1 - dup] anamorphism ## range == [0 <=] [1 - dup] anamorphism
## while == swap [nullary] cons dup dipd concat loop ## while == swap [nullary] cons dup dipd concat loop
## dupdipd == dup dipd ## dupdipd == dup dipd
## primrec == [i] genrec ## tailrec == [i] genrec
## step_zero == 0 roll> step ## step_zero == 0 roll> step
## codireco == cons dip rest cons ## codireco == cons dip rest cons
## make_generator == [codireco] ccons ## make_generator == [codireco] ccons