Advertisement
logicmoo

Untitled

Sep 15th, 2020 (edited)
2,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 26.95 KB | None | 0 0
  1.  
  2.  
  3.  
  4. ===========================================
  5. [Mat]1-(Attrib)->[Color #1]
  6. ===========================================
  7.  
  8. % attrib(Mat, Color),
  9. % Color='Color#1',
  10. % isa(Color, 'Color'),
  11. % Mat='Mat#1',
  12. % isa(Mat, 'Mat'),
  13. % lbl(frame185).
  14.  
  15.  
  16.  
  17. ===========================================
  18. [Mat]1-(Attrib)->[Color]2
  19. ===========================================
  20.  
  21. % attrib(Mat, Color),
  22. % Color='Color#2',
  23. % isa(Color, 'Color'),
  24. % Mat='Mat#1',
  25. % isa(Mat, 'Mat'),
  26. % lbl(frame186).
  27.  
  28.  
  29.  
  30. ===========================================
  31. [Cat: @every]-(On)->[Mat]
  32. ===========================================
  33.  
  34. % on(Every_Cat, Mat),
  35. % isa(Mat, 'Mat'),
  36. % quantz(every, Every_Cat),
  37. % isa(Every_Cat, 'Cat'),
  38. % lbl(frame187).
  39.  
  40.  
  41.  
  42. ===========================================
  43. ['Man':imad]<-agnt-['Drive']-obj->['Car']
  44. ===========================================
  45.  
  46. % obj(Drive_Event, Car),
  47. % isa(Car, 'Car'),
  48. % agnt(Drive_Event, Imad_Man),
  49. % isa(Drive_Event, 'Drive'),
  50. % named(Imad_Man, [imad]),
  51. % isa(Imad_Man, 'Man'),
  52. % lbl(frame188).
  53.  
  54.  
  55.  
  56. ===========================================
  57. [Cat#1]-(On)->[Mat #1]-(Attrib)->[Color #1]
  58. ===========================================
  59.  
  60. % attrib(Cat, Color),
  61. % Color='Color#1',
  62. % isa(Color, 'Color'),
  63. % on(Cat, Mat),
  64. % Mat='Mat#1',
  65. % isa(Mat, 'Mat'),
  66. % Cat='Cat#1',
  67. % isa(Cat, 'Cat'),
  68. % lbl(frame189).
  69.  
  70.  
  71.  
  72. ===========================================
  73. [Cat: ?x]-(Attrib)->[C1]->(On)->[Mat]
  74. ===========================================
  75.  
  76. % on(X_, Mat),
  77. % isa(Mat, 'Mat'),
  78. % attrib(X_, C1),
  79. % isa(C1, 'C1'),
  80. % isa(X_, 'Cat'),
  81. % lbl(frame190).
  82.  
  83.  
  84.  
  85. ===========================================
  86. [Cat: ?x]-(On)->[Mat]
  87. ===========================================
  88.  
  89. % on(X_, Mat),
  90. % isa(Mat, 'Mat'),
  91. % isa(X_, 'Cat'),
  92. % lbl(frame191).
  93.  
  94.  
  95.  
  96. ===========================================
  97. [Cat: ?x]-(On)->[*MatC]
  98. ===========================================
  99.  
  100. % on(X_, MatC),
  101. % isa(X_, 'Cat'),
  102. % lbl(frame192).
  103.  
  104.  
  105.  
  106. ===========================================
  107. [Cat: ?x]-(On)->[Mat: *MatC]
  108. ===========================================
  109.  
  110. % on(X_, Mat),
  111. % isa(Mat, 'Mat'),
  112. % isa(X_, 'Cat'),
  113. % lbl(frame193).
  114.  
  115.  
  116.  
  117. ===========================================
  118. [Man:karim]<-agnt-[Drink]-obj->[Water]
  119. ===========================================
  120.  
  121. % obj(Drink_Event, Water),
  122. % isa(Water, 'Water'),
  123. % agnt(Drink_Event, Karim_Man),
  124. % isa(Drink_Event, 'Drink'),
  125. % named(Karim_Man, [karim]),
  126. % isa(Karim_Man, 'Man'),
  127. % lbl(frame194).
  128.  
  129.  
  130.  
  131. ===========================================
  132. [Mat #1]<- (on)- [Cat #1]
  133. ===========================================
  134.  
  135. % on(Cat, Mat),
  136. % Cat='Cat#1',
  137. % isa(Cat, 'Cat'),
  138. % Mat='Mat#1',
  139. % isa(Mat, 'Mat'),
  140. % lbl(frame195).
  141.  
  142.  
  143.  
  144. ===========================================
  145. [Mat]<-(On)-[Cat: ?x]
  146. ===========================================
  147.  
  148. % on(X_, Mat),
  149. % isa(X_, 'Cat'),
  150. % isa(Mat, 'Mat'),
  151. % lbl(frame196).
  152.  
  153.  
  154.  
  155. ===========================================
  156. [Color #1]<-(Attrib)-[Mat #1]
  157. ===========================================
  158.  
  159. % attrib(Mat, Color),
  160. % Mat='Mat#1',
  161. % isa(Mat, 'Mat'),
  162. % Color='Color#1',
  163. % isa(Color, 'Color'),
  164. % lbl(frame197).
  165.  
  166.  
  167.  
  168. ===========================================
  169. [Cat #1]-(On)->[Mat #1]-(Attrib)->[Color #1]
  170. ===========================================
  171.  
  172. % attrib(Cat, Color),
  173. % Color='Color#1',
  174. % isa(Color, 'Color'),
  175. % on(Cat, Mat),
  176. % Mat='Mat#1',
  177. % isa(Mat, 'Mat'),
  178. % Cat='Cat#1',
  179. % isa(Cat, 'Cat'),
  180. % lbl(frame198).
  181.  
  182.  
  183.  
  184. ===========================================
  185. [Man:karim]<-agnt-[Drink]-obj->[Water]
  186. ===========================================
  187.  
  188. % obj(Drink_Event, Water),
  189. % isa(Water, 'Water'),
  190. % agnt(Drink_Event, Karim_Man),
  191. % isa(Drink_Event, 'Drink'),
  192. % named(Karim_Man, [karim]),
  193. % isa(Karim_Man, 'Man'),
  194. % lbl(frame199).
  195.  
  196.  
  197.  
  198. ===========================================
  199. [Color #1] <- (Attrib) -[Mat #1]<- (on)- [Cat#1]
  200. ===========================================
  201.  
  202. % on(Cat, Mat),
  203. % Cat='Cat#1',
  204. % isa(Cat, 'Cat'),
  205. % attrib(Mat, Color),
  206. % Mat='Mat#1',
  207. % isa(Mat, 'Mat'),
  208. % Color='Color#1',
  209. % isa(Color, 'Color'),
  210. % lbl(frame200).
  211.  
  212.  
  213.  
  214. ===========================================
  215. [Cat: @every]->(On)->[Mat]
  216. ===========================================
  217.  
  218. % on(Every_Cat, Mat),
  219. % isa(Mat, 'Mat'),
  220. % quantz(every, Every_Cat),
  221. % isa(Every_Cat, 'Cat'),
  222. % lbl(frame201).
  223.  
  224.  
  225.  
  226. ===========================================
  227. [CAT]->(STAT)->[SIT]->(LOC)->[MAT].
  228. ===========================================
  229.  
  230. % loc(Sit, Mat),
  231. % isa(Mat, 'Mat'),
  232. % stat(Cat, Sit),
  233. % isa(Sit, 'Sit'),
  234. % isa(Cat, 'Cat'),
  235. % lbl(frame202).
  236.  
  237.  
  238.  
  239. ===========================================
  240. [CAT]->(STAT)->[SIT]->(LOC)->[MAT]
  241. ===========================================
  242.  
  243. % loc(Sit, Mat),
  244. % isa(Mat, 'Mat'),
  245. % stat(Cat, Sit),
  246. % isa(Sit, 'Sit'),
  247. % isa(Cat, 'Cat'),
  248. % lbl(frame203).
  249.  
  250.  
  251.  
  252. ===========================================
  253.  
  254.    [Drive *x] [Person: Bob] [City: "St. Louis"] [Chevy *y]
  255.    (Agnt ?x Bob) (Dest ?x "St. Louis") (Thme ?x ?y) (Poss Bob ?y)
  256. ===========================================
  257.  
  258. % rel('Poss', ['Bob', Y_Chevy]),
  259. % rel('Thme', [X_Drive, Y_Chevy]),
  260. % rel('Dest', [X_Drive, "St. Louis"]),
  261. % rel('Agnt', [X_Drive, 'Bob']),
  262. % isa(Y_Chevy, 'Chevy'),
  263. % textof(St_c46_c32_Louis_City, "St. Louis"),
  264. % isa(St_c46_c32_Louis_City, 'City'),
  265. % named(Bob_Person, ['Bob']),
  266. % isa(Bob_Person, 'Person'),
  267. % isa(X_Drive, 'Drive'),
  268. % lbl(frame204).
  269.  
  270.  
  271.  
  272. ===========================================
  273.  
  274.    [A_CAT] -> (KnowsAbout) ->
  275.    [THE_CAT: #666]  -> (KnowsAbout) ->
  276.    [NAMED_CAT: Moris]  -> (KnowsAbout) ->
  277.    [LENGTH: @ 5ft]
  278. ===========================================
  279.  
  280. % knowsabout(Moris_Named_cat, Ft_Length),
  281. % named(Ft_Length, [ft]),
  282. % quantz(5, Ft_Length),
  283. % isa(Ft_Length, 'Length'),
  284. % knowsabout(The_cat, Moris_Named_cat),
  285. % named(Moris_Named_cat, ['Moris']),
  286. % isa(Moris_Named_cat, 'Named_cat'),
  287. % knowsabout(A_cat, The_cat),
  288. % The_cat='The_cat#666',
  289. % isa(The_cat, 'The_cat'),
  290. % isa(A_cat, 'A_cat'),
  291. % lbl(frame205).
  292.  
  293.  
  294.  
  295. ===========================================
  296.  
  297.    [A_CAT] -> (KnowsAbout) ->
  298.    [THE_CAT: #666]  -> (KnowsAbout) ->
  299.    [NAMED_CAT: Moris]  -> (KnowsAbout) ->
  300.    [LENGTH: @ 5ft]  -> (KnowsAbout) ->
  301.    [CAT_SET:{*}]  -> (KnowsAbout) ->
  302.    [CAT5:{*} @ 5 ]  -> (KnowsAbout) ->
  303.    [CATS_TWO:{Moris, Felix}]  -> (KnowsAbout) ->
  304.    [CATS_ONE_OR_MORE:{Moris,*}]
  305. ===========================================
  306.  
  307.  
  308. ?- rtrace(
  309.     pred_cg(assert_cg_real,tOkS(['[','A_cat',']',->,'(','KnowsAbout',')',->,'[','The_cat',:,#,666,']',->,'(','KnowsAbout',')',->,'[','Named_cat',:,'Moris',']',->,'(','KnowsAbout',')',->,'[','Length',:,@,5,ft,']',->,'(','KnowsAbout',')',->,'[','Cat_set',:,'{',*,'}',']',->,'(','KnowsAbout',')',->,'[','Cat5',:,'{',*,'}',@,5,']',->,'(','KnowsAbout',')',->,'[','Cats_two',:,'{','Moris',',','Felix','}',']',->,'(','KnowsAbout',')',->,'[','Cats_one_or_more',:,'{','Moris',',',*,'}',']']))
  310.    ).
  311.  
  312.  
  313.  
  314. ===========================================
  315. [Relation: *r] (Familial ?r) (#?r Bob Sue)
  316. ===========================================
  317.  
  318. % rel(R, ['Bob', 'Sue']),
  319. % R=Relation,
  320. % rel('Familial', [Relation]),
  321. % isa(Relation, 'Relation'),
  322. % lbl(frame207).
  323.  
  324.  
  325.  
  326. ===========================================
  327.  
  328. [SIT]-
  329.   <-(STAT)<-[CAT]
  330.   ->(LOC)->[MAT],.
  331. ===========================================
  332.  
  333. % loc(Cat, Mat),
  334. % isa(Mat, 'Mat'),
  335. % stat(Cat, Sit),
  336. % isa(Cat, 'Cat'),
  337. % isa(Sit, 'Sit'),
  338. % lbl(frame208).
  339.  
  340.  
  341.  
  342. ===========================================
  343. ?x -(Attrib)-> [Color #1]
  344. ===========================================
  345.  
  346.   isa(Color, 'Color').
  347.   attrib(X, Color).
  348.   Color='Color#1'.
  349.   lbl(frame209).
  350.  
  351.  
  352.  
  353. ===========================================
  354. ?x -(On)->[Mat #1]-(Attrib)->[Color #1]
  355. ===========================================
  356.  
  357.   on(X, Mat).
  358.   isa(Color, 'Color').
  359.   isa(Mat, 'Mat').
  360.   attrib(X, Color).
  361.   Color='Color#1'.
  362.   Mat='Mat#1'.
  363.   lbl(frame210).
  364.  
  365.  
  366.  
  367. ===========================================
  368. ?x -(On)->[Mat #1]
  369. ===========================================
  370.  
  371.   on(X, Mat).
  372.   isa(Mat, 'Mat').
  373.   Mat='Mat#1'.
  374.   lbl(frame211).
  375.  
  376.  
  377.  
  378. ===========================================
  379. [?x] -(Attrib)-> [Color #1]
  380. ===========================================
  381.  
  382.   isa(Color, 'Color').
  383.   isa(X, '?(X)').
  384.   attrib(X, Color).
  385.   Color='Color#1'.
  386.   lbl(frame212).
  387.  
  388.  
  389.  
  390. ===========================================
  391. [?x]-(On)->[Mat #1]-(Attrib)->[Color #1]
  392. ===========================================
  393.  
  394.   on(X, Mat).
  395.   isa(Color, 'Color').
  396.   isa(Mat, 'Mat').
  397.   isa(X, '?(X)').
  398.   attrib(X, Color).
  399.   Color='Color#1'.
  400.   Mat='Mat#1'.
  401.   lbl(frame213).
  402.  
  403.  
  404.  
  405. ===========================================
  406. [Mat ?x]-(Attrib)->[Color #1]
  407. ===========================================
  408.  
  409.   isa(X, 'Mat').
  410.   isa(Color, 'Color').
  411.   attrib(X, Color).
  412.   Color='Color#1'.
  413.   lbl(frame214).
  414.  
  415.  
  416.  
  417. ===========================================
  418. [Cat: ?x]-(On)->[Mat #1]-(Attrib)->[Color #2]
  419. ===========================================
  420.  
  421.   on(X, Mat).
  422.   isa(X, 'Cat').
  423.   isa(Color, 'Color').
  424.   isa(Mat, 'Mat').
  425.   attrib(X, Color).
  426.   Color='Color#2'.
  427.   Mat='Mat#1'.
  428.   lbl(frame215).
  429.  
  430.  
  431.  
  432. ===========================================
  433. [a] - (belives) -> [statement: [Cat: @every]->(On)->[Mat] ]
  434. ===========================================
  435.  
  436.  
  437. ?- rtrace(
  438.     pred_cg(assert_cg_real,tOkS(['[',a,']',-,'(',belives,')',->,'[',statement,:,'[','Cat',:,@,every,']',->,'(','On',')',->,'[','Mat',']',']']))
  439.    ).
  440.  
  441.  
  442.  
  443. ===========================================
  444. [a] - (belives) -> [statement2= [Cat: @every]->(On)->[Mat] ]
  445. ===========================================
  446.  
  447.  
  448. ?- rtrace(
  449.     pred_cg(assert_cg_real,tOkS(['[',a,']',-,'(',belives,')',->,'[',statement2,=,'[','Cat',:,@,every,']',->,'(','On',')',->,'[','Mat',']',']']))
  450.    ).
  451.  
  452.  
  453.  
  454. ===========================================
  455.  
  456.  
  457. [Go]- -
  458.    (Agnt)->[Person: John] -
  459.    (Dest)->[City: Boston] -
  460.    (Inst)->[Bus]
  461. ===========================================
  462.  
  463. % inst(Go_Event, Bus),
  464. % isa(Bus, 'Bus'),
  465. % dest(Go_Event, Boston_City),
  466. % named(Boston_City, ['Boston']),
  467. % isa(Boston_City, 'City'),
  468. % agnt(Go_Event, John_Person),
  469. % named(John_Person, ['John']),
  470. % isa(John_Person, 'Person'),
  471. % isa(Go_Event, 'Go'),
  472. % lbl(frame220).
  473.  
  474.  
  475.  
  476. ===========================================
  477.  
  478.    [Person: John2] <- (Agnt) -
  479.    [City: Boston2] <- (Dest) -
  480.    [Bus2] <- (Inst) - [Go2]
  481. ===========================================
  482.  
  483. % inst(Go2_Event, Bus2),
  484. % isa(Go2_Event, 'Go2'),
  485. % dest(Bus2, Boston2_City_Event),
  486. % isa(Bus2, 'Bus2'),
  487. % agnt(Boston2_City_Event, John2_Person),
  488. % named(Boston2_City_Event, ['Boston2']),
  489. % isa(Boston2_City_Event, 'City'),
  490. % named(John2_Person, ['John2']),
  491. % isa(John2_Person, 'Person'),
  492. % lbl(frame221).
  493.  
  494.  
  495.  
  496. ===========================================
  497.  
  498. [Begin]-
  499.         -obj->[Session],
  500.         -srce->[Proposition =
  501.                    [Press] -
  502.                       -obj -> [Key : enter] -partOf-> [Keyboard],
  503.                       -agnt -> [Person : John]
  504.                ],
  505.         -agnt->[Person : John]
  506. ===========================================
  507.  
  508.  
  509. ?- rtrace(
  510.     pred_cg(assert_cg_real,tOkS(['[','Begin',']',-,-,obj,->,'[','Session',']',',',-,srce,->,'[','Proposition',=,'[','Press',']',-,-,obj,->,'[','Key',:,enter,']',-,partOf,->,'[','Keyboard',']',',',-,agnt,->,'[','Person',:,'John',']',']',',',-,agnt,->,'[','Person',:,'John',']']))
  511.    ).
  512.  
  513.  
  514.  
  515. ===========================================
  516.  
  517.  [a] - (belives) ->
  518.  [statement = [Go2]
  519.    - (Agnt)->[Person: John2]
  520.    - (Dest)->[City: Boston2]
  521.    - (Inst)->[Bus2]  ]
  522. ===========================================
  523.  
  524.  
  525. ?- rtrace(
  526.     pred_cg(assert_cg_real,tOkS(['[',a,']',-,'(',belives,')',->,'[',statement,=,'[','Go2',']',-,'(','Agnt',')',->,'[','Person',:,'John2',']',-,'(','Dest',')',->,'[','City',:,'Boston2',']',-,'(','Inst',')',->,'[','Bus2',']',']']))
  527.    ).
  528.  
  529.  
  530.  
  531. ===========================================
  532. [Go*x][Person:'John'*y][City:'Boston'*z][Bus*w](Agnt?x?y)(Dest?x?z)(Inst?x?w)
  533. ===========================================
  534.  
  535. % rel('Inst', [X_Go, W_Bus]),
  536. % rel('Dest', [X_Go, Z_Boston_City]),
  537. % rel('Agnt', [X_Go, Y_John_Person]),
  538. % isa(W_Bus, 'Bus'),
  539. % named(Z_Boston_City, ['Boston']),
  540. % isa(Z_Boston_City, 'City'),
  541. % named(Y_John_Person, ['John']),
  542. % isa(Y_John_Person, 'Person'),
  543. % isa(X_Go, 'Go'),
  544. % lbl(frame227).
  545.  
  546.  
  547.  
  548. ===========================================
  549. [Woman:red]<-knows-[Man:karim]<-agnt-[Eat]-obj->[Apple]-(on)->[table]
  550. ===========================================
  551.  
  552. % on(Red_Woman, Table),
  553. % isa(Table, table),
  554. % obj(Eat_Event, Apple),
  555. % isa(Apple, 'Apple'),
  556. % agnt(Eat_Event, Karim_Man),
  557. % isa(Eat_Event, 'Eat'),
  558. % knows(Karim_Man, Red_Woman),
  559. % named(Karim_Man, [karim]),
  560. % isa(Karim_Man, 'Man'),
  561. % named(Red_Woman, [red]),
  562. % isa(Red_Woman, 'Woman'),
  563. % lbl(frame228).
  564.  
  565.  
  566.  
  567. ===========================================
  568. [?x]<-(Agnt)-[Marry]-(Thme)->[Sailor]
  569. ===========================================
  570.  
  571. % thme(Marry_Event, Sailor),
  572. % isa(Sailor, 'Sailor'),
  573. % agnt(Marry_Event, X),
  574. % isa(Marry_Event, 'Marry'),
  575. % isa(X, '?(X)'),
  576. % lbl(frame229).
  577.  
  578.  
  579.  
  580. ===========================================
  581.  
  582. [Person: Mary *x]<-(Expr)-[Want]-(Thme)->
  583.      [Situation:  [?x]<-(Agnt)-[Marry]-(Thme)->[Sailor] ]
  584. ===========================================
  585.  
  586.  
  587. ?- rtrace(
  588.     pred_cg(assert_cg_real,tOkS(['[','Person',:,'Mary',*,x,']',<-,'(','Expr',')',-,'[','Want',']',-,'(','Thme',')',->,'[','Situation',:,'[',?('X'),']',<-,'(','Agnt',')',-,'[','Marry',']',-,'(','Thme',')',->,'[','Sailor',']',']']))
  589.    ).
  590.  
  591.  
  592.  
  593. ===========================================
  594.  
  595. [Proposition: [Person: Mary *x]<-(Expr)-[Want]-(Thme)->
  596.      [Situation:  [?x]<-(Agnt)-[Marry]-(Thme)->[Sailor] ]]
  597. ===========================================
  598.  
  599.  
  600. ?- rtrace(
  601.     pred_cg(assert_cg_real,tOkS(['[','Proposition',:,'[','Person',:,'Mary',*,x,']',<-,'(','Expr',')',-,'[','Want',']',-,'(','Thme',')',->,'[','Situation',:,'[',?('X'),']',<-,'(','Agnt',')',-,'[','Marry',']',-,'(','Thme',')',->,'[','Sailor',']',']',']']))
  602.    ).
  603.  
  604.  
  605.  
  606. ===========================================
  607.  
  608. [Person: Tom]<-(Expr)-[Believe]-(Thme)->
  609.      [Proposition:  [Person: Mary *x]<-(Expr)-[Want]-(Thme)->
  610.      [Situation:  [?x]<-(Agnt)-[Marry]-(Thme)->[Sailor] ]]
  611. ===========================================
  612.  
  613.  
  614. ?- rtrace(
  615.     pred_cg(assert_cg_real,tOkS(['[','Person',:,'Tom',']',<-,'(','Expr',')',-,'[','Believe',']',-,'(','Thme',')',->,'[','Proposition',:,'[','Person',:,'Mary',*,x,']',<-,'(','Expr',')',-,'[','Want',']',-,'(','Thme',')',->,'[','Situation',:,'[',?('X'),']',<-,'(','Agnt',')',-,'[','Marry',']',-,'(','Thme',')',->,'[','Sailor',']',']',']']))
  616.    ).
  617.  
  618.  
  619.  
  620. ===========================================
  621.  
  622. [Person: Tom]<-(Expr)<-[Believe]->(Thme)-
  623.      [Proposition:  [Person: Mary *x]<-(Expr)<-[Want]->(Thme)-
  624.      [Situation:  [?x]<-(Agnt)<-[Marry]->(Thme)->[Sailor] ]]
  625. ===========================================
  626.  
  627.  
  628. ?- rtrace(
  629.     pred_cg(assert_cg_real,tOkS(['[','Person',:,'Tom',']',<-,'(','Expr',')',<-,'[','Believe',']',->,'(','Thme',')',-,'[','Proposition',:,'[','Person',:,'Mary',*,x,']',<-,'(','Expr',')',<-,'[','Want',']',->,'(','Thme',')',-,'[','Situation',:,'[',?('X'),']',<-,'(','Agnt',')',<-,'[','Marry',']',->,'(','Thme',')',->,'[','Sailor',']',']',']']))
  630.    ).
  631.  
  632.  
  633.  
  634. ===========================================
  635. TYPE ARRIVAL-DATE(a) IS [UNIV:*a].
  636. ===========================================
  637.  
  638. % isa(A_Univ, 'Univ'),
  639. % decl(type, rEL('Arrival-date', [A_Univ])),
  640. % lbl(frame251).
  641.  
  642.  
  643.  
  644. ===========================================
  645. TYPE CIRCUS(c) IS [UNIV:*c].
  646. ===========================================
  647.  
  648. % isa(C_Univ, 'Univ'),
  649. % decl(type, rEL('Circus', [C_Univ])),
  650. % lbl(frame252).
  651.  
  652.  
  653.  
  654. ===========================================
  655. TYPE CIRCUS(c) IS [UNIV:*c]
  656. ===========================================
  657.  
  658. % isa(C_Univ, 'Univ'),
  659. % decl(type, rEL('Circus', [C_Univ])),
  660. % lbl(frame253).
  661.  
  662.  
  663.  
  664. ===========================================
  665. [ELEPHANT:*c]<-(AGNT)<-[PERFORM]->(LOC)->[CIRCUS]
  666. ===========================================
  667.  
  668. % loc(Perform_Event, Circus),
  669. % isa(Circus, 'Circus'),
  670. % agnt(Perform_Event, C_Elephant),
  671. % isa(Perform_Event, 'Perform'),
  672. % isa(C_Elephant, 'Elephant'),
  673. % lbl(frame254).
  674.  
  675.  
  676.  
  677. ===========================================
  678.  
  679. [Go *x] (Agnt ?x [Person: John]) (Dest ?x [City: Boston]) (Inst ?x [Bus])
  680.  
  681. ===========================================
  682.  
  683. % rel('Inst', [X_Go, Bus]),
  684. % isa(Bus, 'Bus'),
  685. % rel('Dest', [X_Go, Boston_City]),
  686. % named(Boston_City, ['Boston']),
  687. % isa(Boston_City, 'City'),
  688. % rel('Agnt', [X_Go, John_Person]),
  689. % named(John_Person, ['John']),
  690. % isa(John_Person, 'Person'),
  691. % isa(X_Go, 'Go'),
  692. % lbl(frame255).
  693.  
  694.  
  695.  
  696. ===========================================
  697. TYPE CIRCUS-ELEPHANT(C) IS
  698.  [ELEPHANT:*C]<-(AGNT)<-[PERFORM]->(LOC)->[CIRCUS].
  699. ===========================================
  700.  
  701.  
  702. ?- rtrace(
  703.     pred_cg(assert_cg_real,tOkS(['Type','Circus-elephant','(','C',')','Is','[','Elephant',:,*,'C',']',<-,'(','Agnt',')',<-,'[','Perform',']',->,'(','Loc',')',->,'[','Circus',']','.']))
  704.    ).
  705.  
  706.  
  707.  
  708. ===========================================
  709. TYPE CIRCUS-ELEPHANT(C) IS
  710.  [ELEPHANT:*C]<-(AGNT)<-[PERFORM]->(LOC)->[CIRCUS].
  711. ===========================================
  712.  
  713.  
  714. ?- rtrace(
  715.     pred_cg(assert_cg_real,tOkS(['Type','Circus-elephant','(','C',')','Is','[','Elephant',:,*,'C',']',<-,'(','Agnt',')',<-,'[','Perform',']',->,'(','Loc',')',->,'[','Circus',']','.']))
  716.    ).
  717.  
  718.  
  719.  
  720. ===========================================
  721. TYPE DEPARTURE-DATE(d) IS [UNIV:*d].
  722. ===========================================
  723.  
  724. % isa(D_Univ, 'Univ'),
  725. % decl(type, rEL('Departure-date', [D_Univ])),
  726. % lbl(frame258).
  727.  
  728.  
  729.  
  730. ===========================================
  731. TYPE ELEPHANT(e) IS [UNIV:*e].
  732. ===========================================
  733.  
  734. % isa(E_Univ, 'Univ'),
  735. % decl(type, rEL('Elephant', [E_Univ])),
  736. % lbl(frame259).
  737.  
  738.  
  739.  
  740. ===========================================
  741. TYPE HOTEL(h) IS [UNIV:*h].
  742. ===========================================
  743.  
  744. % isa(H_Univ, 'Univ'),
  745. % decl(type, rEL('Hotel', [H_Univ])),
  746. % lbl(frame260).
  747.  
  748.  
  749.  
  750. ===========================================
  751. TYPE HOTEL-RESERVATION(RESERVATION-NO) IS
  752. [RESERVATION:*RESERVATION-NO]-
  753.   ->(RCPT)->[PERSON]
  754.   ->(OBJ)->[ROOM]->(LOC)->[HOTEL]
  755.   ->(DUR)->[TIME-PERIOD]-
  756.              ->(STRT)->[ARRIVAL-DATE]
  757.              ->(UNTL)->[DEPARTURE-DATE],,.
  758. ===========================================
  759.  
  760.  
  761. ?- rtrace(
  762.     pred_cg(assert_cg_real,tOkS(['Type','Hotel-reservation','(','Reservation-no',')','Is','[','Reservation',:,*,'Reservation-no',']',-,->,'(','Rcpt',')',->,'[','Person',']',->,'(','Obj',')',->,'[','Room',']',->,'(','Loc',')',->,'[','Hotel',']',->,'(','Dur',')',->,'[','Time-period',']',-,->,'(','Strt',')',->,'[','Arrival-date',']',->,'(','Untl',')',->,'[','Departure-date',']',',',',','.']))
  763.    ).
  764.  
  765.  
  766.  
  767. ===========================================
  768. TYPE PERFORM(p) IS [UNIV:*p].
  769. ===========================================
  770.  
  771. % isa(P_Univ, 'Univ'),
  772. % decl(type, rEL('Perform', [P_Univ])),
  773. % lbl(frame262).
  774.  
  775.  
  776.  
  777. ===========================================
  778. TYPE PERSON(p) IS [UNIV:*p].
  779. ===========================================
  780.  
  781. % isa(P_Univ, 'Univ'),
  782. % decl(type, rEL('Person', [P_Univ])),
  783. % lbl(frame263).
  784.  
  785.  
  786.  
  787. ===========================================
  788. TYPE PROPOSITION(p) IS [UNIV:*p].
  789. ===========================================
  790.  
  791. % isa(P_Univ, 'Univ'),
  792. % decl(type, rEL('Proposition', [P_Univ])),
  793. % lbl(frame264).
  794.  
  795.  
  796.  
  797. ===========================================
  798. TYPE RESERVATION(r) IS [UNIV:*r].
  799. ===========================================
  800.  
  801. % isa(R_Univ, 'Univ'),
  802. % decl(type, rEL('Reservation', [R_Univ])),
  803. % lbl(frame265).
  804.  
  805.  
  806.  
  807. ===========================================
  808. TYPE ROOM(r) IS [UNIV:*r].
  809. ===========================================
  810.  
  811. % isa(R_Univ, 'Univ'),
  812. % decl(type, rEL('Room', [R_Univ])),
  813. % lbl(frame266).
  814.  
  815.  
  816.  
  817. ===========================================
  818. TYPE TIME-PERIOD(t) IS [UNIV:*t].
  819. ===========================================
  820.  
  821. % isa(T_Univ, 'Univ'),
  822. % decl(type, rEL('Time-period', [T_Univ])),
  823. % lbl(frame267).
  824.  
  825.  
  826.  
  827. ===========================================
  828.  
  829. [RESERVATION #316209]-
  830.   ->(RCPT)->[PERSON:JOHN SOWA]
  831.   ->(OBJ)->[ROOM:Q2]->(LOC)->[HOTEL:Shelburne]
  832.   ->(DUR)->[TIME-PERIOD:@4 NIGHTS]-
  833.              ->(STRT)->[ARRIVAL-DATE:MARCH 14 1983]
  834.              ->(UNTL)->[DEPARTURE-DATE:MARCH 18 1983]
  835. ===========================================
  836.  
  837. % untl(Marchd14c1983_Arrival_date, Marchd18c1983_Departure_date),
  838. % named(Marchd18c1983_Departure_date, ['March', 18, named([1983])]),
  839. % isa(Marchd18c1983_Departure_date, 'Departure-date'),
  840. % strt(Reservation, Marchd14c1983_Arrival_date),
  841. % named(Marchd14c1983_Arrival_date, ['March', 14, named([1983])]),
  842. % isa(Marchd14c1983_Arrival_date, 'Arrival-date'),
  843. % dur(Shelburne_Hotel, Nights_Time_period),
  844. % named(Nights_Time_period, ['Nights']),
  845. % quantz(4, Nights_Time_period),
  846. % isa(Nights_Time_period, 'Time-period'),
  847. % loc(Q2_Room, Shelburne_Hotel),
  848. % named(Shelburne_Hotel, ['Shelburne']),
  849. % isa(Shelburne_Hotel, 'Hotel'),
  850. % obj(JohnSowa_Person, Q2_Room),
  851. % named(Q2_Room, ['Q2']),
  852. % isa(Q2_Room, 'Room'),
  853. % rcpt(Reservation, JohnSowa_Person),
  854. % named(JohnSowa_Person, ['John', 'Sowa']),
  855. % isa(JohnSowa_Person, 'Person'),
  856. % Reservation='Reservation#316209',
  857. % isa(Reservation, 'Reservation'),
  858. % lbl(frame268).
  859.  
  860.  
  861.  
  862. ===========================================
  863.  
  864. [RESERVATION:#316209]-
  865.   ->(RCPT)->[PERSON:JOHN SOWA]
  866.   ->(OBJ)->[ROOM:Q2]->(LOC)->[HOTEL:Shelburne]
  867.   ->(DUR)->[TIME-PERIOD:@4 NIGHTS]-
  868.              ->(STRT)->[ARRIVAL-DATE:MARCH 14 1983]
  869.              ->(UNTL)->[DEPARTURE-DATE:MARCH 18 1983]
  870. ===========================================
  871.  
  872. % untl(Marchd14c1983_Arrival_date, Marchd18c1983_Departure_date),
  873. % named(Marchd18c1983_Departure_date, ['March', 18, named([1983])]),
  874. % isa(Marchd18c1983_Departure_date, 'Departure-date'),
  875. % strt(Reservation, Marchd14c1983_Arrival_date),
  876. % named(Marchd14c1983_Arrival_date, ['March', 14, named([1983])]),
  877. % isa(Marchd14c1983_Arrival_date, 'Arrival-date'),
  878. % dur(Shelburne_Hotel, Nights_Time_period),
  879. % named(Nights_Time_period, ['Nights']),
  880. % quantz(4, Nights_Time_period),
  881. % isa(Nights_Time_period, 'Time-period'),
  882. % loc(Q2_Room, Shelburne_Hotel),
  883. % named(Shelburne_Hotel, ['Shelburne']),
  884. % isa(Shelburne_Hotel, 'Hotel'),
  885. % obj(JohnSowa_Person, Q2_Room),
  886. % named(Q2_Room, ['Q2']),
  887. % isa(Q2_Room, 'Room'),
  888. % rcpt(Reservation, JohnSowa_Person),
  889. % named(JohnSowa_Person, ['John', 'Sowa']),
  890. % isa(JohnSowa_Person, 'Person'),
  891. % Reservation='Reservation#316209',
  892. % isa(Reservation, 'Reservation'),
  893. % lbl(frame269).
  894.  
  895.  
  896.  
  897. ===========================================
  898.  
  899. INDIVIDUAL HOTEL-RESERVATION(#316209) IS
  900. [RESERVATION:#316209]-
  901.   ->(RCPT)->[PERSON:JOHN SOWA]
  902.   ->(OBJ)->[ROOM:Q2]->(LOC)->[HOTEL:Shelburne]
  903.   ->(DUR)->[TIME-PERIOD:@4 NIGHTS]-
  904.              ->(STRT)->[ARRIVAL-DATE:MARCH 14 1983]
  905.              ->(UNTL)->[DEPARTURE-DATE:MARCH 18 1983],,.
  906. ===========================================
  907.  
  908. % untl(Marchd14c1983_Arrival_date, Marchd18c1983_Departure_date),
  909. % named(Marchd18c1983_Departure_date, ['March', 18, named([1983])]),
  910. % isa(Marchd18c1983_Departure_date, 'Departure-date'),
  911. % strt(Reservation, Marchd14c1983_Arrival_date),
  912. % named(Marchd14c1983_Arrival_date, ['March', 14, named([1983])]),
  913. % isa(Marchd14c1983_Arrival_date, 'Arrival-date'),
  914. % dur(Shelburne_Hotel, Nights_Time_period),
  915. % named(Nights_Time_period, ['Nights']),
  916. % quantz(4, Nights_Time_period),
  917. % isa(Nights_Time_period, 'Time-period'),
  918. % loc(Q2_Room, Shelburne_Hotel),
  919. % named(Shelburne_Hotel, ['Shelburne']),
  920. % isa(Shelburne_Hotel, 'Hotel'),
  921. % obj(JohnSowa_Person, Q2_Room),
  922. % named(Q2_Room, ['Q2']),
  923. % isa(Q2_Room, 'Room'),
  924. % rcpt(Reservation, JohnSowa_Person),
  925. % named(JohnSowa_Person, ['John', 'Sowa']),
  926. % isa(JohnSowa_Person, 'Person'),
  927. % Reservation='Reservation#316209',
  928. % isa(Reservation, 'Reservation'),
  929. % rel(_3296, []),
  930. % _3296#316209,
  931. % lbl(frame270).
  932.  
  933.  
  934.  
  935. ===========================================
  936.  
  937. INDIVIDUAL HOTEL-RESERVATION(#316210) IS
  938. [RESERVATION:#316210]-
  939.   ->(RCPT)->[PERSON:JOHN ESCH]
  940.   ->(OBJ)->[ROOM:Q3]->(LOC)->[HOTEL:Sidney]
  941.   ->(DUR)->[TIME-PERIOD:@7 NIGHTS]-
  942.              ->(STRT)->[ARRIVAL-DATE:MARCH 12 1983]
  943.              ->(UNTL)->[DEPARTURE-DATE:MARCH 19 1983],,.
  944. ===========================================
  945.  
  946. % untl(Marchd12c1983_Arrival_date, Marchd19c1983_Departure_date),
  947. % named(Marchd19c1983_Departure_date, ['March', 19, named([1983])]),
  948. % isa(Marchd19c1983_Departure_date, 'Departure-date'),
  949. % strt(Reservation, Marchd12c1983_Arrival_date),
  950. % named(Marchd12c1983_Arrival_date, ['March', 12, named([1983])]),
  951. % isa(Marchd12c1983_Arrival_date, 'Arrival-date'),
  952. % dur(Sidney_Hotel, Nights_Time_period),
  953. % named(Nights_Time_period, ['Nights']),
  954. % quantz(7, Nights_Time_period),
  955. % isa(Nights_Time_period, 'Time-period'),
  956. % loc(Q3_Room, Sidney_Hotel),
  957. % named(Sidney_Hotel, ['Sidney']),
  958. % isa(Sidney_Hotel, 'Hotel'),
  959. % obj(JohnEsch_Person, Q3_Room),
  960. % named(Q3_Room, ['Q3']),
  961. % isa(Q3_Room, 'Room'),
  962. % rcpt(Reservation, JohnEsch_Person),
  963. % named(JohnEsch_Person, ['John', 'Esch']),
  964. % isa(JohnEsch_Person, 'Person'),
  965. % Reservation='Reservation#316210',
  966. % isa(Reservation, 'Reservation'),
  967. % rel(_3294, []),
  968. % _3294#316210,
  969. % lbl(frame271).
  970.  
  971.  
  972.  
  973. ===========================================
  974.  
  975. INDIVIDUAL CIRCUS-ELEPHANT(#BUMBO) IS
  976. [ELEPHANT:#BUMBO]<-(AGNT)<-[PERFORM: {*}]->(LOC)->[CIRCUS:Flying Tigers].
  977. ===========================================
  978.  
  979. % loc(Set_Perform_Event, FlyingTigers_Circus),
  980. % named(FlyingTigers_Circus, ['Flying', 'Tigers']),
  981. % isa(FlyingTigers_Circus, 'Circus'),
  982. % agnt(Set_Perform_Event, Elephant),
  983. % countof(Set_Perform_Event, 1, _5668),
  984. % quantz(set, Set_Perform_Event),
  985. % isa(Set_Perform_Event, 'Perform'),
  986. % Elephant='Elephant#Bumbo',
  987. % isa(Elephant, 'Elephant'),
  988. % rel(Bumbo, []),
  989. % Bumbo#'Bumbo',
  990. % lbl(frame272).
  991. true.
  992.  
  993. cgpro:  ?- assert_cg(" [CATS_ONE_OR_MORE:{*}] ").
  994.  
  995.  
  996.  
  997. ===========================================
  998.  [CATS_ONE_OR_MORE:{*}]
  999. ===========================================
  1000.  
  1001. % countof(Set_Cats_one_or_more, 1, _604),
  1002. % quantz(set, Set_Cats_one_or_more),
  1003. % isa(Set_Cats_one_or_more, 'Cats_one_or_more'),
  1004. % lbl(frame273).
  1005. true.
  1006.  
  1007. cgpro:  ?- assert_cg(" [CATS_ONE_OR_MORE:{morris *}] ").
  1008.  
  1009.  
  1010.  
  1011. ===========================================
  1012.  [CATS_ONE_OR_MORE:{morris *}]
  1013. ===========================================
  1014.  
  1015.  
  1016. ?- rtrace(
  1017.     pred_cg(assert_cg_real,tOkS(['[','Cats_one_or_more',:,'{',morris,*,'}',']']))
  1018.    ).
  1019. true.
  1020.  
  1021. cgpro:  ?- assert_cg(" [CATS_ONE_OR_MORE:{morris,*}] ").
  1022.  
  1023.  
  1024.  
  1025. ===========================================
  1026.  [CATS_ONE_OR_MORE:{morris,*}]
  1027. ===========================================
  1028.  
  1029.  
  1030. ?- rtrace(
  1031.     pred_cg(assert_cg_real,tOkS(['[','Cats_one_or_more',:,'{',morris,',',*,'}',']']))
  1032.    ).
  1033. true.
  1034.  
  1035. cgpro:  ?- assert_cg(" [CATS_ONE_OR_MORE:{morris}] ").
  1036.  
  1037.  
  1038.  
  1039. ===========================================
  1040.  [CATS_ONE_OR_MORE:{morris}]
  1041. ===========================================
  1042.  
  1043. % each_of(Morris_Set_Cats_one_or_more, [morris]),
  1044. % quantz(set, Morris_Set_Cats_one_or_more),
  1045. % isa(Morris_Set_Cats_one_or_more, 'Cats_one_or_more'),
  1046. % lbl(frame276).
  1047. true.
  1048.  
  1049. cgpro:  ?-
  1050.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement