SlideShare une entreprise Scribd logo
1  sur  14
Chapter 3 Lists , Operators and Arithmetic
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],Ex.1:[ann , tennis , tom ,   football]. Ex.2:[ann , X , sport(tennis) ,   [tom , skiing]].    ann: atom   X: variable   sport(tennis):structure with   functor sport / 1 argument.   [tom , skiing]:anther list.
[object Object],i.e.  :to represent it as a structure with  functor   .  , and  in binary tree  ( 2 - arguments ). ,[object Object],Where: Head: First argument object. Tail: The rest of objects. Functor Head Tail Two arguments
[object Object],. ann   . tennis  . tom   . football   [] .  (ann ,  .  (tennis ,  .  (tom ,  .  (football , [])))).
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
(1)  Membership  / 2 ,[object Object],object ,[object Object],[object Object],Means:  number of arguments are two list Yes object list member(a , [1 , b , c]) No
[object Object],(Fact) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],X = a; X = b; X = c; no
[object Object],member (X , Tail) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],Yes To satisfy member (X , [a , d]) It go to member(X , [X | _ ]) again and try to satisfy, but here at this time it is satisfied then it answers Stop  Practice
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Why?? Two lists ,[object Object],[object Object],[object Object],Concatenation  /3 Means :   three lists Conc of L1 , L2. The same [Head | Tail] empty X  L1  X  L3  L2
[object Object],[object Object],Answer: practical  Let us see ,[object Object],conc ([] , L , L). conc ([X | L1] , L2 , [X | L3]) :- conc (L1 , L2 , L3). ,[object Object],[object Object],[object Object],[object Object],[object Object],L1 =[a , b] L2 =[c]; L1 =[a , b ,c] L2 =[]; no Decomposition process. For a list into two lists
[object Object],[object Object],[object Object],Vip: ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Ch1 sets and_logic(1)
Ch1 sets and_logic(1)Ch1 sets and_logic(1)
Ch1 sets and_logic(1)
Kwonpyo Ko
 
Data structure lecture 4
Data structure lecture 4Data structure lecture 4
Data structure lecture 4
Kumar
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
a_akhavan
 
Combining like terms
Combining like termsCombining like terms
Combining like terms
gcahill10
 
2 1 Bzca5e
2 1 Bzca5e2 1 Bzca5e
2 1 Bzca5e
silvia
 
Day 1 examples u8f13
Day 1 examples u8f13Day 1 examples u8f13
Day 1 examples u8f13
jchartiersjsd
 
Day 1 examples u6w14
Day 1 examples u6w14Day 1 examples u6w14
Day 1 examples u6w14
jchartiersjsd
 

Tendances (20)

Ch1 sets and_logic(1)
Ch1 sets and_logic(1)Ch1 sets and_logic(1)
Ch1 sets and_logic(1)
 
Data structure lecture 4
Data structure lecture 4Data structure lecture 4
Data structure lecture 4
 
Set theory
Set theorySet theory
Set theory
 
Common symbols used in set theory
Common symbols used in set theoryCommon symbols used in set theory
Common symbols used in set theory
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
 
List , tuples, dictionaries and regular expressions in python
List , tuples, dictionaries and regular expressions in pythonList , tuples, dictionaries and regular expressions in python
List , tuples, dictionaries and regular expressions in python
 
Set Theory QA 3
Set Theory QA 3Set Theory QA 3
Set Theory QA 3
 
Ppt geo-d3-set operations
Ppt geo-d3-set operationsPpt geo-d3-set operations
Ppt geo-d3-set operations
 
Fundamental Theorem of Calculus
Fundamental Theorem of CalculusFundamental Theorem of Calculus
Fundamental Theorem of Calculus
 
Set
SetSet
Set
 
Python programming for Beginners - II
Python programming for Beginners - IIPython programming for Beginners - II
Python programming for Beginners - II
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
 
Groovy
GroovyGroovy
Groovy
 
Combining like terms
Combining like termsCombining like terms
Combining like terms
 
2 1 Bzca5e
2 1 Bzca5e2 1 Bzca5e
2 1 Bzca5e
 
Sets by navneet class 11
Sets by navneet class 11Sets by navneet class 11
Sets by navneet class 11
 
Day 1 examples u8f13
Day 1 examples u8f13Day 1 examples u8f13
Day 1 examples u8f13
 
Day 1 examples u6w14
Day 1 examples u6w14Day 1 examples u6w14
Day 1 examples u6w14
 
Hashing
HashingHashing
Hashing
 
Evaluating functions
Evaluating functionsEvaluating functions
Evaluating functions
 

Similaire à Section3 Prologppt

Prolog programming
Prolog programmingProlog programming
Prolog programming
Fraboni Ec
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
James Wong
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
David Hoen
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
Tony Nguyen
 

Similaire à Section3 Prologppt (20)

GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Prolog programming
Prolog programmingProlog programming
Prolog programming
 
Lists.pptx
Lists.pptxLists.pptx
Lists.pptx
 
python_avw - Unit-03.pdf
python_avw - Unit-03.pdfpython_avw - Unit-03.pdf
python_avw - Unit-03.pdf
 
List_tuple_dictionary.pptx
List_tuple_dictionary.pptxList_tuple_dictionary.pptx
List_tuple_dictionary.pptx
 
PrologListsGraphs.ppt
PrologListsGraphs.pptPrologListsGraphs.ppt
PrologListsGraphs.ppt
 
Pytho lists
Pytho listsPytho lists
Pytho lists
 
Python Lecture 8
Python Lecture 8Python Lecture 8
Python Lecture 8
 
PROLOG: Arithmetic Operations In Prolog
PROLOG: Arithmetic Operations In PrologPROLOG: Arithmetic Operations In Prolog
PROLOG: Arithmetic Operations In Prolog
 
Prolog: Arithmetic Operations In Prolog
Prolog: Arithmetic Operations In PrologProlog: Arithmetic Operations In Prolog
Prolog: Arithmetic Operations In Prolog
 
Python programming : List and tuples
Python programming : List and tuplesPython programming : List and tuples
Python programming : List and tuples
 
15CS664-Python Application Programming - Module 3 and 4
15CS664-Python Application Programming - Module 3 and 415CS664-Python Application Programming - Module 3 and 4
15CS664-Python Application Programming - Module 3 and 4
 
15CS664- Python Application Programming - Module 3
15CS664- Python Application Programming - Module 315CS664- Python Application Programming - Module 3
15CS664- Python Application Programming - Module 3
 
The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212The Ring programming language version 1.10 book - Part 30 of 212
The Ring programming language version 1.10 book - Part 30 of 212
 

Dernier

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (16)

Cricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdfCricket Api Solution.pdf
Cricket Api Solution.pdfCricket Api Solution.pdf
 
basketball evolution History Slides.pdf
basketball evolution  History Slides.pdfbasketball evolution  History Slides.pdf
basketball evolution History Slides.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call GirlsGenuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
Genuine 8617370543 Hot and Beautiful 💕 Etah Escorts call Girls
 
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
Belgium Vs Slovakia Belgium at Euro 2024 Teams in group, fixtures, schedule, ...
 
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennis
 
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics TradeTechnical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
 
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxSpain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar Chart
 
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docxSlovenia Vs Serbia Eurovision odds Slovenia have top.docx
Slovenia Vs Serbia Eurovision odds Slovenia have top.docx
 
Hire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
Hire 💕 8617370543 Amethi Call Girls Service Call Girls AgencyHire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
Hire 💕 8617370543 Amethi Call Girls Service Call Girls Agency
 
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docxAlbania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
Albania Vs Spain South American coaches lead Albania to Euro 2024 spot.docx
 
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
Italy vs Albania Italy Euro 2024 squad Luciano Spalletti's full team ahead of...
 
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdfJORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
JORNADA 6 LIGA MURO 2024TUXTEPECOAXACA.pdf
 
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdfCroatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
Croatia vs Italy Inter Milan Looking to Carry On Success at Euro 2024.pdf
 

Section3 Prologppt

  • 1. Chapter 3 Lists , Operators and Arithmetic
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.