Advertisement
logicmoo

TC or not?

Aug 2nd, 2017
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 1.83 KB | None | 0 0
  1. Given:
  2.  
  3. fact1-  i:myCar rdf:type c:HondaCivic .
  4. fact2-  c:HondaCivic rdfs:subClassOf c:PassengerVehicle .
  5. fact3-  c:PassengerVehicle rdfs:subClassOf c:ThingThatCanBeInsured .
  6.  
  7. From fact1 + fact2 + fact3  may i conclude?
  8.  
  9. result1-   i:myCar rdf:type  c:PassengerVehicle .
  10. result2-   i:myCar rdf:type  c:ThingThatCanBeInsured .
  11.  
  12. No, because FOL doesnt give me this transitive closure .
  13.  
  14. So, Lets make it by adding a rule:
  15.  
  16. rule1 - { ?c rdfs:subClassOf ?sc.  ?i rdf:type ?c . } ->  { ?i rdf:type ?sc }
  17.  
  18.  
  19.  
  20. ASK> i:myCar rdf:type ?WHAT
  21.  
  22.  
  23. result1> ?WHAT = c:PassengerVehicle
  24.    proof>
  25.       rule1-             { ?c rdfs:subClassOf ?sc.  ?i rdf:type ?c . } ->  { ?i rdf:type ?sc }
  26.       fact1-              i:myCar rdf:type c:HondaCivic .
  27.       fact2-              c:HondaCivic rdfs:subClassOf c:PassengerVehicle .
  28.       rule1+fact2+fact1   c:HondaCivic rdfs:subClassOf c:PassengerVehicle .  i:myCar rdf:type c:HondaCivic .
  29.       ded1-            -> i:myCar rdf:type c:PassengerVehicle
  30.  
  31. result2> ?WHAT = c:ThingThatCanBeInsured
  32.    proof>
  33.       rule1-               { ?c rdfs:subClassOf ?sc.  ?i rdf:type ?c . } ->  { ?i rdf:type ?sc }
  34.       fact1-               i:myCar rdf:type c:HondaCivic .
  35.       fact2-               c:HondaCivic rdfs:subClassOf c:PassengerVehicle .
  36.       rule1+fact2+fact1:   c:HondaCivic rdfs:subClassOf c:PassengerVehicle . i:myCar rdf:type c:HondaCivic .
  37.       ded1-              -> i:myCar rdf:type c:PassengerVehicle .
  38.       fact3-               c:PassengerVehicle rdfs:subClassOf c:ThingThatCanBeInsured .
  39.       rule1+ded1+fact3     c:PassengerVehicle rdfs:subClassOf c:ThingThatCanBeInsured .  i:myCar rdf:type c:PassengerVehicle .
  40.       ded2-              -> i:myCar rdf:type c:ThingThatCanBeInsured
  41.  
  42.  
  43. Oh, still no TC? Perhaps not.  Since TC would have meant that the proofs would have been the same lengths?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement