Subsumption

This example demonstrates some slightly complex subsumption queries.

    Welcome to PowerLoom 3.0.1.beta

Copyright (C) USC Information Sciences Institute, 1997-2003.
PowerLoom is a registered trademark of the University of Southern California.
PowerLoom comes with ABSOLUTELY NO WARRANTY!
Type `(copyright)' for detailed copyright information.
Type `(help)' for a list of available commands.
Type `(demo)' for a list of example applications.
Type `bye', `exit', `halt', `quit', or `stop', to exit.


|= (demo 9)

Now reading from `PL:sources;logic;demos;subsumption.ste'.
Type `?' at the pause prompt for a list of available commands.

;;; -*- Mode: Lisp; Package: STELLA; Syntax: COMMON-LISP; Base: 10 -*-

;;; Version: subsumption.ste,v 1.8 2001/08/22 20:01:03 hans Exp

;;; Testing Subsumption
;;; ===================

;;; Under construction.

|= (in-package "STELLA")
------ pause ------c


|= (defmodule "/PL-KERNEL/KIF-FRAME-ONTOLOGY/SUBSUMPTION")

|MDL|/PL-KERNEL-KB/KIF-FRAME-ONTOLOGY/SUBSUMPTION

|= (in-module "SUBSUMPTION")


|= (clear-module "SUBSUMPTION")


|= (reset-features)

|l|(:JUST-IN-TIME-INFERENCE :EMIT-THINKING-DOTS)

|= (in-dialect :KIF)

:KIF

|= (defconcept PERSON (?p))

|c|PERSON

|= (deffunction friends-of (?p) :-> (?f SET))

|f|FRIENDS-OF

|= (defrelation has-parent ((?x PERSON) (?y PERSON)))

|r|HAS-PARENT

|= (defrelation male ((?p PERSON)))

|r|MALE

|= (defrelation has-father ((?p PERSON) (?f PERSON))
  :<=> (and (has-parent ?p ?f) (male ?p)))

|r|HAS-FATHER

|= (ask (subset-of has-father has-parent))

TRUE

;;; Harder problems for the subsumption test:

|= (assert (forall ((?x NUMBER) (?y NUMBER)) (<= (>= ?x ?y) (> ?x ?y))))

|P|(FORALL (?x ?y)
   (<= (>= ?x ?y)
       (> ?x ?y)))

|= (defconcept Person-with-Friends (?p)
  :<=> (>= (cardinality (friends-of ?p)) 1))

|c|PERSON-WITH-FRIENDS

|= (defconcept Person-with-Atleast-2-Friends (?p)
  :<=> (>= (cardinality (friends-of ?p)) 2))

|c|PERSON-WITH-ATLEAST-2-FRIENDS

|= (defconcept Person-with-Exactly-2-Friends (?p)
  :<=> (= (cardinality (friends-of ?p)) 2))

|c|PERSON-WITH-EXACTLY-2-FRIENDS

|= (defconcept Person-with-More-Than-2-Friends (?p)
  :<=> (> (cardinality (friends-of ?p)) 2))

|c|PERSON-WITH-MORE-THAN-2-FRIENDS

|= (ask (subset-of Person-with-Exactly-2-Friends Person-with-Atleast-2-Friends))

TRUE

|= (ask (subset-of Person-with-Atleast-2-Friends Person-with-Exactly-2-Friends))

UNKNOWN

|= (ask (subset-of Person-with-More-Than-2-Friends Person-with-Atleast-2-Friends))

TRUE

|= (ask (subset-of Person-with-Atleast-2-Friends Person-with-More-Than-2-Friends))

UNKNOWN

|= (ask (subset-of Person-with-Atleast-2-Friends Person-with-Friends))

TRUE

|= 

Finished demo `PL:sources;logic;demos;subsumption.ste'.

|= 

Information Sciences Institute PowerLoom Home Page
PowerLoom is a registered trademark of the University of Southern California.
Last modified: May 27, 2006