<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to read function</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>Recent changes to read function</description><atom:link href="https://sourceforge.net/p/sequencetree/wiki/read%20function/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 08 Oct 2011 21:41:38 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sequencetree/wiki/read%20function/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v13 
+++ v14 
@@ -303,7 +303,7 @@
 
 This allows the main G1 object (in object_pool) and all G1' objects (in trees of object_pool objects)  to accumulate branches.  G1 will accumulate branches  from every where its objects appear, not just in the data used to form G1.
 
-New generalizations can then from with G1 as part of the root.
+New generalizations can then form with G1 as part of the root.
 
 
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 08 Oct 2011 21:41:38 -0000</pubDate><guid>https://sourceforge.netc35e4693f98c2c4939c441277b38f893cac635aa</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 08 Oct 2011 21:38:21 -0000</pubDate><guid>https://sourceforge.net2d49c036dd69de9c885bf9548583e0f078b503d7</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v11 
+++ v12 
@@ -6,286 +6,288 @@
      
           read()
           Object* find(string)
-      }
-     
-     
+          substitute() 
+         }
+     
+     
      Object::read(){
           if (  obj = obj_pool-&gt;find_match(lemma) !=NULL ){
             substitute(obj)   
           }
      
           for (obj= branches.begin -&gt;end){
               obj-&gt;read()
           } 
      }
      
      
      
      main(){
 
      Object obj_pool;  obj_pool.load()         // load previously built obj_pool
      
      Object sentence = "man eat meat"
      
      sentence-&gt;read()
      }
           
-     
+     // the sentence object starts out as:
+
      sentence{
-          br= man' eat' meat'
-      }
-     
-     
-     				                  
-     sentence-&gt;read()		                            
-     man'-&gt;read()  -&gt; substitute() in person':
+               br= man' eat' meat'
+             }
+          				                  
   
      // man' = object in sentence, man = object in main object_pool   
      // they have the same lemma (man)
      
      man'{                   man{				      
-       br= eat' meat'          br = is person    //nouns     
-       }                            is animal    	      
-                                    is human		      
-                                    eat          //verbs	      
-     		                    work			      
-     		             }                                  
-     
-
+           br= eat' meat'         br = is person    //nouns     
+         }                             is animal    	      
+                                       is human		      
+                                       eat          //verbs	      
+                                       work			      
+                                }                            
+     
+
+     // call sentence-&gt;read(),   which calls		                            
+     // man'-&gt;read()  -&gt; substitute() in person':
+  
      // sentence object becomes:
    
      sentence {
-          br= man'     eat' meat'   
-              person'
-         }
-     
-     person{                    person'{	   
-        br= is human		     br = eat' meat' 
-            is individual	    }
-            is someone
-            is man	    
-           }
-     
-     man'-&gt;read(-&gt;):eat'-&gt;read()
+                br= man'     eat' meat'   
+                    person'
+              }
+     
+     person{                        person'{	   
+             br= is human                    br = eat' meat' 
+                 is individual	           }
+                 is someone
+                 is man	    
+           }
+     
+     // now call  man'-&gt;read():eat'-&gt;read()
      
      eat{                    eat'{	   
-        br=food                 br= meat'   
-           a meal             r_br= man'
-        }   
+          br=food                  br= meat'   
+             a meal              }
+        }                        
      //skip eat, assume no change
-     
-     man'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):meat'-&gt;read()
+
+     
+     man'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      
      meat'{		        meat{				      
