Teaching a machine a simple taxonomy

Slides:



Advertisements
Similar presentations
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Advertisements

Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
OO Programming in Java Objectives for today: Constructors Method Overriding & Overloading Encapsulation.
Chapter 1 Inheritance University Of Ha’il.
W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002.
Classes and SubClasses Super Parent Sub Child IS - A.
Advanced Data Modeling
Inheritance & Classification Hierarchies Lecture-8.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Chapter 6 Advanced Data Modelling
Inheritance “a mechanism for propagating properties (attributes & methods) of superclasses to subclasses.”
CLOS To start off with, CLOS (pronounced “kloss” or “see- loss”) is very different from other object oriented programming languages –Multiple inheritance.
Alok Mehta - Programming in Lisp - Lecture Programming in Lisp Lecture 6 - Structure; Case Study: Blocks World.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
CSCI 143 OOP – Inheritance 1. What is Inheritance? A form of software reuse Create a new class from an existing class – Absorb existing class data and.
Using Classes Lisp also supports the Object-Oriented paradigm. The process of defining classes in Lisp is similar to how you you define structures. The.
OOP! POO! Spelled backwards. Intro to OOP What is OOP?  Stands for Object Oriented Programming  Create different types of objects which can do multiple.
Alok Mehta - Programming in Lisp - Data Abstraction and Mapping Programming in Lisp Common Lisp Object System (CLOS)
The Enhanced Entity- Relationship (EER) Model
Contains 16,777,216 Colors. My Car is red My Car is red How do I add colors to my web page? Notepad Browser Works with the “Standard” colors: Red, Green,
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1 EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling concepts.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Def D OC An extensible, dynamic document creation system By Rahul Jain
1 CLOS: Common Lisp Object System Basic principles of CLOS Classes, Instances and Slots Inheritance Generic functions Methods Multi-methods Comparison.
Object Oriented Programming Examples: C++, Java Advantages: 1. reusibility of code 2. ability to adapt (extend) previously written code.
JAVA WORKSHOP SESSION – 3 PRESENTED BY JAYA RAO MTech(CSE) NEWTON’S INSTITUTE OF ENGINEERING 1.
Inheritance CSC 171 FALL 2004 LECTURE 18. READING Read Horstmann, Chapter 11.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Review of objects  overview overview. Class of objects  Attributes/ methods.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Inheritance Objectives: Creating new classes from existing classes The protected modifier Creating class hierarchies Abstract classes Indirect visibility.
Constructors & Garbage Collection Ch. 9 – Head First Java.
Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Topics Inheritance introduction
FEN Mapping from Class Diagram (Domain Model) to Relational Model Table Design.
Software Design– Unit Testing SIMPLE PRIMER ON Junit Junit is a free simple library that is added to Eclipse to all automated unit tests. The first step,
CSCE 240 – Intro to Software Engineering Lecture 3.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Coming up Inheritance – Code duplication – Super classes – Constructors Polymorphic collections – “Anywhere a super class is, a sub class can go” Casting.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
The Enhanced Entity- Relationship (EER) Model
OBJECT ORIENTED CONCEPT
Object-Oriented Programming Basics
Allegro CL Certification Program
Software Engineering Fall 2005
Java Inheritance.
CLOS CSC 358/
Week 4 Object-Oriented Programming (1): Inheritance
INTRODUCTION TO OOP Objective:
ATS Application Programming: Java Programming
Inheritance "Question: What is the object oriented way of getting rich? Answer: Inheritance.“ “Inheritance is new code that reuses old code. Polymorphism.
FinMan Dashboards.
Relational Algebra 461 The slides for this text are organized into chapters. This lecture covers relational algebra, from Chapter 4. The relational calculus.
Object Oriented Analysis and Design
Inheritance Basics Programming with Inheritance
Domain Class Diagram Chapter 4 Part 2 pp
Java Inheritance.
MSIS 670 Object-Oriented Software Engineering
Inheritance, Polymorphism, and Interfaces. Oh My
Advanced Programming Behnam Hatami Fall 2017.
Inheritance, Superclasses, Subclasses
Computer Programming with JAVA
Chapter 5 Advanced Data Modeling
Knowledge Representation
Comp1202: Inheritance I Super and Sub-classes.
Object Oriented Analysis and Design
Object Oriented System Design Class Diagrams
Java Inheritance.
Presentation transcript:

Teaching a machine a simple taxonomy Scott Doherty

What's a Taxonomy? A taxonomy is a hierarchy of objects organized in a type / subtype tree through the ”is-a” relation.

Why is this hard? Multiple taxonomies Data modeling Overlapping classes– degenerates to graph Multiple inheritance Relations – which ones? Top down vs. Bottom up

Multiple taxonomies Linnaean taxonomy Sea, Land, Air Beasts Ad hoc taxonomies

Data Modeling How do we represent a thing? Attribute Value List <K,V> Propositionalized Attributes 0,1 Database Schema Inheritance – Java like (I get what my parents have, but I don't show you that)

Multiple Inheritance Multiple inheritance is where a class is the descendant of two classes This is a graph and not a tree

Solution: duplication Now a strict hierarchy but we don't have a unique path to every object Space requirements and pedigree tracing are hard

The Program A basic ontology Cars, baskets, balls Red things, blue things, green things Basic relations Sub type – more detail, more specific Super type – less detail, more general Instance – same attribute list

Code – classes: agent (defclass agent () ( (name :accessor agent-name :initarg :name) (base-types-of-things :accessor agent-base-types-of-things :initform () :initarg :base-types-of- things) (base-relations :accessor agent-base-relations :initform () :initarg :base-relations ) (learned-types-of-things :accessor agent-learned-types-of-things :initform () :initarg :learned- types-of-things ) (learned-relations :accessor agent-learned-relations :initform () :initarg :learned-relations ) )

Code – classes: thing (defclass type-of-thing() ( (name :accessor type-of-thing-name :initarg :name) (attributes :accessor type-of-thing-attributes :initform () :initarg :attribures ) ) (defclass thing () ( (name :accessor thing-name :initarg :name) (attributes :accessor thing-attributes :initform () :initarg :attribures)

Code - relations (defmethod is-sub-class-of-type((newtype type-of-thing)(a agent) &Aux known-types) (setf known-types (agent-base-types-of-things a)) (setf new-type-attributes (type-of-thing-attributes newtype)) (dolist (thing (agent-base-types-of-things a)) (setf newlist (getKeys (type-of-thing-attributes newtype))) (setf knownlist (getKeys (type-of-thing-attributes thing))) (setf flag (subsetp knownlist newlist :test 'equal)) ;returns t only if list1 is a subset of list2 (if (equal flag nil) (format t "not a sub-class~%") (format t "is a sub-class~%") )

Demos Break 2 [3]> (demoPredicateSuperSet) Learning agent ... name = Taxonomizer 2000 classes ... 2DSHAPE ((ANGLES . 3) (SIDES . 3) (NAME . 2DSHAPE)) relations ... IS-INSTANCE-OF-TYPE IS-SUPERCLASS-OF-TYPE IS-SUBCLASS-OF-TYPE CHECKING IF new item IS AN INSTANCE OF OBJECT known item ===========================================comparing base object to compare new object to compare ((ANGLES . 4) (SIDES . 4) (COLOR . RED) (NAME . 2DSHAPE)) base type size 3 new type size 4 set difference NIL is an instance =========================================== finished comparing NIL

Where am I? Can create objects with their attributes (data modeling) Can check if a thing is a sub-type, super-type or instance of another type of thing (relations) Have run into the multiple inheritance problem, and am working on how to organize tree structure