|
Generated by diff2html © Yves Bailly, MandrakeSoft S.A. 2001 diff2html is licensed under the GNU GPL. |
| support-v1/additional-stuff.lisp | support-v2.1/additional-stuff.lisp | ||||
|---|---|---|---|---|---|
|
47 lines 1756 bytes Last modified : Wed Jun 29 13:31:16 2005 |
47 lines 1756 bytes Last modified : Wed Jun 29 13:32:13 2005 |
||||
| 1 | ;;; -*- Mode: LISP; Syntax: Common-lisp; Base: 10; Package: OCML; -*- | 1 | ;;; -*- Mode: LISP; Syntax: Common-lisp; Base: 10; Package: OCML; -*- | ||
| 2 | 2 | ||||
| 3 | (in-package "OCML") | 3 | (in-package "OCML") | ||
| 4 | 4 | ||||
| 5 | (in-ontology akt-support-ontology) | 5 | (in-ontology akt-support-ontology) | ||
| 6 | 6 | ||||
| 7 | (def-relation SUBCLASS-OF (?sub ?c) | 7 | (def-relation SUBCLASS-OF (?sub ?c) | ||
| 8 | "?sub is a subclass of ?c if every instance of ?sub is also an instance of | 8 | "?sub is a subclass of ?c if every instance of ?sub is also an instance of | ||
| 9 | ?c. Note that according to this definition every class is a subclass of itself" | 9 | ?c. Note that according to this definition every class is a subclass of itself" | ||
| 10 | 10 | ||||
| 11 | :constraint (and (class ?sub)(class ?c)) | 11 | :constraint (and (class ?sub)(class ?c)) | ||
| 12 | 12 | ||||
| 13 | :prove-by (or (and (variable-bound ?sub) | 13 | :prove-by (or (and (variable-bound ?sub) | ||
| 14 | (member ?c (all-superclasses ?sub))) | 14 | (member ?c (all-superclasses ?sub))) | ||
| 15 | (and (variable-bound ?c) | 15 | (and (variable-bound ?c) | ||
| 16 | (member ?sub (all-subclasses ?c))) | 16 | (member ?sub (all-subclasses ?c))) | ||
| 17 | (and | 17 | (and | ||
| 18 | (not (variable-bound ?c)) | 18 | (not (variable-bound ?c)) | ||
| 19 | (not (variable-bound ?sub)) | 19 | (not (variable-bound ?sub)) | ||
| 20 | (class ?sub1)(class ?super1) | 20 | (class ?sub1)(class ?super1) | ||
| 21 | (subclass-of ?sub1 ?super1))) | 21 | (subclass-of ?sub1 ?super1))) | ||
| 22 | 22 | ||||
| 23 | :iff-def (and (class ?sub) (class ?c) | 23 | :iff-def (and (class ?sub) (class ?c) | ||
| 24 | (forall ?inst | 24 | (forall ?inst | ||
| 25 | (=> (instance-of ?inst ?sub) | 25 | (=> (instance-of ?inst ?sub) | ||
| 26 | (instance-of ?inst ?c)))) | 26 | (instance-of ?inst ?c)))) | ||
| 27 | :no-proofs-by (:iff-def)) | 27 | :no-proofs-by (:iff-def)) | ||
| 28 | 28 | ||||
| 29 | (def-function ALL-SUPERCLASSES (?class) -> ?supers | 29 | (def-function ALL-SUPERCLASSES (?class) -> ?supers | ||
| 30 | :constraint (class ?class) | 30 | :constraint (class ?class) | ||
| 31 | :def (forall ?super (<=> (member ?super ?supers) | 31 | :def (forall ?super (<=> (member ?super ?supers) | ||
| 32 | (subclass-of ?class ?super))) | 32 | (subclass-of ?class ?super))) | ||
| 33 | :lisp-fun #'(lambda (class) | 33 | :lisp-fun #'(lambda (class) | ||
| 34 | (let ((class-s (get-ocml-class class))) | 34 | (let ((class-s (get-ocml-class class))) | ||
| 35 | (if class-s | 35 | (if class-s | ||
| 36 | (mapcar #'name (domain-superclasses class-s)))))) | 36 | (mapcar #'name (domain-superclasses class-s)))))) | ||
| 37 | 37 | ||||
| 38 | (def-function ALL-SUBCLASSES (?class) -> ?subs | 38 | (def-function ALL-SUBCLASSES (?class) -> ?subs | ||
| 39 | :constraint (class ?class) | 39 | :constraint (class ?class) | ||
| 40 | :def (forall ?sub (<=> (member ?sub ?subs) | 40 | :def (forall ?sub (<=> (member ?sub ?subs) | ||
| 41 | (subclass-of ?sub ?class))) | 41 | (subclass-of ?sub ?class))) | ||
| 42 | :lisp-fun #'(lambda (class) | 42 | :lisp-fun #'(lambda (class) | ||
| 43 | (let ((class-s (get-ocml-class class))) | 43 | (let ((class-s (get-ocml-class class))) | ||
| 44 | (if class-s | 44 | (if class-s | ||
| 45 | (mapcar #'name (current-subclasses class-s)))))) | 45 | (mapcar #'name (current-subclasses class-s)))))) | ||
| 46 | 46 | ||||
| 47 | 47 |