-        br= ""                   br= is food
-      r_br = eat' man'		is muscle
-     }		        }
+            br= ""                    br= is food
+          }                               is muscle
+                                    }
      
      // meat substitutes in food		        
      
      // this is the state of the sentence object 
      // after the call to sentence-&gt;read()
 
      sentence {
            br= man'     eat'  meat'   
-               person'        food'  
+               person'  eat'  food'  
      }
      
      // A call to sentence-&gt;read() produces 
      // the following recursive calls     
 
      man'-&gt;read()
      man'-&gt;read():eat'-&gt;read()
      man'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      man'-&gt;read():eat'-&gt;read():food'-&gt;read()
      
      person'-&gt;read()
      person'-&gt;read():eat'-&gt;read()
      person'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      person'-&gt;read():eat'-&gt;read():food'-&gt;read()
      
     //-----------------------------------------------------------------------     
 
       //  introduce a truth function.  Will search sequences in tree
       // for matching sequence stored in obj_pool (by definition true)
       sentence-&gt;truth(&amp;obj_pool)
      
      
      Object::truth(o_pool*){
 
         for (obj= branches.begin -&gt;end){                       //loop over branches
    
            obj1 = o_pool-&gt;find_match(obj-&gt;lemma)
 
            if (  obj1 ==NULL ) continue
 
            retval= obj-&gt;truth(obj1)
 
            if  (retval == true) return true 
         }
         return false
      }
     
 
     sentence {
-           br= man'     eat'  meat'   
-               person'        food'   //put food' in eat' 's br list
-     }
-    
-    man'{                   man{				      
-       br= eat' meat'          br = is person    //nouns     
-       }                            is animal    	      
-                                    is human		      
-                                    eat          //verbs	      
-     		                    work			      
-     		             }                                  
+               br= man'     eat'  meat'   
+                   person'  eat'  food' 
+             }
+    
+    man'{                   man{			      
+          br= eat' meat'         br = is person    //nouns     
+        }                             is animal    	      
+                                      is human		      
+                                      eat          //verbs	      
+     		                      work			      
+                               }                             
 
      person'{                    person{	   
-        br= eat' meat'               br= is human
-     }                                   is individual 
-                                         is someone	    
-                                         eat food
-                                 }
+              br= eat' meat'             br= is human
+            }                                is individual 
+                                             is someone	    
+                                             eat food
+                                       }
 
   
         sentence-&gt;truth(&amp;obj_pool)     
         returns true if any of:
         - man eat meat
         - man eat food
         - person eat meat
         - person eat food
 
          these sequences are stored in the 'man' or 'person' object in the main object_pool.
 
          "person eat food"  is in "person" in the main obj_pool, so sentence(man eat meat) is  
          found to be true, or -understood-
 
 //----------------------------------------------------------------------------
 The substitute() function
  
 
     sentence {
-          br= man'     eat' meat'   
-         }
- 
-
-     man'{                   man{				      
-       br= eat' meat'          br = is person    //nouns     
-       }                            is animal    	      
-                                    is human		      
-                                    is carnivore   
-                                    eat          //verbs	      
-     		                    work			      
-     		             }                                  
+               br= man'     eat' meat'   
+             }
+ 
+
+     man'{                   man{				      
+           br= eat' meat'         br = is person    //nouns     
+         }                             is animal    	      
+                                       is human		      
+                                       is carnivore   
+                                       eat          //verbs	      
+     		                       work			      
+     		                }                                  
 
     // man substitutes in 'person' into sentence
    
      sentence {
-          br= man'     eat' meat'   
-              person'  eat' meat'
-         }
+                br= man'     eat' meat'   
+                    person'  eat' meat'
+              }
 
 
     // person gets its own sequence " eat' meat' " in its branches list
     // the two eat' objects are separate instances     
 
 
      // substituting in occurs when the original sentence is not understood 
      // (stored in obj_pool)
 
      // simplest substitution is top noun in 'man' branches list.
      
      // allows for combinatorial search of nearby concepts.
 
      // more complex substitution algorithms possible
   
      // 2nd order substitution:
 
  
      sentence {
-          br= man'     eat' meat'   
-          }
- 
-
-     man'{                   man{				      
-       br= eat' meat'          br = is person    //nouns     
-       }                            is animal    	      
-                                    is human		      
-                                    is carnivore   
-                                    eat          //verbs	      
-     		                    work			      
-     		               }                                  
+                br= man'     eat' meat'   
+              }
+ 
+
+     man'{                   man{				      
+           br= eat' meat'         br = is person    //nouns     
+         }                             is animal    	      
+                                       is human		      
+                                       is carnivore   
+                                       eat          //verbs	      
+     		                       work			      
+     		                }                                  
  
 
      person{	             animal{                 carnivore{	   
-         br= is human               br= ...                     br = ... 
-             is individual              eat food	             eat meat  
-             is someone	           }   	                      }
-             is man 
-        }
+             br= is human            br= ...                    br = ... 
+                 is individual           eat food	             eat meat  
+                 is someone        }   	                      }
+                 is man 
+           }
      
       
 
      Object::search(Object* obj){
 
         //called as 
         //man'-&gt;search(&amp;man)
 
       for (target_obj= obj-&gt;branches.begin -&gt;end){             //loop over man branches
-        obj1 = target_obj-&gt;find_lemma(target_object-&gt;lemma)    //find person, animal,... in
+        obj1 = obj_pool-&gt;find_lemma(target_object-&gt;lemma)      //find person, animal,... in
                                                                // main object pool.
 
         for (obj2= branches.begin -&gt;end){                  //loop over man' branches
    
            match( obj1, obj2 )    // returns metric   
                                   // carnivore has best match
           substitute (best match/highest metric)
      }
 
      //sentence becomes:
 
      sentence {
-          br= man'     eat' meat'   
-              carnivore' eat' meat'
-          }
+                br= man'     eat' meat'   
+                    carnivore' eat' meat'
+              }
    
      
 ------------------------------------------------------------------------
 Generalization
 
        I see the
                  person: 50
                  man: 40
                  human: 10
 
        I speak to 
                   person
                   someone
                   individual
                   man
 
 two generalization objects
 
     G1{                      G2{
-      br = person               br= person
-           man                      someone
-           human                    individual
-      }                             man
-                                }
+        br = person              br= person
+             man                     someone
+             human                   individual
+      }                              man
+                               }
 
 
 A Generalization is a grouping of two or more words.  These groupings form in the sequence tree of the raw words.
   For G1, the words "I see the" are the called the root of G1.
 
 When the Generalization is formed, link all object_pool objects (G1=person, man, human) together:
 
 
      person{	             man{                 human{	   
-         br= ...               br= ...                     br = ... 
-             is man'               is person'                   is person' 
-             is human'             is human'                    is man'
-             G1'                   G1'                          G1'
-        }     	              }   	                      }
+             br= ...              br= ...                br = ... 
+                 is man'              is person'              is person' 
+                 is human'            is human'               is man'
+                 G1'                  G1'                     G1'
+           }     	        }   	               }
 
 
 A G1 object is made and put in the object_pool.  The objects in G1 are all given G1' objects.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Sat, 08 Oct 2011 21:37:00 -0000</pubDate><guid>https://sourceforge.net39a71ad4ab182bb271976c83f6fea9f26a946ca8</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v10 
