EnPrep English-preposition module of the

English and Russian bilingual ghost.pl AI in Perl

Mens Latina in Latin -- MindForth for Robots


1. Diagram of the EnPrep English Preposition 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 of the EnPrep English Preposition Module

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


3. Function of the EnPrep English Preposition Module

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 ghost325.pl AI source code in Perl


sub EnPrep() {  # http://ai.neocities.org/EnPrep.html
  if ($tpr > 0) {  # 2019-08-06: positive time-of-preposition?
    my @k=split(',',$psy[$tpr]);  # 2019-08-06: inspect @psy knowledge-nodes.
    if ($k[14] > 0) { $tkbprep = $k[14] }  # 2019-10-28: "tkbprep" for obj of prep.
    if ($k[20] > 0) { $aud = $k[20]; Speech() }  # 2019-10-30: speak the preposition.
    $tpr = 0;  # 2019-10-20: prevent carry-over.
  }  # 2019-08-06: end of test for positive time-of-preposition.
  if ($tnpr > 0) {  # 2019-10-28: positive time-of-noun-preposition?
    my @k=split(',',$psy[$tnpr]);  # 2019-10-28: inspect @psy knowledge-nodes.
    if ($k[14] > 0) { $tkbprep = $k[14] }  # 2019-10-28: "tkbprep" for obj of prep.
    if ($k[20] > 0) { $aud = $k[20]; Speech() }  # 2019-10-30: speak the preposition.
    $tnpr = 0;  # 2019-10-28: prevent carry-over.
  }  # 2019-10-28: end of test for positive time-of-noun-preposition.
  if ($tvpr > 0) {  # 2019-10-17: positive time-of-verb-preposition?
    my @k=split(',',$psy[$tvpr]);  # 2019-10-17: inspect @psy knowledge-nodes.
    if ($k[14] > 0) { $tkbprep = $k[14] }  # 2019-10-28: "tkbprep" for obj of prep.
    if ($k[20] > 0) { $aud = $k[20]; Speech() }  # 2019-10-30: speak the preposition.
    $tvpr = 0;  # 2019-10-28: prevent carry-over.
  }  # 2019-10-17: end of test for positive time-of-verb-preposition.
  EnArticle();  # 2019-08-06: say "A" or "THE" before object of [preposition.
  if ($tkbprep > 0) {  # 2019-10-28: time of object of preposition?
    my @k=split(',',$psy[$tkbprep]);  # 2019-10-28: inspect @psy knowledge-nodes.
    if ($k[20] > 0) { $aud = $k[20]; Speech() }  # 2019-10-28: obtain recall-vector.
  }  # 2019-10-28: end of test for "tkbprep" object of preposition. 
  $tkbprep = 0;   # 2019-10-28: reset for safety. 
  $prep = 0;      # 2018-11-04: reset to avoid carry-over.
  $prepgen = 0;   # 2018-11-01: reset to avoid carry-over.
  $tpr = 0;       # 2019-09-24: reset to prevent carry-over. 
  $tselo = 0;     # 2018-11-04: reset to avoid carry-over.
  $tselp = 0;     # 2018-11-04: reset to avoid carry-over.
}  # 2019-10-30: 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.

$tkbprep -- time-in-knowledge-base of a preposition leading to its object, necessary for the EnPrep English-preposition module because the basic "tkb" flag, although obtainable at the time of fetching a preposition, is subject to mutation when the output of a preposition results in the re-entry of the preposition and the assigning of a new "tkb" value.

$tnpr -- a proposed time-of-noun-preposition flag not for storing the preposition during instantiation but rather for expressing the preposition as connected with a noun, as for example in prepositional phrases such as "the man in the street with an umbrella in his hand".

$tpr -- time-of-preposition for parsing.

$tselp -- time of selection of preposition - obsolete - was 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.

$tvpr -- a proposed time-of-verb-preposition flag not for storing the preposition during instantiation but rather for expressing the preposition as connected with a verb-phrase, as for example in the prepositional phrase at the end of "God does not play dice with the universe.", where the preposition "with" is logically and semantically connected more to the verb-phrase "play dice" than to the noun "dice" all by itself.

$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
Tiananmen Square IV VI
javascript subreddit for AI Mind discussion;
Forth subreddit for MindForth discussion;
Perl subreddit for ghost.pl AI Mind Maintainers.
http://old.reddit.com/r/ControlProblem -- NOT SOLVED.
http://en.wikipedia.org/wiki/Natural_language_understanding -- solved.
Iskusstvenny Intellekt Programming Journal for Artificial Intelligence in Russian Language.
Converting ancient Latin AI into modern Russian AI
http://ai.neocities.org/Dushka.html -- tutorial Russian AI;
If you have any questions about the First Working AGI, please Join the Discussion.
Joint Artificial Intelligence Center (JAIC) -- the AI Manhattan Project.
Subject to change without notice.
Many thanks to NeoCities.
http://neocities.org/blog


Website Counter