Intelligent Systems And Their Societies Walter Fritz

 

The General Learner 3

 

For continuos reading, like a book - continue here.

Introduction
Initial Internal Situation Concepts
Elementary Rules
The Main Loop
Using rules

Main part of the C program
Shape of Concepts
Shape of rules

 

Introduction
In the GL 3 everything is done by concepts and rules. A concept is a pattern between parts of an input or parts of an output.
A rule is a sequential (temporal) pattern between the present situation (Sit1) and the future situation (FS). It has an Sit1 and an FS as parts of itself. Sit1 is the situation for which the rule applies and FS is the future resulting situation; also called the objective. Both are expressed wih concepts.
The IntSit part of a rule consists of one intermediary situation, expressed with concepts.

External rules take information from the environment and act uypon the environment. Internal rules do the processing inside the brain of the GL 3. This includes making abstract and composed concepts and rules, sleeping, learning rules, selecting a rule to do, forgetting, learning by generalization etc. The quality of the internal rules determines the capability of the brain. The programmer supplies a set of elementary internal rules.

 

Initial Internal Situation Concepts
(Presently in use)

 

Elementary Rules
Elementary rules are rules that trigger the corresponding C-language function. Initially the programmer supplies all internal elementary rules. For a list of elementry rules see: Elementary rules (Enter for continuos reading, like a book)..

At the start of the first run, the GL 3 combines elementary rules into combined rules. Then again, repetively, it combines these, reaching finally some "general rule" These are the top level rules, all the other rules (representing the internal functions of he brain) are lower level parts of these.

Note: To be used, the Sit1 of a rule has to fit the present situation and the FS of the rule has to fit the desired future situation. Sit1 and FS are concrete, combined or abstract concepts.

 

The Main Loop
The main loop of the program has the following parts (subprograms):

Main event
Here the program manages "events" that is activity of the keyboard and the mouse, requsts by menus and showing of windows.

Do approval
The sub program that detects approval or disapproval by the person and modifies rules accordingly.

Maintain situations
In the waking state it puts the
Initial situation (sit1) to: AWAKE
Mid-situation to: AWAKE, EXTERN_SIT, RUL_LEARNED
Final situation: Same as Initial situation.

In the sleping state it puts the
Initial situation (sit1) to: ASLEEP, CHRONO_EXT
Mid-situation to: ASLEEP, CHRONO_INT
Final situation: Same as Initial situation.

Note:
CHRONO_EXT means that the program is working with a chronological list of the external rules used.
CHRONO_INT means the same for a chronological list of internal rules used.

Select rule
Selects a rule that can get from the initial situation to the mid-situation.

Do rule
does this rule.

Select rule
Selects a rule that can get from the mid-situation to the final situation.

Do rule
does this rule.

- - - - -

Here the loop repeats itself.

 

Using rules
The program selects a rule from its memory that gets from the first to the second situation. Once found, the rule is executed by decomposing it. That is finding lower level rules that fit from the sit1 (initial situation) to the intermediate sit and finally to the FS (final situation) of the rule. If one such lower level rule is an elementary rule, its corresponding C - languange function is done. Else it is decomposed recursively.
The GL 3 cannot act, if no rule can be found. It reports the failure to find an appropiate rule.

When encountering an abstract rule, the GL 3 uses the concrete rule, that has the best "value"
It uses first the rule wich covers most of the concepts of the sit1. It builds up the action. Then it uses further rules for concepts not covered so far. It adds or modifies the action correspondingly.

 

Main part of the C program
(file: main.c)

int		main(void)
// The GL 3 is similar to the General Learner, but the activity of the brain 
// is done by concepts and rules instead of C language functions.
	{
	short		sit1[256], sit2[256], sit3[256];
	short		rule;
	
	gIsTimeSensitive = false; // make true, when NOT in tryout.
	
	InitializeProgram();

	// Read memory of previously learned concepts and rules.
	ReadMemory();

	gMH.period++;  
	// another period of life. gMH.period varies between 120 and 240
	if (gMH.period LT (unsigned char)120)
		gMH.period = (unsigned char)120;
	if (gMH.period GT (unsigned char)240)
		gNeedForget = true;

	// initial start up only.	
	if (gMH.fillC EQ 0)
		{
		FillInitConcepts();	// Creates the joker concept and inicial concepts.
		CreateElemRules();	// Creates the joker rule and initial rules.
		PutElemRulesIntoChrono();  
		WriteMem();
		}

	HandleNewStart();	// initiation.
	
	TryoutOfFunction();	// for debugging only.

	// Main loop of the program.
	// runs through here once each instant.  				
	// Rest of activity is concepts and rules.
while (true) 
		{
		MainEvent();	// manages "events" = keyboard, mouse, menus, windows
							
		if (gGotInput)	
			DoApproval();	// Handle approval/disapproval.
			
		MaintainIntSits(sit1, sit2, sit3);	
		// puts the situation according to the to awake or asleep mode.
		// and manages window "asleep".

		if (gGotInput OR gSleepNow) // any input.		
			{
			// first rule
			rule = SelectRule(sit1, sit2);	

			if (rule NE NONE)
				DoRule(rule);
			else
				{
				NumNotice(NoRuleFound, 101, NONE, NONE);
				WaitWithMainEvent(180);		
				SysBeep(2);
				}
			
			// second rule
			rule = SelectRule(sit2, sit3);	

			if (rule NE NONE)
				DoRule(rule);
			else
				{
				NumNotice(NoRuleFound, 102, NONE, NONE);
				WaitWithMainEvent(180);
				SysBeep(2);
				}

			gGotInput = false;
			}
		}

	return 0;	// required by C language.
	}

Note:
DoRule( ) replaces the BrainSensoryArea( ), CentralBrain( ), BrainMotorArea( ) and Sleep( ) of the previous GL version. It does the "first" and "second" rule, which in turn look up lower level rules, that do the internal and external actions.

 

Shape of Concepts in C language

typedef struct 
	{
	char		Type;	// BRANCH_Typ, WORD, OBJ, COMP, SOUND etc
	char		Use;		// BRANCH_Use, ELEM, CONCUR, SEQU
	short	*pAddrP;	// BRANCH_P 
	// parts of this concept. In type COMP only concepts,  in rest anything.  	
	// pAddrP must always be filled, indicates existence of concept
	// All that follows are related concepts and rules:
	short	*pAddrT;	// BRANCH_T, total concepts which include this 						// concept  							 
	short	*pAddrA;	// BRANCH_A. abstract concepts which include this 					// concept			
	short	*pAddrC;	// BRANCH_C, concrete concepts of this concept 	
	short	*pAddrS1r; // BRANCH_S1r, the rules in whose sit1 the concept is 					// used
	short	*pAddrFSr; // BRANCH_FS, the rules in whose FS the concept is 					// used	
	} DataC;
Note: Branches of a concept can contain concepts or rule labels.

 

Shape of rules in C language

typedef struct 
	{
	char		Type; // BRANCH_Typ, ELEM, COMB 
	char		From; // BRANCH_From, creator 
	unsigned char	LastUse; // BRANCH_LastUse
	short	value // BRANCH_value, value of rule for choice between rules
	char		mode // BRANCH_mode, sequence, concurrently, repetively.							
	char 		rep; // BRANCH_rep, amont of repetitions.
	short	*pAddrS1; // BRANCHRULS1, situation 1			
		// pAddrS1 must always be filled, indicates existence of rule
	short	*pAddrW; // BRANCHRULW, value of each concept in sit 1	
	short	*pAddrIntSits; // BRANCHRULIS intermediate situations		
	short	*pAddrFS;	// BRANCHRULFS expected future sit after action
	short	*pAddrT; // BRANCH_T, total rule which includes this rule		
	short	*pAddrA; // BRANCH_A, abs rule which includes this rule	
	short	*pAddrC; // BRANCH_C, concrete rule of this rule
	} DataR;

 

For continuos reading, like a book - continue here.
Jump to the top of this document / Present Investigation / E-Book Contents.


Last Edited 6 Mar. 06 / Walter Fritz
Copyright © New Horizons Press