+++ v11 
@@ -299,7 +299,7 @@
      I see G1                The G1 talk 
 
 
-This allows the G1 object (in object_pool) to accumulate branches.  G1 will accumulate branches  from every where its objects appear, not just in the data used to form G1.
+This allows the main G1 object (in object_pool) and all G1' objects (in trees of object_pool objects)  to accumulate branches.  G1 will accumulate branches  from every where its objects appear, not just in the data used to form G1.
 
 New generalizations can then from with G1 as part of the root.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Thu, 06 Oct 2011 15:52:23 -0000</pubDate><guid>https://sourceforge.net229a996f6c6d87b8e81d8168e6e7139a1dfa6eac</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v9 
+++ v10 
@@ -274,3 +274,34 @@
                                 }
 
 
+A Generalization is a grouping of two or more words.  These groupings form in the sequence tree of the raw words.
+  For G1, the words "I see the" are the called the root of G1.
+
+When the Generalization is formed, link all object_pool objects (G1=person, man, human) together:
+
+
+     person{	             man{                 human{	   
+         br= ...               br= ...                     br = ... 
+             is man'               is person'                   is person' 
+             is human'             is human'                    is man'
+             G1'                   G1'                          G1'
+        }     	              }   	                      }
+
+
+A G1 object is made and put in the object_pool.  The objects in G1 are all given G1' objects.
+  
+The input sentence data is then re read and the object_pool re-accumulated.  When an object belonging to G1 is encountered, G1 is combinatorially inserted:
+
+
+     I see person,           The man talk         becomes:
+
+     I see person            The man talk
+     I see G1                The G1 talk 
+
+
+This allows the G1 object (in object_pool) to accumulate branches.  G1 will accumulate branches  from every where its objects appear, not just in the data used to form G1.
+
+New generalizations can then from with G1 as part of the root.
+
+
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Thu, 06 Oct 2011 15:48:15 -0000</pubDate><guid>https://sourceforge.net2092fef9c29194006bce826ca29c4268b7e4674e</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v8 
+++ v9 
@@ -62,75 +62,76 @@
      person{                    person'{	   
         br= is human		     br = eat' meat' 
             is individual	    }
