Thu Mar 28 06:34:37 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2015-09-01

HANGOUT

2024-03-28 | 2024-02-28 | 2024-01-28 | 2023-12-28 | 2023-11-28 | 2023-10-28 | 2023-09-28 | 2023-08-28 | 2023-07-28 | 2023-06-28 | 2023-05-28 | 2023-04-28 | 2023-03-28 | 2023-02-28 | 2023-01-28 | 2022-12-28 | 2022-11-28 | 2022-10-28 | 2022-09-28 | 2022-08-28 | 2022-07-28 | 2022-06-28 | 2022-05-28 | 2022-04-28 | 2022-03-28 | 2022-02-28 | 2022-01-28 | 2021-12-28 | 2021-11-28 | 2021-10-28 | 2021-09-28 | 2021-08-28 | 2021-07-28 | 2021-06-28 | 2021-05-28 | 2021-04-28 | 2021-03-28 | 2021-02-28 | 2021-01-28 | 2020-12-28 | 2020-11-28 | 2020-10-28 | 2020-09-28 | 2020-08-28 | 2020-07-28 | 2020-06-28 | 2020-05-28 | 2020-04-28 | 2020-03-28 | 2020-02-28 | 2020-01-28 | 2019-12-28 | 2019-11-28 | 2019-10-28 | 2019-09-28 | 2019-08-28 | 2019-07-28 | 2019-06-28 | 2019-05-28 | 2019-04-28 | 2019-03-28 | 2019-02-28 | 2019-01-28 | 2018-12-28 | 2018-11-28 | 2018-10-28 | 2018-09-28 | 2018-08-28 | 2018-07-28 | 2018-06-28 | 2018-05-28 | 2018-04-28 | 2018-03-28 | 2018-02-28 | 2018-01-28 | 2017-12-28 | 2017-11-28 | 2017-10-28 | 2017-09-28 | 2017-08-28 | 2017-07-28 | 2017-06-28 | 2017-05-28 | 2017-04-28 | 2017-03-28 | 2017-02-28 | 2017-01-28 | 2016-12-28 | 2016-11-28 | 2016-10-28 | 2016-09-28 | 2016-08-28 | 2016-07-28 | 2016-06-28 | 2016-05-28 | 2016-04-28 | 2016-03-28 | 2016-02-28 | 2016-01-28 | 2015-12-28 | 2015-11-28 | 2015-10-28 | 2015-09-28 | 2015-08-28 | 2015-07-28 | 2015-06-28 | 2015-05-28 | 2015-04-28 | 2015-03-28 | 2015-02-28 | 2015-01-28 | 2014-12-28 | 2014-11-28 | 2014-10-28 | 2014-09-28 | 2014-08-28 | 2014-07-28 | 2014-06-28 | 2014-05-28 | 2014-04-28 | 2014-03-28 | 2014-02-28 | 2014-01-28 | 2013-12-28 | 2013-11-28 | 2013-10-28 | 2013-09-28 | 2013-08-28 | 2013-07-28 | 2013-06-28 | 2013-05-28 | 2013-04-28 | 2013-03-28 | 2013-02-28 | 2013-01-28 | 2012-12-28 | 2012-11-28 | 2012-10-28 | 2012-09-28 | 2012-08-28 | 2012-07-28 | 2012-06-28 | 2012-05-28 | 2012-04-28 | 2012-03-28 | 2012-02-28 | 2012-01-28 | 2011-12-28 | 2011-11-28 | 2011-10-28 | 2011-09-28 | 2011-08-28 | 2011-07-28 | 2011-06-28 | 2011-05-28 | 2011-04-28 | 2011-03-28 | 2011-02-28 | 2011-01-28 | 2010-12-28 | 2010-11-28 | 2010-10-28 | 2010-09-28 | 2010-08-28 | 2010-07-28 | 2010-06-28 | 2010-05-28 | 2010-04-28 | 2010-03-28 | 2010-02-28 | 2010-01-28 | 2009-12-28 | 2009-11-28 | 2009-10-28 | 2009-09-28 | 2009-08-28 | 2009-07-28 | 2009-06-28 | 2009-05-28 | 2009-04-28 | 2009-03-28 | 2009-02-28 | 2009-01-28 | 2008-12-28 | 2008-11-28 | 2008-10-28 | 2008-09-28 | 2008-08-28 | 2008-07-28 | 2008-06-28 | 2008-05-28 | 2008-04-28 | 2008-03-28 | 2008-02-28 | 2008-01-28 | 2007-12-28 | 2007-11-28 | 2007-10-28 | 2007-09-28 | 2007-08-28 | 2007-07-28 | 2007-06-28 | 2007-05-28 | 2007-04-28 | 2007-03-28 | 2007-02-28 | 2007-01-28 | 2006-12-28 | 2006-11-28 | 2006-10-28 | 2006-09-28 | 2006-08-28 | 2006-07-28 | 2006-06-28 | 2006-05-28 | 2006-04-28 | 2006-03-28 | 2006-02-28 | 2006-01-28 | 2005-12-28 | 2005-11-28 | 2005-10-28 | 2005-09-28 | 2005-08-28 | 2005-07-28 | 2005-06-28 | 2005-05-28 | 2005-04-28 | 2005-03-28 | 2005-02-28 | 2005-01-28 | 2004-12-28 | 2004-11-28 | 2004-10-28 | 2004-09-28 | 2004-08-28 | 2004-07-28 | 2004-06-28 | 2004-05-28 | 2004-04-28 | 2004-03-28 | 2004-02-28 | 2004-01-28 | 2003-12-28 | 2003-11-28 | 2003-10-28 | 2003-09-28 | 2003-08-28 | 2003-07-28 | 2003-06-28 | 2003-05-28 | 2003-04-28 | 2003-03-28 | 2003-02-28 | 2003-01-28 | 2002-12-28 | 2002-11-28 | 2002-10-28 | 2002-09-28 | 2002-08-28 | 2002-07-28 | 2002-06-28 | 2002-05-28 | 2002-04-28 | 2002-03-28 | 2002-02-28 | 2002-01-28 | 2001-12-28 | 2001-11-28 | 2001-10-28 | 2001-09-28 | 2001-08-28 | 2001-07-28 | 2001-06-28 | 2001-05-28 | 2001-04-28 | 2001-03-28 | 2001-02-28 | 2001-01-28 | 2000-12-28 | 2000-11-28 | 2000-10-28 | 2000-09-28 | 2000-08-28 | 2000-07-28 | 2000-06-28 | 2000-05-28 | 2000-04-28 | 2000-03-28 | 2000-02-28 | 2000-01-28 | 1999-12-28

