logicmoo

NAL TEST (still reader only)

Feb 14th, 2021 (edited)
793
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NAL TEST
  2.  
  3. -----------------------------
  4. 'the detective claims that tim lives in graz
  5. -----------------------------
  6. %  ['$COMMENT'("the detective claims that tim lives in graz", -1, -1)].
  7.  
  8. -----------------------------
  9. <{tim} --> (/,livingIn,_,{graz})>.
  10. -----------------------------
  11. %  [ task(judgement,
  12. %           inheritance(ext_set([tim]), ext_image([livingIn, '_', ext_set([graz])])),
  13. %           _,
  14. %           _,
  15. %           Task)
  16. %    ].
  17.  
  18. -----------------------------
  19. <bird --> swimmer>. %0.87;0.91%
  20. -----------------------------
  21. %  [task(judgement, inheritance(bird, swimmer), _, [0.87, 0.91], Task)].
  22.  
  23. -----------------------------
  24. ''outputMustContain('<bird --> swimmer>. %0.87;0.91%')
  25. -----------------------------
  26. %  ['$COMMENT'("'outputMustContain('<bird --> swimmer>. %0.87;0.91%')", -1, -1)].
  27.  
  28. -----------------------------
  29. 1
  30. -----------------------------
  31. %  [do_steps(1)].
  32.  
  33. -----------------------------
  34. $1
  35. -----------------------------
  36. %  [nal_term(var(ind, 1))].
  37.  
  38. -----------------------------
  39. #1
  40. -----------------------------
  41. %  [nal_term(var(dep, 1))].
  42.  
  43. -----------------------------
  44. ?1
  45. -----------------------------
  46. %  [nal_term(var(query, 1))].
  47.  
  48. -----------------------------
  49. /1
  50. -----------------------------
  51. %  [nal_term(var(arg, 1))].
  52.  
  53. -----------------------------
  54. \1
  55. -----------------------------
  56. %  [nal_term(var(int, 1))].
  57.  
  58. -----------------------------
  59. 'eating tiger
  60. -----------------------------
  61. %  ['$COMMENT'("eating tiger", -1, -1)].
  62.  
  63. -----------------------------
  64. (eat /1 tiger)
  65. -----------------------------
  66. %  [nal_term(ext_image([eat, '_', tiger]))].
  67.  
  68. -----------------------------
  69. (/,eat,_,tiger)
  70. -----------------------------
  71. %  [nal_term(ext_image([eat, '_', tiger]))].
  72.  
  73. -----------------------------
  74. 'eaten by tiger
  75. -----------------------------
  76. %  ['$COMMENT'("eaten by tiger", -1, -1)].
  77.  
  78. -----------------------------
  79. (eat /2 tiger)
  80. -----------------------------
  81. %  [nal_term(ext_image([eat, tiger, '_']))].
  82.  
  83. -----------------------------
  84. (/,eat,tiger,_)
  85. -----------------------------
  86. %  [nal_term(ext_image([eat, tiger, '_']))].
  87.  
  88. -----------------------------
  89. 'intensional eating
  90. -----------------------------
  91. %  ['$COMMENT'("intensional eating", -1, -1)].
  92.  
  93. -----------------------------
  94. (eat \1 tiger)
  95. -----------------------------
  96. %  [nal_term(int_image([eat, '_', tiger]))].
  97.  
  98. -----------------------------
  99. (\,eat,_,tiger)
  100. -----------------------------
  101. %  [nal_term(int_image([eat, '_', tiger]))].
  102.  
  103. -----------------------------
  104. (eat \2 tiger)
  105. -----------------------------
  106. %  [nal_term(int_image([eat, tiger, '_']))].
  107.  
  108. -----------------------------
  109. (\,eat,tiger,_)
  110. -----------------------------
  111. %  [nal_term(int_image([eat, tiger, '_']))].
  112.  
  113. -----------------------------
  114. 'Revision ------
  115.  
  116. 'Bird is a type of swimmer.
  117. <bird --> swimmer>.
  118.  
  119. 'Bird is probably not a type of swimmer.
  120. <bird --> swimmer>. %0.10;0.60%
  121.  
  122. 1
  123.  
  124. 'Bird is very likely to be a type of swimmer.
  125. ''outputMustContain('<bird --> swimmer>. %0.87;0.91%')
  126. -----------------------------
  127. %  [ '$COMMENT'("Revision ------", -1, -1),
  128. %      '$COMMENT'("Bird is a type of swimmer.", -1, -1),
  129. %      task(judgement, inheritance(bird, swimmer), _, _, Task),
  130. %      '$COMMENT'("Bird is probably not a type of swimmer.", -1, -1),
  131. %      task(judgement, inheritance(bird, swimmer), _, [0.1, 0.6], Task1),
  132. %      do_steps(1),
  133. %      '$COMMENT'("Bird is very likely to be a type of swimmer.", -1, -1),
  134. %      '$COMMENT'("'outputMustContain('<bird --> swimmer>. %0.87;0.91%')", -1, -1)
  135. %    ].
  136.  
  137. -----------------------------
  138.  
  139. ********** revision
  140.   IN: <bird --> swimmer>. %1.00;0.90% {0 : 1}
  141.   IN: <bird --> swimmer>. %0.10;0.60% {0 : 2}
  142. 1
  143.  OUT: <bird --> swimmer>. %0.87;0.91% {1 : 1;2}
  144. -----------------------------
  145. %  [ '$COMMENT'("******** revision", -1, -1),
  146. %      nal_in(task(judgement,
  147. %                  inheritance(bird, swimmer),
  148. %                  _,
  149. %                  [1.0, 0.9],
  150. %                  Task),
  151. %             0:1),
  152. %      nal_in(task(judgement,
  153. %                  inheritance(bird, swimmer),
  154. %                  _,
  155. %                  [0.1, 0.6],
  156. %                  Task1),
  157. %             0:2),
  158. %      do_steps(1),
  159. %      nal_out(task(judgement,
  160. %                   inheritance(bird, swimmer),
  161. %                   _,
  162. %                   [0.87, 0.91],
  163. %                   Task2),
  164. %               (1:1;2))
  165. %    ].
  166.  
  167. -----------------------------
  168. ********** deduction
  169.   IN: <bird --> animal>. %1.00;0.90% {0 : 1}
  170.   IN: <robin --> bird>. %1.00;0.90% {0 : 2}
  171. 1
  172.  OUT: <robin --> animal>. %1.00;0.81% {1 : 2;1}
  173.  OUT: <animal --> robin>. %1.00;0.45% {1 : 2;1}
  174. -----------------------------
  175. %  [ '$COMMENT'("******** deduction", -1, -1),
  176. %      nal_in(task(judgement,
  177. %                  inheritance(bird, animal),
  178. %                  _,
  179. %                  [1.0, 0.9],
  180. %                  Task),
  181. %             0:1),
  182. %      nal_in(task(judgement,
  183. %                  inheritance(robin, bird),
  184. %                  _,
  185. %                  [1.0, 0.9],
  186. %                  Task1),
  187. %             0:2),
  188. %      do_steps(1),
  189. %      nal_out(task(judgement,
  190. %                   inheritance(robin, animal),
  191. %                   _,
  192. %                   [1.0, 0.81],
  193. %                   Task2),
  194. %               (1:2;1)),
  195. %      nal_out(task(judgement,
  196. %                   inheritance(animal, robin),
  197. %                   _,
  198. %                   [1.0, 0.45],
  199. %                   Task3),
  200. %               (1:2;1))
  201. %    ].
  202.  
  203. -----------------------------
  204.  
  205. ********** abduction
  206.   IN: <sport --> competition>. %1.00;0.90% {0 : 1}
  207.   IN: <chess --> competition>. %0.90;0.90% {0 : 2}
  208. 1
  209.  OUT: <sport --> chess>. %1.00;0.42% {1 : 2;1}
  210.  OUT: <chess --> sport>. %0.90;0.45% {1 : 2;1}
  211.  OUT: <chess <-> sport>. %0.90;0.45% {1 : 2;1}
  212.  OUT: <(&,chess,sport) --> competition>. %1.00;0.81% {1 : 2;1}
  213.  OUT: <(<PIPE>,chess,sport) --> competition>. %0.90;0.81% {1 : 2;1}
  214.  OUT: <<sport --> $1> ==> <chess --> $1>>. %0.90;0.45% {1 : 2;1}
  215.  OUT: <<chess --> $1> ==> <sport --> $1>>. %1.00;0.42% {1 : 2;1}
  216.  OUT: <<chess --> $1> <=> <sport --> $1>>. %0.90;0.45% {1 : 2;1}
  217.  OUT: (&&,<chess --> #1>,<sport --> #1>). %0.90;0.81% {1 : 2;1}
  218. -----------------------------
  219. %  [ '$COMMENT'("******** abduction", -1, -1),
  220. %      nal_in(task(judgement,
  221. %                  inheritance(sport, competition),
  222. %                  _,
  223. %                  [1.0, 0.9],
  224. %                  Task),
  225. %             0:1),
  226. %      nal_in(task(judgement,
  227. %                  inheritance(chess, competition),
  228. %                  _,
  229. %                  [0.9, 0.9],
  230. %                  Task1),
  231. %             0:2),
  232. %      do_steps(1),
  233. %      nal_out(task(judgement,
  234. %                   inheritance(sport, chess),
  235. %                   _,
  236. %                   [1.0, 0.42],
  237. %                   Task2),
  238. %               (1:2;1)),
  239. %      nal_out(task(judgement,
  240. %                   inheritance(chess, sport),
  241. %                   _,
  242. %                   [0.9, 0.45],
  243. %                   Task3),
  244. %               (1:2;1)),
  245. %      nal_out(task(judgement,
  246. %                   similarity(chess, sport),
  247. %                   _,
  248. %                   [0.9, 0.45],
  249. %                   Task4),
  250. %               (1:2;1)),
  251. %      nal_out(task(judgement,
  252. %                   inheritance(ext_intersection([chess, sport]), competition),
  253. %                   _,
  254. %                   [1.0, 0.81],
  255. %                   Task5),
  256. %               (1:2;1)),
  257. %      nal_out(task(judgement,
  258. %                   inheritance(int_intersection([chess, sport]), competition),
  259. %                   _,
  260. %                   [0.9, 0.81],
  261. %                   Task6),
  262. %               (1:2;1)),
  263. %      nal_out(task(judgement,
  264. %                   implication(inheritance(sport, var(ind, 1)),
  265. %                               inheritance(chess, var(ind, 1))),
  266. %                   _,
  267. %                   [0.9, 0.45],
  268. %                   Task7),
  269. %               (1:2;1)),
  270. %      nal_out(task(judgement,
  271. %                   implication(inheritance(chess, var(ind, 1)),
  272. %                               inheritance(sport, var(ind, 1))),
  273. %                   _,
  274. %                   [1.0, 0.42],
  275. %                   Task8),
  276. %               (1:2;1)),
  277. %      nal_out(task(judgement,
  278. %                   equiv(inheritance(chess, var(ind, 1)),
  279. %                         inheritance(sport, var(ind, 1))),
  280. %                   _,
  281. %                   [0.9, 0.45],
  282. %                   Task9),
  283. %               (1:2;1)),
  284. %      nal_out(task(judgement,
  285. %                   nal_named_statement(and([ inheritance(chess, var(dep, 1)),
  286. %                                             inheritance(sport, var(dep, 1))
  287. %                                           ])),
  288. %                   _,
  289. %                   [0.9, 0.81],
  290. %                   Task10),
  291. %               (1:2;1))
  292. %    ].
  293.  
  294. -----------------------------
  295.  
  296. ********* induction
  297.   IN: <swan --> swimmer>. %0.90;0.90% {0 : 1}
  298.   IN: <swan --> bird>. %1.00;0.90% {0 : 2}
  299. 1
  300.  OUT: <bird --> swimmer>. %0.90;0.45% {1 : 2;1}
  301.  OUT: <swimmer --> bird>. %1.00;0.42% {1 : 2;1}
  302.  OUT: <bird <-> swimmer>. %0.90;0.45% {1 : 2;1}
  303.  OUT: <swan --> (<PIPE>,bird,swimmer)>. %1.00;0.81% {1 : 2;1}
  304.  OUT: <swan --> (&,bird,swimmer)>. %0.90;0.81% {1 : 2;1}
  305.  OUT: <<$1 --> swimmer> ==> <$1 --> bird>>. %1.00;0.42% {1 : 2;1}
  306.  OUT: <<$1 --> bird> ==> <$1 --> swimmer>>. %0.90;0.45% {1 : 2;1}
  307.  OUT: <<$1 --> bird> <=> <$1 --> swimmer>>. %0.90;0.45% {1 : 2;1}
  308.  OUT: (&&,<#1 --> bird>,<#1 --> swimmer>). %0.90;0.81% {1 : 2;1}
  309. -----------------------------
  310. %  [ '$COMMENT'("******* induction", -1, -1),
  311. %      nal_in(task(judgement,
  312. %                  inheritance(swan, swimmer),
  313. %                  _,
  314. %                  [0.9, 0.9],
  315. %                  Task),
  316. %             0:1),
  317. %      nal_in(task(judgement,
  318. %                  inheritance(swan, bird),
  319. %                  _,
  320. %                  [1.0, 0.9],
  321. %                  Task1),
  322. %             0:2),
  323. %      do_steps(1),
  324. %      nal_out(task(judgement,
  325. %                   inheritance(bird, swimmer),
  326. %                   _,
  327. %                   [0.9, 0.45],
  328. %                   Task2),
  329. %               (1:2;1)),
  330. %      nal_out(task(judgement,
  331. %                   inheritance(swimmer, bird),
  332. %                   _,
  333. %                   [1.0, 0.42],
  334. %                   Task3),
  335. %               (1:2;1)),
  336. %      nal_out(task(judgement,
  337. %                   similarity(bird, swimmer),
  338. %                   _,
  339. %                   [0.9, 0.45],
  340. %                   Task4),
  341. %               (1:2;1)),
  342. %      nal_out(task(judgement,
  343. %                   inheritance(swan, int_intersection([bird, swimmer])),
  344. %                   _,
  345. %                   [1.0, 0.81],
  346. %                   Task5),
  347. %               (1:2;1)),
  348. %      nal_out(task(judgement,
  349. %                   inheritance(swan, ext_intersection([bird, swimmer])),
  350. %                   _,
  351. %                   [0.9, 0.81],
  352. %                   Task6),
  353. %               (1:2;1)),
  354. %      nal_out(task(judgement,
  355. %                   implication(inheritance(var(ind, 1), swimmer),
  356. %                               inheritance(var(ind, 1), bird)),
  357. %                   _,
  358. %                   [1.0, 0.42],
  359. %                   Task7),
  360. %               (1:2;1)),
  361. %      nal_out(task(judgement,
  362. %                   implication(inheritance(var(ind, 1), bird),
  363. %                               inheritance(var(ind, 1), swimmer)),
  364. %                   _,
  365. %                   [0.9, 0.45],
  366. %                   Task8),
  367. %               (1:2;1)),
  368. %      nal_out(task(judgement,
  369. %                   equiv(inheritance(var(ind, 1), bird),
  370. %                         inheritance(var(ind, 1), swimmer)),
  371. %                   _,
  372. %                   [0.9, 0.45],
  373. %                   Task9),
  374. %               (1:2;1)),
  375. %      nal_out(task(judgement,
  376. %                   nal_named_statement(and([ inheritance(var(dep, 1), bird),
  377. %                                             inheritance(var(dep, 1), swimmer)
  378. %                                           ])),
  379. %                   _,
  380. %                   [0.9, 0.81],
  381. %                   Task10),
  382. %               (1:2;1))
  383. %    ].
  384.  
  385. -----------------------------
  386.  
  387. ********** exemplification
  388.   IN: <robin --> bird>. %1.00;0.90% {0 : 1}
  389.   IN: <bird --> animal>. %1.00;0.90% {0 : 2}
  390. 1
  391.  OUT: <robin --> animal>. %1.00;0.81% {1 : 2;1}
  392.  OUT: <animal --> robin>. %1.00;0.45% {1 : 2;1}
  393. -----------------------------
  394. %  [ '$COMMENT'("******** exemplification", -1, -1),
  395. %      nal_in(task(judgement,
  396. %                  inheritance(robin, bird),
  397. %                  _,
  398. %                  [1.0, 0.9],
  399. %                  Task),
  400. %             0:1),
  401. %      nal_in(task(judgement,
  402. %                  inheritance(bird, animal),
  403. %                  _,
  404. %                  [1.0, 0.9],
  405. %                  Task1),
  406. %             0:2),
  407. %      do_steps(1),
  408. %      nal_out(task(judgement,
  409. %                   inheritance(robin, animal),
  410. %                   _,
  411. %                   [1.0, 0.81],
  412. %                   Task2),
  413. %               (1:2;1)),
  414. %      nal_out(task(judgement,
  415. %                   inheritance(animal, robin),
  416. %                   _,
  417. %                   [1.0, 0.45],
  418. %                   Task3),
  419. %               (1:2;1))
  420. %    ].
  421.  
  422. -----------------------------
  423.  
  424. ********** conversion
  425.   IN: <bird --> swimmer>. %1.00;0.90% {0 : 1}
  426.   IN: <swimmer --> bird>?  {0 : 2}
  427. 2
  428.  OUT: <swimmer --> bird>. %1.00;0.47% {2 : 1}
  429. -----------------------------
  430. %  [ '$COMMENT'("******** conversion", -1, -1),
  431. %      nal_in(task(judgement,
  432. %                  inheritance(bird, swimmer),
  433. %                  _,
  434. %                  [1.0, 0.9],
  435. %                  Task),
  436. %             0:1),
  437. %      nal_in(task(question_truth,
  438. %                  inheritance(swimmer, bird),
  439. %                  _,
  440. %                  _,
  441. %                  Task1),
  442. %             0:2),
  443. %      do_steps(2),
  444. %      nal_out(task(judgement,
  445. %                   inheritance(swimmer, bird),
  446. %                   _,
  447. %                   [1.0, 0.47],
  448. %                   Task2),
  449. %              2:1)
  450. %    ].
  451.  
  452. -----------------------------
  453.  
  454. ********** y/n question
  455.   IN: <bird --> swimmer>. %1.00;0.90% {0 : 1}
  456.   IN: <bird --> swimmer>?  {0 : 2}
  457. 1
  458.  OUT: <bird --> swimmer>. %1.00;0.90% {0 : 1}
  459. -----------------------------
  460. %  [ '$COMMENT'("******** y/n question", -1, -1),
  461. %      nal_in(task(judgement,
  462. %                  inheritance(bird, swimmer),
  463. %                  _,
  464. %                  [1.0, 0.9],
  465. %                  Task),
  466. %             0:1),
  467. %      nal_in(task(question_truth,
  468. %                  inheritance(bird, swimmer),
  469. %                  _,
  470. %                  _,
  471. %                  Task1),
  472. %             0:2),
  473. %      do_steps(1),
  474. %      nal_out(task(judgement,
  475. %                   inheritance(bird, swimmer),
  476. %                   _,
  477. %                   [1.0, 0.9],
  478. %                   Task2),
  479. %              0:1)
  480. %    ].
  481.  
  482. -----------------------------
  483.  
  484. ********** wh-question
  485.   IN: <bird --> swimmer>. %1.00;0.80% {0 : 1}
  486.   IN: <?1 --> swimmer>?  {0 : 2}
  487. 1
  488.  OUT: <bird --> swimmer>. %1.00;0.80% {0 : 1}
  489. -----------------------------
  490. %  [ '$COMMENT'("******** wh-question", -1, -1),
  491. %      nal_in(task(judgement,
  492. %                  inheritance(bird, swimmer),
  493. %                  _,
  494. %                  [1.0, 0.8],
  495. %                  Task),
  496. %             0:1),
  497. %      nal_in(task(question_truth,
  498. %                  inheritance(var(query, 1), swimmer),
  499. %                  _,
  500. %                  _,
  501. %                  Task1),
  502. %             0:2),
  503. %      do_steps(1),
  504. %      nal_out(task(judgement,
  505. %                   inheritance(bird, swimmer),
  506. %                   _,
  507. %                   [1.0, 0.8],
  508. %                   Task2),
  509. %              0:1)
  510. %    ].
  511.  
  512. -----------------------------
  513.  
  514.  
  515. 'the detective claims that tim lives in graz
  516. '<{tim} --> (/,livingIn,_,{graz})>.
  517. 'and lawyer claims that this is not the case
  518. <{tim} --> (/,livingIn,_,{graz})>. %0%
  519. 100
  520. 'the first deponent, a psychologist,
  521. 'claims that people with sunglasses are more aggressive
  522. <<(*,$1,sunglasses) --> own> ==> <$1 --> [aggressive]>>.
  523. 'the third deponent claims, that he has seen tom with sunglasses on:
  524. <(*,{tom},sunglasses) --> own>.
  525. 'the teacher claims, that people who are aggressive tend to be murders
  526. <<$1 --> [aggressive]> ==> <$1 --> murder>>.
  527. 'the second deponent claims, that if the person lives in Graz, he is surely the murder
  528. <<$1 --> (/,livingIn,_,{graz})> ==> <$1 --> murder>>.
  529. 'who is the murder?
  530. <{?who} --> murder>?
  531. ''outputMustContain('<{tom} --> murder>. %1.00;0.73%')
  532.  
  533. -----------------------------
  534. %  [ '$COMMENT'("the detective claims that tim lives in graz", -1, -1),
  535. %      '$COMMENT'("<{tim} --> (/,livingIn,_,{graz})>.", -1, -1),
  536. %      '$COMMENT'("and lawyer claims that this is not the case", -1, -1),
  537. %      task(judgement,
  538. %           inheritance(ext_set([tim]), ext_image([livingIn, '_', ext_set([graz])])),
  539. %           _,
  540. %           [0, CAR],
  541. %           Task),
  542. %      do_steps(100),
  543. %      '$COMMENT'("the first deponent, a psychologist,", -1, -1),
  544. %      '$COMMENT'("claims that people with sunglasses are more aggressive", -1, -1),
  545. %      task(judgement,
  546. %           implication(inheritance(product([var(ind, 1), sunglasses]), own),
  547. %                       inheritance(var(ind, 1), int_set([aggressive]))),
  548. %           _,
  549. %           _,
  550. %           Task1),
  551. %      '$COMMENT'("the third deponent claims, that he has seen tom with sunglasses on:",
  552. %                 -1,
  553. %                 -1),
  554. %      task(judgement,
  555. %           inheritance(product([ext_set([tom]), sunglasses]), own),
  556. %           _,
  557. %           _,
  558. %           Task2),
  559. %      '$COMMENT'("the teacher claims, that people who are aggressive tend to be murders",
  560. %                 -1,
  561. %                 -1),
  562. %      task(judgement,
  563. %           implication(inheritance(var(ind, 1), int_set([aggressive])),
  564. %                       inheritance(var(ind, 1), murder)),
  565. %           _,
  566. %           _,
  567. %           Task3),
  568. %      '$COMMENT'("the second deponent claims, that if the person lives in Graz, he is surely the murder",
  569. %                 -1,
  570. %                 -1),
  571. %      task(judgement,
  572. %           implication(inheritance(var(ind, 1),
  573. %                                   ext_image([livingIn, '_', ext_set([graz])])),
  574. %                       inheritance(var(ind, 1), murder)),
  575. %           _,
  576. %           _,
  577. %           Task4),
  578. %      '$COMMENT'("who is the murder?", -1, -1),
  579. %      task(question_truth,
  580. %           inheritance(ext_set([var(query, who)]), murder),
  581. %           _,
  582. %           _,
  583. %           Task5),
  584. %      '$COMMENT'("'outputMustContain('<{tom} --> murder>. %1.00;0.73%')", -1, -1)
  585. %    ].
  586.  
  587. -----------------------------
  588.  
  589. ' Custom truth values These are added by appending {0.0 0.9} instead of %0.0;0.9% as we believe this increased the readability.
  590.  
  591. ' Example
  592.  
  593. ********** wh-question
  594.   IN: <bird --> swimmer>. %1.00;0.80% {0 : 1}
  595.   IN: <?1 --> swimmer>?  {0 : 2}
  596. 1
  597.  OUT: <bird --> swimmer>. %1.00;0.80% {0 : 1}
  598.  
  599. ' can now be
  600.  
  601.  
  602. ********** wh-question
  603.   IN: <bird --> swimmer>. {1.0 0.80} {0 : 1}
  604.   IN: <?1 --> swimmer>?  {0 : 2}
  605. 1
  606.  OUT: <bird --> swimmer>. {1.0 0.80} {0 : 1}
  607.  
  608. -----------------------------
  609. %  [ '$COMMENT'(" Custom truth values These are added by appending {0.0 0.9} instead of %0.0;0.9% as we believe this increased the readability.",
  610. %                 -1,
  611. %                 -1),
  612. %      '$COMMENT'(" Example", -1, -1),
  613. %      '$COMMENT'("******** wh-question", -1, -1),
  614. %      nal_in(task(judgement,
  615. %                  inheritance(bird, swimmer),
  616. %                  _,
  617. %                  [1.0, 0.8],
  618. %                  Task),
  619. %             0:1),
  620. %      nal_in(task(question_truth,
  621. %                  inheritance(var(query, 1), swimmer),
  622. %                  _,
  623. %                  _,
  624. %                  Task1),
  625. %             0:2),
  626. %      do_steps(1),
  627. %      nal_out(task(judgement,
  628. %                   inheritance(bird, swimmer),
  629. %                   _,
  630. %                   [1.0, 0.8],
  631. %                   Task2),
  632. %              0:1),
  633. %      '$COMMENT'(" can now be", -1, -1),
  634. %      '$COMMENT'("******** wh-question", -1, -1),
  635. %      nal_in(task(judgement,
  636. %                  inheritance(bird, swimmer),
  637. %                  _,
  638. %                  [1.0, 0.8],
  639. %                  Task3),
  640. %             0:1),
  641. %      nal_in(task(question_truth,
  642. %                  inheritance(var(query, 1), swimmer),
  643. %                  _,
  644. %                  _,
  645. %                  Task4),
  646. %             0:2),
  647. %      do_steps(1),
  648. %      nal_out(task(judgement,
  649. %                   inheritance(bird, swimmer),
  650. %                   _,
  651. %                   [1.0, 0.8],
  652. %                   Task5),
  653. %              0:1)
  654. %    ].
  655.  
  656. -----------------------------
  657.  
  658. 'Intervals, to measure expected time distances between events, are always learned by ONA and stored as meta-data, they are not part of the Narsese I/O format anymore. Hence a sequence
  659.  
  660. (&/,a,+5,b)
  661.  
  662. ' becomes
  663.  
  664. (&/,a,b)
  665.  
  666. ' or
  667.  
  668. (a &/ b)
  669.  
  670. ' and also the interval for implications is not used anymore.
  671.  
  672. -----------------------------
  673. %  [ '$COMMENT'("Intervals, to measure expected time distances between events, are always learned by ONA and stored as meta-data, they are not part of the Narsese I/O format anymore. Hence a sequence",
  674. %                 -1,
  675. %                 -1),
  676. %      nal_term(sequence_evnts([a, + 5, b])),
  677. %      '$COMMENT'(" becomes", -1, -1),
  678. %      nal_term(sequence_evnts([a, b])),
  679. %      '$COMMENT'(" or", -1, -1),
  680. %      nal_term(sequence_evnts([a, b])),
  681. %      '$COMMENT'(" and also the interval for implications is not used anymore.",
  682. %                 -1,
  683. %                 -1)
  684. %    ].
  685.  
  686. -----------------------------
  687.  
  688. 'Operators The syntactic sugar
  689.  
  690. (^op,arg_1,arg_2,arg_3,arg_n)
  691.  
  692. ' is not supported anymore, instead the full notation has to be used which is supported by both systems:
  693.  
  694. <(*,arg_1,arg_2,arg_3,arg_n) --> ^op>
  695.  
  696. ' though for operations without arguments, the following shortcut can be used:
  697.  
  698. ^op
  699.  
  700. -----------------------------
  701. %  [ '$COMMENT'("Operators The syntactic sugar", -1, -1),
  702. %      nal_term(product([exec([op]), arg_1, arg_2, arg_3, arg_n])),
  703. %      '$COMMENT'(" is not supported anymore, instead the full notation has to be used which is supported by both systems:",
  704. %                 -1,
  705. %                 -1),
  706. %      nal_term(inheritance(product([arg_1, arg_2, arg_3, arg_n]), exec([op]))),
  707. %      '$COMMENT'(" though for operations without arguments, the following shortcut can be used:",
  708. %                 -1,
  709. %                 -1),
  710. %      nal_term(exec([op]))
  711. %    ].
  712.  
  713. -----------------------------
  714.  
  715. 'Restrictions
  716.  
  717. '1. Copulas in ONA are binary, since it's using an array-based heap for terms.
  718. ' While there are ways to encode n-ary relations in a binary heap, the ONA philosophy, following KISS,
  719. ' encourages the use of left-nesting, which is also used by the system itself to compose sequences of events:
  720.  
  721. ((a &/ b) &/ c).
  722.  
  723. -----------------------------
  724. %  [ '$COMMENT'("Restrictions", -1, -1),
  725. %      '$COMMENT'("1. Copulas in ONA are binary, since it's using an array-based heap for terms. ",
  726. %                 -1,
  727. %                 -1),
  728. %      '$COMMENT'(" While there are ways to encode n-ary relations in a binary heap, the ONA philosophy, following KISS, ",
  729. %                 -1,
  730. %                 -1),
  731. %      '$COMMENT'(" encourages the use of left-nesting, which is also used by the system itself to compose sequences of events:",
  732. %                 -1,
  733. %                 -1),
  734. %      task(judgement,
  735. %           nal_named_statement(sequence_evnts([sequence_evnts([a, b]), c])),
  736. %           _,
  737. %           _,
  738. %           Task)
  739. %    ].
  740.  
  741. -----------------------------
  742.  
  743. '2. The parallel temporal copula &<PIPE> is not implemented, please use &/ for now, again due to KISS.
  744. ' If the order does not matter in some background knowledge we want to give the system, in addition to
  745.  
  746. <(a &/ b) =/> c>
  747.  
  748. ' also give it
  749.  
  750. <(b &/ a) =/> c>
  751.  
  752. ' to achieve the same as with &<PIPE> for now.
  753. -----------------------------
  754. %  [ '$COMMENT'("2. The parallel temporal copula &| is not implemented, please use &/ for now, again due to KISS. ",
  755. %                 -1,
  756. %                 -1),
  757. %      '$COMMENT'(" If the order does not matter in some background knowledge we want to give the system, in addition to",
  758. %                 -1,
  759. %                 -1),
  760. %      nal_term(predictive_impl(sequence_evnts([a, b]), c)),
  761. %      '$COMMENT'(" also give it", -1, -1),
  762. %      nal_term(predictive_impl(sequence_evnts([b, a]), c)),
  763. %      '$COMMENT'(" to achieve the same as with &| for now.", -1, -1)
  764. %    ].
  765.  
  766. -----------------------------
  767.  
  768. 'Optional syntactic improvements
  769. ' The ONA parser does not require commas, and doesn't distinguish between < and (, also it supports infix format.
  770.  
  771. <(<PIPE>,a,b) --> M>.
  772.  
  773. ' can be written as
  774.  
  775. <(a <PIPE> b) --> M>.
  776.  
  777. ' or even as
  778.  
  779. ((a <PIPE> b) --> M).
  780.  
  781. ' Note: Spaces cannot be omitted.
  782. -----------------------------
  783. %  [ '$COMMENT'("Optional syntactic improvements", -1, -1),
  784. %      '$COMMENT'(" The ONA parser does not require commas, and doesn't distinguish between < and (, also it supports infix format.",
  785. %                 -1,
  786. %                 -1),
  787. %      task(judgement,
  788. %           inheritance(int_intersection([a, b]), 'M'),
  789. %           _,
  790. %           _,
  791. %           Task),
  792. %      '$COMMENT'(" can be written as", -1, -1),
  793. %      task(judgement,
  794. %           inheritance(int_intersection([a, b]), 'M'),
  795. %           _,
  796. %           _,
  797. %           Task1),
  798. %      '$COMMENT'(" or even as", -1, -1),
  799. %      task(judgement,
  800. %           inheritance(int_intersection([a, b]), 'M'),
  801. %           _,
  802. %           _,
  803. %           Task2),
  804. %      '$COMMENT'(" Note: Spaces cannot be omitted.", -1, -1)
  805. %    ].
  806. true.
  807.  
  808. baseKB:  ?-
  809.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×