Turing completeness, and generation of non-Turing complete code to solve problems that would typically require Turing complete languages
- From: "pantagruel" <rasmussen.bryan@xxxxxxxxx>
- Date: 22 Aug 2006 06:04:26 -0700
Hi,
This message may seem somewhat cryptic, but I am trying to abstract
from particulars relating to a particular non-Turing complete language
to general matters.
In most languages if one has some data in a field of text consisting of
a certain length which has to be analysed in some way (for example
detecting if parts of the line have specific values) it is normal to
loop or recurse through the line until the end is reached, and
determining if all the relevant parts of the line are as they should
be.
In a non-Turing complete language this may not be doable (I suppose
most non Turing Complete languages lack looping or recursing abilities,
but there may be some that have these but lack other things).
However if one knows the upper bound of the data, for example knowing
the exact length of the data one can generate a program in a non-Turing
complete language to handle the problem.
The problem that I specifically had that led me to doing this was:
A field of text that can be up to 43 lines in length, no line greater
than 35 characters in length. Lines have been normalized to a linefeed.
Solution using non-Turing complete:
Generate code consisting of splitting string at linefeeds, if string
between linefeed 1 and 2 not greater than 35 and not less than 1 do not
raise error, if string between linefeed 2 and 3 not greater than 35 and
not less than 1 do not raise error... and so forth.
Because of the nature of the language, which was a rule based one,
rules for linefeeds analysis greater than the number of linefeeds in my
actual data were not called thus not creating error conditions.
What I'm wondering is if there are any studies on the Generation of
Non-Turing complete code via Turing complete languages to run against
data where the bounds are known as in this situation? Can one prove
that code which can solve any computation can be generated for a
language that is Non-Turing complete by a Turing Complete language?
What features must a non-Turing complete language lack in order for it
to be impossible to generate code in it to handle any calculation?
Are there special requirements for the language in which code is
generated? As in the example above where I know the possible upper
bound of the data but in which data that did not reach this point did
not raise an error because the rules were not called.
.
- Prev by Date: Re: basic query regarding NP Complete...
- Next by Date: Re: SQL query plan question
- Previous by thread: Graph theory problem
- Next by thread: Re: SQL query plan question
- Index(es):
Relevant Pages
|