Key: Value:

Key: Value:

MESSAGE
DATE 2015-09-25
FROM Ruben Safir
SUBJECT Subject: [NYLXS - HANGOUT] Artificial Intelligence in Perl

http://ai.neocities.org/AiSteps.html


DIY Strong AI in any natural human language with step-by-step
examples in Perl



Perl AI code comments refer to page numbers in /PERL by Example, Fifth
Edition/.

1. Code the MainLoop
module.

*
___________ ___________
/ \ / \
/ Motorium \ / Security \
\_____________/\ ______ /\_____________/
__________ \ / \ / ____________
/ \ \/ \/ / \
( Volition )--------< MainLoop >--------( Sensorium )
\__________/ /\ /\ \____________/
_____________ / \______/ \ _____________
/ \/ \/ \
\ Think / \ Emotion /
\___________/ \___________/
*

Code the MainLoop
shown above in your chosen programming language. Use either an actual
loop with subroutine calls, or make a ringlet of perhaps object-oriented
module stubs, each calling the next stub. Provide the ESCAPE key or
other mechanisms for the user to stop the AI. Below is an example of
starting to code *mind.pl* as the Main AI Loop in Perl, along with
page-number references to the fifth edition (2015) of the book /PERL by
Example/ , by Ellie Quigley.

*
#!/usr/bin/perl
$IQ = 0; # PERL by Example (2015), p. 17
while ($IQ < 8) { # PERL by Example (2015), p. 190
print "IQ = $IQ Enter new IQ: ";
$IQ = ; # PERL by Example (2015), p. 50
} # End of mind.pl program for coding Strong AI in Perl
*


2. Code the sensorium
module or
subroutine.

Start a subroutine or module that is able to sense something coming in
from the outside world, i.e., a key-press on the keyboard.

* In Perl we will count on pressing Ctrl+C to halt the AI Mind program
if we need to rescue it from an infinite loop. You may also create a
numeric limit based on a variable used as a counter so that the
program will halt when it reaches your arbitrary limit. In languages
other than Perl, you may trap for special key-presses such as the
following.

* If possible, code recognition of the Escape-key (ASCII 27) for
halting the AI. Once the escape-code works within the Sensorium
stub, remove any escape-code from the MainLoop module.

Below is the expanded Perl code for AI Step #Two. Notice that there is a
"forward declaration" of the Sensorium module whose actual code is then
located below the main loop that calls sensorium(). Within the sensorium
mind-module, you have the option, shown below, of announcing that you
are in the sensorium module by stating so at the start of any on-screen
prompt or other message conveyed to the user from within the sensorium
code. As your coding moves beyond the sensorium module, you may remove
any such blatant indication that you are in the sensorium module.

*#!/usr/bin/perl
sub sensorium; # PERL by Example p. 351 Forward declaration
$IQ = 0; # PERL by Example (2015), p. 17
while ($IQ < 8) { # PERL by Example (2015), p. 190
sensorium(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling AI subroutines
sub sensorium() {
print "Sensorium: IQ = $IQ Enter new IQ: ";
$IQ = ; # PERL by Example (2015), p. 50
} # End of mind.pl program for coding Strong AI in Perl
*


Now you have two modules or subroutines, a MainLoop
and a subordinate,
sensorium
pathway. But what should come next in AI evolution
? Now we need a
reaction module, so that the organism may react to its environment.
Let's call the reaction-module "think".


3. Stub in the think
module or subroutine.

Now, of course, the simple organism is not truly thinking yet, but in
the Perl AI code shown below we
insert a think subroutine and we adjust the previous code to accommodate
the new think mechanism.

*
#!/usr/bin/perl
use strict; # PERL by Example (2015), p. 77
use warnings; # PERL by Example (2015), p. 85
our $IQ = 0; # PERL by Example (2015), p. 689
sub sensorium; # PERL by Example p. 351 Forward declaration
sub think; # PERL by Example p. 351 Forward declaration
while ($IQ < 8) { # PERL by Example (2015), p. 190
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling AI subroutines
sub sensorium() { # Start sensory input.
print " Sensorium: Enter new IQ: ";
$IQ = ; # PERL by Example (2015), p. 50
} # End of sensorium subroutine.
sub think() { # Start showing output as if generated by thinking.
print "Think: My IQ is now $IQ";
} # End of mind.pl program for coding Strong AI in Perl
*


*/use strict/* in a new line of code is a form of insurance against bad
coding practices, especially for a large program such as an artificial
intelligence.

*/use warnings/* in another new line of code is a technique for being
warned about any mistakes that you may make in your Strong AI coding.

Adding the word */our/* in the declaration of the /our $IQ/ variable is
a way of making the variable global to the whole AI program and not just
to the Main Loop of the AI Mind.

We change the on-screen messages so that the sensorium() subroutine now
requests the analog of sensory input and the think() subroutine makes
the analog of a statement of thought. You may experiment with changing
the on-screen messages to suit your own ideas of how an AI Mind should
interact with other sentient beings.


4. Initiate the AudInput
module for keyboard
or acoustic input.

Drop any [ESCAPE] mechanism down by one tier, into the AudInput
module, but do not
eliminate or bypass the quite essential sensorium
module, because
another programmer may wish to specialize in implementing some elaborate
sensory modality among your SensoryInput
stubs. Code the
AudInput module
initially to deal with ASCII keyboard input. If you are an expert at
speech recognition, extrapolate backwards from the storage requirements
(space and format) of the acoustic input of real phonemes in your
AudInput system, so
that the emerging robot Mind may be ready in advance for the switch from
hearing by keyboard to hearing by microphone or artificial ear.
Anticipate evolution even beyond the Perl code shown below for auditory
input.

*
#!/usr/bin/perl
use strict; # PERL by Example (2015), p. 77
use warnings; # PERL by Example (2015), p. 85
our $IQ = 0; # PERL by Example (2015), p. 689
sub AudInput; # PERL by Example p. 351 Forward declaration
sub sensorium; # PERL by Example p. 351 Forward declaration
sub think; # PERL by Example p. 351 Forward declaration
sub VisRecog; # PERL by Example p. 351 Forward declaration
while ($IQ < 8) { # PERL by Example (2015), p. 190
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling mind.pl Strong AI subroutines
sub sensorium() { # Start sensory input through sensory modalities.
print " Sensorium: Calling AudInput subroutine: \n";
AudInput(); # PERL by Example p. 350: () empty parameter list
# VisRecog(); -- non-existent subroutine is shown but commented out
} # End of sensorium subroutine in Perl artificial intelligence
sub AudInput() { # As if keyboard input were auditory hearing.
print " AudInput: Enter new IQ: ";
$IQ = ; # PERL by Example (2015), p. 50
} # End of auditory input for human-computer interaction
sub think() { # Start showing output as if generated by thinking.
print "Think: My IQ is now $IQ";
} # http://ai.neocities.org/AiSteps.html
*

*sub VisRecog;* has been added to the declarations of subroutines in
order to flesh out the sensorium code by showing that the visual
recognition module could be called if there was such a module available.


5. The TabulaRasa loop.

Before you can create an auditory memory "AudMem" subroutine for storing
input from the keyboard, you need to code a "TabularRasa" loop that will
fill the mental memory of the AI with blank engrams, thus reserving the
memory space and preventing error messages about unavailable locations
in the AI memory.

*
#!/usr/bin/perl
use strict; # PERL by Example (2015) p. 77
use warnings; # PERL by Example (2015) p. 85
our $cns = 32; # size of AI memory for central nervous system.
our $IQ = 0; # PERL by Example (2015) p. 689
our -at-aud = " "; # PERL by Example (2015) p. 17: auditory array
sub AudInput; # PERL by Example p. 351 Forward declaration
sub sensorium; # PERL by Example p. 351 Forward declaration
sub think; # PERL by Example p. 351 Forward declaration
sub VisRecog; # PERL by Example p. 351 Forward declaration
TabulaRasa: { # PERL by Example (2015), p. 204: Labels
my $trc = 0; # $trc variable is "tabula rasa counter".
print "Size of experiential memory is $cns \n"; # Increase as needed.
until ($trc == $cns) { # PERL by Example (2015), p. 193: "Loops".
$aud[$trc] = " "; # Fill CNS memory with blank spaces.
$trc++; # PERL by Example (2015) p. 21: autoincrement $trc.
} # End of loop filling auditory memory with blank engrams.
} # End of TabulaRasa "clean slate" sequence.
while ($IQ < 8) { # PERL by Example (2015), p. 190
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling mind.pl Strong AI subroutines
sub sensorium() { # Start sensory input through sensory modalities.
print " Sensorium: Calling AudInput subroutine: \n";
AudInput(); # PERL by Example p. 350: () empty parameter list
# VisRecog(); -- non-existent subroutine is shown but commented out
} # End of sensorium subroutine in Perl artificial intelligence
sub AudInput() { # As if keyboard input were auditory hearing.
print " AudInput: Enter new IQ: ";
$IQ = ; # PERL by Example (2015), p. 50
} # End of auditory input for human-computer interaction
sub think() { # Start showing output as if generated by thinking.
print "Think: My IQ is now $IQ";
} # http://ai.neocities.org/AiSteps.html
*


The new variable *$cns* in the above code is set to an arbitrary value
by the mind-designer or AI maintainer. You start out with a low $cns
value so that you may see the entire contents of mental memory during
the first coding of mind-modules that store and retrieve engrams of
memory. As the AI grows larger and larger, the psychic memory will
become too big to see on-screen all at once, but you may insert code for
the purpose of printing out the memory onto paper, or into a file
separate from the AI. Since an AI Mind is theoretically immortal and can
have a vast life-span, it will later be convenient and necessary to
recycle the mental $cns memory with a ReJuvenate module.

The new *-at-aud* array for auditory memory will hold individual keystrokes
of human input or individual characters from any file or website that
the AI tries to read. A more advanced AI will use acoustic phonemes
instead of alphabetic characters for auditory input and memory storage.
Characters are close enough to phonemes for coding the prototype AI Minds.


6. EnBoot (English
Bootstrap).

The English Bootstrap (EnBoot
) module makes it
possible for the Strong AI Mind to begin thinking immediately when you
launch the more advanced AI program. Here we stub in the EnBoot
subroutine with an English word or two before the AudMem module begins
to store new words coming from the AudInput module. The EnBoot stub
shows us that the first portion of the AI mental memory is reserved for
the innate concepts and the English words that express each concept. If
you use the same Unicode that Perl enjoys to create a Strong AI Mind in
Arabic, Chinese, Hungarian, Indonesian, Japanese, Korean, Swahili, Urdu
or any other natural human language, you will need to create a bootstrap
module for your chosen human language. The English Bootstrap shown in
the Perl code below serves merely as an example of how to do it.

*
#!/usr/bin/perl
use strict; # PERL by Example (2015) p. 77
use warnings; # PERL by Example (2015) p. 85
our $cns = 32; # size of AI memory for central nervous system.
our $IQ = 0; # PERL by Example (2015) p. 689
our -at-aud = " "; # PERL by Example (2015) p. 17: auditory array
our $t = 0; # Lifetime experiential time "$t"
sub AudInput; # PERL by Example p. 351 Forward declaration
sub sensorium; # PERL by Example p. 351 Forward declaration
sub think; # PERL by Example p. 351 Forward declaration
sub VisRecog; # PERL by Example p. 351 Forward declaration
TabulaRasa: { # PERL by Example (2015), p. 204: Labels
my $trc = 0; # $trc variable is "tabula rasa counter".
print "Size of experiential memory is $cns \n"; # Increase as needed.
until ($trc == $cns) { # PERL by Example (2015), p. 193: "Loops".
$aud[$trc] = " "; # Fill CNS memory with blank spaces.
$trc++; # PERL by Example (2015) p. 21: autoincrement $trc.
} # End of loop filling auditory memory with blank engrams.
} # End of TabulaRasa "clean slate" sequence.
EnBoot: { # http://mind.sourceforge.net/enboot.html
$t = 0; # English Bootstrap sequence stretches over mental time "$t".
print "English bootstrap is loading into memory... \n";
$t = 0; $aud[$t] = "H"; # Indexing of array begins with zero.
$t = 1; $aud[$t] = "E"; # Single elements of array use $aud not -at-aud.
$t = 2; $aud[$t] = "L"; # PERL by Example (2015), p. 95: Elements
$t = 3; $aud[$t] = "L"; # AudMem() stores new words at higher $t values.
$t = 4; $aud[$t] = "O"; # Bootstrap "HELLO" is not permanently here.
$t = 5; # A blank gap is necessary between words.
$t = 6; # More bootstrap words will be needed.
}; # http://code.google.com/p/mindforth/wiki/EnBoot
while ($IQ < 8) { # PERL by Example (2015), p. 190
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling mind.pl Strong AI subroutines
sub sensorium() { # Start sensory input through sensory modalities.
print " Sensorium: Calling AudInput subroutine: \n";
AudInput(); # PERL by Example p. 350: () empty parameter list
# VisRecog(); -- non-existent subroutine is shown but commented out
} # End of sensorium subroutine in Perl artificial intelligence
sub AudInput() { # As if keyboard input were auditory hearing.
print " AudInput: Enter new IQ: ";
$IQ = ; # PERL by Example (2015), p. 50
} # End of auditory input for human-computer interaction
sub think() { # Start showing output as if generated by thinking.
print "Think: My IQ is now $IQ";
} # http://ai.neocities.org/AiSteps.html
*


The *$t* "time" variable is now declared not only as a way to index
through the memory arrays of the AI Mind, but also as a measure or a
counter of each mental moment of time in the inner, psychic life of the
artificial intelligence. Time *$t* in the AI is not strictly coordinated
with real time in the external world or even with the internal
clock-time of the host computer. Time *$t* is a way of scheduling and
organizing discrete operations in the AI software, such as accepting and
storing new sensory input and such as generating a sentence of thought
by retrieving time-bound phonemes from auditory memory and stringing
them together into an act of thinking that takes time to utter and to
communicate.


7. AudMem (Auditory
Memory).

Into the *-at-aud* auditory array that was filled with blank spaces by the
TabulaRasa sequence and primed with some bootstrap content by the EnBoot
sequence, insert some new memories with the *AudMem* auditory memory
module. Modify the *AudInput* module to prompt for English words and
modify the *Think* module to display words stored in memory as if they
were a thought being generated in English (or in your chosen natural
human language). Below is the new *mind.pl* Perl code with the changes
that were made.

*
#!/usr/bin/perl
use strict; # PERL by Example (2015) p. 77
use warnings; # PERL by Example (2015) p. 85
our $age = 0; # Temporary age for loop-counting and loop-exit.
our -at-aud = " "; # PERL by Example (2015) p. 17: auditory array
our $cns = 32; # size of AI memory for central nervous system.
our $IQ = 0; # PERL by Example (2015) p. 689
our $msg = " "; # Variable holds a "message" of input from AudInput.
our $pho = ""; # $pho is for a "phoneme" or character of input.
our $t = 0; # Lifetime experiential time "$t"
our $t2s = 0; # auditory text-to-speech index for -at-aud array
sub AudInput; # PERL by Example p. 351 Forward declaration
sub sensorium; # PERL by Example p. 351 Forward declaration
sub think; # PERL by Example p. 351 Forward declaration
sub VisRecog; # PERL by Example p. 351 Forward declaration
TabulaRasa: { # PERL by Example (2015), p. 204: Labels
my $trc = 0; # $trc variable is "tabula rasa counter".
print "Size of experiential memory is $cns \n"; # Increase as needed.
until ($trc == $cns) { # PERL by Example (2015), p. 193: "Loops".
$aud[$trc] = " "; # Fill CNS memory with blank spaces.
$trc++; # PERL by Example (2015) p. 21: autoincrement $trc.
} # End of loop filling auditory memory with blank engrams.
} # End of TabulaRasa "clean slate" sequence.
EnBoot: { # http://mind.sourceforge.net/enboot.html
$t = 0; # English Bootstrap sequence stretches over mental time "$t".
print "English bootstrap is loading into memory... \n";
$t = 0; $aud[$t] = "H"; # Indexing of array begins with zero.
$t = 1; $aud[$t] = "E"; # Single elements of array use $aud not -at-aud.
$t = 2; $aud[$t] = "L"; # PERL by Example (2015), p. 95: Elements
$t = 3; $aud[$t] = "L"; # AudMem() stores new words at higher $t values.
$t = 4; $aud[$t] = "O"; # Bootstrap "HELLO" is not permanently here.
$t = 5; # A blank gap is necessary between words.
$t = 6; # More bootstrap words will be needed.
}; # http://code.google.com/p/mindforth/wiki/EnBoot
while ($t < $cns) { # PERL by Example (2015), p. 190
$age = $age + 1; # Increment $age variable with each loop.
print "\nMain loop cycle ", $age, " \n"; # Display loop-count.
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
if ($age eq 999) { die "Perlmind dies when time = $t \n" }; # safety
} # End of main loop calling mind.pl Strong AI subroutines
sub sensorium() { # Start sensory input through sensory modalities.
print " Sensorium: Calling AudInput subroutine: \n";
AudInput(); # PERL by Example p. 350: () empty parameter list
# VisRecog(); -- non-existent subroutine is shown but commented out
} # End of sensorium subroutine in Perl artificial intelligence
sub AudInput() { # As if keyboard input were auditory hearing.
print "Enter a word of input, then press RETURN: ";
$msg = ; # PERL by Example (2015), p. 50: Filehandle STDIN
print "AudInput: You entered the word: $msg";
AudMem(); # Calling the memory-insertion subroutine
} # End of auditory input for human-computer interaction
sub AudMem() { # http://mind.sourceforge.net/audstm.html
chop($msg); # PERL by Example (2015), p. 111: chop Function
my $reversed = reverse $msg; # PERL by Example (2015), p. 125: reverse
print "Input word reversed is: $reversed"; # PERL by Example, p. 125
do { # PERL by Example (2015), p. 194: do/until Loops
$pho = chop($reversed); # "chop" returns the chopped character as $pho.
print "\nAudMem: Storing ", $pho, " at time = ", "$t";
$aud[$t] = $pho; # Store the input phoneme in the auditory memory array.
$t++ ; # Increment time $t to store each input character separately.
} until $pho eq ""; # Store the whole word until $pho is empty.
$t++ ; # Add one more time point for a blank engram on-screen.
print "\n"; # Show a new-line gap on-screen.
} # http://code.google.com/p/mindforth/wiki/AudMem
sub think() { # Start showing output as if generated by thinking.
print "\nThink: "; # Display a new-line before "Think: "
$t2s = 0; # Speak all of $cns memory.
do { # PERL by Example (2015), p. 194: do/until Loops
print $aud[$t2s]; # Show each successive character in memory.
$t2s++ ; # Increment time-to-speech to advance thru memory.
} until $t2s eq $cns; # Show the whole array of AI Mind memory.
print "...comes from auditory memory. \n"; #
} # http://ai.neocities.org/AiSteps.html
*


The variable *$msg* holds the "message" typed in by the human user
during AudInput.

The *$pho* variable holds each character of keyboard input as if it were
an acoustic phoneme going into the *-at-aud* auditory memory array. The
prototype AI Minds use keyboard characters as if they were phonemes of
sound. Later on, more advanced forms of artificial intelligence may use
phonemes of actual speech to store and retrieve words of natural human
language. Since Perl works with Unicode
for handling most written
languages, it is now possible to use these AI Steps and any suitable
programming language to code an AI that thinks in almost any natural
human language.


8. Speech .


9. NewConcept .


10. EnVocab .

* MainLoop
o sensorium
+ AudInput
# NewConcept
* *EnVocab*
# AudMem
o think
+ speech


11. EnParser .

* MainLoop
o sensorium
+ AudInput
# NewConcept
* EnVocab
* *EnParser*
# AudMem
o think
+ speech


12. InStantiate .

* MainLoop
o sensorium
+ AudInput
# NewConcept
* EnVocab
* EnParser
o *InStantiate*
# AudMem
o think
+ speech


13. AudRecog .


14. OldConcept.


15. SpreadAct.


16. NounPhrase.


17. EnReify.


18. ReEntry.


19. VerbPhrase.


20. AuxVerb.


21. AskUser.


22. ConJoin.


23. EnArticle.


24. EnAdjective.


25. EnPronoun.


26. AudBuffer .


27. OutBuffer .


28. KbRetro.


29. KbSearch.


30. NounGen.


31. VerbGen .


32. InFerence .


33. EnCog.


34. MotorOutput
(Motor Memory).

As soon as you have sensory memory for audition, it is imperative to
include motor memory for action. The polarity of robot-to-world is about
to become a circularity of robot - motorium - world - sensorium - robot.
If you have been making robots longer than you have been making minds,
you now need to engrammatize whatever motor software routines you may
have written for your particular automaton. You must decouple your
legacy motor output software from whatever mindless stimuli were
controlling the robot and you must now associate each motor output
routine with memory engram nodes accreting over time onto a lifelong
motor memory channel for your mentally awakening robot. If you have not
been making robots, implement some simple motor output function like
emitting sounds or moving in four directions across a real or virtual
world.


35. Stub in the FreeWill
module for volition.

In your robot software, de-link any direct connection that you have
hardcoded between a sensory stimulus and a motor initiative. Force motor
execution commands to transit through your stubbed-in FreeWill
module, so that
future versions of your thought-bot will afford at least the option of
incorporating a sophisticated algorithm for free will in robots. If you
have no robot and you are building a creature of pure reason,
nevertheless include a FreeWill
stub for the sake of
AI-Complete design patterns.


36. The SeCurity module.

The SeCurity module
is not a natural component of the mind, but rather a machine equivalent
of the immune system in a human body. When we have advanced AI robots
running factories to fabricate even more advanced AI robots, let not the
complaint arise that nobody bothered to build in any security
precautions. Stub in a SeCurity module and let it be called from the
MainLoop by uncommenting any commented-out mention of SeCurity in the
MainLoop code. Inside the new SeCurity module, insert a call to
ReJuvenate but immediately comment-out the call to the not-yet-existent
ReJuvenate module. Also insert into SeCurity any desired code or
diagnostic messages pertinent to security functions.


37. The TuringTest module.

It is a simple matter to create a stub for the TuringTest
module and to call
it from within the SeCurity
module. Before the
native quickening
of the AI Mind, it may be necessary or at least advisable to have the AI
program come to a pause by default in the TuringTest module so that the
user must press the Enter key for the AI to continue operating. If it
becomes obvious that the still rudimentary program is pausing
disruptively within any module other than TuringTest, then it is time to
remove the disruptive code and to ensure that the budding AI stops
looping only once per cyclical calling of the TuringTest InterFace
. If the AudListen or AudInput
modules have only been stubbed in and have not been fleshed out, it may
be time now to complete the full coding of AudListen, AudInput and
AudMem for storage of the input.

...to be continued.

See also

http://mind.sourceforge.net/aisteps.html


You may discuss the *Perl* programming language at:
*https://groups.google.com/group/comp.lang.perl.misc*
http://stackoverflow.com/questions/tagged/perl

*http://www.reddit.com/r/perl*

You may discuss the Perl *artificial intelligence* at:
*https://groups.google.com/group/comp.ai.nat-lang*
http://stackoverflow.com/questions/tagged/artificial-intelligence
*http://www.reddit.com/r/artificial*

You may discuss *Perl and AI* combined at
*http://lists.perl.org/list/perl-ai.html*
http://www.nntp.perl.org/group/perl.ai/

http://www.mail-archive.com/perl-ai-at-perl.org



Strong AI software resulting from the above AI Steps:
http://www.nlg-wiki.org/systems/Mind.Forth
in English;
http://www.nlg-wiki.org/systems/Wotan
in German;
http://www.nlg-wiki.org/systems/Mind
in English;
http://www.nlg-wiki.org/systems/Dushka
in Russian.

http://www.google.com/patents/US8620890
is a patent that cites
Mentifex MindForth.


*Perlmind Programming Journal (PMPJ) -- details for 2015 May 10:*

Our next concern is how we will save auditory engrams into the -at-aud
auditory memory array with not only the $pho phonemic character being
saved, but with other elements horizontally saved into a line of data.
In departure from the previous AI Minds in REXX, in Forth and in
JavaScript, we wish to tighten up and simplify the number of items being
saved beyond each character itself. The JavaScript AI saves auditory
engrams in the following format.

*krt pho act pov beg ctu audpsi
630.
631. {
632. I 0 # 1 0 701*

Before we go about eliminating some of the legacy items from the
flag-panel, first we have to learn how to save the flag-panel in Perl.

We have gotten the Perl program to display the contents of -at-aud auditory
memory on a line-by-line basis with the following main-loop code.

while ($t < $cns) { # PERL by Example (2015), p. 190
$age = $age + 1; # Increment $age variable with each loop.
print "\nMain loop cycle ", $age, " \n"; # Display loop-count.
sensorium(); # PERL by Example p. 350: () empty parameter list
think(); # PERL by Example p. 350: () empty parameter list
if ($age eq 999) { die "Perlmind dies when time = $t \n" }; # safety
if ($t > 30) {
do {
# print -at-aud; # show contents of $aud array
print $aud[$krt], "\n"; # Show each successive character in memory.
$krt++; # increment $krt
} while ($krt < 10); # show -at-aud array at all time-points
}; # outer braces
} # End of main loop calling mind.pl Strong AI subroutines

Next we need to add such flag-panel items as the time-points and the
activation-level.


*Perlmind Programming Journal (PMPJ) -- details for 2015 May 13:*

In the Perlmind as a
third-generation ("3G") AI, we need to change the "AudMem" module in
combination with the "speech" module so that they both handle a greatly
simplified -at-aud auditory memory array. In the new "3G" -at-aud array, there
should not be seven unwieldy and partly unnecessary flags in the
flag-panel or "row" of the auditory array. Instead, there should be only
flags which have a legitimate basis in the neuronal nature of the
auditory memory. There should be the phoneme itself, its quasi-neuronal
activation-level, and its conceptual associative tag.


*Perlmind Programming Journal (PMPJ) -- details for 2015 May 14:*

Now we must cause the speech() module to display each word horizontally
and with nothing but the phonemic character showing. How do we read out
only one element, the $pho, from each row in the -at-aud auditory array?


*Perlmind Programming Journal (PMPJ) -- details for 2015 May 17:*

We need to experiment with "slice" in Perl so that we may break down an
engram-row in -at-aud memory and retrieve individual elements from any row
in the -at-aud array.


*Perlmind Programming Journal (PMPJ) -- details for 2015 May 28:*

The next module we need to implement is NewConcept, because the AI Mind
can not begin to think without making associations among concepts and
ideas. In the early AI Steps, all concepts are new concepts.

We need to expand the TabulaRasa routine to include the -at-psi conceptual
array and the -at-en English lexical array. We do so, and the AI still runs.

In MindForth, NewConcept is called from the AudInput module, which will
also call OldConcept when we have coded OldConcept. Now we stub in the
NewConcept module, and the AI still runs. Next we add some temporary
code to show that new entries are being made in the -at-psi conceptual array.


*Perlmind Programming Journal (PMPJ )
-- details for 2015 June 01:*

Now that NewConcept has stored data in the -at-psi conceptual array, next
we need EnVocab to be called by the NewConcept module to store data in
the -at-en array for English vocabulary. We will need some temporary,
non-permanent code in the AI Perlmind
to display data present in the
-at-en array along with the -at-psi array and the -at-aud array.

We start using the $nen variable as the "number of the English word."
Then we discover that we need to reverse the order of some calls and
have AudInput() call NewConcept() first and AudMem() later, so that any
new concept is created /before/ its engrams are stored in memory.

http://metacpan.org/pod/Lingua::Wordnet
is a major resource which we
are not yet ready to use, but which may be of enormous value later in
the further development of AI Perlminds.


*Perlmind Programming Journal (PMPJ )
-- details for 2015 June 04:*

Next we need to stub in the EnParser (English Parser) module, not so
much for its own sake, but rather as a bridge to calling the InStantiate
module. We have EnParser merely announce that it has been called by the
NewConcept module, so that we may see that the AI still runs with no
apparent problems. We declare the *$bias*
and *$pov*
variables associated
with EnParser so as to make sure that they are not reserved words in
Perl. We clean up some lines of code previously commented out but left
intact for at least one archival release iteration. We caution here that
the EnParser module is extremely primitive and relies upon very strict
input formats such as subject-verb-object (SVO), so that EnParser can
expect a subject-noun, then a verb, and then an object-noun or a
predicate nominative. We are more interested in the demonstration of
thinking than in the demonstration of parsing. Perl AI coders may be
able to adapt pre-existing CPAN or
other parsing code for use with the AI Perlmind
.


*Nota Bene:*

http://ai.neocities.org/perlmind.txt
is the full Perl AI mind.pl
source code.

The original thirty-four mind-modules are described in the /AI4U/ Amazon
Kindle e-book which was originally
published in 2002. /Artificial Intelligence in German/
was published in English in 2013
with an updated description of how all the AI Minds in German, English
and Russian generate thoughts and perform automated reasoning with
inference.

Meanwhile, the software names of the mind-modules have changed to a
format compatible with the wiki-pages of the MindForth project on Google
code. For example, the InFerence
module is spelled
with two uppercase letters in it so that any occurrence of the word
/InFerence/ is
clickable on a wiki-page. The AI software in Forth or JavaScript does
not care if the modules are named in wiki-format, so the module names
were changed not only on the documentation pages, but also inside the
free, open-source software for artificial intelligence.

The Amazon Kindle e-book InFerence (Artificial Intelligence)
gives the mind-module source code
with line-by-line explanation of how the AI implements automated
reasoning with inference.

The contents of this page are subject to change without notice



Return to top ; or to
http://ai.neocities.org/perlmind.txt
http://ai.neocities.org/ai4ubook.html

DkPj -- German Artificial
Intelligence Programming Journal
JMPJ -- JavaScript Mind Programming
Journal
MfPj -- MindForth
Programming Journa
PMPJ -- Perlmind Programming Journal
RMPJ -- Russian AI
Mind Programming Journal
http://www.tiananmenuniv.net
http://neocities.org/blog
Many thanks to NeoCities for hosting
Strong AI

  1. 2015-09-01 mrbrklyn-at-panix.com Subject: [NYLXS - HANGOUT] [rms-at-gnu.org: Panel about technology in higher education.]
  2. 2015-09-02 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] does your PC work with Linux
  3. 2015-09-02 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fwd: Panel about technology in higher education.
  4. 2015-09-03 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Welcome to the new Google
  5. 2015-09-03 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fwd: [linux-392] Fwd: RSVP open, Wed Sept 16: Karen Sandler on Freedom
  6. 2015-09-03 prmarino1-at-gmail.com Re: [NYLXS - HANGOUT] Welcome to the new Google
  7. 2015-09-03 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [NYLXS - HANGOUT] Welcome to the new Google
  8. 2015-09-04 Paul Robert Marino <prmarino1-at-gmail.com> Re: [NYLXS - HANGOUT] Welcome to the new Google
  9. 2015-09-05 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Movie of the Week
  10. 2015-09-07 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Copyright Wars - Chicken Sandwich
  11. 2015-09-07 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Copyright Wars - Hershey Bars
  12. 2015-09-08 Rick Moen <rick-at-linuxmafia.com> Re: [NYLXS - HANGOUT] Copyright Wars - Hershey Bars
  13. 2015-09-08 Rick Moen <rick-at-linuxmafia.com> Re: [NYLXS - HANGOUT] Copyright Wars - Chicken Sandwich
  14. 2015-09-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fwd: Re: [linux-392] Fwd: RSVP open, Wed Sept 16: Karen Sandler on
  15. 2015-09-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Let's Go Mets
  16. 2015-09-09 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Tor security
  17. 2015-09-09 mrbrklyn-at-panix.com Subject: [NYLXS - HANGOUT] [rick-at-linuxmafia.com: [conspire] $60 touchscreen for your Raspberry
  18. 2015-09-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Internt of things...
  19. 2015-09-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] bitcoin usage
  20. 2015-09-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fwd: Wednesday: Join us at "Freedom in my Heart"
  21. 2015-09-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] =?UTF-8?B?RndkOiAiTWlkZGxlIEVhc3QgUHJvdm9jYXRpb25zIGFuZCBQcmVkaWM=?=
  22. 2015-09-13 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Great Privacy tool
  23. 2015-09-13 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] cell service with best privacy
  24. 2015-09-13 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] So much for gun control
  25. 2015-09-13 Paul Robert Marino <prmarino1-at-gmail.com> Re: [NYLXS - HANGOUT] cell service with best privacy
  26. 2015-09-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] what is going on with HP?
  27. 2015-09-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Being literate in the 1300's
  28. 2015-09-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Controlling the Subway with Free Software
  29. 2015-09-16 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Controlling the Subway with Free Software
  30. 2015-09-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] the war on encryption: Daily News
  31. 2015-09-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] movie of the week
  32. 2015-09-23 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Writing Kernel Driver tutorial
  33. 2015-09-24 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Hipsters invade brooklyn?
  34. 2015-09-24 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Hipsters invade brooklyn?
  35. 2015-09-24 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [NYLXS - HANGOUT] Hipsters invade brooklyn?
  36. 2015-09-25 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Artificial Intelligence in Perl
  37. 2015-09-26 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Vacuum sealers
  38. 2015-09-26 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Vacuum sealers
  39. 2015-09-26 Rick Moen <rick-at-linuxmafia.com> Re: [NYLXS - HANGOUT] Vacuum sealers
  40. 2015-09-27 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Vacuum sealers
  41. 2015-09-27 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Vacuum sealers
  42. 2015-09-30 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] deep learning

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!