Thoughts on AI

Thoughts on the future of humanity, usually posted while I am drunk.

Monday, December 20, 2010

More Query Logic

So last night, I talked about the 4 chat rooms. Two being equivalent to the atomic concepts of True and False, the other two being equivalent to the unary functions NOT and IDENTITY. I gave the examples of Russell's paradox being equivalent to NOT, (it negates your assumptions) and I talked about the existence of lonely hearts paradoxes, which agree with your assumption. Off the top of my head one like Russell's paradox: "The set of all sets which contain themselves. I assume this set contains itself" True, it does, by definition. "I assume this set does not contain itself" True, it does not, by definition in assumption. This is a lonely hearts paradox, though these get less attention, poor things. People pay far more attention to snobs.

Anyway, some formalization. Lets get rid of the atomic true and false, and replace them with 4 unary functions. We have Contradiction (=F= atomic concept of False) Tautology (=T= atomic concept of True) Not(=N), and Identity(=I). Each of these is queried with an assumption of their values. The first two act like T and false, so if the second argument of q is the query, then q(T, T)=T, q(T,F)=F, q(F,F)=T, q(F,T) = F. For the snobs, q(N, T) = F, q(N, F)=T and lonely hearts q(I, T) = T q(I, F) = F. So since we are treating these 4 functions like atomic values, then they need to be defined for the others. T and F are both "honest" functions, we can trust them to answer that they are not N or I if they were queried. But can we trust the liars? Will the lonely hearts tell us that they are lonely? Will the snobs admit to being snobs? I think both the snobs and lonely hearts would respond with meta-honesty, which is to say, they would respond be being snobs and lonely hearts respectively. So the query Q(N, N) = N, Q(I, I) = I. In english:
"Is it the case that you are snobs?"
"well..."
"C'mon, its true isn't it?"
"No!"
or
"C'mon its a lie, you aren't snobs are you?"
"Actually we ARE!"
Which is to say, Q(Q(N,N), T) = F, Q(Q(N,N), F) = T Our liars are consistent in their lies.

So you can draw out a 4*4 truth table for TFNI, I haven't yet defined Q(T, I) for instance, maybe its more interesting than T and F being honest, but it really doesn't matter. The key idea of query logic is that while V() is final in its answer, Q() is not. if V(e) = T, then V(V(e)) = T. However, Q(N, Q(N, T)) != Q(N, T). The first is NOT NOT T, the second is NOT T.

So back to pragmatism, what's the big idea? De-construct a person thinking about a paradox. The define it "everything I say is a lie" then they observe it. "OMG! If its true, then its false, and if its false, then its true!" De-construct that last part of what they said; two if-then implications, of the form condition-implies-outcome, input output, a one way direction. The input is an ASSUMPTION (in caps because its that important) and the outcome is a logical conclusion of the assumption, the result of the evaluation or observation of the thing defined. Who holds the assumption? The observer. What is the result of the observation? It is dependent on the assumption, or the state of the observer. So the state of the observer and the system observed are entangled, that's one way to say it. A simple metaphor is that a paradox is like a mirror, what you see in it depends on the state you are in, what you get out depends on what you put in.

So wrapping this up for now, V(e) = Q(e, T) where e is any logical expression made up of T, F, or any of the traditional logical operators. (The principle of the excluded middle holds for v logic, so we never have to ask Q(e, F)). So v-logic is in query logic. Outside of that though, the wasteland.


Sunday, December 19, 2010

V is for Vendetta, Q is for Queer.

So I've been thinking about the language I wrote about last week, attacking it like I attack any problem, decomposing it into smaller an simpler parts. With something like a programming language, this always reduces down to the old 1 and 0, True and False; Boolean logic.

The language I was talking about was based on Codd's relational model, which is formally based on a three valued logic; True, False and Null, where null means the truth value of the predicate is not known. It was a little new to me, so I drew out the truth tables of this logic. I was shocked to see how simple it was: NOT Null = Null, x AND null = False if x== False, Null otherwise, Null OR X == True if x == True, Null otherwise, and so on for IMPLIES, EQUALS, and XOR. Relational 'purists' claim that Null never should have been part of the model at all, but after deep contemplation I conclude that these people are fucking dicks. If a database user doesn't know a customer's address, they should just enter that into the database as Null. If these purists had their way, the user would have to construct multiple tables, to deal with all the contingencies of unknowns, just so things would be a little easier for these 'purists'. Purist, of course, means lazy ass: Its been show that an n-valued logic is always reducible to a 2-valued logic, so the only reason anybody would reject a 3 valued logic is that they are too lazy to reduce it to 2 valued logic to make a proof based on boolean theorems, though they are more than happy to pass hardships on to end users.

Anyway, I am digressing. This blog post is about a concept I came upon in my reductions to the boolean spheres,(not 3 valued, but boolean) something slippery I finally reduced down to that realm. I call it q-logic. You could call it "quantum logic" and it would be dead on accurate, but I prefer the term "queer logic". Less intimidating, right? Nobody is afraid of queer, right? It deals with the hidden function 'v' in the old school boolean model.

Quick summation: ask the question, is 'True' == 'True OR False'? (T==T|F) The quick mind answers 'yes', thinking of the OR logic table, but what we are formally asking is: "is the expression 'T' == the expression 'T|F'? The answer is no, the two strings are different. In formal logic, the function 'v', which stands for "eValuate" is used to reduce logical expressions down to their end values, so that (v(T) == v(T|F))

its like asking: does "5" == "3+2", no, the two strings are different. "5" is a different 'word' than "3+2". One has 1 character, 1 has 3 characters. But v(5) == v(3+2), where the function v actually adds the two terms in the string of characters "3+2", so the two resulting strings "5" and "5" actually are equal.

So it turns out, the function 'v' plays a secret and critical role in logic and math, one taken for granted. Anyway, the long point is, my reductions of the logic I am picturing have lead me down to changing the nature of the function 'v'.

My q-logic works thus: Values can be either collapsed or in superposition. The values that are collapsed are the traditional logic values T and F. The easiest way to explain intuitively here is to depart into a metaphor. While 'v' eValuates, the function 'q' Queries. Let us consider two chat rooms, Gaga chat, and Sports chat. You log into the chat rooms, and to find out what they are talking about, you must ask (query) the people who have been there. The predicate you ask is, "are you talking about Lady Gaga?" Gaga Chat users will answer "True", while Sports Chat users will answer "False". If you ask the opposite, "Are you NOT talking about Lady Gaga here"? The answers will be opposite. For the predicate given, these two answers conform directly to the traditional logic concepts of True and False, and support the Law of the Excluded Middle needed by Boolean logic. However, q-logic introduces two new chat rooms: The Lonely hearts club, and The Snobs.

If you go into the Snobs and ask them if they are talking about Lady Gaga, they will answer "False", even if they were: They want you to go away. If you ask the opposite, "did I find a room where people AREN'T talking about lady Gaga"? They will answer that they were talking about her. They just want you to leave.

The lonely hearts club is quite the opposite. They will answer that they WERE talking about her even if they weren't, just to get you to stay. And they will answer that they weren't talking about her even if they were, if you ask the negation of your original predicate. In other words, they tell you what they want to hear, they just want to talk to you.

So, for the predicate, the Gaga chat room = T, the sports chat room == F, the snobs == NOT and the lonely hearts == IDENTITY. For the last two, the answer you get depends on the question you ask. You "collapse the superposition" by querying them.

I HAVE COME TO DROP BOMBS

So in the 'q' rather than 'v' context, what is the q() Russel's paradox? T? F? No, SNOB. Assume S, the set of all sets which do not contain themselves contains S. Is my assumption correct?
"False".
Assume S, the set of all sets which do not contain themselves, does NOT contain S. is my assumption correct?
"False".
Russel's paradox, like the snobs, just wants you to leave. It negates your predicate. "Lonely hearts" paradoxes are out there as well, they are just harder to detect, as the human ego is more inclined to notice its unconditional rejections than its unconditional acceptance.

The real question is, just as Russel's paradox = NOT, is there a paradox which == IMPLIES, AND or OR? Such a paradox would make paradoxes under Q Turing complete. You could construct, for instance paradoxes that add numbers, based on the truth values you assumed for the original predicates. using q(). (remembering you must assume initial values with q and ask if they are indeed correct).

But lets take this back to the ground, what am I really talking about with this queer/query/quantum business? We are talking about observations where the result of the observations is entangled with the state of the observer. The observer must choose to ask if P is correct, or ask if P is incorrect, and the answer they get depends on which of those two choices they make. The choice they make defines their state, which is entangled with the state of the outcome.

Now given the 4 "chat rooms", it seems obvious to me that all of this is reducible, like n-valued logic, to boolean logic. but when 3 valued logic is integrated, with Null, an interesting possibility becomes part of it all: A fifth chat room, where asking the question reduces the answer to either T or F for the predicate, but which one will be chosen is unknown (Null) and undefined: Its a roll of the dice.

This is the thing that is fundamentally new, and not reducible to 2-valued logic: because it is here where the system must shrug, and admit the unknown, which makes that choice. This atomic concept is fundamentally new, and powerful, and beautiful.

Selah.

Addendum: Consider the two-slit experiment: the evaluation/query (v|q) of a particle going through one slit will collapse it down to either the slit observed or the other one, (T|F but NOT Null, the outcome is known) but there's no telling how that choice is made, its made by factors beyond the predictive capability of the system. Meher Baba: "There are four levels"

1) Ignorance of Ignorance: You think you know it all, but your model is completely fucked. You will fail.
2) Ignorance of knowledge: You've learned humility, but you still aren't aware of what your missing, what it is you don't know.
3) Knowledge of Ignorance: You know exactly what you don't know, and this is extremely empowering.
4) Knowledge of Knowledge: You've filled in those gaps you identified, you are profoundly powerful.

In this schema, 3 is a damn good target.



Monday, December 13, 2010

Dr Zorgs thinking machine.

So I have been checking out Prolog lately. Prolog is a programming language from the early 1970s. It is based on a model fundamentally different from all the popular modern (procedural) programming languages, in that its declarative. The most succint explanation I have heard is: "You tell procedural languages how to solve a problem. You tell declarative languages a set of declarations, and then you query them, and let computer solve the problem". On a pragmatic level, what it looks like is you make declarations, which you then query. For instance:

assert(likes(bob, alice)).

Is a declaration that a relationship "likes" exists between Alice and Bob. You can then query it by asking it
?- likes(alice, bob)
>true
?- likes(alice, X)
>X = bob
Those queries could be read "does alice like bob?" and "who likes alice?"

There are many more features, recursion, lists, etc. Its a Turing complete language, you can do anything in Prolog that you can do in a procedural language, but its model is fundamentally different.

As far as market share and real use go, Prolog resides in the dustbin of CS history. Like any 40 year old language, the debugging is nightmarish. Also, its hard to formulate normal problems in terms of it, and unlike procedural languages, the programmer feels completely divorced from the computational complexity of their own code... Its unclear how to write for performance. The current crowd who keep it alive are the math nerds, the theorists. While this is great, there is this air of academia around it, it has the sense of one of those academic languages that asks what its users can do for it, not what it can do for its users.

But is a failure? Not at all. The thing about Prolog that matters is when it came out: Around the time of Codd's relational model. There was active, pragmatic research at the time about the question of how to store data. The relational model had the advantage of coming out of IBM, and thus being presented with pragmatic business concerns at the forefront. As a result, it is the model for all the relational databases of our time, and will probably be around 100 years from now. Its popular and here to stay because its too useful for too many things to go away, and those who really understand it understand its not about tables, its expressive enough for any object oriented languages and beyond (as argued in Codd's third manifesto) even though SQL is likely to go the way of the Dodo.

So how does this relate to Prolog? Its simple. 90% of current solutions have two parts, a procedural part (manifest in the code, Java C# whatever) and the declarative part (manifest in the database that the app calls on, usually through SQL). This separation isn't by design, its just that nobody ever came up with a language that is both procedural and declarative.

(I have to back up here and note that program language classification are ill defined. Strictly speaking, Java, C# and C++ are Object-oriented not procedural. But all OO talks about is how data is encapsulated. The difference between C++ and C is much smaller than the difference between C++ and Prolog/SQL. So when I say procedural, I am referring to all the languages where the programmer specifies a procedure for producing an output, rather than a set of declarations and queries upon them, like Prolog SQL)

Kudos to Microsoft for trying, but its really not been done yet. The next language to die will be SQL, and its replacement will be a unified Turing complete language with both procedural/OO and declarative (SQL like) behavior. In this language, every library (DLL) will be a database file, every database will be a library. Learning new APIs and new Schemata will be one in the same. The database admin will be the programmer and vice versa. The user who can edit certain database tables through a GUI will be a (highly limited) code contributer. Object access control and database security will be one in the same.

The key is that part about users as code contributors: This is about seeing clearly what's already going on: Application users dictating application behavior. Good web apps do it, popular news stories go strait to the top, etc. But the next step is beyond that, things like CMS systems where the users really are application designers with some restrictions. The clarity and introspection of the relational model offers promise to do this securely, avoiding the insanity of letting users write procedures with all their ambiguity and shadowy behavior.

Next Steps: Obstacles to be Overcome

To create such a language, we must borrow some things Prolog got right. You need to have the idea of a virtual table. This is a database table that doesn't actually exist constructed in memory, but can answer queries about itself like membership and so on. Consider the following Prolog:
assert(cubed(X, Y) :- Y is X*X*X).
This reads "if Y equals X times X times X, then the relationship 'cubed' exists between X and Y. " Prolog then answers the query cubed(3, 27) as 'true', and answers cubed(3, Y) as 'Y=27'. However, it is unable to answer the query cubed(X, 27) because it is not smart enough to invert the definition and compute a cubed root of 27. So the answer is like a table you can run queries on, except the query SELECT from `cubed` WHERE Y = 27; just doesn't work, you can search by X, but not by Y.

This is a fundamental issue with accessing procedural computations as tables: Some can't be inverted, some can. It would be easy to write in cube root functionality, but larger issues exist, such as when a function can be done in P time but its inversion can only be done in NP time.

The key here is to think of it in terms of database access limitations. If a db admin says you can look up a customers name from provided SS number but not SS number by provided name, that's a rule you can do your job around. If God says you can look up an integer product in polynomial time but not its factors, that's another rule you can do your job around.

You do want the language to be able to find inversions, simplifications and so on. How doable that is I do not know. In its simple forms, you want users to be able to provide inversion f'(x) for their own function f(x), and you want it to be caught if the f(f'(x)) != x. Ideally you want to be able to prove that provided f'(x) is indeed the inversion of f(x) at compile time. The difference between proving and producing the inversion of a function seems slim.

The other thing you need is a language really oriented natively toward collections and sets. Set constructors need to be common objects, especially where inverting functions goes, the kind of functions that lose information like 27%5 = X. inverting that, Y%5 = 2? The natural numbers that answer that is given by the set constructor n*5+2 for n in N. Even for infinite N, this function will list all the y that satisfy Y%5=2. It acts like a you queried a table, and the set of rows which satisfy the condition are infinite, but only exists as a tiny little function in memory.

The deep integration with sets, where operations are done not in the order specified by the procedure but simultaneously, is an important part of the new vastly multi-core computing paradigm. The key to such a language is to make the programmer aware of his interaction with the multi-core architecture, so he or she can plan around it consciously, not to make the adaptation happen behind the scenes invisibly, which is a mistake I think current solutions are making.

This post was completed and not published about a week ago.


Sunday, December 05, 2010

Last blog post in a while.

So I was working on this elaborate post, but I'm spending too much time in front of the computer and getting carpal tunnel. I need to get away from it, do some yoga and get out of the house. So before I do that, I want to throw out all the points that was going into my elaborate post in a really ugly and strait forward way, so I have access to them later.

I was writing about the awareness of the philosopher, the guy who has the outside view of society because he is something of an outsider, and how the cost of that outside view is his ability to function in society, he is something of a weirdo. I gave a metaphor about a man who wishes to seduce women, and analyzes female psychology to the point where he sees them as machines to be manipulated, but the cost of this awareness is having that same awareness of himself... and being forced to see his relationships as machine interactions, passionless and void of the what he sought when he learned to seduce women in the first place. This is like the scientist, the philosopher. In gaining understanding of the thing desirable, the value of thing desired is thus diminished.

But really, its all part of a much large thing, a theme I have touched on again and again: The limitations of the mind. The philosopher must sacrifice his rich experiences of daily life for his vast overview of the world, he cannot have his cake and analyze it too. He is no better, no greater a man that a simpleton who eats cookies and lives for them: Its merely that the philosopher has reduced cookies down in his mind to very little, while the simpleton's experience of them is vast, he explores new worlds in every taste.

Now all this ties in to something I have heard a lot of lately: people talking about other's voting their interests. The last time was in the context of a progressive website, a guy wondering aloud why so many poor people vote for things which benefit the rich, seemingly against their own interests. Others wonder why the rich vote against global warming control when GW will damage their profits, and right wing sites wonder why people vote against their interests by seeking government which is large and detrimental to the economy that employs them. What's apparent is that "what's in my best interest" as a voter is not well defined... In fact the striking thing is not that this is true: the world is a complex place, its hard to figure out long term outcomes. The striking thing is that I am not aware of any mechanism AT ALL by which myself, or any other "average Joe" voter figures out what is in their own best interests. We simply assume it based on an gut feeling model, which is not held up to any scrutiny. Its amazing how its like this for almost EVERYBODY. Now some corporations crunch numbers regarding policies, and get lobbyists to push for this or that based on projected short term outcomes so they have something, a stats model very limited in scope, but its more than the vast majority of people have.

Now again, I am not putting much time into this so I have I don't have time to explain the following:

An evolutionary game will go through numerous zero-sum iterations until it stabilizes into a non-zero sum game. Evolutionary games are far more ubiquitous than just lifeforms, the include ideas and economies.

Now, thought experiment: What if some mathematically sound "best interest determiner" could be constructed? The machine would take inputs about its users, and determine, collectively the best outcome for all. We thus assume a priori that its basically an oracle. It doesn't have to be perfect, it just has to be good, and know just how good it is.

Now, one of two things must be true about the machine. Either it decides that the best interest of the world isn't for everybody to know about it, and it just interacts with a small group of people to do things, (maybe orchestrating a conspiracy, zero sum game style) or things have reached a state of equilibrium, its grown out of zero sum game mode and decides that the best interest of everyone is for everyone to be able to talk with it, to figure out their own best interest. Its the latter I'm interested in this thought experiment, when it gets to that state, what does it say?

Openness, Glasnost, has been the driving new political force in the last few decades, and has manifested through society in tandem with the advent of the Internet, open source movement, and more things. In its simplest form, it advocates openness and transparency in government: It says the people should be able to know what's going on, and seeks to make information available, as it posits that accurate information will let people make the most informed decisions of self interest. Looking at all the people around us seemingly acting against their own self interest, an experience we all have, this seems like a noble goal... And surely its true, less MIS information would help everybody. But what's unclear about our oracle machine is if it would see things the same way. I have known many mentally disabled people, and have cared for some of them. One truth I have observed is that telling them the truth is often not in their best interest, but rather a simplification, even a deception that causes them to make the right choices is often better off for them. Its a painful truth to say, because I resonate massively with the Glasnost ideas.

Its been haunting me for a long time. I wrote about in this post here. In the Matrix The ORacle lies to Neo in order to invoke a change within him, symbolized by the movement of letters in his name from NEO to ONE. Was it a splendide mendax (I heard this term on CNN, apparently mendax was Julian Assange's hacker name) A lie told because it allowed the listener to approach a truth he could not comprehend without it, that only by not believing he was the One would he become the One.

This takes us back to the philosophers quest: To know truth, to seek truth, to speak truth. He does it not because he wants to, but because he has to. Its what he is. Why? Because Truth is good, truth is light. And what when he sees the limitations of his own mental vessel prevent him from knowing it, and the best he can hope for is an optimal approximation? Well, that's Mitchell Heisman's story.

So what of those left behind? What is there to do? Manifest an aspect of truth. Not the totality, but just an aspect. Maybe that's what we've all been doing all along.

Bye blog, I'm off to do yoga.