Skip to content

Implement an evolutionary algorithm to prove hidden relationship between a given predicate and a given concept #1009

@andre-senna

Description

@andre-senna

We want to prove the existence of an expression $(Evaluation \> P_{target} \> C_{target})$.

$(Evaluation \> P_{target} \> C_{target})$ is not present in the knowledge base but it's in the "test" knowledge base, i.e., we know a priori it's true.

Since $(Evaluation \> P_{target} \> C_{target})$ is not present in the knowledge base, we need to find a combination of expressions which implies in $(Evaluation \> P_{target} \> C_{target})$. We'l do so by making a query to the QueryEvolution agent.

High level algorithm

We'll apply a query evolution request in an iterative algorithm which also includes complementary link creation. These are the steps of the algorithm:

  1. Initialize ContextBroker
  2. Pre-processing
  3. Run a round of complementary links creation
  4. Run query evolution
  5. Repeat steps 3. and 4. until a stop criterium is reached

ContextBroker initialization

ContextBroker must be initialized to make Evaluation importance depends on Concept and Predicate importance's.

LINK_TEMPLATE 3
    Evaluation
    VARIABLE P1
    VARIABLE C1

{(toplevel_link, P1), (toplevel_link, C1)}

There's no need to spread initial activation here, so the activation spreading parameter can be set empty.

Pre-processing

In the pre-processing step we must accomplish two tasks: (1) initialization of STI and (2) creation of basic complementary links.

(1) must bump STI of all concepts and predicates linked to the PTARGET and CTARGET via some Evaluation expression:

OR 2
    LINK_TEMPLATE 3
        Evaluation
        ATOM PTARGET
        VARIABLE C1
    LINK_TEMPLATE 3
        Evaluation
        VARIABLE P1
        ATOM CTARGET

(2) Should re-use the link-creation code to compute "equivalence" between CTARGET and every other concept in the knowledge base. Then we must do the same for PTARGET computing "implication" from/to all the other predicates in the knowledge base. But, for "implication", we must consider equivalent concepts (with the proper strength being taken into account) as well as actual concepts linked to a given predicate.

Link creation

We'll create 3 types of complementary links.

  1. Equivalence

  2. Implication

  3. Evaluation

  4. and 2. must follow the same implementation we have in our current code. As for 3., the idea is to select two evaluation links pointing to the same concept and create a new Evaluation with the conjunction of the two predicates pointing to the same concept. So the query would be like this:

AND 2
    LINK_TEMPLATE 3
        Evaluation
        VARIABLE P1
        VARIABLE C1
    LINK_TEMPLATE 3
        Evaluation
        VARIABLE P2
        VARIABLE C1

Given a query answer to this query and considering that the names of P1 and P2 are "p1" and "p2" respectively, we create a new Predicate (Predicate "And(p1, p2)") and then we create a new Evaluation pointing to this new predicate and the same concept C1

Query evolution

The query to be evolved is the following one:

OR 3
    AND 2
        LINK_TEMPLATE 3
            Evaluation
            ATOM PTARGET
            VARIABLE concept1
        LINK_TEMPLATE 3
             Equivalence
             VARIABLE concept1
             ATOM CTARGET
    AND 2
        LINK_TEMPLATE 3
            Evaluation
            VARIABLE predicate1
            ATOM CTARGET
        LINK_TEMPLATE 3
             Implication
             VARIABLE predicate1
             ATOM PTARGET
    AND 3
        LINK_TEMPLATE 3
            Evaluation
            VARIABLE predicate1
            VARIABLE concept1
        LINK_TEMPLATE 3
             Equivalence
             VARIABLE concept1
             ATOM CTARGET
        LINK_TEMPLATE 3
             Implication
             VARIABLE predicate1
             ATOM PTARGET

The fitness function must multiply the strength of all handles in the query answers (the answer, not the variable mapping). Each QueryAnswer will have either 2 or 3 handles depending on the clause of the outer OR which has been matched.

The importance updating query can be the one below.

OR 2
    LINK_TEMPLATE 3
        VARIABLE P1
        VARIABLE concept
    LINK_TEMPLATE 3
        VARIABLE predicate
        VARIABLE C1

With the following replacements:

P1 -> predicate1
C1 -> concept1

And the following mappings:

(concept1, concept)
(predicate1, predicate)

Metadata

Metadata

Labels

PublicShould be cc'ed to the public board

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions