Typinferenz Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.

Slides:



Advertisements
Ähnliche Präsentationen
Word Order in German Subordiante Clauses
Advertisements

Programmierung 1 - Repetitorium WS 2002/2003 Programmierung 1 - Repetitorium Andreas Augustin und Marc Wagner Homepage:
Kapitel 9: Graphdurchlauf
The difference between kein and nicht.
Fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
Peter Marwedel TU Dortmund, Informatik 12
Aufgabenbesprechung Programming Contest. Order 7 Bo Pat Jean Kevin Claude William Marybeth 6 Jim Ben Zoe Joey Frederick Annabelle 0 SET 1 Bo Jean Claude.
Listen & Beweisstrategie
Rekursive Listenverarbeitung
Grammatikentwicklung
Union-Find-Strukturen
Semantik von Prolog & Unifikation
Verschachtelte Listen, Differenzlisten, Graphen
Typinferenz (mit Bitvectoren) Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf Gast: Wolfram Bernhardt.
Chart-Parsing Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.
PATR II Interpreter Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.
Vorschau Prolog Aufbaukurs SS 2003 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.
PATR II Compiler Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.
Parsing Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.
Merkmalslogik Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf.
Seite 1/21 Marcel Hoffmann 17. Mai 2001 Verteilte Kognitionen – Distributed Cognitions Systeme verteilter Kognitionen Schiffsnavigation,
Three-Valued Models of Program Completion
Modulare Programmierung
Kapitel 10: Graphalgorithmen
PageRank 1.What does the graph represent? 2.Describe PageRank. 3.What does PageRank measure in a graph? 4.Which role does PageRank play in IR?
Los! Find vocab for the following categories
Seminar Telematiksysteme für Fernwartung und Ferndiagnose Basic Concepts in Control Theory MSc. Lei Ma 22 April, 2004.
Linguistically Motivated Information Retrieval
Nominative and Accusative
Adjektive Endungen von Frau Templeton.
Laurie Clarcq The purpose of language, used in communication, is to create a picture in the mind and/or the heart of another.
Adjektivendungen Let’s start by reviewing our basic case endings for Nominativ, Akkusativ, Dativ and Genitiv…
Institut AIFB, Universität Karlsruhe (TH) Forschungsuniversität gegründet 1825 Towards Automatic Composition of Processes based on Semantic.
Montag, den Hausaufgabe für Dienstag den Keine Hausaufgabe!!! Film: 8:00 oder 9:30 Guten Tag!
Accusative and Dative Cases
Adjective Endings Frau Lizz Caplan-Carbin Deutsch für Anfänger.
Morphology and Syntax More on sentence structure.
der-words, ein-words & adjective endings
Meine Schulfächer.
bei in seit mit auf hinter von nach aus zu für vor.
Learning Target / Lernziel: 1.Hausaufgabenkontrolle (Vok 1-1) 2.Kultur 3.Forming questions Heute ist Dienstag, der 3. September 2013 Hausaufgaben GH #1,#2.
DATIVE Ich schreibe meinem Bruder einen Brief.
Guten Morgen!.
Adjectives provide additional information about nouns and pronouns.
Forming the Future Tense in German
What is it? Why use it? the Accusative What does it sound like?
Deutsch für Anfänger Beginning German
Case #1 - Nominative Case
Grammatik Deutsch I Kapitel 3 – 1. Stufe LERNZIEL:
Predicate Adjectives Stand alone in a sentence. Das Brot schmeckt gut. Attributive Adjectives Precede a Noun Ending is based on gender, case and preceding.
External Labels – The rules For all external labels the following rules apply (external labels are all labels which are not inside of a shape) - all labels.
Feste und Feiertage Treffpunkt Deutsch Sixth Edition.
Phrasen Ich wache auf. Ich bereite mich für den Tag vor.
Alltagsleben Treffpunkt Deutsch Sixth Edition
Negation is when you dont have or dont do something.
AS Thema Die Schule.
Adjectiv Endungen Lite: Adjective following articles and pre-ceeding nouns. Colors and Clothes.
Deutsch I für Anfänger SMA NEGERI MOJOAGUNG Introduction to German Verb Conjugation.
Sentence Structure Subject and verb are always together. Subject and verb are always together. Subject and verb must agree Subject and verb must agree.
DEUTSCHE VERBEN I. REGULAR VERBS.
1 Intern | ST-IN/PRM-EU | | © Robert Bosch GmbH Alle Rechte vorbehalten, auch bzgl. jeder Verfügung, Verwertung, Reproduktion, Bearbeitung,
Noch most directly has the meaning of still. As such, it has basically for types of usage. The temporal usage of the word. (as it relates to time) can.
You need to use your mouse to see this presentation
Data Mining Spectral Clustering Junli Zhu SS 2005.
Adjective Declension in German
Using Relative Clauses
German Key Sounds Deutsche Schlüssellaute
Alltagsleben Treffpunkt Deutsch Sixth Edition
Kapitel 2 Grammar INDEX 1.Subjects & Verbs 2.Conjugation of Verbs 3.Subject Verb Agreement 4.Person and Number 5.Present Tense 6.Word Order: Position of.
Der, die das pronouns Deutsch I kapitel 3-2.
 Präsentation transkript:

