EnPrep English-preposition module of the

first working Artificial Intelligence

ghost.pl for webservers -- MindForth for robots


1. Diagram of the EnPrep Mind-Module


   /^^^^^^^^\   EnPrep Inserts an English Preposition   /^^^^\ 
  /   EYE    \            ___________________          / EAR  \ 
 /            \          /  EnThink module   \        /        \ 
|              |  | |    \___________________/       | auditory | 
|   _______    |  | |          |                     | memory   | 
|  / old   \   |  | |     _____V_____________        | channel  | 
| / image   \--|----+    /  Indicative       \       |          |
| \ engram  /  | a|c|f   \___________________/       |          | 
|  \_______/   | b|o|i     |              |          |          | 
|              | s|n|b    _V_            _V_         |          | 
|   visual     | t|c|e   /En-\          /En-\        | "GHOST"  | 
|              | r|e|r  /Noun-\        /Verb-\       |          | 
|   memory     | a|p|s (Phrase )      (Phrase )      | "LIVES"  | 
|              | c|t|   \_____/        \_____/       |          | 
|   channel    | t| |       \____________/           |          |
|              |  | |       /EnNounPhrase\           |          | 
|    ______    |  | |       \ "computer" /           | "IN"     | 
|   /      \   |  | |        \__________/            |          | 
|  /  new   \  |  | |         |       |              | "THE"    | 
| /  image   \ |  |_|_    ____V___   _V_________     |          | 
| \  engram  / | /     \ / EnPrep \ / EnArticle \    |"COMPUTER"| 
|  \        /  | \ Psy / \  "in"  / \  "the"    /    |          | 
|   \______/   |  \___/   \______/   \_________/     |          |


2. Purpose

EnPrep forms a prepositional phrase by inserting an English preposition, plus or minus an article, in front of a noun or pronoun.


3. Function

The AI Mind Maintainer may ordain that any activated noun, not serving as the subject or object of a verb, may be included in a nascent thought as the object of a sufficiently activated preposition. Thus a question like "Where does Ghost live?" might be answered with "Ghost lives in the computer."


4. Code of EnPrep() from ghost294.pl First Working AGI in Perl


sub EnPrep() {  # http://ai.neocities.org/EnPrep.html
  for (my $i=$t; $i>$midway; $i--) {  # 2018-11-01: search backwards in time.
    my @k=split(',',$psy[$i]);  # 2018-11-01: inspect @psy knowledge-nodes.
    if ($k[6] == 6 && $k[10] == $qv2psi) {  # 2018-11-01:
      $tselp = $i;  # 2018-11-01: time of selection of preposition
      $prep = $k[1];  # 2018-11-01: for _any_ preposition
      $objprep = $k[12];  # 2018-11-01: turn "seq" into object-of-preposition
    }  # 2018-11-01: end of test for _any_ preposition linked to "quverb".
    if ($prep > 0 && $k[1] == $qv1psi) { last }  # 2018-11-11: search no further.
  }  # 2018-11-01: 2018-10-28: end of backwards loop.
  for (my $i=$tpu; $i>$midway; $i--) {  # 2018-11-01: search @Psy array
    my @k=split(',',$psy[$i]);  # 2018-11-01: inspect @psy knowledge-nodes.
    if ($k[1] == $prep) {  # 2018-11-01: if preposition is found;
      $aud = $k[14];  # 2018-11-01: one auditory engram is enough.
      last;  # 2018-11-01: one auditory engram is enough.
    }  # 2018-11-01: End of search for preposition
  }  # 2018-11-01: 2018-11-01: end of loop searching for preposition
  Speech();  # 2018-11-01: speak the preposition.
  EnArticle();  # 2018-11-01: say "A" or "THE" before object of [preposition.
  for (my $i=$tpu; $i>$midway; $i--) {  # 2018-11-01: search @Psy array
    my @k=split(',',$psy[$i]);  # 2018-11-01: inspect @psy knowledge-nodes.
    if ($k[1] == $objprep) {  # 2018-11-01: if object of preposition is found;
      $aud = $k[14];  # 2018-11-01: one auditory engram is enough.
      last;  # 2018-11-01: one auditory engram is enough.
    }  # 2018-11-01: End of search for object of preposition
  }  # 2018-11-01: 2018-11-01: end of loop searching for object of preposition
  Speech();  # 2018-11-01: speak the object of preposition
  $objprep = 0;   # 2018-11-04: reset to avoid carry-over.
  $prep = 0;      # 2018-11-04: reset to avoid carry-over.
  $prepgen = 0;   # 2018-11-01: reset to avoid carry-over.
  $tselo = 0;     # 2018-11-04: reset to avoid carry-over.
  $tselp = 0;     # 2018-11-04: reset to avoid carry-over.
# $wherecon = 0;  # 2018-11-01: reset to avoid carry-over.
# $wherecon = 0;  # 2018-11-04: reset from higher vantage-point.
}  # 2016mar30: EnPrep() returns to a thought-generation module.


