logicmoo

NARS reader

Feb 14th, 2021 (edited)
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 3.88 KB | None | 0 0
  1. nal_a_test("'the detective claims that tim lives in graz").
  2.  
  3. nal_a_test("'Revision ------
  4.  
  5. 'Bird is a type of swimmer.
  6. <bird --> swimmer>.
  7.  
  8. 'Bird is probably not a type of swimmer.
  9. <bird --> swimmer>. %0.10;0.60%
  10.  
  11. 1
  12.  
  13. 'Bird is very likely to be a type of swimmer.
  14. ''outputMustContain('<bird --> swimmer>. %0.87;0.91%')").
  15.  
  16. nal_a_test("
  17.  
  18. 'the detective claims that tim lives in graz
  19. '<{tim} --> (/,livingIn,_,{graz})>.
  20. 'and lawyer claims that this is not the case
  21. <{tim} --> (/,livingIn,_,{graz})>. %0%
  22. 100
  23. 'the first deponent, a psychologist,
  24. 'claims that people with sunglasses are more aggressive
  25. <<(*,$1,sunglasses) --> own> ==> <$1 --> [aggressive]>>.
  26. 'the third deponent claims, that he has seen tom with sunglasses on:
  27. <(*,{tom},sunglasses) --> own>.
  28. 'the teacher claims, that people who are aggressive tend to be murders
  29. <<$1 --> [aggressive]> ==> <$1 --> murder>>.
  30. 'the second deponent claims, that if the person lives in Graz, he is surely the murder
  31. <<$1 --> (/,livingIn,_,{graz})> ==> <$1 --> murder>>.
  32. 'who is the murder?
  33. <{?who} --> murder>?
  34. ''outputMustContain('<{tom} --> murder>. %1.00;0.73%')
  35.  
  36. ").
  37.  
  38.  
  39.  
  40. baseKB:  ?- nal_test.
  41. %  ['$COMMENT'("the detective claims that tim lives in graz", -1, -1)].
  42. %  [ '$COMMENT'("Revision ------", -1, -1),
  43. %      '$COMMENT'("Bird is a type of swimmer.", -1, -1),
  44. %      task(judgement, inheritance(bird, swimmer), _, _, Task),
  45. %      '$COMMENT'("Bird is probably not a type of swimmer.", -1, -1),
  46. %      task(judgement, inheritance(bird, swimmer), _, [0.1, 0.6], Task1),
  47. %      do_steps(1),
  48. %      '$COMMENT'("Bird is very likely to be a type of swimmer.", -1, -1),
  49. %      '$COMMENT'("'outputMustContain('<bird --> swimmer>. %0.87;0.91%')", -1, -1)
  50. %    ].
  51. %  [ '$COMMENT'("the detective claims that tim lives in graz", -1, -1),
  52. %      '$COMMENT'("<{tim} --> (/,livingIn,_,{graz})>.", -1, -1),
  53. %      '$COMMENT'("and lawyer claims that this is not the case", -1, -1),
  54. %      task(judgement,
  55. %           inheritance(ext_set([tim]), ext_image([livingIn, '_', ext_set([graz])])),
  56. %           _,
  57. %           [0, CAR],
  58. %           Task),
  59. %      do_steps(100),
  60. %      '$COMMENT'("the first deponent, a psychologist,", -1, -1),
  61. %      '$COMMENT'("claims that people with sunglasses are more aggressive", -1, -1),
  62. %      task(judgement,
  63. %           implication(inheritance(product([var(ind, 1), sunglasses]), own),
  64. %                       inheritance(var(ind, 1), int_set([aggressive]))),
  65. %           _,
  66. %           _,
  67. %           Task1),
  68. %      '$COMMENT'("the third deponent claims, that he has seen tom with sunglasses on:",
  69. %                 -1,
  70. %                 -1),
  71. %      task(judgement,
  72. %           inheritance(product([ext_set([tom]), sunglasses]), own),
  73. %           _,
  74. %           _,
  75. %           Task2),
  76. %      '$COMMENT'("the teacher claims, that people who are aggressive tend to be murders",
  77. %                 -1,
  78. %                 -1),
  79. %      task(judgement,
  80. %           implication(inheritance(var(ind, 1), int_set([aggressive])),
  81. %                       inheritance(var(ind, 1), murder)),
  82. %           _,
  83. %           _,
  84. %           Task3),
  85. %      '$COMMENT'("the second deponent claims, that if the person lives in Graz, he is surely the murder",
  86. %                 -1,
  87. %                 -1),
  88. %      task(judgement,
  89. %           implication(inheritance(var(ind, 1),
  90. %                                   ext_image([livingIn, '_', ext_set([graz])])),
  91. %                       inheritance(var(ind, 1), murder)),
  92. %           _,
  93. %           _,
  94. %           Task4),
  95. %      '$COMMENT'("who is the murder?", -1, -1),
  96. %      task(question_truth,
  97. %           inheritance(ext_set([var(query, who)]), murder),
  98. %           _,
  99. %           _,
  100. %           Task5),
  101. %      '$COMMENT'("'outputMustContain('<{tom} --> murder>. %1.00;0.73%')", -1, -1)
  102. %    ].
  103. true.
  104.  
  105. baseKB:  ?-
  106.  
  107.  
  108.  
  109.  
  110. nal_test:- forall(nal_a_test(Test),nal_test(Test)).
  111.  
Add Comment
Please, Sign In to add comment