Typinferenz Prolog Aufbaukurs SS 2000 Heinrich-Heine-Universität Düsseldorf Christof Rumpf

Typinferenz2 Hintergrund Getypte Merkmalsstrukturen sind von Bedeutung insbesondere für die HPSG. Implementierte Systeme zur Verarbeitung getypter Merkmalsstrukturen sind u.a. ALE, CUF, LKB, TFS, TROLL,... Die nachfolgenden Definitionen liegen dem Düsseldorfer System QType zugrunde, das sich seit 1997 in Entwicklung befindet.

Typinferenz3 Getypte Merkmalsstrukturen Sind Mengen von Attribut-Wert-Paaren. Jede Merkmalsstruktur hat einen Typ. Jeder Wert eines Attributs ist eine getypte Merkmalsstruktur. Die Typen sind in einer Vererbungshierarchie (Summenhalbverband) angeordnet, innerhalb der Attribut- Wert-Paare top-down vererbt werden. Die Vererbungshierarchie wird durch eine Typensignatur etabliert, in der Klassen von Merkmalsstrukturen definiert werden.

Typinferenz4 Typensignatur - Syntax 2 Mengen: Types, Features 2 Relationen: –unmittelbarer Subtyp >> –Appropriateness :: Typdefinition Supertyp >> Subtyp 1,..., Subtyp n :: Feature 1 :Typ 1,...,Feature m :Typ m.

Typinferenz5 Typensignatur zu Shieber 1 top >> category, featval. category >> verbal, np :: HEAD:head. featval >> head, agr, gen, pers, num, vform. head >> vhead, nhead. verbal >> v, vp, s :: HEAD:vhead. np :: HEAD:nhead. nhead :: AGREEMENT:agr. agr :: GENDER:gen, PERSON:pers, NUMBER:num. gen >> masc, fem, neut. pers >> first, second, third. num >> sing, plur. vhead :: FORM:vform, SUBJECT:np. vform >> finite, base. Kilbury 1997, QType-Syntax

Typinferenz6 Typhierarchie category verbal np v vp s head vhead nhead gen masc fem neut pers first second third num sing plur vform finite base featval top agr

Typinferenz7 FS zu Typ s in Shieber 1

Typinferenz8 Typensignatur: Prolog-Syntax % Type >> Subtypes :: FeatureValuePairs % Type = Atom % Subtypes = [Type1,...,TypeN] % FeatureValuePairs = [F1:V1,...,Fm:Vm] % Fi = Atom % Vi = Type :- op(800, xfx, '>>'). :- op(700, xfx, '::').

Typinferenz9 Shieber 1 in Prolog-Syntax top >> [category, featval] :: []. category >> [verbal, np] :: ['HEAD':head]. featval >> [head, agr, gen, pers, num, vform] :: []. head >> [vhead, nhead] :: []. verbal >> [v, vp, s] :: ['HEAD':vhead]. np >> [] :: ['HEAD':nhead]. nhead >> [] :: ['AGREEMENT':agr]. agr >> [] :: ['GENDER':gen, 'PERSON':pers, 'NUMBER':num]. gen >> [masc, fem, neut] :: []. pers >> [first, second, third] :: []. num >> [sing, plur] :: []. vhead >> [] :: ['FORM':vform, 'SUBJECT':np]. vform >> [finite, base] :: []. base >> [] :: []. v >> [] :: []. masc >> [] :: []. first >> [] :: []. vp >> [] :: []. fem >> [] :: []. second >> [] :: []. s >> [] :: []. neut >> [] :: []. third >> [] :: []. sing >> [] :: []. plur >> [] :: []. finite >> [] :: [].

