# Relational Algerbra & Falcon

39 views

### Giancarlo Niccolai

Feb 7, 2018, 4:25:32 AM2/7/18
to FalconPL
A fast debrief on what I have been up to in the last days and why I have been so silent.
As I anticipated, I want to dedicate the new incarnation of Falcon to AI and evolutionary programming (without hindering the generic programming language aspect). The 1.0 version, never released but basically ready, was already much going in that direction.
One element that I wanted to add to the language and I wasn't still unsure about whether to add it as a library component or as an integral part of the language was a relational engine I called Concept-Relation-algebra. It's an extension of the work I published for my doctor thesis.
(Note: I have a title as Doctor in Economics under the old Italian academic curriculum, which is approximately equivalent to an American/UK Master, or a PhD without a field research).

Two Fridays ago, I met up with a representative of GRAKN.AI https://grakn.ai/ a company that developed an open source relational engine.
The logic behind GRAKN is very akin to my CR-Algebra: it describes knowledge as a network of relations, and through inference rules on this relations generates new knowledge.
The main difference is that GRAKN has typed connections, while CR-Algebra has typed and weighted connections. For example, In GRAKN, you can describe the relation between to people as friends, enemies or none, while in CR-Algebra you can describe HOW MUCH friend or enemies they are.

In other words, a CR-Algebra graph is to a GRAKN graph what fuzzy logic is to boolean logic.

I have a numerical model working, but I have been struggling to find a mathematical description of the CR-algebra for several years now.

Inspired by the fact that GRAKN models have so much success in AI, I went head down trying to complete the missing piece of the puzzle: finding a math description under which I can provide a formal proof of CR-Algebra.

I first dug into Universal Algebra, as I first conceptualized CR-Algebra as a sequence of operations on complex operators, kind of what you do in quantum mechanics with objects as the Hamiltonian operator. However, I realized that the operator concept is not powerful enough to capture some aspects of the CR-Algebra.

I then turned to lambda calculus, and the thing snapped. Lambda calculus can be also studied as a special lattice in Universal Algebra, but the focus on the procedural aspect of functions (what they do, step by step), instead of the relational aspect (the fact that they associate points in a vector space to points in another vector space) makes it a much better tool to deal with CR-Graph.

I have now a way to express CR-Graphs as sequence of Lambda terms, instead of relations between concepts, and this means that every term (function) can arbitrarily operate on the previous part of chain in the sequence. A minimal extension of the lambda theory (i.e. the addition of a few symbols that could be reduced to the basic lambda theory) will easily cover all the cases of the CR-Algebra.

Moreover, the functional structure of the Falcon 1.0 engine (the organic VM) is perfect to deal with lambda terms: it simply "thinks" in those terms.

I had already a non-mathematically sound document on CR algebra, I just have to stuff in the lambda calc things.

A final note: to describe how powerful the CR-Algebra is, just suffice to know that systems of equations are a special case of CR-Algebra; or in other words, any system of any kind of equation can be expressed in CR-Algebra, while not all CR-Algebra could be expressed in equation systems. This is why I think it's worth to have our Falcon2 engine being natively able to deal with this structure, an extension of lambda calculus.