SlideShare a Scribd company logo
1 of 41
Lecture 7: Definite Clause Grammars ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Context free grammars ,[object Object],[object Object],[object Object],[object Object]
Example of a CFG ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ingredients of a grammar  ,[object Object],[object Object],[object Object],s    np vp np    det n vp    v np vp    v det     the det     a n     man n     woman v     shoots
A little bit of linguistics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
More linguistics ,[object Object],[object Object]
Context free rules ,[object Object],[object Object],[object Object],[object Object],[object Object],s    np vp np    det n vp    v np vp    v det     the det     a n     man n     woman v     shoots
Grammar coverage ,[object Object],[object Object],[object Object]
Syntactic structure ,[object Object],[object Object],[object Object],[object Object],[object Object],s    np vp np    det n vp    v np vp    v det     the det     a n     man n     woman v     shoots
Parse trees ,[object Object],[object Object],[object Object],[object Object]
Grammatical strings ,[object Object],[object Object],[object Object],[object Object]
Generated language ,[object Object],[object Object],[object Object],[object Object]
Recogniser ,[object Object],[object Object]
Information about structure ,[object Object],[object Object],[object Object]
Parser  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Context free language ,[object Object],[object Object],[object Object],[object Object],[object Object]
Theory vs. Practice ,[object Object],[object Object],[object Object],[object Object],[object Object]
CFG recognition in Prolog ,[object Object],[object Object],[object Object],[object Object]
CFG recognition using append/3 s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]).  det([a]).  n([man]).  n([woman]).  v([shoots]).
CFG recognition using append/3 ?- s ([the,woman,shoots,a,man]). yes ?- s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]).  det([a]).  n([man]).  n([woman]).  v([shoots]).
CFG recognition using append/3 ?- s (S). S = [the,man,shoots,the,man]; S = [the,man,shoots,the,woman]; S = [the,woman,shoots,a,man] … s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]).  det([a]).  n([man]).  n([woman]).  v([shoots]).
CFG recognition using append/3 ?- np ([the,woman]). yes ?-  np (X). X = [the,man]; X = [the,woman] s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]).  det([a]).  n([man]).  n([woman]).  v([shoots]).
Problems with this recogniser ,[object Object],[object Object],[object Object]
Difference lists ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CFG recognition using difference lists s (A-C):- np(A-B), vp(B-C). np (A-C):- det(A-B), n(B-C).  vp (A-C):- v(A-B), np(B-C).  vp (A-C):- v(A-C). det([the|W]-W).  det([a|W]-W).  n([man|W]-W).  n([woman|W]-W).  v([shoots|W]-W).
CFG recognition using difference lists ?- s ([the,man,shoots,a,man]-[ ]). yes ?- s (A-C):- np(A-B), vp(B-C). np (A-C):- det(A-B), n(B-C).  vp (A-C):- v(A-B), np(B-C).  vp (A-C):- v(A-C). det([the|W]-W).  det([a|W]-W).  n([man|W]-W).  n([woman|W]-W).  v([shoots|W]-W).
CFG recognition using difference lists ?-  s (X-[ ]). S = [the,man,shoots,the,man]; S = [the,man,shoots,a,man]; … . s (A-C):- np(A-B), vp(B-C). np (A-C):- det(A-B), n(B-C).  vp (A-C):- v(A-B), np(B-C).  vp (A-C):- v(A-C). det([the|W]-W).  det([a|W]-W).  n([man|W]-W).  n([woman|W]-W).  v([shoots|W]-W).
Summary so far ,[object Object],[object Object],[object Object],[object Object]
Definite Clause Grammars ,[object Object],[object Object],[object Object]
DCGs: first example s  --> np, vp. np  --> det, n. vp  --> v, np. vp  --> v. det  --> [the].  det  --> [a]. n   --> [man].  n   --> [woman].  v   --> [shoots].
DCGs: first example ?- s ([a,man,shoots,a,woman],[ ]). yes ?- s  --> np, vp. np  --> det, n. vp  --> v, np. vp  --> v. det  --> [the].  det  --> [a]. n   --> [man].  n   --> [woman].  v   --> [shoots].
DCGs: first example ?-  s (X,[ ]). S = [the,man,shoots,the,man]; S = [the,man,shoots,a,man]; … . s  --> np, vp. np  --> det, n. vp  --> v, np. vp  --> v. det  --> [the].  det  --> [a]. n   --> [man].  n   --> [woman].  v   --> [shoots].
DCGs: second example ,[object Object],[object Object],[object Object],s --> s, conj, s.  s  --> np, vp. np  --> det, n.  vp  --> v, np.  vp  --> v. det  --> [the].  det  --> [a]. n   --> [man].  n   --> [woman].  v   --> [shoots]. conj --> [and].  conj --> [or].  conj --> [but].
DCG without left-recursive rules s --> simple _ s, conj, s.  s --> simple _ s. simple _ s  --> np, vp. np  --> det, n.  vp  --> v, np.  vp  --> v. det  --> [the].  det  --> [a]. n   --> [man].  n   --> [woman].  v   --> [shoots]. conj --> [and].  conj --> [or].  conj --> [but].
DCGs are not magic! ,[object Object],[object Object],[object Object]
DCGs: third example ,[object Object],[object Object],[object Object],[object Object],[object Object]
DCGs: third example s  --> []. s  --> l,s,r. l  --> [a]. r  --> [b]. ?-  s ([a,a,a,b,b,b],[ ]). yes ?-  s ([a,a,a,a,b,b,b],[ ]). no ,[object Object]
DCGs: third example s  --> []. s  --> l,s,r. l  --> [a]. r  --> [b]. ?- s(X,[ ]). X = [ ]; X = [a,b]; X = [a,a,b,b]; X = [a,a,a,b,b,b] … . ,[object Object]
Exercises ,[object Object],[object Object],[object Object]
Summary of this lecture  ,[object Object],[object Object],[object Object],[object Object]
Next lecture ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Final formal languages
Final formal languagesFinal formal languages
Final formal languagesMegha Khanna
 
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...Guy De Pauw
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingHemantha Kulathilake
 