Typinferenz10 Typensignatur-Interpreter type(?Type) immediate_subtype(?ImmediateSubType,?Type) subtype(?SubType,?Type) immediate_supertype(?SuperType,?Type) supertype(?SuperType,?Type) lb(?Type1,?Type2,?Type3)lower bound glb(?Type1,?Type2,?Type3)greatest lower bound ub(?Type1,?Type2,?Type3)upper bound lub(?Type1,?Type2,?Type3)least upper bound complement(?Type,-Complement)

Typinferenz11 Typen % type(?Type). % Type is defined as a type. type(T):- call(T >> _).

Typinferenz12 Unmittelbare Subtypen % immediate_subtype(?ImmediateSubType,?Type) % ImmediateSubType is defined as an immediate % subtype of Type. immediate_subtype(ST,T):- call(T >> STs :: _), member(ST,STs).

Typinferenz13 Subtypen % subtype(?SubType,?Type) % SubType is a subtype of Type. % Reflexive transitive closure of the % immediate_subtype/2 relation. subtype(T,T):- type(T). subtype(ST,T):- immediate_subtype(IST,T), subtype(ST,IST).

Typinferenz14 Echte Subtypen % true_subtype(?SubType,?Type) % SubType is a true subtype of Type. true_subtype(T1,T2):- subtype(T1,T2), T1 \= T2.

Typinferenz15 Minimale (Sub-)Typen minimal_subtype(MiniType,Type):- subtype(MiniType,Type), minimal(MiniType). minimal(T):- T >> [] :: _.

Typinferenz16 Extension eines Typs % extension(?Type,-Extension) % Extension is the set of minimal subtypes of Type. extension(Type,Extension):- type(Type), setof1(MiniType, minimal_subtype(MiniType,Type), Extension).

Typinferenz17 Alle Lösungen: setof/3 % setof(?Template,+Goal,?Set) Eingebautes Prädikat. % Set ist die Menge aller Instanzen von Template, % so dass Goal bewiesen werden kann. Falls Set % leer ist, scheitert setof/3. % setof1(?Template,+Goal,?Set) setof1(Template,Goal,Set):- setof(Template,Goal,Set), !. setof1(_,_,[]).

Typinferenz18 Setof-Beispiel likes(bill, cider). likes(dick, beer). likes(harry, beer). likes(jan, cider). likes(tom, beer). likes(tom, cider). ?- setof(X, likes(X,Y), S). S = [dick,harry,tom], Y = beer -> ; S = [bill,jan,tom], Y = cider -> ; no ?- setof((Y,S), setof(X, likes(X,Y), S), SS). SS = [(beer,[dick,harry,tom]),(cider,[bill,jan,tom])] yes ?- setof(X, Y^(likes(X,Y)), S). % Y existenzquantifiziert S = [bill,dick,harry,jan,tom]

Typinferenz19 Typen-Unifikation Die Unifikation zweier Typen t 1 und t 2 liefert entweder Typ t 3, falls t 3 der allgemeinste Typ ist, sodaß –t 3 Subtyp von t 1 ist und –t 3 Subtyp von t 2 ist oder ist undefiniert, falls es einen solchen Typ t 3 nicht gibt.

Typinferenz20 Untere Schranken % lb(?Type1,?Type2,?Type3) % Type3 is a lower bound for Type1 and % Type2, if it is a subtype of both. lb(T1,T2,T3):- subtype(T3,T1), subtype(T3,T2).

Typinferenz21 Grösste untere Schranken % glb(?Type1,?Type2,?Type3) % Type3 is the greatest lower bound of Type1 and Type2. glb(T1,T2,T3):- % T3 is GLB of T1 and T2 if lb(T1,T2,T3), % T3 is a LB of T1 and T2 and setof1(T4, % the set S of types T4 ( % which are true_subtype(T3,T4), % true supertypes of T3 and lb(T1,T2,T4) % lower bounds of T1 and T2 ), S), S=[]. % is the empty set.