5. Variables for First Working Artificial General Intelligence

$aud -- in the Speech() module is an associative tag leading to the typically most recent engram of a word stored in the @ear array of the auditory memory channel.

$objprep -- object of a preposition to be found and spoken by the EnPrep module.

$prep -- a preposition used in the EnPrep mind-module for English prepositions.

$prepcon -- prepositional condition-flag for parsing.

$prepgen -- urgency to generate a prepositional phrase.

$seq -- subSEQuent @psy concept in an idea. As the AI Minds evolve, the associative seq tag may take on a new role as pointing from a noun or verb or adjective or adverb to an associated preposition.

$tselp -- time of selection of preposition - is used in the EnPrep English-preposition module to make sure by calculation that a verb being sought as used with a preposition is in close temporal proximity to the preposition, so that a query may be answered correctly with a response that mentions the query-subject qv1psi and the query-verb qv2psi and the selected preposition at the beginning of a prepositional phrase.

$wherecon -- flag for condition of answering a where-query.


6. Troubleshooting and Robotic Psychosurgery

6.1.a. Symptom: (Something goes wrong.)
6.1.b. Solution: (AI Mind Maintainer devises solution.)


7. Future Development

The AI Minds with the concept-based, first working artificial intelligence will evolve beyond simple subject-verb-object (SVO) thought-structures into mentalities which may include a prepositional phrase in association with any noun or verb or adjective or adverb. The seq flag may be used to attach a prepositional phrase to a previous word.

In the future, an AI Mind may be able to disambiguate sentences with prepositions in a way which reasons from the following inputs.

Human: john eats with a fork
Ghost:

Human: john is with bob
Ghost:

Human: john eats pizza with a fork
Ghost:

Human: john eats pizza with bob
Ghost:

Human: john eats pizza with anchovies
Ghost:

First the SpreadAct module must evolve sufficiently to spread action from one concept in a statement to all associated concepts -- subject, verb, object or preposition. At that point, the inputs presented above may yield an associative knowledge base that links each instance of the preposition "with" back to its truly corresponding concept, from "with Bob" back to "John"; from "with a fork" back to "eats"; and from "with anchovies" back to "pizza". The AI Mind may then be able to respond properly to queries in the following manner.

Human: Who eats pizza?
Ghost: JOHN EATS PIZZA AND BOB EATS PIZZA

Human: How does John eat pizza?
Ghost: JOHN EATS PIZZA WITH A FORK

Human: What does John eat?
Ghost: JOHN EATS PIZZA WITH ANCHOVIES
The AI will think and output each response because the concepts in the response have been activated by the SpreadAct module, and because the preliminary ideas in the knowledge base have established retroactive associations from the concept "with" to the proper antecedent.


8. Resources


Please see

http://github.com/kernc/mindforth/blob/master/wiki/EnPrep.wiki


9. AiTree of First Working AGI Mind-Modules


Return to top; or to
javascript subreddit for AI Mind discussion;
Forth subreddit for MindForth discussion;
Perl subreddit for ghost.pl AI Mind Maintainers.