-            is someone	    
+            is someone
+            is man	    
            }
      
      man'-&gt;read(-&gt;):eat'-&gt;read()
      
      eat{                    eat'{	   
         br=food                 br= meat'   
            a meal             r_br= man'
         }   
      //skip eat, assume no change
      
      man'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):meat'-&gt;read()
      
      meat'{		        meat{				      
         br= ""                   br= is food
       r_br = eat' man'		is muscle
      }		        }
      
      // meat substitutes in food		        
      
      // this is the state of the sentence object 
      // after the call to sentence-&gt;read()
 
      sentence {
            br= man'     eat'  meat'   
                person'        food'  
      }
      
      // A call to sentence-&gt;read() produces 
      // the following recursive calls     
 
      man'-&gt;read()
      man'-&gt;read():eat'-&gt;read()
      man'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      man'-&gt;read():eat'-&gt;read():food'-&gt;read()
      
      person'-&gt;read()
      person'-&gt;read():eat'-&gt;read()
      person'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      person'-&gt;read():eat'-&gt;read():food'-&gt;read()
      
     //-----------------------------------------------------------------------     
 
       //  introduce a truth function.  Will search sequences in tree
       // for matching sequence stored in obj_pool (by definition true)
       sentence-&gt;truth(&amp;obj_pool)
      
      
      Object::truth(o_pool*){
 
         for (obj= branches.begin -&gt;end){                       //loop over branches
    
            obj1 = o_pool-&gt;find_match(obj-&gt;lemma)
 
            if (  obj1 ==NULL ) continue
 
            retval= obj-&gt;truth(obj1)
 
            if  (retval == true) return true 
         }
         return false
      }
     
 
     sentence {
            br= man'     eat'  meat'   
                person'        food'   //put food' in eat' 's br list
      }
     
     man'{                   man{				      
        br= eat' meat'          br = is person    //nouns     
        }                            is animal    	      
@@ -139,27 +140,27 @@
      		                    work			      
      		             }                                  
 
      person'{                    person{	   
         br= eat' meat'               br= is human
      }                                   is individual 
                                          is someone	    
                                          eat food
                                  }
 
   
         sentence-&gt;truth(&amp;obj_pool)     
         returns true if any of:
         - man eat meat
         - man eat food
         - person eat meat
         - person eat food
 
          these sequences are stored in the 'man' or 'person' object in the main object_pool.
 
          "person eat food"  is in "person" in the main obj_pool, so sentence(man eat meat) is  
          found to be true, or -understood-
 
 //----------------------------------------------------------------------------
 The substitute() function
  
 
@@ -177,27 +178,27 @@
      		                    work			      
      		             }                                  
 
     // man substitutes in 'person' into sentence
    
      sentence {
           br= man'     eat' meat'   
               person'  eat' meat'
          }
 
 
     // person gets its own sequence " eat' meat' " in its branches list
     // the two eat' objects are separate instances     
 
 
      // substituting in occurs when the original sentence is not understood 
      // (stored in obj_pool)
 
      // simplest substitution is top noun in 'man' branches list.
      
      // allows for combinatorial search of nearby concepts.
 
      // more complex substitution algorithms possible
   
      // 2nd order substitution:
 
  