Formal language
Formal languageFormal language
Formal languageRajendran
 
Class7
 Class7 Class7
Class7issbp
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of AutomataFarooq Mian
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 
Ldml - public
Ldml - publicLdml - public
Ldml - publicseanscon
 
Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of LanguageDipankar Boruah
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! EdholeEdhole.com
 
Ldml presentation
Ldml presentationLdml presentation
Ldml presentationSean Con
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryTsegazeab Asgedom
 

What's hot (18)

Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Final formal languages
Final formal languagesFinal formal languages
Final formal languages
 
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
Setswana Tokenisation and Computational Verb Morphology: Facing the Challenge...
 
Unit i
Unit iUnit i
Unit i
 
Unit ii
Unit iiUnit ii
Unit ii
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological Parsing
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Formal language
Formal languageFormal language
Formal language
 
Class7
 Class7 Class7
Class7
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Unit v
Unit vUnit v
Unit v
 
Ldml - public
Ldml - publicLdml - public
Ldml - public
 
Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of Language
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 
Ldml presentation
Ldml presentationLdml presentation
Ldml presentation
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
 
Logic
LogicLogic
Logic
 

Similar to Lecture 7: Definite Clause Grammars

PROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG CONTENT
 
PROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologDataminingTools Inc
 
natural language processing
natural language processing natural language processing
natural language processing sunanthakrishnan
 
ToC_M1L3_Grammar and Derivation.pdf
ToC_M1L3_Grammar and Derivation.pdfToC_M1L3_Grammar and Derivation.pdf
ToC_M1L3_Grammar and Derivation.pdfjaishreemane73
 
Natural Language processing Parts of speech tagging, its classes, and how to ...
Natural Language processing Parts of speech tagging, its classes, and how to ...Natural Language processing Parts of speech tagging, its classes, and how to ...
Natural Language processing Parts of speech tagging, its classes, and how to ...Rajnish Raj
 
Natural Language parsing.pptx
Natural Language parsing.pptxNatural Language parsing.pptx
Natural Language parsing.pptxsiddhantroy13
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithmsRaghu nath
 
Segmenting dna sequence into words
Segmenting dna sequence into wordsSegmenting dna sequence into words
Segmenting dna sequence into wordsLiang Wang
 
sentence patterns
sentence patternssentence patterns
sentence patternsJack Tony
 
Computational model language and grammar bnf
Computational model language and grammar bnfComputational model language and grammar bnf
Computational model language and grammar bnfTaha Shakeel
 
ACL読み会2014@PFI "Less Grammar, More Features"
ACL読み会2014@PFI "Less Grammar, More Features"ACL読み会2014@PFI "Less Grammar, More Features"
ACL読み会2014@PFI "Less Grammar, More Features"nozyh
 
crypto_graphy_PPTs.pdf
crypto_graphy_PPTs.pdfcrypto_graphy_PPTs.pdf
crypto_graphy_PPTs.pdfMajidMumtaz3
 
Definite Clause Grammars For Language Analysis
Definite Clause Grammars For Language AnalysisDefinite Clause Grammars For Language Analysis
Definite Clause Grammars For Language AnalysisRePierre
 
INFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.pptINFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.pptLamhotNaibaho3
 
Natural Language Processing made easy
Natural Language Processing made easyNatural Language Processing made easy
Natural Language Processing made easyGopi Krishnan Nambiar
 

Similar to Lecture 7: Definite Clause Grammars (20)

PROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In Prolog
 
PROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In Prolog
 
natural language processing
natural language processing natural language processing
natural language processing
 
ToC_M1L3_Grammar and Derivation.pdf
ToC_M1L3_Grammar and Derivation.pdfToC_M1L3_Grammar and Derivation.pdf
ToC_M1L3_Grammar and Derivation.pdf
 
Inteligencia artificial
Inteligencia artificialInteligencia artificial
Inteligencia artificial
 
Natural Language processing Parts of speech tagging, its classes, and how to ...
Natural Language processing Parts of speech tagging, its classes, and how to ...Natural Language processing Parts of speech tagging, its classes, and how to ...
Natural Language processing Parts of speech tagging, its classes, and how to ...
 
NLP-my-lecture (3).ppt
NLP-my-lecture (3).pptNLP-my-lecture (3).ppt
NLP-my-lecture (3).ppt
 
Natural Language parsing.pptx
Natural Language parsing.pptxNatural Language parsing.pptx
Natural Language parsing.pptx
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
 
Grammar Syntax(1).pptx
Grammar Syntax(1).pptxGrammar Syntax(1).pptx
Grammar Syntax(1).pptx
 
Segmenting dna sequence into words
Segmenting dna sequence into wordsSegmenting dna sequence into words
Segmenting dna sequence into words
 
sentence patterns
sentence patternssentence patterns
sentence patterns
 
NLP
NLPNLP
NLP
 
NLP
NLPNLP
NLP
 
Computational model language and grammar bnf
Computational model language and grammar bnfComputational model language and grammar bnf
Computational model language and grammar bnf
 
ACL読み会2014@PFI "Less Grammar, More Features"
ACL読み会2014@PFI "Less Grammar, More Features"ACL読み会2014@PFI "Less Grammar, More Features"
ACL読み会2014@PFI "Less Grammar, More Features"
 
crypto_graphy_PPTs.pdf
crypto_graphy_PPTs.pdfcrypto_graphy_PPTs.pdf
crypto_graphy_PPTs.pdf
 
Definite Clause Grammars For Language Analysis
Definite Clause Grammars For Language AnalysisDefinite Clause Grammars For Language Analysis
Definite Clause Grammars For Language Analysis
 
INFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.pptINFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.ppt
 
Natural Language Processing made easy
Natural Language Processing made easyNatural Language Processing made easy
Natural Language Processing made easy
 

More from CS, NcState

Talks2015 novdec
Talks2015 novdecTalks2015 novdec
Talks2015 novdecCS, NcState
 
GALE: Geometric active learning for Search-Based Software Engineering
GALE: Geometric active learning for Search-Based Software EngineeringGALE: Geometric active learning for Search-Based Software Engineering
GALE: Geometric active learning for Search-Based Software EngineeringCS, NcState
 
Big Data: the weakest link
Big Data: the weakest linkBig Data: the weakest link
Big Data: the weakest linkCS, NcState
 
Three Laws of Trusted Data Sharing: (Building a Better Business Case for Dat...
Three Laws of Trusted Data Sharing:(Building a Better Business Case for Dat...Three Laws of Trusted Data Sharing:(Building a Better Business Case for Dat...
Three Laws of Trusted Data Sharing: (Building a Better Business Case for Dat...CS, NcState
 
Lexisnexis june9
Lexisnexis june9Lexisnexis june9
Lexisnexis june9CS, NcState
 
Welcome to ICSE NIER’15 (new ideas and emerging results).
Welcome to ICSE NIER’15 (new ideas and emerging results).Welcome to ICSE NIER’15 (new ideas and emerging results).
Welcome to ICSE NIER’15 (new ideas and emerging results).CS, NcState
 
Icse15 Tech-briefing Data Science
Icse15 Tech-briefing Data ScienceIcse15 Tech-briefing Data Science
Icse15 Tech-briefing Data ScienceCS, NcState
 
Kits to Find the Bits that Fits
Kits to Find  the Bits that Fits Kits to Find  the Bits that Fits
Kits to Find the Bits that Fits CS, NcState
 
Ai4se lab template
Ai4se lab templateAi4se lab template
Ai4se lab templateCS, NcState
 
Automated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSUAutomated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSUCS, NcState
 
Requirements Engineering
Requirements EngineeringRequirements Engineering
Requirements EngineeringCS, NcState
 
172529main ken and_tim_software_assurance_research_at_west_virginia
172529main ken and_tim_software_assurance_research_at_west_virginia172529main ken and_tim_software_assurance_research_at_west_virginia
172529main ken and_tim_software_assurance_research_at_west_virginiaCS, NcState
 
Automated Software Engineering
Automated Software EngineeringAutomated Software Engineering
Automated Software EngineeringCS, NcState
 
Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)CS, NcState
 
Tim Menzies, directions in Data Science
Tim Menzies, directions in Data ScienceTim Menzies, directions in Data Science
Tim Menzies, directions in Data ScienceCS, NcState
 
Dagstuhl14 intro-v1
Dagstuhl14 intro-v1Dagstuhl14 intro-v1
Dagstuhl14 intro-v1CS, NcState
 
The Art and Science of Analyzing Software Data
The Art and Science of Analyzing Software DataThe Art and Science of Analyzing Software Data
The Art and Science of Analyzing Software DataCS, NcState
 

More from CS, NcState (20)

Talks2015 novdec
Talks2015 novdecTalks2015 novdec
Talks2015 novdec
 
Future se oct15
Future se oct15Future se oct15
Future se oct15
 
GALE: Geometric active learning for Search-Based Software Engineering
GALE: Geometric active learning for Search-Based Software EngineeringGALE: Geometric active learning for Search-Based Software Engineering
GALE: Geometric active learning for Search-Based Software Engineering
 
Big Data: the weakest link
Big Data: the weakest linkBig Data: the weakest link
Big Data: the weakest link
 
Three Laws of Trusted Data Sharing: (Building a Better Business Case for Dat...
Three Laws of Trusted Data Sharing:(Building a Better Business Case for Dat...Three Laws of Trusted Data Sharing:(Building a Better Business Case for Dat...
Three Laws of Trusted Data Sharing: (Building a Better Business Case for Dat...
 
Lexisnexis june9
Lexisnexis june9Lexisnexis june9
Lexisnexis june9
 
Welcome to ICSE NIER’15 (new ideas and emerging results).
Welcome to ICSE NIER’15 (new ideas and emerging results).Welcome to ICSE NIER’15 (new ideas and emerging results).
Welcome to ICSE NIER’15 (new ideas and emerging results).
 
Icse15 Tech-briefing Data Science
Icse15 Tech-briefing Data ScienceIcse15 Tech-briefing Data Science
Icse15 Tech-briefing Data Science
 
Kits to Find the Bits that Fits
Kits to Find  the Bits that Fits Kits to Find  the Bits that Fits
Kits to Find the Bits that Fits
 
Ai4se lab template
Ai4se lab templateAi4se lab template
Ai4se lab template
 
Automated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSUAutomated Software Enging, Fall 2015, NCSU
Automated Software Enging, Fall 2015, NCSU
 
Requirements Engineering
Requirements EngineeringRequirements Engineering
Requirements Engineering
 
172529main ken and_tim_software_assurance_research_at_west_virginia
172529main ken and_tim_software_assurance_research_at_west_virginia172529main ken and_tim_software_assurance_research_at_west_virginia
172529main ken and_tim_software_assurance_research_at_west_virginia
 
Automated Software Engineering
Automated Software EngineeringAutomated Software Engineering
Automated Software Engineering
 
Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)
 
Tim Menzies, directions in Data Science
Tim Menzies, directions in Data ScienceTim Menzies, directions in Data Science
Tim Menzies, directions in Data Science
 
Goldrush
GoldrushGoldrush
Goldrush
 
Dagstuhl14 intro-v1
Dagstuhl14 intro-v1Dagstuhl14 intro-v1
Dagstuhl14 intro-v1
 
Know thy tools
Know thy toolsKnow thy tools
Know thy tools
 
The Art and Science of Analyzing Software Data
The Art and Science of Analyzing Software DataThe Art and Science of Analyzing Software Data
The Art and Science of Analyzing Software Data
 

Recently uploaded

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Lecture 7: Definite Clause Grammars

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. CFG recognition using append/3 s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]). det([a]). n([man]). n([woman]). v([shoots]).
  • 20. CFG recognition using append/3 ?- s ([the,woman,shoots,a,man]). yes ?- s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]). det([a]). n([man]). n([woman]). v([shoots]).
  • 21. CFG recognition using append/3 ?- s (S). S = [the,man,shoots,the,man]; S = [the,man,shoots,the,woman]; S = [the,woman,shoots,a,man] … s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]). det([a]). n([man]). n([woman]). v([shoots]).
  • 22. CFG recognition using append/3 ?- np ([the,woman]). yes ?- np (X). X = [the,man]; X = [the,woman] s (C):- np(A), vp(B), append(A,B,C). np (C):- det(A), n(B), append(A,B,C). vp (C):- v(A), np(B), append(A,B,C). vp (C):- v(C). det([the]). det([a]). n([man]). n([woman]). v([shoots]).
  • 23.
  • 24.
  • 25. CFG recognition using difference lists s (A-C):- np(A-B), vp(B-C). np (A-C):- det(A-B), n(B-C). vp (A-C):- v(A-B), np(B-C). vp (A-C):- v(A-C). det([the|W]-W). det([a|W]-W). n([man|W]-W). n([woman|W]-W). v([shoots|W]-W).
  • 26. CFG recognition using difference lists ?- s ([the,man,shoots,a,man]-[ ]). yes ?- s (A-C):- np(A-B), vp(B-C). np (A-C):- det(A-B), n(B-C). vp (A-C):- v(A-B), np(B-C). vp (A-C):- v(A-C). det([the|W]-W). det([a|W]-W). n([man|W]-W). n([woman|W]-W). v([shoots|W]-W).
  • 27. CFG recognition using difference lists ?- s (X-[ ]). S = [the,man,shoots,the,man]; S = [the,man,shoots,a,man]; … . s (A-C):- np(A-B), vp(B-C). np (A-C):- det(A-B), n(B-C). vp (A-C):- v(A-B), np(B-C). vp (A-C):- v(A-C). det([the|W]-W). det([a|W]-W). n([man|W]-W). n([woman|W]-W). v([shoots|W]-W).
  • 28.
  • 29.
  • 30. DCGs: first example s --> np, vp. np --> det, n. vp --> v, np. vp --> v. det --> [the]. det --> [a]. n --> [man]. n --> [woman]. v --> [shoots].
  • 31. DCGs: first example ?- s ([a,man,shoots,a,woman],[ ]). yes ?- s --> np, vp. np --> det, n. vp --> v, np. vp --> v. det --> [the]. det --> [a]. n --> [man]. n --> [woman]. v --> [shoots].
  • 32. DCGs: first example ?- s (X,[ ]). S = [the,man,shoots,the,man]; S = [the,man,shoots,a,man]; … . s --> np, vp. np --> det, n. vp --> v, np. vp --> v. det --> [the]. det --> [a]. n --> [man]. n --> [woman]. v --> [shoots].
  • 33.
  • 34. DCG without left-recursive rules s --> simple _ s, conj, s. s --> simple _ s. simple _ s --> np, vp. np --> det, n. vp --> v, np. vp --> v. det --> [the]. det --> [a]. n --> [man]. n --> [woman]. v --> [shoots]. conj --> [and]. conj --> [or]. conj --> [but].
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.