To frame or not to frame in parallel computing
Return to home page
Comments Loading...
2008-08-06

Previously I talked about how we might integrate 'global state' in to our Smalltalk programs by embracing the semantic web and upgrading our understand of data to information. I briefly talked about the semantic web and I mentioned in passing the idea of frames.

I thought I'd spend a little time talking about frames, interpretations of reality and how that relates to the semantic web, logic programming and programming in general.

First off, we need to start with the most basic concept - saying something about something else. In fact, the core principle of RDF (Resource Description Framework) is that you can say stuff about something. Topic Maps, another way of talking about 'stuff' says this about a topic:

"A topic in its most generic sense, can be any "thing" whatsoever - a person, an entity, a concept, really anything - regardless of whether it exists or has any other specific characters, about which anything whatsoever may be asserted by any means whatsoever."

So at this lowest level we start to get pretty vague about stuff. In fact, the idea is to be as vague as possible so that when we start saying concrete things about other things, the vagueness quickly disappears.

In RDF, we break up this idea of say stuff about stuff as 'triples'. A triple is the combination of three things: a subject, a predicate and an object. The subject is this 'thing' we keep wanting to talk about - the object is what we're going to say about the subject and the predicate is the scope as to which the object applies to the subject.

For example, (subject) "example.org" was (predicate) "registered" on (object) "August 16, 1999". Naturally the subject, predicate and object are all things too. This gives us a nice recursive world. The semantic web - RDF, Topic Maps, etc, all share this idea that facts are global. You can say something within a scope that can be arbitrarily defined - but everything is 'out there' to be interpreted.

What that means is if I nickname you 'schnoop', anyone who can access my database knows it and can choose to interpret that 'fact' in anyway they want.

In steps the confusing world of frames. Frames are a reasonably old idea now - they are based around understanding and artificial intelligence and the capture of information. There is a key distinction between how frames work and the semantic web works - frames are always localized. What this means is, if *I* say your nickname is schnoop, only *I* can ever know that I think that. For you to know that I think that, we have to *exchange* information.. and then *you* know that *I* have nick named you schnoop... the factoid has actually changed in the exchange.

This creates a bit of a problem - because all of our data processing research and logic programming has been based around the idea that we freely exchange information and that we do so often. But if we really treat the world that way, we create unreconcilable conflicts when two factoids contradict each other. Humans deal with this problem by having separate brains that can all make a judgement on the information presented and bias one piece of information over another. Some of us are even good at logic and are capable of discerning false information with enough information to the contrary that can be backed up by other independent sources.

The RDF world, though, wants to treat the internet as one giant brain. A giant brain fed by millions of independent brains that quite often have information to share that is in direct contradiction with each other. And sometimes this information cannot be proven right or wrong one way or the other.

Frames tells us we need our own brains.. but such a computer would have to be relatively persistent in its understanding, yet have significant barriers to information exchange, deliberately to avoid contaminating its own understanding of the world. In programming, we call this encapsulation - yet this is on a whole new level. In this version of encapsulation, each running process has its own understanding of the world and terminating the process is tantamount to killing a brain.

We probably don't have a problem with that initially - but imagine an AI that has been running for a year, collecting information and processing it symbiotically for you. We have programs like that now - email spam filters for example. Can you imagine how it would be to suddenly lose that AI program and have all the spam poor back in to your inbox? Disastrous and frustrating and infuriating no doubt.

So the properties of these programs are interesting. They vary on what they store considerably, can learn new things, inference things, exchange information through some sort of messaging, are persistent and very long running and can probably even be transmitted from machine to machine.. and can no doubt be encoded in themselves.

Given the tendency for such a program -not- to exchange information, the ability to keep such a program 'alive' becomes really important and completely the opposite to the way computers run right now. We kill them constantly, they crash - we reboot, we buy new ones, we throw away old data.. we delete things. And just how many of these programs would we have running anyway? Does 'forking' a new process mean creating a new 'being' inside your computer?

Research in to the way we humans think suggests that most of the parallel computing going on does very little direct information sharing, but lots of information exchange. It's easy to imagine that each independent process would not treat something given to it as its own 'thought' but indeed, an input to be considered and reinterpreted. Whether this is true or not remains to be seen - but that's how we treat programming now.

When two programs decide to share information, they do as (typically) at verbatim. If record #10s name is "Bob", that must be truth. Program A gives this to program B, who then sees record #10 as Bob as well.. instead of seeing it as record #10 called "Bob" by program A. This distinction really turns our understanding of data models upside down.. heck, you don't model this sort of thing, it evolves itself.

Frames means there is a chain of information inside the computer that even the computer programs don't traverse - they are deliberatelly not given access. Let's say I receive an email - the program that receives the email records this fact.. the time, the source, the destination, the subject, the contents.. so on and so forth. It then passes this information on to another 'brain' that does spam filtering, which then passes it on to another brain that does semantic sorting which passes it on to another brain which presents the information to you.. your brain.. for you to read. Each program has its own 'frame of reference' on the information. The spam filter rates the email, yet the original program can't see that and it's unlikely it'll pass that on to the semantic organizer.. in fact, it probably won't tell the next program interested about a spammy email at all.

But there's more being recorded here - it might be interesting for the semantic organizer to know when it received the email from .. wherever it got it from, which is a different 'received' timestamp to the one that the original email client had for the actual email. The records are linked, the frames of reference are stacked on top of each other - but that doesn't mean they share their information. In fact, the only thing they truly share is the identify of the thing they're working on. Identity is paramount. Every piece of information has the same unique identifier. In "the real world" this is achieved by matter existing in only one place at one time and our brains ability to identify it either through direct observation or smart inferencing.

There are experiments where each object in a room receives a small irradiation and then robots can measure that radiation to uniquely identify things. In the virtual world, 'stuff' is so ephemeral we put a great deal of importance on identity... the least of which is because if we don't, we'll lose it in our physical ram space!, memory address is the lowest form of identity, but we usually work at a higher abstraction than that.

But even frames of reference cannot agree on identity. The original email client that sent the email has a different id for the email than the email server that sent it - than the email client that received it - than the database the email user program receiving it uses.

What conclusions can we make from all this? Well, functional programmers have been telling us they're the future for a while now. Logic programming makes dealing with ever-changing data structures easier. Statistical machine learning is really good at finding useful patterns in non-uniform data.

What it tells me is that we throw running programs away too easily. It seems like almost every program should be a persistent small entity that can start and stop like a suspended laptop on a dime and can be transported around safely from machine to machine and probably should do so often to avoid accidental deletion. It also tells me we should talk to these programs at a higher level than we currently do - we should talk to them with information, not data, we should program them for knowledge, at an information level, not for information at a data level and that there would be a standard messaging paradigm for these programs and these inherent properties would be hard coded in to their core being.. so this would be one very very high level language indeed.

In many respects, functional programming languages that use copy-only and no-memory-sharing, such as erlang, are steps in the right direction here.. but the formalism that we impose on ourselves with data structures probably needs to disappear. And the idea that multi-core CPUs means we can ephemerally use 128 cores to compute something is not really the way we would want to work.. how about 128 unique brains communicating in parallel with their own persistent views on reality? There's a big difference between parallel number crunching and parallel -thought-.

I want my computer to one day be my symbiotic partner - and if hardware continues on its current path, that computer-brain won't be *a* brain but hundreds and hundreds of them, feeding up in to my one master brain at a level useful for my day to day living.

That's a future worth striving for.