Anytime Interpretation (AI)

Just follow the yellow brick road. The image was created with InkScape in about 34 seconds, exported as png and represents the idea of recursive programming to a goal. It might seem that the things I investigate are a jumble of code, genetics, algorithms, games, methods, neuroanatomy, genotype expression, organisms, blended images, physics, mathematics , matrices, make files, gate arrays, and process. In fact they are all the same in that they have a common structure that comes from logic. To me the game or the life are both systems and understanding one leads to understanding the other.Now I remember, I wanted to make a "divide by zero exception" and see what happened.(And below is the result, I need to add that to sighandler.)


CODE: i=0;failComp=1/i;

RESULT: Floating point exception

And the answer to my own question:


Apoptosis is likely on SIGFPE!
static void signal_0(int signum, siginfo_t* info, void*ptr) { static const char *si_codes[3] = {"", "SEGV_MAPERR", "SEGV_ACCERR"}; ucontext_t *ucontext = (ucontext_t*)ptr; char syscom[256]; sprintf(syscom, "Divide by zero is not allowed!\n"); sprintf(syscom, "info.si_signo = %d\n", signum); sprintf(syscom, "info.si_errno = %d\n", info->si_errno); sprintf(syscom, "info.si_code = %d (%s)\n", info->si_code, si_codes[info->si_code]); sprintf(syscom, "info.si_addr = %p\n", info->si_addr); sprintf(syscom, "reg[%02d] = 0x" REGFORMAT "\n",(int)0, (long unsigned int)ucontext->uc_mcontext.gregs[0]); printf("Apoptosis is likely on SIGFPE!\n"); exit(0); }
memset(&daction, 0, sizeof(daction)); daction.sa_sigaction = signal_0; daction.sa_flags = SA_SIGINFO; if (sigaction(SIGFPE, &daction, NULL) < 0) { perror("sig_0_action"); return 0; }

I happened on a new free online resource while going over Turing things again. Anytime Algorithm at FOL DOC.. I am testing recursion in the program creator today. It isn't always that efficient to have a function which calls itself to achieve a result, but in this case it seems the perfect algorithm. To me programming looks like "bracket and branch". Essentially a tree, but in the detail is the swirly vortex that is the real structure of the tree. That is the hidden cats that make it all work. A cat tree.

So if I have a function "Bracket" which calls "Bracket" which calls "Bracket", and it operates as thus: On entry it writes a left bracket to the stream. It checks if the iterator is zero and if not it (1.)-[decrements the level] and (2.)-[calls "Bracket" with the new level], otherwise it closes the bracket and returns and it does not know or care whether it is the last, first or somewhere in between. Hmmm ,naught, knot, not ! nothing isn't can't, doesn't exist. So that is how I roll the dice.

/* I am making this up as I write. */ /* So if it doesn't compile, that is why. */ /* Totally untested code for demo. */ void Bracket(int depthLevel) { printf("{"); if (depthLevel>0){ depthLevel--; Bracket(depthLevel) } printf("}"); return; }

The net result should be N = depthLevel of paired brackets. Pretty simple, but when combined with other algorithms, it creates some interesting structures. {{{}}}. It is just a silly example of recursion in practice, but the power of it is astounding when applied to some common problems. It allows a kind of skip to the end and go back reasoning. Backward induction is what it is commonly called. It can be very effective in practice if applied properly. In this case I see a program as branches and loops. A branch must come back and at the lowest level, a program is just a straight action. For example, a=b; is in method z, which is called by method y, which is called by method x. So it is easy to do a=b; and return. It would look like this: DoMethod(DoMethodStream); It either continues the stream or ends on a single action. It is well suited to my automated programing. I have a stream that is either function, method or action and it branches method on that stream. The program is defined as a single "tape" or stream and creates the entire program as a result. It makes the application of nested elements easy to use.

When I am programming normally, I must make sure that I close each bracket and yet it always must be done and it is easier to "push" the end each time I go deeper and then just pop back to the next level. `pushd ./`, `popd`. It is simpler with an automated process, because it keeps its state on the stack, so to speak.

It will probably be a couple days before I can get the AI to start solving the puzzle consistently, but after that it should be able to apply an analogous method to solve general problems of larger scope.

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen