Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.theory |
| Subject | Re: Primitive recursive functions and LBA? |
| Date | 2022-01-29 22:13 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <87leyyfaxf.fsf@bsb.me.uk> (permalink) |
| References | (3 earlier) <sss5gf$1ke$1@dont-email.me> <8735l929vu.fsf@bsb.me.uk> <sstefq$fu1$1@dont-email.me> <87sft7zgv2.fsf@bsb.me.uk> <st48q6$jjv$1@dont-email.me> |
Jeff Barnett <jbb@notatt.com> writes:
> On 1/28/2022 2:32 PM, Ben Bacarisse wrote:
>> Sorry, I started an answer but life happened. I have eventually got
>> round to finishing it...
>> Jeff Barnett <jbb@notatt.com> writes:
>>
>>> On 1/26/2022 7:24 PM, Ben Bacarisse wrote:
>>>> Jeff Barnett <jbb@notatt.com> writes:
>>>>
>>>>> When I looked at the definitions of PR in Linz and a few other places,
>>>>> I was struck by the glib way they presented a definition that, in my
>>>>> opinion, was inadequate. I think those definitions must allow many
>>>>> more ways to compose a new function from the basics and previously
>>>>> defined functions, i.e., more liberal nesting and ordering are
>>>>> necessary.
>>>> Necessary for what? Linz limits his discussion to unary and binary
>>>> functions. Is that what you mean?
>>>
>>> It's been quite a while since I thought I understood all of this so
>>> let's see if I can dredge out some examples.
>>>
>>> Linz provides no way to directly compose one argument functions; so,
>>> for example I cannot write one(x) = s(z(x)). And I'm not sure if I
>>> could write "one" using what he does provide.
>>>
>>> The ONLY composition rule in Linz for a 2 argument function is
>>> f(x,y) = h(g1(x,y), g2(x,y))
>>> where h, g1, and g2 are already defined.
>> The PR rule lets one extend a unary function to a binary one:
>> u'(x, 0) = u(x)
>> u'(x, y+1) = p2(..., u'(x, y)) = u'(x, y)
>> where p2 is the projection function and ... denotes an arbitrary (and
>> irrelevant) PR function. You can then show (by induction) that u'(x, y)
>> = u(x). Similarly for v'(x, y) = v(x)
>> Now, by setting h = v' and g1 = u' in the composition rule we see that
>> v'(u'(x, y), ...) = v(u'(x, y)) = v(u(x))
>> is PR, so the composition of unary PR functions is PR. (Again, I've
>> used ... rather than refer to some function g2 that is irrelevant.)
>>
>>> There is, of course, the strict definitions of the allowed pattern of
>>> recursion for a two argument function.
>>>
>>> So lets say I want to define f(x,y) = 5 + x*y. I might try
>>> f(x,y) = add(five(x,y), mult(x, y))
>>>
>>> but I don't know how to write "five(x, y)" using only the forms that
>>> Linz provides. Do You?
>> five(x, 0) = 5
>> five(x, y+1) = p2(..., five(x, y)) = five(x, y).
>> Once you see that you can have arbitrary constant unary and binary
>> functions, there is no need to keep using this level of detail. One
>> might just write
>> f(x,y) = add(5, mult(x, y))
>> as an example of composition with a constant function.
>> It's not ideal to confuse elements of the domain (the non-negative
>> integers) with constant functions over the domain, but it's technically
>> sound once you see what's meant. In fact, many authors include nullary
>> functions with a notation (like bold) to show that 5 is really a
>> constant function. These then work in the composition rule because it
>> will have been defined more generally.
>>
>>> Other authors seem to allow arbitrary nesting of previously defined
>>> functions and the obvious freedoms. Linz doesn't and I don't know how
>>> to recover the needed capabilities. Above (where you snipped) there
>>> was a grammar (or pattern) driven manipulation idea based on the few
>>> patterns that Linz provided.
>> I snipped the grammar because I did not follow exactly what was being
>> said about it, and the part I kept stood on it's own.
>> By the way, being asked for the details makes me think Linz could have
>> been much more explicit about this as even his first example (add) does
>> not work without a binary successor function. I bet most readers just
>> nod and keep going but kudos for not lettering that go without an
>> explanation.
>> But in fairness to Linz, this is part of a veritable gallop through
>> other models of computation. PR functions get 5 pages, several or which
>> are about functions that aren't PR, because that's the main goal.
>
> I think what you have shown is very clever.
You are too kind. I was wrong in the no amount of cleverness will
overcome the problems you spotted. The recursion rule can extend a PR
function from I^k to the domain I^(k+1) which is why I thought his
presentation might be fixable. But you can't go back to a lower arity
because his composition rule is too simple.
> However, I think a much clearer exposition for a Linz-like book would
> be something akin to
>
> 1. zero, projector, and successor functions are PR
Yup. Formally, every
z^n(x_1, x_2, ..., x_n) = 0
p^n_i(x_1, x_2, ..., x_n) = x_i
s^n_i(x_1, x_2, ..., x_n) = x_i + 1
are PR. (The superscript denotes that arity.)
> 2. all compositions of previously defined PR functions are PR - this
> rules out recursive definitions on purpose
Formally, for any k PR functions g_i(x_1, x_2, ..., x_n) and any PR
function h(x_1, x_2, ..., x_k) then
h(g_1(x_1, x_2, ..., x_n),
g_2(x_1, x_2, ..., x_n),
...,
g_k(x_1, x_2, ..., x_n))
is PR.
> 3. for each n > 0, a formula to build a recursive on one-variable,
> n-place PR function from previously defined PR functions.
This would have to be pinned down. "Formula" and "on one variable" are
a bit vague! The usual treatment is to say that a function defined like
this:
f(x_1, x_2, ... x_{n-1}, 0) = g(x_1, x_2, ..., x_{n-1})
f(x_1, x_2, ... x_{n-1}, m+1) = h(x_1, x_2, ..., x_{n-1}, m,
f(x_1, x_2, ..., x_{n-1}, m))
is PR, provided g and h are PR.
I think you can see why Linz wanted to find a simpler subset of these
rules. They are not intellectually complex, but they are messy.
> I know that it's very possible that recursive function definitions,
> like Ackermann's, that `recur' in multiple variables can be PR or
> not. On the other hand I have no idea how one would precisely weaken 3
> above to allow that with anything less powerful than a PR predicate;
> but that's what the composition rules were to establish in the first
> place.
I am not sure what you are getting at here, but the above rules (typos
excepted) are the usual way for defining what a PR function is.
Aside: it's instructive to map this more standard presentation to Linz's
one- and two-argument functions to see what's missing.
We'd have initial PR functions
z^1(x) = 0
z^2(x, y) = 0 missing, but can be defined
p^1_1(x) = x missing, and can't be defined
p^2_1(x, y) = x
p^2_2(x, y) = y
s^1_1(x) = x+1
s^2_1(x, y) = x+1 missing, but can be defined
s^2_3(x, y) = y+1 missing, but can be defined
and the composition rules:
f(x) = h(g(x))
f(x) = h(g_1(x), g_2(x))
f(x, y) = h(g(x, y))
f(x, y) = h(g_1(x, y), g_2(x, y)) Linz's only composition rule.
The recursion rule is also different. While the "base" (zero) cases are
the same, where Linz has
f(x, y+1) = h(g_2(x, y), f(x, y)
the usual presentation has
f(x, y+1) = h(x, y, f(x, y))
which would not fit in with Linz's simplification because h is a
three-argument function.
--
Ben.
Back to comp.theory | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2021-10-03 22:47 -0600
Re: Primitive recursive functions and LBA? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-10-04 15:00 +0100
Re: Primitive recursive functions and LBA? Alan Smaill <alandsmaill@gmail.com> - 2022-01-23 15:10 -0800
Re: Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2022-01-23 16:57 -0700
Re: Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2022-01-26 11:56 -0700
Re: Primitive recursive functions and LBA? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-01-27 02:24 +0000
Re: Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2022-01-26 23:35 -0700
Re: Primitive recursive functions and LBA? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-01-28 21:32 +0000
Re: Primitive recursive functions and LBA? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-01-29 01:56 +0000
Re: Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2022-01-28 19:39 -0700
Re: Primitive recursive functions and LBA? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-01-29 17:34 +0000
Re: Primitive recursive functions and LBA? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-01-29 19:53 +0000
Re: Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2022-01-29 13:41 -0700
Re: Primitive recursive functions and LBA? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-01-29 22:13 +0000
Re: Primitive recursive functions and LBA? Jeff Barnett <jbb@notatt.com> - 2022-01-29 18:42 -0700
csiph-web