@@ -213,38 +214,63 @@
                                     is carnivore   
                                     eat          //verbs	      
      		                    work			      
      		               }                                  
  
 
      person{	             animal{                 carnivore{	   
          br= is human               br= ...                     br = ... 
              is individual              eat food	             eat meat  
              is someone	           }   	                      }
-         }
+             is man 
+        }
      
       
 
      Object::search(Object* obj){
 
         //called as 
         //man'-&gt;search(&amp;man)
 
       for (target_obj= obj-&gt;branches.begin -&gt;end){             //loop over man branches
         obj1 = target_obj-&gt;find_lemma(target_object-&gt;lemma)    //find person, animal,... in
                                                                // main object pool.
 
         for (obj2= branches.begin -&gt;end){                  //loop over man' branches
    
            match( obj1, obj2 )    // returns metric   
                                   // carnivore has best match
           substitute (best match/highest metric)
      }
 
      //sentence becomes:
 
      sentence {
           br= man'     eat' meat'   
               carnivore' eat' meat'
           }
    
      
+------------------------------------------------------------------------
+Generalization
+
+       I see the
+                 person: 50
+                 man: 40
+                 human: 10
+
+       I speak to 
+                  person
+                  someone
+                  individual
+                  man
+
+two generalization objects
+
+    G1{                      G2{
+      br = person               br= person
+           man                      someone
+           human                    individual
+      }                             man
+                                }
+
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Thu, 06 Oct 2011 01:47:32 -0000</pubDate><guid>https://sourceforge.net0f2d2bf5d98ea3462ae55618c3acf54497e7b216</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v7 
+++ v8 
@@ -201,7 +201,7 @@
      // 2nd order substitution:
 
  
-   sentence {
+     sentence {
           br= man'     eat' meat'   
           }
  
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Wed, 05 Oct 2011 19:13:08 -0000</pubDate><guid>https://sourceforge.nete4dcd52a216a8f80326cf2c8b9f87c52bbe2216c</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v6 
+++ v7 
@@ -158,3 +158,93 @@
 
          "person eat food"  is in "person" in the main obj_pool, so sentence(man eat meat) is  
          found to be true, or -understood-
+
+//----------------------------------------------------------------------------
+The substitute() function
+ 
+
+    sentence {
+          br= man'     eat' meat'   
+         }
+ 
+
+     man'{                   man{				      
+       br= eat' meat'          br = is person    //nouns     
+       }                            is animal    	      
+                                    is human		      
+                                    is carnivore   
+                                    eat          //verbs	      
+     		                    work			      
+     		             }                                  
+
+    // man substitutes in 'person' into sentence
+   
+     sentence {
+          br= man'     eat' meat'   
+              person'  eat' meat'
+         }
+
+
+    // person gets its own sequence " eat' meat' " in its branches list
+    // the two eat' objects are separate instances     
+
+
+     // substituting in occurs when the original sentence is not understood 
+     // (stored in obj_pool)
+
+     // simplest substitution is top noun in 'man' branches list.
+     
+     // allows for combinatorial search of nearby concepts.
+
+     // more complex substitution algorithms possible
+  
+     // 2nd order substitution:
+
+ 
+   sentence {
+          br= man'     eat' meat'   
+          }
+ 
+
+     man'{                   man{				      
+       br= eat' meat'          br = is person    //nouns     
+       }                            is animal    	      
+                                    is human		      
+                                    is carnivore   
+                                    eat          //verbs	      
+     		                    work			      
+     		               }                                  
+ 
+
+     person{	             animal{                 carnivore{	   
+         br= is human               br= ...                     br = ... 
+             is individual              eat food	             eat meat  
+             is someone	           }   	                      }
+         }
+     
+      
+
+     Object::search(Object* obj){
+
+        //called as 
+        //man'-&gt;search(&amp;man)
+
+      for (target_obj= obj-&gt;branches.begin -&gt;end){             //loop over man branches
+        obj1 = target_obj-&gt;find_lemma(target_object-&gt;lemma)    //find person, animal,... in
+                                                               // main object pool.
+
+        for (obj2= branches.begin -&gt;end){                  //loop over man' branches
+   
+           match( obj1, obj2 )    // returns metric   
+                                  // carnivore has best match
+          substitute (best match/highest metric)
+     }
+
+     //sentence becomes:
+
+     sentence {
+          br= man'     eat' meat'   
+              carnivore' eat' meat'
+          }
+   
+     
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Wed, 05 Oct 2011 19:12:39 -0000</pubDate><guid>https://sourceforge.net1a758cd835e7885ceb7bc2adec57b188796acc0d</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v5 
+++ v6 
@@ -39,8 +39,10 @@
      				                  
      sentence-&gt;read()		                            
      man'-&gt;read()  -&gt; substitute() in person':
-     
-     
+  
+     // man' = object in sentence, man = object in main object_pool   
+     // they have the same lemma (man)
+     
      man'{                   man{				      
        br= eat' meat'          br = is person    //nouns     
        }                            is animal    	      
@@ -49,77 +51,86 @@
      		                    work			      
      		             }                                  
      
