00001 std::map<int, Btr<vtree > > tests;
00002
00003 void initTests()
00004 {
00005 AtomSpaceWrapper* atw = GET_ASW;
00006 int testi = 0;
00007 tests.clear();
00008
00009
00010
00011
00012
00014 printf("Insert test %d\n", testi++);
00015 tests[0] = Btr<vtree > (new vtree(mva((pHandle)AND_LINK,
00016 NewNode(CONCEPT_NODE, "Osama"),
00017 NewNode(CONCEPT_NODE, "terrorist")
00018 )));
00019
00020 printf("Insert test %d\n", testi++);
00021 tests[1] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00022 NewNode(PREDICATE_NODE, "friendOf"),
00023 mva((pHandle)LIST_LINK,
00024 NewNode(CONCEPT_NODE, "Amir"),
00025 NewNode(CONCEPT_NODE, "Osama")
00026 )
00027 )));
00028 printf("Insert test %d\n", testi++);
00029 tests[2] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00030 NewNode(PREDICATE_NODE, "wasKilled"),
00031 mva((pHandle)LIST_LINK,
00032 NewNode(CONCEPT_NODE, "Osama")
00033 )
00034 )));
00035 printf("Insert test %d\n", testi++);
00036 tests[3] = Btr<vtree >(new vtree(mva((pHandle)EVALUATION_LINK,
00037 NewNode(PREDICATE_NODE, "friendOf"),
00038 mva((pHandle)LIST_LINK,
00039 NewNode(FW_VARIABLE_NODE, "$OsamaFriend"),
00040 NewNode(CONCEPT_NODE, "Osama")
00041 )
00042 )));
00043 printf("Insert test %d\n", testi++);
00044 tests[4] = Btr<vtree > (new vtree(mva((pHandle)INHERITANCE_LINK,
00045 NewNode(CONCEPT_NODE, "Osama"),
00046 NewNode(CONCEPT_NODE, "AlQaeda")
00047 )));
00048 printf("Insert test %d\n", testi++);
00049 tests[5] = Btr<vtree > (new vtree(mva((pHandle)INHERITANCE_LINK,
00050 NewNode(CONCEPT_NODE, "Osama"),
00051 NewNode(CONCEPT_NODE, "Abu")
00052 )));
00053 printf("Insert test %d\n", testi++);
00054 tests[6] = Btr<vtree >(new vtree(mva((pHandle)INHERITANCE_LINK,
00055 NewNode(CONCEPT_NODE, "AlQaeda"),
00056 NewNode(CONCEPT_NODE, "terrorist")
00057 )));
00058 printf("Insert test %d\n", testi++);
00059 tests[7] = Btr<vtree > (new vtree(mva((pHandle)INHERITANCE_LINK,
00060 NewNode(CONCEPT_NODE, "Muhammad"),
00061 NewNode(CONCEPT_NODE, "Osama")
00062 )));
00063 printf("Insert test %d\n", testi++);
00064 tests[8] = Btr<vtree > (new vtree(mva((pHandle)INHERITANCE_LINK,
00065 NewNode(CONCEPT_NODE, "Muhammad"),
00066 NewNode(CONCEPT_NODE, "terrorist")
00067 )));
00068 printf("Insert test %d\n", testi++);
00069 tests[9] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00070 NewNode(PREDICATE_NODE, "killed"),
00071 mva((pHandle)LIST_LINK,
00072 NewNode(FW_VARIABLE_NODE, "$killeri"),
00073 NewNode(CONCEPT_NODE, "Osama")
00074 )
00075 )));
00076
00078 printf("Insert test %d\n", testi++);
00079 tests[10] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00080 NewNode(PREDICATE_NODE, "+++")
00081
00082 )));
00083
00085 printf("Insert test %d\n", testi++);
00086 tests[11] = Btr<vtree > (new vtree(mva((pHandle)IMPLICATION_LINK,
00087 mva((pHandle)AND_LINK,
00088 mva((pHandle)EVALUATION_LINK,
00089 NewNode(PREDICATE_NODE, "teacher_say"),
00090 mva((pHandle)LIST_LINK,
00091 NewNode(WORD_NODE, "fetch")
00092 )
00093 ),
00094 NewNode(FW_VARIABLE_NODE, "$1")
00095 ),
00096 mva((pHandle)EVALUATION_LINK,
00097 NewNode(PREDICATE_NODE, "+++")
00098 )
00099 )));
00100
00101 printf("Insert test %d\n", testi++);
00102 tests[12] = Btr<vtree > (new vtree(mva((pHandle)IMPLICATION_LINK,
00103 mva((pHandle)AND_LINK,
00104 NewNode(CONCEPT_NODE, "C"),
00105 NewNode(CONCEPT_NODE, "A")
00106 ),
00107 mva((pHandle)AND_LINK,
00108 NewNode(CONCEPT_NODE, "C"),
00109 NewNode(CONCEPT_NODE, "B")
00110 )
00111 )));
00112
00113 printf("Insert test %d\n", testi++);
00114 tests[13] = Btr<vtree > (new vtree(mva((pHandle)IMPLICATION_LINK,
00115 mva((pHandle)AND_LINK,
00116 NewNode(CONCEPT_NODE, "A"),
00117 NewNode(CONCEPT_NODE, "C")
00118 ),
00119 mva((pHandle)AND_LINK,
00120 NewNode(CONCEPT_NODE, "C"),
00121 NewNode(CONCEPT_NODE, "B")
00122 )
00123 )));
00124 printf("Insert test %d\n", testi++);
00125 tests[14] = Btr<vtree > (new vtree(mva((pHandle)IMPLICATION_LINK,
00126 mva((pHandle)AND_LINK,
00127 NewNode(CONCEPT_NODE, "A"),
00128 NewNode(CONCEPT_NODE, "C")
00129 ),
00130 mva((pHandle)AND_LINK,
00131 NewNode(CONCEPT_NODE, "B"),
00132 NewNode(CONCEPT_NODE, "C")
00133 )
00134 )));
00135
00136 printf("Insert test %d\n", testi++);
00137 tests[15] = Btr<vtree > (new vtree(
00138 mva((pHandle)IMPLICATION_LINK,
00139 NewNode(FW_VARIABLE_NODE, "$1"),
00140 mva((pHandle)EVALUATION_LINK,
00141 NewNode(PREDICATE_NODE, "teacher_say"),
00142 mva((pHandle)LIST_LINK,
00143 NewNode(WORD_NODE, "fetch")
00144 )
00145 )
00146 )));
00147
00148 printf("Insert test %d\n", testi++);
00149 tests[16] = Btr<vtree > (new vtree(
00150 mva((pHandle)IMPLICATION_LINK,
00151 NewNode(FW_VARIABLE_NODE, "$1"),
00152 mva((pHandle)AND_LINK,
00153 mva((pHandle)EVALUATION_LINK,
00154 NewNode(PREDICATE_NODE, "teacher_say"),
00155 mva((pHandle)LIST_LINK,
00156 NewNode(WORD_NODE, "fetch")
00157 )
00158 ),
00159 mva((pHandle)EVALUATION_LINK,
00160 NewNode(PREDICATE_NODE, "just_done"),
00161 mva((pHandle)LIST_LINK,
00162 mva((pHandle)EVALUATION_LINK,
00163 NewNode(SCHEMA_NODE, "give"),
00164 mva((pHandle)LIST_LINK,
00165 NewNode(CONCEPT_NODE, "ball"),
00166 NewNode(CONCEPT_NODE, "teacher")
00167 )
00168 )
00169 )
00170 )
00171 )
00172 )
00173 ));
00174
00175 printf("Insert test %d\n", testi++);
00176 tests[17] = Btr<vtree > (new vtree(
00177 mva((pHandle)IMPLICATION_LINK,
00178 NewNode(FW_VARIABLE_NODE, "$1"),
00179 mva((pHandle)AND_LINK,
00180 mva((pHandle)EVALUATION_LINK,
00181 NewNode(PREDICATE_NODE, "teacher_say"),
00182 mva((pHandle)LIST_LINK,
00183 NewNode(WORD_NODE, "fetch")
00184 )
00185 ),
00186 mva((pHandle)EVALUATION_LINK,
00187 NewNode(PREDICATE_NODE, "can_do"),
00188 mva((pHandle)LIST_LINK,
00189 mva((pHandle)EVALUATION_LINK,
00190 NewNode(SCHEMA_NODE, "walktowards"),
00191 mva((pHandle)LIST_LINK,
00192 NewNode(CONCEPT_NODE, "teacher")
00193 )
00194 )
00195 )
00196 )
00197 )
00198 )
00199 ));
00200
00201 printf("Insert test %d\n", testi++);
00202 tests[18] = Btr<vtree > (new vtree(
00203 mva((pHandle)EVALUATION_LINK,
00204 NewNode(PREDICATE_NODE, "just_done"),
00205 mva((pHandle)LIST_LINK,
00206 mva((pHandle)EVALUATION_LINK,
00207 NewNode(SCHEMA_NODE, "give"),
00208 mva((pHandle)LIST_LINK,
00209 NewNode(CONCEPT_NODE, "ball"),
00210 NewNode(CONCEPT_NODE, "teacher")
00211 )
00212 )
00213 )
00214 )
00215 ));
00216
00217 printf("Insert test %d\n", testi++);
00218 tests[19] = Btr<vtree > (new vtree(
00219 mva((pHandle)EVALUATION_LINK,
00220 NewNode(PREDICATE_NODE, "do"),
00221 mva((pHandle)LIST_LINK,
00222 mva((pHandle)EVALUATION_LINK,
00223 NewNode(SCHEMA_NODE, "give"),
00224 mva((pHandle)LIST_LINK,
00225 NewNode(CONCEPT_NODE, "ball"),
00226 NewNode(CONCEPT_NODE, "teacher")
00227 )
00228 )
00229 )
00230 )
00231 ));
00232
00233 printf("Insert test %d\n", testi++);
00234 tests[20] = Btr<vtree > (new vtree(
00235 mva((pHandle)EVALUATION_LINK,
00236 NewNode(PREDICATE_NODE, "+++")
00237 )
00238 ));
00239
00240 printf("Insert test %d\n", testi++);
00241 tests[21] = Btr<vtree > (new vtree(
00242 mva((pHandle)EVALUATION_LINK,
00243 NewNode(PREDICATE_NODE, "test2"),
00244 mva((pHandle)LIST_LINK,
00245 NewNode(CONCEPT_NODE, "Osama")
00246 )
00247 )
00248 ));
00249 printf("Insert test %d\n", testi++);
00250 tests[22] = Btr<vtree > (new vtree(
00251 mva((pHandle)EVALUATION_LINK,
00252 NewNode(PREDICATE_NODE, "just_done"),
00253 mva((pHandle)LIST_LINK,
00254 mva((pHandle)EVALUATION_LINK,
00255 NewNode(SCHEMA_NODE, "give"),
00256 mva((pHandle)LIST_LINK,
00257 NewNode(CONCEPT_NODE, "ball"),
00258 NewNode(CONCEPT_NODE, "teacher")
00259 )
00260 )
00261 )
00262 )
00263 ));
00264
00265 printf("Insert test %d\n", testi++);
00266 tests[23] = Btr<vtree > (new vtree(
00267 mva((pHandle)EVALUATION_LINK,
00268 NewNode(PREDICATE_NODE, "near"),
00269 mva((pHandle)LIST_LINK,
00270 NewNode(CONCEPT_NODE, "teacher")
00271 )
00272 )
00273 )
00274 );
00275
00276 printf("Insert test %d\n", testi++);
00277 tests[24] = Btr<vtree > (new vtree(
00278 mva((pHandle)SIMULTANEOUS_AND_LINK,
00279 NewNode(WORD_NODE, "blockword"),
00280 NewNode(FW_VARIABLE_NODE, "$blockword_associatee")
00281 )
00282 )
00283 );
00284
00285 printf("Insert test %d\n", testi++);
00286 tests[25] = Btr<vtree > (new vtree(mva((pHandle)IMPLICATION_LINK,
00287 NewNode(FW_VARIABLE_NODE, "$1"),
00288 mva((pHandle)EVALUATION_LINK,
00289 NewNode(PREDICATE_NODE, "+++")
00290 )
00291 )));
00292
00293 printf("Insert test %d\n", testi++);
00294 tests[26] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00295 NewNode(PREDICATE_NODE, "found_under"),
00296 mva((pHandle)LIST_LINK,
00297 NewNode(CONCEPT_NODE, "toy_6"),
00298 NewNode(FW_VARIABLE_NODE, "$1")
00299 )
00300 )));
00301 printf("Insert test %d\n", testi++);
00302 tests[27] = Btr<vtree > (new vtree(mva((pHandle)AND_LINK,
00303 mva((pHandle)INHERITANCE_LINK,
00304 NewNode(CONCEPT_NODE, "toy_6"),
00305 NewNode(CONCEPT_NODE, "toy")),
00306 mva((pHandle)INHERITANCE_LINK,
00307 NewNode(CONCEPT_NODE, "red_bucket_6"),
00308 NewNode(CONCEPT_NODE, "bucket")),
00309 mva((pHandle)EVALUATION_LINK,
00310 NewNode(PREDICATE_NODE, "placed_under"),
00311 mva((pHandle)LIST_LINK,
00312 NewNode(CONCEPT_NODE, "toy_6"),
00313 NewNode(CONCEPT_NODE, "red_bucket_6")
00314 )
00315 )
00316 )));
00317
00318 printf("Insert test %d\n", testi++);
00319 tests[28] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00320 NewNode(PREDICATE_NODE, "friendOf"),
00321 mva((pHandle)LIST_LINK,
00322 NewNode(CONCEPT_NODE, "Britney"),
00323 NewNode(CONCEPT_NODE, "Amir")
00324 ))));
00325
00326 printf("Insert test %d\n", testi++);
00327 tests[29] = Btr<vtree > (new vtree(mva((pHandle)FORALL_LINK,
00328 mva((pHandle)LIST_LINK),
00329 mva((pHandle)INHERITANCE_LINK,
00330 NewNode(FW_VARIABLE_NODE, "$i"),
00331 NewNode(CONCEPT_NODE, "terrorist")
00332 ))));
00333
00334 printf("Insert test %d\n", testi++);
00335 tests[30] = Btr<vtree > (new vtree(mva((pHandle)VARIABLE_SCOPE_LINK,
00336 mva((pHandle)LIST_LINK),
00337 mva((pHandle)INHERITANCE_LINK,
00338 NewNode(FW_VARIABLE_NODE, "$i"),
00339 NewNode(CONCEPT_NODE, "terrorist")
00340 ))));
00341
00342 printf("Insert test %d\n", testi++);
00343 tests[31] = Btr<vtree > (new vtree(mva((pHandle)EVALUATION_LINK,
00344 NewNode(PREDICATE_NODE, "Possible"),
00345 mva((pHandle)LIST_LINK,
00346 NewNode(FW_VARIABLE_NODE, "$elmerist")
00347 )
00348 )));
00349
00350 printf("Insert tests init\n");
00351 }
00352