Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.theory > #40275 > unrolled thread
| Started by | Jeff Barnett <jbb@notatt.com> |
|---|---|
| First post | 2021-10-03 22:47 -0600 |
| Last post | 2022-01-29 18:42 -0700 |
| Articles | 15 — 4 participants |
Back to article view | Back to comp.theory
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
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2021-10-03 22:47 -0600 |
| Subject | Primitive recursive functions and LBA? |
| Message-ID | <sje10e$4nn$1@dont-email.me> |
Let P be a primitive recursive function, say with n arguments. Does
there exist a linear bounded automata that, given the input string
a_1/.../a_n/A, can determine if
P(a_1,...,a_n) = A?
An alternative question might be, does there exist a linear bounded
automata that given a_1/..../a_n can calculate P(a_1,...,a_n)?
I suspect that
1) If the first question is answered yes, so will the second one.
However, the size of the tape character set will be substantially larger
in the second case.
2) The choice of arguments and values representation is not important.
3) Whether the machines are deterministic or nondeterministic might be
significant.
Another question that might be interesting is "Can some linear bounded
automata compute non primitive recursive functions?"
I found nothing to help with the above after an hour of searching the
net and I also flipped through Martin Davis (actually his book).
--
Jeff Barnett
[toc] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2021-10-04 15:00 +0100 |
| Message-ID | <87lf38nb3m.fsf@bsb.me.uk> |
| In reply to | #40275 |
Jeff Barnett <jbb@notatt.com> writes: > Let P be a primitive recursive function, say with n arguments. Does > there exist a linear bounded automata that, given the input string > a_1/.../a_n/A, can determine if > > P(a_1,...,a_n) = A? > > An alternative question might be, does there exist a linear bounded > automata that given a_1/..../a_n can calculate P(a_1,...,a_n)? <snip> > I found nothing to help with the above after an hour of searching the > net and I also flipped through Martin Davis (actually his book). Hmmm... I suspect that means it's not known. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Alan Smaill <alandsmaill@gmail.com> |
|---|---|
| Date | 2022-01-23 15:10 -0800 |
| Message-ID | <1c557170-4f38-4082-9363-3ed470a67a94n@googlegroups.com> |
| In reply to | #40275 |
On Monday, 4 October 2021 at 05:47:13 UTC+1, Jeff Barnett wrote:
> Let P be a primitive recursive function, say with n arguments. Does
> there exist a linear bounded automata that, given the input string
> a_1/.../a_n/A, can determine if
>
> P(a_1,...,a_n) = A?
>
> An alternative question might be, does there exist a linear bounded
> automata that given a_1/..../a_n can calculate P(a_1,...,a_n)?
>
> I suspect that
>
> 1) If the first question is answered yes, so will the second one.
> However, the size of the tape character set will be substantially larger
> in the second case.
>
> 2) The choice of arguments and values representation is not important.
>
> 3) Whether the machines are deterministic or nondeterministic might be
> significant.
>
> Another question that might be interesting is "Can some linear bounded
> automata compute non primitive recursive functions?"
>
> I found nothing to help with the above after an hour of searching the
> net and I also flipped through Martin Davis (actually his book).
> --
> Jeff Barnett
I think the answer to the first question above is positive.
Here's an outline argument.
In Kuroda, Classes of language and linear bounded automata,
Information and Control, 7, 207--223, 1964, there is the theorem (no 3):
"A context free language is accepted by a deterministic linear-bounded automaton."
- the article is linked from:
https://en.wikipedia.org/wiki/Linear_bounded_automaton
So it is enough to show that we can describe primitive recursive functions via context-free grammars.
This looks do-able. There are only a few cases needed to generate primitive recursive functions
(constant function, successor, projection, composition and primitive recursion operator).
Take a relational view of the p.r. functions, so the language statements are of the form
P( x1, x2, ..., xn, y ) where the arguments are all Peano numerals using S as successor symbol,
and P corresponds to name of some p.r. function.
Then, for example, to define x ^ y via primitive recursion from times,
where the variables are implicitly constrained to be Peano numerals:
exp( x, 0, S(0) ) and
exp( x1, S(x2), y ) ::= exp( x1, x2, z ), times( x1, z, y)
For composition, to get x1^(x2 + x1) given exp and plus:
Pnew( x2, x1, y ) ::= plus( x2, x1, z ), exp( x1, z, y ).
This outline would need to be fleshed out, but looks to be on the right lines.
(and at least it doesn't give an obvious way to define Ackermann's function)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
On a separate issue, the wikipedia page on linear bounded automata says:
"Linear bounded automata are acceptors for the class of context-sensitive languages.[1]: 225–226
The only restriction placed on grammars for such languages is that no production maps a string to a shorter string."
This claimed restriction seems to me to come from a misreading of the Kuroda paper, which does introduce
the property mentioned, but then shows that any context sensitive grammar can be transformed into an equivalent
grammar (ie accepting the same language) where the restriction mentioned does hold.
Or maybe I've misunderstood what is going on.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2022-01-23 16:57 -0700 |
| Message-ID | <sskq1b$do3$1@dont-email.me> |
| In reply to | #43951 |
On 1/23/2022 4:10 PM, Alan Smaill wrote: > On Monday, 4 October 2021 at 05:47:13 UTC+1, Jeff Barnett wrote: >> Let P be a primitive recursive function, say with n arguments. Does >> there exist a linear bounded automata that, given the input string >> a_1/.../a_n/A, can determine if >> >> P(a_1,...,a_n) = A? >> >> An alternative question might be, does there exist a linear bounded >> automata that given a_1/..../a_n can calculate P(a_1,...,a_n)? >> >> I suspect that >> >> 1) If the first question is answered yes, so will the second one. >> However, the size of the tape character set will be substantially larger >> in the second case. >> >> 2) The choice of arguments and values representation is not important. >> >> 3) Whether the machines are deterministic or nondeterministic might be >> significant. >> >> Another question that might be interesting is "Can some linear bounded >> automata compute non primitive recursive functions?" >> >> I found nothing to help with the above after an hour of searching the >> net and I also flipped through Martin Davis (actually his book). >> -- >> Jeff Barnett > > I think the answer to the first question above is positive. > Here's an outline argument. > > In Kuroda, Classes of language and linear bounded automata, > Information and Control, 7, 207--223, 1964, there is the theorem (no 3): > "A context free language is accepted by a deterministic linear-bounded automaton." > - the article is linked from: > > https://en.wikipedia.org/wiki/Linear_bounded_automaton > > So it is enough to show that we can describe primitive recursive functions via context-free grammars. > This looks do-able. There are only a few cases needed to generate primitive recursive functions > (constant function, successor, projection, composition and primitive recursion operator). > > Take a relational view of the p.r. functions, so the language statements are of the form > P( x1, x2, ..., xn, y ) where the arguments are all Peano numerals using S as successor symbol, > and P corresponds to name of some p.r. function. > > Then, for example, to define x ^ y via primitive recursion from times, > where the variables are implicitly constrained to be Peano numerals: > > exp( x, 0, S(0) ) and > exp( x1, S(x2), y ) ::= exp( x1, x2, z ), times( x1, z, y) > > For composition, to get x1^(x2 + x1) given exp and plus: > > Pnew( x2, x1, y ) ::= plus( x2, x1, z ), exp( x1, z, y ). > > This outline would need to be fleshed out, but looks to be on the right lines. > > (and at least it doesn't give an obvious way to define Ackermann's function) > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > On a separate issue, the wikipedia page on linear bounded automata says: > "Linear bounded automata are acceptors for the class of context-sensitive languages.[1]: 225–226 > The only restriction placed on grammars for such languages is that no production maps a string to a shorter string." > This claimed restriction seems to me to come from a misreading of the Kuroda paper, which does introduce > the property mentioned, but then shows that any context sensitive grammar can be transformed into an equivalent > grammar (ie accepting the same language) where the restriction mentioned does hold. > Or maybe I've misunderstood what is going on. I haven't thought about this for several months. I gave up the ghost when only Ben responded and had no literature pointers to follow up. As to your interesting rewrite scheme, I'm confused as to why it can be described by a context free grammar. I think there are a few problems: 1) There must be some way to "unify" the variables used, e.g., the three appearances of x1 in your definition of exponentiation. I'm not sure how that is context free. I also don't know how the grammar could enforce the fact that, e.g., times is primitive recursive when used to define exp. I believe that would entail a context sensitive grammar. 2) Do we have a proof that there is a universal bound on the multiplier of input size that restricts the greatest intermediate length of data structure generated during resolution? If not, in what sense is this in concert with "linear boundedness"? 3) I believe, put cannot prove, that all and only the primitive recursive functions can be described/generated by this scheme. This is a real difficulty for me (at this point) because we have so damn few examples of non primitive recursive functions to play with. I know there are "a lot" of them, I just don't know what they are. Side note: If it were true that 3 above is correct, then we have an interesting possibility if we have a way to enumerate what your "grammar" can accept: we can use this approach to show that a function is not primitive recursive if we cannot generate it this way. -- Jeff Barnett
[toc] | [prev] | [next] | [standalone]
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2022-01-26 11:56 -0700 |
| Message-ID | <sss5gf$1ke$1@dont-email.me> |
| In reply to | #43954 |
On 1/23/2022 4:57 PM, Jeff Barnett wrote: > On 1/23/2022 4:10 PM, Alan Smaill wrote: >> On Monday, 4 October 2021 at 05:47:13 UTC+1, Jeff Barnett wrote: >>> Let P be a primitive recursive function, say with n arguments. Does >>> there exist a linear bounded automata that, given the input string >>> a_1/.../a_n/A, can determine if >>> >>> P(a_1,...,a_n) = A? >>> >>> An alternative question might be, does there exist a linear bounded >>> automata that given a_1/..../a_n can calculate P(a_1,...,a_n)? >>> >>> I suspect that >>> >>> 1) If the first question is answered yes, so will the second one. >>> However, the size of the tape character set will be substantially larger >>> in the second case. >>> >>> 2) The choice of arguments and values representation is not important. >>> >>> 3) Whether the machines are deterministic or nondeterministic might be >>> significant. >>> >>> Another question that might be interesting is "Can some linear bounded >>> automata compute non primitive recursive functions?" >>> >>> I found nothing to help with the above after an hour of searching the >>> net and I also flipped through Martin Davis (actually his book). >>> -- >>> Jeff Barnett >> >> I think the answer to the first question above is positive. >> Here's an outline argument. >> >> In Kuroda, Classes of language and linear bounded automata, >> Information and Control, 7, 207--223, 1964, there is the >> theorem (no 3): >> "A context free language is accepted by a deterministic >> linear-bounded automaton." >> - the article is linked from: >> >> https://en.wikipedia.org/wiki/Linear_bounded_automaton >> >> So it is enough to show that we can describe primitive recursive >> functions via context-free grammars. >> This looks do-able. There are only a few cases needed to generate >> primitive recursive functions >> (constant function, successor, projection, composition and primitive >> recursion operator). >> >> Take a relational view of the p.r. functions, so the language >> statements are of the form >> P( x1, x2, ..., xn, y ) where the arguments are all Peano >> numerals using S as successor symbol, >> and P corresponds to name of some p.r. function. >> Then, for example, to define x ^ y via primitive recursion from times, >> where the variables are implicitly constrained to be Peano numerals: >> >> exp( x, 0, S(0) >> ) >> and >> exp( x1, S(x2), y ) ::= exp( x1, x2, z ), times( x1, z, y) >> >> For composition, to get x1^(x2 + x1) given exp and plus: >> >> Pnew( x2, x1, y ) ::= plus( x2, x1, z ), exp( x1, z, y ). >> >> This outline would need to be fleshed out, but looks to be on the >> right lines. >> >> (and at least it doesn't give an obvious way to define Ackermann's >> function) >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> On a separate issue, the wikipedia page on linear bounded automata says: >> "Linear bounded automata are acceptors for the class of >> context-sensitive languages.[1]: 225–226 >> The only restriction placed on grammars for such languages is >> that no production maps a string to a shorter string." >> This claimed restriction seems to me to come from a misreading of the >> Kuroda paper, which does introduce >> the property mentioned, but then shows that any context sensitive >> grammar can be transformed into an equivalent >> grammar (ie accepting the same language) where the restriction >> mentioned does hold. >> Or maybe I've misunderstood what is going on. > > I haven't thought about this for several months. I gave up the ghost > when only Ben responded and had no literature pointers to follow up. As > to your interesting rewrite scheme, I'm confused as to why it can be > described by a context free grammar. I think there are a few problems: > > 1) There must be some way to "unify" the variables used, e.g., the three > appearances of x1 in your definition of exponentiation. I'm not sure how > that is context free. I also don't know how the grammar could enforce > the fact that, e.g., times is primitive recursive when used to define > exp. I believe that would entail a context sensitive grammar. > > 2) Do we have a proof that there is a universal bound on the multiplier > of input size that restricts the greatest intermediate length of data > structure generated during resolution? If not, in what sense is this in > concert with "linear boundedness"? > > 3) I believe, put cannot prove, that all and only the primitive > recursive functions can be described/generated by this scheme. This is a > real difficulty for me (at this point) because we have so damn few > examples of non primitive recursive functions to play with. I know there > are "a lot" of them, I just don't know what they are. > > Side note: If it were true that 3 above is correct, then we have an > interesting possibility if we have a way to enumerate what your > "grammar" can accept: we can use this approach to show that a function > is not primitive recursive if we cannot generate it this way. This is a PS to the above: 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. The only form restriction that must be imposed is the nature of the recursion (otherwise everything will sneak in). It is with reference to more liberal nesting and argument order that the need for some sort of unification is necessary. In the "grammar" you assumed, these liberalizations are not present and with them, I don't believe it will remain context free. Have you given the matter any more thought since your first message? -- Jeff Barnett
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2022-01-27 02:24 +0000 |
| Message-ID | <8735l929vu.fsf@bsb.me.uk> |
| In reply to | #44026 |
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? -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2022-01-26 23:35 -0700 |
| Message-ID | <sstefq$fu1$1@dont-email.me> |
| In reply to | #44035 |
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.
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?
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 don't think those are enough and when you open
things up to where they need to be, all sorts of context sensitive
issues seem to pop up. They might not but that is an issue to be sorted
out and at least proof sketched. I was hopping that Alan had went down
that path and would share his insights with us. I was trying to provoke
a response in that direction.
So I now ask you a question: What am I missing?
--
Jeff Barnett
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2022-01-28 21:32 +0000 |
| Message-ID | <87sft7zgv2.fsf@bsb.me.uk> |
| In reply to | #44044 |
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. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Mike Terry <news.dead.person.stones@darjeeling.plus.com> |
|---|---|
| Date | 2022-01-29 01:56 +0000 |
| Message-ID | <PNGdnaYT_f5IA2n8nZ2dnUU7-aHNnZ2d@brightview.co.uk> |
| In reply to | #44106 |
On 28/01/2022 21:32, 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.
A general comment first - I had previously never got as far as this chapter of Linz, since I stopped
after the TM chapter. So I'm just having a quick look now. I understand Jeff's general concern I
think (and sympathise).
>
> 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)
Yep. (We need to know there is at least one two-place function we can use for "..." and we have p1
or p2 for that.)
>
> 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.)
>
Is this what we want though? The expression evaluates as above, but what is the g(x) such that g(x)
= v(u(x))? I think we need a couple more build-up steps.
Hmm. It's like we need at least the reverse for what you did above, so if h(x,y) is PR, then h'(x)
= h(x,0) is PR. Or better, h'(x) = h(f(x),g(x)) [why be unnecesarily restrictive here?]
Also we don't yet have the right h, but one more Composition gets us that.
h := Composite [ u', p1, v' ]
and h' should be easy?
h' := PR [ um, I'm changing my mind, maybe not so easy :(
OK, I can't see a way in Linz world to get /any/ new 1-place function! So I'd say his definitions
are thoroughly broken. Perhaps we could do without all 1-place functions, and just use 2-place
functions which are independant of the second argument? But then all PR rule applications can only
use the two given 1-place functions z and s. This is just dumb...
>> 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).
But 5 is not a 1-place function, and how can you make it? There is no way unless I've misunderstood
something basic.
And also the very first example from Linz for his rules is this:
add (x, 0) = x
add (x, y+1) = add (x,y) + 1
but that's rubbish for multiple reasons. First x (he means the identity 1-place function, I
suppose) is not yet shown to be PR, and what are the h, g2 and f supposed to be for add (x,y)+1 ?
I mean, that's his very first example and it doesn't work, right? I am less than impressed!
<stomps foot>
>
> 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.
Right now, I'm agreeing with you, but I might change my mind later if I've goofed :)
But there's a more thorny problem that occurs to me. Most authors allow many-place functions, and
so a give 1- or 2-place non-Linz-PR function can be built from a chain including 3-, 4-, 77324-place
previously constructed functions etc.. How do we know that the 1- and 2-place Linz-PR functions
include all the 1- or 2-place non-Linz-PR functions? (Even if we fix any missing rules for 1- and
2-place Linz-PR functions???)
E.g. is it true that every 2-place non-Linz-PR function can be constructed (as a non-Linz-PR
function) ONLY USING 1- and 2-place functions? (I suspect yes, but it sounds like serious thought
is required, and I'm not as tenacious as I was in my younger days!)
>
> 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 get that, but I think in this topic Linz has fallen a little short of the line. He says he is
aiming his text at CS students rather than mathematicians, which makes sense, but here he is not
simply shortening proofs by omitting tedious details - he's missing out key definitions and he's
missed that because nobody looked closely enough during the proof reading (it seems to me...). At
least you'd expect his very first example for his students to work! :)
Mike.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2022-01-28 19:39 -0700 |
| Message-ID | <st29e6$sbc$1@dont-email.me> |
| In reply to | #44124 |
On 1/28/2022 6:56 PM, Mike Terry wrote: > On 28/01/2022 21:32, 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. > > A general comment first - I had previously never got as far as this > chapter of Linz, since I stopped after the TM chapter. So I'm just > having a quick look now. I understand Jeff's general concern I think > (and sympathise). > >> >> 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) > > Yep. (We need to know there is at least one two-place function we can > use for "..." and we have p1 or p2 for that.) > >> >> 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.) >> > > Is this what we want though? The expression evaluates as above, but > what is the g(x) such that g(x) = v(u(x))? I think we need a couple > more build-up steps. > > Hmm. It's like we need at least the reverse for what you did above, so > if h(x,y) is PR, then h'(x) = h(x,0) is PR. Or better, h'(x) = > h(f(x),g(x)) [why be unnecesarily restrictive here?] > > Also we don't yet have the right h, but one more Composition gets us that. > > h := Composite [ u', p1, v' ] > > and h' should be easy? > > h' := PR [ um, I'm changing my mind, maybe not so easy :( > > OK, I can't see a way in Linz world to get /any/ new 1-place function! > So I'd say his definitions are thoroughly broken. Perhaps we could do > without all 1-place functions, and just use 2-place functions which are > independant of the second argument? But then all PR rule applications > can only use the two given 1-place functions z and s. This is just dumb... > >>> 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). > > But 5 is not a 1-place function, and how can you make it? There is no > way unless I've misunderstood something basic. > > And also the very first example from Linz for his rules is this: > > add (x, 0) = x > add (x, y+1) = add (x,y) + 1 > > but that's rubbish for multiple reasons. First x (he means the identity > 1-place function, I suppose) is not yet shown to be PR, and what are the > h, g2 and f supposed to be for add (x,y)+1 ? > > I mean, that's his very first example and it doesn't work, right? I am > less than impressed! <stomps foot> > >> >> 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. > > Right now, I'm agreeing with you, but I might change my mind later if > I've goofed :) > > But there's a more thorny problem that occurs to me. Most authors allow > many-place functions, and so a give 1- or 2-place non-Linz-PR function > can be built from a chain including 3-, 4-, 77324-place previously > constructed functions etc.. How do we know that the 1- and 2-place > Linz-PR functions include all the 1- or 2-place non-Linz-PR functions? > (Even if we fix any missing rules for 1- and 2-place Linz-PR functions???) > > E.g. is it true that every 2-place non-Linz-PR function can be > constructed (as a non-Linz-PR function) ONLY USING 1- and 2-place > functions? (I suspect yes, but it sounds like serious thought is > required, and I'm not as tenacious as I was in my younger days!) > >> >> 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 get that, but I think in this topic Linz has fallen a little short of > the line. He says he is aiming his text at CS students rather than > mathematicians, which makes sense, but here he is not simply shortening > proofs by omitting tedious details - he's missing out key definitions > and he's missed that because nobody looked closely enough during the > proof reading (it seems to me...). At least you'd expect his very first > example for his students to work! :) You had precisely the reaction to Linz that I did, i.e., his add example function was botched. I was too lazy to go through all the tedium but if anything was to be built from Linz, a lot of things needed to be sorted. I look at a few other sources laying on my book shelves and found some that just tossed in arbitrary nesting (except in recursive definitions) with a comment and some did approximately what Linz did. -- Jeff Barnett
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2022-01-29 17:34 +0000 |
| Message-ID | <87bkzuh2eo.fsf@bsb.me.uk> |
| In reply to | #44124 |
Mike Terry <news.dead.person.stones@darjeeling.plus.com> writes: > On 28/01/2022 21:32, 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. > > A general comment first - I had previously never got as far as this > chapter of Linz, since I stopped after the TM chapter. So I'm just > having a quick look now. I understand Jeff's general concern I think > (and sympathise). > >> 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) > > Yep. (We need to know there is at least one two-place function we can > use for "..." and we have p1 or p2 for that.) > >> 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.) >> > > Is this what we want though? The expression evaluates as above, but > what is the g(x) such that g(x) = v(u(x))? I think we need a couple > more build-up steps. I think you are right. Being PR is a syntactic property, not a semantic one so knowing the value of v'(u'(x, y), ...) is not really helpful. > Hmm. It's like we need at least the reverse for what you did above, > so if h(x,y) is PR, then h'(x) = h(x,0) is PR. Or better, h'(x) = > h(f(x),g(x)) [why be unnecesarily restrictive here?] The usual treatment has a general composition rule the allows h to have any number of arguments, so (in Linz's restricted world), one would also have f(x) = h(g1(x), g2(x)) and f(x, y) = h(g(x, y)) in addition to his rule. >> 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 get that, but I think in this topic Linz has fallen a little short > of the line. He says he is aiming his text at CS students rather than > mathematicians, which makes sense, but here he is not simply > shortening proofs by omitting tedious details - he's missing out key > definitions and he's missed that because nobody looked closely enough > during the proof reading (it seems to me...). At least you'd expect > his very first example for his students to work! :) Yes, that's bad. But I can imagine the reluctance to introduce all the notation you need for m-place n-ary projections, arbitrary arity successor functions and so on, only to state, rather than derive, a few theorems. I am surprised, as you are, that this was not picked up, but then maybe his editor was as incompetent as I am! I did, for a moment, think his presentation could be fixed. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Mike Terry <news.dead.person.stones@darjeeling.plus.com> |
|---|---|
| Date | 2022-01-29 19:53 +0000 |
| Message-ID | <st460e$7n0$1@gioia.aioe.org> |
| In reply to | #44132 |
On 29/01/2022 17:34, Ben Bacarisse wrote:
> Mike Terry <news.dead.person.stones@darjeeling.plus.com> writes:
>
>> On 28/01/2022 21:32, 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.
>>
>> A general comment first - I had previously never got as far as this
>> chapter of Linz, since I stopped after the TM chapter. So I'm just
>> having a quick look now. I understand Jeff's general concern I think
>> (and sympathise).
>>
>>> 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)
>>
>> Yep. (We need to know there is at least one two-place function we can
>> use for "..." and we have p1 or p2 for that.)
>>
>>> 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.)
>>>
>>
>> Is this what we want though? The expression evaluates as above, but
>> what is the g(x) such that g(x) = v(u(x))? I think we need a couple
>> more build-up steps.
>
> I think you are right. Being PR is a syntactic property, not a semantic
> one so knowing the value of v'(u'(x, y), ...) is not really helpful.
>
>> Hmm. It's like we need at least the reverse for what you did above,
>> so if h(x,y) is PR, then h'(x) = h(x,0) is PR. Or better, h'(x) =
>> h(f(x),g(x)) [why be unnecesarily restrictive here?]
>
> The usual treatment has a general composition rule the allows h to have
> any number of arguments, so (in Linz's restricted world), one would also
> have
>
> f(x) = h(g1(x), g2(x))
>
> and
>
> f(x, y) = h(g(x, y))
>
> in addition to his rule.
Yes, I think then things are back on track. Although there's still the separate question of whether
some 2-place PR functions might /require/ higher-place PR functions in their construction chain.
(Needs more thought.)
>
>>> 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 get that, but I think in this topic Linz has fallen a little short
>> of the line. He says he is aiming his text at CS students rather than
>> mathematicians, which makes sense, but here he is not simply
>> shortening proofs by omitting tedious details - he's missing out key
>> definitions and he's missed that because nobody looked closely enough
>> during the proof reading (it seems to me...). At least you'd expect
>> his very first example for his students to work! :)
>
> Yes, that's bad. But I can imagine the reluctance to introduce all the
> notation you need for m-place n-ary projections, arbitrary arity
> successor functions and so on, only to state, rather than derive, a few
> theorems. I am surprised, as you are, that this was not picked up, but
> then maybe his editor was as incompetent as I am! I did, for a moment,
> think his presentation could be fixed.
I can't help thinking of when I check my own work/postings - however hard I try to concentrate, I
can't help glossing over certain passages because
a) they are boring to me (perhaps a bit "fiddly", and I know the result
very well myself...)
b) I know what I /intended/ to say, and that was obvious to me, so I
kind of imagine other people will be reading it the same way I am.
(Which is not the case e.g. when a reader is not familiar with the
material and terminology etc.)
... so despite rereading, I end up just seeing what I'm /expecting/ to see, and sure enough that's
the point where a silly error decides to creep in.
Sometimes a complete beginner can be a better reviewer than one of your peers! Maybe that's a
factor with Linz's book. (Not an excuse, but I can see reviewing is tricky.)
Mike.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2022-01-29 13:41 -0700 |
| Message-ID | <st48q6$jjv$1@dont-email.me> |
| In reply to | #44106 |
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. 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 2. all compositions of previously defined PR functions are PR - this rules out recursive definitions on purpose 3. for each n > 0, a formula to build a recursive on one-variable, n-place PR function from previously defined PR functions. 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. -- Jeff Barnett
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2022-01-29 22:13 +0000 |
| Message-ID | <87leyyfaxf.fsf@bsb.me.uk> |
| In reply to | #44143 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Barnett <jbb@notatt.com> |
|---|---|
| Date | 2022-01-29 18:42 -0700 |
| Message-ID | <st4qdo$1aj$1@dont-email.me> |
| In reply to | #44147 |
On 1/29/2022 3:13 PM, Ben Bacarisse wrote:
> 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.
What I'm getting at is that it is possible for a two or more argument
recursive definition to have multiple conditions such as are present in
the definition of Ackermann's function that branch the definition:
A(0,Y) = K(y)
A(X,0) = A(X-1,L(X))
A(X,Y+1) = A(X-1,A(M(X),N(Y))
Here both the second and third lines cause recursion in the definition.
However, I believe that whether or not the above is PR depends on the
choice of K, L, M, and/or N. The only point being is that the definition
of the PR class is typically made by the STRUCTURE of the structure of
the definition, not its numerical properties. One can not be so generous
with the way recursive PR functions are defined. While any old nesting
and composition of previously defined PR functions that tickle your
fancy will be a PR function PR. A more rigid definition of recursive PR
functions is necessary.
After all, what's so neat about the definition of PR functions? It's
that the class is introduced by the STRUCTURE of the function
definitions, not the NUMERICAL properties of the result. This is wildly
different than, say, the definition of continuous functions. I know this
was the fact that initially caught my attention many, many years ago.
> 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.
--
Jeff Barnett
[toc] | [prev] | [standalone]
Back to top | Article view | comp.theory
csiph-web