-     
+
+     // sentence object becomes:
+   
      sentence {
           br= man'     eat' meat'   
               person'
          }
      
      person{                    person'{	   
         br= is human		     br = eat' meat' 
             is individual	    }
             is someone	    
            }
      
      man'-&gt;read(-&gt;):eat'-&gt;read()
      
      eat{                    eat'{	   
         br=food                 br= meat'   
            a meal             r_br= man'
         }   
      //skip eat, assume no change
      
      man'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):meat'-&gt;read()
      
      meat'{		        meat{				      
         br= ""                   br= is food
       r_br = eat' man'		is muscle
      }		        }
-     		        
+     
+     // meat substitutes in food		        
      
      // this is the state of the sentence object 
      // after the call to sentence-&gt;read()
-     sentence {
-           br= man'     eat'  meat'   
-               person'        food'   //put food' in eat' 's br list
+
+     sentence {
+           br= man'     eat'  meat'   
+               person'        food'  
      }
      
      // A call to sentence-&gt;read() produces 
      // the following recursive calls     
 
      man'-&gt;read()
      man'-&gt;read():eat'-&gt;read()
      man'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      man'-&gt;read():eat'-&gt;read():food'-&gt;read()
      
      person'-&gt;read()
      person'-&gt;read():eat'-&gt;read()
      person'-&gt;read():eat'-&gt;read():meat'-&gt;read()
      person'-&gt;read():eat'-&gt;read():food'-&gt;read()
      
     //-----------------------------------------------------------------------     
+
       //  introduce a truth function.  Will search sequences in tree
       // for matching sequence stored in obj_pool (by definition true)
       sentence-&gt;truth(&amp;obj_pool)
      
      
      Object::truth(o_pool*){
 
-      for (obj= branches.begin -&gt;end){                       //loop over branches
-   
-         obj1 = o_pool-&gt;find_match(obj-&gt;lemma)
-
-         if (  obj1 ==NULL ) return false
-
-         return obj-&gt;truth(obj1)  
-      }
-   
-
-   sentence {
+        for (obj= branches.begin -&gt;end){                       //loop over branches
+   
+           obj1 = o_pool-&gt;find_match(obj-&gt;lemma)
+
+           if (  obj1 ==NULL ) continue
+
+           retval= obj-&gt;truth(obj1)
+
+           if  (retval == true) return true 
+        }
+        return false
+     }
+    
+
+    sentence {
            br= man'     eat'  meat'   
                person'        food'   //put food' in eat' 's br list
      }
     
     man'{                   man{				      
        br= eat' meat'          br = is person    //nouns     
        }                            is animal    	      
@@ -127,15 +138,23 @@
                                     eat          //verbs	      
      		                    work			      
      		             }                                  
- 
+
+     person'{                    person{	   
+        br= eat' meat'               br= is human
+     }                                   is individual 
+                                         is someone	    
+                                         eat food
+                                 }
+
   
         sentence-&gt;truth(&amp;obj_pool)     
         returns true if any of:
         - man eat meat
         - man eat food
         - person eat meat
         - person eat food
 
-         these sequences are stored in the man or person object in the main object_pool.
-
-
+         these sequences are stored in the 'man' or 'person' object in the main object_pool.
+
+         "person eat food"  is in "person" in the main obj_pool, so sentence(man eat meat) is  
+         found to be true, or -understood-
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Tue, 04 Oct 2011 16:16:38 -0000</pubDate><guid>https://sourceforge.neta34e38e6a3d7ff2604de70f8b0f7791dabb0ec27</guid></item><item><title>WikiPage read function modified by Ken Del Signore</title><link>https://sourceforge.net/p/sequencetree/wiki/read%2520function/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -1,45 +1,46 @@
-     Object{
+    // the Object class 
+    Object{
           string lemma 
           list&lt;Object&gt; branches
           static Object* obj_pool       //points to main obj_pool
      
           read()
           Object* find(string)
       }
      
      
      Object::read(){
           if (  obj = obj_pool-&gt;find_match(lemma) !=NULL ){
             substitute(obj)   
           }
      
           for (obj= branches.begin -&gt;end){
               obj-&gt;read()
           } 
      }
      
      
      
      main(){
 
-     Object obj_pool;  obj_pool.load()
+     Object obj_pool;  obj_pool.load()         // load previously built obj_pool
      
      Object sentence = "man eat meat"
      
      sentence-&gt;read()
      }
           
      
      sentence{
           br= man' eat' meat'
       }
      
      
      				                  
      sentence-&gt;read()		                            
      man'-&gt;read()  -&gt; substitute() in person':
      
      
      man'{                   man{				      
        br= eat' meat'          br = is person    //nouns     
        }                            is animal    	      
@@ -50,41 +51,91 @@
      
      
      sentence {
           br= man'     eat' meat'   
               person'
          }
      
      person{                    person'{	   
         br= is human		     br = eat' meat' 
             is individual	    }
             is someone	    
            }
      
      man'-&gt;read(-&gt;):eat'-&gt;read()
      
      eat{                    eat'{	   
         br=food                 br= meat'   
            a meal             r_br= man'
         }   
      //skip eat, assume no change
      
      man'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):meat'-&gt;read()
      
      meat'{		        meat{				      
         br= ""                   br= is food
       r_br = eat' man'		is muscle
      }		        }
      		        
      
-     sentence {
-           br= man'     eat'  meat'   
-               person'        food'   //put food' in eat' 's br list
-     }
-     
-     man'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):food'-&gt;read()
-     
-     person'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):meat'-&gt;read()
-     person'-&gt;read(-&gt;):eat'-&gt;read(-&gt;):food'-&gt;read()
-     
-     
-     
+     // this is the state of the sentence object 
+     // after the call to sentence-&gt;read()
+     sentence {
+           br= man'     eat'  meat'   
+               person'        food'   //put food' in eat' 's br list
+     }
+     
+     // A call to sentence-&gt;read() produces 
+     // the following recursive calls     
+
+     man'-&gt;read()
+     man'-&gt;read():eat'-&gt;read()
+     man'-&gt;read():eat'-&gt;read():meat'-&gt;read()
+     man'-&gt;read():eat'-&gt;read():food'-&gt;read()
+     
+     person'-&gt;read()
+     person'-&gt;read():eat'-&gt;read()
+     person'-&gt;read():eat'-&gt;read():meat'-&gt;read()
+     person'-&gt;read():eat'-&gt;read():food'-&gt;read()
+     
+    //-----------------------------------------------------------------------     
+      //  introduce a truth function.  Will search sequences in tree
+      // for matching sequence stored in obj_pool (by definition true)
+      sentence-&gt;truth(&amp;obj_pool)
+     
+     
+     Object::truth(o_pool*){
+
+      for (obj= branches.begin -&gt;end){                       //loop over branches
+   
+         obj1 = o_pool-&gt;find_match(obj-&gt;lemma)
+
+         if (  obj1 ==NULL ) return false
+
+         return obj-&gt;truth(obj1)  
+      }
+   
+
+   sentence {
+           br= man'     eat'  meat'   
+               person'        food'   //put food' in eat' 's br list
+     }
+    
+    man'{                   man{				      
+       br= eat' meat'          br = is person    //nouns     
+       }                            is animal    	      
+                                    is human		      
+                                    eat          //verbs	      
+     		                    work			      
+     		             }                                  
+ 
+  
+        sentence-&gt;truth(&amp;obj_pool)     
+        returns true if any of:
+        - man eat meat
+        - man eat food
+        - person eat meat
+        - person eat food
+
+         these sequences are stored in the man or person object in the main object_pool.
+
+
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ken Del Signore</dc:creator><pubDate>Tue, 04 Oct 2011 15:51:29 -0000</pubDate><guid>https://sourceforge.net9c01d0557ad8cdd9a5638c791cf11fc3f05b9cff</guid></item></channel></rss>