Typinferenz22 GLB über Extension extension/2 liegt als berechnete Faktenmenge vor. Das zweite Argument von extension/2 ist alphabetisch sortiert. Jeder Typ hat entweder keinen oder mindestens zwei unmittelbare Subtypen. % glb(?T1,?T2,?T3) glb(T1,T2,T3):- extension(T1,E1), extension(T2,E2), intersection(E1,E2,E4), sort(E4,E3), extension(T3,E3). Nebenstehende Definition hat folgende Voraussetzungen:

Typinferenz23 Typen-Generalisierung Die Generalisierung zweier Typen t 1 und t 2 liefert entweder Typ t 3, falls t 3 der spezifischste Typ ist, sodaß –t 3 Supertyp von t 1 ist und –t 3 Supertyp von t 2 ist oder ist undefiniert, falls es einen solchen Typ t 3 nicht gibt.

Typinferenz24 Supertypen % supertype(?SuperType,?Type) % SuperType is a supertype of Type. supertype(ST,T):-subtype(T,ST). % immediate_supertype(?SuperType,?Type) % SuperType is an immediate supertype of Type. immediate_supertype(ST,T):- immediate_subtype(T,ST).

Typinferenz25 Obere Schranken % ub(?Type1,?Type2,?Type3) % Type3 is an upper bound for Type1 and % Type2 if it is a supertype of both. ub(T1,T2,T3):- subtype(T1,T3), subtype(T2,T3).

Typinferenz26 Kleinste obere Schranken % lub(?Type1,?Type2,?Type3) % Type3 is the least upper bound of Type1 and Type2. lub(T1,T2,T3):-% T3 is the LUB of T1 and T2 if ub(T1,T2,T3),% T3 is an UB for T1 and T2 and setof1(T4,% the set S of types T4 (% which are true_subtype(T4,T3), % true subtypes of T3 and ub(T1,T2,T4)% upper bounds for T1 and T2 ), S), S=[].% is the empty set.

Typinferenz27 LUB über Extension extension/2 liegt als berechnete Faktenmenge vor. Das zweite Argument von extension/2 ist alphabetisch sortiert. Jeder Typ hat entweder keinen oder mindestens zwei unmittelbare Subtypen. % lub(?T1,?T2,?T3) lub(T1,T2,T3):- extension(T1,E1), extension(T2,E2), union(E1,E2,E4), sort(E4,E3), extension(T3,E3). Nebenstehende Definition hat folgende Voraussetzungen:

Typinferenz28 LUB-Filter für Typenmenge % lubs(+ListOfTypes1, ?ListOfTypes2) % ListOfTypes2 includes the disjunct least upper bounds for % the types in ListOfTypes1. In other words: every type in % ListOfTypes1 that is a subtype of some other type in % ListOfTypes1 is deleted. lubs(Types,Lubs):- delete(Type1,Types,Types1), member(Type2,Types1), subtype(Type1,Type2), !, lubs(Types1,Lubs). lubs(L,L):- !. naives Verfahren, delete/3 vermeiden!

Typinferenz29 Komplement % complement(?Type,-Complement) % The Complement of Type relative to all other Types. complement(Type,Complement):- type(Type), complement(Type,top,Complement). % complement(?Type,+ContextType,-Complement) % The Complement of Type relative to ContextType. % ContextType is the LUB for the complement types. complement(Type,CT,Complement):- setof1(ST,subtype(ST,CT),Types), complement_in_context(Type,Types,Complement0), lubs(Complement0,Complement), Complement \= [], !.

Typinferenz30 Komplement im Kontext % complement_in_context(?Type,+Context,-Complement) % The Complement of Type relative to Context. Context is a % list of candidate types for the complement. Every type in % Context that has no lower bound with Type is in Complement. complement_in_context(_,[],[]):- !. complement_in_context(Type,[T|Ts],Complement):- lb(Type,T,_), !, complement_in_context(Type,Ts,Complement). complement_in_context(Type,[T|Ts],[T|Complement]):- complement_in_context(Type,Ts,Complement).

Typinferenz31 Komplement: Beispiel ?- complement(first, top, C). C = [agr,category,gen,head,num,second,third,vform] yes ?- complement(first, pers, C). C = [second,third] yes mit der Shieber 1-Signatur als Basis

Typinferenz32 Literatur Carpenter, Bob (1993): The Logic of Typed Feature Structures. CUP. OKeefe, Richard A. (1990): The Craft of Prolog. MIT Press. Shieber, Stuart (1986): An Introduction to Unification-based Approaches to Grammar. CSLI Lecture Notes.